From 993a18b27ddf40d786cb6d67def036d918196b3a Mon Sep 17 00:00:00 2001 From: joeransegnola <129192453+joeransegnola@users.noreply.github.com> Date: Thu, 11 Jul 2024 20:10:30 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20built-on?= =?UTF-8?q?-openfin/web-starter@3d8185ef5ff39c5b9966ec3e6ca62fb48bc93b24?= =?UTF-8?q?=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web-layout/common/style/app.css | 9 +++++- .../web-layout/js/fdc3-panel.bundle.js | 32 +++++++++---------- .../web-layout/js/fdc3-panel.bundle.js.map | 2 +- .../web-layout/js/fdc3-view.bundle.js | 32 +++++++++---------- .../web-layout/js/fdc3-view.bundle.js.map | 2 +- .../web-layout/js/iframe-broker.bundle.js | 12 +++---- .../web-layout/js/iframe-broker.bundle.js.map | 2 +- .../web-layout/js/interop-view.bundle.js | 32 +++++++++---------- .../web-layout/js/interop-view.bundle.js.map | 2 +- .../web-layout/js/provider.bundle.js | 32 +++++++++---------- .../web-layout/js/provider.bundle.js.map | 2 +- .../web-layout/js/shared-worker.bundle.js | 2 +- .../layouts/secondary.layout.fin.json | 6 ++-- .../web-layout/platform/provider.html | 4 +-- 14 files changed, 90 insertions(+), 81 deletions(-) diff --git a/dev/joe/add-remove-layouts/web-layout/common/style/app.css b/dev/joe/add-remove-layouts/web-layout/common/style/app.css index 4cc9c0a..4bfaf1c 100644 --- a/dev/joe/add-remove-layouts/web-layout/common/style/app.css +++ b/dev/joe/add-remove-layouts/web-layout/common/style/app.css @@ -969,4 +969,11 @@ td, content: var(--tab-close-button-url); color: var(--brand-text-secondary); cursor: pointer; -} \ No newline at end of file +} + +.main-container { + display: flex; + justify-content: stretch; + align-items: stretch; + /* overflow: hidden; */ +} diff --git a/dev/joe/add-remove-layouts/web-layout/js/fdc3-panel.bundle.js b/dev/joe/add-remove-layouts/web-layout/js/fdc3-panel.bundle.js index df469a4..8accd90 100644 --- a/dev/joe/add-remove-layouts/web-layout/js/fdc3-panel.bundle.js +++ b/dev/joe/add-remove-layouts/web-layout/js/fdc3-panel.bundle.js @@ -1,38 +1,38 @@ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ -/***/ "../../node_modules/@openfin/core-web/out/api-client.js": -/*!**************************************************************!*\ - !*** ../../node_modules/@openfin/core-web/out/api-client.js ***! - \**************************************************************/ +/***/ "./node_modules/@openfin/core-web/out/api-client.js": +/*!**********************************************************!*\ + !*** ./node_modules/@openfin/core-web/out/api-client.js ***! + \**********************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -var e=__webpack_require__(/*! ./main-48131439.js */ "../../node_modules/@openfin/core-web/out/main-48131439.js");__webpack_require__(/*! buffer/ */ "../../node_modules/buffer/index.js"),__webpack_require__(/*! uuid */ "../../node_modules/uuid/dist/esm-browser/index.js"),__webpack_require__(/*! events */ "../../node_modules/events/events.js"),__webpack_require__(/*! lodash */ "../../node_modules/lodash/lodash.js"),exports.connect=e.connect; +var e=__webpack_require__(/*! ./main-efd674f2.js */ "./node_modules/@openfin/core-web/out/main-efd674f2.js");__webpack_require__(/*! buffer/ */ "../../node_modules/buffer/index.js"),__webpack_require__(/*! uuid */ "../../node_modules/uuid/dist/esm-browser/index.js"),__webpack_require__(/*! events */ "../../node_modules/events/events.js"),__webpack_require__(/*! lodash */ "../../node_modules/lodash/lodash.js"),exports.connect=e.connect; /***/ }), -/***/ "../../node_modules/@openfin/core-web/out/main-48131439.js": -/*!*****************************************************************!*\ - !*** ../../node_modules/@openfin/core-web/out/main-48131439.js ***! - \*****************************************************************/ +/***/ "./node_modules/@openfin/core-web/out/main-8d24addc.js": +/*!*************************************************************!*\ + !*** ./node_modules/@openfin/core-web/out/main-8d24addc.js ***! + \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -var e=__webpack_require__(/*! buffer/ */ "../../node_modules/buffer/index.js"),t=__webpack_require__(/*! events */ "../../node_modules/events/events.js"),n=__webpack_require__(/*! lodash */ "../../node_modules/lodash/lodash.js"),i=__webpack_require__(/*! uuid */ "../../node_modules/uuid/dist/esm-browser/index.js");const r=(e,t)=>`${t}<${btoa(JSON.stringify(e))}>`;var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof __webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self?self:{},s={},a={},c={},d={};async function h(e){const t=[];for(const n of e){const e=await n();t.push(e)}return t}Object.defineProperty(d,"__esModule",{value:!0}),d.promiseMapSerial=d.serial=d.promiseMap=d.promisify=void 0,d.promisify=function(e){return(...t)=>new Promise(((n,i)=>{e(...t,((e,t)=>e?i(e):n(t)))}))},d.promiseMap=async function(e,t){return Promise.all(e.map(t))},d.serial=h,d.promiseMapSerial=async function(e,t){return h(e.map(((e,n,i)=>()=>t(e,n,i))))};var l,u=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},p=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(c,"__esModule",{value:!0}),c.Reply=c.EmitterBase=c.Base=void 0;const w=d;class y{constructor(e){this.isNodeEnvironment=()=>"node"===this.wire.environment.type,this.isOpenFinEnvironment=()=>"openfin"===this.wire.environment.type,this.isBrowserEnvironment=()=>"other"===this.wire.environment.type,this.wire=e}get fin(){return this.wire.getFin()}get me(){return this.wire.me}}c.Base=y;c.EmitterBase=class extends y{constructor(e,t,...n){super(e),this.topic=t,l.set(this,void 0),this.eventNames=()=>this.hasEmitter()?this.getOrCreateEmitter().eventNames():[],this.emit=(e,t,...n)=>!!this.hasEmitter()&&this.getOrCreateEmitter().emit(e,t,...n),this.hasEmitter=()=>this.wire.eventAggregator.has(p(this,l,"f")),this.getOrCreateEmitter=()=>this.wire.eventAggregator.getOrCreate(p(this,l,"f")),this.listeners=e=>this.hasEmitter()?this.getOrCreateEmitter().listeners(e):[],this.listenerCount=e=>this.hasEmitter()?this.getOrCreateEmitter().listenerCount(e):0,this.registerEventListener=async(e,t={},n,i)=>{const r={...this.identity,timestamp:t.timestamp||Date.now(),topic:this.topic,type:e},o=this.getOrCreateEmitter();n(o);try{await this.wire.sendAction("subscribe-to-desktop-event",r)}catch(e){throw i(o),this.deleteEmitterIfNothingRegistered(o),e}},this.deregisterEventListener=async(e,t={})=>{if(this.hasEmitter()){const n={...this.identity,timestamp:t.timestamp||Date.now(),topic:this.topic,type:e};await this.wire.sendAction("unsubscribe-to-desktop-event",n).catch((()=>null));return this.getOrCreateEmitter()}return Promise.resolve()},u(this,l,[t,...n],"f"),this.listeners=e=>this.hasEmitter()?this.getOrCreateEmitter().listeners(e):[]}async on(e,t,n){return await this.registerEventListener(e,n,(n=>{n.on(e,t)}),(n=>{n.removeListener(e,t)})),this}async addListener(e,t,n){return this.on(e,t,n)}async once(e,t,n){const i=()=>this.deregisterEventListener(e);return await this.registerEventListener(e,n,(n=>{n.once(e,i),n.once(e,t)}),(n=>{n.removeListener(e,i),n.removeListener(e,t)})),this}async prependListener(e,t,n){return await this.registerEventListener(e,n,(n=>{n.prependListener(e,t)}),(n=>{n.removeListener(e,t)})),this}async prependOnceListener(e,t,n){const i=()=>this.deregisterEventListener(e);return await this.registerEventListener(e,n,(n=>{n.prependOnceListener(e,t),n.once(e,i)}),(n=>{n.removeListener(e,t),n.removeListener(e,i)})),this}async removeListener(e,t,n){const i=await this.deregisterEventListener(e,n);return i&&(i.removeListener(e,t),this.deleteEmitterIfNothingRegistered(i)),this}async deregisterAllListeners(e){const t={...this.identity,type:e,topic:this.topic};if(this.hasEmitter()){const e=this.getOrCreateEmitter(),n=e.listenerCount(t.type),i=[];for(let e=0;enull)));return await Promise.all(i),e}}async removeAllListeners(e){const t=async e=>{const t=await this.deregisterAllListeners(e);t&&(t.removeAllListeners(e),this.deleteEmitterIfNothingRegistered(t))};if(e)await t(e);else if(this.hasEmitter()){const e=this.getOrCreateEmitter().eventNames();await(0,w.promiseMap)(e,t)}return this}deleteEmitterIfNothingRegistered(e){0===e.eventNames().length&&this.wire.eventAggregator.delete(p(this,l,"f"))}},l=new WeakMap;c.Reply=class{};var f={};Object.defineProperty(f,"__esModule",{value:!0});var g=f.RuntimeError=f.NotSupportedError=f.NotImplementedError=f.NoAckError=f.DuplicateCorrelationError=f.UnexpectedActionError=f.DisconnectedError=void 0;class m extends Error{constructor(e){super(`Expected websocket state OPEN but found ${e}`),this.readyState=e}}f.DisconnectedError=m;class v extends Error{}f.UnexpectedActionError=v;class C extends Error{}f.DuplicateCorrelationError=C;class b extends Error{}f.NoAckError=b;class I extends Error{}f.NotImplementedError=I;class E extends Error{}f.NotSupportedError=E;class x extends Error{constructor(e){const{message:t,name:n,stack:i,...r}=e;super(t),this.name=n||"Error",this.stack=i??this.toString(),Object.keys(r).forEach((e=>{this[e]=r[e]}))}}class A extends Error{static getCallSite(e=0){const t=Error.stackTraceLimit,n=e+1;Error.stackTraceLimit=t+n;const i=Error.prepareStackTrace;Error.prepareStackTrace=(e,t)=>t;const r=(new Error).stack?.slice(n)??[];return Error.prepareStackTrace=i,Error.stackTraceLimit=t,r}static prepareStackTrace(e,t){if("function"==typeof Error.prepareStackTrace)return Error.prepareStackTrace(e,t);let n="";n+=e.name||"Error",n+=`: ${e.message||""}`;for(const e of t)n+=`\n at ${e.toString()}`;return n}constructor(e,t){const{reason:n,error:i}=e;super(n),this.name="RuntimeError",i?.stack&&(this.cause=new x(i)),t&&(this.stack=A.prepareStackTrace(this,t))}}g=f.RuntimeError=A;var P={},M={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.validateIdentity=void 0,O.validateIdentity=function(e){let t;return"object"==typeof e&&"string"==typeof e.uuid||(t="Not a valid identity object"),t};var _={},S={},R={},F={},j={},k={},L={};Object.defineProperty(L,"__esModule",{value:!0}),L.handleDeprecatedWarnings=void 0;var T;L.handleDeprecatedWarnings=e=>{(e.contentNavigation?.whitelist||e.contentNavigation?.blacklist||e.contentRedirect?.whitelist||e.contentRedirect?.blacklist)&&console.warn("The properties 'whitelist' and 'blacklist' have been marked as deprecated and will be removed in a future version. Please use 'allowlist' and 'denylist'.")};var $={},B={};Object.defineProperty(B,"__esModule",{value:!0}),B.AsyncRetryableLazy=G=B.Lazy=void 0;var G=B.Lazy=class{constructor(e){this.producerFn=e}getValue(){return this.value||(this.value=this.producerFn()),this.value}};B.AsyncRetryableLazy=class{constructor(e){this.producerFn=e}async getValue(){return this.promise||(this.promise=this.producerFn().catch((e=>{throw delete this.promise,e}))),this.promise}};var W={},H={},N={};Object.defineProperty(N,"__esModule",{value:!0}),N.ApiConsumer=void 0;N.ApiConsumer=class{constructor(e){this.strategy=e,this.consume=async e=>(await this.strategy.getExposedFunctions(e)).reduce(((t,n)=>({...t,[n.key]:this.strategy.createFunction(n,e)})),{})}};var D={},U={};Object.defineProperty(U,"__esModule",{value:!0}),U.expose=U.getExposedProperties=void 0;const V=Symbol("exposedProperties");U.getExposedProperties=e=>e[V]||e.prototype[V]||[];U.expose=e=>(t,n,i)=>{t[V]=t[V]||[],t[V].push({key:n,descriptor:i,options:e})},Object.defineProperty(D,"__esModule",{value:!0}),D.ApiExposer=void 0;const z=U;D.ApiExposer=class{constructor(e){this.strategy=e,this.exposeInstance=async(e,t)=>{const n=(0,z.getExposedProperties)(e),i=await Promise.all(n.map((async({key:n,options:i})=>({key:n,options:await this.strategy.exposeFunction(e[n].bind(e),{key:n,options:i,meta:t})}))));await this.strategy.exposeMeta(t,i)}}};var K={},q={},Y={};Object.defineProperty(Y,"__esModule",{value:!0}),Y.ChannelsConsumer=void 0;Y.ChannelsConsumer=class{constructor(e){this.channel=e,this.getExposedFunctions=async e=>{const{id:t}=e,{props:n}=await this.channel.dispatch(`api-meta:${t}`);return n},this.createFunction=e=>(...t)=>{const{action:n}=e.options;return this.channel.dispatch(n,{args:t})}}};var J={};Object.defineProperty(J,"__esModule",{value:!0}),J.ChannelsExposer=void 0;J.ChannelsExposer=class{constructor(e){this.channelProviderOrClient=e,this.exposeFunction=async(e,t)=>{const{key:n,options:i,meta:r}=t,{id:o}=r,s=`${o}.${i?.action||n}`;return await this.channelProviderOrClient.register(s,(async({args:t})=>e(...t))),{action:s}},this.exposeMeta=async({id:e},t)=>{const n=`api-meta:${e}`;await this.channelProviderOrClient.register(n,(()=>({props:t})))}}},function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Y,e),n(J,e)}(q),function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(q,e)}(K),function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(N,e),n(D,e),n(K,e),n(U,e)}(H);var Z={};Object.defineProperty(Z,"__esModule",{value:!0}),Z.createRelayedDispatch=Z.relayChannelClientApi=void 0;const Q=["no longer connected","RTCDataChannel closed unexpectedly","The client you are trying to dispatch from is disconnected from the target provider"];Z.relayChannelClientApi=async(e,t)=>{e.register(`relay:${t}`,(({action:t,target:n,payload:i})=>e.dispatch(n,t,i))),await Promise.resolve()};Z.createRelayedDispatch=(e,t,n,i)=>async(r,o)=>{try{return await e.dispatch(`relay:${n}`,{action:r,payload:o,target:t})}catch(e){if(s=e.message,Q.some((e=>s.includes(e)))&&i)throw new Error(i);throw e}var s};var X,ee,te,ne=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},ie=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(W,"__esModule",{value:!0}),W.ColumnOrRow=W.TabStack=W.LayoutNode=void 0;const re=H,oe=Z;class se{constructor(e,t){X.set(this,void 0),this.isRoot=()=>ie(this,X,"f").isRoot(this.entityId),this.exists=()=>ie(this,X,"f").exists(this.entityId),this.getParent=async()=>{const e=await ie(this,X,"f").getParent(this.entityId);if(e)return se.getEntity(e,ie(this,X,"f"))},this.createAdjacentStack=async(e,t)=>{const n=await ie(this,X,"f").createAdjacentStack(this.entityId,e,t);return se.getEntity({entityId:n,type:"stack"},ie(this,X,"f"))},this.getAdjacentStacks=async e=>(await ie(this,X,"f").getAdjacentStacks({targetId:this.entityId,edge:e})).map((e=>se.getEntity({type:"stack",entityId:e.entityId},ie(this,X,"f")))),ne(this,X,e,"f"),this.entityId=t}}W.LayoutNode=se,X=new WeakMap,se.newLayoutEntitiesClient=async(e,t,n)=>{const i=(0,oe.createRelayedDispatch)(e,n,"layout-relay","You are trying to interact with a layout component on a window that does not exist or has been destroyed.");return new re.ApiConsumer(new re.ChannelsConsumer({dispatch:i})).consume({id:t})},se.getEntity=(e,t)=>{const{entityId:n,type:i}=e;switch(i){case"column":case"row":return new ce(t,n,i);case"stack":return new ae(t,n);default:throw new Error(`Unrecognised Layout Entity encountered ('${JSON.stringify(e)})`)}};class ae extends se{constructor(e,t){super(e,t),ee.set(this,void 0),this.type="stack",this.getViews=()=>ie(this,ee,"f").getStackViews(this.entityId),this.addView=async(e,t={index:0})=>ie(this,ee,"f").addViewToStack(this.entityId,e,t),this.removeView=async e=>{await ie(this,ee,"f").removeViewFromStack(this.entityId,e)},this.setActiveView=async e=>{await ie(this,ee,"f").setStackActiveView(this.entityId,e)},ne(this,ee,e,"f")}}W.TabStack=ae,ee=new WeakMap;class ce extends se{constructor(e,t,n){super(e,t),te.set(this,void 0),this.getContent=async()=>(await ie(this,te,"f").getContent(this.entityId)).map((e=>se.getEntity(e,ie(this,te,"f")))),ne(this,te,e,"f"),this.type=n}}W.ColumnOrRow=ce,te=new WeakMap;var de={};Object.defineProperty(de,"__esModule",{value:!0}),de.DEFAULT_LAYOUT_KEY=de.LAYOUT_CONTROLLER_ID=void 0,de.LAYOUT_CONTROLLER_ID="layout-entities",de.DEFAULT_LAYOUT_KEY="__default__";var he={};Object.defineProperty(he,"__esModule",{value:!0}),he.WebContents=void 0;const le=c;class ue extends le.EmitterBase{constructor(e,t,n){super(e,n,t.uuid,t.name),this.identity=t,this.entityType=n}capturePage(e){return this.wire.sendAction("capture-page",{options:e,...this.identity}).then((({payload:e})=>e.data))}executeJavaScript(e){return this.wire.sendAction("execute-javascript-in-window",{...this.identity,code:e}).then((({payload:e})=>e.data))}getZoomLevel(){return this.wire.sendAction("get-zoom-level",this.identity).then((({payload:e})=>e.data))}setZoomLevel(e){return this.wire.sendAction("set-zoom-level",{...this.identity,level:e}).then((()=>{}))}navigate(e){return this.wire.sendAction("navigate-window",{...this.identity,url:e}).then((()=>{}))}navigateBack(){return this.wire.sendAction("navigate-window-back",{...this.identity}).then((()=>{}))}async navigateForward(){await this.wire.sendAction("navigate-window-forward",{...this.identity})}stopNavigation(){return this.wire.sendAction("stop-window-navigation",{...this.identity}).then((()=>{}))}reload(e=!1){return this.wire.sendAction("reload-window",{ignoreCache:e,...this.identity}).then((()=>{}))}print(e={}){return this.wire.sendAction("print",{...this.identity,options:e}).then((()=>{}))}findInPage(e,t){return this.wire.sendAction("find-in-page",{...this.identity,searchTerm:e,options:t}).then((({payload:e})=>e.data))}stopFindInPage(e){return this.wire.sendAction("stop-find-in-page",{...this.identity,action:e}).then((()=>{}))}getPrinters(){return this.wire.sendAction("get-printers",{...this.identity}).then((({payload:e})=>e.data))}async focus({emitSynthFocused:e}={emitSynthFocused:!0}){await this.wire.sendAction("focus-window",{emitSynthFocused:e,...this.identity})}async showDeveloperTools(){await this.wire.sendAction("show-developer-tools",this.identity)}async getProcessInfo(){const{payload:{data:e}}=await this.wire.sendAction("get-process-info",this.identity);return e}async getSharedWorkers(){return this.wire.sendAction("get-shared-workers",this.identity).then((({payload:e})=>e.data))}async inspectSharedWorker(){await this.wire.sendAction("inspect-shared-worker",{...this.identity})}async inspectSharedWorkerById(e){await this.wire.sendAction("inspect-shared-worker-by-id",{...this.identity,workerId:e})}async inspectServiceWorker(){await this.wire.sendAction("inspect-service-worker",{...this.identity})}async showPopupWindow(e){if(this.wire.sendAction(`${this.entityType}-show-popup-window`,this.identity).catch((()=>{})),e?.onPopupReady){const t=async({popupName:t})=>{try{const n=this.fin.Window.wrapSync({uuid:this.fin.me.uuid,name:t});await e.onPopupReady(n)}catch(e){throw new Error(`Something went wrong during onPopupReady execution: ${e}`)}};await this.once("popup-ready",t)}const{payload:t}=await this.wire.sendAction("try-create-popup-window",{options:{...e,hasResultCallback:!!e?.onPopupResult,hasReadyCallback:!!e?.onPopupReady},...this.identity}),{data:{willOpen:n,options:i}}=t;n&&await this.fin.Window.create(i.initialOptions);if(e?.onPopupResult){const t=async t=>{await e.onPopupResult((e=>{const{name:t,uuid:n,result:i,data:r}=e,o={identity:{name:t,uuid:n},result:i};return r&&(o.data=r),o})(t))},n=async()=>{await this.removeListener("popup-result",t)};await this.on("popup-result",t),await this.once("popup-teardown",n)}const{payload:r}=await this.wire.sendAction("show-popup-window",{options:i,...this.identity});return r.data}}var pe,we,ye,fe,ge;function me(){return we||(we=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(function(){if(T)return k;T=1,Object.defineProperty(k,"__esModule",{value:!0}),k.ViewModule=void 0;const e=c,t=O,n=me(),i=L;class r extends e.Base{async create(e){const{uuid:t}=this.wire.me;if(!e.name||"string"!=typeof e.name)throw new Error("Please provide a name property as a string in order to create a View.");return(0,i.handleDeprecatedWarnings)(e),this.wire.environment.childViews?await this.wire.environment.createChildContent({entityType:"view",options:{...e,uuid:t}}):await this.wire.sendAction("create-view",{...e,uuid:t}),this.wrapSync({uuid:t,name:e.name})}async wrap(e){this.wire.sendAction("view-wrap");const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.View(this.wire,e)}wrapSync(e){this.wire.sendAction("view-wrap-sync").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.View(this.wire,e)}getCurrent(){if(this.wire.sendAction("view-get-current").catch((e=>{})),!this.wire.me.isView)throw new Error("You are not in a View context");const{uuid:e,name:t}=this.wire.me;return this.wrap({uuid:e,name:t})}getCurrentSync(){if(this.wire.sendAction("view-get-current-sync").catch((e=>{})),!this.wire.me.isView)throw new Error("You are not in a View context");const{uuid:e,name:t}=this.wire.me;return this.wrapSync({uuid:e,name:t})}}return k.ViewModule=r,k}(),e),n(function(){if(pe)return $;pe=1;var e,t=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty($,"__esModule",{value:!0}),$.View=void 0;const n=f,i=B,r=W,s=de,a=he,c=Pe();class d extends a.WebContents{constructor(o,a){super(o,a,"view"),this.identity=a,e.set(this,new i.Lazy((()=>this.fin.Platform.wrapSync(this.identity).getClient()))),this.attach=async e=>{await this.wire.sendAction("attach-view",{target:e,...this.identity})},this.destroy=async()=>{await this.wire.sendAction("destroy-view",{...this.identity})},this.show=async()=>{await this.wire.sendAction("show-view",{...this.identity})},this.showAt=async e=>{await this.wire.sendAction("show-view-at",{bounds:e,...this.identity})},this.hide=async()=>{await this.wire.sendAction("hide-view",{...this.identity})},this.setBounds=async e=>{await this.wire.sendAction("set-view-bounds",{bounds:e,...this.identity})},this.getBounds=async()=>(await this.wire.sendAction("get-view-bounds",{...this.identity})).payload.data,this.getInfo=async()=>(await this.wire.sendAction("get-view-info",{...this.identity})).payload.data,this.getParentLayout=async()=>{this.wire.sendAction("view-get-parent-layout",{...this.identity}).catch((()=>{}));const n=await this.getCurrentWindow();try{const i=await t(this,e,"f").getValue(),o=await r.LayoutNode.newLayoutEntitiesClient(i,s.LAYOUT_CONTROLLER_ID,n.identity),a=await o.getLayoutIdentityForViewOrThrow(this.identity);return this.fin.Platform.Layout.wrap(a)}catch(e){if(!["No action registered at target for","getLayoutIdentityForViewOrThrow is not a function"].some((t=>e.message.includes(t))))throw e;return this.fin.Platform.Layout.wrap(n.identity)}},this.getOptions=async()=>this.wire.sendAction("get-view-options",{...this.identity}).then((({payload:e})=>e.data)),this.updateOptions=async e=>this.wire.sendAction("update-view-options",{options:e,...this.identity}).then((()=>{})),this.getCurrentWindow=async()=>{const{payload:{data:e}}=await this.wire.sendAction("get-view-window",{...this.identity});return new c._Window(this.wire,e)},this.getCurrentStack=async()=>{this.wire.sendAction("view-get-current-stack").catch((()=>{}));try{const n=await this.getCurrentWindow(),i=await t(this,e,"f").getValue(),o=await r.LayoutNode.newLayoutEntitiesClient(i,s.LAYOUT_CONTROLLER_ID,n.identity),a=await o.getStackByView(this.identity);return r.LayoutNode.getEntity(a,o)}catch(e){throw new n.RuntimeError({reason:"This view does not belong to a stack.",error:e})}},this.triggerBeforeUnload=async()=>(await this.wire.sendAction("trigger-before-unload",{...this.identity})).payload.data,this.bindToElement=async e=>{if(!e)throw new Error("Element not found.");return this.wire.environment.observeBounds(e,(async e=>this.setBounds(e)))}}async focus({emitSynthFocused:e}={emitSynthFocused:!0}){const t=await this.getCurrentWindow();await t.focusedWebViewWasChanged(),await super.focus({emitSynthFocused:e})}}return $.View=d,e=new WeakMap,$}(),e)}(j)),j}function ve(){if(ye)return F;ye=1,Object.defineProperty(F,"__esModule",{value:!0}),F.Application=void 0;const e=c,t=Pe(),n=me();class i extends e.EmitterBase{constructor(e,n){super(e,"application",n.uuid),this.identity=n,this.window=new t._Window(this.wire,{uuid:this.identity.uuid,name:this.identity.uuid})}windowListFromIdentityList(e){const n=[];return e.forEach((e=>{n.push(new t._Window(this.wire,{uuid:e.uuid,name:e.name}))})),n}isRunning(){return this.wire.sendAction("is-application-running",this.identity).then((({payload:e})=>e.data))}async quit(e=!1){try{await this._close(e),await this.wire.sendAction("destroy-application",{force:e,...this.identity})}catch(e){if(!["Remote connection has closed","Could not locate the requested application"].some((t=>e.message.includes(t))))throw e}}async _close(e=!1){try{await this.wire.sendAction("close-application",{force:e,...this.identity})}catch(e){if(!e.message.includes("Remote connection has closed"))throw e}}close(e=!1){return console.warn("Deprecation Warning: Application.close is deprecated Please use Application.quit"),this.wire.sendAction("application-close",this.identity).catch((e=>{})),this._close(e)}getChildWindows(){return this.wire.sendAction("get-child-windows",this.identity).then((({payload:e})=>{const t=[];return e.data.forEach((e=>{t.push({uuid:this.identity.uuid,name:e})})),this.windowListFromIdentityList(t)}))}getManifest(){return this.wire.sendAction("get-application-manifest",this.identity).then((({payload:e})=>e.data))}getParentUuid(){return this.wire.sendAction("get-parent-application",this.identity).then((({payload:e})=>e.data))}getShortcuts(){return this.wire.sendAction("get-shortcuts",this.identity).then((({payload:e})=>e.data))}async getViews(){const{payload:e}=await this.wire.sendAction("application-get-views",this.identity);return e.data.map((e=>new n.View(this.wire,e)))}getZoomLevel(){return this.wire.sendAction("get-application-zoom-level",this.identity).then((({payload:e})=>e.data))}getWindow(){return this.wire.sendAction("application-get-window",this.identity).catch((e=>{})),Promise.resolve(this.window)}registerUser(e,t){return this.wire.sendAction("register-user",{userName:e,appName:t,...this.identity}).then((()=>{}))}removeTrayIcon(){return this.wire.sendAction("remove-tray-icon",this.identity).then((()=>{}))}restart(){return this.wire.sendAction("restart-application",this.identity).then((()=>{}))}run(){return console.warn("Deprecation Warning: Application.run is deprecated Please use fin.Application.start"),this.wire.sendAction("application-run",this.identity).catch((e=>{})),this._run()}_run(e={}){return this.wire.sendAction("run-application",{manifestUrl:this._manifestUrl,opts:e,...this.identity}).then((()=>{}))}scheduleRestart(){return this.wire.sendAction("relaunch-on-close",this.identity).then((()=>{}))}async sendApplicationLog(){const{payload:e}=await this.wire.sendAction("send-application-log",this.identity);return e.data}async setJumpList(e){await this.wire.sendAction("set-jump-list",{config:e,...this.identity})}setTrayIcon(e){return this.wire.sendAction("set-tray-icon",{enabledIcon:e,...this.identity}).then((()=>{}))}setShortcuts(e){return this.wire.sendAction("set-shortcuts",{data:e,...this.identity}).then((()=>{}))}async setShortcutQueryParams(e){await this.wire.sendAction("set-shortcut-query-args",{data:e,...this.identity})}setZoomLevel(e){return this.wire.sendAction("set-application-zoom-level",{level:e,...this.identity}).then((()=>{}))}async setAppLogUsername(e){await this.wire.sendAction("set-app-log-username",{data:e,...this.identity})}getTrayIconInfo(){return this.wire.sendAction("get-tray-icon-info",this.identity).then((({payload:e})=>e.data))}hasTrayIcon(){return this.wire.sendAction("has-tray-icon",this.identity).then((({payload:e})=>e.data))}terminate(){return this.wire.sendAction("terminate-application",this.identity).then((()=>{}))}wait(){return this.wire.sendAction("wait-for-hung-application",this.identity).then((()=>{}))}getInfo(){return this.wire.sendAction("get-info",this.identity).then((({payload:e})=>e.data))}async getProcessInfo(){const{payload:{data:e}}=await this.wire.sendAction("application-get-process-info",this.identity);return e}async setFileDownloadLocation(e){const{name:t}=this.wire.me,n={uuid:this.identity.uuid,name:t};await this.wire.sendAction("set-file-download-location",{...n,downloadLocation:e})}async getFileDownloadLocation(){const{payload:{data:e}}=await this.wire.sendAction("get-file-download-location",this.identity);return e}async showTrayIconPopupMenu(e){const{name:t}=this.wire.me,n={uuid:this.identity.uuid,name:t},{payload:i}=await this.wire.sendAction("show-tray-icon-popup-menu",{...n,options:e});return i.data}async closeTrayIconPopupMenu(){const{name:e}=this.wire.me,t={uuid:this.identity.uuid,name:e};await this.wire.sendAction("close-tray-icon-popup-menu",{...t})}}return F.Application=i,F}function Ce(){return ge||(ge=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(function(){if(fe)return R;fe=1,Object.defineProperty(R,"__esModule",{value:!0}),R.ApplicationModule=void 0;const e=c,t=O,n=ve();class i extends e.Base{async wrap(e){this.wire.sendAction("wrap-application").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.Application(this.wire,e)}wrapSync(e){this.wire.sendAction("wrap-application-sync").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.Application(this.wire,e)}async _create(e){return void 0===e.waitForPageLoad&&(e.waitForPageLoad=!1),void 0===e.autoShow&&void 0===e.isPlatformController&&(e.autoShow=!0),await this.wire.sendAction("create-application",e),this.wrap({uuid:e.uuid})}create(e){return console.warn("Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start"),this.wire.sendAction("application-create").catch((e=>{})),this._create(e)}async start(e){this.wire.sendAction("start-application").catch((e=>{}));const t=await this._create(e);return await this.wire.sendAction("run-application",{uuid:e.uuid}),t}async startManyManifests(e,t){return this.wire.sendAction("run-applications",{applications:e,opts:t}).then((()=>{}))}getCurrent(){return this.wire.sendAction("get-current-application").catch((e=>{})),this.wrap({uuid:this.wire.me.uuid})}getCurrentSync(){return this.wire.sendAction("get-current-application-sync").catch((e=>{})),this.wrapSync({uuid:this.wire.me.uuid})}async startFromManifest(e,t){this.wire.sendAction("application-start-from-manifest").catch((e=>{}));const n=await this._createFromManifest(e);return await n._run(t),n}createFromManifest(e){return console.warn("Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest"),this.wire.sendAction("application-create-from-manifest").catch((e=>{})),this._createFromManifest(e)}_createFromManifest(e){return this.wire.sendAction("get-application-manifest",{manifestUrl:e}).then((({payload:e})=>{const t=e.data.platform?e.data.platform.uuid:e.data.startup_app.uuid;return this.wrap({uuid:t})})).then((t=>(t._manifestUrl=e,t)))}}return R.ApplicationModule=i,R}(),e),n(ve(),e)}(S)),S}he.WebContents=ue;var be={};Object.defineProperty(be,"__esModule",{value:!0}),be.promisifySubscription=void 0;var Ie,Ee,xe;function Ae(){if(Ie)return _;Ie=1,Object.defineProperty(_,"__esModule",{value:!0}),_._Window=void 0;const e=Ce(),t=he,n=me(),i=L,r=be;class o extends t.WebContents{constructor(e,t){super(e,t,"window")}async createWindow(e){this.wire.sendAction("window-create-window",this.identity).catch((e=>{}));const t=await(0,r.promisifySubscription)(this,"fire-constructor-callback");void 0===e.waitForPageLoad&&(e.waitForPageLoad=!1),void 0===e.autoShow&&(e.autoShow=!0),(0,i.handleDeprecatedWarnings)(e);const n=this.wire.environment.createChildContent({entityType:"window",options:e}),[o]=await Promise.all([t.getValue(),n]);let s;const{success:a}=o,c=o.data,{message:d}=c;s=a?{httpResponseCode:c.httpResponseCode,apiInjected:c.apiInjected}:{message:c.message,networkErrorCode:c.networkErrorCode,stack:c.stack};const h={message:d,cbPayload:s,success:a};try{this.getWebWindow().fin.__internal_.openerSuccessCBCalled()}catch(e){}return h.success?this:Promise.reject(h)}getAllFrames(){return this.wire.sendAction("get-all-frames",this.identity).then((({payload:e})=>e.data))}getBounds(){return this.wire.sendAction("get-window-bounds",this.identity).then((({payload:e})=>e.data))}center(){return this.wire.sendAction("center-window",this.identity).then((()=>{}))}blur(){return this.wire.sendAction("blur-window",this.identity).then((()=>{}))}bringToFront(){return this.wire.sendAction("bring-window-to-front",this.identity).then((()=>{}))}animate(e,t){return this.wire.sendAction("animate-window",{transitions:e,options:t,...this.identity}).then((()=>{}))}hide(){return this.wire.sendAction("hide-window",this.identity).then((()=>{}))}close(e=!1){return this.wire.sendAction("close-window",{force:e,...this.identity}).then((()=>{Object.setPrototypeOf(this,null)}))}focusedWebViewWasChanged(){return this.wire.sendAction("focused-webview-changed",this.identity).then((()=>{}))}getNativeId(){return this.wire.sendAction("get-window-native-id",this.identity).then((({payload:e})=>e.data))}async getCurrentViews(){const{payload:e}=await this.wire.sendAction("window-get-views",this.identity);return e.data.map((e=>new n.View(this.wire,e)))}disableFrame(){return console.warn("Function is deprecated; use disableUserMovement instead."),this.wire.sendAction("disable-window-frame",this.identity).then((()=>{}))}disableUserMovement(){return this.wire.sendAction("disable-window-frame",this.identity).then((()=>{}))}enableFrame(){return console.warn("Function is deprecated; use enableUserMovement instead."),this.wire.sendAction("enable-window-frame",this.identity).then((()=>{}))}enableUserMovement(){return this.wire.sendAction("enable-window-frame",this.identity).then((()=>{}))}flash(){return this.wire.sendAction("flash-window",this.identity).then((()=>{}))}stopFlashing(){return this.wire.sendAction("stop-flash-window",this.identity).then((()=>{}))}getInfo(){return this.wire.sendAction("get-window-info",this.identity).then((({payload:e})=>e.data))}async getLayout(e){this.wire.sendAction("window-get-layout",this.identity).catch((e=>{}));const t=await this.getOptions();if(!t.layout||!t.layoutSnapshot)throw new Error("Window does not have a Layout");return this.fin.Platform.Layout.wrap(e??this.identity)}getOptions(){return this.wire.sendAction("get-window-options",this.identity).then((({payload:e})=>e.data))}getParentApplication(){return this.wire.sendAction("window-get-parent-application",this.identity).catch((e=>{})),Promise.resolve(new e.Application(this.wire,this.identity))}getParentWindow(){return this.wire.sendAction("window-get-parent-window",this.identity).catch((e=>{})),Promise.resolve(new e.Application(this.wire,this.identity)).then((e=>e.getWindow()))}async getSnapshot(e){const t={area:e,...this.identity};console.warn("Window.getSnapshot has been deprecated, please use Window.capturePage");return(await this.wire.sendAction("get-window-snapshot",t)).payload.data}getState(){return this.wire.sendAction("get-window-state",this.identity).then((({payload:e})=>e.data))}getWebWindow(){return this.wire.sendAction("window-get-web-window",this.identity).catch((e=>{})),this.wire.environment.getWebWindow(this.identity)}isMainWindow(){return this.wire.sendAction("window-is-main-window",this.identity).catch((e=>{})),this.me.uuid===this.me.name}isShowing(){return this.wire.sendAction("is-window-showing",this.identity).then((({payload:e})=>e.data))}maximize(){return this.wire.sendAction("maximize-window",this.identity).then((()=>{}))}minimize(){return this.wire.sendAction("minimize-window",this.identity).then((()=>{}))}moveBy(e,t,n){return this.wire.sendAction("move-window-by",{deltaLeft:e,deltaTop:t,positioningOptions:n,...this.identity}).then((()=>{}))}moveTo(e,t,n){return this.wire.sendAction("move-window",{left:e,top:t,positioningOptions:n,...this.identity}).then((()=>{}))}resizeBy(e,t,n,i){return this.wire.sendAction("resize-window-by",{deltaWidth:Math.floor(e),deltaHeight:Math.floor(t),anchor:n,positioningOptions:i,...this.identity}).then((()=>{}))}resizeTo(e,t,n,i){return this.wire.sendAction("resize-window",{width:Math.floor(e),height:Math.floor(t),anchor:n,positioningOptions:i,...this.identity}).then((()=>{}))}restore(){return this.wire.sendAction("restore-window",this.identity).then((()=>{}))}setAsForeground(){return this.wire.sendAction("set-foreground-window",this.identity).then((()=>{}))}setBounds(e,t){return this.wire.sendAction("set-window-bounds",{...e,...this.identity,positioningOptions:t}).then((()=>{}))}show(e=!1){return this.wire.sendAction("show-window",{force:e,...this.identity}).then((()=>{}))}showAt(e,t,n=!1){return this.wire.sendAction("show-at-window",{force:n,left:Math.floor(e),top:Math.floor(t),...this.identity}).then((()=>{}))}updateOptions(e){return this.wire.sendAction("update-window-options",{options:e,...this.identity}).then((()=>{}))}authenticate(e,t){return this.wire.sendAction("window-authenticate",{userName:e,password:t,...this.identity}).then((()=>{}))}async showPopupMenu(e){const{payload:t}=await this.wire.sendAction("show-popup-menu",{options:e,...this.identity});return t.data}async closePopupMenu(){return this.wire.sendAction("close-popup-menu",{...this.identity}).then((()=>{}))}async dispatchPopupResult(e){this.wire.sendAction("window-dispatch-popup-result",this.identity).catch((e=>{})),await this.wire.sendAction("dispatch-popup-result",{data:e,...this.identity})}async print(e={content:"self"}){switch(e.content){case void 0:case"self":return super.print(e);case"screenshot":return this.wire.sendAction("print-screenshot",this.identity).then((()=>{}));case"views":return this.wire.sendAction("print-views",{...this.identity,options:e}).then((()=>{}));default:return}}}return _._Window=o,_}function Pe(){return xe||(xe=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(function(){if(Ee)return M;Ee=1,Object.defineProperty(M,"__esModule",{value:!0}),M._WindowModule=void 0;const e=c,t=O,n=Ae();class i extends e.Base{async wrap(e){this.wire.sendAction("window-wrap").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n._Window(this.wire,e)}wrapSync(e){this.wire.sendAction("window-wrap-sync").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n._Window(this.wire,e)}create(e){return this.wire.sendAction("create-window").catch((e=>{})),new n._Window(this.wire,{uuid:this.me.uuid,name:e.name}).createWindow(e)}getCurrent(){if(this.wire.sendAction("get-current-window").catch((e=>{})),!this.wire.me.isWindow)throw new Error("You are not in a Window context");const{uuid:e,name:t}=this.wire.me;return this.wrap({uuid:e,name:t})}getCurrentSync(){if(this.wire.sendAction("get-current-window-sync").catch((e=>{})),!this.wire.me.isWindow)throw new Error("You are not in a Window context");const{uuid:e,name:t}=this.wire.me;return this.wrapSync({uuid:e,name:t})}}return M._WindowModule=i,M}(),e),n(Ae(),e)}(P)),P}be.promisifySubscription=async(e,t,n=(()=>!0),i)=>{let r,o,s;const a=new Promise(((e,t)=>{r=e,o=t})),c=e=>{n(e)&&(clearTimeout(s),r(e))};return await e.on(t,c),i&&(s=setTimeout((()=>o(new Error("event timed out"))),i)),a.finally((()=>{e.removeListener(t,c).catch((()=>null))})),{getValue:()=>a}},Object.defineProperty(a,"__esModule",{value:!0}),a.System=void 0;const Me=c,Oe=f,_e=Pe(),Se=t;class Re extends Me.EmitterBase{constructor(e){super(e,"system")}sendExternalProcessRequest(e,t){return new Promise(((n,i)=>{const r="external-process-exited";let o,s,a,c;"function"==typeof t.listener&&(a=e=>{const n=e||{};s={topic:"exited",uuid:n.processUuid||"",exitCode:n.exitCode||0},o===e.processUuid&&(t.listener(s),c.removeListener(r,a))},this.wire.me.name||(this.wire.me.name=this.wire.me.uuid),c=new _e._Window(this.wire,this.wire.me),c.on(r,a)),this.wire.sendAction(e,t).then((({payload:e})=>{o=e.data.uuid,n(e.data),s&&o===s.uuid&&(t.listener(s),c.removeListener(r,a))})).catch((e=>{c&&c.removeListener(r,a),i(e)}))}))}getVersion(){return this.wire.sendAction("get-version").then((({payload:e})=>e.data))}clearCache(e){return this.wire.sendAction("clear-cache",e).then((()=>{}))}deleteCacheOnExit(){return this.wire.sendAction("delete-cache-request").then((()=>{}))}exit(){return this.wire.sendAction("exit-desktop").then((()=>{}))}async fetchManifest(e){const{payload:{data:t}}=await this.wire.sendAction("fetch-manifest",{manifestUrl:e});return t}flushCookieStore(){return this.wire.sendAction("flush-cookie-store").then((()=>{}))}getAllWindows(){return this.wire.sendAction("get-all-windows").then((({payload:e})=>e.data))}getAllApplications(){return this.wire.sendAction("get-all-applications").then((({payload:e})=>e.data))}getCommandLineArguments(){return this.wire.sendAction("get-command-line-arguments").then((({payload:e})=>e.data))}async getCrashReporterState(){const{payload:{data:{diagnosticMode:e,isRunning:t}}}=await this.wire.sendAction("get-crash-reporter-state");return console.warn("diagnosticMode property is deprecated. It will be removed in a future version"),{diagnosticMode:e,diagnosticsMode:e,isRunning:t}}async startCrashReporter(e){const t=e,n={...t,diagnosticMode:t.diagnosticsMode||t.diagnosticMode},{payload:{data:{diagnosticMode:i,isRunning:r}}}=await this.wire.sendAction("start-crash-reporter",n);return{diagnosticMode:i,diagnosticsMode:i,isRunning:r}}getUniqueUserId(){return this.wire.sendAction("get-unique-user-id").then((({payload:e})=>e.data))}getEntityInfo(e,t){return this.wire.sendAction("get-entity-info",{uuid:e,name:t}).then((({payload:e})=>e.data))}getEnvironmentVariable(e){return this.wire.sendAction("get-environment-variable",{environmentVariables:e}).then((({payload:e})=>e.data))}getFocusedWindow(){return this.wire.sendAction("get-focused-window").then((({payload:e})=>e.data))}async isAppCertified(e){const{payload:{data:{certifiedInfo:t}}}=await this.wire.sendAction("is-app-certified",{manifestUrl:e});return t}getInstalledRuntimes(){return this.wire.sendAction("get-installed-runtimes").then((({payload:e})=>e.data.runtimes))}async getInstalledApps(){const{payload:{data:{installedApps:e}}}=await this.wire.sendAction("get-installed-apps");return e}getLog(e){return this.wire.sendAction("view-log",e).then((({payload:e})=>e.data))}getMachineId(){return this.wire.sendAction("get-machine-id").then((({payload:e})=>e.data))}getMinLogLevel(){return this.wire.sendAction("get-min-log-level").then((({payload:e})=>e.data))}getLogList(){return this.wire.sendAction("list-logs").then((({payload:e})=>e.data))}getMonitorInfo(){return this.wire.sendAction("get-monitor-info").then((({payload:e})=>e.data))}getMousePosition(){return this.wire.sendAction("get-mouse-position").then((({payload:e})=>e.data))}getProcessList(){return console.warn("System.getProcessList has been deprecated. Please consider using our new process APIs: Window.getProcessInfo, View.getProcessInfo, Application.getProcessInfo, System.getAllProcessInfo"),this.wire.sendAction("process-snapshot").then((({payload:e})=>e.data))}async getAllProcessInfo(){const{payload:{data:e}}=await this.wire.sendAction("get-all-process-info",this.identity);return e}getProxySettings(){return this.wire.sendAction("get-proxy-settings").then((({payload:e})=>e.data))}getRuntimeInfo(){return this.wire.sendAction("get-runtime-info").then((({payload:e})=>e.data))}getRvmInfo(){return this.wire.sendAction("get-rvm-info").then((({payload:e})=>e.data))}getHostSpecs(){return this.wire.sendAction("get-host-specs").then((({payload:e})=>e.data))}launchExternalProcess(e){return this.sendExternalProcessRequest("launch-external-process",e)}monitorExternalProcess(e){return this.sendExternalProcessRequest("monitor-external-process",e)}log(e,t){return this.wire.sendAction("write-to-log",{level:e,message:t}).then((()=>{}))}openUrlWithBrowser(e){return this.wire.sendAction("open-url-with-browser",{url:e}).then((()=>{}))}async registerCustomProtocol(e){if("object"!=typeof e)throw new Error("Must provide an object with a `protocolName` property having a string value.");await this.wire.sendAction("register-custom-protocol",e)}async unregisterCustomProtocol(e){await this.wire.sendAction("unregister-custom-protocol",{protocolName:e})}async getCustomProtocolState(e){return this.wire.sendAction("get-custom-protocol-state",{protocolName:e}).then((({payload:e})=>e.data))}releaseExternalProcess(e){return this.wire.sendAction("release-external-process",{uuid:e}).then((()=>{}))}showDeveloperTools(e){return this.wire.sendAction("show-developer-tools",e).then((()=>{}))}terminateExternalProcess(e){return this.wire.sendAction("terminate-external-process",e).then((()=>{}))}updateProxySettings(e){return this.wire.sendAction("update-proxy",e).then((()=>{}))}async downloadAsset(e,t){const n=()=>{};let i=n,r=n;const o=new Promise(((e,t)=>{i=e,r=t}));if("openfin"!==this.wire.environment.type)throw new Oe.NotSupportedError("downloadAsset only supported in an OpenFin Render process");const s=Oe.RuntimeError.getCallSite(),a=this.wire.environment.getNextMessageId().toString(),c=`asset-download-progress-${a}`,d=`asset-download-error-${a}`,h=`asset-download-complete-${a}`,l=e=>{const n={downloadedBytes:e.downloadedBytes,totalBytes:e.totalBytes};t(n)},u=()=>{this.removeListener(c,l)};await Promise.all([this.on(c,l),this.once(d,(e=>{u();const{reason:t,err:n}=e;r(new Oe.RuntimeError({reason:t,error:n},s))})),this.once(h,(()=>{u(),i()}))]);const p=Object.assign(e,{downloadId:a});return await this.wire.sendAction("download-asset",p).catch((e=>{throw u(),e})),o}downloadRuntime(e,t){const n=Oe.RuntimeError.getCallSite();return new Promise(((i,r)=>{if("openfin"!==this.wire.environment.type)return void r(new Oe.NotSupportedError("downloadRuntime only supported in an OpenFin Render process"));const o=this.wire.environment.getNextMessageId().toString(),s=`runtime-download-progress-${o}`,a=`runtime-download-error-${o}`,c=`runtime-download-complete-${o}`,d=e=>{const n={downloadedBytes:e.downloadedBytes,totalBytes:e.totalBytes};t(n)},h=()=>{this.removeListener(s,d)};this.on(s,d),this.once(a,(e=>{h();const{reason:t,err:i}=e;r(new Oe.RuntimeError({reason:t,error:i},n))})),this.once(c,(()=>{h(),i()}));const l=Object.assign(e,{downloadId:o});this.wire.sendAction("download-runtime",l).catch((e=>{h(),r(e)}))}))}downloadPreloadScripts(e){return this.wire.sendAction("download-preload-scripts",{scripts:e}).then((({payload:e})=>e.data))}getAllExternalApplications(){return this.wire.sendAction("get-all-external-applications").then((({payload:e})=>e.data))}getAppAssetInfo(e){return this.wire.sendAction("get-app-asset-info",e).then((({payload:e})=>e.data))}getCookies(e){const t=this.wire.environment.getUrl(),n=Object.assign(e,{url:t});return this.wire.sendAction("get-cookies",n).then((({payload:e})=>e.data))}setMinLogLevel(e){return this.wire.sendAction("set-min-log-level",{level:e}).then((()=>{}))}resolveUuid(e){return this.wire.sendAction("resolve-uuid",{entityKey:e}).then((({payload:e})=>e.data))}executeOnRemote(e,t){return t.requestingIdentity=e,this.wire.ferryAction(t)}readRegistryValue(e,t,n){return this.wire.sendAction("read-registry-value",{rootKey:e,subkey:t,value:n}).then((({payload:e})=>e.data))}registerExternalConnection(e){return this.wire.sendAction("register-external-connection",{uuid:e}).then((({payload:e})=>e.data))}async getServiceConfiguration(e){if("string"!=typeof e.name)throw new Error("Must provide an object with a `name` property having a string value");const{name:t}=e;return this.wire.sendAction("get-service-configuration",{name:t}).then((({payload:e})=>e.data))}async getSystemAppConfig(e){if("string"!=typeof e)throw new Error("Must provide a string value for name of system app");return this.wire.sendAction("get-system-app-configuration",{name:e}).then((({payload:e})=>e.data))}async registerShutdownHandler(e){this.wire.sendAction("system-register-shutdown-handler").catch((e=>{}));const{uuid:t,name:n}=this.wire.me;this.on("system-shutdown",(i=>{e({proceed:()=>{this.wire.environment.raiseEvent("application/system-shutdown-handled",{uuid:t,name:n,topic:"application"})}})}))}runRvmHealthCheck(){return this.wire.sendAction("run-rvm-health-check").then((({payload:e})=>e.data))}async launchManifest(e,t={}){const{subscribe:n,...i}=t,r=i;if(n){const e=new Se.EventEmitter;n(e);const t="app-version-progress",i="runtime-status",o="app-version-complete",s="app-version-error",a=this.wire.environment.getNextMessageId().toString();r.appVersionId=a;const c=[o,t,i,s],d=e=>{const{appVersionId:t,topic:n,type:i,...r}=e;return{...r,type:c.find((e=>i.includes(e)))}},h=t=>{const n=d(t);e.emit(n.type,n)},l=()=>{this.removeListener(`${t}.${a}`,h),this.removeListener(`${i}.${a}`,h),this.removeListener(`${o}.${a}`,h),this.removeListener(`${s}.${a}`,h),this.removeListener(`${o}.${a}`,l),this.removeListener(`${s}.${a}`,l)};await Promise.all([this.on(`${t}.${a}`,h),this.on(`${i}.${a}`,h),this.once(`${o}.${a}`,h),this.once(`${s}.${a}`,h),this.once(`${o}.${a}`,l),this.once(`${s}.${a}`,l)])}return(await this.wire.sendAction("launch-manifest",{manifestUrl:e,opts:r})).payload.data.manifest}async queryPermissionForCurrentContext(e){const t={uuid:this.wire.me.uuid,name:this.wire.me.name};return(await this.wire.sendAction("query-permission-for-current-context",{apiName:e,identity:t})).payload.data}async enableNativeWindowIntegrationProvider(e){const{payload:t}=await this.wire.sendAction("enable-native-window-integration-provider",{permissions:e});return t.data}async registerUsage({data:e,type:t}){await this.wire.sendAction("register-usage",{data:e,type:t})}async getPrinters(){const{payload:e}=await this.wire.sendAction("system-get-printers");return e.data}async updateProcessLoggingOptions(e){await this.wire.sendAction("system-update-process-logging-options",{options:e})}async getDomainSettings(){const{payload:{data:e}}=await this.wire.sendAction("get-domain-settings",this.identity);return e}async setDomainSettings(e){await this.wire.sendAction("set-domain-settings",{domainSettings:e,...this.identity})}}a.System=Re;var Fe={},je={};Object.defineProperty(je,"__esModule",{value:!0}),je.RefCounter=void 0;je.RefCounter=class{constructor(){this.topicRefMap=new Map}incRefCount(e){const t=this.topicRefMap.get(e);let n;if(t){const i=t+1;n=i,this.topicRefMap.set(e,i)}else this.topicRefMap.set(e,1),n=1;return n}decRefCount(e){const t=this.topicRefMap.get(e);let n;if(t){const i=t-1;this.topicRefMap.set(e,i),n=i}else n=-1;return n}actOnFirst(e,t,n){return 1===this.incRefCount(e)?t():n()}actOnLast(e,t,n){return 0===this.decRefCount(e)?t():n()}};var ke={},Le={},Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.ChannelBase=Te.ProtectedItems=void 0;const $e=e=>async(t,n,i)=>{const r=await e(t,n,i);return void 0===r?n:r};Te.ProtectedItems=class{constructor(e,t){this.providerIdentity=e,this.close=t}};class Be{static defaultAction(e){throw new Error(`No action registered at target for ${e}`)}constructor(){this.subscriptions=new Map}async processAction(e,t,n){try{const i=this.subscriptions.has(e)?this.subscriptions.get(e):(t,n)=>(this.defaultAction??Be.defaultAction)(e,t,n),r=this.preAction?await this.preAction(e,t,n):t,o=await i(r,n);return this.postAction?await this.postAction(e,o,n):o}catch(t){if(this.errorMiddleware)return this.errorMiddleware(e,t,n);throw t}}beforeAction(e){if(this.preAction)throw new Error("Already registered beforeAction middleware");this.preAction=$e(e)}onError(e){if(this.errorMiddleware)throw new Error("Already registered error middleware");this.errorMiddleware=e}afterAction(e){if(this.postAction)throw new Error("Already registered afterAction middleware");this.postAction=$e(e)}remove(e){this.subscriptions.delete(e)}setDefaultAction(e){if(this.defaultAction)throw new Error("default action can only be set once");this.defaultAction=e}register(e,t){if(this.subscriptions.has(e))throw new Error(`Subscription already registered for action: ${e}. Unsubscribe before adding new subscription`);return this.subscriptions.set(e,t),!0}}Te.ChannelBase=Be;var Ge,We,He,Ne=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},De=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(Le,"__esModule",{value:!0}),Le.ChannelClient=void 0;const Ue=Te,Ve=new Map;class ze extends Ue.ChannelBase{static closeChannelByEndpointId(e){const t=Ve.get(e);t&&Ne(t,He,"f").call(t)}static handleProviderDisconnect(e){for(const t of Ve.values())t.providerIdentity.channelId===e.channelId&&(t.disconnectListener(e),Ne(t,He,"f").call(t))}constructor(e,t,n){super(),Ge.set(this,void 0),We.set(this,void 0),this.processAction=(e,t,n)=>super.processAction(e,t,n),He.set(this,(()=>{Ve.delete(this.endpointId),Ne(this,We,"f").close()})),De(this,Ge,new Ue.ProtectedItems(e,t),"f"),this.disconnectListener=()=>{},this.endpointId=e.endpointId,De(this,We,n,"f"),Ve.set(this.endpointId,this),n.receive(this.processAction)}get providerIdentity(){return Ne(this,Ge,"f").providerIdentity}async dispatch(e,t){if(Ne(this,We,"f").isEndpointConnected(this.providerIdentity.channelId))return Ne(this,We,"f").send(this.providerIdentity.channelId,e,t);throw new Error("The client you are trying to dispatch from is disconnected from the target provider.")}onDisconnection(e){this.disconnectListener=t=>{try{e(t)}catch(e){throw new Error(`Error while calling the onDisconnection callback: ${e.message}`)}finally{this.disconnectListener=()=>{}}}}async disconnect(){await this.sendDisconnectAction(),Ne(this,He,"f").call(this)}async sendDisconnectAction(){const e=Ne(this,Ge,"f");await e.close()}static async wireClose(e,t,n){const{channelName:i,uuid:r,name:o}=t;await e.sendAction("disconnect-from-channel",{channelName:i,uuid:r,name:o,endpointId:n})}}Le.ChannelClient=ze,Ge=new WeakMap,We=new WeakMap,He=new WeakMap;var Ke={},qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.exhaustiveCheck=void 0,qe.exhaustiveCheck=function(e,t){throw new Error(`Unsupported value: ${e}${t?`\n Supported values are: ${t.join("")}`:""}`)};var Ye,Je,Ze,Qe={},Xe=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},et=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.ClassicInfo=Qe.ClassicStrategy=void 0;Qe.ClassicStrategy=class{constructor(e,t,n,i){this.messageReceiver=t,this.endpointId=n,this.providerIdentity=i,Ye.set(this,void 0),Je.set(this,new Map),Ze.set(this,new Map),this.send=async(e,t,n)=>{const i=et(this,Je,"f").get(e);if(!i)throw new Error(`Could not locate routing info for endpoint ${e}`);const r={...i};r.isLocalEndpointId&&delete r.endpointId,delete r.isLocalEndpointId;const o=et(this,Ye,"f").sendAction("send-channel-message",{...r,providerIdentity:this.providerIdentity,action:t,payload:n});et(this,Ze,"f").get(e)?.add(o);return(await o.catch((e=>{throw new Error(e.message)})).finally((()=>{et(this,Ze,"f").get(e)?.delete(o)}))).payload.data.result},this.close=async()=>{this.messageReceiver.removeEndpoint(this.providerIdentity.channelId,this.endpointId),[...et(this,Je,"f").keys()].forEach((e=>this.closeEndpoint(e))),Xe(this,Je,new Map,"f")},Xe(this,Ye,e,"f")}onEndpointDisconnect(e,t){}receive(e){this.messageReceiver.addEndpoint(e,this.providerIdentity.channelId,this.endpointId)}async closeEndpoint(e){const t=et(this,Je,"f").get(e);et(this,Je,"f").delete(e);const n=et(this,Ze,"f").get(e);n?.forEach((n=>{const i=`Channel connection with identity uuid: ${t?.uuid} / name: ${t?.name} / endpointId: ${e} no longer connected.`;n.cancel(new Error(i))}))}isEndpointConnected(e){return et(this,Je,"f").has(e)}addEndpoint(e,t){et(this,Je,"f").set(e,t.endpointIdentity),et(this,Ze,"f").set(e,new Set)}isValidEndpointPayload(e){return"string"==typeof e?.endpointIdentity?.endpointId||"string"==typeof e?.endpointIdentity?.channelId}},Ye=new WeakMap,Je=new WeakMap,Ze=new WeakMap,Qe.ClassicInfo={version:5,minimumVersion:0,type:"classic"};var tt={},nt={},it={};Object.defineProperty(it,"__esModule",{value:!0}),it.errorToPOJO=void 0,it.errorToPOJO=function(e){return{stack:e.stack,name:e.name,message:e.message,toString:()=>e.stack||e.toString()}};var rt,ot,st=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},at=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(nt,"__esModule",{value:!0}),nt.RTCEndpoint=void 0;const ct=it;nt.RTCEndpoint=class{static isValidEndpointPayload(e){const t=e=>"object"==typeof e&&null!==e;return t(e)&&t(e.endpointIdentity)&&t(e.rtc)&&"string"==typeof e.endpointIdentity.endpointId}constructor({rtc:e,endpointIdentity:t}){this.responseMap=new Map,rt.set(this,null),ot.set(this,void 0),this.connectionStateChangeHandler=e=>{"connected"!==this.rtc.rtcClient.connectionState&&(this.rtc.rtcClient.removeEventListener("connectionstatechange",this.connectionStateChangeHandler),this.close(),st(this,ot,"f")&&st(this,ot,"f").call(this))},this.send=async(e,t)=>{const n=`message-${Math.random()}`,i=new Promise(((e,t)=>{this.responseMap.set(n,{resolve:e,reject:t})}));return this.rtc.channels.request.send(JSON.stringify({action:e,payload:t,messageId:n})),i},this.close=()=>{this.responseMap.forEach((e=>e.reject("Connection has closed."))),this.responseMap=new Map,this.rtc.channels.request.close(),this.rtc.channels.response.close(),this.rtc.rtcClient.close()},this.rtc=e,this.endpointIdentity=t,this.rtc.channels.response.addEventListener("message",(e=>{let{data:t}=e;e.data instanceof ArrayBuffer&&(t=(new TextDecoder).decode(e.data));const{messageId:n,payload:i,success:r,error:o}=JSON.parse(t),{resolve:s,reject:a}=this.responseMap.get(n)??{};s&&a?(this.responseMap.delete(n),r?s(i):a(o)):(console.log("Could not find id in responseMap."),console.log(e))})),this.rtc.channels.request.addEventListener("message",(async e=>{let{data:n}=e;e.data instanceof ArrayBuffer&&(n=(new TextDecoder).decode(e.data));const{messageId:i,action:r,payload:o}=JSON.parse(n);if(st(this,rt,"f"))try{const e=await st(this,rt,"f").call(this,r,o,t);this.rtc.channels.response.send(JSON.stringify({messageId:i,payload:e,success:!0}))}catch(e){"open"===this.rtc.channels.response.readyState&&this.rtc.channels.response.send(JSON.stringify({messageId:i,error:(0,ct.errorToPOJO)(e),success:!1}))}else"open"===this.rtc.channels.response.readyState&&this.rtc.channels.response.send(JSON.stringify({messageId:i,success:!1,error:"Connection not ready."}))})),this.rtc.rtcClient.addEventListener("connectionstatechange",this.connectionStateChangeHandler),Object.values(this.rtc.channels).forEach((e=>{e.onclose=e=>{[...this.responseMap.values()].forEach((e=>e.reject(new Error("RTCDataChannel closed unexpectedly, this is most commonly caused by message size. Note: RTC Channels have a message size limit of ~255kB.")))),this.close(),st(this,ot,"f")&&st(this,ot,"f").call(this)}}))}onDisconnect(e){if(st(this,ot,"f"))throw new Error("RTCEndpoint disconnectListener cannot be set twice.");at(this,ot,e,"f")}receive(e){if(st(this,rt,"f"))throw new Error("You have already set a listener for this RTC Endpoint.");at(this,rt,e,"f")}get connected(){return"connected"===this.rtc.rtcClient.connectionState}},rt=new WeakMap,ot=new WeakMap;var dt,ht,lt,ut={},pt=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},wt=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(ut,"__esModule",{value:!0}),ut.EndpointStrategy=void 0;ut.EndpointStrategy=class{constructor(e,t,n){this.EndpointType=e,this.StrategyName=n,dt.set(this,null),ht.set(this,new Map),lt.set(this,!0),this.send=async(e,t,n)=>this.getEndpointById(e).send(t,n),this.close=async()=>{pt(this,lt,"f")&&(pt(this,ht,"f").forEach((e=>e.close())),wt(this,ht,new Map,"f")),wt(this,lt,!1,"f")},this.isValidEndpointPayload=t}onEndpointDisconnect(e,t){this.getEndpointById(e).onDisconnect(t)}receive(e){if(pt(this,dt,"f"))throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);wt(this,dt,e,"f"),pt(this,ht,"f").forEach((e=>e.receive(pt(this,dt,"f"))))}getEndpointById(e){const t=pt(this,ht,"f").get(e);if(!t)throw new Error(`Client with endpoint id ${e} is not connected`);return t}get connected(){return pt(this,lt,"f")}isEndpointConnected(e){return pt(this,ht,"f").has(e)}addEndpoint(e,t){if(!pt(this,lt,"f"))return void console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);const n=new this.EndpointType(t);pt(this,dt,"f")&&n.receive(pt(this,dt,"f")),pt(this,ht,"f").set(e,n)}async closeEndpoint(e){pt(this,ht,"f").delete(e)}},dt=new WeakMap,ht=new WeakMap,lt=new WeakMap,Object.defineProperty(tt,"__esModule",{value:!0}),tt.RTCInfo=tt.RTCStrategy=void 0;const yt=nt,ft=ut;class gt extends ft.EndpointStrategy{constructor(){super(yt.RTCEndpoint,yt.RTCEndpoint.isValidEndpointPayload,"RTC")}}tt.RTCStrategy=gt,tt.RTCInfo={version:2,minimumVersion:0,type:"rtc"};var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.RTCICEManager=void 0;const vt=c;class Ct extends vt.EmitterBase{constructor(e){super(e,"channel"),this.ensureChannelOpened=e=>new Promise(((t,n)=>{if("open"===e.readyState)t();else if("connecting"===e.readyState){const n=()=>{e.removeEventListener("open",n),t()};e.addEventListener("open",n)}else n(new Error("This Channel has already closed"))}))}static createDataChannelPromise(e,t){let n;const i=new Promise((e=>{n=e})),r=i=>{const o=()=>{i.channel.removeEventListener("open",o),n(i.channel)};i.channel.label===e&&(i.channel.addEventListener("open",o),t.removeEventListener("datachannel",r))};return t.addEventListener("datachannel",r),i}async listenForProviderIce(e,t){await this.on(this.createProviderEventName(e),t,{timestamp:Date.now()})}async raiseProviderIce(e,t){await this.wire.environment.raiseEvent(this.createRouteString(this.createProviderEventName(e)),t)}async listenForClientIce(e,t){await this.on(this.createClientEventName(e),t,{timestamp:Date.now()})}async raiseClientIce(e,t){await this.wire.environment.raiseEvent(this.createRouteString(this.createClientEventName(e)),t)}cleanupIceListeners(e){this.removeAllListeners(this.createClientEventName(e)),this.removeAllListeners(this.createProviderEventName(e))}createClientEventName(e){return`ice-client-${e}`}createProviderEventName(e){return`ice-provider-${e}`}createRouteString(e){return`channel/${e}`}createRtcPeer(){return this.wire.environment.getRtcPeer()}async startClientOffer(){const e=Math.random().toString(),t=this.createRtcPeer();t.addEventListener("icecandidate",(async t=>{t.candidate&&await this.raiseClientIce(e,{candidate:t.candidate?.toJSON()})})),await this.listenForProviderIce(e,(async e=>{await t.addIceCandidate(e.candidate)}));const n={request:t.createDataChannel("request"),response:t.createDataChannel("response")},i=await t.createOffer();await t.setLocalDescription(i);const r=Promise.all([n.request,n.response].map(this.ensureChannelOpened)).then((()=>{}));return{rtcClient:t,channels:n,offer:i,rtcConnectionId:e,channelsOpened:r}}async finishClientOffer(e,t,n){return await e.setRemoteDescription(t),await n,!0}async createProviderAnswer(e,t){const n=this.createRtcPeer(),i=Ct.createDataChannelPromise("request",n),r=Ct.createDataChannelPromise("response",n);n.addEventListener("icecandidate",(async t=>{t.candidate&&await this.raiseProviderIce(e,{candidate:t.candidate?.toJSON()})})),await this.listenForClientIce(e,(async e=>{await n.addIceCandidate(e.candidate)})),await n.setRemoteDescription(t);const o=await n.createAnswer();await n.setLocalDescription(o);const s=Promise.all([i,r]).then((([t,n])=>(this.cleanupIceListeners(e),{request:t,response:n})));return{rtcClient:n,answer:o,channels:s}}}mt.RTCICEManager=Ct;var bt={},It={};function Et(e){return[...e.split(".").reverse().entries()].reduce(((e,[t,n])=>e+ +n*1e4**t),0)}function xt(e,t){return Et(e)>=Et(t)}function At(e){return e.split("/")[0]}Object.defineProperty(It,"__esModule",{value:!0}),It.runtimeUuidMeetsMinimumRuntimeVersion=It.parseRuntimeUuid=It.meetsMinimumRuntimeVersion=void 0,It.meetsMinimumRuntimeVersion=xt,It.parseRuntimeUuid=At,It.runtimeUuidMeetsMinimumRuntimeVersion=function(e,t){return xt(At(e),t)};var Pt,Mt,Ot,_t,St,Rt=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Ft=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(bt,"__esModule",{value:!0}),bt.ChannelProvider=void 0;const jt=Te,kt=It;class Lt extends jt.ChannelBase{get connections(){return[...Rt(this,Pt,"f")]}static handleClientDisconnection(e,t){const n=e.connections.find((e=>e.endpointId===t.endpointId));if(n)Rt(e,_t,"f").call(e,n);else{e.connections.filter((e=>e.uuid===t.uuid&&e.name===t.name)).forEach(Rt(e,_t,"f"))}e.disconnectListener(t)}static setProviderRemoval(e,t){Lt.removalMap.set(e,t)}constructor(e,t,n){super(),Pt.set(this,void 0),Mt.set(this,void 0),Ot.set(this,void 0),_t.set(this,(e=>{const t=this.connections.filter((t=>t.endpointId!==e.endpointId));Rt(this,Ot,"f").closeEndpoint(e.endpointId),Ft(this,Pt,t,"f")})),this.processAction=async(e,t,n)=>(Lt.clientIsMultiRuntime(n)&&!(0,kt.runtimeUuidMeetsMinimumRuntimeVersion)(n.runtimeUuid,"18.87.56.0")?this.handleMultiRuntimeLegacyClient(n):this.checkForClientConnection(n),super.processAction(e,t,n)),St.set(this,(()=>{Rt(this,Ot,"f").close();const e=Lt.removalMap.get(this);e&&e()})),Ft(this,Mt,new jt.ProtectedItems(e,t),"f"),this.connectListener=()=>{},this.disconnectListener=()=>{},Ft(this,Pt,[],"f"),Ft(this,Ot,n,"f"),n.receive(this.processAction)}dispatch(e,t,n){const i=e.endpointId??this.getEndpointIdForOpenFinId(e,t);return i&&Rt(this,Ot,"f").isEndpointConnected(i)?Rt(this,Ot,"f").send(i,t,n):Promise.reject(new Error(`Client connection with identity uuid: ${e.uuid} / name: ${e.name} / endpointId: ${i} no longer connected.`))}async processConnection(e,t){return Rt(this,Pt,"f").push(e),this.connectListener(e,t)}publish(e,t){return this.connections.map((n=>Rt(this,Ot,"f").send(n.endpointId,e,t)))}onConnection(e){this.connectListener=e}onDisconnection(e){this.disconnectListener=e}async destroy(){const e=Rt(this,Mt,"f");e.providerIdentity,Ft(this,Pt,[],"f"),await e.close(),Rt(this,St,"f").call(this)}async getAllClientInfo(){return this.connections.map((e=>{const{uuid:t,name:n,endpointId:i,entityType:r,connectionUrl:o}=e;return{uuid:t,name:n,endpointId:i,entityType:r,connectionUrl:o}}))}checkForClientConnection(e){if(!this.isClientConnected(e))throw new Error(`This action was sent from a client that is not connected to the provider.\n Client Identity: {uuid: ${e.uuid}, name: ${e.name}, endpointId: ${e.endpointId}}`)}isClientConnected(e){return Lt.clientIdentityIncludesEndpointId(e)?this.connections.some((t=>t.endpointId===e.endpointId&&t.uuid===e.uuid&&t.name===e.name)):this.isLegacyClientConnected(e)}isLegacyClientConnected(e){return this.connections.some((t=>t.uuid===e.uuid&&t.name===e.name))}handleMultiRuntimeLegacyClient(e){if(!this.isLegacyClientConnected(e))throw new Error(`This action was sent from a client that is not connected to the provider. Client Identity:\n {uuid: ${e.uuid}, name: ${e.name}, endpointId: ${e.endpointId}}`)}getEndpointIdForOpenFinId(e,t){const n=this.connections.filter((t=>t.name===e.name&&t.uuid===e.uuid));if(n.length>=2){const n=Rt(this,Mt,"f"),{uuid:i,name:r}=e,o=n?.providerIdentity.uuid,s=n?.providerIdentity.name;console.warn(`WARNING: Dispatch call may have unintended results. The "to" argument of your dispatch call is missing the\n "endpointId" parameter. The identity you are dispatching to ({uuid: ${i}, name: ${r}})\n has multiple channelClients for this channel. Your dispatched action: (${t}) from the provider:\n ({uuid: ${o}, name: ${s}}) will only be processed by the most recently-created client.`)}return n.pop()?.endpointId}static clientIdentityIncludesEndpointId(e){return void 0!==e.endpointId}static clientIsMultiRuntime(e){return void 0!==e.runtimeUuid}static async wireClose(e,t){await e.sendAction("destroy-channel",{channelName:t})}}bt.ChannelProvider=Lt,Pt=new WeakMap,Mt=new WeakMap,Ot=new WeakMap,_t=new WeakMap,St=new WeakMap,Lt.removalMap=new WeakMap;var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.MessageReceiver=void 0;const $t=Le,Bt=c;class Gt extends Bt.Base{constructor(e){super(e),this.onmessage=e=>"process-channel-message"===e.action&&(this.processChannelMessage(e),!0),this.endpointMap=new Map,this.latestEndpointIdByChannelId=new Map,e.registerMessageHandler(this.onmessage.bind(this))}async processChannelMessage(e){const{senderIdentity:t,providerIdentity:n,action:i,ackToSender:r,payload:o,intendedTargetIdentity:s}=e.payload,a=s.channelId??s.endpointId??this.latestEndpointIdByChannelId.get(n.channelId),c=this.endpointMap.get(a);if(!c)return r.payload.success=!1,r.payload.reason=`Client connection with identity uuid: ${this.wire.me.uuid} / name: ${this.wire.me.name} / endpointId: ${a} no longer connected.`,this.wire.sendRaw(r);try{const e=await c(i,o,t);return r.payload.payload=r.payload.payload||{},r.payload.payload.result=e,this.wire.sendRaw(r)}catch(e){return r.payload.success=!1,r.payload.reason=e.message,this.wire.sendRaw(r)}}addEndpoint(e,t,n){this.endpointMap.set(n,e),t!==n&&this.latestEndpointIdByChannelId.set(t,n)}removeEndpoint(e,t){this.endpointMap.delete(t),this.latestEndpointIdByChannelId.get(e)===t&&this.latestEndpointIdByChannelId.delete(e)}checkForPreviousClientConnection(e){const t=this.latestEndpointIdByChannelId.get(e);t&&($t.ChannelClient.closeChannelByEndpointId(t),console.warn("You have created a second connection to an older provider. First connection has been removed from the clientMap"),console.warn("If the provider calls publish(), you may receive multiple messages."))}}Tt.MessageReceiver=Gt;var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.ProtocolManager=void 0;Wt.ProtocolManager=class{constructor(e){this.ProtocolsInPreferenceOrder=e,this.DefaultClientProtocols=["classic"],this.DefaultProviderProtocols=["classic"],this.getClientProtocols=e=>{const t=e?this.ProtocolsInPreferenceOrder.filter((t=>e.includes(t))):this.DefaultClientProtocols;if(!t.length)throw new Error(`No valid protocols were passed in. Accepted values are: ${this.ProtocolsInPreferenceOrder.join(", ")}.`);return t},this.getProviderProtocols=e=>{const t=e?this.ProtocolsInPreferenceOrder.filter((t=>e.includes(t))):this.DefaultProviderProtocols;if(!t.length)throw new Error(`No valid protocols were passed in. Accepted values are: ${this.ProtocolsInPreferenceOrder.join(", ")}.`);return t},this.getCompatibleProtocols=(e,t)=>t.supportedProtocols.filter((t=>e.some((e=>e.type===t.type&&t.version>=e.minimumVersion&&e.version>=(t.minimumVersion??0))))).slice(0,t.maxProtocols)}};var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});class Nt{static combine(e,t){return new Nt(e,t)}constructor(e,t){this.primary=e,this.secondary=t}onEndpointDisconnect(e,t){this.primary.onEndpointDisconnect(e,(()=>{this.secondary.isEndpointConnected(e)||t()})),this.secondary.onEndpointDisconnect(e,(()=>{this.primary.isEndpointConnected(e)||t()}))}isValidEndpointPayload(e){return this.primary.isValidEndpointPayload(e)||this.secondary.isValidEndpointPayload(e)}async closeEndpoint(e){await this.primary.closeEndpoint(e),await this.secondary.closeEndpoint(e)}isEndpointConnected(e){return this.primary.isEndpointConnected(e)||this.secondary.isEndpointConnected(e)}async addEndpoint(e,t){this.primary.isValidEndpointPayload(t)&&await this.primary.addEndpoint(e,t),this.secondary.isValidEndpointPayload(t)&&await this.secondary.addEndpoint(e,t)}receive(e){this.primary.receive(e),this.secondary.receive(e)}send(e,t,n){return this.primary.isEndpointConnected(e)?this.primary.send(e,t,n):this.secondary.send(e,t,n)}async close(){await Promise.all([this.primary.close(),this.secondary.close()])}}Ht.default=Nt;var Dt,Ut,Vt=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},zt=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.ConnectionManager=void 0;const Kt=qe,qt=c,Yt=Qe,Jt=tt,Zt=mt,Qt=bt,Xt=Tt,en=Wt,tn=Ht;class nn extends qt.Base{static getProtocolOptionsFromStrings(e){return e.map((e=>{switch(e){case"rtc":return Jt.RTCInfo;case"classic":return Yt.ClassicInfo;default:return(0,Kt.exhaustiveCheck)(e,["rtc","classic"])}}))}constructor(e){super(e),Dt.set(this,void 0),Ut.set(this,void 0),this.removeChannelFromProviderMap=e=>{this.providerMap.delete(e)},this.onmessage=e=>"process-channel-connection"===e.action&&(this.processChannelConnection(e),!0),this.providerMap=new Map,this.protocolManager=new en.ProtocolManager("node"===this.wire.environment.type?["classic"]:["rtc","classic"]),Vt(this,Dt,new Xt.MessageReceiver(e),"f"),Vt(this,Ut,new Zt.RTCICEManager(e),"f"),e.registerMessageHandler(this.onmessage.bind(this))}createProvider(e,t){const n=Object.assign(this.wire.environment.getDefaultChannelOptions().create,e||{}),i=this.protocolManager.getProviderProtocols(n?.protocols),r=i.map((e=>{switch(e){case"rtc":return new Jt.RTCStrategy;case"classic":return new Yt.ClassicStrategy(this.wire,zt(this,Dt,"f"),t.channelId,t);default:return(0,Kt.exhaustiveCheck)(e,["rtc","classic"])}}));let o;if(2===r.length){const[e,t]=r;o=tn.default.combine(e,t)}else{if(1!==r.length)throw new Error("failed to combine strategies");[o]=r}const s=new Qt.ChannelProvider(t,(()=>Qt.ChannelProvider.wireClose(this.wire,t.channelName)),o),a=t.channelId;return this.providerMap.set(a,{provider:s,strategy:o,supportedProtocols:nn.getProtocolOptionsFromStrings(i)}),Qt.ChannelProvider.setProviderRemoval(s,this.removeChannelFromProviderMap.bind(this)),s}async createClientOffer(e){const t=this.protocolManager.getClientProtocols(e?.protocols);let n;return{offer:{supportedProtocols:await Promise.all(t.map((async e=>{switch(e){case"rtc":{const{rtcClient:e,channels:t,offer:i,rtcConnectionId:r,channelsOpened:o}=await zt(this,Ut,"f").startClientOffer();return n={rtcClient:e,channels:t,channelsOpened:o},{type:"rtc",version:Jt.RTCInfo.version,payload:{offer:i,rtcConnectionId:r}}}case"classic":return{type:"classic",version:Yt.ClassicInfo.version};default:return(0,Kt.exhaustiveCheck)(e,["rtc","classic"])}}))),maxProtocols:2},rtc:n}}async createClientStrategy(e,t){t.endpointId||(t.endpointId=this.wire.environment.getNextMessageId(),zt(this,Dt,"f").checkForPreviousClientConnection(t.channelId));const n=t.answer??{supportedProtocols:[{type:"classic",version:1}]},i=(await Promise.all(n.supportedProtocols.map((async n=>"rtc"===n.type&&e?(await zt(this,Ut,"f").finishClientOffer(e.rtcClient,n.payload.answer,e.channelsOpened),new Jt.RTCStrategy):"classic"===n.type?new Yt.ClassicStrategy(this.wire,zt(this,Dt,"f"),t.endpointId,t):null)))).filter((e=>null!==e));let r;if(e&&!i.some((e=>e instanceof Jt.RTCStrategy))&&e&&e.rtcClient.close(),i.length>=2)r=tn.default.combine(i[0],i[1]);else{if(!i.length)throw new Error("No compatible protocols");[r]=i}const o={endpointIdentity:t,rtc:e};return r.addEndpoint(t.channelId,o),r}async processChannelConnection(e){const{clientIdentity:t,providerIdentity:n,ackToSender:i,payload:r,offer:o}=e.payload;t.endpointId?t.isLocalEndpointId=!1:(t.endpointId=this.wire.environment.getNextMessageId(),t.isLocalEndpointId=!0);const s=n.channelId,a=this.providerMap.get(s);if(!a)return i.payload.success=!1,i.payload.reason=`Channel "${n.channelName}" has been destroyed.`,this.wire.sendRaw(i);const{provider:c,strategy:d,supportedProtocols:h}=a;try{if(!(c instanceof Qt.ChannelProvider))throw Error("Cannot connect to a channel client");const e=o??{supportedProtocols:[{type:"classic",version:1}],maxProtocols:1},n=this.protocolManager.getCompatibleProtocols(h,e);if(!n.length)throw new Error("This provider does not support any of the offered protocols.");const s=await c.processConnection(t,r);i.payload.payload=i.payload.payload||{};let a={supportedProtocols:[],endpointPayloadPromise:Promise.resolve({endpointIdentity:t})};return a=await n.reduce((async(e,t)=>{const n=await e;if("rtc"===t.type){const{answer:e,rtcClient:i,channels:r}=await zt(this,Ut,"f").createProviderAnswer(t.payload.rtcConnectionId,t.payload.offer);n.supportedProtocols.push({type:"rtc",version:Jt.RTCInfo.version,payload:{answer:e}}),n.endpointPayloadPromise=n.endpointPayloadPromise.then((e=>r.then((t=>({...e,rtc:{rtcClient:i,channels:t}})))))}else n.supportedProtocols.push({type:"classic",version:Yt.ClassicInfo.version});return n}),Promise.resolve(a)),a.endpointPayloadPromise.then((e=>d.addEndpoint(t.endpointId,e))),i.payload.payload.result=s,i.payload.payload.answer=a,this.wire.sendRaw(i)}catch(e){return i.payload.success=!1,i.payload.reason=e.message,this.wire.sendRaw(i)}}}Ke.ConnectionManager=nn,Dt=new WeakMap,Ut=new WeakMap;var rn,on,sn,an=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},cn=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(ke,"__esModule",{value:!0}),ke.Channel=void 0;const dn=t,hn=B,ln=c,un=Le,pn=Ke,wn=bt;function yn(e){const t=Math.floor(e/10),n=Math.min(3e4,500*2**t);return new Promise((e=>{setTimeout((()=>{e(!1)}),n)}))}class fn extends ln.EmitterBase{constructor(e){super(e,"channel"),rn.set(this,void 0),on.set(this,new dn.EventEmitter),sn.set(this,new hn.AsyncRetryableLazy((async()=>{await Promise.all([this.on("disconnected",(e=>{un.ChannelClient.handleProviderDisconnect(e)})),this.on("connected",((...e)=>{cn(this,on,"f").emit("connected",...e)}))]).catch((()=>new Error("error setting up channel connection listeners")))}))),an(this,rn,new pn.ConnectionManager(e),"f")}async getAllChannels(){return this.wire.sendAction("get-all-channels").then((({payload:e})=>e.data))}async onChannelConnect(e){await this.on("connected",e)}async onChannelDisconnect(e){await this.on("disconnected",e)}async safeConnect(e,t,n){const i={count:0};do{let r=()=>{};const o=new Promise((t=>{r=n=>{e===n.channelName&&t(!0)},cn(this,on,"f").on("connected",r)}));try{if(i.count>0){i.gotConnectedEvent=await Promise.race([yn(i.count),o]);const t=await this.wire.sendAction("connect-to-channel",{...n,retryInfo:i});return console.log(`Successfully connected to channelName: ${e}`),t.payload.data}const t=this.wire.sendAction("connect-to-channel",n);i.originalMessageId=t.messageId;return(await t).payload.data}catch(n){if(!n.message.includes("internal-nack"))throw n;t&&0===i.count&&console.warn(`No channel found for channelName: ${e}. Waiting for connection...`)}finally{i.count+=1,cn(this,on,"f").removeListener("connected",r)}}while(t);throw new Error(`No channel found for channelName: ${e}.`)}async connect(e,t={}){if(await cn(this,sn,"f").getValue(),!e||"string"!=typeof e)throw new Error("Please provide a channelName string to connect to a channel.");const n={wait:!0,...this.wire.environment.getDefaultChannelOptions().connect,...t},{offer:i,rtc:r}=await cn(this,rn,"f").createClientOffer(n);let o;(this.fin.me.isFrame||this.fin.me.isView||this.fin.me.isWindow)&&(o=(await this.fin.me.getInfo()).url);const s={channelName:e,...n,offer:i,connectionUrl:o},a=await this.safeConnect(e,n.wait,s),c=await cn(this,rn,"f").createClientStrategy(r,a),d=new un.ChannelClient(a,(()=>un.ChannelClient.wireClose(this.wire,a,a.endpointId)),c);return c.onEndpointDisconnect(a.channelId,(async()=>{try{await d.sendDisconnectAction()}catch(e){console.warn(`Something went wrong during disconnect for client with uuid: ${a.uuid} / name: ${a.name} / endpointId: ${a.endpointId}.`)}finally{un.ChannelClient.handleProviderDisconnect(a)}})),d}async create(e,t){if(!e)throw new Error("Please provide a channelName to create a channel");const{payload:{data:n}}=await this.wire.sendAction("create-channel",{channelName:e}),i=cn(this,rn,"f").createProvider(t,n);return this.on("client-disconnected",(t=>{t.channelName===e&&wn.ChannelProvider.handleClientDisconnection(i,t)})),i}}ke.Channel=fn,rn=new WeakMap,on=new WeakMap,sn=new WeakMap,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.InterAppPayload=Fe.InterApplicationBus=void 0;const gn=t,mn=c,vn=je,Cn=ke,bn=O;class In extends mn.Base{constructor(e){super(e),this.events={subscriberAdded:"subscriber-added",subscriberRemoved:"subscriber-removed"},this.refCounter=new vn.RefCounter,this.Channel=new Cn.Channel(e),this.emitter=new gn.EventEmitter,e.registerMessageHandler(this.onmessage.bind(this)),this.on=this.emitter.on.bind(this.emitter),this.removeAllListeners=this.emitter.removeAllListeners.bind(this.emitter)}async publish(e,t){await this.wire.sendAction("publish-message",{topic:e,message:t,sourceWindowName:this.me.name})}async send(e,t,n){const i=(0,bn.validateIdentity)(e);if(i)throw new Error(i);await this.wire.sendAction("send-message",{destinationUuid:e.uuid,destinationWindowName:e.name,topic:t,message:n,sourceWindowName:this.me.name})}subscribe(e,t,n){const i=this.createSubscriptionKey(e.uuid,e.name||"*",t);return this.emitter.on(i,n),this.refCounter.actOnFirst(i,(async()=>{await this.wire.sendAction("subscribe",{sourceUuid:e.uuid,sourceWindowName:e.name||"*",topic:t,destinationWindowName:this.me.name})}),(()=>Promise.resolve()))}unsubscribe(e,t,n){const i=e.name||"*",r=this.createSubscriptionKey(e.uuid,i,t);return this.emitter.removeListener(r,n),this.refCounter.actOnLast(r,(async()=>{await this.wire.sendAction("unsubscribe",{sourceUuid:e.uuid,sourceWindowName:i,topic:t,destinationWindowName:this.me.name})}),(()=>new Promise((e=>e)).then((()=>{}))))}processMessage(e){const{payload:{message:t,sourceWindowName:n,sourceUuid:i,topic:r}}=e,o=[this.createSubscriptionKey(i,n,r),this.createSubscriptionKey(i,"*",r),this.createSubscriptionKey("*","*",r)],s={uuid:i,name:n};o.forEach((e=>{this.emitter.emit(e,t,s)}))}emitSubscriverEvent(e,t){const{payload:{targetName:n,uuid:i,topic:r}}=t,o={name:n,uuid:i,topic:r};this.emitter.emit(e,o)}createSubscriptionKey(e,t,n){const i=t||"*";if(!(e&&i&&n))throw new Error("Missing uuid, name, or topic string");return function(...e){return e.map((e=>Buffer.from(`${e}`).toString("base64"))).join("/")}(e,i,n)}onmessage(e){const{action:t}=e;switch(t){case"process-message":this.processMessage(e);break;case this.events.subscriberAdded:this.emitSubscriverEvent(this.events.subscriberAdded,e);break;case this.events.subscriberRemoved:this.emitSubscriverEvent(this.events.subscriberRemoved,e)}return!0}}Fe.InterApplicationBus=In;Fe.InterAppPayload=class{};var En={};Object.defineProperty(En,"__esModule",{value:!0}),En.Clipboard=void 0;const xn=c;class An extends xn.Base{async writeText(e){await this.wire.sendAction("clipboard-write-text",e)}async readText(e){const{payload:t}=await this.wire.sendAction("clipboard-read-text",{type:e});return t.data}async writeImage(e){await this.wire.sendAction("clipboard-write-image",e)}async readImage(e={format:"dataURL"}){const{payload:t}=await this.wire.sendAction("clipboard-read-image",e);return t.data}async writeHtml(e){await this.wire.sendAction("clipboard-write-html",e)}async readHtml(e){const{payload:t}=await this.wire.sendAction("clipboard-read-html",{type:e});return t.data}async writeRtf(e){await this.wire.sendAction("clipboard-write-rtf",e)}async readRtf(e){const{payload:t}=await this.wire.sendAction("clipboard-read-rtf",{type:e});return t.data}async write(e){await this.wire.sendAction("clipboard-write",e)}async getAvailableFormats(e){const{payload:t}=await this.wire.sendAction("clipboard-read-formats",{type:e});return t.data}}En.Clipboard=An;var Pn={},Mn={},On={};Object.defineProperty(On,"__esModule",{value:!0}),On.ExternalApplication=void 0;const _n=c;class Sn extends _n.EmitterBase{constructor(e,t){super(e,"external-application",t.uuid),this.identity=t}getInfo(){return this.wire.sendAction("get-external-application-info",this.identity).then((({payload:e})=>e.data))}}On.ExternalApplication=Sn,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.ExternalApplicationModule=void 0;const Rn=c,Fn=On;class jn extends Rn.Base{wrap(e){return this.wire.sendAction("external-application-wrap").catch((e=>{})),Promise.resolve(new Fn.ExternalApplication(this.wire,{uuid:e}))}wrapSync(e){return this.wire.sendAction("external-application-wrap-sync").catch((e=>{})),new Fn.ExternalApplication(this.wire,{uuid:e})}}Mn.ExternalApplicationModule=jn,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Mn,e),n(On,e)}(Pn);var kn={},Ln={},Tn={};Object.defineProperty(Tn,"__esModule",{value:!0}),Tn._Frame=void 0;const $n=c;class Bn extends $n.EmitterBase{constructor(e,t){super(e,"frame",t.uuid,t.name),this.identity=t}getInfo(){return this.wire.sendAction("get-frame-info",this.identity).then((({payload:e})=>e.data))}getParentWindow(){return this.wire.sendAction("get-parent-window",this.identity).then((({payload:e})=>e.data))}}Tn._Frame=Bn,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln._FrameModule=void 0;const Gn=c,Wn=O,Hn=Tn;class Nn extends Gn.Base{async wrap(e){this.wire.sendAction("frame-wrap").catch((e=>{}));const t=(0,Wn.validateIdentity)(e);if(t)throw new Error(t);return new Hn._Frame(this.wire,e)}wrapSync(e){this.wire.sendAction("frame-wrap-sync").catch((e=>{}));const t=(0,Wn.validateIdentity)(e);if(t)throw new Error(t);return new Hn._Frame(this.wire,e)}getCurrent(){return this.wire.sendAction("frame-get-current").catch((e=>{})),Promise.resolve(new Hn._Frame(this.wire,this.wire.environment.getCurrentEntityIdentity()))}getCurrentSync(){return this.wire.sendAction("frame-get-current-sync").catch((e=>{})),new Hn._Frame(this.wire,this.wire.environment.getCurrentEntityIdentity())}}Ln._FrameModule=Nn,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Ln,e),n(Tn,e)}(kn);var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.GlobalHotkey=void 0;const Un=c;class Vn extends Un.EmitterBase{constructor(e){super(e,"global-hotkey")}async register(e,t){await this.on(e,t),await this.wire.sendAction("global-hotkey-register",{hotkey:e})}async unregister(e){await this.removeAllListeners(e),await this.wire.sendAction("global-hotkey-unregister",{hotkey:e})}async unregisterAll(){await Promise.all(this.eventNames().filter((e=>!("registered"===e||"unregistered"===e))).map((e=>this.removeAllListeners(e)))),await this.wire.sendAction("global-hotkey-unregister-all",{})}async isRegistered(e){const{payload:{data:t}}=await this.wire.sendAction("global-hotkey-is-registered",{hotkey:e});return t}}Dn.GlobalHotkey=Vn;var zn,Kn={},qn={},Yn={},Jn=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.Platform=void 0;const Zn=c,Qn=O,Xn=new Map;class ei extends Zn.EmitterBase{constructor(e,t){super(t.wire,"application",e.uuid),this.getClient=e=>{this.wire.sendAction("platform-get-client",this.identity).catch((e=>{}));const t=e||this.identity,{uuid:n}=t;if(!Xn.has(n)){const e=Jn(this,zn,"f").call(this,n);Xn.set(n,e)}return Xn.get(n)},zn.set(this,(async e=>{try{const t=`custom-frame-${e}`,n=await this._channel.connect(t,{wait:!1});return n.onDisconnection((()=>{Xn.delete(e)})),n}catch(t){throw Xn.delete(e),new Error("The targeted Platform is not currently running. Listen for application-started event for the given Uuid.")}})),this.launchLegacyManifest=this.launchContentManifest;const n=(0,Qn.validateIdentity)(e);if(n)throw new Error(n);this._channel=t,this.identity={uuid:e.uuid},this.Layout=this.fin.Platform.Layout,this.Application=this.fin.Application.wrapSync(this.identity)}async createView(e,t,n){this.wire.sendAction("platform-create-view",this.identity).catch((e=>{}));const i=await this.getClient(),r=await i.dispatch("create-view",{target:t,opts:e,targetView:n});if(!r||(0,Qn.validateIdentity)(r.identity))throw new Error(`When overwriting the createView call, please return an object that has a valid 'identity' property: ${JSON.stringify(r)}`);return this.fin.View.wrapSync(r.identity)}async createWindow(e){this.wire.sendAction("platform-create-window",this.identity).catch((e=>{}));const t=await this.getClient();e.reason||(e.reason="api-call");const n=await t.dispatch("create-view-container",e);if(!n||(0,Qn.validateIdentity)(n.identity))throw new Error(`When overwriting the createWindow call, please return an object that has a valid 'identity' property: ${JSON.stringify(n)}`);const{identity:i}=n,r=this.fin.Window.wrapSync(i);return r.name=i.name,r.uuid=i.uuid,r}async quit(){this.wire.sendAction("platform-quit",this.identity).catch((e=>{}));return(await this.getClient()).dispatch("quit")}async closeView(e){this.wire.sendAction("platform-close-view",this.identity).catch((e=>{}));const t=await this.getClient();await t.dispatch("close-view",{view:e})}async reparentView(e,t){console.warn("Platform.reparentView has been deprecated, please use Platform.createView"),this.wire.sendAction("platform-reparent-view",this.identity).catch((e=>{}));const n={...e,uuid:e.uuid??this.identity.uuid},i=await this.fin.View.wrap(n),r=await i.getOptions();return this.createView(r,t)}async getSnapshot(){this.wire.sendAction("platform-get-snapshot",this.identity).catch((e=>{}));return(await this.getClient()).dispatch("get-snapshot")}async getViewSnapshot(e){return(await this.getClient()).dispatch("get-view-snapshot",{viewIdentity:e})}async applySnapshot(e,t){this.wire.sendAction("platform-apply-snapshot",this.identity).catch((e=>{}));const n="Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.";let i;if("string"==typeof e)try{i=(await this._channel.wire.sendAction("get-application-manifest",{manifestUrl:e})).payload.data}catch(e){throw new Error(`${n}: ${e}`)}else i=e;if(!i.windows)throw new Error(n);const r=await this.getClient();return await r.dispatch("apply-snapshot",{snapshot:i,options:t}),this}async fetchManifest(e){return(await this.getClient()).dispatch("platform-fetch-manifest",{manifestUrl:e})}async launchContentManifest(e){this.wire.sendAction("platform-launch-content-manifest",this.identity).catch((()=>{}));const t=await this.getClient(),n=await this.fetchManifest(e);return t.dispatch("launch-into-platform",{manifest:n,manifestUrl:e}),this}async setWindowContext(e={},t){if(this.wire.sendAction("platform-set-window-context",this.identity).catch((e=>{})),!e)throw new Error("Please provide a serializable object or string to set the context.");const n=await this.getClient(),{entityType:i}=t?await this.fin.System.getEntityInfo(t.uuid,t.name):this.fin.me;await n.dispatch("set-window-context",{context:e,entityType:i,target:t||{uuid:this.fin.me.uuid,name:this.fin.me.name}})}async getWindowContext(e){this.wire.sendAction("platform-get-window-context",this.identity).catch((e=>{}));const t=await this.getClient(),{entityType:n}=e?await this.fin.System.getEntityInfo(e.uuid,e.name):this.fin.me;return t.dispatch("get-window-context",{target:e||{uuid:this.fin.me.uuid,name:this.fin.me.name},entityType:n})}async closeWindow(e,t={skipBeforeUnload:!1}){this.wire.sendAction("platform-close-window",this.identity).catch((e=>{}));return(await this.getClient()).dispatch("close-window",{windowId:e,options:t})}}Yn.Platform=ei,zn=new WeakMap;var ti={},ni={},ii={},ri={};function oi(e){switch(e){case"columns":case"grid":case"rows":case"tabs":return!0;default:return!1}}Object.defineProperty(ri,"__esModule",{value:!0}),ri.overrideFromComposables=ri.isValidPresetType=void 0,ri.isValidPresetType=oi,ri.overrideFromComposables=function(...e){return t=>e.reduceRight(((e,t)=>n=>t(e(n))),(e=>e))(t)},ri.default={isValidPresetType:oi};var si,ai=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(ii,"__esModule",{value:!0}),ii.Layout=void 0;const ci=B,di=O,hi=c,li=ri,ui=W,pi=de;class wi extends hi.Base{constructor(e,t){super(t),si.set(this,new ci.Lazy((async()=>ui.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(),pi.LAYOUT_CONTROLLER_ID,this.identity)))),this.replace=async e=>{this.wire.sendAction("layout-replace").catch((e=>{}));const t=await this.platform.getClient();await t.dispatch("replace-layout",{target:this.identity,opts:{layout:e}})},this.replaceView=async(e,t)=>{this.wire.sendAction("layout-replace-view").catch((e=>{}));const n=await this.platform.getClient();await n.dispatch("replace-view",{target:this.identity,opts:{viewToReplace:e,newView:t}})},this.applyPreset=async e=>{this.wire.sendAction("layout-apply-preset").catch((e=>{}));const t=await this.platform.getClient(),{presetType:n}=e;if(!n||!(0,li.isValidPresetType)(n))throw new Error("Cannot apply preset layout, please include an applicable presetType property in the PresetLayoutOptions.");await t.dispatch("apply-preset-layout",{target:this.identity,opts:{presetType:n}})};const n=(0,di.validateIdentity)(e);if(n)throw new Error(n);this.identity=e,this.platform=this.fin.Platform.wrapSync({uuid:e.uuid}),e.uuid===this.fin.me.uuid&&e.name===this.fin.me.name&&(this.init=this.fin.Platform.Layout.init)}async getConfig(){this.wire.sendAction("layout-get-config").catch((e=>{}));return(await this.platform.getClient()).dispatch("get-frame-snapshot",{target:this.identity})}async getCurrentViews(){this.wire.sendAction("layout-get-views").catch((e=>{}));const e=await this.platform.getClient();return(await e.dispatch("get-layout-views",{target:this.identity})).map((e=>this.fin.View.wrapSync(e)))}async getRootItem(){this.wire.sendAction("layout-get-root-item").catch((()=>{}));const e=await ai(this,si,"f").getValue(),t=await e.getRoot("layoutName"in this.identity?this.identity:void 0);return ui.LayoutNode.getEntity(t,e)}}ii.Layout=wi,si=new WeakMap;var yi,fi,gi,mi,vi,Ci=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},bi=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(ni,"__esModule",{value:!0}),ni.LayoutModule=void 0;const Ii=c,Ei=ii,xi=de;class Ai extends Ii.Base{constructor(){super(...arguments),yi.add(this),fi.set(this,!1),gi.set(this,null),this.init=async(e={})=>{if(this.wire.sendAction("layout-init").catch((e=>{})),!this.wire.environment.layoutAllowedInContext(this.fin))throw new Error("Layout.init can only be called from a Window context.");if(Ci(this,fi,"f"))throw new Error("Layout.init was already called, please use Layout.create to add additional layouts.");bi(this,fi,!0,"f"),bi(this,gi,await this.wire.environment.initLayoutManager(this.fin,this.wire,e),"f"),await this.wire.environment.applyLayoutSnapshot(this.fin,Ci(this,gi,"f"),e);const t={name:this.fin.me.name,uuid:this.fin.me.uuid};if(!e.layoutManagerOverride){const e={layoutName:xi.DEFAULT_LAYOUT_KEY,...t};return Ci(this,mi,"f").call(this,e)}return this.wrapSync(t)},mi.set(this,(e=>{const t="[Layout] You are using a deprecated property `layoutManager` - it will throw if you access it starting in v37.",n=new Proxy({},{get(e,n){throw console.warn(`[Layout-mgr-proxy] accessing ${n.toString()}`),new Error(t)}}),i=Object.assign(this.wrapSync(e),{layoutManager:n});return new Proxy(i,{get(e,n){if("layoutManager"===n)throw console.warn(`[Layout-proxy] accessing ${n.toString()}`),new Error(t);return e[n]}})})),this.getCurrentLayoutManagerSync=()=>Ci(this,yi,"m",vi).call(this,"fin.Platform.Layout.getCurrentLayoutManagerSync()"),this.create=async e=>this.wire.environment.createLayout(Ci(this,yi,"m",vi).call(this,"fin.Platform.Layout.create()"),e),this.destroy=async e=>this.wire.environment.destroyLayout(Ci(this,yi,"m",vi).call(this,"fin.Platform.Layout.destroy()"),e)}async wrap(e){return this.wire.sendAction("layout-wrap").catch((e=>{})),new Ei.Layout(e,this.wire)}wrapSync(e){return this.wire.sendAction("layout-wrap-sync").catch((e=>{})),new Ei.Layout(e,this.wire)}async getCurrent(){if(this.wire.sendAction("layout-get-current").catch((e=>{})),!this.fin.me.isWindow)throw new Error("You are not in a Window context. Only Windows can have a Layout.");const{uuid:e,name:t}=this.fin.me;return this.wrap({uuid:e,name:t})}getCurrentSync(){if(this.wire.sendAction("layout-get-current-sync").catch((e=>{})),!this.fin.me.isWindow)throw new Error("You are not in a Window context. Only Windows can have a Layout.");const{uuid:e,name:t}=this.fin.me;return this.wrapSync({uuid:e,name:t})}}ni.LayoutModule=Ai,fi=new WeakMap,gi=new WeakMap,mi=new WeakMap,yi=new WeakSet,vi=function(e){if(!Ci(this,gi,"f"))throw new Error(`You must call init before using the API ${e}`);return Ci(this,gi,"f")},function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(ni,e),n(ii,e)}(ti),Object.defineProperty(qn,"__esModule",{value:!0}),qn.PlatformModule=void 0;const Pi=c,Mi=Yn,Oi=ti;class _i extends Pi.Base{constructor(e,t){super(e),this._channel=t,this.Layout=new Oi.LayoutModule(this.wire)}async init(e){if(!fin.__internal_.isPlatform||fin.me.name!==fin.me.uuid)throw new Error("fin.Platform.init should only be called from a custom platform provider running in the main window of the application.");return this.wire.environment.initPlatform(this.fin,e)}async wrap(e){return this.wire.sendAction("platform-wrap").catch((e=>{})),new Mi.Platform({uuid:e.uuid},this._channel)}wrapSync(e){return this.wire.sendAction("platform-wrap-sync").catch((e=>{})),new Mi.Platform({uuid:e.uuid},this._channel)}async getCurrent(){return this.wire.sendAction("platform-get-current").catch((e=>{})),this.wrap({uuid:this.wire.me.uuid})}getCurrentSync(){return this.wire.sendAction("platform-get-current-sync").catch((e=>{})),this.wrapSync({uuid:this.wire.me.uuid})}start(e){return this.wire.sendAction("platform-start").catch((e=>{})),new Promise((async(t,n)=>{try{const{uuid:n}=e,i=await this.fin.Application._create({...e,isPlatformController:!0});i.once("platform-api-ready",(()=>t(this.wrapSync({uuid:n})))),i._run({uuid:n})}catch(e){n(e)}}))}startFromManifest(e,t){return this.wire.sendAction("platform-start-from-manifest").catch((e=>{})),new Promise((async(n,i)=>{try{const i=await this.fin.Application._createFromManifest(e);i.once("platform-api-ready",(()=>n(this.wrapSync({uuid:i.identity.uuid})))),i._run(t)}catch(e){i(e)}}))}}qn.PlatformModule=_i,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(qn,e),n(Yn,e)}(Kn);var Si={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMe=e.getBaseMe=e.environmentUnsupportedMessage=void 0;const t=me(),n=kn,i=Pe(),r=Pn;function o(e,t,n){return{...{isView:"view"===e,isWindow:"window"===e,isFrame:"iframe"===e,isExternal:"external connection"===e},uuid:t,name:n,entityType:e}}e.environmentUnsupportedMessage="You are not running in OpenFin.",e.getBaseMe=o,e.getMe=function(s){const{uuid:a,name:c,entityType:d}=s.me,h={setContext(){throw new Error(e.environmentUnsupportedMessage)},addContextHandler(){throw new Error(e.environmentUnsupportedMessage)},getContextGroups(){throw new Error(e.environmentUnsupportedMessage)},joinContextGroup(){throw new Error(e.environmentUnsupportedMessage)},removeFromContextGroup(){throw new Error(e.environmentUnsupportedMessage)},getAllClientsInContextGroup(){throw new Error(e.environmentUnsupportedMessage)},getInfoForContextGroup(){throw new Error(e.environmentUnsupportedMessage)}},l="Interop API has not been instantiated. Either connection has failed or you have not declared interop in your config.",u={setContext(){throw new Error(l)},addContextHandler(){throw new Error(l)},getContextGroups(){throw new Error(l)},joinContextGroup(){throw new Error(l)},removeFromContextGroup(){throw new Error(l)},getAllClientsInContextGroup(){throw new Error(l)},getInfoForContextGroup(){throw new Error(l)}},p={eventNames:()=>{throw new Error(e.environmentUnsupportedMessage)},emit:()=>{throw new Error(e.environmentUnsupportedMessage)},listeners:()=>{throw new Error(e.environmentUnsupportedMessage)},listenerCount:()=>{throw new Error(e.environmentUnsupportedMessage)},on:()=>{throw new Error(e.environmentUnsupportedMessage)},addListener:()=>{throw new Error(e.environmentUnsupportedMessage)},once:()=>{throw new Error(e.environmentUnsupportedMessage)},prependListener:()=>{throw new Error(e.environmentUnsupportedMessage)},prependOnceListener:()=>{throw new Error(e.environmentUnsupportedMessage)},removeListener:()=>{throw new Error(e.environmentUnsupportedMessage)},removeAllListeners:()=>{throw new Error(e.environmentUnsupportedMessage)}};switch(d){case"view":return Object.assign(new t.View(s,{uuid:a,name:c}),o(d,a,c),{interop:u,isOpenFin:!0});case"window":return Object.assign(new i._Window(s,{uuid:a,name:c}),o(d,a,c),{interop:u,isOpenFin:!0});case"iframe":return Object.assign(new n._Frame(s,{uuid:a,name:c}),o(d,a,c),{interop:u,isOpenFin:!0});case"external connection":return Object.assign(new r.ExternalApplication(s,{uuid:a}),o(d,a,c),{interop:u,isOpenFin:!1});default:return{...o(d,a,c),...p,interop:h,isOpenFin:!1}}}}(Si);var Ri={},Fi={},ji={};Object.defineProperty(ji,"__esModule",{value:!0}),ji.createWarningObject=ji.createUnusableObject=void 0,ji.createUnusableObject=function(e){const t=()=>{throw new Error(e)};return new Proxy({},{apply:t,construct:t,defineProperty:t,deleteProperty:t,get:t,getOwnPropertyDescriptor:t,getPrototypeOf:t,has:t,isExtensible:t,ownKeys:t,preventExtensions:t,set:t,setPrototypeOf:t})},ji.createWarningObject=function(e,t){return new Proxy(t,{get:(...t)=>(console.warn(e),Reflect.get(...t)),set:(...t)=>(console.warn(e),Reflect.set(...t)),getOwnPropertyDescriptor:(...t)=>(console.warn(e),Reflect.getOwnPropertyDescriptor(...t)),ownKeys:(...t)=>(console.warn(e),Reflect.ownKeys(...t))})};var ki,Li={},Ti={};var $i={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapIntentHandler=e.BROKER_ERRORS=e.generateOverrideWarning=e.generateOverrideError=e.wrapContextHandler=e.wrapInTryCatch=e.generateId=void 0;e.generateId=()=>`${Math.random()}${Date.now()}`;e.wrapInTryCatch=(e,t)=>(...n)=>{try{return e(...n)}catch(e){throw new Error((t||"")+e)}};e.wrapContextHandler=(e,t)=>async n=>{try{await e(n)}catch(e){throw console.error(`Error thrown by handler ${t} for context type ${n.type}: ${e}`),e}};e.generateOverrideError=(e,t)=>`You have tried to to use ${e} but ${t} has not been overridden in the Interop Broker. Please override this function. Refer to our documentation for more info.`;e.generateOverrideWarning=(e,t,n,i)=>{const{uuid:r,name:o}=n;return i?`Entity with identity: ${r}/${o} has called ${i} or ${e} but ${t} has not been overridden.`:`Entity with identity: ${r}/${o} has called ${e} but ${t} has not been overridden.`},e.BROKER_ERRORS={fireIntent:(0,e.generateOverrideError)("fireIntent","handleFiredIntent"),fireIntentForContext:(0,e.generateOverrideError)("fireIntentForContext","handleFiredIntentForContext"),getInfoForIntent:(0,e.generateOverrideError)("getInfoForIntent","handleInfoForIntent"),getInfoForIntentsByContext:(0,e.generateOverrideError)("getInfoForIntentsByContext","handleInfoForIntentsByContext"),joinSessionContextGroupWithJoinContextGroup:"The Context Group you have tried to join is a Session Context Group. Custom Context Groups can only be defined by the Interop Broker through code or manifest configuration. Please use joinSessionContextGroup.",fdc3Open:(0,e.generateOverrideError)("fdc3.open","fdc3HandleOpen"),fdc3FindInstances:(0,e.generateOverrideError)("fdc3.findInstances","fdc3HandleFindInstances"),fdc3GetAppMetadata:(0,e.generateOverrideError)("fdc3.getAppMetadata","fdc3HandleGetAppMetadata"),fdc3GetInfo:(0,e.generateOverrideError)("fdc3.getInfo","fdc3HandleGetInfo")};e.wrapIntentHandler=(e,t)=>async n=>{try{return e(n)}catch(e){throw console.error(`Error thrown by handler ${t}: ${e}`),e}}}($i);var Bi,Gi,Wi={};function Hi(){if(Gi)return Li;Gi=1;var e,t,i,r=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},s=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Li,"__esModule",{value:!0}),Li.InteropBroker=void 0;const a=c,d=function(){if(ki)return Ti;ki=1,Object.defineProperty(Ti,"__esModule",{value:!0});const e=pr();return Ti.default=class{constructor(e,t){this.provider=e,this.id=t,this.lastContext=void 0,this.contextGroupMap=new Map,this.clients=new Map,this.registerListeners()}registerListeners(){this.provider.register(`sessionContextGroup:getContext-${this.id}`,this.getCurrentContext.bind(this)),this.provider.register(`sessionContextGroup:setContext-${this.id}`,this.setContext.bind(this)),this.provider.register(`sessionContextGroup:handlerAdded-${this.id}`,this.handlerAdded.bind(this)),this.provider.register(`sessionContextGroup:handlerRemoved-${this.id}`,this.handlerRemoved.bind(this))}getCurrentContext(e){return e.type?this.contextGroupMap.get(e.type):this.lastContext}setContext(t,n){const{context:i}=t,r=e.InteropBroker.checkContextIntegrity(i);if(!1===r.isValid)throw new Error(`Failed to set Context - bad Context. Reason: ${r.reason}. Context: ${JSON.stringify(i)}`);if(!this.getClientState(n))throw new Error(`Client with Identity: ${n.uuid} ${n.name} not in Session Client State Map`);this.contextGroupMap.set(i.type,i),this.lastContext=i,Array.from(this.clients.values()).forEach((e=>{e.contextHandlers.get(i.type)?.forEach((t=>{this.provider.dispatch(e.clientIdentity,t,i)})),e.globalHandler&&this.provider.dispatch(e.clientIdentity,e.globalHandler,i)}))}getClientState(e){return this.clients.get(e.endpointId)}async handlerAdded(e,t){const{handlerId:n,contextType:i}=e,r=this.getClientState(t);if(!r)throw new Error(`Client with Identity: ${t.uuid} ${t.name} not in Client State Map`);if(i){const e=r.contextHandlers.get(i)||[];r.contextHandlers.set(i,[...e,n]);const o=this.contextGroupMap.get(i);o&&await this.provider.dispatch(t,n,o)}else{r.globalHandler=n;const e=[...this.contextGroupMap.keys()].map((async e=>{const i=this.contextGroupMap.get(e);i&&await this.provider.dispatch(t,n,i)}));await Promise.all(e)}}handlerRemoved(e,t){const{handlerId:n}=e,i=this.clients.get(t.endpointId);i?(Array.from(i.contextHandlers).forEach((([,e])=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)})),i.globalHandler===n&&(i.globalHandler=void 0)):console.warn(`Trying to remove a handler from a client that isn't mapped. handlerId: ${n}. clientIdentity: ${t}`)}registerNewClient(e){if(!this.clients.has(e.endpointId)){const t={contextHandlers:new Map,clientIdentity:e,globalHandler:void 0};this.clients.set(e.endpointId,t)}}onDisconnection(e){this.clients.delete(e.endpointId)}},Ti}(),h=$i,l=n,u=function(){if(Bi)return Wi;Bi=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.PrivateChannelProvider=void 0;const e=Hi();return Wi.PrivateChannelProvider=class t{constructor(e,t){this.provider=e,this.id=t,this.clients=new Map,this.registerListeners(),this.contextByContextType=new Map,this.lastContext=void 0,this.provider.onConnection((e=>this.registerNewClient(e))),this.provider.onDisconnection((async e=>{const{endpointId:t}=e;this.clients.has(t)&&await this.handleClientDisconnecting(e),0===(await this.provider.getAllClientInfo()).length&&this.provider.destroy()}))}getClientState(e){return this.clients.get(e.endpointId)}registerListeners(){this.provider.register("broadcast",this.broadcast.bind(this)),this.provider.register("getCurrentContext",this.getCurrentContext.bind(this)),this.provider.register("contextHandlerAdded",this.contextHandlerAdded.bind(this)),this.provider.register("contextHandlerRemoved",this.contextHandlerRemoved.bind(this)),this.provider.register("nonStandardHandlerRemoved",this.nonStandardHandlerRemoved.bind(this)),this.provider.register("onAddContextHandlerAdded",this.onAddContextHandlerAdded.bind(this)),this.provider.register("onDisconnectHandlerAdded",this.onDisconnectHandlerAdded.bind(this)),this.provider.register("onUnsubscribeHandlerAdded",this.onUnsubscribeHandlerAdded.bind(this)),this.provider.register("clientDisconnecting",((e,t)=>{this.handleClientDisconnecting(t)}))}broadcast(t,n){const{context:i}=t;if(!this.getClientState(n))throw new Error(`Client with Identity: ${n.uuid} ${n.name}, tried to call broadcast, is not connected to this Private Channel`);const r=e.InteropBroker.checkContextIntegrity(i);if(!1===r.isValid)throw new Error(`Failed to broadcast - bad Context. Reason: ${r.reason}. Context: ${JSON.stringify(i)}`);this.contextByContextType.set(i.type,i),this.lastContext=i,Array.from(this.clients.values()).forEach((e=>{const t=e.handlerIdsByContextTypes.get(i.type);t&&t.forEach((t=>{this.provider.dispatch(e.clientIdentity,t,i)})),e.globalHandler&&this.provider.dispatch(e.clientIdentity,e.globalHandler,i)}))}getCurrentContext(e,t){const{contextType:n}=e;if(!this.getClientState(t))throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call getCurrentContext, is not connected to this Private Channel`);if(void 0!==n){return this.contextByContextType.get(n)||null}return this.lastContext?this.lastContext:null}contextHandlerAdded(e,t){const{handlerId:n,contextType:i}=e,r=this.getClientState(t);if(!r)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call addContextListener, is not connected to this Private Channel`);if(i){const e=r.handlerIdsByContextTypes.get(i)||[];r.handlerIdsByContextTypes.set(i,[...e,n])}else r.globalHandler=n;Array.from(this.clients.values()).forEach((e=>{e.clientIdentity.endpointId!==t.endpointId&&e.onAddContextListenerHandlerId&&this.provider.dispatch(e.clientIdentity,e.onAddContextListenerHandlerId,i)}))}async contextHandlerRemoved(e,t){const{handlerId:n}=e,i=this.getClientState(t);if(i){let e;if(i.globalHandler===n)i.globalHandler=void 0;else for(const[t,r]of i.handlerIdsByContextTypes){const i=r.indexOf(n);i>-1&&(r.splice(i,1),e=t)}const r=(await this.getConnectedClients()).map((async n=>{const{clientIdentity:i,clientIdentity:{endpointId:r},onUnsubscribeHandlerId:o}=n;r!==t.endpointId&&o&&await this.provider.dispatch(i,o,e)}));try{await Promise.all(r)}catch(e){throw console.error(`Problem when attempting to dispatch to onUnsubscribeHandlers. Error: ${e} Removing Client: ${n}. uuid: ${t.uuid}. name: ${t.name}. endpointId: ${t.endpointId}`),new Error(e)}}else console.warn(`Trying to remove a handler from a client that isn't mapped. handlerId: ${n}. uuid: ${t.uuid}. name: ${t.name}. endpointId: ${t.endpointId}.`)}nonStandardHandlerRemoved(e,t){const{handlerId:n}=e,i=this.getClientState(t);i?i.onDisconnectHandlerId===n?i.onDisconnectHandlerId=void 0:i.onAddContextListenerHandlerId===n?i.onAddContextListenerHandlerId=void 0:i.onUnsubscribeHandlerId===n&&(i.onUnsubscribeHandlerId=void 0):console.warn(`Trying to remove a handler from a client that isn't mapped. handlerId: ${n}. clientIdentity: ${t}`)}onAddContextHandlerAdded(e,t){const n=this.getClientState(t),{handlerId:i}=e;if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call onAddContextListener, is not connected to this Private Channel`);n.onAddContextListenerHandlerId=i,Array.from(this.clients.values()).forEach((e=>{e.clientIdentity.endpointId!==t.endpointId&&Array.from(e.handlerIdsByContextTypes.keys()).forEach((e=>{this.provider.dispatch(t,i,e)}))}))}onDisconnectHandlerAdded(e,t){const n=this.getClientState(t),{handlerId:i}=e;if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call onDisconnect, is not connected to this Private Channel`);n.onDisconnectHandlerId=i}onUnsubscribeHandlerAdded(e,t){const n=this.getClientState(t),{handlerId:i}=e;if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call onUnsubscribe, is not connected to this Private Channel`);n.onUnsubscribeHandlerId=i}removeClient(e){const t=this.getClientState(e);if(!t)throw new Error(`Client with Identity: ${e.uuid} ${e.name}, tried to call disconnect, is not connected to this Private Channel`);t.handlerIdsByContextTypes.clear(),this.clients.delete(e.endpointId)}async fireOnDisconnectForOtherClients(e){const{endpointId:t}=e,n=(await this.getConnectedClients()).map((async e=>{const{clientIdentity:{endpointId:n},onDisconnectHandlerId:i}=e;n!==t&&i&&await this.provider.dispatch(e.clientIdentity,i)}));try{await Promise.all(n)}catch(t){throw console.error(`Problem when attempting to dispatch to onDisconnectHandlers. Error: ${t} Disconnecting Client: uuid: ${e.uuid}. name: ${e.name}. endpointId: ${e.endpointId}`),new Error(t)}}async unsubscribeAll(e){const{endpointId:t}=e,n=this.clients.get(t);if(n){const t=Array.from(n.handlerIdsByContextTypes.values()).flat(),i=n.globalHandler;if(t.length>0){const n=t.map((async t=>this.contextHandlerRemoved({handlerId:t},e)));try{await Promise.all(n)}catch(e){console.error(e.message)}}if(i)try{await this.contextHandlerRemoved({handlerId:i},e)}catch(e){console.error(e.message)}}}async handleClientDisconnecting(e){await this.unsubscribeAll(e),this.removeClient(e),await this.fireOnDisconnectForOtherClients(e)}registerNewClient(e){if(!this.clients.has(e.endpointId)){const t={clientIdentity:e,handlerIdsByContextTypes:new Map,globalHandler:void 0,onAddContextListenerHandlerId:void 0,onUnsubscribeHandlerId:void 0,onDisconnectHandlerId:void 0};this.clients.set(e.endpointId,t)}}async getConnectedClients(){const e=await this.provider.getAllClientInfo();return Array.from(this.clients.values()).filter((t=>{const{uuid:n,name:i}=t.clientIdentity;return e.some((e=>i===e.name&&n===e.uuid))}))}static init(e,n){return new t(e,n)}},Wi}(),p=B,w=[{id:"green",displayMetadata:{color:"#00CC88",name:"green"}},{id:"purple",displayMetadata:{color:"#8C61FF",name:"purple"}},{id:"orange",displayMetadata:{color:"#FF8C4C",name:"orange"}},{id:"red",displayMetadata:{color:"#FF5E60",name:"red"}},{id:"pink",displayMetadata:{color:"#FF8FB8",name:"pink"}},{id:"yellow",displayMetadata:{color:"#E9FF8F",name:"yellow"}}];let y=class n extends a.Base{constructor(n,o,a){super(n),e.set(this,void 0),t.set(this,void 0),i.set(this,void 0),this.getProvider=()=>s(this,i,"f").getValue(),this.interopClients=new Map,this.contextGroupsById=new Map,r(this,t,a.contextGroups??[...w],"f"),r(this,e,a.fdc3Info,"f"),a?.logging&&(this.logging=a.logging),this.intentClientMap=new Map,this.lastContextMap=new Map,this.sessionContextGroupMap=new Map,r(this,i,new p.Lazy(o),"f"),this.setContextGroupMap(),this.setupChannelProvider()}static createClosedConstructor(...e){return class extends n{constructor(...t){if(t.length){const[n,i,r]=t;if(r&&"object"==typeof r&&!(0,l.isEqual)(r,e[2]))return console.warn("You have modified the parameters of the InteropOverride constructor. This behavior is deprecated and will be removed in a future version. You can modify these options in your manifest. Please consult our Interop docs for guidance on migrating to the new override scheme."),void super(e[0],e[1],r);console.warn("You are attempting to pass arguments to the InteropOverride constructor. This is not necessary, and these passed arguments will be ignored. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.")}super(...e)}}}setContext({context:e},t){this.wire.sendAction("interop-broker-set-context").catch((e=>{}));const n=this.getClientState(t);if(!n||!n.contextGroupId)throw n?new Error("You must join a context group before you can set context."):new Error(`Client with Identity: ${t.uuid} ${t.name} not in Client State Map`);{const{contextGroupId:t}=n;this.setContextForGroup({context:e},t)}}setContextForGroup({context:e},t){this.wire.sendAction("interop-broker-set-context-for-group").catch((e=>{}));const i=this.contextGroupsById.get(t);if(!i)throw new Error(`Unable to set context for context group that isn't in the context group mapping: ${t}.`);const r=n.checkContextIntegrity(e);if(!1===r.isValid)throw new Error(`Failed to set Context - bad Context. Reason: ${r.reason}. Context: ${JSON.stringify(e)}`);const o=e.type;i.set(o,e),this.lastContextMap.set(t,o);Array.from(this.interopClients.values()).filter((e=>e.contextGroupId===t)).forEach((t=>{for(const[,i]of t.contextHandlers)n.isContextTypeCompatible(o,i.contextType)&&this.invokeContextHandler(t.clientIdentity,i.handlerId,e)}))}getCurrentContext(e,t){this.wire.sendAction("interop-broker-get-current-context").catch((e=>{}));const n=this.getClientState(t);if(!n?.contextGroupId)throw new Error("You must be a member of a context group to call getCurrentContext");const{contextGroupId:i}=n,r=this.contextGroupsById.get(i),o=this.lastContextMap.get(i),s=e?.contextType??o;return r&&s?r.get(s):void 0}async joinContextGroup({contextGroupId:e,target:t},i){if(this.wire.sendAction("interop-broker-join-context-group").catch((e=>{})),this.sessionContextGroupMap.has(e))throw new Error(h.BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup);if(t){n.hasEndpointId(t)&&await this.addClientToContextGroup({contextGroupId:e},t);try{const n=this.channel.connections.filter((e=>e.uuid===t.uuid&&e.name===t.name));if(!n.length)throw new Error(`Given Identity ${t.uuid} ${t.name} is not connected to the Interop Broker.`);n.length>1&&console.warn(`More than one connection found for identity ${t.uuid} ${t.name}`);const i=[];for(const t of n)i.push(this.addClientToContextGroup({contextGroupId:e},t));await Promise.all(i)}catch(e){throw new Error(e)}}else await this.addClientToContextGroup({contextGroupId:e},i)}async addClientToContextGroup({contextGroupId:e},t){this.wire.sendAction("interop-broker-add-client-to-context-group").catch((e=>{}));const n=this.getClientState(t);if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name} not in Client State Map`);if(!this.getContextGroups().find((t=>t.id===e)))throw new Error(`Attempting to join a context group that does not exist: ${e}. You may only join existing context groups.`);if(n.contextGroupId!==e){n.contextGroupId=e,await this.setCurrentContextGroupInClientOptions(t,e);const i=this.contextGroupsById.get(e);for(const[,e]of n.contextHandlers){const{contextType:n,handlerId:r}=e;if(void 0===n)i.forEach(((e,n)=>{this.invokeContextHandler(t,r,e)}));else if(i.has(n)){const e=i.get(n);e&&this.invokeContextHandler(t,r,e)}}}}async removeFromContextGroup({target:e},t){if(this.wire.sendAction("interop-broker-remove-from-context-group").catch((e=>{})),e){n.hasEndpointId(e)&&await this.removeClientFromContextGroup(e);try{const t=this.channel.connections.filter((t=>t.uuid===e.uuid&&t.name===e.name));if(!t.length)throw new Error(`No connection found for given Identity ${e.uuid} ${e.name}`);t.length>1&&console.warn(`More than one connection found for identity ${e.uuid} ${e.name}`);const n=[];for(const e of t)n.push(this.removeClientFromContextGroup(e));await Promise.all(n)}catch(e){throw new Error(e)}}else await this.removeClientFromContextGroup(t)}async removeClientFromContextGroup(e){this.wire.sendAction("interop-broker-remove-client-from-context-group").catch((e=>{}));const t=this.getClientState(e);t&&(t.contextGroupId=void 0),await this.setCurrentContextGroupInClientOptions(e,null)}getContextGroups(){return this.wire.sendAction("interop-broker-get-context-groups").catch((e=>{})),s(this,t,"f").map((e=>({...e})))}getInfoForContextGroup({contextGroupId:e}){return this.wire.sendAction("interop-broker-get-info-for-context-group").catch((e=>{})),this.getContextGroups().find((t=>t.id===e))}getAllClientsInContextGroup({contextGroupId:e}){this.wire.sendAction("interop-broker-get-all-clients-in-context-group").catch((e=>{}));return Array.from(this.interopClients.values()).filter((t=>t.contextGroupId===e)).map((e=>e.clientIdentity))}async handleFiredIntent(e,t){const n=(0,h.generateOverrideWarning)("fdc3.raiseIntent","InteropBroker.handleFiredIntent",t,"interopClient.fireIntent");throw console.warn(n),new Error(h.BROKER_ERRORS.fireIntent)}async setIntentTarget(e,t){this.wire.sendAction("interop-broker-set-intent-target").catch((e=>{}));const n=this.intentClientMap.get(t.name),i=`intent-handler-${e.name}`;if(n){const t=n.get(i);if(t){if(t.pendingIntents.push(e),t.clientIdentity&&t.isReady){const{clientIdentity:e,pendingIntents:n}=t;try{const r=n[n.length-1];await this.invokeIntentHandler(e,i,r),t.pendingIntents=[]}catch(n){console.error(`Error invoking intent handler for client ${e.uuid}/${e.name}/${e.endpointId}`),t.isReady=!1}}}else n.set(i,{isReady:!1,pendingIntents:[e]})}else{this.intentClientMap.set(t.name,new Map);const n=this.intentClientMap.get(t.name);n&&n.set(i,{isReady:!1,pendingIntents:[e]})}}async handleInfoForIntent(e,t){const n=(0,h.generateOverrideWarning)("fdc3.findIntent","InteropBroker.handleInfoForIntent",t,"interopClient.getInfoForIntent");throw console.warn(n),new Error(h.BROKER_ERRORS.getInfoForIntent)}async handleInfoForIntentsByContext(e,t){const n=(0,h.generateOverrideWarning)("fdc3.findIntentsByContext","InteropBroker.handleInfoForIntentsByContext",t,"interopClient.getInfoForIntentsByContext");throw console.warn(n),new Error(h.BROKER_ERRORS.getInfoForIntentsByContext)}async handleFiredIntentForContext(e,t){const n=(0,h.generateOverrideWarning)("fdc3.raiseIntentForContext","InteropBroker.handleFiredIntentForContext",t,"interopClient.fireIntentForContext");throw console.warn(n),new Error(h.BROKER_ERRORS.fireIntentForContext)}async clientDisconnected(e){}async fdc3HandleOpen({app:e,context:t},n){const i=(0,h.generateOverrideWarning)("fdc3.open","InteropBroker.fdc3HandleOpen",n);throw console.warn(i),new Error(h.BROKER_ERRORS.fdc3Open)}async fdc3HandleFindInstances(e,t){const n=(0,h.generateOverrideWarning)("fdc3.open","InteropBroker.fdc3HandleFindInstances",t);throw console.warn(n),new Error(h.BROKER_ERRORS.fdc3FindInstances)}async fdc3HandleGetAppMetadata(e,t){const n=(0,h.generateOverrideWarning)("fdc3.getAppMetadata","InteropBroker.fdc3HandleGetAppMetadata",t);throw console.warn(n),new Error(h.BROKER_ERRORS.fdc3GetAppMetadata)}async invokeContextHandler(e,t,n){const i=await this.getProvider();try{await i.dispatch(e,t,n)}catch(i){console.error(`Error invoking context handler ${t} for context type ${n.type} in client ${e.uuid}/${e.name}/${e.endpointId}`,i)}}async invokeIntentHandler(e,t,n){const i=await this.getProvider();await i.dispatch(e,t,n)}async fdc3HandleGetInfo(t,n){const{fdc3Version:i}=t;return{fdc3Version:i,...s(this,e,"f"),optionalFeatures:{OriginatingAppMetadata:!1,UserChannelMembershipAPIs:!0},appMetadata:{appId:"",instanceId:""}}}async getAllClientInfo(){return(await this.getProvider()).getAllClientInfo()}decorateSnapshot(e){return{...e,interopSnapshotDetails:{contextGroupStates:this.getContextGroupStates()}}}applySnapshot(e,t){const n=e?.interopSnapshotDetails?.contextGroupStates;n&&(t?.closeExistingWindows||this.updateExistingClients(n),this.rehydrateContextGroupStates(n))}updateExistingClients(e){this.interopClients.forEach((t=>{const{clientIdentity:i,contextGroupId:r,contextHandlers:o}=t;if(r){const t=e[r];for(const[,e]of Object.entries(t))o.forEach((t=>{const{handlerId:r,contextType:o}=t;n.isContextTypeCompatible(e.type,o)&&this.invokeContextHandler(i,r,e)}))}}))}getContextGroupStates(){return n.toObject(this.contextGroupsById)}rehydrateContextGroupStates(e){const t=Object.entries(e);for(const[e,n]of t){const t=Object.entries(n);for(const[n,i]of t)if(this.contextGroupsById.has(e)){this.contextGroupsById.get(e).set(n,i)}else console.warn(`Attempting to set a context group that isn't in the context group mapping. Skipping context group rehydration for: ${e}`)}}contextHandlerRegistered({contextType:e,handlerId:t},n){const i={contextType:e,handlerId:t},r=this.getClientState(n);if(r?.contextHandlers.set(t,i),r&&r.contextGroupId){const{contextGroupId:i}=r,o=this.contextGroupsById.get(i);if(void 0===e)o.forEach(((e,i)=>{this.invokeContextHandler(n,t,e)}));else if(o.has(e)){const i=o.get(e);i&&this.invokeContextHandler(n,t,i)}}}async intentHandlerRegistered(e,t){const{handlerId:n}=e,i=this.intentClientMap.get(t.name),r=i?.get(n);if(i)if(r){const{pendingIntents:e}=r;r.clientIdentity=t,r.isReady=!0;try{if(e.length>0){const i=e[e.length-1];await this.invokeIntentHandler(t,n,i),r.pendingIntents=[]}}catch(e){console.error(`Error invoking intent handler: ${n} for client ${t.uuid}/${t.name}/${t.endpointId}`)}}else i.set(n,{isReady:!0,pendingIntents:[],clientIdentity:t});else{this.intentClientMap.set(t.name,new Map);const e=this.intentClientMap.get(t.name);e&&e.set(n,{isReady:!0,pendingIntents:[],clientIdentity:t})}}removeContextHandler({handlerId:e},t){const n=this.getClientState(t);n&&n.contextHandlers.delete(e)}handleJoinSessionContextGroup({sessionContextGroupId:e},t){try{if(!e)throw new Error("Failed to join session context group: must specify group id.");const n=this.sessionContextGroupMap.get(e);if(n)n.registerNewClient(t);else{const n=new d.default(this.channel,e);n.registerNewClient(t),this.sessionContextGroupMap.set(e,n)}return{hasConflict:this.contextGroupsById.has(e)}}catch(e){throw new Error(e)}}getClientState(e){return this.interopClients.get(e.endpointId)}static toObject(e){const t=Object.fromEntries(e),n={};return Object.entries(t).forEach((([e,t])=>{const i=Object.fromEntries(t);n[e]=i})),n}static checkContextIntegrity(e){if(!e)return{isValid:!1,reason:"No context supplied"};if("object"!=typeof e)return{isValid:!1,reason:"Context must be an Object"};if(!e.type)return{isValid:!1,reason:"Context must have a type property"};if(e.id&&"object"!=typeof e.id)return{isValid:!1,reason:"Context id must be an Object populated with key-value identifiers (if set)"};if(e.id){const{id:t}=e,n=Object.keys(t);let i=!1;if(!n.length)return{isValid:!1,reason:"Context id must have at least one key-value identifier"};if(n.forEach((e=>{"string"==typeof e&&"string"==typeof t[e]||(i=!0)})),i)return{isValid:!1,reason:"Context id key-value identifiers must be of type string"}}return e.name&&"string"!=typeof e.name?{isValid:!1,reason:"Context name must be of string type (if set)"}:{isValid:!0}}static hasEndpointId(e){return void 0!==e.endpointId}static isContextTypeCompatible(e,t){return void 0===t||e===t}setContextGroupMap(){for(const e of this.getContextGroups())this.contextGroupsById.set(e.id,new Map)}async setCurrentContextGroupInClientOptions(e,t){try{const n=await this.fin.System.getEntityInfo(e.uuid,e.name);let i;"view"===n.entityType?i=await this.fin.View.wrap(e):"window"===n.entityType&&(i=await this.fin.Window.wrap(e)),i&&await i.updateOptions({interop:{currentContextGroup:t}})}catch(e){}}async setupChannelProvider(){try{const e=await this.getProvider();this.channel=e,this.wireChannel(e)}catch(e){throw new Error(`Error setting up Interop Broker Channel Provider: ${e}`)}}wireChannel(e){e.onConnection((async(e,t)=>{if(!await this.isConnectionAuthorized(e,t))throw new Error(`Connection not authorized for ${e.uuid}, ${e.name}`);if(!e.endpointId)throw new Error("Version too old to be compatible with Interop. Please upgrade your runtime to a more recent version.");const n={contextGroupId:void 0,contextHandlers:new Map,clientIdentity:e};t?.currentContextGroup&&this.contextGroupsById.has(t.currentContextGroup)&&(n.contextGroupId=t?.currentContextGroup),this.interopClients.set(e.endpointId,n)})),e.onDisconnection((e=>{this.interopClients.delete(e.endpointId);const t=this.intentClientMap.get(e.name);t&&e.uuid===this.fin.me.uuid&&t.forEach((e=>{e.isReady=!1})),this.sessionContextGroupMap.forEach((t=>{t.onDisconnection(e)})),this.clientDisconnected(e)})),e.beforeAction((async(e,t,n)=>{if(!await this.isActionAuthorized(e,t,n))throw new Error(`Action (${e}) not authorized for ${n.uuid}, ${n.name}`);this.logging?.beforeAction?.enabled&&console.log(e,t,n)})),e.afterAction(((e,t,n)=>{this.logging?.afterAction?.enabled&&console.log(e,t,n)})),e.register("setContext",this.setContext.bind(this)),e.register("fireIntent",this.handleFiredIntent.bind(this)),e.register("getCurrentContext",this.getCurrentContext.bind(this)),e.register("getInfoForIntent",this.handleInfoForIntent.bind(this)),e.register("getInfoForIntentsByContext",this.handleInfoForIntentsByContext.bind(this)),e.register("fireIntentForContext",this.handleFiredIntentForContext.bind(this)),e.register("getContextGroups",this.getContextGroups.bind(this)),e.register("joinContextGroup",this.joinContextGroup.bind(this)),e.register("removeFromContextGroup",this.removeFromContextGroup.bind(this)),e.register("getAllClientsInContextGroup",this.getAllClientsInContextGroup.bind(this)),e.register("getInfoForContextGroup",this.getInfoForContextGroup.bind(this)),e.register("contextHandlerRegistered",this.contextHandlerRegistered.bind(this)),e.register("intentHandlerRegistered",this.intentHandlerRegistered.bind(this)),e.register("removeContextHandler",this.removeContextHandler.bind(this)),e.register("sessionContextGroup:createIfNeeded",this.handleJoinSessionContextGroup.bind(this)),e.register("fdc3Open",this.fdc3HandleOpen.bind(this)),e.register("fdc3v2FindIntentsByContext",this.handleInfoForIntentsByContext.bind(this)),e.register("fdc3FindInstances",this.fdc3HandleFindInstances.bind(this)),e.register("fdc3GetAppMetadata",this.fdc3HandleGetAppMetadata.bind(this)),e.register("fdc3v2GetInfo",(async(e,t)=>this.fdc3HandleGetInfo.bind(this)(e,t))),e.register("createPrivateChannelProvider",(async e=>{const{channelId:t}=e,n=await this.fin.InterApplicationBus.Channel.create(t);u.PrivateChannelProvider.init(n,t)}))}isConnectionAuthorized(e,t){return this.wire.sendAction("interop-broker-is-connection-authorized").catch((e=>{})),Promise.resolve(!0)}isActionAuthorized(e,t,n){return this.wire.sendAction("interop-broker-is-action-authorized").catch((e=>{})),Promise.resolve(!0)}};return Li.InteropBroker=y,e=new WeakMap,t=new WeakMap,i=new WeakMap,Li}var Ni,Di={},Ui={},Vi=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},zi=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Ui,"__esModule",{value:!0});const Ki=c,qi=$i;class Yi extends Ki.Base{constructor(e,t,n){super(e),Ni.set(this,void 0),this.id=n,Vi(this,Ni,t,"f")}async setContext(e){this.wire.sendAction("interop-session-context-group-set-context").catch((e=>{}));return(await zi(this,Ni,"f")).dispatch(`sessionContextGroup:setContext-${this.id}`,{sessionContextGroupId:this.id,context:e})}async getCurrentContext(e){this.wire.sendAction("interop-session-context-group-get-context").catch((e=>{}));return(await zi(this,Ni,"f")).dispatch(`sessionContextGroup:getContext-${this.id}`,{sessionContextGroupId:this.id,type:e})}async addContextHandler(e,t){if(this.wire.sendAction("interop-session-context-group-add-handler").catch((e=>{})),"function"!=typeof e)throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");const n=await zi(this,Ni,"f");let i;return i=t?`sessionContextHandler:invoke-${this.id}-${t}-${(0,qi.generateId)()}`:`sessionContextHandler:invoke-${this.id}`,n.register(i,(0,qi.wrapContextHandler)(e,i)),await n.dispatch(`sessionContextGroup:handlerAdded-${this.id}`,{handlerId:i,contextType:t}),{unsubscribe:await this.createUnsubscribeCb(i)}}async createUnsubscribeCb(e){const t=await zi(this,Ni,"f");return async()=>{t.remove(e),await t.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`,{handlerId:e})}}getUserInstance(){return{id:this.id,setContext:(0,qi.wrapInTryCatch)(this.setContext.bind(this),"Failed to set context: "),getCurrentContext:(0,qi.wrapInTryCatch)(this.getCurrentContext.bind(this),"Failed to get context: "),addContextHandler:(0,qi.wrapInTryCatch)(this.addContextHandler.bind(this),"Failed to add context handler: ")}}}Ui.default=Yi,Ni=new WeakMap;var Ji={},Zi={},Qi={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.PrivateChannelClient=void 0;const er=$i;var tr,nr;function ir(){if(tr)return Zi;tr=1;var e,t=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},i=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.FDC3ModuleBase=void 0;const r=Qi,s=$i,a=ar(),c=n;return Zi.FDC3ModuleBase=class{get client(){return t(this,e,"f").call(this)}get fin(){return this.wire.getFin()}constructor(t,n){this.wire=n,e.set(this,void 0),i(this,e,t,"f")}async broadcast(e){return this.wire.sendAction("fdc3-broadcast").catch((e=>{})),this.client.setContext(e)}async _open(e,t){this.wire.sendAction("fdc3-open").catch((e=>{}));try{return await a.InteropClient.ferryFdc3Call(this.client,"fdc3Open",{app:e,context:t})}catch(e){const t=e.message===s.BROKER_ERRORS.fdc3Open?"ResolverUnavailable":e.message;throw new Error(t)}}async _getChannels(){return(await this.client.getContextGroups()).map((e=>({...e,type:"system",...(0,r.getUnsupportedChannelApis)()})))}async getOrCreateChannel(e){this.wire.sendAction("fdc3-get-or-create-channel").catch((e=>{}));const t=(await this._getChannels()).find((t=>t.id===e));if(t)return{...t,type:"system",...(0,r.getUnsupportedChannelApis)()};try{const t=await this.client.joinSessionContextGroup(e);return(0,r.buildAppChannelObject)(t)}catch(e){throw console.error(e.message),new Error(r.ChannelError.CreationFailed)}}async getSystemChannels(){return this.wire.sendAction("fdc3-get-system-channels").catch((e=>{})),this._getChannels()}async joinChannel(e){this.wire.sendAction("fdc3-join-channel").catch((e=>{}));try{return await this.client.joinContextGroup(e)}catch(e){if(e.message===s.BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup?console.error("The Channel you have tried to join is an App Channel. Custom Channels can only be defined by the Interop Broker through code or manifest configuration. Please use getOrCreateChannel."):console.error(e.message),e.message.startsWith("Attempting to join a context group that does not exist"))throw new Error(r.ChannelError.NoChannelFound);throw new Error(r.ChannelError.AccessDenied)}}async getCurrentChannel(){this.wire.sendAction("fdc3-get-current-channel").catch((e=>{}));const e=await this.getCurrentContextGroupInfo();return e?this.buildChannelObject(e):null}async leaveCurrentChannel(){return this.wire.sendAction("fdc3-leave-current-channel").catch((e=>{})),this.client.removeFromContextGroup()}async getCurrentContextGroupInfo(){const e=await this.client.getContextGroups(),t=e.map((async e=>this.client.getAllClientsInContextGroup(e.id))),n=(await Promise.all(t)).findIndex((e=>e.some((e=>{const{uuid:t,name:n}=e;return this.wire.me.uuid===t&&this.wire.me.name===n}))));return e[n]}async buildChannelObject(e){return{...e,type:"system",addContextListener:(...[e,t])=>{let n,i;"function"==typeof e?(console.warn("addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)"),n=e):(n=t,"string"==typeof e&&(i=e));const r=(async()=>{let e=!0;const t=await this.client.getCurrentContext(i);return this.client.addContextHandler(((i,r)=>{if(!e||(e=!1,!(0,c.isEqual)(t,i)))return n(i,r)}),i)})();return{...r,unsubscribe:()=>r.then((e=>e.unsubscribe()))}},broadcast:this.broadcast.bind(this),getCurrentContext:async e=>{const t=await this.client.getCurrentContext(e);return void 0===t?null:t}}}},e=new WeakMap,Zi}Xi.PrivateChannelClient=class{constructor(e,t){this.id=t,this.client=e,this.listeners=new Map}async broadcast(e){return this.client.dispatch("broadcast",{context:e})}async getCurrentContext(e){return this.client.dispatch("getCurrentContext",{contextType:e})}async addContextListener(e,t){if("function"!=typeof t)throw new Error("Non-function argument passed to the second parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");let n;n=e?`contextHandler:invoke-${this.id}-${e}-${er.generateId()}`:`contextHandler:invoke-${this.id}-${er.generateId()}`,this.client.register(n,er.wrapContextHandler(t,n));const i={unsubscribe:await this.createContextUnsubscribeCb(n)};return this.listeners.set(n,i),await this.client.dispatch("contextHandlerAdded",{handlerId:n,contextType:e}),i}createNonStandardUnsubscribeCb(e){return async()=>{this.client.remove(e),this.listeners.delete(e),await this.client.dispatch("nonStandardHandlerRemoved",{handlerId:e})}}createContextUnsubscribeCb(e){return async()=>{this.client.remove(e),this.listeners.delete(e),await this.client.dispatch("contextHandlerRemoved",{handlerId:e})}}onAddContextListener(e){const t=`onContextHandlerAdded:invoke-${this.id}-${er.generateId()}`;this.client.register(t,e);const n={unsubscribe:this.createNonStandardUnsubscribeCb(t)};return this.listeners.set(t,n),this.client.dispatch("onAddContextHandlerAdded",{handlerId:t}),n}onDisconnect(e){const t=`onDisconnect:invoke-${this.id}-${er.generateId()}`;this.client.register(t,e);const n={unsubscribe:this.createNonStandardUnsubscribeCb(t)};return this.listeners.set(t,n),this.client.dispatch("onDisconnectHandlerAdded",{handlerId:t}),n}onUnsubscribe(e){const t=`onUnsubscribe:invoke-${this.id}-${er.generateId()}`;this.client.register(t,e);const n={unsubscribe:this.createNonStandardUnsubscribeCb(t)};return this.listeners.set(t,n),this.client.dispatch("onUnsubscribeHandlerAdded",{handlerId:t}),n}async cleanUpAllSubs(){Array.from(this.listeners.keys()).forEach((e=>{this.client.remove(e),this.listeners.delete(e)}))}async disconnect(){try{await this.client.dispatch("clientDisconnecting"),await this.cleanUpAllSubs(),await this.client.disconnect()}catch(e){throw new Error(e.message)}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getIntentResolution=e.isChannel=e.isContext=e.connectPrivateChannel=e.buildAppChannelObject=e.buildPrivateChannelObject=e.ChannelError=e.ResultError=e.UnsupportedChannelApiError=e.getUnsupportedChannelApis=void 0;const t=$i,i=Xi,r=n;e.getUnsupportedChannelApis=e=>({addContextListener:()=>{throw new o("Channel.addContextListener",e)},broadcast:()=>{throw new o("Channel.broadcast",e)},getCurrentContext:()=>{throw new o("Channel.getCurrentContext",e)}});class o extends Error{constructor(e,t="System"){super(e),this.message=`Calling ${e} on an instance of a ${t} Channel returned by fdc3.get${t}Channels is not supported. If you would like to use a ${t} Channel, please use fdc3.joinChannel, fdc3.addContextListener, and fdc3.broadcast instead.`}}var s,a;e.UnsupportedChannelApiError=o,function(e){e.NoResultReturned="NoResultReturned",e.IntentHandlerRejected="IntentHandlerRejected"}(s=e.ResultError||(e.ResultError={})),(a=e.ChannelError||(e.ChannelError={})).NoChannelFound="NoChannelFound",a.AccessDenied="AccessDenied",a.CreationFailed="CreationFailed";e.buildPrivateChannelObject=e=>{let t=!1;const n=()=>{if(t)throw new Error("Private Channel Client has been disconnected from the Private Channel")};return{id:e.id,type:"private",broadcast:async t=>(n(),e.broadcast(t)),getCurrentContext:async t=>(n(),e.getCurrentContext(t)),addContextListener:async(t,i)=>{n();let r=i,o=t;"function"==typeof t&&(console.warn("addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)"),r=t,o=null);return e.addContextListener(o,r)},onAddContextListener:t=>(n(),e.onAddContextListener(t)),disconnect:async()=>(n(),t=!0,e.disconnect()),onDisconnect:t=>(n(),e.onDisconnect(t)),onUnsubscribe:t=>(n(),e.onUnsubscribe(t))}};e.buildAppChannelObject=e=>({id:e.id,type:"app",broadcast:e.setContext,getCurrentContext:async t=>{const n=await e.getCurrentContext(t);return void 0===n?null:n},addContextListener:(t,n)=>{let i,o;"function"==typeof t?(console.warn("addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)"),i=t):(i=n,"string"==typeof t&&(o=t));const s=(async()=>{let t=!0;const n=await e.getCurrentContext(o);return e.addContextHandler(((e,o)=>{if(!t||(t=!1,!(0,r.isEqual)(n,e)))return i(e,o)}),o)})();return{...s,unsubscribe:()=>s.then((e=>e.unsubscribe()))}}});e.connectPrivateChannel=async t=>{try{const n=await fin.InterApplicationBus.Channel.connect(t),r=new i.PrivateChannelClient(n,t);return(0,e.buildPrivateChannelObject)(r)}catch(e){throw new Error(`Private Channel with id: ${t} doesn't exist`)}};e.isContext=e=>{if(e&&"object"==typeof e&&"type"in e){const{type:t}=e;return"string"==typeof t}return!1};e.isChannel=e=>{if(e&&"object"==typeof e&&"type"in e&&"id"in e){const{type:t,id:n}=e;return"string"==typeof t&&"string"==typeof n&&("app"===t||"private"===t)}return!1};e.getIntentResolution=async(n,i,r,o)=>{const a=(0,t.generateId)(),c=new Promise(((e,t)=>{fin.InterApplicationBus.subscribe({uuid:"*"},a,(t=>{e(t)})).catch((()=>t(new Error("getResult is not supported in this environment"))))})),d=r?{target:r,intentResolutionResultId:a}:{intentResolutionResultId:a},h=o?{name:o,context:i,metadata:d}:{...i,metadata:d},l=async()=>{let t=await c;if(!t||"object"!=typeof t)throw new Error(s.NoResultReturned);const{error:i}=t;if(i)throw new Error(s.IntentHandlerRejected);if((0,e.isChannel)(t)){const{id:i,type:r}=t;switch(r){case"private":t=await(0,e.connectPrivateChannel)(i);break;case"app":{const r=await n.joinSessionContextGroup(i);t=(0,e.buildAppChannelObject)(r);break}}}else if(!(0,e.isContext)(t))throw new Error(s.NoResultReturned);return t},u=o?await n.fireIntent(h):await n.fireIntentForContext(h);return"object"!=typeof u?{source:{appId:"",instanceId:""},intent:"",version:"2.0",getResult:l}:{...u,getResult:l}}}(Qi);var rr,or,sr={};function ar(){if(or)return Di;or=1;var e,t,n=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},i=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Di,"__esModule",{value:!0}),Di.InteropClient=void 0;const r=c,s=Ui,a=function(){if(nr)return Ji;nr=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.Fdc3Module=void 0;const e=$i,t=ir();class n extends t.FDC3ModuleBase{async open(e,t){await super._open(e,t)}addContextListener(e,t){let n;return this.wire.sendAction("fdc3-add-context-listener").catch((e=>{})),"function"==typeof e?(console.warn("addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)"),n=this.client.addContextHandler(e)):n=this.client.addContextHandler(t,null===e?void 0:e),{...n,unsubscribe:()=>n.then((e=>e.unsubscribe()))}}addIntentListener(e,t){this.wire.sendAction("fdc3-add-intent-listener").catch((e=>{}));const n=this.client.registerIntentHandler((e=>{const{context:n,metadata:i}=e,{metadata:r}=n,o=i?.intentResolutionResultId||r?.intentResolutionResultId;o&&this.fin.InterApplicationBus.publish(o,null).catch((()=>null)),t(e.context)}),e,{fdc3Version:"1.2"});return{...n,unsubscribe:()=>n.then((e=>e.unsubscribe()))}}async raiseIntent(t,n,i){this.wire.sendAction("fdc3-raise-intent").catch((e=>{}));const r=i?{name:t,context:n,metadata:{target:i}}:{name:t,context:n};try{return await this.client.fireIntent(r)}catch(t){const n=t.message===e.BROKER_ERRORS.fireIntent?"ResolverUnavailable":t.message;throw new Error(n)}}async findIntent(t,n){this.wire.sendAction("fdc3-find-intent").catch((e=>{}));try{return await this.client.getInfoForIntent({name:t,context:n})}catch(t){const n=t.message===e.BROKER_ERRORS.getInfoForIntent?"ResolverUnavailable":t.message;throw new Error(n)}}async findIntentsByContext(t){this.wire.sendAction("fdc3-find-intents-by-context").catch((e=>{}));try{return await this.client.getInfoForIntentsByContext(t)}catch(t){const n=t.message===e.BROKER_ERRORS.getInfoForIntentsByContext?"ResolverUnavailable":t.message;throw new Error(n)}}async raiseIntentForContext(t,n){this.wire.sendAction("fdc3-raise-intent-for-context").catch((e=>{}));try{return await this.client.fireIntentForContext({...t,metadata:{target:n}})}catch(t){const n=t.message===e.BROKER_ERRORS.fireIntentForContext?"ResolverUnavailable":t.message;throw new Error(n)}}async getOrCreateChannel(e){return super.getOrCreateChannel(e)}getInfo(){this.wire.sendAction("fdc3-get-info").catch((e=>{}));const{uuid:e,fdc3InteropApi:t}=fin.__internal_.initialOptions;return{fdc3Version:t,provider:`openfin-${e}`,providerVersion:fin.desktop.getVersion()}}}return Ji.Fdc3Module=n,Ji}(),d=function(){if(rr)return sr;rr=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.Fdc3Module2=void 0;const e=ir(),t=$i,n=ar(),i=Qi,r=Xi;class o extends e.FDC3ModuleBase{async open(e,t){return"string"==typeof e&&console.warn("Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string })."),super._open(e,t)}async findInstances(e){this.wire.sendAction("fdc3-find-instances").catch((e=>{}));try{return await n.InteropClient.ferryFdc3Call(this.client,"fdc3FindInstances",e)}catch(e){const n=e.message===t.BROKER_ERRORS.fdc3FindInstances?"ResolverUnavailable":e.message;throw new Error(n)}}async getAppMetadata(e){this.wire.sendAction("fdc3-get-app-metadata").catch((e=>{}));try{return await n.InteropClient.ferryFdc3Call(this.client,"fdc3GetAppMetadata",e)}catch(e){const n=e.message===t.BROKER_ERRORS.fdc3GetAppMetadata?"ResolverUnavailable":e.message;throw new Error(n)}}async addContextListener(e,t){this.wire.sendAction("fdc3-add-context-listener").catch((e=>{}));const n=e=>t=>{const{contextMetadata:n,...i}=t,r=n?[{...i},n]:[t,null];e(...r)};let i=t,r=n(i);return"function"==typeof e?(console.warn("addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)"),i=e,r=n(i),this.client.addContextHandler(r)):this.client.addContextHandler(r,null===e?void 0:e)}async findIntent(e,n,i){this.wire.sendAction("fdc3-find-intent").catch((e=>{}));try{return await this.client.getInfoForIntent({name:e,context:n,metadata:{resultType:i}})}catch(e){const n=e.message===t.BROKER_ERRORS.getInfoForIntent?"ResolverUnavailable":e.message;throw new Error(n)}}async findIntentsByContext(e,i){this.wire.sendAction("fdc3-find-intents-by-context").catch((e=>{}));const r=i?{context:e,metadata:{resultType:i}}:e;try{return await n.InteropClient.ferryFdc3Call(this.client,"fdc3v2FindIntentsByContext",r)}catch(e){const n=e.message===t.BROKER_ERRORS.getInfoForIntentsByContext?"ResolverUnavailable":e.message;throw new Error(n)}}async raiseIntent(e,n,r){this.wire.sendAction("fdc3-raise-intent").catch((e=>{}));try{return"string"==typeof r&&console.warn("Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string })."),(0,i.getIntentResolution)(this.client,n,r,e)}catch(e){const n=e.message===t.BROKER_ERRORS.fireIntent?"ResolverUnavailable":e.message;throw new Error(n)}}async raiseIntentForContext(e,n){this.wire.sendAction("fdc3-raise-intent-for-context").catch((e=>{}));try{return"string"==typeof n&&console.warn("Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string })."),(0,i.getIntentResolution)(this.client,e,n)}catch(e){const n=e.message===t.BROKER_ERRORS.fireIntent?"ResolverUnavailable":e.message;throw new Error(n)}}async addIntentListener(e,t){if(this.wire.sendAction("fdc3-add-intent-listener").catch((e=>{})),"string"!=typeof e)throw new Error("First argument must be an Intent name");return this.client.registerIntentHandler((async e=>{let n,i;const{context:r,metadata:o}=e,{contextMetadata:s,metadata:a,...c}=r,d=o?.intentResolutionResultId||a?.intentResolutionResultId;try{const e=a?{metadata:a,...c}:{...c};n=await t(e,s),i=n}catch(e){n=e,i={error:!0}}if(d&&this.fin.InterApplicationBus.publish(d,i).catch((()=>null)),n instanceof Error)throw new Error(n.message);return n}),e,{fdc3Version:"2.0"})}async getOrCreateChannel(e){return super.getOrCreateChannel(e)}async createPrivateChannel(){const e=(0,t.generateId)();await n.InteropClient.ferryFdc3Call(this.client,"createPrivateChannelProvider",{channelId:e});const o=await this.fin.InterApplicationBus.Channel.connect(e),s=new r.PrivateChannelClient(o,e);return(0,i.buildPrivateChannelObject)(s)}async getUserChannels(){return(await this.client.getContextGroups()).map((e=>({...e,type:"user",...(0,i.getUnsupportedChannelApis)("User")})))}async getSystemChannels(){return console.warn("This API has been deprecated. Please use fdc3.getUserChannels instead."),super.getSystemChannels()}async joinUserChannel(e){return super.joinChannel(e)}async joinChannel(e){return console.warn("This API has been deprecated. Please use fdc3.joinUserChannel instead."),super.joinChannel(e)}async getCurrentChannel(){const e=await super.getCurrentChannel();return e?{...e,type:"user",broadcast:this.broadcast.bind(this)}:null}async getInfo(){return n.InteropClient.ferryFdc3Call(this.client,"fdc3v2GetInfo",{fdc3Version:"2.0"})}}return sr.Fdc3Module2=o,sr}(),h=$i;let l=class extends r.Base{constructor(i,r){super(i),e.set(this,void 0),t.set(this,void 0),n(this,t,new Map,"f"),n(this,e,r,"f")}async setContext(t){this.wire.sendAction("interop-client-set-context").catch((e=>{}));return(await i(this,e,"f")).dispatch("setContext",{context:t})}async addContextHandler(t,n){if(this.wire.sendAction("interop-client-add-context-handler").catch((e=>{})),"function"!=typeof t)throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");const r=await i(this,e,"f");let o;o=n?`invokeContextHandler-${n}-${(0,h.generateId)()}`:"invokeContextHandler";const s=(0,h.wrapContextHandler)(t,o);return r.register(o,s),await r.dispatch("contextHandlerRegistered",{handlerId:o,contextType:n}),{unsubscribe:async()=>{r.remove(o),await r.dispatch("removeContextHandler",{handlerId:o})}}}async getContextGroups(){this.wire.sendAction("interop-client-get-context-groups").catch((e=>{}));return(await i(this,e,"f")).dispatch("getContextGroups")}async joinContextGroup(t,n){this.wire.sendAction("interop-client-join-context-group").catch((e=>{}));const r=await i(this,e,"f");if(!t)throw new Error("No contextGroupId specified for joinContextGroup.");return r.dispatch("joinContextGroup",{contextGroupId:t,target:n})}async removeFromContextGroup(t){this.wire.sendAction("interop-client-remove-from-context-group").catch((e=>{}));return(await i(this,e,"f")).dispatch("removeFromContextGroup",{target:t})}async getAllClientsInContextGroup(t){this.wire.sendAction("interop-client-get-all-clients-in-context-group").catch((e=>{}));const n=await i(this,e,"f");if(!t)throw new Error("No contextGroupId specified for getAllClientsInContextGroup.");return n.dispatch("getAllClientsInContextGroup",{contextGroupId:t})}async getInfoForContextGroup(t){this.wire.sendAction("interop-client-get-info-for-context-group").catch((e=>{}));const n=await i(this,e,"f");if(!t)throw new Error("No contextGroupId specified for getInfoForContextGroup.");return n.dispatch("getInfoForContextGroup",{contextGroupId:t})}async fireIntent(t){this.wire.sendAction("interop-client-fire-intent").catch((e=>{}));return(await i(this,e,"f")).dispatch("fireIntent",t)}async registerIntentHandler(t,n,r){this.wire.sendAction("interop-client-register-intent-handler").catch((e=>{}));const o=await i(this,e,"f"),s=`intent-handler-${n}`,a=(0,h.wrapIntentHandler)(t,s);try{await o.register(s,a),await o.dispatch("intentHandlerRegistered",{handlerId:s,...r})}catch(e){throw new Error("Unable to register intent handler")}return{unsubscribe:async()=>{o.remove(s)}}}async getCurrentContext(t){this.wire.sendAction("interop-client-get-current-context").catch((e=>{}));return(await i(this,e,"f")).dispatch("getCurrentContext",{contextType:t})}async getInfoForIntent(t){this.wire.sendAction("interop-client-get-info-for-intent").catch((e=>{}));return(await i(this,e,"f")).dispatch("getInfoForIntent",t)}async getInfoForIntentsByContext(t){this.wire.sendAction("interop-client-get-info-for-intents-by-context").catch((e=>{}));return(await i(this,e,"f")).dispatch("getInfoForIntentsByContext",t)}async fireIntentForContext(t){this.wire.sendAction("interop-client-fire-intent-for-context").catch((e=>{}));return(await i(this,e,"f")).dispatch("fireIntentForContext",t)}async joinSessionContextGroup(n){try{const r=i(this,t,"f").get(n);if(r)return r.getUserInstance();const o=await i(this,e,"f"),{hasConflict:a}=await o.dispatch("sessionContextGroup:createIfNeeded",{sessionContextGroupId:n});a&&console.warn(`A (non-session) context group with the name "${n}" already exists. If you are trying to join a Context Group, call joinContextGroup instead.`);const c=new s.default(this.wire,i(this,e,"f"),n);return i(this,t,"f").set(n,c),c.getUserInstance()}catch(e){throw console.error(`Error thrown trying to create Session Context Group with id "${n}": ${e}`),e}}async onDisconnection(t){this.wire.sendAction("interop-client-add-ondisconnection-listener").catch((e=>{}));return(await i(this,e,"f")).onDisconnection((e=>{const{uuid:n}=e;t({type:"interop-broker",topic:"disconnected",brokerName:n})}))}getFDC3Sync(e){switch(e){case"1.2":return new a.Fdc3Module((()=>this),this.wire);case"2.0":return new d.Fdc3Module2((()=>this),this.wire);default:throw new Error(`Invalid FDC3 version provided: ${e}. Must be '1.2' or '2.0'`)}}async getFDC3(e){return this.getFDC3Sync(e)}static async ferryFdc3Call(t,n,r){return(await i(t,e,"f")).dispatch(n,r||null)}};return Di.InteropClient=l,e=new WeakMap,t=new WeakMap,Di}var cr,dr,hr,lr={};function ur(){if(cr)return lr;cr=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.overrideCheck=lr.checkFDC32Overrides=lr.getDefaultViewFdc3VersionFromAppInfo=void 0;const e=Hi();function t(t){return["fdc3HandleFindInstances","handleInfoForIntent","handleInfoForIntentsByContext","fdc3HandleGetAppMetadata","fdc3HandleGetInfo","fdc3HandleOpen","handleFiredIntent","handleFiredIntentForContext"].filter((n=>t[n]===e.InteropBroker.prototype[n]))}return lr.getDefaultViewFdc3VersionFromAppInfo=function({manifest:e,initialOptions:t}){const n=e?.platform?.defaultViewOptions?.fdc3InteropApi??t.defaultViewOptions?.fdc3InteropApi;return["1.2","2.0"].includes(n??"")?n:void 0},lr.checkFDC32Overrides=t,lr.overrideCheck=function(e,n){if(n&&"2.0"===n){const n=t(e);n.length>0&&console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\nThe following APIs need to be overridden:\n${n.join("\n")}`)}},lr}function pr(){return hr||(hr=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),i=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),i(function(){if(dr)return Fi;dr=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.InteropModule=void 0;const e=n,t=ji,i=c,r=Hi(),o=ar(),s=ur(),a=ri,d=e=>new e,h="You have attempted to use or modify InteropBroker parameters, which is not allowed. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.";class l extends i.Base{async init(n,i=d){this.wire.sendAction("interop-init").catch((()=>{}));const o=await this.wire.environment.getInteropInfo(this.wire.getFin()),c=(0,t.createUnusableObject)(h),l=(0,t.createWarningObject)(h,(0,e.cloneDeep)(o)),u=async()=>{throw new Error(h)},p=r.InteropBroker.createClosedConstructor(this.wire,(()=>this.fin.InterApplicationBus.Channel.create(`interop-broker-${n}`)),o);let w;return w=Array.isArray(i)?new((0,a.overrideFromComposables)(...i)(p))(c,u,l):await i(p,c,u,l),(0,s.overrideCheck)(w,o.fdc3Version),w}connectSync(e,t){return this.wire.sendAction("interop-connect-sync").catch((()=>{})),new o.InteropClient(this.wire,this.wire.environment.whenReady().then((()=>this.fin.InterApplicationBus.Channel.connect(`interop-broker-${e}`,{payload:t}))))}}return Fi.InteropModule=l,Fi}(),e),i(ar(),e),i(Hi(),e)}(Ri)),Ri}var wr={},yr={},fr={},gr={};Object.defineProperty(gr,"__esModule",{value:!0}),gr.getSnapshotSourceChannelName=void 0;gr.getSnapshotSourceChannelName=e=>`snapshot-source-provider-${e.uuid}`;var mr,vr,Cr,br,Ir,Er=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},xr=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(fr,"__esModule",{value:!0}),fr.SnapshotSource=void 0;const Ar=c,Pr=gr,Mr=new Map;class Or extends Ar.Base{constructor(e,t){super(e),mr.set(this,void 0),vr.set(this,(()=>(Mr.has(this.identity.uuid)||Mr.set(this.identity.uuid,{eventFired:null,clientPromise:null}),Mr.get(this.identity.uuid)))),Cr.set(this,(()=>(xr(this,vr,"f").call(this).clientPromise||(xr(this,vr,"f").call(this).clientPromise=xr(this,br,"f").call(this)),xr(this,vr,"f").call(this).clientPromise))),br.set(this,(async()=>{const e=(0,Pr.getSnapshotSourceChannelName)(this.identity);try{xr(this,vr,"f").call(this).eventFired||await xr(this,Ir,"f").call(this);const t=await this.fin.InterApplicationBus.Channel.connect(e,{wait:!1});return t.onDisconnection((()=>{xr(this,vr,"f").call(this).clientPromise=null,xr(this,vr,"f").call(this).eventFired=null})),t}catch(e){throw xr(this,vr,"f").call(this).clientPromise=null,new Error("The targeted SnapshotSource is not currently initialized. Await this object's ready() method.")}})),Ir.set(this,(async()=>{const e=(0,Pr.getSnapshotSourceChannelName)(this.identity);let t,n;const i=new Promise(((e,i)=>{t=e,n=i}));xr(this,vr,"f").call(this).eventFired=i;const r=async i=>{try{i.channelName===e&&(t(),await this.fin.InterApplicationBus.Channel.removeListener("connected",r))}catch(e){n(e)}};await this.fin.InterApplicationBus.Channel.on("connected",r)})),Er(this,mr,t,"f")}get identity(){return xr(this,mr,"f")}async ready(){this.wire.sendAction("snapshot-source-ready").catch((e=>{}));try{await xr(this,Cr,"f").call(this)}catch(e){await xr(this,vr,"f").call(this).eventFired}}async getSnapshot(){this.wire.sendAction("snapshot-source-get-snapshot").catch((e=>{}));const e=await xr(this,Cr,"f").call(this),t=await e.dispatch("get-snapshot");return(await t).snapshot}async applySnapshot(e){this.wire.sendAction("snapshot-source-apply-snapshot").catch((e=>{}));return(await xr(this,Cr,"f").call(this)).dispatch("apply-snapshot",{snapshot:e})}}fr.SnapshotSource=Or,mr=new WeakMap,vr=new WeakMap,Cr=new WeakMap,br=new WeakMap,Ir=new WeakMap,Object.defineProperty(yr,"__esModule",{value:!0}),yr.SnapshotSourceModule=void 0;const _r=c,Sr=fr,Rr=gr;class Fr extends _r.Base{async init(e){if(this.wire.sendAction("snapshot-source-init").catch((e=>{})),"object"!=typeof e||"function"!=typeof e.getSnapshot||"function"!=typeof e.applySnapshot)throw new Error("you must pass in a valid SnapshotProvider");const t=await this.fin.InterApplicationBus.Channel.create((0,Rr.getSnapshotSourceChannelName)(this.fin.me));t.register("get-snapshot",(async()=>({snapshot:await e.getSnapshot()}))),t.register("apply-snapshot",(({snapshot:t})=>e.applySnapshot(t)))}wrapSync(e){return this.wire.sendAction("snapshot-source-wrap-sync").catch((e=>{})),new Sr.SnapshotSource(this.wire,e)}async wrap(e){return this.wire.sendAction("snapshot-source-wrap").catch((e=>{})),this.wrapSync(e)}}yr.SnapshotSourceModule=Fr,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(yr,e),n(fr,e)}(wr),Object.defineProperty(s,"__esModule",{value:!0});var jr=s.Fin=void 0;const kr=t,Lr=a,Tr=Pe(),$r=Ce(),Br=Fe,Gr=En,Wr=Pn,Hr=kn,Nr=Dn,Dr=me(),Ur=Kn,Vr=Si,zr=pr(),Kr=wr;class qr extends kr.EventEmitter{constructor(e){super(),this.wire=e,this.System=new Lr.System(e),this.Window=new Tr._WindowModule(e),this.Application=new $r.ApplicationModule(e),this.InterApplicationBus=new Br.InterApplicationBus(e),this.Clipboard=new Gr.Clipboard(e),this.ExternalApplication=new Wr.ExternalApplicationModule(e),this.Frame=new Hr._FrameModule(e),this.GlobalHotkey=new Nr.GlobalHotkey(e),this.Platform=new Ur.PlatformModule(e,this.InterApplicationBus.Channel),this.View=new Dr.ViewModule(e),this.Interop=new zr.InteropModule(e),this.SnapshotSource=new Kr.SnapshotSourceModule(e),e.registerFin(this),this.me=(0,Vr.getMe)(e),e.on("disconnected",(()=>{this.emit("disconnected")}))}}jr=s.Fin=qr;var Yr={},Jr={};function Zr(e){return"string"==typeof e.manifestUrl}function Qr(e){return eo(e)&&"string"==typeof e.address}function Xr(e){return Qr(e)&&"string"==typeof e.token}function eo(e){return"string"==typeof e.uuid}function to(e){return e.runtime&&"string"==typeof e.runtime.version}function no(e){return eo(e)&&to(e)}Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.isInternalConnectConfig=Jr.isPortDiscoveryConfig=Jr.isNewConnectConfig=Jr.isConfigWithReceiver=Jr.isRemoteConfig=Jr.isExistingConnectConfig=Jr.isExternalConfig=void 0,Jr.isExternalConfig=Zr,Jr.isExistingConnectConfig=Qr,Jr.isRemoteConfig=Xr,Jr.isConfigWithReceiver=function(e){return"object"==typeof e.receiver&&Xr({...e,address:""})},Jr.isNewConnectConfig=no,Jr.isPortDiscoveryConfig=function(e){return Zr(e)&&to(e)||no(e)},Jr.isInternalConnectConfig=function(e){return Qr(e)||no(e)};var io={},ro={};Object.defineProperty(ro,"__esModule",{value:!0}),ro.EmitterMap=void 0;const oo=t;function so(e){return Buffer.from(e).toString("base64")}ro.EmitterMap=class{constructor(){this.storage=new Map}hashKeys(e){return e.map(so).join("/")}getOrCreate(e){const t=this.hashKeys(e);return this.storage.has(t)||this.storage.set(t,new oo.EventEmitter),this.storage.get(t)}has(e){return this.storage.has(this.hashKeys(e))}delete(e){const t=this.hashKeys(e);return this.storage.delete(t)}},Object.defineProperty(io,"__esModule",{value:!0});const ao=ro;class co extends ao.EmitterMap{constructor(){super(...arguments),this.dispatchEvent=e=>{if(function(e){return"process-desktop-event"===e.action}(e)){const{payload:t}=e,n=function(e){const{topic:t}=e;if("frame"===t||"window"===t||"view"===t){const{uuid:n,name:i}=e;return[t,n,i]}if("application"===t){const{uuid:n}=e;return[t,n]}return[t]}(t);if(this.has(n))return this.getOrCreate(n).emit(t.type,t),!0}return!1}}}io.default=co;var ho,lo,uo=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},po=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Yr,"__esModule",{value:!0});var wo=Yr.Transport=void 0;const yo=t,fo=Jr,go=f,mo=io,vo=Si,Co=it;class bo extends yo.EventEmitter{constructor(e,t,n){super(),this.wireListeners=new Map,this.topicRefMap=new Map,this.eventAggregator=new mo.default,this.messageHandlers=[this.eventAggregator.dispatchEvent],ho.set(this,void 0),lo.set(this,void 0),this.connectSync=()=>{po(this,ho,"f").connectSync()},this.getPort=()=>po(this,ho,"f").getPort(),uo(this,ho,new e(this.onmessage.bind(this)),"f"),this.environment=t,this.sendRaw=po(this,ho,"f").send.bind(po(this,ho,"f")),this.registerMessageHandler(this.handleMessage.bind(this)),po(this,ho,"f").on("disconnected",(()=>{for(const[,{handleNack:e}]of this.wireListeners)e({reason:"Remote connection has closed"});this.wireListeners.clear(),this.emit("disconnected")}));const{uuid:i,name:r}=n,o=this.environment.getCurrentEntityType();this.me=(0,vo.getBaseMe)(o,i,r)}getFin(){if(!po(this,lo,"f"))throw new Error("No Fin object registered for this transport");return po(this,lo,"f")}registerFin(e){if(po(this,lo,"f"))throw new Error("Fin object has already been registered for this transport");uo(this,lo,e,"f")}shutdown(){return po(this,ho,"f").shutdown()}async connect(e){if((0,fo.isConfigWithReceiver)(e))return await po(this,ho,"f").connect(e.receiver),this.authorize(e);if((0,fo.isRemoteConfig)(e))return this.connectRemote(e);if((0,fo.isExistingConnectConfig)(e))return this.connectByPort(e);if((0,fo.isNewConnectConfig)(e)){const t=await this.environment.retrievePort(e);return this.connectByPort({...e,address:`ws://localhost:${t}`})}}async connectRemote(e){return await po(this,ho,"f").connect(new(this.environment.getWsConstructor())(e.address)),this.authorize(e)}async connectByPort(e){const{address:t,uuid:n}=e,i={...e,type:"file-token"},r=po(this,ho,"f");await r.connect(new(this.environment.getWsConstructor())(e.address));const o=await this.sendAction("request-external-authorization",{uuid:n,type:"file-token"},!0);if("external-authorization-response"!==o.action)throw new go.UnexpectedActionError(o.action);return await this.environment.writeToken(o.payload.file,o.payload.token),this.authorize(i)}async authorize(e){const t=await this.sendAction("request-authorization",e,!0);if("authorization-response"!==t.action)throw new go.UnexpectedActionError(t.action);if(!0!==t.payload.success)throw new go.RuntimeError(t.payload)}sendAction(e,t={},n=!1){let i=()=>{};const r=go.RuntimeError.getCallSite(1),o=this.environment.getNextMessageId(),s=new Promise(((s,a)=>{i=a;const c={action:e,payload:t,messageId:o},d=po(this,ho,"f");return this.addWireListener(o,s,(e=>this.nackHandler(e,a,r)),n),d.send(c).catch(a)}));return Object.assign(s,{cancel:i,messageId:o})}nackHandler(e,t,n){t("string"==typeof e?e:new go.RuntimeError(e,n))}ferryAction(e){return new Promise(((t,n)=>{const i=this.environment.getNextMessageId();e.messageId=i;const r=e=>{t(e.payload)};return po(this,ho,"f").send(e).then((()=>this.addWireListener(i,r,(e=>this.nackHandler(e,n)),!1))).catch(n)}))}registerMessageHandler(e){this.messageHandlers.push(e)}addWireListener(e,t,n,i){i?this.uncorrelatedListener=t:this.wireListeners.has(e)?n({reason:"Duplicate handler id",error:(0,Co.errorToPOJO)(new go.DuplicateCorrelationError(String(e)))}):this.wireListeners.set(e,{resolve:t,handleNack:n})}onmessage(e){for(const t of this.messageHandlers)t.call(null,e)}handleMessage(e){const t=e.correlationId||NaN;if("correlationId"in e){if(!this.wireListeners.has(t))return!1;{const{resolve:n,handleNack:i}=this.wireListeners.get(t);"ack"!==e.action?i({reason:"Did not receive ack action",error:(0,Co.errorToPOJO)(new go.NoAckError(e.action))}):"payload"in e?e.payload.success?n.call(null,e):i(e.payload):"string"==typeof e.reason?i(e):(console.warn("Received invalid response from core",e),i({reason:"invalid response shape"})),this.wireListeners.delete(t)}}else this.uncorrelatedListener&&this.uncorrelatedListener.call(null,e),this.uncorrelatedListener=()=>{};return!0}}wo=Yr.Transport=bo,ho=new WeakMap,lo=new WeakMap;const Io=(...e)=>({log:(...t)=>console.log(`[${(new Date).toISOString()}]`,...(e=>e.map((e=>`[${e}]`)))(e),...t),getLogger:(...t)=>Io(...e,...t)}),Eo=Io("[@openfin/core-web/client");function xo(e,t){if(!function(e){return"string"==typeof e}(e))throw new Error(`Property ${t} has invalid type. Expected string, got ${typeof e}.`)}const Ao="web-broker-ports-ready",Po=Eo.getLogger("get-web-interop-ports");function Mo(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function Oo(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;const _o=e=>{var n,i,r;return r=class extends t.EventEmitter{constructor(t){super(),n.set(this,void 0),i.set(this,!1),this.connectSync=()=>{Mo(this,i,"f")||(e.addEventListener("message",(e=>{e.data?.topic?.startsWith("wire-message")&&e.data.message&&Mo(this,n,"f").call(this,{...JSON.parse(e.data.message),ports:e.ports})})),e.start())},this.connect=async()=>{this.connectSync()},this.send=t=>(e.postMessage({topic:"wire-message",message:JSON.stringify(t)}),Promise.resolve()),this.shutdown=async()=>{e.close()},Oo(this,n,t,"f")}getPort(){return e}},n=new WeakMap,i=new WeakMap,r};var So={},Ro={};Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.BaseEnvironment=void 0;const Fo=ur();Ro.BaseEnvironment=class{async getInteropInfo(e){const t=await e.Application.getCurrentSync().getInfo().catch((()=>null)),n=t?.initialOptions?.interopBrokerConfiguration??{};return{fdc3Version:t?(0,Fo.getDefaultViewFdc3VersionFromAppInfo)(t):void 0,...n,fdc3Info:{providerVersion:await e.System.getVersion(),provider:"OpenFin"}}}},Object.defineProperty(So,"__esModule",{value:!0});var jo=So.BrowserEnvironment=void 0;const ko=Ro;class Lo extends ko.BaseEnvironment{constructor(){super(...arguments),this.type="other",this.getRandomId=()=>{const e=new Uint32Array(1);return window.crypto.getRandomValues(e)[0].toString(32)}}observeBounds(e,t){throw new Error("Method not implemented.")}layoutAllowedInContext(e){return!1}initLayoutManager(e,t,n){throw new Error("Method not implemented.")}applyLayoutSnapshot(e,t,n){throw new Error("Method not implemented.")}createLayout(e,t){throw new Error("Method not implemented.")}destroyLayout(e,t){throw new Error("Method not implemented.")}resolveLayout(e,t){throw new Error("Method not implemented.")}initPlatform(...e){throw new Error("Method not implemented.")}writeToken(e,t){return Promise.resolve("")}retrievePort(e){throw new Error("Method not implemented.")}getNextMessageId(){return this.getRandomId()}createChildContent(e){throw new Error("Method not implemented.")}getWebWindow(e){throw new Error("Method not implemented.")}getCurrentEntityIdentity(){throw new Error("Method not implemented.")}getCurrentEntityType(){return"external connection"}raiseEvent(e,t){throw new Error("Method not implemented.")}getUrl(){return location.href}getDefaultChannelOptions(){return{create:{},connect:{}}}getRtcPeer(){return new RTCPeerConnection}getWsConstructor(){return WebSocket}whenReady(){return Promise.resolve()}}jo=So.BrowserEnvironment=Lo;const To=e=>"platform"in e&&void 0!==e.platform;var $o,Bo;class Go extends jo{constructor(e){super(),this.connectConfig=e,$o.set(this,void 0),Bo.set(this,new G((async()=>Promise.resolve().then((function(){return __webpack_require__(/*! ./main-92c82377.js */ "../../node_modules/@openfin/core-web/out/main-92c82377.js")}))))),To(e)&&this.validatePlatformOptions(e)}validatePlatformOptions({platform:e}){if(!("layoutSnapshot"in e))throw new Error("Platform options are missing layoutSnapshot. Please provide a layoutSnapshot in the platform options.");if("windows"in e||"windows"in e.layoutSnapshot)throw new Error("It appears you tried to call connect() with a snapshot object from an OpenFin desktop environment. Note that connect() expects to be called with a platform property with this structure: { platform: { layoutSnapshot } }. To get a layoutSnapshot of the expected structure, use fin.Platform.Layout.getCurrentLayoutManagerSync().getLayoutSnapshot() in v34+ in your desktop environment.");const{layouts:t}=e.layoutSnapshot;Object.entries(t).map((([e,t])=>{if("object"!=typeof t||null===t)throw new Error(`Invalid layout detected: layoutSnapshot.layouts.${e} must be an object.`);if(!("content"in t))throw new Error(`Invalid layout detected: layoutSnapshot.layouts.${e} must contain a 'content' property.`)}))}async getInteropInfo(e){return{...{contextGroups:void 0,logging:{beforeAction:{enabled:!1},afterAction:{enabled:!1}}},fdc3Version:void 0,fdc3Info:{providerVersion:"0.38.49",provider:"OpenFin Web"}}}layoutAllowedInContext(e){return!0}async initLayoutManager(e,t,n){if(Mo(this,$o,"f"))throw new Error("Layout already initialized.");if(!To(this.connectConfig))throw new Error("Platform options are missing from connection config.");const{createWebLayoutModule:i}=await Mo(this,Bo,"f").getValue();return Oo(this,$o,i(this.connectConfig),"f"),await Mo(this,$o,"f").init(n),Mo(this,$o,"f").getCurrentLayoutManagerSync()}async applyLayoutSnapshot(e,t,n){}async createLayout(e,t){return Mo(this,$o,"f").create(t)}async destroyLayout(e,t){return Mo(this,$o,"f").destroy(t)}}$o=new WeakMap,Bo=new WeakMap;const Wo=()=>{const e=((e,t)=>{const n=new RegExp(`^${t}<(?.*)>$`).exec(e)?.groups?.meta;if(n)try{return JSON.parse(atob(n))}catch(e){throw new Error(`Failed to decode JSON from ${n}.`)}})(window.name,"of-frame");if(e)try{const{name:t,uuid:n,brokerUrl:i,providerId:r,contextGroup:o}=e;return xo(i,"brokerUrl"),xo(n,"uuid"),xo(t,"name"),{identity:{name:t,uuid:n},brokerUrl:i,interopConfig:{providerId:r,currentContextGroup:o}}}catch(e){throw new Error(`Unexpected error occurred when inferring platform information: ${e.stack}`)}},Ho=()=>{const e=i.v4();return{uuid:e,name:e}},No=async e=>{if("enabled"===e.connectionInheritance){const t=await(async e=>{const t=Wo();if(t){const{validateOptions:n=(()=>!0)}=e,{identity:i,...r}=t;if(!await n(r))throw new Error("Parent options were rejected by validateOptions.");return t}})(e);if(t)return t}if(!e.options){const t="enabled"===e.connectionInheritance?"Broker URL was not specified nor provided by a platform container.":"Connection inheritance is disabled but no options were provided.";throw new Error(t)}return{...e.options,identity:Ho()}};exports.__classPrivateFieldGet=Mo,exports.__classPrivateFieldSet=Oo,exports.commonjsGlobal=o,exports.connect=async t=>{try{Eo.log("Establishing connection",t);const{brokerUrl:n,identity:i,timeout:o,interopConfig:s}=await No(t),{workerPort:a,iframeBrokerPort:c}=await(async(e,t,n)=>{const{origin:i}=new URL(e),o=document.createElement("IFRAME");let s;o.style.display="none";try{return await new Promise(((a,c)=>{const d=e=>{if(e.source===o.contentWindow&&e.data?.topic===`ack-${Ao}`){if(e.origin!==i)c(new Error(`Broker redirected to unexpected origin ${e.origin}, expected ${i}.`));else if(e.data.success){const[t,n]=e.ports;a({iframeBrokerPort:t,workerPort:n})}else c(new g(e.data));window.removeEventListener("message",d),clearTimeout(s)}};window.addEventListener("message",d),Po.log(`Connecting to broker ${e}`),o.setAttribute("src",e),o.setAttribute("name",r(t,"of-broker")),document.body.appendChild(o),Po.log("Iframe loaded, awaiting init message from iframe"),n&&(s=setTimeout((()=>{window.removeEventListener("message",d),document.body.removeChild(o),c(new Error("Worker did not initialize in time"))}),n))}))}catch(e){throw new Error(`Failed to initialise Fin Web Client. ${e.message}`,{cause:e})}})(n,i,o);Eo.log("Successfully established connection to shared worker");const d={entityType:"external connection",...i};a.start(),c.start();const h=((t,n,i)=>{const r=_o(n),o=new Go(t),s=new wo(r,o,i);return s.connectSync(),window.Buffer=e.Buffer,new jr(s)})(t,a,d);return s?.providerId&&(h.me.interop=h.Interop.connectSync(s.providerId),s?.currentContextGroup&&h.me.interop.joinContextGroup(s.currentContextGroup).catch((e=>{console.warn(`Error joining specified context group: ${s?.currentContextGroup}, continuing`,e)}))),{...h,me:{...h.me,identity:{uuid:h.me.uuid,name:h.me.name}}}}catch(e){throw new Error(`An error occured during web-interop connection: ${e.message}`)}},exports.encodeOptions=r; +var e=__webpack_require__(/*! ./main-efd674f2.js */ "./node_modules/@openfin/core-web/out/main-efd674f2.js"),t=__webpack_require__(/*! golden-layout */ "../../node_modules/golden-layout/dist/esm/index.js"),i=__webpack_require__(/*! uuid */ "../../node_modules/uuid/dist/esm-browser/index.js");__webpack_require__(/*! buffer/ */ "../../node_modules/buffer/index.js"),__webpack_require__(/*! events */ "../../node_modules/events/events.js"),__webpack_require__(/*! lodash */ "../../node_modules/lodash/lodash.js");var o={},n={};Object.defineProperty(n,"__esModule",{value:!0}),n.mapValuesAsync=n.mapEntriesAsync=void 0;const s=(e,[t,i])=>({...e,[t]:i});async function a(e,t){return(await Promise.all(t.map((async([t,i])=>[t,await e(i,t)])))).reduce(s,{})}n.mapEntriesAsync=a,n.mapValuesAsync=async function(e,t){let i;return i=t instanceof Map?[...t.entries()]:Object.entries(t),a(e,i)};var r,l,c,u,h=e.commonjsGlobal&&e.commonjsGlobal.__classPrivateFieldSet||function(e,t,i,o,n){if("m"===o)throw new TypeError("Private method is not writable");if("a"===o&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===o?n.call(e,i):n?n.value=i:t.set(e,i),i},d=e.commonjsGlobal&&e.commonjsGlobal.__classPrivateFieldGet||function(e,t,i,o){if("a"===i&&!o)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?o:"a"===i?o.call(e):o?o.value:t.get(e)};Object.defineProperty(o,"__esModule",{value:!0});var m=o.DefaultLayoutManager=void 0;const y=n;class f{constructor(e){l.set(this,void 0),c.set(this,new Map),h(this,l,e,"f")}size(){return d(this,c,"f").size}async applyLayoutSnapshot({layouts:e}){if(Object.keys(e).length>1)throw new Error("[LayoutManager] Tried to call applyLayoutSnapshot with more than 1 layout. When implementing multiple layouts via overridden LayoutManager class, you must override and fully implement the applyLayoutSnapshot method without calling super.applyLayoutSnapshot().");const[[t,i]]=Object.entries(e);await f.createLayout(this,{layoutName:t,layout:i})}async showLayout({layoutName:e}){}async getLayoutSnapshot(){return{layouts:await(0,y.mapValuesAsync)((e=>e.getFrameSnapshot()),d(this,c,"f"))}}async removeLayout({layoutName:e}){}getLayoutIdentityForView(e){const t=[...d(this,c,"f").values()].find((t=>t.getCurrentViews().some((t=>t.name===e.name&&t.uuid===e.uuid))));return t?.identity??void 0}isLayoutVisible({layoutName:e}){return d(f,r,"m",u).call(f,this,e).isVisible()}resolveLayoutIdentity(e){if(e&&"layoutName"in e)return e;const t=[...d(this,c,"f").values()];if(1===t.length)return t[0].identity;const i=t.find((e=>e.isVisible()));return i?.identity??void 0}static async resolveLayout(e,t){const i=e.resolveLayoutIdentity(t);if(void 0===i||!("layoutName"in i))throw new Error("[layout-manager] resolveLayout: Could not resolve the layout identity. Make sure you include 'layoutName' in the identity object.");return d(f,r,"m",u).call(f,e,i.layoutName)}static async handleSharedView(e,t,i){await(0,y.mapValuesAsync)((async e=>{if(e.identity.layoutName!==t.layoutName){const t=e.getCurrentViews().find((e=>e.name===i.name));t&&await e.onViewDetached({viewIdentity:t,target:null}).catch(console.error)}}),d(e,c,"f"))}static async handleLastViewRemoved(e,t){await e.removeLayout(t),await d(e,l,"f").handleLastViewRemoved(e)}static async destroyLayout(e,{layoutName:t}){await d(f,r,"m",u).call(f,e,t).destroy(),d(e,c,"f").delete(t)}static async createLayout(e,t){const{layoutName:i}=t;if(d(e,c,"f").has(i))throw new Error(`Layout name ${i} already exists`);await d(e,l,"f").createLayout(t,e)}static registerLayout(e,t,i){d(e,c,"f").set(t,i)}static getAllLayouts(e){return[...d(e,c,"f").values()]}static setInitialSnapshot(e,t){d(e,l,"f").setInitialSnapshot(t)}static createClosedConstructor(...e){return class extends f{constructor(){super(...e)}}}}m=o.DefaultLayoutManager=f,r=f,l=new WeakMap,c=new WeakMap,u=function(e,t){const i=d(e,c,"f").get(t);if(!i)throw new Error(`[layout-manager] getLayoutByName: Could not locate layout with name '${t}'`);return i};var p={};Object.defineProperty(p,"__esModule",{value:!0});var w=p.BaseLayout=void 0;w=p.BaseLayout=class{};var v={};Object.defineProperty(v,"__esModule",{value:!0});var g=v.DOMEmitter=void 0;g=v.DOMEmitter=class{constructor(e){this.container=e}dispatchLocalEvent(e,t){const i={...t,type:e,tabSelector:`tab-${t.name}`,containerSelector:`container-${t.name}`,topic:"openfin-DOM-event"};this.container.dispatchEvent(new CustomEvent(e,{detail:i}))}};var b={};Object.defineProperty(b,"__esModule",{value:!0});var C=b.isVisible=void 0;C=b.isVisible=e=>(0!==e.offsetWidth||0!==e.offsetHeight)&&"hidden"!==window.getComputedStyle(e).visibility&&e.offsetTop>=0&&e.offsetLeft>=0&&e.offsetTop<=window.innerHeight&&e.offsetLeft<=window.innerWidth;const L="initial_",E={show:"top",popout:!1,maximise:!1,close:"close-tab-unused"},_={headerHeight:31},S={hasHeaders:!0,reorderEnabled:!0},V={popoutWholeStack:!1,constrainDragToContainer:!1,constrainDragToHeaders:!1,preventDragout:!1,showMaximiseIcon:!1,showPopoutIcon:!1,showCloseIcon:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,selectionEnabled:!1};var M,N,A;class P{constructor(t){this.layout=t,M.set(this,void 0),N.set(this,void 0),A.set(this,!1),this.handleResize=t=>{t.forEach((t=>{const i=this.layout.viewComponentsByContainerElement.get(t.target);i&&i.resize(i.container.element.getBoundingClientRect(),e.__classPrivateFieldGet(this,A,"f"))}))},this.handleMutation=()=>{document.body.classList.contains("lm_dragging")?(this.layout.handleDragStart(),e.__classPrivateFieldSet(this,A,!0,"f")):(this.layout.handleDragEnd(),e.__classPrivateFieldSet(this,A,!1,"f")),this.layout.viewComponentsByContainerElement.forEach((e=>{const t=e.container.tab.element;t&&t.className.includes("lm_dragging")&&e.hide()}))},e.__classPrivateFieldSet(this,M,new ResizeObserver(this.handleResize),"f"),e.__classPrivateFieldSet(this,N,new MutationObserver(this.handleMutation),"f")}observeDragging(){const t=this.layout.layout.rootItem;if(!t)throw new Error("Root item not found in layout.");e.__classPrivateFieldGet(this,N,"f")?.observe(t.element,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class"]})}destroy(){e.__classPrivateFieldGet(this,M,"f").disconnect(),e.__classPrivateFieldGet(this,N,"f").disconnect()}observeContainer(t){e.__classPrivateFieldGet(this,M,"f").observe(t)}unobserveContainer(t){e.__classPrivateFieldGet(this,M,"f").unobserve(t)}}function k(e=[],t){for(const i of e)"component"===i.type?Object.keys(t).forEach((e=>{e in i&&(i.componentState={[`${L}${e}`]:i[e],...i.componentState}),i[e]=t[e]})):k(i.content,t)}function F(e=[],t,i){for(const o of e)if("component"===o.type)Object.keys(t).forEach((e=>{if(`${L}${e}`in o.componentState)return o[e]=o.componentState[`${L}${e}`],void delete o.componentState[`${L}${e}`];o[e]=t[e]}));else{if(o.size&&("row"===i||"column"===i)){o["row"===i?"width":"height"]=o.size?.includes(".")?parseFloat(o.size):parseInt(o.size)}F(o.content,t,o.type)}}function $(e){if(e.root){e.root.content&&F([e.root],{componentName:"view",isClosable:!0});const t=e.root;e.content=[t],delete e.root}return e}M=new WeakMap,N=new WeakMap,A=new WeakMap;const x=t=>class extends t{connectedCallback(){if(!this.name||!this.uuid)throw new Error(" Name or uuid attribute missing");if(!this.src)throw new Error(" missing 'src' attribute.");this.#e||(this.#e=document.createElement("iframe"),this.#e.src=this.src,this.#e.style.height="100%",this.#e.style.width="100%",this.#e.style.border="none",this.forceFrameName?this.#e.setAttribute("name",this.forceFrameName):this.#e.setAttribute("name",e.encodeOptions({brokerUrl:this.brokerUrl,name:this.name,uuid:this.uuid,providerId:this.providerId,contextGroup:this.contextGroup},"of-frame")),this.#e.setAttribute("id",this.name),this.appendChild(this.#e))}#e;get brokerUrl(){return this.getAttribute("of-broker")}set brokerUrl(e){e&&this.setAttribute("of-broker",e)}get name(){return this.getAttribute("of-name")}set name(e){e&&this.setAttribute("of-name",e)}get forceFrameName(){return this.getAttribute("forceFrameName")}set forceFrameName(e){e&&this.setAttribute("forceFrameName",e)}get uuid(){return this.getAttribute("of-uuid")}set uuid(e){e&&this.setAttribute("of-uuid",e)}get src(){return this.getAttribute("src")}set src(e){e&&this.setAttribute("src",e)}get providerId(){return this.getAttribute("of-provider-id")}set providerId(e){e&&this.setAttribute("of-provider-id",e)}get contextGroup(){return this.getAttribute("of-context-group")}set contextGroup(e){e&&this.setAttribute("of-context-group",e)}static get observedAttributes(){return["name"]}};class I{static create(e){const t=document.createElement("of-view");return Object.entries(e).forEach((([e,i])=>{t.setAttribute(e,i)})),t}}customElements.define("of-view",x(HTMLElement));class z{constructor(e,t,o,{brokerUrl:n,interopConfig:s},a){this.container=e,this.config=t,this.ofView=null;const{url:r,web:l,interop:c}=t||{},u=`internal-generated-view-${i.v4()}`;if(this.identity={uuid:o,name:u},this.container.element.setAttribute("of-name",u),this.container.element.id=`container-${u}`,void 0===r)return void this.handleUrlMissing();const h=this.updateTitleIfNotSet(r),d={"of-broker":n,"of-uuid":o,"of-name":u,src:r};l?.frameName&&(d.forceFrameName=l.frameName);const m=c?.currentContextGroup??s?.currentContextGroup;m&&(d["of-context-group"]=m),s?.providerId&&(d["of-provider-id"]=s?.providerId),this.ofView=I.create(d),this.ofView.title=h??`Iframe: ${r}`,a.appendChild(this.ofView),this.ofView.style.position="absolute"}updateTitleIfNotSet(e){return"view"===this.container.parent.title&&this.container.parent.setTitle(e),this.container.parent.title}handleUrlMissing(){const e=document.createElement("div");e.setAttribute("style","padding: 20px");e.innerText="No URL provided",this.container.element.appendChild(e)}destroy(){this.ofView?.remove(),this.ofView=null}resize(e,t=!1){this.ofView&&(this.ofView.style.position="absolute",this.ofView.style.height=`${e.height}px`,this.ofView.style.width=`${e.width}px`,this.ofView.style.inset=`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`,t||(this.ofView.style.display="block"))}hide(){this.ofView&&(this.ofView.style.display="none")}}class G extends w{static overrideConfig(e){const t={...S,...e.settings,...V};return t.reorderEnabled?k(e.content,{isClosable:!0}):k(e.content,{reorderEnabled:!1}),{dimensions:_,...e,settings:t,header:{...E,show:!1!==e.settings?.hasHeaders&&E.show}}}constructor(e,i,o,{options:n},s){super(),this.identity=e,this.container=i,this.initialConfig=o,this.layoutManager=s,this.viewComponentsByContainerElement=new Map,this.createViewComponent=(e,t)=>{const i=new z(e,t,this.identity.uuid,this.options,this.iframeContainer);return t&&!1===t[`${L}isClosable`]&&this.stylesheet.insertRule(`#tab-${i.identity.name} .lm_close_tab { display: none; }`),this.viewComponentsByContainerElement.set(e.element,i),this.resizeController.observeContainer(e.element),i},this.iframeContainer=document.createElement("div"),this.iframeContainer.id=`openfin-layout-iframe-container-${this.identity.layoutName}`,this.domEmitter=new g(i),this.setupStylesheets(),this.layout=new t.GoldenLayout(this.container),this.layout.resizeWithContainerAutomatically=!0,this.options=n,this.layout.registerComponent("view",this.createViewComponent),this.setupListeners(),this.resizeController=new P(this),this.layout.loadLayout(G.overrideConfig(o));const a=document.createElement("div");a.attachShadow({mode:"open",delegatesFocus:!1}).appendChild(this.iframeContainer),this.container.appendChild(a),this.resizeController.observeDragging()}setupStylesheets(){if(this.container.setAttribute("data-openfin-layout-name",this.identity.layoutName),this.stylesheet=new CSSStyleSheet,this.stylesheet.insertRule(".lm_close { display: none; }"),document.adoptedStyleSheets.push(this.stylesheet),this.initialConfig.settings?.preventSplitterResize){const e=`\n [data-openfin-layout-name='${this.identity.layoutName}'] .lm_splitter {\n pointer-events: none;\n }`;this.stylesheet.insertRule(e)}}addView(e){throw new Error("Method not implemented.")}replaceView({viewToReplace:e,newView:t}){throw new Error("Method not implemented.")}replaceLayout(e){throw new Error("Method not implemented.")}closeView(e){throw new Error("Method not implemented.")}applyPreset(e){throw new Error("Method not implemented.")}getCurrentViews(){return[...this.viewComponentsByContainerElement.values()].map((e=>e.identity))}async getFrameSnapshot(){return $(t.LayoutConfig.fromResolved(this.layout.toConfig()))}isVisible(){return C(this.container)}async onViewDetached(){throw new Error("Method not implemented.")}async destroy(){this.layout.destroy(),this.iframeContainer.remove(),this.resizeController.destroy(),document.adoptedStyleSheets=document.adoptedStyleSheets.filter((e=>e!==this.stylesheet)),this.viewComponentsByContainerElement.clear()}setupListeners(){this.container.addEventListener("mousedown",(e=>{e.target instanceof HTMLElement&&e.target.classList.contains("lm_drag_handle")&&this.handleDragStart()})),this.container.addEventListener("pointerdown",(e=>{if(e.target instanceof HTMLElement&&2===e.button){const t=e.target.classList;["lm_tab","lm_title","lm_splitter","lm_drag_handle"].some((e=>t.contains(e)))&&e.stopPropagation()}}),!0),this.layout.on("tabCreated",(e=>{const t=e.componentItem.container.element.getAttribute("of-name")??i.v4(),o={name:t,uuid:t};e.element.id=`tab-${t}`,this.domEmitter.dispatchLocalEvent("tab-created",o)}));const e=e=>{const t=e.handleResize.bind(e);e.handleResize=function(e){"block"===getComputedStyle(e).display&&t()}.bind(e,this.container)};this.layout.on("itemCreated",(({target:t})=>{const o=t;if(o.isStack)return void e(o);if(!o.isComponent)return;const n=o.element.querySelector("[of-name]")?.getAttribute("of-name")??i.v4(),s={name:n,uuid:n};this.domEmitter.dispatchLocalEvent("container-created",s)})),this.layout.on("itemDestroyed",(e=>{if(!e.target.isComponent)return;const t=e.target;this.removeViewComponent(t.component)}))}handleDragStart(){this.iframeContainer.style.pointerEvents="none"}handleDragEnd(){this.iframeContainer.style.pointerEvents=""}removeViewComponent(e){if(e.config&&!1===e.config[`${L}isClosable`]){const t=[...this.stylesheet.cssRules].findIndex((t=>t.cssText.includes(`#tab-${e.identity.name}`)));this.stylesheet.deleteRule(t)}e.destroy(),this.viewComponentsByContainerElement.delete(e.container.element),this.resizeController.unobserveContainer(e.container.element);0===this.getCurrentViews().length&&m.handleLastViewRemoved(this.layoutManager,this.identity)}}class R{constructor(e,t,i){this.windowIdentity=e,this.connectConfig=t,this.fallbackContainer=i}async createLayout(e,t){if(!("container"in e)&&!this.fallbackContainer)throw new Error("Container property is not optional in web");const{layout:i,layoutName:o}=e,n=e.container??this.fallbackContainer,s={...this.windowIdentity,layoutName:o};this.webLayout=new G(s,n,i,this.connectConfig,t),m.registerLayout(t,o,this.webLayout),this.fallbackContainer=null}async getLayoutSnapshot(e){return e.getLayoutSnapshot()}async handleLastViewRemoved(e){}}var T;const j=e=>e;T=new WeakMap,exports.WebLayoutEntryPoint=class{constructor(t){T.set(this,void 0),this.initLayoutManager=async(t,i,{container:o,layoutManagerOverride:n})=>{const s=n??j,a=new R(i.me,e.__classPrivateFieldGet(this,T,"f"),o);return new(s(m.createClosedConstructor(a)))},this.applyLayoutSnapshot=async(t,i,o)=>{await i.applyLayoutSnapshot(e.__classPrivateFieldGet(this,T,"f").platform.layoutSnapshot)},this.createLayout=async(e,t)=>m.createLayout(e,t),this.destroyLayout=async(e,t)=>m.destroyLayout(e,t),e.__classPrivateFieldSet(this,T,t,"f")}}; /***/ }), -/***/ "../../node_modules/@openfin/core-web/out/main-92c82377.js": -/*!*****************************************************************!*\ - !*** ../../node_modules/@openfin/core-web/out/main-92c82377.js ***! - \*****************************************************************/ +/***/ "./node_modules/@openfin/core-web/out/main-efd674f2.js": +/*!*************************************************************!*\ + !*** ./node_modules/@openfin/core-web/out/main-efd674f2.js ***! + \*************************************************************/ /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; -var t=__webpack_require__(/*! ./main-48131439.js */ "../../node_modules/@openfin/core-web/out/main-48131439.js"),e=__webpack_require__(/*! uuid */ "../../node_modules/uuid/dist/esm-browser/index.js"),o=__webpack_require__(/*! golden-layout */ "../../node_modules/golden-layout/dist/esm/index.js");__webpack_require__(/*! buffer/ */ "../../node_modules/buffer/index.js"),__webpack_require__(/*! events */ "../../node_modules/events/events.js"),__webpack_require__(/*! lodash */ "../../node_modules/lodash/lodash.js");var i={},r={};Object.defineProperty(r,"__esModule",{value:!0}),r.mapValuesAsync=r.mapEntriesAsync=void 0;const a=(t,[e,o])=>({...t,[e]:o});async function n(t,e){return(await Promise.all(e.map((async([e,o])=>[e,await t(o,e)])))).reduce(a,{})}r.mapEntriesAsync=n,r.mapValuesAsync=async function(t,e){let o;return o=e instanceof Map?[...e.entries()]:Object.entries(e),n(t,o)};var s,c,l,u,d=t.commonjsGlobal&&t.commonjsGlobal.__classPrivateFieldSet||function(t,e,o,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!r:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(t,o):r?r.value=o:e.set(t,o),o},h=t.commonjsGlobal&&t.commonjsGlobal.__classPrivateFieldGet||function(t,e,o,i){if("a"===o&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===o?i:"a"===o?i.call(t):i?i.value:e.get(t)};Object.defineProperty(i,"__esModule",{value:!0});var m=i.DefaultLayoutManager=void 0;const y=r;class f{constructor(t){c.set(this,void 0),l.set(this,new Map),d(this,c,t,"f")}size(){return h(this,l,"f").size}async applyLayoutSnapshot({layouts:t}){if(Object.keys(t).length>1)throw new Error("[LayoutManager] Tried to call applyLayoutSnapshot with more than 1 layout. When implementing multiple layouts via overridden LayoutManager class, you must override and fully implement the applyLayoutSnapshot method without calling super.applyLayoutSnapshot().");const[[e,o]]=Object.entries(t);await f.createLayout(this,{layoutName:e,layout:o})}async showLayout({layoutName:t}){}async getLayoutSnapshot(){return{layouts:await(0,y.mapValuesAsync)((t=>t.getFrameSnapshot()),h(this,l,"f"))}}async removeLayout({layoutName:t}){}getLayoutIdentityForView(t){const e=[...h(this,l,"f").values()].find((e=>e.getCurrentViews().some((e=>e.name===t.name&&e.uuid===t.uuid))));return e?.identity??void 0}isLayoutVisible({layoutName:t}){return h(f,s,"m",u).call(f,this,t).isVisible()}resolveLayoutIdentity(t){if(t&&"layoutName"in t)return t;const e=[...h(this,l,"f").values()];if(1===e.length)return e[0].identity;const o=e.find((t=>t.isVisible()));return o?.identity??void 0}static async resolveLayout(t,e){const o=t.resolveLayoutIdentity(e);if(void 0===o||!("layoutName"in o))throw new Error("[layout-manager] resolveLayout: Could not resolve the layout identity. Make sure you include 'layoutName' in the identity object.");return h(f,s,"m",u).call(f,t,o.layoutName)}static async handleSharedView(t,e,o){await(0,y.mapValuesAsync)((async t=>{if(t.identity.layoutName!==e.layoutName){const e=t.getCurrentViews().find((t=>t.name===o.name));e&&await t.onViewDetached({viewIdentity:e,target:null}).catch(console.error)}}),h(t,l,"f"))}static async handleLastViewRemoved(t,e){await t.removeLayout(e),await h(t,c,"f").handleLastViewRemoved(t)}static async destroyLayout(t,{layoutName:e}){await h(f,s,"m",u).call(f,t,e).destroy(),h(t,l,"f").delete(e)}static async createLayout(t,e){const{layoutName:o}=e;if(h(t,l,"f").has(o))throw new Error(`Layout name ${o} already exists`);await h(t,c,"f").createLayout(e,t)}static registerLayout(t,e,o){h(t,l,"f").set(e,o)}static getAllLayouts(t){return[...h(t,l,"f").values()]}static setInitialSnapshot(t,e){h(t,c,"f").setInitialSnapshot(e)}static createClosedConstructor(...t){return class extends f{constructor(){super(...t)}}}}m=i.DefaultLayoutManager=f,s=f,c=new WeakMap,l=new WeakMap,u=function(t,e){const o=h(t,l,"f").get(e);if(!o)throw new Error(`[layout-manager] getLayoutByName: Could not locate layout with name '${e}'`);return o};var p={};Object.defineProperty(p,"__esModule",{value:!0});var w=p.BaseLayout=void 0;w=p.BaseLayout=class{};var v={};Object.defineProperty(v,"__esModule",{value:!0});var b=v.DOMEmitter=void 0;b=v.DOMEmitter=class{constructor(t){this.container=t}dispatchLocalEvent(t,e){const o={...e,type:t,tabSelector:`tab-${e.name}`,containerSelector:`container-${e.name}`,topic:"openfin-DOM-event"};this.container.dispatchEvent(new CustomEvent(t,{detail:o}))}};var g={};Object.defineProperty(g,"__esModule",{value:!0});var L=g.isVisible=void 0;L=g.isVisible=t=>(0!==t.offsetWidth||0!==t.offsetHeight)&&"hidden"!==window.getComputedStyle(t).visibility&&t.offsetTop>=0&&t.offsetLeft>=0&&t.offsetTop<=window.innerHeight&&t.offsetLeft<=window.innerWidth;const E={show:"top",popout:!1,maximise:!1,close:!1},_={headerHeight:31},C={hasHeaders:!0},M={reorderEnabled:!1,popoutWholeStack:!1,constrainDragToContainer:!1,constrainDragToHeaders:!1,preventDragout:!1,showMaximiseIcon:!1,showPopoutIcon:!1,showCloseIcon:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,selectionEnabled:!1};function A(t=[],e){for(const o of t)"component"===o.type?Object.keys(e).forEach((t=>o[t]=e[t])):A(o.content,e)}const P=e=>class extends e{connectedCallback(){if(!this.name||!this.uuid)throw new Error(" Name or uuid attribute missing");if(!this.src)throw new Error(" missing 'src' attribute.");this.#t||(this.#t=document.createElement("iframe"),this.#t.src=this.src,this.#t.style.height="100%",this.#t.style.width="100%",this.#t.style.border="none",this.forceFrameName?this.#t.setAttribute("name",this.forceFrameName):this.#t.setAttribute("name",t.encodeOptions({brokerUrl:this.brokerUrl,name:this.name,uuid:this.uuid,providerId:this.providerId,contextGroup:this.contextGroup},"of-frame")),this.#t.setAttribute("id",this.name),this.appendChild(this.#t))}#t;get brokerUrl(){return this.getAttribute("of-broker")}set brokerUrl(t){t&&this.setAttribute("of-broker",t)}get name(){return this.getAttribute("of-name")}set name(t){t&&this.setAttribute("of-name",t)}get forceFrameName(){return this.getAttribute("forceFrameName")}set forceFrameName(t){t&&this.setAttribute("forceFrameName",t)}get uuid(){return this.getAttribute("of-uuid")}set uuid(t){t&&this.setAttribute("of-uuid",t)}get src(){return this.getAttribute("src")}set src(t){t&&this.setAttribute("src",t)}get providerId(){return this.getAttribute("of-provider-id")}set providerId(t){t&&this.setAttribute("of-provider-id",t)}get contextGroup(){return this.getAttribute("of-context-group")}set contextGroup(t){t&&this.setAttribute("of-context-group",t)}static get observedAttributes(){return["name"]}};class N{static create(t){const e=document.createElement("of-view");return Object.entries(t).forEach((([t,o])=>{e.setAttribute(t,o)})),e}}customElements.define("of-view",P(HTMLElement));class S{constructor(t,o,i,{brokerUrl:r,interopConfig:a}){this.container=t;const{url:n,web:s,name:c=e.v4(),interop:l}=o||{};if(this.container.element.setAttribute("of-name",c),this.container.element.id=`container-${c}`,void 0===n)return void this.handleUrlMissing();const u=this.updateTitleIfNotSet(n),d={"of-broker":r,"of-uuid":i,"of-name":c,src:n};s?.frameName&&(d.forceFrameName=s.frameName);const h=l?.currentContextGroup??a?.currentContextGroup;h&&(d["of-context-group"]=h),a?.providerId&&(d["of-provider-id"]=a?.providerId);const m=N.create(d);m.title=u??`Iframe: ${n}`,this.container.element.appendChild(m)}updateTitleIfNotSet(t){return"view"===this.container.parent.title&&this.container.parent.setTitle(t),this.container.parent.title}handleUrlMissing(){const t=document.createElement("div");t.setAttribute("style","padding: 20px");t.innerText="No URL provided",this.container.element.appendChild(t)}}class F extends w{static overrideConfig(t){return A(t.content,{isClosable:!1}),{dimensions:_,...t,settings:{...C,...t.settings,...M},header:{...E,show:!1!==t.settings?.hasHeaders&&E.show}}}constructor(t,e,i,{options:r}){super(),this.identity=t,this.container=e,this.domEmitter=new b(e),this.layout=new o.GoldenLayout(this.container),this.layout.resizeWithContainerAutomatically=!0,this.layout.registerComponent("view",((e,o)=>new S(e,o,t.uuid,r))),this.setupListeners(),this.layout.loadLayout(F.overrideConfig(i))}addView(t){throw new Error("Method not implemented.")}replaceView({viewToReplace:t,newView:e}){throw new Error("Method not implemented.")}replaceLayout(t){throw new Error("Method not implemented.")}closeView(t){throw new Error("Method not implemented.")}applyPreset(t){throw new Error("Method not implemented.")}getCurrentViews(){throw new Error("Method not implemented.")}async getFrameSnapshot(){return function(t){if(t.root){t.root.content&&A(t.root.content,{componentName:"view"});const e=t.root;t.content=[e],delete t.root}return t}(o.LayoutConfig.fromResolved(this.layout.toConfig()))}isVisible(){return L(this.container)}async onViewDetached(){throw new Error("Method not implemented.")}async destroy(){this.layout.destroy()}setupListeners(){this.layout.on("tabCreated",(t=>{const o=t.componentItem.container.element.getAttribute("of-name")??e.v4(),i={name:o,uuid:o};t.element.id=`tab-${o}`,this.domEmitter.dispatchLocalEvent("tab-created",i)})),this.layout.on("itemCreated",(({target:t})=>{const o=t;if(!o.isComponent)return;const i=o.element.querySelector("[of-name]")?.getAttribute("of-name")??e.v4(),r={name:i,uuid:i};this.domEmitter.dispatchLocalEvent("container-created",r),setTimeout((()=>{document.querySelectorAll(".lm_splitter").forEach((t=>{t.style.pointerEvents="none"}))}),1)}))}}class k{constructor(t,e,o){this.windowIdentity=t,this.connectConfig=e,this.fallbackContainer=o}async createLayout(t,e){if(!("container"in t)&&!this.fallbackContainer)throw new Error("Container property is not optional in web");const{layout:o,layoutName:i}=t,r=t.container??this.fallbackContainer,a={...this.windowIdentity,layoutName:i},n=new F(a,r,o,this.connectConfig);m.registerLayout(e,i,n),this.fallbackContainer=null}async getLayoutSnapshot(t){return t.getLayoutSnapshot()}async handleLastViewRemoved(t){throw new Error("Method not implemented.")}}var V,G,I,j,x;const T=t=>t;class O{constructor(o){V.add(this),G.set(this,void 0),I.set(this,void 0),j.set(this,void 0),this.init=async({container:e,layoutManagerOverride:o})=>{const i=o??T,r=new k(t.__classPrivateFieldGet(this,j,"f"),t.__classPrivateFieldGet(this,G,"f"),e);t.__classPrivateFieldSet(this,I,new(i(m.createClosedConstructor(r))),"f"),await t.__classPrivateFieldGet(this,I,"f").applyLayoutSnapshot(t.__classPrivateFieldGet(this,G,"f").platform.layoutSnapshot)},this.getCurrentLayoutManagerSync=()=>(t.__classPrivateFieldGet(this,V,"m",x).call(this),t.__classPrivateFieldGet(this,I,"f")),this.create=async e=>(t.__classPrivateFieldGet(this,V,"m",x).call(this),m.createLayout(t.__classPrivateFieldGet(this,I,"f"),e)),this.destroy=async e=>(t.__classPrivateFieldGet(this,V,"m",x).call(this),m.destroyLayout(t.__classPrivateFieldGet(this,I,"f"),e)),t.__classPrivateFieldSet(this,G,o,"f");const i=e.v4();t.__classPrivateFieldSet(this,j,{name:i,uuid:i},"f")}}G=new WeakMap,I=new WeakMap,j=new WeakMap,V=new WeakSet,x=function(){if(!t.__classPrivateFieldGet(this,I,"f"))throw new Error("You must call init before using this API")};exports.createWebLayoutModule=t=>new O(t); +var e=__webpack_require__(/*! buffer/ */ "../../node_modules/buffer/index.js"),t=__webpack_require__(/*! events */ "../../node_modules/events/events.js"),n=__webpack_require__(/*! lodash */ "../../node_modules/lodash/lodash.js"),i=__webpack_require__(/*! uuid */ "../../node_modules/uuid/dist/esm-browser/index.js");const r=(e,t)=>`${t}<${btoa(JSON.stringify(e))}>`;var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof __webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self?self:{},s={},a={},c={},d={};async function h(e){const t=[];for(const n of e){const e=await n();t.push(e)}return t}Object.defineProperty(d,"__esModule",{value:!0}),d.promiseMapSerial=d.serial=d.promiseMap=d.promisify=void 0,d.promisify=function(e){return(...t)=>new Promise(((n,i)=>{e(...t,((e,t)=>e?i(e):n(t)))}))},d.promiseMap=async function(e,t){return Promise.all(e.map(t))},d.serial=h,d.promiseMapSerial=async function(e,t){return h(e.map(((e,n,i)=>()=>t(e,n,i))))};var l,u=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},p=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(c,"__esModule",{value:!0}),c.Reply=c.EmitterBase=c.Base=void 0;const w=d;class y{constructor(e){this.isNodeEnvironment=()=>"node"===this.wire.environment.type,this.isOpenFinEnvironment=()=>"openfin"===this.wire.environment.type,this.isBrowserEnvironment=()=>"other"===this.wire.environment.type,this.wire=e}get fin(){return this.wire.getFin()}get me(){return this.wire.me}}c.Base=y;c.EmitterBase=class extends y{constructor(e,t,...n){super(e),this.topic=t,l.set(this,void 0),this.eventNames=()=>this.hasEmitter()?this.getOrCreateEmitter().eventNames():[],this.emit=(e,t,...n)=>!!this.hasEmitter()&&this.getOrCreateEmitter().emit(e,t,...n),this.hasEmitter=()=>this.wire.eventAggregator.has(p(this,l,"f")),this.getOrCreateEmitter=()=>this.wire.eventAggregator.getOrCreate(p(this,l,"f")),this.listeners=e=>this.hasEmitter()?this.getOrCreateEmitter().listeners(e):[],this.listenerCount=e=>this.hasEmitter()?this.getOrCreateEmitter().listenerCount(e):0,this.registerEventListener=async(e,t={},n,i)=>{const r={...this.identity,timestamp:t.timestamp||Date.now(),topic:this.topic,type:e},o=this.getOrCreateEmitter();n(o);try{await this.wire.sendAction("subscribe-to-desktop-event",r)}catch(e){throw i(o),this.deleteEmitterIfNothingRegistered(o),e}},this.deregisterEventListener=async(e,t={})=>{if(this.hasEmitter()){const n={...this.identity,timestamp:t.timestamp||Date.now(),topic:this.topic,type:e};await this.wire.sendAction("unsubscribe-to-desktop-event",n).catch((()=>null));return this.getOrCreateEmitter()}return Promise.resolve()},u(this,l,[t,...n],"f"),this.listeners=e=>this.hasEmitter()?this.getOrCreateEmitter().listeners(e):[]}async on(e,t,n){return await this.registerEventListener(e,n,(n=>{n.on(e,t)}),(n=>{n.removeListener(e,t)})),this}async addListener(e,t,n){return this.on(e,t,n)}async once(e,t,n){const i=()=>this.deregisterEventListener(e);return await this.registerEventListener(e,n,(n=>{n.once(e,i),n.once(e,t)}),(n=>{n.removeListener(e,i),n.removeListener(e,t)})),this}async prependListener(e,t,n){return await this.registerEventListener(e,n,(n=>{n.prependListener(e,t)}),(n=>{n.removeListener(e,t)})),this}async prependOnceListener(e,t,n){const i=()=>this.deregisterEventListener(e);return await this.registerEventListener(e,n,(n=>{n.prependOnceListener(e,t),n.once(e,i)}),(n=>{n.removeListener(e,t),n.removeListener(e,i)})),this}async removeListener(e,t,n){const i=await this.deregisterEventListener(e,n);return i&&(i.removeListener(e,t),this.deleteEmitterIfNothingRegistered(i)),this}async deregisterAllListeners(e){const t={...this.identity,type:e,topic:this.topic};if(this.hasEmitter()){const e=this.getOrCreateEmitter(),n=e.listenerCount(t.type),i=[];for(let e=0;enull)));return await Promise.all(i),e}}async removeAllListeners(e){const t=async e=>{const t=await this.deregisterAllListeners(e);t&&(t.removeAllListeners(e),this.deleteEmitterIfNothingRegistered(t))};if(e)await t(e);else if(this.hasEmitter()){const e=this.getOrCreateEmitter().eventNames();await(0,w.promiseMap)(e,t)}return this}deleteEmitterIfNothingRegistered(e){0===e.eventNames().length&&this.wire.eventAggregator.delete(p(this,l,"f"))}},l=new WeakMap;c.Reply=class{};var f={};Object.defineProperty(f,"__esModule",{value:!0});var g=f.RuntimeError=f.NotSupportedError=f.NotImplementedError=f.NoAckError=f.DuplicateCorrelationError=f.UnexpectedActionError=f.DisconnectedError=void 0;class m extends Error{constructor(e){super(`Expected websocket state OPEN but found ${e}`),this.readyState=e}}f.DisconnectedError=m;class v extends Error{}f.UnexpectedActionError=v;class C extends Error{}f.DuplicateCorrelationError=C;class b extends Error{}f.NoAckError=b;class I extends Error{}f.NotImplementedError=I;class E extends Error{}f.NotSupportedError=E;class x extends Error{constructor(e){const{message:t,name:n,stack:i,...r}=e;super(t),this.name=n||"Error",this.stack=i??this.toString(),Object.keys(r).forEach((e=>{this[e]=r[e]}))}}class A extends Error{static getCallSite(e=0){const t=Error.stackTraceLimit,n=e+1;Error.stackTraceLimit=t+n;const i=Error.prepareStackTrace;Error.prepareStackTrace=(e,t)=>t;const r=(new Error).stack?.slice(n)??[];return Error.prepareStackTrace=i,Error.stackTraceLimit=t,r}static prepareStackTrace(e,t){if("function"==typeof Error.prepareStackTrace)return Error.prepareStackTrace(e,t);let n="";n+=e.name||"Error",n+=`: ${e.message||""}`;for(const e of t)n+=`\n at ${e.toString()}`;return n}constructor(e,t){const{reason:n,error:i}=e;super(n),this.name="RuntimeError",i?.stack&&(this.cause=new x(i)),t&&(this.stack=A.prepareStackTrace(this,t))}}g=f.RuntimeError=A;var P={},M={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.validateIdentity=void 0,O.validateIdentity=function(e){let t;return"object"==typeof e&&"string"==typeof e.uuid||(t="Not a valid identity object"),t};var _={},S={},R={},F={},j={},L={},k={};Object.defineProperty(k,"__esModule",{value:!0}),k.handleDeprecatedWarnings=void 0;var T;k.handleDeprecatedWarnings=e=>{(e.contentNavigation?.whitelist||e.contentNavigation?.blacklist||e.contentRedirect?.whitelist||e.contentRedirect?.blacklist)&&console.warn("The properties 'whitelist' and 'blacklist' have been marked as deprecated and will be removed in a future version. Please use 'allowlist' and 'denylist'.")};var $={},B={};Object.defineProperty(B,"__esModule",{value:!0}),B.AsyncRetryableLazy=G=B.Lazy=void 0;var G=B.Lazy=class{constructor(e){this.producerFn=e}getValue(){return this.value||(this.value=this.producerFn()),this.value}};B.AsyncRetryableLazy=class{constructor(e){this.producerFn=e}async getValue(){return this.promise||(this.promise=this.producerFn().catch((e=>{throw delete this.promise,e}))),this.promise}};var W={},H={},N={};Object.defineProperty(N,"__esModule",{value:!0}),N.ApiConsumer=void 0;N.ApiConsumer=class{constructor(e){this.strategy=e,this.consume=async e=>(await this.strategy.getExposedFunctions(e)).reduce(((t,n)=>({...t,[n.key]:this.strategy.createFunction(n,e)})),{})}};var D={},U={};Object.defineProperty(U,"__esModule",{value:!0}),U.expose=U.getExposedProperties=void 0;const V=Symbol("exposedProperties");U.getExposedProperties=e=>e[V]||e.prototype[V]||[];U.expose=e=>(t,n,i)=>{t[V]=t[V]||[],t[V].push({key:n,descriptor:i,options:e})},Object.defineProperty(D,"__esModule",{value:!0}),D.ApiExposer=void 0;const z=U;D.ApiExposer=class{constructor(e){this.strategy=e,this.exposeInstance=async(e,t)=>{const n=(0,z.getExposedProperties)(e),i=await Promise.all(n.map((async({key:n,options:i})=>({key:n,options:await this.strategy.exposeFunction(e[n].bind(e),{key:n,options:i,meta:t})}))));await this.strategy.exposeMeta(t,i)}}};var K={},q={},Y={};Object.defineProperty(Y,"__esModule",{value:!0}),Y.ChannelsConsumer=void 0;Y.ChannelsConsumer=class{constructor(e){this.channel=e,this.getExposedFunctions=async e=>{const{id:t}=e,{props:n}=await this.channel.dispatch(`api-meta:${t}`);return n},this.createFunction=e=>(...t)=>{const{action:n}=e.options;return this.channel.dispatch(n,{args:t})}}};var J={};Object.defineProperty(J,"__esModule",{value:!0}),J.ChannelsExposer=void 0;J.ChannelsExposer=class{constructor(e){this.channelProviderOrClient=e,this.exposeFunction=async(e,t)=>{const{key:n,options:i,meta:r}=t,{id:o}=r,s=`${o}.${i?.action||n}`;return await this.channelProviderOrClient.register(s,(async({args:t})=>e(...t))),{action:s}},this.exposeMeta=async({id:e},t)=>{const n=`api-meta:${e}`;await this.channelProviderOrClient.register(n,(()=>({props:t})))}}},function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Y,e),n(J,e)}(q),function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(q,e)}(K),function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(N,e),n(D,e),n(K,e),n(U,e)}(H);var Z={};Object.defineProperty(Z,"__esModule",{value:!0}),Z.createRelayedDispatch=Z.relayChannelClientApi=void 0;const Q=["no longer connected","RTCDataChannel closed unexpectedly","The client you are trying to dispatch from is disconnected from the target provider"];Z.relayChannelClientApi=async(e,t)=>{e.register(`relay:${t}`,(({action:t,target:n,payload:i})=>e.dispatch(n,t,i))),await Promise.resolve()};Z.createRelayedDispatch=(e,t,n,i)=>async(r,o)=>{try{return await e.dispatch(`relay:${n}`,{action:r,payload:o,target:t})}catch(e){if(s=e.message,Q.some((e=>s.includes(e)))&&i)throw new Error(i);throw e}var s};var X,ee,te,ne=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},ie=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(W,"__esModule",{value:!0}),W.ColumnOrRow=W.TabStack=W.LayoutNode=void 0;const re=H,oe=Z;class se{constructor(e,t){X.set(this,void 0),this.isRoot=()=>ie(this,X,"f").isRoot(this.entityId),this.exists=()=>ie(this,X,"f").exists(this.entityId),this.getParent=async()=>{const e=await ie(this,X,"f").getParent(this.entityId);if(e)return se.getEntity(e,ie(this,X,"f"))},this.createAdjacentStack=async(e,t)=>{const n=await ie(this,X,"f").createAdjacentStack(this.entityId,e,t);return se.getEntity({entityId:n,type:"stack"},ie(this,X,"f"))},this.getAdjacentStacks=async e=>(await ie(this,X,"f").getAdjacentStacks({targetId:this.entityId,edge:e})).map((e=>se.getEntity({type:"stack",entityId:e.entityId},ie(this,X,"f")))),ne(this,X,e,"f"),this.entityId=t}}W.LayoutNode=se,X=new WeakMap,se.newLayoutEntitiesClient=async(e,t,n)=>{const i=(0,oe.createRelayedDispatch)(e,n,"layout-relay","You are trying to interact with a layout component on a window that does not exist or has been destroyed.");return new re.ApiConsumer(new re.ChannelsConsumer({dispatch:i})).consume({id:t})},se.getEntity=(e,t)=>{const{entityId:n,type:i}=e;switch(i){case"column":case"row":return new ce(t,n,i);case"stack":return new ae(t,n);default:throw new Error(`Unrecognised Layout Entity encountered ('${JSON.stringify(e)})`)}};class ae extends se{constructor(e,t){super(e,t),ee.set(this,void 0),this.type="stack",this.getViews=()=>ie(this,ee,"f").getStackViews(this.entityId),this.addView=async(e,t={index:0})=>ie(this,ee,"f").addViewToStack(this.entityId,e,t),this.removeView=async e=>{await ie(this,ee,"f").removeViewFromStack(this.entityId,e)},this.setActiveView=async e=>{await ie(this,ee,"f").setStackActiveView(this.entityId,e)},ne(this,ee,e,"f")}}W.TabStack=ae,ee=new WeakMap;class ce extends se{constructor(e,t,n){super(e,t),te.set(this,void 0),this.getContent=async()=>(await ie(this,te,"f").getContent(this.entityId)).map((e=>se.getEntity(e,ie(this,te,"f")))),ne(this,te,e,"f"),this.type=n}}W.ColumnOrRow=ce,te=new WeakMap;var de={};Object.defineProperty(de,"__esModule",{value:!0}),de.DEFAULT_LAYOUT_KEY=de.LAYOUT_CONTROLLER_ID=void 0,de.LAYOUT_CONTROLLER_ID="layout-entities",de.DEFAULT_LAYOUT_KEY="__default__";var he={};Object.defineProperty(he,"__esModule",{value:!0}),he.WebContents=void 0;const le=c;class ue extends le.EmitterBase{constructor(e,t,n){super(e,n,t.uuid,t.name),this.identity=t,this.entityType=n}capturePage(e){return this.wire.sendAction("capture-page",{options:e,...this.identity}).then((({payload:e})=>e.data))}executeJavaScript(e){return this.wire.sendAction("execute-javascript-in-window",{...this.identity,code:e}).then((({payload:e})=>e.data))}getZoomLevel(){return this.wire.sendAction("get-zoom-level",this.identity).then((({payload:e})=>e.data))}setZoomLevel(e){return this.wire.sendAction("set-zoom-level",{...this.identity,level:e}).then((()=>{}))}navigate(e){return this.wire.sendAction("navigate-window",{...this.identity,url:e}).then((()=>{}))}navigateBack(){return this.wire.sendAction("navigate-window-back",{...this.identity}).then((()=>{}))}async navigateForward(){await this.wire.sendAction("navigate-window-forward",{...this.identity})}stopNavigation(){return this.wire.sendAction("stop-window-navigation",{...this.identity}).then((()=>{}))}reload(e=!1){return this.wire.sendAction("reload-window",{ignoreCache:e,...this.identity}).then((()=>{}))}print(e={}){return this.wire.sendAction("print",{...this.identity,options:e}).then((()=>{}))}findInPage(e,t){return this.wire.sendAction("find-in-page",{...this.identity,searchTerm:e,options:t}).then((({payload:e})=>e.data))}stopFindInPage(e){return this.wire.sendAction("stop-find-in-page",{...this.identity,action:e}).then((()=>{}))}getPrinters(){return this.wire.sendAction("get-printers",{...this.identity}).then((({payload:e})=>e.data))}async focus({emitSynthFocused:e}={emitSynthFocused:!0}){await this.wire.sendAction("focus-window",{emitSynthFocused:e,...this.identity})}async showDeveloperTools(){await this.wire.sendAction("show-developer-tools",this.identity)}async getProcessInfo(){const{payload:{data:e}}=await this.wire.sendAction("get-process-info",this.identity);return e}async getSharedWorkers(){return this.wire.sendAction("get-shared-workers",this.identity).then((({payload:e})=>e.data))}async inspectSharedWorker(){await this.wire.sendAction("inspect-shared-worker",{...this.identity})}async inspectSharedWorkerById(e){await this.wire.sendAction("inspect-shared-worker-by-id",{...this.identity,workerId:e})}async inspectServiceWorker(){await this.wire.sendAction("inspect-service-worker",{...this.identity})}async showPopupWindow(e){if(this.wire.sendAction(`${this.entityType}-show-popup-window`,this.identity).catch((()=>{})),e?.onPopupReady){const t=async({popupName:t})=>{try{const n=this.fin.Window.wrapSync({uuid:this.fin.me.uuid,name:t});await e.onPopupReady(n)}catch(e){throw new Error(`Something went wrong during onPopupReady execution: ${e}`)}};await this.once("popup-ready",t)}const{payload:t}=await this.wire.sendAction("try-create-popup-window",{options:{...e,hasResultCallback:!!e?.onPopupResult,hasReadyCallback:!!e?.onPopupReady},...this.identity}),{data:{willOpen:n,options:i}}=t;n&&await this.fin.Window.create(i.initialOptions);if(e?.onPopupResult){const t=async t=>{await e.onPopupResult((e=>{const{name:t,uuid:n,result:i,data:r}=e,o={identity:{name:t,uuid:n},result:i};return r&&(o.data=r),o})(t))},n=async()=>{await this.removeListener("popup-result",t)};await this.on("popup-result",t),await this.once("popup-teardown",n)}const{payload:r}=await this.wire.sendAction("show-popup-window",{options:i,...this.identity});return r.data}}var pe,we,ye,fe,ge;function me(){return we||(we=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(function(){if(T)return L;T=1,Object.defineProperty(L,"__esModule",{value:!0}),L.ViewModule=void 0;const e=c,t=O,n=me(),i=k;class r extends e.Base{async create(e){const{uuid:t}=this.wire.me;if(!e.name||"string"!=typeof e.name)throw new Error("Please provide a name property as a string in order to create a View.");return(0,i.handleDeprecatedWarnings)(e),this.wire.environment.childViews?await this.wire.environment.createChildContent({entityType:"view",options:{...e,uuid:t}}):await this.wire.sendAction("create-view",{...e,uuid:t}),this.wrapSync({uuid:t,name:e.name})}async wrap(e){this.wire.sendAction("view-wrap");const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.View(this.wire,e)}wrapSync(e){this.wire.sendAction("view-wrap-sync").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.View(this.wire,e)}getCurrent(){if(this.wire.sendAction("view-get-current").catch((e=>{})),!this.wire.me.isView)throw new Error("You are not in a View context");const{uuid:e,name:t}=this.wire.me;return this.wrap({uuid:e,name:t})}getCurrentSync(){if(this.wire.sendAction("view-get-current-sync").catch((e=>{})),!this.wire.me.isView)throw new Error("You are not in a View context");const{uuid:e,name:t}=this.wire.me;return this.wrapSync({uuid:e,name:t})}}return L.ViewModule=r,L}(),e),n(function(){if(pe)return $;pe=1;var e,t=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty($,"__esModule",{value:!0}),$.View=void 0;const n=f,i=B,r=W,s=de,a=he,c=Pe();class d extends a.WebContents{constructor(o,a){super(o,a,"view"),this.identity=a,e.set(this,new i.Lazy((()=>this.fin.Platform.wrapSync(this.identity).getClient()))),this.attach=async e=>{await this.wire.sendAction("attach-view",{target:e,...this.identity})},this.destroy=async()=>{await this.wire.sendAction("destroy-view",{...this.identity})},this.show=async()=>{await this.wire.sendAction("show-view",{...this.identity})},this.showAt=async(e,t={})=>{await this.wire.sendAction("show-view-at",{bounds:e,...this.identity,options:t})},this.bringToFront=async()=>{await this.wire.sendAction("bring-view-to-front",{...this.identity})},this.hide=async()=>{await this.wire.sendAction("hide-view",{...this.identity})},this.setBounds=async e=>{await this.wire.sendAction("set-view-bounds",{bounds:e,...this.identity})},this.getBounds=async()=>(await this.wire.sendAction("get-view-bounds",{...this.identity})).payload.data,this.getInfo=async()=>(await this.wire.sendAction("get-view-info",{...this.identity})).payload.data,this.getParentLayout=async()=>{this.wire.sendAction("view-get-parent-layout",{...this.identity}).catch((()=>{}));const n=await this.getCurrentWindow();try{const i=await t(this,e,"f").getValue(),o=await r.LayoutNode.newLayoutEntitiesClient(i,s.LAYOUT_CONTROLLER_ID,n.identity),a=await o.getLayoutIdentityForViewOrThrow(this.identity);return this.fin.Platform.Layout.wrap(a)}catch(e){if(!["No action registered at target for","getLayoutIdentityForViewOrThrow is not a function"].some((t=>e.message.includes(t))))throw e;return this.fin.Platform.Layout.wrap(n.identity)}},this.getOptions=async()=>this.wire.sendAction("get-view-options",{...this.identity}).then((({payload:e})=>e.data)),this.updateOptions=async e=>this.wire.sendAction("update-view-options",{options:e,...this.identity}).then((()=>{})),this.getCurrentWindow=async()=>{const{payload:{data:e}}=await this.wire.sendAction("get-view-window",{...this.identity});return new c._Window(this.wire,e)},this.getCurrentStack=async()=>{this.wire.sendAction("view-get-current-stack").catch((()=>{}));try{const n=await this.getCurrentWindow(),i=await t(this,e,"f").getValue(),o=await r.LayoutNode.newLayoutEntitiesClient(i,s.LAYOUT_CONTROLLER_ID,n.identity),a=await o.getStackByView(this.identity);return r.LayoutNode.getEntity(a,o)}catch(e){throw new n.RuntimeError({reason:"This view does not belong to a stack.",error:e})}},this.triggerBeforeUnload=async()=>(await this.wire.sendAction("trigger-before-unload",{...this.identity})).payload.data,this.bindToElement=async e=>{if(!e)throw new Error("Element not found.");return this.wire.environment.observeBounds(e,(async e=>this.setBounds(e)))}}async focus({emitSynthFocused:e}={emitSynthFocused:!0}){const t=await this.getCurrentWindow();await t.focusedWebViewWasChanged(),await super.focus({emitSynthFocused:e})}}return $.View=d,e=new WeakMap,$}(),e)}(j)),j}function ve(){if(ye)return F;ye=1,Object.defineProperty(F,"__esModule",{value:!0}),F.Application=void 0;const e=c,t=Pe(),n=me();class i extends e.EmitterBase{constructor(e,n){super(e,"application",n.uuid),this.identity=n,this.window=new t._Window(this.wire,{uuid:this.identity.uuid,name:this.identity.uuid})}windowListFromIdentityList(e){const n=[];return e.forEach((e=>{n.push(new t._Window(this.wire,{uuid:e.uuid,name:e.name}))})),n}isRunning(){return this.wire.sendAction("is-application-running",this.identity).then((({payload:e})=>e.data))}async quit(e=!1){try{await this._close(e),await this.wire.sendAction("destroy-application",{force:e,...this.identity})}catch(e){if(!["Remote connection has closed","Could not locate the requested application"].some((t=>e.message.includes(t))))throw e}}async _close(e=!1){try{await this.wire.sendAction("close-application",{force:e,...this.identity})}catch(e){if(!e.message.includes("Remote connection has closed"))throw e}}close(e=!1){return console.warn("Deprecation Warning: Application.close is deprecated Please use Application.quit"),this.wire.sendAction("application-close",this.identity).catch((e=>{})),this._close(e)}getChildWindows(){return this.wire.sendAction("get-child-windows",this.identity).then((({payload:e})=>{const t=[];return e.data.forEach((e=>{t.push({uuid:this.identity.uuid,name:e})})),this.windowListFromIdentityList(t)}))}getManifest(){return this.wire.sendAction("get-application-manifest",this.identity).then((({payload:e})=>e.data))}getParentUuid(){return this.wire.sendAction("get-parent-application",this.identity).then((({payload:e})=>e.data))}getShortcuts(){return this.wire.sendAction("get-shortcuts",this.identity).then((({payload:e})=>e.data))}async getViews(){const{payload:e}=await this.wire.sendAction("application-get-views",this.identity);return e.data.map((e=>new n.View(this.wire,e)))}getZoomLevel(){return this.wire.sendAction("get-application-zoom-level",this.identity).then((({payload:e})=>e.data))}getWindow(){return this.wire.sendAction("application-get-window",this.identity).catch((e=>{})),Promise.resolve(this.window)}registerUser(e,t){return this.wire.sendAction("register-user",{userName:e,appName:t,...this.identity}).then((()=>{}))}removeTrayIcon(){return this.wire.sendAction("remove-tray-icon",this.identity).then((()=>{}))}restart(){return this.wire.sendAction("restart-application",this.identity).then((()=>{}))}run(){return console.warn("Deprecation Warning: Application.run is deprecated Please use fin.Application.start"),this.wire.sendAction("application-run",this.identity).catch((e=>{})),this._run()}_run(e={}){return this.wire.sendAction("run-application",{manifestUrl:this._manifestUrl,opts:e,...this.identity}).then((()=>{}))}scheduleRestart(){return this.wire.sendAction("relaunch-on-close",this.identity).then((()=>{}))}async sendApplicationLog(){const{payload:e}=await this.wire.sendAction("send-application-log",this.identity);return e.data}async setJumpList(e){await this.wire.sendAction("set-jump-list",{config:e,...this.identity})}setTrayIcon(e){return this.wire.sendAction("set-tray-icon",{enabledIcon:e,...this.identity}).then((()=>{}))}setShortcuts(e){return this.wire.sendAction("set-shortcuts",{data:e,...this.identity}).then((()=>{}))}async setShortcutQueryParams(e){await this.wire.sendAction("set-shortcut-query-args",{data:e,...this.identity})}setZoomLevel(e){return this.wire.sendAction("set-application-zoom-level",{level:e,...this.identity}).then((()=>{}))}async setAppLogUsername(e){await this.wire.sendAction("set-app-log-username",{data:e,...this.identity})}getTrayIconInfo(){return this.wire.sendAction("get-tray-icon-info",this.identity).then((({payload:e})=>e.data))}hasTrayIcon(){return this.wire.sendAction("has-tray-icon",this.identity).then((({payload:e})=>e.data))}terminate(){return this.wire.sendAction("terminate-application",this.identity).then((()=>{}))}wait(){return this.wire.sendAction("wait-for-hung-application",this.identity).then((()=>{}))}getInfo(){return this.wire.sendAction("get-info",this.identity).then((({payload:e})=>e.data))}async getProcessInfo(){const{payload:{data:e}}=await this.wire.sendAction("application-get-process-info",this.identity);return e}async setFileDownloadLocation(e){const{name:t}=this.wire.me,n={uuid:this.identity.uuid,name:t};await this.wire.sendAction("set-file-download-location",{...n,downloadLocation:e})}async getFileDownloadLocation(){const{payload:{data:e}}=await this.wire.sendAction("get-file-download-location",this.identity);return e}async showTrayIconPopupMenu(e){const{name:t}=this.wire.me,n={uuid:this.identity.uuid,name:t},{payload:i}=await this.wire.sendAction("show-tray-icon-popup-menu",{...n,options:e});return i.data}async closeTrayIconPopupMenu(){const{name:e}=this.wire.me,t={uuid:this.identity.uuid,name:e};await this.wire.sendAction("close-tray-icon-popup-menu",{...t})}}return F.Application=i,F}function Ce(){return ge||(ge=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(function(){if(fe)return R;fe=1,Object.defineProperty(R,"__esModule",{value:!0}),R.ApplicationModule=void 0;const e=c,t=O,n=ve();class i extends e.Base{async wrap(e){this.wire.sendAction("wrap-application").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.Application(this.wire,e)}wrapSync(e){this.wire.sendAction("wrap-application-sync").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.Application(this.wire,e)}async _create(e){return void 0===e.waitForPageLoad&&(e.waitForPageLoad=!1),void 0===e.autoShow&&void 0===e.isPlatformController&&(e.autoShow=!0),await this.wire.sendAction("create-application",e),this.wrap({uuid:e.uuid})}create(e){return console.warn("Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start"),this.wire.sendAction("application-create").catch((e=>{})),this._create(e)}async start(e){this.wire.sendAction("start-application").catch((e=>{}));const t=await this._create(e);return await this.wire.sendAction("run-application",{uuid:e.uuid}),t}async startManyManifests(e,t){return this.wire.sendAction("run-applications",{applications:e,opts:t}).then((()=>{}))}getCurrent(){return this.wire.sendAction("get-current-application").catch((e=>{})),this.wrap({uuid:this.wire.me.uuid})}getCurrentSync(){return this.wire.sendAction("get-current-application-sync").catch((e=>{})),this.wrapSync({uuid:this.wire.me.uuid})}async startFromManifest(e,t){this.wire.sendAction("application-start-from-manifest").catch((e=>{}));const n=await this._createFromManifest(e);return await n._run(t),n}createFromManifest(e){return console.warn("Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest"),this.wire.sendAction("application-create-from-manifest").catch((e=>{})),this._createFromManifest(e)}_createFromManifest(e){return this.wire.sendAction("get-application-manifest",{manifestUrl:e}).then((({payload:e})=>{const t=e.data.platform?e.data.platform.uuid:e.data.startup_app.uuid;return this.wrap({uuid:t})})).then((t=>(t._manifestUrl=e,t)))}}return R.ApplicationModule=i,R}(),e),n(ve(),e)}(S)),S}he.WebContents=ue;var be={};Object.defineProperty(be,"__esModule",{value:!0}),be.promisifySubscription=void 0;var Ie,Ee,xe;function Ae(){if(Ie)return _;Ie=1,Object.defineProperty(_,"__esModule",{value:!0}),_._Window=void 0;const e=Ce(),t=he,n=me(),i=k,r=be;class o extends t.WebContents{constructor(e,t){super(e,t,"window")}async createWindow(e){this.wire.sendAction("window-create-window",this.identity).catch((e=>{}));const t=await(0,r.promisifySubscription)(this,"fire-constructor-callback");void 0===e.waitForPageLoad&&(e.waitForPageLoad=!1),void 0===e.autoShow&&(e.autoShow=!0),(0,i.handleDeprecatedWarnings)(e);const n=this.wire.environment.createChildContent({entityType:"window",options:e}),[o]=await Promise.all([t.getValue(),n]);let s;const{success:a}=o,c=o.data,{message:d}=c;s=a?{httpResponseCode:c.httpResponseCode,apiInjected:c.apiInjected}:{message:c.message,networkErrorCode:c.networkErrorCode,stack:c.stack};const h={message:d,cbPayload:s,success:a};try{this.getWebWindow().fin.__internal_.openerSuccessCBCalled()}catch(e){}return h.success?this:Promise.reject(h)}getAllFrames(){return this.wire.sendAction("get-all-frames",this.identity).then((({payload:e})=>e.data))}getBounds(){return this.wire.sendAction("get-window-bounds",this.identity).then((({payload:e})=>e.data))}center(){return this.wire.sendAction("center-window",this.identity).then((()=>{}))}blur(){return this.wire.sendAction("blur-window",this.identity).then((()=>{}))}bringToFront(){return this.wire.sendAction("bring-window-to-front",this.identity).then((()=>{}))}animate(e,t){return this.wire.sendAction("animate-window",{transitions:e,options:t,...this.identity}).then((()=>{}))}hide(){return this.wire.sendAction("hide-window",this.identity).then((()=>{}))}close(e=!1){return this.wire.sendAction("close-window",{force:e,...this.identity}).then((()=>{Object.setPrototypeOf(this,null)}))}focusedWebViewWasChanged(){return this.wire.sendAction("focused-webview-changed",this.identity).then((()=>{}))}getNativeId(){return this.wire.sendAction("get-window-native-id",this.identity).then((({payload:e})=>e.data))}async getCurrentViews(){const{payload:e}=await this.wire.sendAction("window-get-views",this.identity);return e.data.map((e=>new n.View(this.wire,e)))}disableFrame(){return console.warn("Function is deprecated; use disableUserMovement instead."),this.wire.sendAction("disable-window-frame",this.identity).then((()=>{}))}disableUserMovement(){return this.wire.sendAction("disable-window-frame",this.identity).then((()=>{}))}enableFrame(){return console.warn("Function is deprecated; use enableUserMovement instead."),this.wire.sendAction("enable-window-frame",this.identity).then((()=>{}))}enableUserMovement(){return this.wire.sendAction("enable-window-frame",this.identity).then((()=>{}))}flash(){return this.wire.sendAction("flash-window",this.identity).then((()=>{}))}stopFlashing(){return this.wire.sendAction("stop-flash-window",this.identity).then((()=>{}))}getInfo(){return this.wire.sendAction("get-window-info",this.identity).then((({payload:e})=>e.data))}async getLayout(e){this.wire.sendAction("window-get-layout",this.identity).catch((e=>{}));const t=await this.getOptions();if(!t.layout&&!t.layoutSnapshot)throw new Error("Window does not have a Layout");return this.fin.Platform.Layout.wrap(e??this.identity)}getOptions(){return this.wire.sendAction("get-window-options",this.identity).then((({payload:e})=>e.data))}getParentApplication(){return this.wire.sendAction("window-get-parent-application",this.identity).catch((e=>{})),Promise.resolve(new e.Application(this.wire,this.identity))}getParentWindow(){return this.wire.sendAction("window-get-parent-window",this.identity).catch((e=>{})),Promise.resolve(new e.Application(this.wire,this.identity)).then((e=>e.getWindow()))}async getSnapshot(e){const t={area:e,...this.identity};console.warn("Window.getSnapshot has been deprecated, please use Window.capturePage");return(await this.wire.sendAction("get-window-snapshot",t)).payload.data}getState(){return this.wire.sendAction("get-window-state",this.identity).then((({payload:e})=>e.data))}getWebWindow(){return this.wire.sendAction("window-get-web-window",this.identity).catch((e=>{})),this.wire.environment.getWebWindow(this.identity)}isMainWindow(){return this.wire.sendAction("window-is-main-window",this.identity).catch((e=>{})),this.me.uuid===this.me.name}isShowing(){return this.wire.sendAction("is-window-showing",this.identity).then((({payload:e})=>e.data))}maximize(){return this.wire.sendAction("maximize-window",this.identity).then((()=>{}))}minimize(){return this.wire.sendAction("minimize-window",this.identity).then((()=>{}))}moveBy(e,t,n){return this.wire.sendAction("move-window-by",{deltaLeft:e,deltaTop:t,positioningOptions:n,...this.identity}).then((()=>{}))}moveTo(e,t,n){return this.wire.sendAction("move-window",{left:e,top:t,positioningOptions:n,...this.identity}).then((()=>{}))}resizeBy(e,t,n,i){return this.wire.sendAction("resize-window-by",{deltaWidth:Math.floor(e),deltaHeight:Math.floor(t),anchor:n,positioningOptions:i,...this.identity}).then((()=>{}))}resizeTo(e,t,n,i){return this.wire.sendAction("resize-window",{width:Math.floor(e),height:Math.floor(t),anchor:n,positioningOptions:i,...this.identity}).then((()=>{}))}restore(){return this.wire.sendAction("restore-window",this.identity).then((()=>{}))}setAsForeground(){return this.wire.sendAction("set-foreground-window",this.identity).then((()=>{}))}setBounds(e,t){return this.wire.sendAction("set-window-bounds",{...e,...this.identity,positioningOptions:t}).then((()=>{}))}show(e=!1){return this.wire.sendAction("show-window",{force:e,...this.identity}).then((()=>{}))}showAt(e,t,n=!1){return this.wire.sendAction("show-at-window",{force:n,left:Math.floor(e),top:Math.floor(t),...this.identity}).then((()=>{}))}updateOptions(e){return this.wire.sendAction("update-window-options",{options:e,...this.identity}).then((()=>{}))}authenticate(e,t){return this.wire.sendAction("window-authenticate",{userName:e,password:t,...this.identity}).then((()=>{}))}async showPopupMenu(e){const{payload:t}=await this.wire.sendAction("show-popup-menu",{options:e,...this.identity});return t.data}async closePopupMenu(){return this.wire.sendAction("close-popup-menu",{...this.identity}).then((()=>{}))}async dispatchPopupResult(e){this.wire.sendAction("window-dispatch-popup-result",this.identity).catch((e=>{})),await this.wire.sendAction("dispatch-popup-result",{data:e,...this.identity})}async print(e={content:"self"}){switch(e.content){case void 0:case"self":return super.print(e);case"screenshot":return this.wire.sendAction("print-screenshot",this.identity).then((()=>{}));case"views":return this.wire.sendAction("print-views",{...this.identity,options:e}).then((()=>{}));default:return}}}return _._Window=o,_}function Pe(){return xe||(xe=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(function(){if(Ee)return M;Ee=1,Object.defineProperty(M,"__esModule",{value:!0}),M._WindowModule=void 0;const e=c,t=O,n=Ae();class i extends e.Base{async wrap(e){this.wire.sendAction("window-wrap").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n._Window(this.wire,e)}wrapSync(e){this.wire.sendAction("window-wrap-sync").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n._Window(this.wire,e)}create(e){return this.wire.sendAction("create-window").catch((e=>{})),new n._Window(this.wire,{uuid:this.me.uuid,name:e.name}).createWindow(e)}getCurrent(){if(this.wire.sendAction("get-current-window").catch((e=>{})),!this.wire.me.isWindow)throw new Error("You are not in a Window context");const{uuid:e,name:t}=this.wire.me;return this.wrap({uuid:e,name:t})}getCurrentSync(){if(this.wire.sendAction("get-current-window-sync").catch((e=>{})),!this.wire.me.isWindow)throw new Error("You are not in a Window context");const{uuid:e,name:t}=this.wire.me;return this.wrapSync({uuid:e,name:t})}}return M._WindowModule=i,M}(),e),n(Ae(),e)}(P)),P}be.promisifySubscription=async(e,t,n=(()=>!0),i)=>{let r,o,s;const a=new Promise(((e,t)=>{r=e,o=t})),c=e=>{n(e)&&(clearTimeout(s),r(e))};return await e.on(t,c),i&&(s=setTimeout((()=>o(new Error("event timed out"))),i)),a.finally((()=>{e.removeListener(t,c).catch((()=>null))})),{getValue:()=>a}},Object.defineProperty(a,"__esModule",{value:!0}),a.System=void 0;const Me=c,Oe=f,_e=Pe(),Se=t;class Re extends Me.EmitterBase{constructor(e){super(e,"system")}sendExternalProcessRequest(e,t){return new Promise(((n,i)=>{const r="external-process-exited";let o,s,a,c;"function"==typeof t.listener&&(a=e=>{const n=e||{};s={topic:"exited",uuid:n.processUuid||"",exitCode:n.exitCode||0},o===e.processUuid&&(t.listener(s),c.removeListener(r,a))},this.wire.me.name||(this.wire.me.name=this.wire.me.uuid),c=new _e._Window(this.wire,this.wire.me),c.on(r,a)),this.wire.sendAction(e,t).then((({payload:e})=>{o=e.data.uuid,n(e.data),s&&o===s.uuid&&(t.listener(s),c.removeListener(r,a))})).catch((e=>{c&&c.removeListener(r,a),i(e)}))}))}getVersion(){return this.wire.sendAction("get-version").then((({payload:e})=>e.data))}clearCache(e){return this.wire.sendAction("clear-cache",e).then((()=>{}))}deleteCacheOnExit(){return this.wire.sendAction("delete-cache-request").then((()=>{}))}exit(){return this.wire.sendAction("exit-desktop").then((()=>{}))}async fetchManifest(e){const{payload:{data:t}}=await this.wire.sendAction("fetch-manifest",{manifestUrl:e});return t}flushCookieStore(){return this.wire.sendAction("flush-cookie-store").then((()=>{}))}getAllWindows(){return this.wire.sendAction("get-all-windows").then((({payload:e})=>e.data))}getAllApplications(){return this.wire.sendAction("get-all-applications").then((({payload:e})=>e.data))}getCommandLineArguments(){return this.wire.sendAction("get-command-line-arguments").then((({payload:e})=>e.data))}async getCrashReporterState(){const{payload:{data:{diagnosticMode:e,isRunning:t}}}=await this.wire.sendAction("get-crash-reporter-state");return console.warn("diagnosticMode property is deprecated. It will be removed in a future version"),{diagnosticMode:e,diagnosticsMode:e,isRunning:t}}async startCrashReporter(e){const t=e,n={...t,diagnosticMode:t.diagnosticsMode||t.diagnosticMode},{payload:{data:{diagnosticMode:i,isRunning:r}}}=await this.wire.sendAction("start-crash-reporter",n);return{diagnosticMode:i,diagnosticsMode:i,isRunning:r}}getUniqueUserId(){return this.wire.sendAction("get-unique-user-id").then((({payload:e})=>e.data))}getEntityInfo(e,t){return this.wire.sendAction("get-entity-info",{uuid:e,name:t}).then((({payload:e})=>e.data))}getEnvironmentVariable(e){return this.wire.sendAction("get-environment-variable",{environmentVariables:e}).then((({payload:e})=>e.data))}getFocusedWindow(){return this.wire.sendAction("get-focused-window").then((({payload:e})=>e.data))}async isAppCertified(e){const{payload:{data:{certifiedInfo:t}}}=await this.wire.sendAction("is-app-certified",{manifestUrl:e});return t}getInstalledRuntimes(){return this.wire.sendAction("get-installed-runtimes").then((({payload:e})=>e.data.runtimes))}async getInstalledApps(){const{payload:{data:{installedApps:e}}}=await this.wire.sendAction("get-installed-apps");return e}getLog(e){return this.wire.sendAction("view-log",e).then((({payload:e})=>e.data))}getMachineId(){return this.wire.sendAction("get-machine-id").then((({payload:e})=>e.data))}getMinLogLevel(){return this.wire.sendAction("get-min-log-level").then((({payload:e})=>e.data))}getLogList(){return this.wire.sendAction("list-logs").then((({payload:e})=>e.data))}getMonitorInfo(){return this.wire.sendAction("get-monitor-info").then((({payload:e})=>e.data))}getMousePosition(){return this.wire.sendAction("get-mouse-position").then((({payload:e})=>e.data))}getProcessList(){return console.warn("System.getProcessList has been deprecated. Please consider using our new process APIs: Window.getProcessInfo, View.getProcessInfo, Application.getProcessInfo, System.getAllProcessInfo"),this.wire.sendAction("process-snapshot").then((({payload:e})=>e.data))}async getAllProcessInfo(){const{payload:{data:e}}=await this.wire.sendAction("get-all-process-info",this.identity);return e}getProxySettings(){return this.wire.sendAction("get-proxy-settings").then((({payload:e})=>e.data))}getRuntimeInfo(){return this.wire.sendAction("get-runtime-info").then((({payload:e})=>e.data))}getRvmInfo(){return this.wire.sendAction("get-rvm-info").then((({payload:e})=>e.data))}getHostSpecs(){return this.wire.sendAction("get-host-specs").then((({payload:e})=>e.data))}getOSInfo(){return this.wire.sendAction("get-os-info").then((({payload:e})=>e.data))}launchExternalProcess(e){return this.sendExternalProcessRequest("launch-external-process",e)}monitorExternalProcess(e){return this.sendExternalProcessRequest("monitor-external-process",e)}log(e,t){return this.wire.sendAction("write-to-log",{level:e,message:t}).then((()=>{}))}openUrlWithBrowser(e){return this.wire.sendAction("open-url-with-browser",{url:e}).then((()=>{}))}async registerCustomProtocol(e){if("object"!=typeof e)throw new Error("Must provide an object with a `protocolName` property having a string value.");await this.wire.sendAction("register-custom-protocol",e)}async unregisterCustomProtocol(e){await this.wire.sendAction("unregister-custom-protocol",{protocolName:e})}async getCustomProtocolState(e){return this.wire.sendAction("get-custom-protocol-state",{protocolName:e}).then((({payload:e})=>e.data))}releaseExternalProcess(e){return this.wire.sendAction("release-external-process",{uuid:e}).then((()=>{}))}showDeveloperTools(e){return this.wire.sendAction("show-developer-tools",e).then((()=>{}))}terminateExternalProcess(e){return this.wire.sendAction("terminate-external-process",e).then((()=>{}))}updateProxySettings(e){return this.wire.sendAction("update-proxy",e).then((()=>{}))}async downloadAsset(e,t){const n=()=>{};let i=n,r=n;const o=new Promise(((e,t)=>{i=e,r=t}));if("openfin"!==this.wire.environment.type)throw new Oe.NotSupportedError("downloadAsset only supported in an OpenFin Render process");const s=Oe.RuntimeError.getCallSite(),a=this.wire.environment.getNextMessageId().toString(),c=`asset-download-progress-${a}`,d=`asset-download-error-${a}`,h=`asset-download-complete-${a}`,l=e=>{const n={downloadedBytes:e.downloadedBytes,totalBytes:e.totalBytes};t(n)},u=()=>{this.removeListener(c,l)};await Promise.all([this.on(c,l),this.once(d,(e=>{u();const{reason:t,err:n}=e;r(new Oe.RuntimeError({reason:t,error:n},s))})),this.once(h,(()=>{u(),i()}))]);const p=Object.assign(e,{downloadId:a});return await this.wire.sendAction("download-asset",p).catch((e=>{throw u(),e})),o}downloadRuntime(e,t){const n=Oe.RuntimeError.getCallSite();return new Promise(((i,r)=>{if("openfin"!==this.wire.environment.type)return void r(new Oe.NotSupportedError("downloadRuntime only supported in an OpenFin Render process"));const o=this.wire.environment.getNextMessageId().toString(),s=`runtime-download-progress-${o}`,a=`runtime-download-error-${o}`,c=`runtime-download-complete-${o}`,d=e=>{const n={downloadedBytes:e.downloadedBytes,totalBytes:e.totalBytes};t(n)},h=()=>{this.removeListener(s,d)};this.on(s,d),this.once(a,(e=>{h();const{reason:t,err:i}=e;r(new Oe.RuntimeError({reason:t,error:i},n))})),this.once(c,(()=>{h(),i()}));const l=Object.assign(e,{downloadId:o});this.wire.sendAction("download-runtime",l).catch((e=>{h(),r(e)}))}))}downloadPreloadScripts(e){return this.wire.sendAction("download-preload-scripts",{scripts:e}).then((({payload:e})=>e.data))}getAllExternalApplications(){return this.wire.sendAction("get-all-external-applications").then((({payload:e})=>e.data))}getAppAssetInfo(e){return this.wire.sendAction("get-app-asset-info",e).then((({payload:e})=>e.data))}getCookies(e){const t=this.wire.environment.getUrl(),n=Object.assign(e,{url:t});return this.wire.sendAction("get-cookies",n).then((({payload:e})=>e.data))}setMinLogLevel(e){return this.wire.sendAction("set-min-log-level",{level:e}).then((()=>{}))}resolveUuid(e){return this.wire.sendAction("resolve-uuid",{entityKey:e}).then((({payload:e})=>e.data))}executeOnRemote(e,t){return t.requestingIdentity=e,this.wire.ferryAction(t)}readRegistryValue(e,t,n){return this.wire.sendAction("read-registry-value",{rootKey:e,subkey:t,value:n}).then((({payload:e})=>e.data))}registerExternalConnection(e){return this.wire.sendAction("register-external-connection",{uuid:e}).then((({payload:e})=>e.data))}async getServiceConfiguration(e){if("string"!=typeof e.name)throw new Error("Must provide an object with a `name` property having a string value");const{name:t}=e;return this.wire.sendAction("get-service-configuration",{name:t}).then((({payload:e})=>e.data))}async getSystemAppConfig(e){if("string"!=typeof e)throw new Error("Must provide a string value for name of system app");return this.wire.sendAction("get-system-app-configuration",{name:e}).then((({payload:e})=>e.data))}async registerShutdownHandler(e){this.wire.sendAction("system-register-shutdown-handler").catch((e=>{}));const{uuid:t,name:n}=this.wire.me;this.on("system-shutdown",(i=>{e({proceed:()=>{this.wire.environment.raiseEvent("application/system-shutdown-handled",{uuid:t,name:n,topic:"application"})}})}))}runRvmHealthCheck(){return this.wire.sendAction("run-rvm-health-check").then((({payload:e})=>e.data))}async launchManifest(e,t={}){const{subscribe:n,...i}=t,r=i;if(n){const e=new Se.EventEmitter;n(e);const t="app-version-progress",i="runtime-status",o="app-version-complete",s="app-version-error",a=this.wire.environment.getNextMessageId().toString();r.appVersionId=a;const c=[o,t,i,s],d=e=>{const{appVersionId:t,topic:n,type:i,...r}=e;return{...r,type:c.find((e=>i.includes(e)))}},h=t=>{const n=d(t);e.emit(n.type,n)},l=()=>{this.removeListener(`${t}.${a}`,h),this.removeListener(`${i}.${a}`,h),this.removeListener(`${o}.${a}`,h),this.removeListener(`${s}.${a}`,h),this.removeListener(`${o}.${a}`,l),this.removeListener(`${s}.${a}`,l)};await Promise.all([this.on(`${t}.${a}`,h),this.on(`${i}.${a}`,h),this.once(`${o}.${a}`,h),this.once(`${s}.${a}`,h),this.once(`${o}.${a}`,l),this.once(`${s}.${a}`,l)])}return(await this.wire.sendAction("launch-manifest",{manifestUrl:e,opts:r})).payload.data.manifest}async queryPermissionForCurrentContext(e){const t={uuid:this.wire.me.uuid,name:this.wire.me.name};return(await this.wire.sendAction("query-permission-for-current-context",{apiName:e,identity:t})).payload.data}async enableNativeWindowIntegrationProvider(e){const{payload:t}=await this.wire.sendAction("enable-native-window-integration-provider",{permissions:e});return t.data}async registerUsage({data:e,type:t}){await this.wire.sendAction("register-usage",{data:e,type:t})}async getPrinters(){const{payload:e}=await this.wire.sendAction("system-get-printers");return e.data}async updateProcessLoggingOptions(e){await this.wire.sendAction("system-update-process-logging-options",{options:e})}async getDomainSettings(){const{payload:{data:e}}=await this.wire.sendAction("get-domain-settings",this.identity);return e}async setDomainSettings(e){await this.wire.sendAction("set-domain-settings",{domainSettings:e,...this.identity})}}a.System=Re;var Fe={},je={};Object.defineProperty(je,"__esModule",{value:!0}),je.RefCounter=void 0;je.RefCounter=class{constructor(){this.topicRefMap=new Map}incRefCount(e){const t=this.topicRefMap.get(e);let n;if(t){const i=t+1;n=i,this.topicRefMap.set(e,i)}else this.topicRefMap.set(e,1),n=1;return n}decRefCount(e){const t=this.topicRefMap.get(e);let n;if(t){const i=t-1;this.topicRefMap.set(e,i),n=i}else n=-1;return n}actOnFirst(e,t,n){return 1===this.incRefCount(e)?t():n()}actOnLast(e,t,n){return 0===this.decRefCount(e)?t():n()}};var Le={},ke={},Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.ChannelBase=Te.ProtectedItems=void 0;const $e=e=>async(t,n,i)=>{const r=await e(t,n,i);return void 0===r?n:r};Te.ProtectedItems=class{constructor(e,t){this.providerIdentity=e,this.close=t}};class Be{static defaultAction(e){throw new Error(`No action registered at target for ${e}`)}constructor(){this.subscriptions=new Map}async processAction(e,t,n){try{const i=this.subscriptions.has(e)?this.subscriptions.get(e):(t,n)=>(this.defaultAction??Be.defaultAction)(e,t,n),r=this.preAction?await this.preAction(e,t,n):t,o=await i(r,n);return this.postAction?await this.postAction(e,o,n):o}catch(t){if(this.errorMiddleware)return this.errorMiddleware(e,t,n);throw t}}beforeAction(e){if(this.preAction)throw new Error("Already registered beforeAction middleware");this.preAction=$e(e)}onError(e){if(this.errorMiddleware)throw new Error("Already registered error middleware");this.errorMiddleware=e}afterAction(e){if(this.postAction)throw new Error("Already registered afterAction middleware");this.postAction=$e(e)}remove(e){this.subscriptions.delete(e)}setDefaultAction(e){if(this.defaultAction)throw new Error("default action can only be set once");this.defaultAction=e}register(e,t){if(this.subscriptions.has(e))throw new Error(`Subscription already registered for action: ${e}. Unsubscribe before adding new subscription`);return this.subscriptions.set(e,t),!0}}Te.ChannelBase=Be;var Ge,We,He,Ne=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},De=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(ke,"__esModule",{value:!0}),ke.ChannelClient=void 0;const Ue=Te,Ve=new Map;class ze extends Ue.ChannelBase{static closeChannelByEndpointId(e){const t=Ve.get(e);t&&Ne(t,He,"f").call(t)}static handleProviderDisconnect(e){for(const t of Ve.values())t.providerIdentity.channelId===e.channelId&&(t.disconnectListener(e),Ne(t,He,"f").call(t))}constructor(e,t,n){super(),Ge.set(this,void 0),We.set(this,void 0),this.processAction=(e,t,n)=>super.processAction(e,t,n),He.set(this,(()=>{Ve.delete(this.endpointId),Ne(this,We,"f").close()})),De(this,Ge,new Ue.ProtectedItems(e,t),"f"),this.disconnectListener=()=>{},this.endpointId=e.endpointId,De(this,We,n,"f"),Ve.set(this.endpointId,this),n.receive(this.processAction)}get providerIdentity(){return Ne(this,Ge,"f").providerIdentity}async dispatch(e,t){if(Ne(this,We,"f").isEndpointConnected(this.providerIdentity.channelId))return Ne(this,We,"f").send(this.providerIdentity.channelId,e,t);throw new Error("The client you are trying to dispatch from is disconnected from the target provider.")}onDisconnection(e){this.disconnectListener=t=>{try{e(t)}catch(e){throw new Error(`Error while calling the onDisconnection callback: ${e.message}`)}finally{this.disconnectListener=()=>{}}}}async disconnect(){await this.sendDisconnectAction(),Ne(this,He,"f").call(this)}async sendDisconnectAction(){const e=Ne(this,Ge,"f");await e.close()}static async wireClose(e,t,n){const{channelName:i,uuid:r,name:o}=t;await e.sendAction("disconnect-from-channel",{channelName:i,uuid:r,name:o,endpointId:n})}}ke.ChannelClient=ze,Ge=new WeakMap,We=new WeakMap,He=new WeakMap;var Ke={},qe={};Object.defineProperty(qe,"__esModule",{value:!0}),qe.exhaustiveCheck=void 0,qe.exhaustiveCheck=function(e,t){throw new Error(`Unsupported value: ${e}${t?`\n Supported values are: ${t.join("")}`:""}`)};var Ye,Je,Ze,Qe={},Xe=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},et=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.ClassicInfo=Qe.ClassicStrategy=void 0;Qe.ClassicStrategy=class{constructor(e,t,n,i){this.messageReceiver=t,this.endpointId=n,this.providerIdentity=i,Ye.set(this,void 0),Je.set(this,new Map),Ze.set(this,new Map),this.send=async(e,t,n)=>{const i=et(this,Je,"f").get(e);if(!i)throw new Error(`Could not locate routing info for endpoint ${e}`);const r={...i};r.isLocalEndpointId&&delete r.endpointId,delete r.isLocalEndpointId;const o=et(this,Ye,"f").sendAction("send-channel-message",{...r,providerIdentity:this.providerIdentity,action:t,payload:n});et(this,Ze,"f").get(e)?.add(o);return(await o.catch((e=>{throw new Error(e.message)})).finally((()=>{et(this,Ze,"f").get(e)?.delete(o)}))).payload.data.result},this.close=async()=>{this.messageReceiver.removeEndpoint(this.providerIdentity.channelId,this.endpointId),[...et(this,Je,"f").keys()].forEach((e=>this.closeEndpoint(e))),Xe(this,Je,new Map,"f")},Xe(this,Ye,e,"f")}onEndpointDisconnect(e,t){}receive(e){this.messageReceiver.addEndpoint(e,this.providerIdentity.channelId,this.endpointId)}async closeEndpoint(e){const t=et(this,Je,"f").get(e);et(this,Je,"f").delete(e);const n=et(this,Ze,"f").get(e);n?.forEach((n=>{const i=`Channel connection with identity uuid: ${t?.uuid} / name: ${t?.name} / endpointId: ${e} no longer connected.`;n.cancel(new Error(i))}))}isEndpointConnected(e){return et(this,Je,"f").has(e)}addEndpoint(e,t){et(this,Je,"f").set(e,t.endpointIdentity),et(this,Ze,"f").set(e,new Set)}isValidEndpointPayload(e){return"string"==typeof e?.endpointIdentity?.endpointId||"string"==typeof e?.endpointIdentity?.channelId}},Ye=new WeakMap,Je=new WeakMap,Ze=new WeakMap,Qe.ClassicInfo={version:5,minimumVersion:0,type:"classic"};var tt={},nt={},it={};Object.defineProperty(it,"__esModule",{value:!0}),it.errorToPOJO=void 0,it.errorToPOJO=function(e){return{stack:e.stack,name:e.name,message:e.message,toString:()=>e.stack||e.toString()}};var rt,ot,st=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},at=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(nt,"__esModule",{value:!0}),nt.RTCEndpoint=void 0;const ct=it;nt.RTCEndpoint=class{static isValidEndpointPayload(e){const t=e=>"object"==typeof e&&null!==e;return t(e)&&t(e.endpointIdentity)&&t(e.rtc)&&"string"==typeof e.endpointIdentity.endpointId}constructor({rtc:e,endpointIdentity:t}){this.responseMap=new Map,rt.set(this,null),ot.set(this,void 0),this.connectionStateChangeHandler=e=>{"connected"!==this.rtc.rtcClient.connectionState&&(this.rtc.rtcClient.removeEventListener("connectionstatechange",this.connectionStateChangeHandler),this.close(),st(this,ot,"f")&&st(this,ot,"f").call(this))},this.send=async(e,t)=>{const n=`message-${Math.random()}`,i=new Promise(((e,t)=>{this.responseMap.set(n,{resolve:e,reject:t})}));return this.rtc.channels.request.send(JSON.stringify({action:e,payload:t,messageId:n})),i},this.close=()=>{this.responseMap.forEach((e=>e.reject("Connection has closed."))),this.responseMap=new Map,this.rtc.channels.request.close(),this.rtc.channels.response.close(),this.rtc.rtcClient.close()},this.rtc=e,this.endpointIdentity=t,this.rtc.channels.response.addEventListener("message",(e=>{let{data:t}=e;e.data instanceof ArrayBuffer&&(t=(new TextDecoder).decode(e.data));const{messageId:n,payload:i,success:r,error:o}=JSON.parse(t),{resolve:s,reject:a}=this.responseMap.get(n)??{};s&&a?(this.responseMap.delete(n),r?s(i):a(o)):(console.log("Could not find id in responseMap."),console.log(e))})),this.rtc.channels.request.addEventListener("message",(async e=>{let{data:n}=e;e.data instanceof ArrayBuffer&&(n=(new TextDecoder).decode(e.data));const{messageId:i,action:r,payload:o}=JSON.parse(n);if(st(this,rt,"f"))try{const e=await st(this,rt,"f").call(this,r,o,t);this.rtc.channels.response.send(JSON.stringify({messageId:i,payload:e,success:!0}))}catch(e){"open"===this.rtc.channels.response.readyState&&this.rtc.channels.response.send(JSON.stringify({messageId:i,error:(0,ct.errorToPOJO)(e),success:!1}))}else"open"===this.rtc.channels.response.readyState&&this.rtc.channels.response.send(JSON.stringify({messageId:i,success:!1,error:"Connection not ready."}))})),this.rtc.rtcClient.addEventListener("connectionstatechange",this.connectionStateChangeHandler),Object.values(this.rtc.channels).forEach((e=>{e.onclose=e=>{[...this.responseMap.values()].forEach((e=>e.reject(new Error("RTCDataChannel closed unexpectedly, this is most commonly caused by message size. Note: RTC Channels have a message size limit of ~255kB.")))),this.close(),st(this,ot,"f")&&st(this,ot,"f").call(this)}}))}onDisconnect(e){if(st(this,ot,"f"))throw new Error("RTCEndpoint disconnectListener cannot be set twice.");at(this,ot,e,"f")}receive(e){if(st(this,rt,"f"))throw new Error("You have already set a listener for this RTC Endpoint.");at(this,rt,e,"f")}get connected(){return"connected"===this.rtc.rtcClient.connectionState}},rt=new WeakMap,ot=new WeakMap;var dt,ht,lt,ut={},pt=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},wt=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(ut,"__esModule",{value:!0}),ut.EndpointStrategy=void 0;ut.EndpointStrategy=class{constructor(e,t,n){this.EndpointType=e,this.StrategyName=n,dt.set(this,null),ht.set(this,new Map),lt.set(this,!0),this.send=async(e,t,n)=>this.getEndpointById(e).send(t,n),this.close=async()=>{pt(this,lt,"f")&&(pt(this,ht,"f").forEach((e=>e.close())),wt(this,ht,new Map,"f")),wt(this,lt,!1,"f")},this.isValidEndpointPayload=t}onEndpointDisconnect(e,t){this.getEndpointById(e).onDisconnect(t)}receive(e){if(pt(this,dt,"f"))throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);wt(this,dt,e,"f"),pt(this,ht,"f").forEach((e=>e.receive(pt(this,dt,"f"))))}getEndpointById(e){const t=pt(this,ht,"f").get(e);if(!t)throw new Error(`Client with endpoint id ${e} is not connected`);return t}get connected(){return pt(this,lt,"f")}isEndpointConnected(e){return pt(this,ht,"f").has(e)}addEndpoint(e,t){if(!pt(this,lt,"f"))return void console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);const n=new this.EndpointType(t);pt(this,dt,"f")&&n.receive(pt(this,dt,"f")),pt(this,ht,"f").set(e,n)}async closeEndpoint(e){pt(this,ht,"f").delete(e)}},dt=new WeakMap,ht=new WeakMap,lt=new WeakMap,Object.defineProperty(tt,"__esModule",{value:!0}),tt.RTCInfo=tt.RTCStrategy=void 0;const yt=nt,ft=ut;class gt extends ft.EndpointStrategy{constructor(){super(yt.RTCEndpoint,yt.RTCEndpoint.isValidEndpointPayload,"RTC")}}tt.RTCStrategy=gt,tt.RTCInfo={version:2,minimumVersion:0,type:"rtc"};var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.RTCICEManager=void 0;const vt=c;class Ct extends vt.EmitterBase{constructor(e){super(e,"channel"),this.ensureChannelOpened=e=>new Promise(((t,n)=>{if("open"===e.readyState)t();else if("connecting"===e.readyState){const n=()=>{e.removeEventListener("open",n),t()};e.addEventListener("open",n)}else n(new Error("This Channel has already closed"))}))}static createDataChannelPromise(e,t){let n;const i=new Promise((e=>{n=e})),r=i=>{const o=()=>{i.channel.removeEventListener("open",o),n(i.channel)};i.channel.label===e&&(i.channel.addEventListener("open",o),t.removeEventListener("datachannel",r))};return t.addEventListener("datachannel",r),i}async listenForProviderIce(e,t){await this.on(this.createProviderEventName(e),t,{timestamp:Date.now()})}async raiseProviderIce(e,t){await this.wire.environment.raiseEvent(this.createRouteString(this.createProviderEventName(e)),t)}async listenForClientIce(e,t){await this.on(this.createClientEventName(e),t,{timestamp:Date.now()})}async raiseClientIce(e,t){await this.wire.environment.raiseEvent(this.createRouteString(this.createClientEventName(e)),t)}cleanupIceListeners(e){this.removeAllListeners(this.createClientEventName(e)),this.removeAllListeners(this.createProviderEventName(e))}createClientEventName(e){return`ice-client-${e}`}createProviderEventName(e){return`ice-provider-${e}`}createRouteString(e){return`channel/${e}`}createRtcPeer(){return this.wire.environment.getRtcPeer()}async startClientOffer(){const e=Math.random().toString(),t=this.createRtcPeer();t.addEventListener("icecandidate",(async t=>{t.candidate&&await this.raiseClientIce(e,{candidate:t.candidate?.toJSON()})})),await this.listenForProviderIce(e,(async e=>{await t.addIceCandidate(e.candidate)}));const n={request:t.createDataChannel("request"),response:t.createDataChannel("response")},i=await t.createOffer();await t.setLocalDescription(i);const r=Promise.all([n.request,n.response].map(this.ensureChannelOpened)).then((()=>{}));return{rtcClient:t,channels:n,offer:i,rtcConnectionId:e,channelsOpened:r}}async finishClientOffer(e,t,n){return await e.setRemoteDescription(t),await n,!0}async createProviderAnswer(e,t){const n=this.createRtcPeer(),i=Ct.createDataChannelPromise("request",n),r=Ct.createDataChannelPromise("response",n);n.addEventListener("icecandidate",(async t=>{t.candidate&&await this.raiseProviderIce(e,{candidate:t.candidate?.toJSON()})})),await this.listenForClientIce(e,(async e=>{await n.addIceCandidate(e.candidate)})),await n.setRemoteDescription(t);const o=await n.createAnswer();await n.setLocalDescription(o);const s=Promise.all([i,r]).then((([t,n])=>(this.cleanupIceListeners(e),{request:t,response:n})));return{rtcClient:n,answer:o,channels:s}}}mt.RTCICEManager=Ct;var bt={},It={};function Et(e){return[...e.split(".").reverse().entries()].reduce(((e,[t,n])=>e+ +n*1e4**t),0)}function xt(e,t){return Et(e)>=Et(t)}function At(e){return e.split("/")[0]}Object.defineProperty(It,"__esModule",{value:!0}),It.runtimeUuidMeetsMinimumRuntimeVersion=It.parseRuntimeUuid=It.meetsMinimumRuntimeVersion=void 0,It.meetsMinimumRuntimeVersion=xt,It.parseRuntimeUuid=At,It.runtimeUuidMeetsMinimumRuntimeVersion=function(e,t){return xt(At(e),t)};var Pt,Mt,Ot,_t,St,Rt=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Ft=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(bt,"__esModule",{value:!0}),bt.ChannelProvider=void 0;const jt=Te,Lt=It;class kt extends jt.ChannelBase{get connections(){return[...Rt(this,Pt,"f")]}static handleClientDisconnection(e,t){const n=e.connections.find((e=>e.endpointId===t.endpointId));if(n)Rt(e,_t,"f").call(e,n);else{e.connections.filter((e=>e.uuid===t.uuid&&e.name===t.name)).forEach(Rt(e,_t,"f"))}e.disconnectListener(t)}static setProviderRemoval(e,t){kt.removalMap.set(e,t)}constructor(e,t,n){super(),Pt.set(this,void 0),Mt.set(this,void 0),Ot.set(this,void 0),_t.set(this,(e=>{const t=this.connections.filter((t=>t.endpointId!==e.endpointId));Rt(this,Ot,"f").closeEndpoint(e.endpointId),Ft(this,Pt,t,"f")})),this.processAction=async(e,t,n)=>(kt.clientIsMultiRuntime(n)&&!(0,Lt.runtimeUuidMeetsMinimumRuntimeVersion)(n.runtimeUuid,"18.87.56.0")?this.handleMultiRuntimeLegacyClient(n):this.checkForClientConnection(n),super.processAction(e,t,n)),St.set(this,(()=>{Rt(this,Ot,"f").close();const e=kt.removalMap.get(this);e&&e()})),Ft(this,Mt,new jt.ProtectedItems(e,t),"f"),this.connectListener=()=>{},this.disconnectListener=()=>{},Ft(this,Pt,[],"f"),Ft(this,Ot,n,"f"),n.receive(this.processAction)}dispatch(e,t,n){const i=e.endpointId??this.getEndpointIdForOpenFinId(e,t);return i&&Rt(this,Ot,"f").isEndpointConnected(i)?Rt(this,Ot,"f").send(i,t,n):Promise.reject(new Error(`Client connection with identity uuid: ${e.uuid} / name: ${e.name} / endpointId: ${i} no longer connected.`))}async processConnection(e,t){return Rt(this,Pt,"f").push(e),this.connectListener(e,t)}publish(e,t){return this.connections.map((n=>Rt(this,Ot,"f").send(n.endpointId,e,t)))}onConnection(e){this.connectListener=e}onDisconnection(e){this.disconnectListener=e}async destroy(){const e=Rt(this,Mt,"f");e.providerIdentity,Ft(this,Pt,[],"f"),await e.close(),Rt(this,St,"f").call(this)}async getAllClientInfo(){return this.connections.map((e=>{const{uuid:t,name:n,endpointId:i,entityType:r,connectionUrl:o}=e;return{uuid:t,name:n,endpointId:i,entityType:r,connectionUrl:o}}))}checkForClientConnection(e){if(!this.isClientConnected(e))throw new Error(`This action was sent from a client that is not connected to the provider.\n Client Identity: {uuid: ${e.uuid}, name: ${e.name}, endpointId: ${e.endpointId}}`)}isClientConnected(e){return kt.clientIdentityIncludesEndpointId(e)?this.connections.some((t=>t.endpointId===e.endpointId&&t.uuid===e.uuid&&t.name===e.name)):this.isLegacyClientConnected(e)}isLegacyClientConnected(e){return this.connections.some((t=>t.uuid===e.uuid&&t.name===e.name))}handleMultiRuntimeLegacyClient(e){if(!this.isLegacyClientConnected(e))throw new Error(`This action was sent from a client that is not connected to the provider. Client Identity:\n {uuid: ${e.uuid}, name: ${e.name}, endpointId: ${e.endpointId}}`)}getEndpointIdForOpenFinId(e,t){const n=this.connections.filter((t=>t.name===e.name&&t.uuid===e.uuid));if(n.length>=2){const n=Rt(this,Mt,"f"),{uuid:i,name:r}=e,o=n?.providerIdentity.uuid,s=n?.providerIdentity.name;console.warn(`WARNING: Dispatch call may have unintended results. The "to" argument of your dispatch call is missing the\n "endpointId" parameter. The identity you are dispatching to ({uuid: ${i}, name: ${r}})\n has multiple channelClients for this channel. Your dispatched action: (${t}) from the provider:\n ({uuid: ${o}, name: ${s}}) will only be processed by the most recently-created client.`)}return n.pop()?.endpointId}static clientIdentityIncludesEndpointId(e){return void 0!==e.endpointId}static clientIsMultiRuntime(e){return void 0!==e.runtimeUuid}static async wireClose(e,t){await e.sendAction("destroy-channel",{channelName:t})}}bt.ChannelProvider=kt,Pt=new WeakMap,Mt=new WeakMap,Ot=new WeakMap,_t=new WeakMap,St=new WeakMap,kt.removalMap=new WeakMap;var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.MessageReceiver=void 0;const $t=ke,Bt=c;class Gt extends Bt.Base{constructor(e){super(e),this.onmessage=e=>"process-channel-message"===e.action&&(this.processChannelMessage(e),!0),this.endpointMap=new Map,this.latestEndpointIdByChannelId=new Map,e.registerMessageHandler(this.onmessage.bind(this))}async processChannelMessage(e){const{senderIdentity:t,providerIdentity:n,action:i,ackToSender:r,payload:o,intendedTargetIdentity:s}=e.payload,a=s.channelId??s.endpointId??this.latestEndpointIdByChannelId.get(n.channelId),c=this.endpointMap.get(a);if(!c)return r.payload.success=!1,r.payload.reason=`Client connection with identity uuid: ${this.wire.me.uuid} / name: ${this.wire.me.name} / endpointId: ${a} no longer connected.`,this.wire.sendRaw(r);try{const e=await c(i,o,t);return r.payload.payload=r.payload.payload||{},r.payload.payload.result=e,this.wire.sendRaw(r)}catch(e){return r.payload.success=!1,r.payload.reason=e.message,this.wire.sendRaw(r)}}addEndpoint(e,t,n){this.endpointMap.set(n,e),t!==n&&this.latestEndpointIdByChannelId.set(t,n)}removeEndpoint(e,t){this.endpointMap.delete(t),this.latestEndpointIdByChannelId.get(e)===t&&this.latestEndpointIdByChannelId.delete(e)}checkForPreviousClientConnection(e){const t=this.latestEndpointIdByChannelId.get(e);t&&($t.ChannelClient.closeChannelByEndpointId(t),console.warn("You have created a second connection to an older provider. First connection has been removed from the clientMap"),console.warn("If the provider calls publish(), you may receive multiple messages."))}}Tt.MessageReceiver=Gt;var Wt={};Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.ProtocolManager=void 0;Wt.ProtocolManager=class{constructor(e){this.ProtocolsInPreferenceOrder=e,this.DefaultClientProtocols=["classic"],this.DefaultProviderProtocols=["classic"],this.getClientProtocols=e=>{const t=e?this.ProtocolsInPreferenceOrder.filter((t=>e.includes(t))):this.DefaultClientProtocols;if(!t.length)throw new Error(`No valid protocols were passed in. Accepted values are: ${this.ProtocolsInPreferenceOrder.join(", ")}.`);return t},this.getProviderProtocols=e=>{const t=e?this.ProtocolsInPreferenceOrder.filter((t=>e.includes(t))):this.DefaultProviderProtocols;if(!t.length)throw new Error(`No valid protocols were passed in. Accepted values are: ${this.ProtocolsInPreferenceOrder.join(", ")}.`);return t},this.getCompatibleProtocols=(e,t)=>t.supportedProtocols.filter((t=>e.some((e=>e.type===t.type&&t.version>=e.minimumVersion&&e.version>=(t.minimumVersion??0))))).slice(0,t.maxProtocols)}};var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0});class Nt{static combine(e,t){return new Nt(e,t)}constructor(e,t){this.primary=e,this.secondary=t}onEndpointDisconnect(e,t){this.primary.onEndpointDisconnect(e,(()=>{this.secondary.isEndpointConnected(e)||t()})),this.secondary.onEndpointDisconnect(e,(()=>{this.primary.isEndpointConnected(e)||t()}))}isValidEndpointPayload(e){return this.primary.isValidEndpointPayload(e)||this.secondary.isValidEndpointPayload(e)}async closeEndpoint(e){await this.primary.closeEndpoint(e),await this.secondary.closeEndpoint(e)}isEndpointConnected(e){return this.primary.isEndpointConnected(e)||this.secondary.isEndpointConnected(e)}async addEndpoint(e,t){this.primary.isValidEndpointPayload(t)&&await this.primary.addEndpoint(e,t),this.secondary.isValidEndpointPayload(t)&&await this.secondary.addEndpoint(e,t)}receive(e){this.primary.receive(e),this.secondary.receive(e)}send(e,t,n){return this.primary.isEndpointConnected(e)?this.primary.send(e,t,n):this.secondary.send(e,t,n)}async close(){await Promise.all([this.primary.close(),this.secondary.close()])}}Ht.default=Nt;var Dt,Ut,Vt=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},zt=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Ke,"__esModule",{value:!0}),Ke.ConnectionManager=void 0;const Kt=qe,qt=c,Yt=Qe,Jt=tt,Zt=mt,Qt=bt,Xt=Tt,en=Wt,tn=Ht;class nn extends qt.Base{static getProtocolOptionsFromStrings(e){return e.map((e=>{switch(e){case"rtc":return Jt.RTCInfo;case"classic":return Yt.ClassicInfo;default:return(0,Kt.exhaustiveCheck)(e,["rtc","classic"])}}))}constructor(e){super(e),Dt.set(this,void 0),Ut.set(this,void 0),this.removeChannelFromProviderMap=e=>{this.providerMap.delete(e)},this.onmessage=e=>"process-channel-connection"===e.action&&(this.processChannelConnection(e),!0),this.providerMap=new Map,this.protocolManager=new en.ProtocolManager("node"===this.wire.environment.type?["classic"]:["rtc","classic"]),Vt(this,Dt,new Xt.MessageReceiver(e),"f"),Vt(this,Ut,new Zt.RTCICEManager(e),"f"),e.registerMessageHandler(this.onmessage.bind(this))}createProvider(e,t){const n=Object.assign(this.wire.environment.getDefaultChannelOptions().create,e||{}),i=this.protocolManager.getProviderProtocols(n?.protocols),r=i.map((e=>{switch(e){case"rtc":return new Jt.RTCStrategy;case"classic":return new Yt.ClassicStrategy(this.wire,zt(this,Dt,"f"),t.channelId,t);default:return(0,Kt.exhaustiveCheck)(e,["rtc","classic"])}}));let o;if(2===r.length){const[e,t]=r;o=tn.default.combine(e,t)}else{if(1!==r.length)throw new Error("failed to combine strategies");[o]=r}const s=new Qt.ChannelProvider(t,(()=>Qt.ChannelProvider.wireClose(this.wire,t.channelName)),o),a=t.channelId;return this.providerMap.set(a,{provider:s,strategy:o,supportedProtocols:nn.getProtocolOptionsFromStrings(i)}),Qt.ChannelProvider.setProviderRemoval(s,this.removeChannelFromProviderMap.bind(this)),s}async createClientOffer(e){const t=this.protocolManager.getClientProtocols(e?.protocols);let n;return{offer:{supportedProtocols:await Promise.all(t.map((async e=>{switch(e){case"rtc":{const{rtcClient:e,channels:t,offer:i,rtcConnectionId:r,channelsOpened:o}=await zt(this,Ut,"f").startClientOffer();return n={rtcClient:e,channels:t,channelsOpened:o},{type:"rtc",version:Jt.RTCInfo.version,payload:{offer:i,rtcConnectionId:r}}}case"classic":return{type:"classic",version:Yt.ClassicInfo.version};default:return(0,Kt.exhaustiveCheck)(e,["rtc","classic"])}}))),maxProtocols:2},rtc:n}}async createClientStrategy(e,t){t.endpointId||(t.endpointId=this.wire.environment.getNextMessageId(),zt(this,Dt,"f").checkForPreviousClientConnection(t.channelId));const n=t.answer??{supportedProtocols:[{type:"classic",version:1}]},i=(await Promise.all(n.supportedProtocols.map((async n=>"rtc"===n.type&&e?(await zt(this,Ut,"f").finishClientOffer(e.rtcClient,n.payload.answer,e.channelsOpened),new Jt.RTCStrategy):"classic"===n.type?new Yt.ClassicStrategy(this.wire,zt(this,Dt,"f"),t.endpointId,t):null)))).filter((e=>null!==e));let r;if(e&&!i.some((e=>e instanceof Jt.RTCStrategy))&&e&&e.rtcClient.close(),i.length>=2)r=tn.default.combine(i[0],i[1]);else{if(!i.length)throw new Error("No compatible protocols");[r]=i}const o={endpointIdentity:t,rtc:e};return r.addEndpoint(t.channelId,o),r}async processChannelConnection(e){const{clientIdentity:t,providerIdentity:n,ackToSender:i,payload:r,offer:o}=e.payload;t.endpointId?t.isLocalEndpointId=!1:(t.endpointId=this.wire.environment.getNextMessageId(),t.isLocalEndpointId=!0);const s=n.channelId,a=this.providerMap.get(s);if(!a)return i.payload.success=!1,i.payload.reason=`Channel "${n.channelName}" has been destroyed.`,this.wire.sendRaw(i);const{provider:c,strategy:d,supportedProtocols:h}=a;try{if(!(c instanceof Qt.ChannelProvider))throw Error("Cannot connect to a channel client");const e=o??{supportedProtocols:[{type:"classic",version:1}],maxProtocols:1},n=this.protocolManager.getCompatibleProtocols(h,e);if(!n.length)throw new Error("This provider does not support any of the offered protocols.");const s=await c.processConnection(t,r);i.payload.payload=i.payload.payload||{};let a={supportedProtocols:[],endpointPayloadPromise:Promise.resolve({endpointIdentity:t})};return a=await n.reduce((async(e,t)=>{const n=await e;if("rtc"===t.type){const{answer:e,rtcClient:i,channels:r}=await zt(this,Ut,"f").createProviderAnswer(t.payload.rtcConnectionId,t.payload.offer);n.supportedProtocols.push({type:"rtc",version:Jt.RTCInfo.version,payload:{answer:e}}),n.endpointPayloadPromise=n.endpointPayloadPromise.then((e=>r.then((t=>({...e,rtc:{rtcClient:i,channels:t}})))))}else n.supportedProtocols.push({type:"classic",version:Yt.ClassicInfo.version});return n}),Promise.resolve(a)),a.endpointPayloadPromise.then((e=>d.addEndpoint(t.endpointId,e))),i.payload.payload.result=s,i.payload.payload.answer=a,this.wire.sendRaw(i)}catch(e){return i.payload.success=!1,i.payload.reason=e.message,this.wire.sendRaw(i)}}}Ke.ConnectionManager=nn,Dt=new WeakMap,Ut=new WeakMap;var rn,on,sn,an=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},cn=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Le,"__esModule",{value:!0}),Le.Channel=void 0;const dn=t,hn=B,ln=c,un=ke,pn=Ke,wn=bt;function yn(e){const t=Math.floor(e/10),n=Math.min(3e4,500*2**t);return new Promise((e=>{setTimeout((()=>{e(!1)}),n)}))}class fn extends ln.EmitterBase{constructor(e){super(e,"channel"),rn.set(this,void 0),on.set(this,new dn.EventEmitter),sn.set(this,new hn.AsyncRetryableLazy((async()=>{await Promise.all([this.on("disconnected",(e=>{un.ChannelClient.handleProviderDisconnect(e)})),this.on("connected",((...e)=>{cn(this,on,"f").emit("connected",...e)}))]).catch((()=>new Error("error setting up channel connection listeners")))}))),an(this,rn,new pn.ConnectionManager(e),"f")}async getAllChannels(){return this.wire.sendAction("get-all-channels").then((({payload:e})=>e.data))}async onChannelConnect(e){await this.on("connected",e)}async onChannelDisconnect(e){await this.on("disconnected",e)}async safeConnect(e,t,n){const i={count:0};do{let r=()=>{};const o=new Promise((t=>{r=n=>{e===n.channelName&&t(!0)},cn(this,on,"f").on("connected",r)}));try{if(i.count>0){i.gotConnectedEvent=await Promise.race([yn(i.count),o]);const t=await this.wire.sendAction("connect-to-channel",{...n,retryInfo:i});return console.log(`Successfully connected to channelName: ${e}`),t.payload.data}const t=this.wire.sendAction("connect-to-channel",n);i.originalMessageId=t.messageId;return(await t).payload.data}catch(n){if(!n.message.includes("internal-nack"))throw n;t&&0===i.count&&console.warn(`No channel found for channelName: ${e}. Waiting for connection...`)}finally{i.count+=1,cn(this,on,"f").removeListener("connected",r)}}while(t);throw new Error(`No channel found for channelName: ${e}.`)}async connect(e,t={}){if(await cn(this,sn,"f").getValue(),!e||"string"!=typeof e)throw new Error("Please provide a channelName string to connect to a channel.");const n={wait:!0,...this.wire.environment.getDefaultChannelOptions().connect,...t},{offer:i,rtc:r}=await cn(this,rn,"f").createClientOffer(n);let o;(this.fin.me.isFrame||this.fin.me.isView||this.fin.me.isWindow)&&(o=(await this.fin.me.getInfo()).url);const s={channelName:e,...n,offer:i,connectionUrl:o},a=await this.safeConnect(e,n.wait,s),c=await cn(this,rn,"f").createClientStrategy(r,a),d=new un.ChannelClient(a,(()=>un.ChannelClient.wireClose(this.wire,a,a.endpointId)),c);return c.onEndpointDisconnect(a.channelId,(async()=>{try{await d.sendDisconnectAction()}catch(e){console.warn(`Something went wrong during disconnect for client with uuid: ${a.uuid} / name: ${a.name} / endpointId: ${a.endpointId}.`)}finally{un.ChannelClient.handleProviderDisconnect(a)}})),d}async create(e,t){if(!e)throw new Error("Please provide a channelName to create a channel");const{payload:{data:n}}=await this.wire.sendAction("create-channel",{channelName:e}),i=cn(this,rn,"f").createProvider(t,n);return this.on("client-disconnected",(t=>{t.channelName===e&&wn.ChannelProvider.handleClientDisconnection(i,t)})),i}}Le.Channel=fn,rn=new WeakMap,on=new WeakMap,sn=new WeakMap,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.InterAppPayload=Fe.InterApplicationBus=void 0;const gn=t,mn=c,vn=je,Cn=Le,bn=O;class In extends mn.Base{constructor(e){super(e),this.events={subscriberAdded:"subscriber-added",subscriberRemoved:"subscriber-removed"},this.refCounter=new vn.RefCounter,this.Channel=new Cn.Channel(e),this.emitter=new gn.EventEmitter,e.registerMessageHandler(this.onmessage.bind(this)),this.on=this.emitter.on.bind(this.emitter),this.removeAllListeners=this.emitter.removeAllListeners.bind(this.emitter)}async publish(e,t){await this.wire.sendAction("publish-message",{topic:e,message:t,sourceWindowName:this.me.name})}async send(e,t,n){const i=(0,bn.validateIdentity)(e);if(i)throw new Error(i);await this.wire.sendAction("send-message",{destinationUuid:e.uuid,destinationWindowName:e.name,topic:t,message:n,sourceWindowName:this.me.name})}subscribe(e,t,n){const i=this.createSubscriptionKey(e.uuid,e.name||"*",t);return this.emitter.on(i,n),this.refCounter.actOnFirst(i,(async()=>{await this.wire.sendAction("subscribe",{sourceUuid:e.uuid,sourceWindowName:e.name||"*",topic:t,destinationWindowName:this.me.name})}),(()=>Promise.resolve()))}unsubscribe(e,t,n){const i=e.name||"*",r=this.createSubscriptionKey(e.uuid,i,t);return this.emitter.removeListener(r,n),this.refCounter.actOnLast(r,(async()=>{await this.wire.sendAction("unsubscribe",{sourceUuid:e.uuid,sourceWindowName:i,topic:t,destinationWindowName:this.me.name})}),(()=>new Promise((e=>e)).then((()=>{}))))}processMessage(e){const{payload:{message:t,sourceWindowName:n,sourceUuid:i,topic:r}}=e,o=[this.createSubscriptionKey(i,n,r),this.createSubscriptionKey(i,"*",r),this.createSubscriptionKey("*","*",r)],s={uuid:i,name:n};o.forEach((e=>{this.emitter.emit(e,t,s)}))}emitSubscriverEvent(e,t){const{payload:{targetName:n,uuid:i,topic:r}}=t,o={name:n,uuid:i,topic:r};this.emitter.emit(e,o)}createSubscriptionKey(e,t,n){const i=t||"*";if(!(e&&i&&n))throw new Error("Missing uuid, name, or topic string");return function(...e){return e.map((e=>Buffer.from(`${e}`).toString("base64"))).join("/")}(e,i,n)}onmessage(e){const{action:t}=e;switch(t){case"process-message":this.processMessage(e);break;case this.events.subscriberAdded:this.emitSubscriverEvent(this.events.subscriberAdded,e);break;case this.events.subscriberRemoved:this.emitSubscriverEvent(this.events.subscriberRemoved,e)}return!0}}Fe.InterApplicationBus=In;Fe.InterAppPayload=class{};var En={};Object.defineProperty(En,"__esModule",{value:!0}),En.Clipboard=void 0;const xn=c;class An extends xn.Base{async writeText(e){await this.wire.sendAction("clipboard-write-text",e)}async readText(e){const{payload:t}=await this.wire.sendAction("clipboard-read-text",{type:e});return t.data}async writeImage(e){await this.wire.sendAction("clipboard-write-image",e)}async readImage(e={format:"dataURL"}){const{payload:t}=await this.wire.sendAction("clipboard-read-image",e);return t.data}async writeHtml(e){await this.wire.sendAction("clipboard-write-html",e)}async readHtml(e){const{payload:t}=await this.wire.sendAction("clipboard-read-html",{type:e});return t.data}async writeRtf(e){await this.wire.sendAction("clipboard-write-rtf",e)}async readRtf(e){const{payload:t}=await this.wire.sendAction("clipboard-read-rtf",{type:e});return t.data}async write(e){await this.wire.sendAction("clipboard-write",e)}async getAvailableFormats(e){const{payload:t}=await this.wire.sendAction("clipboard-read-formats",{type:e});return t.data}}En.Clipboard=An;var Pn={},Mn={},On={};Object.defineProperty(On,"__esModule",{value:!0}),On.ExternalApplication=void 0;const _n=c;class Sn extends _n.EmitterBase{constructor(e,t){super(e,"external-application",t.uuid),this.identity=t}getInfo(){return this.wire.sendAction("get-external-application-info",this.identity).then((({payload:e})=>e.data))}}On.ExternalApplication=Sn,Object.defineProperty(Mn,"__esModule",{value:!0}),Mn.ExternalApplicationModule=void 0;const Rn=c,Fn=On;class jn extends Rn.Base{wrap(e){return this.wire.sendAction("external-application-wrap").catch((e=>{})),Promise.resolve(new Fn.ExternalApplication(this.wire,{uuid:e}))}wrapSync(e){return this.wire.sendAction("external-application-wrap-sync").catch((e=>{})),new Fn.ExternalApplication(this.wire,{uuid:e})}}Mn.ExternalApplicationModule=jn,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(Mn,e),n(On,e)}(Pn);var Ln={},kn={},Tn={};Object.defineProperty(Tn,"__esModule",{value:!0}),Tn._Frame=void 0;const $n=c;class Bn extends $n.EmitterBase{constructor(e,t){super(e,"frame",t.uuid,t.name),this.identity=t}getInfo(){return this.wire.sendAction("get-frame-info",this.identity).then((({payload:e})=>e.data))}getParentWindow(){return this.wire.sendAction("get-parent-window",this.identity).then((({payload:e})=>e.data))}}Tn._Frame=Bn,Object.defineProperty(kn,"__esModule",{value:!0}),kn._FrameModule=void 0;const Gn=c,Wn=O,Hn=Tn;class Nn extends Gn.Base{async wrap(e){this.wire.sendAction("frame-wrap").catch((e=>{}));const t=(0,Wn.validateIdentity)(e);if(t)throw new Error(t);return new Hn._Frame(this.wire,e)}wrapSync(e){this.wire.sendAction("frame-wrap-sync").catch((e=>{}));const t=(0,Wn.validateIdentity)(e);if(t)throw new Error(t);return new Hn._Frame(this.wire,e)}getCurrent(){return this.wire.sendAction("frame-get-current").catch((e=>{})),Promise.resolve(new Hn._Frame(this.wire,this.wire.environment.getCurrentEntityIdentity()))}getCurrentSync(){return this.wire.sendAction("frame-get-current-sync").catch((e=>{})),new Hn._Frame(this.wire,this.wire.environment.getCurrentEntityIdentity())}}kn._FrameModule=Nn,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(kn,e),n(Tn,e)}(Ln);var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0}),Dn.GlobalHotkey=void 0;const Un=c;class Vn extends Un.EmitterBase{constructor(e){super(e,"global-hotkey")}async register(e,t){await this.on(e,t),await this.wire.sendAction("global-hotkey-register",{hotkey:e})}async unregister(e){await this.removeAllListeners(e),await this.wire.sendAction("global-hotkey-unregister",{hotkey:e})}async unregisterAll(){await Promise.all(this.eventNames().filter((e=>!("registered"===e||"unregistered"===e))).map((e=>this.removeAllListeners(e)))),await this.wire.sendAction("global-hotkey-unregister-all",{})}async isRegistered(e){const{payload:{data:t}}=await this.wire.sendAction("global-hotkey-is-registered",{hotkey:e});return t}}Dn.GlobalHotkey=Vn;var zn,Kn={},qn={},Yn={},Jn=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Yn,"__esModule",{value:!0}),Yn.Platform=void 0;const Zn=c,Qn=O,Xn=new Map;class ei extends Zn.EmitterBase{constructor(e,t){super(t.wire,"application",e.uuid),this.getClient=e=>{this.wire.sendAction("platform-get-client",this.identity).catch((e=>{}));const t=e||this.identity,{uuid:n}=t;if(!Xn.has(n)){const e=Jn(this,zn,"f").call(this,n);Xn.set(n,e)}return Xn.get(n)},zn.set(this,(async e=>{try{const t=`custom-frame-${e}`,n=await this._channel.connect(t,{wait:!1});return n.onDisconnection((()=>{Xn.delete(e)})),n}catch(t){throw Xn.delete(e),new Error("The targeted Platform is not currently running. Listen for application-started event for the given Uuid.")}})),this.launchLegacyManifest=this.launchContentManifest;const n=(0,Qn.validateIdentity)(e);if(n)throw new Error(n);this._channel=t,this.identity={uuid:e.uuid},this.Layout=this.fin.Platform.Layout,this.Application=this.fin.Application.wrapSync(this.identity)}async createView(e,t,n){this.wire.sendAction("platform-create-view",this.identity).catch((e=>{}));const i=await this.getClient(),r=await i.dispatch("create-view",{target:t,opts:e,targetView:n});if(!r||(0,Qn.validateIdentity)(r.identity))throw new Error(`When overwriting the createView call, please return an object that has a valid 'identity' property: ${JSON.stringify(r)}`);return this.fin.View.wrapSync(r.identity)}async createWindow(e){this.wire.sendAction("platform-create-window",this.identity).catch((e=>{}));const t=await this.getClient();e.reason||(e.reason="api-call");const n=await t.dispatch("create-view-container",e);if(!n||(0,Qn.validateIdentity)(n.identity))throw new Error(`When overwriting the createWindow call, please return an object that has a valid 'identity' property: ${JSON.stringify(n)}`);const{identity:i}=n,r=this.fin.Window.wrapSync(i);return r.name=i.name,r.uuid=i.uuid,r}async quit(){this.wire.sendAction("platform-quit",this.identity).catch((e=>{}));return(await this.getClient()).dispatch("quit")}async closeView(e){this.wire.sendAction("platform-close-view",this.identity).catch((e=>{}));const t=await this.getClient();await t.dispatch("close-view",{view:e})}async reparentView(e,t){console.warn("Platform.reparentView has been deprecated, please use Platform.createView"),this.wire.sendAction("platform-reparent-view",this.identity).catch((e=>{}));const n={...e,uuid:e.uuid??this.identity.uuid},i=await this.fin.View.wrap(n),r=await i.getOptions();return this.createView(r,t)}async getSnapshot(){this.wire.sendAction("platform-get-snapshot",this.identity).catch((e=>{}));return(await this.getClient()).dispatch("get-snapshot")}async getViewSnapshot(e){return(await this.getClient()).dispatch("get-view-snapshot",{viewIdentity:e})}async applySnapshot(e,t){this.wire.sendAction("platform-apply-snapshot",this.identity).catch((e=>{}));const n="Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.";let i;if("string"==typeof e)try{i=(await this._channel.wire.sendAction("get-application-manifest",{manifestUrl:e})).payload.data}catch(e){throw new Error(`${n}: ${e}`)}else i=e;if(!i.windows)throw new Error(n);const r=await this.getClient();return await r.dispatch("apply-snapshot",{snapshot:i,options:t}),this}async fetchManifest(e){return(await this.getClient()).dispatch("platform-fetch-manifest",{manifestUrl:e})}async launchContentManifest(e){this.wire.sendAction("platform-launch-content-manifest",this.identity).catch((()=>{}));const t=await this.getClient(),n=await this.fetchManifest(e);return t.dispatch("launch-into-platform",{manifest:n,manifestUrl:e}),this}async setWindowContext(e={},t){if(this.wire.sendAction("platform-set-window-context",this.identity).catch((e=>{})),!e)throw new Error("Please provide a serializable object or string to set the context.");const n=await this.getClient(),{entityType:i}=t?await this.fin.System.getEntityInfo(t.uuid,t.name):this.fin.me;await n.dispatch("set-window-context",{context:e,entityType:i,target:t||{uuid:this.fin.me.uuid,name:this.fin.me.name}})}async getWindowContext(e){this.wire.sendAction("platform-get-window-context",this.identity).catch((e=>{}));const t=await this.getClient(),{entityType:n}=e?await this.fin.System.getEntityInfo(e.uuid,e.name):this.fin.me;return t.dispatch("get-window-context",{target:e||{uuid:this.fin.me.uuid,name:this.fin.me.name},entityType:n})}async closeWindow(e,t={skipBeforeUnload:!1}){this.wire.sendAction("platform-close-window",this.identity).catch((e=>{}));return(await this.getClient()).dispatch("close-window",{windowId:e,options:t})}}Yn.Platform=ei,zn=new WeakMap;var ti={},ni={},ii={},ri={};function oi(e){switch(e){case"columns":case"grid":case"rows":case"tabs":return!0;default:return!1}}Object.defineProperty(ri,"__esModule",{value:!0}),ri.overrideFromComposables=ri.isValidPresetType=void 0,ri.isValidPresetType=oi,ri.overrideFromComposables=function(...e){return t=>e.reduceRight(((e,t)=>n=>t(e(n))),(e=>e))(t)},ri.default={isValidPresetType:oi};var si,ai=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(ii,"__esModule",{value:!0}),ii.Layout=void 0;const ci=B,di=O,hi=c,li=ri,ui=W,pi=de;class wi extends hi.Base{constructor(e,t){super(t),si.set(this,new ci.Lazy((async()=>ui.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(),pi.LAYOUT_CONTROLLER_ID,this.identity)))),this.replace=async e=>{this.wire.sendAction("layout-replace").catch((e=>{}));const t=await this.platform.getClient();await t.dispatch("replace-layout",{target:this.identity,opts:{layout:e}})},this.replaceView=async(e,t)=>{this.wire.sendAction("layout-replace-view").catch((e=>{}));const n=await this.platform.getClient();await n.dispatch("replace-view",{target:this.identity,opts:{viewToReplace:e,newView:t}})},this.applyPreset=async e=>{this.wire.sendAction("layout-apply-preset").catch((e=>{}));const t=await this.platform.getClient(),{presetType:n}=e;if(!n||!(0,li.isValidPresetType)(n))throw new Error("Cannot apply preset layout, please include an applicable presetType property in the PresetLayoutOptions.");await t.dispatch("apply-preset-layout",{target:this.identity,opts:{presetType:n}})};const n=(0,di.validateIdentity)(e);if(n)throw new Error(n);this.identity=e,this.platform=this.fin.Platform.wrapSync({uuid:e.uuid}),e.uuid===this.fin.me.uuid&&e.name===this.fin.me.name&&(this.init=this.fin.Platform.Layout.init)}async getConfig(){this.wire.sendAction("layout-get-config").catch((e=>{}));return(await this.platform.getClient()).dispatch("get-frame-snapshot",{target:this.identity})}async getCurrentViews(){this.wire.sendAction("layout-get-views").catch((e=>{}));const e=await this.platform.getClient();return(await e.dispatch("get-layout-views",{target:this.identity})).map((e=>this.fin.View.wrapSync(e)))}async getRootItem(){this.wire.sendAction("layout-get-root-item").catch((()=>{}));const e=await ai(this,si,"f").getValue(),t=await e.getRoot("layoutName"in this.identity?this.identity:void 0);return ui.LayoutNode.getEntity(t,e)}}ii.Layout=wi,si=new WeakMap;var yi,fi,gi,mi,vi,Ci=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},bi=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(ni,"__esModule",{value:!0}),ni.LayoutModule=void 0;const Ii=c,Ei=ii,xi=de;class Ai extends Ii.Base{constructor(){super(...arguments),yi.add(this),fi.set(this,!1),gi.set(this,null),this.init=async(e={})=>{if(this.wire.sendAction("layout-init").catch((e=>{})),!this.wire.environment.layoutAllowedInContext(this.fin))throw new Error("Layout.init can only be called from a Window context.");if(Ci(this,fi,"f"))throw new Error("Layout.init was already called, please use Layout.create to add additional layouts.");"openfin"===this.wire.environment.type&&await this.fin.Platform.getCurrentSync().getClient(),bi(this,fi,!0,"f"),bi(this,gi,await this.wire.environment.initLayoutManager(this.fin,this.wire,e),"f"),await this.wire.environment.applyLayoutSnapshot(this.fin,Ci(this,gi,"f"),e);const t={name:this.fin.me.name,uuid:this.fin.me.uuid};if(!e.layoutManagerOverride){const e={layoutName:xi.DEFAULT_LAYOUT_KEY,...t};return Ci(this,mi,"f").call(this,e)}return this.wrapSync(t)},mi.set(this,(e=>{const t="[Layout] You are using a deprecated property `layoutManager` - it will throw if you access it starting in v37.",n=new Proxy({},{get(e,n){throw console.warn(`[Layout-mgr-proxy] accessing ${n.toString()}`),new Error(t)}}),i=Object.assign(this.wrapSync(e),{layoutManager:n});return new Proxy(i,{get(e,n){if("layoutManager"===n)throw console.warn(`[Layout-proxy] accessing ${n.toString()}`),new Error(t);return e[n]}})})),this.getCurrentLayoutManagerSync=()=>Ci(this,yi,"m",vi).call(this,"fin.Platform.Layout.getCurrentLayoutManagerSync()"),this.create=async e=>this.wire.environment.createLayout(Ci(this,yi,"m",vi).call(this,"fin.Platform.Layout.create()"),e),this.destroy=async e=>this.wire.environment.destroyLayout(Ci(this,yi,"m",vi).call(this,"fin.Platform.Layout.destroy()"),e)}async wrap(e){return this.wire.sendAction("layout-wrap").catch((e=>{})),new Ei.Layout(e,this.wire)}wrapSync(e){return this.wire.sendAction("layout-wrap-sync").catch((e=>{})),new Ei.Layout(e,this.wire)}async getCurrent(){if(this.wire.sendAction("layout-get-current").catch((e=>{})),!this.fin.me.isWindow)throw new Error("You are not in a Window context. Only Windows can have a Layout.");const{uuid:e,name:t}=this.fin.me;return this.wrap({uuid:e,name:t})}getCurrentSync(){if(this.wire.sendAction("layout-get-current-sync").catch((e=>{})),!this.fin.me.isWindow)throw new Error("You are not in a Window context. Only Windows can have a Layout.");const{uuid:e,name:t}=this.fin.me;return this.wrapSync({uuid:e,name:t})}}ni.LayoutModule=Ai,fi=new WeakMap,gi=new WeakMap,mi=new WeakMap,yi=new WeakSet,vi=function(e){if(!Ci(this,gi,"f"))throw new Error(`You must call init before using the API ${e}`);return Ci(this,gi,"f")},function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(ni,e),n(ii,e)}(ti),Object.defineProperty(qn,"__esModule",{value:!0}),qn.PlatformModule=void 0;const Pi=c,Mi=Yn,Oi=ti;class _i extends Pi.Base{constructor(e,t){super(e),this._channel=t,this.Layout=new Oi.LayoutModule(this.wire)}async init(e){if(!fin.__internal_.isPlatform||fin.me.name!==fin.me.uuid)throw new Error("fin.Platform.init should only be called from a custom platform provider running in the main window of the application.");return this.wire.environment.initPlatform(this.fin,e)}async wrap(e){return this.wire.sendAction("platform-wrap").catch((e=>{})),new Mi.Platform({uuid:e.uuid},this._channel)}wrapSync(e){return this.wire.sendAction("platform-wrap-sync").catch((e=>{})),new Mi.Platform({uuid:e.uuid},this._channel)}async getCurrent(){return this.wire.sendAction("platform-get-current").catch((e=>{})),this.wrap({uuid:this.wire.me.uuid})}getCurrentSync(){return this.wire.sendAction("platform-get-current-sync").catch((e=>{})),this.wrapSync({uuid:this.wire.me.uuid})}start(e){return this.wire.sendAction("platform-start").catch((e=>{})),new Promise((async(t,n)=>{try{const{uuid:n}=e,i=await this.fin.Application._create({...e,isPlatformController:!0});i.once("platform-api-ready",(()=>t(this.wrapSync({uuid:n})))),i._run({uuid:n})}catch(e){n(e)}}))}startFromManifest(e,t){return this.wire.sendAction("platform-start-from-manifest").catch((e=>{})),new Promise((async(n,i)=>{try{const i=await this.fin.Application._createFromManifest(e);i.once("platform-api-ready",(()=>n(this.wrapSync({uuid:i.identity.uuid})))),i._run(t)}catch(e){i(e)}}))}}qn.PlatformModule=_i,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(qn,e),n(Yn,e)}(Kn);var Si={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMe=e.getBaseMe=e.environmentUnsupportedMessage=void 0;const t=me(),n=Ln,i=Pe(),r=Pn;function o(e,t,n){return{...{isView:"view"===e,isWindow:"window"===e,isFrame:"iframe"===e,isExternal:"external connection"===e},uuid:t,name:n,entityType:e}}e.environmentUnsupportedMessage="You are not running in OpenFin.",e.getBaseMe=o,e.getMe=function(s){const{uuid:a,name:c,entityType:d}=s.me,h={setContext(){throw new Error(e.environmentUnsupportedMessage)},addContextHandler(){throw new Error(e.environmentUnsupportedMessage)},getContextGroups(){throw new Error(e.environmentUnsupportedMessage)},joinContextGroup(){throw new Error(e.environmentUnsupportedMessage)},removeFromContextGroup(){throw new Error(e.environmentUnsupportedMessage)},getAllClientsInContextGroup(){throw new Error(e.environmentUnsupportedMessage)},getInfoForContextGroup(){throw new Error(e.environmentUnsupportedMessage)}},l="Interop API has not been instantiated. Either connection has failed or you have not declared interop in your config.",u={setContext(){throw new Error(l)},addContextHandler(){throw new Error(l)},getContextGroups(){throw new Error(l)},joinContextGroup(){throw new Error(l)},removeFromContextGroup(){throw new Error(l)},getAllClientsInContextGroup(){throw new Error(l)},getInfoForContextGroup(){throw new Error(l)}},p={eventNames:()=>{throw new Error(e.environmentUnsupportedMessage)},emit:()=>{throw new Error(e.environmentUnsupportedMessage)},listeners:()=>{throw new Error(e.environmentUnsupportedMessage)},listenerCount:()=>{throw new Error(e.environmentUnsupportedMessage)},on:()=>{throw new Error(e.environmentUnsupportedMessage)},addListener:()=>{throw new Error(e.environmentUnsupportedMessage)},once:()=>{throw new Error(e.environmentUnsupportedMessage)},prependListener:()=>{throw new Error(e.environmentUnsupportedMessage)},prependOnceListener:()=>{throw new Error(e.environmentUnsupportedMessage)},removeListener:()=>{throw new Error(e.environmentUnsupportedMessage)},removeAllListeners:()=>{throw new Error(e.environmentUnsupportedMessage)}};switch(d){case"view":return Object.assign(new t.View(s,{uuid:a,name:c}),o(d,a,c),{interop:u,isOpenFin:!0});case"window":return Object.assign(new i._Window(s,{uuid:a,name:c}),o(d,a,c),{interop:u,isOpenFin:!0});case"iframe":return Object.assign(new n._Frame(s,{uuid:a,name:c}),o(d,a,c),{interop:u,isOpenFin:!0});case"external connection":return Object.assign(new r.ExternalApplication(s,{uuid:a}),o(d,a,c),{interop:u,isOpenFin:!1});default:return{...o(d,a,c),...p,interop:h,isOpenFin:!1}}}}(Si);var Ri={},Fi={},ji={};Object.defineProperty(ji,"__esModule",{value:!0}),ji.createWarningObject=ji.createUnusableObject=void 0,ji.createUnusableObject=function(e){const t=()=>{throw new Error(e)};return new Proxy({},{apply:t,construct:t,defineProperty:t,deleteProperty:t,get:t,getOwnPropertyDescriptor:t,getPrototypeOf:t,has:t,isExtensible:t,ownKeys:t,preventExtensions:t,set:t,setPrototypeOf:t})},ji.createWarningObject=function(e,t){return new Proxy(t,{get:(...t)=>(console.warn(e),Reflect.get(...t)),set:(...t)=>(console.warn(e),Reflect.set(...t)),getOwnPropertyDescriptor:(...t)=>(console.warn(e),Reflect.getOwnPropertyDescriptor(...t)),ownKeys:(...t)=>(console.warn(e),Reflect.ownKeys(...t))})};var Li,ki={},Ti={};var $i={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.wrapIntentHandler=e.BROKER_ERRORS=e.generateOverrideWarning=e.generateOverrideError=e.wrapContextHandler=e.wrapInTryCatch=e.generateId=void 0;e.generateId=()=>`${Math.random()}${Date.now()}`;e.wrapInTryCatch=(e,t)=>(...n)=>{try{return e(...n)}catch(e){throw new Error((t||"")+e)}};e.wrapContextHandler=(e,t)=>async n=>{try{await e(n)}catch(e){throw console.error(`Error thrown by handler ${t} for context type ${n.type}: ${e}`),e}};e.generateOverrideError=(e,t)=>`You have tried to to use ${e} but ${t} has not been overridden in the Interop Broker. Please override this function. Refer to our documentation for more info.`;e.generateOverrideWarning=(e,t,n,i)=>{const{uuid:r,name:o}=n;return i?`Entity with identity: ${r}/${o} has called ${i} or ${e} but ${t} has not been overridden.`:`Entity with identity: ${r}/${o} has called ${e} but ${t} has not been overridden.`},e.BROKER_ERRORS={fireIntent:(0,e.generateOverrideError)("fireIntent","handleFiredIntent"),fireIntentForContext:(0,e.generateOverrideError)("fireIntentForContext","handleFiredIntentForContext"),getInfoForIntent:(0,e.generateOverrideError)("getInfoForIntent","handleInfoForIntent"),getInfoForIntentsByContext:(0,e.generateOverrideError)("getInfoForIntentsByContext","handleInfoForIntentsByContext"),joinSessionContextGroupWithJoinContextGroup:"The Context Group you have tried to join is a Session Context Group. Custom Context Groups can only be defined by the Interop Broker through code or manifest configuration. Please use joinSessionContextGroup.",fdc3Open:(0,e.generateOverrideError)("fdc3.open","fdc3HandleOpen"),fdc3FindInstances:(0,e.generateOverrideError)("fdc3.findInstances","fdc3HandleFindInstances"),fdc3GetAppMetadata:(0,e.generateOverrideError)("fdc3.getAppMetadata","fdc3HandleGetAppMetadata"),fdc3GetInfo:(0,e.generateOverrideError)("fdc3.getInfo","fdc3HandleGetInfo")};e.wrapIntentHandler=(e,t)=>async n=>{try{return e(n)}catch(e){throw console.error(`Error thrown by handler ${t}: ${e}`),e}}}($i);var Bi,Gi,Wi={};function Hi(){if(Gi)return ki;Gi=1;var e,t,i,r=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},s=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(ki,"__esModule",{value:!0}),ki.InteropBroker=void 0;const a=c,d=function(){if(Li)return Ti;Li=1,Object.defineProperty(Ti,"__esModule",{value:!0});const e=pr();return Ti.default=class{constructor(e,t){this.provider=e,this.id=t,this.lastContext=void 0,this.contextGroupMap=new Map,this.clients=new Map,this.registerListeners()}registerListeners(){this.provider.register(`sessionContextGroup:getContext-${this.id}`,this.getCurrentContext.bind(this)),this.provider.register(`sessionContextGroup:setContext-${this.id}`,this.setContext.bind(this)),this.provider.register(`sessionContextGroup:handlerAdded-${this.id}`,this.handlerAdded.bind(this)),this.provider.register(`sessionContextGroup:handlerRemoved-${this.id}`,this.handlerRemoved.bind(this))}getCurrentContext(e){return e.type?this.contextGroupMap.get(e.type):this.lastContext}setContext(t,n){const{context:i}=t,r=e.InteropBroker.checkContextIntegrity(i);if(!1===r.isValid)throw new Error(`Failed to set Context - bad Context. Reason: ${r.reason}. Context: ${JSON.stringify(i)}`);if(!this.getClientState(n))throw new Error(`Client with Identity: ${n.uuid} ${n.name} not in Session Client State Map`);this.contextGroupMap.set(i.type,i),this.lastContext=i,Array.from(this.clients.values()).forEach((e=>{e.contextHandlers.get(i.type)?.forEach((t=>{this.provider.dispatch(e.clientIdentity,t,i)})),e.globalHandler&&this.provider.dispatch(e.clientIdentity,e.globalHandler,i)}))}getClientState(e){return this.clients.get(e.endpointId)}async handlerAdded(e,t){const{handlerId:n,contextType:i}=e,r=this.getClientState(t);if(!r)throw new Error(`Client with Identity: ${t.uuid} ${t.name} not in Client State Map`);if(i){const e=r.contextHandlers.get(i)||[];r.contextHandlers.set(i,[...e,n]);const o=this.contextGroupMap.get(i);o&&await this.provider.dispatch(t,n,o)}else{r.globalHandler=n;const e=[...this.contextGroupMap.keys()].map((async e=>{const i=this.contextGroupMap.get(e);i&&await this.provider.dispatch(t,n,i)}));await Promise.all(e)}}handlerRemoved(e,t){const{handlerId:n}=e,i=this.clients.get(t.endpointId);i?(Array.from(i.contextHandlers).forEach((([,e])=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)})),i.globalHandler===n&&(i.globalHandler=void 0)):console.warn(`Trying to remove a handler from a client that isn't mapped. handlerId: ${n}. clientIdentity: ${t}`)}registerNewClient(e){if(!this.clients.has(e.endpointId)){const t={contextHandlers:new Map,clientIdentity:e,globalHandler:void 0};this.clients.set(e.endpointId,t)}}onDisconnection(e){this.clients.delete(e.endpointId)}},Ti}(),h=$i,l=n,u=function(){if(Bi)return Wi;Bi=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.PrivateChannelProvider=void 0;const e=Hi();return Wi.PrivateChannelProvider=class t{constructor(e,t){this.provider=e,this.id=t,this.clients=new Map,this.registerListeners(),this.contextByContextType=new Map,this.lastContext=void 0,this.provider.onConnection((e=>this.registerNewClient(e))),this.provider.onDisconnection((async e=>{const{endpointId:t}=e;this.clients.has(t)&&await this.handleClientDisconnecting(e),0===(await this.provider.getAllClientInfo()).length&&this.provider.destroy()}))}getClientState(e){return this.clients.get(e.endpointId)}registerListeners(){this.provider.register("broadcast",this.broadcast.bind(this)),this.provider.register("getCurrentContext",this.getCurrentContext.bind(this)),this.provider.register("contextHandlerAdded",this.contextHandlerAdded.bind(this)),this.provider.register("contextHandlerRemoved",this.contextHandlerRemoved.bind(this)),this.provider.register("nonStandardHandlerRemoved",this.nonStandardHandlerRemoved.bind(this)),this.provider.register("onAddContextHandlerAdded",this.onAddContextHandlerAdded.bind(this)),this.provider.register("onDisconnectHandlerAdded",this.onDisconnectHandlerAdded.bind(this)),this.provider.register("onUnsubscribeHandlerAdded",this.onUnsubscribeHandlerAdded.bind(this)),this.provider.register("clientDisconnecting",((e,t)=>{this.handleClientDisconnecting(t)}))}broadcast(t,n){const{context:i}=t;if(!this.getClientState(n))throw new Error(`Client with Identity: ${n.uuid} ${n.name}, tried to call broadcast, is not connected to this Private Channel`);const r=e.InteropBroker.checkContextIntegrity(i);if(!1===r.isValid)throw new Error(`Failed to broadcast - bad Context. Reason: ${r.reason}. Context: ${JSON.stringify(i)}`);this.contextByContextType.set(i.type,i),this.lastContext=i,Array.from(this.clients.values()).forEach((e=>{const t=e.handlerIdsByContextTypes.get(i.type);t&&t.forEach((t=>{this.provider.dispatch(e.clientIdentity,t,i)})),e.globalHandler&&this.provider.dispatch(e.clientIdentity,e.globalHandler,i)}))}getCurrentContext(e,t){const{contextType:n}=e;if(!this.getClientState(t))throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call getCurrentContext, is not connected to this Private Channel`);if(void 0!==n){return this.contextByContextType.get(n)||null}return this.lastContext?this.lastContext:null}contextHandlerAdded(e,t){const{handlerId:n,contextType:i}=e,r=this.getClientState(t);if(!r)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call addContextListener, is not connected to this Private Channel`);if(i){const e=r.handlerIdsByContextTypes.get(i)||[];r.handlerIdsByContextTypes.set(i,[...e,n])}else r.globalHandler=n;Array.from(this.clients.values()).forEach((e=>{e.clientIdentity.endpointId!==t.endpointId&&e.onAddContextListenerHandlerId&&this.provider.dispatch(e.clientIdentity,e.onAddContextListenerHandlerId,i)}))}async contextHandlerRemoved(e,t){const{handlerId:n}=e,i=this.getClientState(t);if(i){let e;if(i.globalHandler===n)i.globalHandler=void 0;else for(const[t,r]of i.handlerIdsByContextTypes){const i=r.indexOf(n);i>-1&&(r.splice(i,1),e=t)}const r=(await this.getConnectedClients()).map((async n=>{const{clientIdentity:i,clientIdentity:{endpointId:r},onUnsubscribeHandlerId:o}=n;r!==t.endpointId&&o&&await this.provider.dispatch(i,o,e)}));try{await Promise.all(r)}catch(e){throw console.error(`Problem when attempting to dispatch to onUnsubscribeHandlers. Error: ${e} Removing Client: ${n}. uuid: ${t.uuid}. name: ${t.name}. endpointId: ${t.endpointId}`),new Error(e)}}else console.warn(`Trying to remove a handler from a client that isn't mapped. handlerId: ${n}. uuid: ${t.uuid}. name: ${t.name}. endpointId: ${t.endpointId}.`)}nonStandardHandlerRemoved(e,t){const{handlerId:n}=e,i=this.getClientState(t);i?i.onDisconnectHandlerId===n?i.onDisconnectHandlerId=void 0:i.onAddContextListenerHandlerId===n?i.onAddContextListenerHandlerId=void 0:i.onUnsubscribeHandlerId===n&&(i.onUnsubscribeHandlerId=void 0):console.warn(`Trying to remove a handler from a client that isn't mapped. handlerId: ${n}. clientIdentity: ${t}`)}onAddContextHandlerAdded(e,t){const n=this.getClientState(t),{handlerId:i}=e;if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call onAddContextListener, is not connected to this Private Channel`);n.onAddContextListenerHandlerId=i,Array.from(this.clients.values()).forEach((e=>{e.clientIdentity.endpointId!==t.endpointId&&Array.from(e.handlerIdsByContextTypes.keys()).forEach((e=>{this.provider.dispatch(t,i,e)}))}))}onDisconnectHandlerAdded(e,t){const n=this.getClientState(t),{handlerId:i}=e;if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call onDisconnect, is not connected to this Private Channel`);n.onDisconnectHandlerId=i}onUnsubscribeHandlerAdded(e,t){const n=this.getClientState(t),{handlerId:i}=e;if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call onUnsubscribe, is not connected to this Private Channel`);n.onUnsubscribeHandlerId=i}removeClient(e){const t=this.getClientState(e);if(!t)throw new Error(`Client with Identity: ${e.uuid} ${e.name}, tried to call disconnect, is not connected to this Private Channel`);t.handlerIdsByContextTypes.clear(),this.clients.delete(e.endpointId)}async fireOnDisconnectForOtherClients(e){const{endpointId:t}=e,n=(await this.getConnectedClients()).map((async e=>{const{clientIdentity:{endpointId:n},onDisconnectHandlerId:i}=e;n!==t&&i&&await this.provider.dispatch(e.clientIdentity,i)}));try{await Promise.all(n)}catch(t){throw console.error(`Problem when attempting to dispatch to onDisconnectHandlers. Error: ${t} Disconnecting Client: uuid: ${e.uuid}. name: ${e.name}. endpointId: ${e.endpointId}`),new Error(t)}}async unsubscribeAll(e){const{endpointId:t}=e,n=this.clients.get(t);if(n){const t=Array.from(n.handlerIdsByContextTypes.values()).flat(),i=n.globalHandler;if(t.length>0){const n=t.map((async t=>this.contextHandlerRemoved({handlerId:t},e)));try{await Promise.all(n)}catch(e){console.error(e.message)}}if(i)try{await this.contextHandlerRemoved({handlerId:i},e)}catch(e){console.error(e.message)}}}async handleClientDisconnecting(e){await this.unsubscribeAll(e),this.removeClient(e),await this.fireOnDisconnectForOtherClients(e)}registerNewClient(e){if(!this.clients.has(e.endpointId)){const t={clientIdentity:e,handlerIdsByContextTypes:new Map,globalHandler:void 0,onAddContextListenerHandlerId:void 0,onUnsubscribeHandlerId:void 0,onDisconnectHandlerId:void 0};this.clients.set(e.endpointId,t)}}async getConnectedClients(){const e=await this.provider.getAllClientInfo();return Array.from(this.clients.values()).filter((t=>{const{uuid:n,name:i}=t.clientIdentity;return e.some((e=>i===e.name&&n===e.uuid))}))}static init(e,n){return new t(e,n)}},Wi}(),p=B,w=[{id:"green",displayMetadata:{color:"#00CC88",name:"green"}},{id:"purple",displayMetadata:{color:"#8C61FF",name:"purple"}},{id:"orange",displayMetadata:{color:"#FF8C4C",name:"orange"}},{id:"red",displayMetadata:{color:"#FF5E60",name:"red"}},{id:"pink",displayMetadata:{color:"#FF8FB8",name:"pink"}},{id:"yellow",displayMetadata:{color:"#E9FF8F",name:"yellow"}}];let y=class n extends a.Base{constructor(n,o,a){super(n),e.set(this,void 0),t.set(this,void 0),i.set(this,void 0),this.getProvider=()=>s(this,i,"f").getValue(),this.interopClients=new Map,this.contextGroupsById=new Map,r(this,t,a.contextGroups??[...w],"f"),r(this,e,a.fdc3Info,"f"),a?.logging&&(this.logging=a.logging),this.intentClientMap=new Map,this.lastContextMap=new Map,this.sessionContextGroupMap=new Map,r(this,i,new p.Lazy(o),"f"),this.setContextGroupMap(),this.setupChannelProvider()}static createClosedConstructor(...e){return class extends n{constructor(...t){if(t.length){const[n,i,r]=t;if(r&&"object"==typeof r&&!(0,l.isEqual)(r,e[2]))return console.warn("You have modified the parameters of the InteropOverride constructor. This behavior is deprecated and will be removed in a future version. You can modify these options in your manifest. Please consult our Interop docs for guidance on migrating to the new override scheme."),void super(e[0],e[1],r);console.warn("You are attempting to pass arguments to the InteropOverride constructor. This is not necessary, and these passed arguments will be ignored. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.")}super(...e)}}}setContext({context:e},t){this.wire.sendAction("interop-broker-set-context").catch((e=>{}));const n=this.getClientState(t);if(!n||!n.contextGroupId)throw n?new Error("You must join a context group before you can set context."):new Error(`Client with Identity: ${t.uuid} ${t.name} not in Client State Map`);{const{contextGroupId:t}=n;this.setContextForGroup({context:e},t)}}setContextForGroup({context:e},t){this.wire.sendAction("interop-broker-set-context-for-group").catch((e=>{}));const i=this.contextGroupsById.get(t);if(!i)throw new Error(`Unable to set context for context group that isn't in the context group mapping: ${t}.`);const r=n.checkContextIntegrity(e);if(!1===r.isValid)throw new Error(`Failed to set Context - bad Context. Reason: ${r.reason}. Context: ${JSON.stringify(e)}`);const o=e.type;i.set(o,e),this.lastContextMap.set(t,o);Array.from(this.interopClients.values()).filter((e=>e.contextGroupId===t)).forEach((t=>{for(const[,i]of t.contextHandlers)n.isContextTypeCompatible(o,i.contextType)&&this.invokeContextHandler(t.clientIdentity,i.handlerId,e)}))}getCurrentContext(e,t){this.wire.sendAction("interop-broker-get-current-context").catch((e=>{}));const n=this.getClientState(t);if(!n?.contextGroupId)throw new Error("You must be a member of a context group to call getCurrentContext");const{contextGroupId:i}=n,r=this.contextGroupsById.get(i),o=this.lastContextMap.get(i),s=e?.contextType??o;return r&&s?r.get(s):void 0}async joinContextGroup({contextGroupId:e,target:t},i){if(this.wire.sendAction("interop-broker-join-context-group").catch((e=>{})),this.sessionContextGroupMap.has(e))throw new Error(h.BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup);if(t){n.hasEndpointId(t)&&await this.addClientToContextGroup({contextGroupId:e},t);try{const n=this.channel.connections.filter((e=>e.uuid===t.uuid&&e.name===t.name));if(!n.length)throw new Error(`Given Identity ${t.uuid} ${t.name} is not connected to the Interop Broker.`);n.length>1&&console.warn(`More than one connection found for identity ${t.uuid} ${t.name}`);const i=[];for(const t of n)i.push(this.addClientToContextGroup({contextGroupId:e},t));await Promise.all(i)}catch(e){throw new Error(e)}}else await this.addClientToContextGroup({contextGroupId:e},i)}async addClientToContextGroup({contextGroupId:e},t){this.wire.sendAction("interop-broker-add-client-to-context-group").catch((e=>{}));const n=this.getClientState(t);if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name} not in Client State Map`);if(!this.getContextGroups().find((t=>t.id===e)))throw new Error(`Attempting to join a context group that does not exist: ${e}. You may only join existing context groups.`);if(n.contextGroupId!==e){n.contextGroupId=e,await this.setCurrentContextGroupInClientOptions(t,e);const i=this.contextGroupsById.get(e);for(const[,e]of n.contextHandlers){const{contextType:n,handlerId:r}=e;if(void 0===n)i.forEach(((e,n)=>{this.invokeContextHandler(t,r,e)}));else if(i.has(n)){const e=i.get(n);e&&this.invokeContextHandler(t,r,e)}}}}async removeFromContextGroup({target:e},t){if(this.wire.sendAction("interop-broker-remove-from-context-group").catch((e=>{})),e){n.hasEndpointId(e)&&await this.removeClientFromContextGroup(e);try{const t=this.channel.connections.filter((t=>t.uuid===e.uuid&&t.name===e.name));if(!t.length)throw new Error(`No connection found for given Identity ${e.uuid} ${e.name}`);t.length>1&&console.warn(`More than one connection found for identity ${e.uuid} ${e.name}`);const n=[];for(const e of t)n.push(this.removeClientFromContextGroup(e));await Promise.all(n)}catch(e){throw new Error(e)}}else await this.removeClientFromContextGroup(t)}async removeClientFromContextGroup(e){this.wire.sendAction("interop-broker-remove-client-from-context-group").catch((e=>{}));const t=this.getClientState(e);t&&(t.contextGroupId=void 0),await this.setCurrentContextGroupInClientOptions(e,null)}getContextGroups(){return this.wire.sendAction("interop-broker-get-context-groups").catch((e=>{})),s(this,t,"f").map((e=>({...e})))}getInfoForContextGroup({contextGroupId:e}){return this.wire.sendAction("interop-broker-get-info-for-context-group").catch((e=>{})),this.getContextGroups().find((t=>t.id===e))}getAllClientsInContextGroup({contextGroupId:e}){this.wire.sendAction("interop-broker-get-all-clients-in-context-group").catch((e=>{}));return Array.from(this.interopClients.values()).filter((t=>t.contextGroupId===e)).map((e=>e.clientIdentity))}async handleFiredIntent(e,t){const n=(0,h.generateOverrideWarning)("fdc3.raiseIntent","InteropBroker.handleFiredIntent",t,"interopClient.fireIntent");throw console.warn(n),new Error(h.BROKER_ERRORS.fireIntent)}async setIntentTarget(e,t){this.wire.sendAction("interop-broker-set-intent-target").catch((e=>{}));const n=this.intentClientMap.get(t.name),i=`intent-handler-${e.name}`;if(n){const t=n.get(i);if(t){if(t.pendingIntents.push(e),t.clientIdentity&&t.isReady){const{clientIdentity:e,pendingIntents:n}=t;try{const r=n[n.length-1];await this.invokeIntentHandler(e,i,r),t.pendingIntents=[]}catch(n){console.error(`Error invoking intent handler for client ${e.uuid}/${e.name}/${e.endpointId}`),t.isReady=!1}}}else n.set(i,{isReady:!1,pendingIntents:[e]})}else{this.intentClientMap.set(t.name,new Map);const n=this.intentClientMap.get(t.name);n&&n.set(i,{isReady:!1,pendingIntents:[e]})}}async handleInfoForIntent(e,t){const n=(0,h.generateOverrideWarning)("fdc3.findIntent","InteropBroker.handleInfoForIntent",t,"interopClient.getInfoForIntent");throw console.warn(n),new Error(h.BROKER_ERRORS.getInfoForIntent)}async handleInfoForIntentsByContext(e,t){const n=(0,h.generateOverrideWarning)("fdc3.findIntentsByContext","InteropBroker.handleInfoForIntentsByContext",t,"interopClient.getInfoForIntentsByContext");throw console.warn(n),new Error(h.BROKER_ERRORS.getInfoForIntentsByContext)}async handleFiredIntentForContext(e,t){const n=(0,h.generateOverrideWarning)("fdc3.raiseIntentForContext","InteropBroker.handleFiredIntentForContext",t,"interopClient.fireIntentForContext");throw console.warn(n),new Error(h.BROKER_ERRORS.fireIntentForContext)}async clientDisconnected(e){}async fdc3HandleOpen({app:e,context:t},n){const i=(0,h.generateOverrideWarning)("fdc3.open","InteropBroker.fdc3HandleOpen",n);throw console.warn(i),new Error(h.BROKER_ERRORS.fdc3Open)}async fdc3HandleFindInstances(e,t){const n=(0,h.generateOverrideWarning)("fdc3.open","InteropBroker.fdc3HandleFindInstances",t);throw console.warn(n),new Error(h.BROKER_ERRORS.fdc3FindInstances)}async fdc3HandleGetAppMetadata(e,t){const n=(0,h.generateOverrideWarning)("fdc3.getAppMetadata","InteropBroker.fdc3HandleGetAppMetadata",t);throw console.warn(n),new Error(h.BROKER_ERRORS.fdc3GetAppMetadata)}async invokeContextHandler(e,t,n){const i=await this.getProvider();try{await i.dispatch(e,t,n)}catch(i){console.error(`Error invoking context handler ${t} for context type ${n.type} in client ${e.uuid}/${e.name}/${e.endpointId}`,i)}}async invokeIntentHandler(e,t,n){const i=await this.getProvider();await i.dispatch(e,t,n)}async fdc3HandleGetInfo(t,n){const{fdc3Version:i}=t;return{fdc3Version:i,...s(this,e,"f"),optionalFeatures:{OriginatingAppMetadata:!1,UserChannelMembershipAPIs:!0},appMetadata:{appId:"",instanceId:""}}}async getAllClientInfo(){return(await this.getProvider()).getAllClientInfo()}decorateSnapshot(e){return{...e,interopSnapshotDetails:{contextGroupStates:this.getContextGroupStates()}}}applySnapshot(e,t){const n=e?.interopSnapshotDetails?.contextGroupStates;n&&(t?.closeExistingWindows||this.updateExistingClients(n),this.rehydrateContextGroupStates(n))}updateExistingClients(e){this.interopClients.forEach((t=>{const{clientIdentity:i,contextGroupId:r,contextHandlers:o}=t;if(r){const t=e[r];for(const[,e]of Object.entries(t))o.forEach((t=>{const{handlerId:r,contextType:o}=t;n.isContextTypeCompatible(e.type,o)&&this.invokeContextHandler(i,r,e)}))}}))}getContextGroupStates(){return n.toObject(this.contextGroupsById)}rehydrateContextGroupStates(e){const t=Object.entries(e);for(const[e,n]of t){const t=Object.entries(n);for(const[n,i]of t)if(this.contextGroupsById.has(e)){this.contextGroupsById.get(e).set(n,i)}else console.warn(`Attempting to set a context group that isn't in the context group mapping. Skipping context group rehydration for: ${e}`)}}contextHandlerRegistered({contextType:e,handlerId:t},n){const i={contextType:e,handlerId:t},r=this.getClientState(n);if(r?.contextHandlers.set(t,i),r&&r.contextGroupId){const{contextGroupId:i}=r,o=this.contextGroupsById.get(i);if(void 0===e)o.forEach(((e,i)=>{this.invokeContextHandler(n,t,e)}));else if(o.has(e)){const i=o.get(e);i&&this.invokeContextHandler(n,t,i)}}}async intentHandlerRegistered(e,t){const{handlerId:n}=e,i=this.intentClientMap.get(t.name),r=i?.get(n);if(i)if(r){const{pendingIntents:e}=r;r.clientIdentity=t,r.isReady=!0;try{if(e.length>0){const i=e[e.length-1];await this.invokeIntentHandler(t,n,i),r.pendingIntents=[]}}catch(e){console.error(`Error invoking intent handler: ${n} for client ${t.uuid}/${t.name}/${t.endpointId}`)}}else i.set(n,{isReady:!0,pendingIntents:[],clientIdentity:t});else{this.intentClientMap.set(t.name,new Map);const e=this.intentClientMap.get(t.name);e&&e.set(n,{isReady:!0,pendingIntents:[],clientIdentity:t})}}removeContextHandler({handlerId:e},t){const n=this.getClientState(t);n&&n.contextHandlers.delete(e)}handleJoinSessionContextGroup({sessionContextGroupId:e},t){try{if(!e)throw new Error("Failed to join session context group: must specify group id.");const n=this.sessionContextGroupMap.get(e);if(n)n.registerNewClient(t);else{const n=new d.default(this.channel,e);n.registerNewClient(t),this.sessionContextGroupMap.set(e,n)}return{hasConflict:this.contextGroupsById.has(e)}}catch(e){throw new Error(e)}}getClientState(e){return this.interopClients.get(e.endpointId)}static toObject(e){const t=Object.fromEntries(e),n={};return Object.entries(t).forEach((([e,t])=>{const i=Object.fromEntries(t);n[e]=i})),n}static checkContextIntegrity(e){if(!e)return{isValid:!1,reason:"No context supplied"};if("object"!=typeof e)return{isValid:!1,reason:"Context must be an Object"};if(!e.type)return{isValid:!1,reason:"Context must have a type property"};if(e.id&&"object"!=typeof e.id)return{isValid:!1,reason:"Context id must be an Object populated with key-value identifiers (if set)"};if(e.id){const{id:t}=e,n=Object.keys(t);let i=!1;if(!n.length)return{isValid:!1,reason:"Context id must have at least one key-value identifier"};if(n.forEach((e=>{"string"==typeof e&&"string"==typeof t[e]||(i=!0)})),i)return{isValid:!1,reason:"Context id key-value identifiers must be of type string"}}return e.name&&"string"!=typeof e.name?{isValid:!1,reason:"Context name must be of string type (if set)"}:{isValid:!0}}static hasEndpointId(e){return void 0!==e.endpointId}static isContextTypeCompatible(e,t){return void 0===t||e===t}setContextGroupMap(){for(const e of this.getContextGroups())this.contextGroupsById.set(e.id,new Map)}async setCurrentContextGroupInClientOptions(e,t){try{const n=await this.fin.System.getEntityInfo(e.uuid,e.name);let i;"view"===n.entityType?i=await this.fin.View.wrap(e):"window"===n.entityType&&(i=await this.fin.Window.wrap(e)),i&&await i.updateOptions({interop:{currentContextGroup:t}})}catch(e){}}async setupChannelProvider(){try{const e=await this.getProvider();this.channel=e,this.wireChannel(e)}catch(e){throw new Error(`Error setting up Interop Broker Channel Provider: ${e}`)}}wireChannel(e){e.onConnection((async(e,t)=>{if(!await this.isConnectionAuthorized(e,t))throw new Error(`Connection not authorized for ${e.uuid}, ${e.name}`);if(!e.endpointId)throw new Error("Version too old to be compatible with Interop. Please upgrade your runtime to a more recent version.");const n={contextGroupId:void 0,contextHandlers:new Map,clientIdentity:e};t?.currentContextGroup&&this.contextGroupsById.has(t.currentContextGroup)&&(n.contextGroupId=t?.currentContextGroup),this.interopClients.set(e.endpointId,n)})),e.onDisconnection((e=>{this.interopClients.delete(e.endpointId);const t=this.intentClientMap.get(e.name);t&&e.uuid===this.fin.me.uuid&&t.forEach((e=>{e.isReady=!1})),this.sessionContextGroupMap.forEach((t=>{t.onDisconnection(e)})),this.clientDisconnected(e)})),e.beforeAction((async(e,t,n)=>{if(!await this.isActionAuthorized(e,t,n))throw new Error(`Action (${e}) not authorized for ${n.uuid}, ${n.name}`);this.logging?.beforeAction?.enabled&&console.log(e,t,n)})),e.afterAction(((e,t,n)=>{this.logging?.afterAction?.enabled&&console.log(e,t,n)})),e.register("setContext",this.setContext.bind(this)),e.register("fireIntent",this.handleFiredIntent.bind(this)),e.register("getCurrentContext",this.getCurrentContext.bind(this)),e.register("getInfoForIntent",this.handleInfoForIntent.bind(this)),e.register("getInfoForIntentsByContext",this.handleInfoForIntentsByContext.bind(this)),e.register("fireIntentForContext",this.handleFiredIntentForContext.bind(this)),e.register("getContextGroups",this.getContextGroups.bind(this)),e.register("joinContextGroup",this.joinContextGroup.bind(this)),e.register("removeFromContextGroup",this.removeFromContextGroup.bind(this)),e.register("getAllClientsInContextGroup",this.getAllClientsInContextGroup.bind(this)),e.register("getInfoForContextGroup",this.getInfoForContextGroup.bind(this)),e.register("contextHandlerRegistered",this.contextHandlerRegistered.bind(this)),e.register("intentHandlerRegistered",this.intentHandlerRegistered.bind(this)),e.register("removeContextHandler",this.removeContextHandler.bind(this)),e.register("sessionContextGroup:createIfNeeded",this.handleJoinSessionContextGroup.bind(this)),e.register("fdc3Open",this.fdc3HandleOpen.bind(this)),e.register("fdc3v2FindIntentsByContext",this.handleInfoForIntentsByContext.bind(this)),e.register("fdc3FindInstances",this.fdc3HandleFindInstances.bind(this)),e.register("fdc3GetAppMetadata",this.fdc3HandleGetAppMetadata.bind(this)),e.register("fdc3v2GetInfo",(async(e,t)=>this.fdc3HandleGetInfo.bind(this)(e,t))),e.register("createPrivateChannelProvider",(async e=>{const{channelId:t}=e,n=await this.fin.InterApplicationBus.Channel.create(t);u.PrivateChannelProvider.init(n,t)}))}isConnectionAuthorized(e,t){return this.wire.sendAction("interop-broker-is-connection-authorized").catch((e=>{})),Promise.resolve(!0)}isActionAuthorized(e,t,n){return this.wire.sendAction("interop-broker-is-action-authorized").catch((e=>{})),Promise.resolve(!0)}};return ki.InteropBroker=y,e=new WeakMap,t=new WeakMap,i=new WeakMap,ki}var Ni,Di={},Ui={},Vi=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},zi=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Ui,"__esModule",{value:!0});const Ki=c,qi=$i;class Yi extends Ki.Base{constructor(e,t,n){super(e),Ni.set(this,void 0),this.id=n,Vi(this,Ni,t,"f")}async setContext(e){this.wire.sendAction("interop-session-context-group-set-context").catch((e=>{}));return(await zi(this,Ni,"f")).dispatch(`sessionContextGroup:setContext-${this.id}`,{sessionContextGroupId:this.id,context:e})}async getCurrentContext(e){this.wire.sendAction("interop-session-context-group-get-context").catch((e=>{}));return(await zi(this,Ni,"f")).dispatch(`sessionContextGroup:getContext-${this.id}`,{sessionContextGroupId:this.id,type:e})}async addContextHandler(e,t){if(this.wire.sendAction("interop-session-context-group-add-handler").catch((e=>{})),"function"!=typeof e)throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");const n=await zi(this,Ni,"f");let i;return i=t?`sessionContextHandler:invoke-${this.id}-${t}-${(0,qi.generateId)()}`:`sessionContextHandler:invoke-${this.id}`,n.register(i,(0,qi.wrapContextHandler)(e,i)),await n.dispatch(`sessionContextGroup:handlerAdded-${this.id}`,{handlerId:i,contextType:t}),{unsubscribe:await this.createUnsubscribeCb(i)}}async createUnsubscribeCb(e){const t=await zi(this,Ni,"f");return async()=>{t.remove(e),await t.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`,{handlerId:e})}}getUserInstance(){return{id:this.id,setContext:(0,qi.wrapInTryCatch)(this.setContext.bind(this),"Failed to set context: "),getCurrentContext:(0,qi.wrapInTryCatch)(this.getCurrentContext.bind(this),"Failed to get context: "),addContextHandler:(0,qi.wrapInTryCatch)(this.addContextHandler.bind(this),"Failed to add context handler: ")}}}Ui.default=Yi,Ni=new WeakMap;var Ji={},Zi={},Qi={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0}),Xi.PrivateChannelClient=void 0;const er=$i;var tr,nr;function ir(){if(tr)return Zi;tr=1;var e,t=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},i=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(Zi,"__esModule",{value:!0}),Zi.FDC3ModuleBase=void 0;const r=Qi,s=$i,a=ar(),c=n;return Zi.FDC3ModuleBase=class{get client(){return t(this,e,"f").call(this)}get fin(){return this.wire.getFin()}constructor(t,n){this.wire=n,e.set(this,void 0),i(this,e,t,"f")}async broadcast(e){return this.wire.sendAction("fdc3-broadcast").catch((e=>{})),this.client.setContext(e)}async _open(e,t){this.wire.sendAction("fdc3-open").catch((e=>{}));try{return await a.InteropClient.ferryFdc3Call(this.client,"fdc3Open",{app:e,context:t})}catch(e){const t=e.message===s.BROKER_ERRORS.fdc3Open?"ResolverUnavailable":e.message;throw new Error(t)}}async _getChannels(){return(await this.client.getContextGroups()).map((e=>({...e,type:"system",...(0,r.getUnsupportedChannelApis)()})))}async getOrCreateChannel(e){this.wire.sendAction("fdc3-get-or-create-channel").catch((e=>{}));const t=(await this._getChannels()).find((t=>t.id===e));if(t)return{...t,type:"system",...(0,r.getUnsupportedChannelApis)()};try{const t=await this.client.joinSessionContextGroup(e);return(0,r.buildAppChannelObject)(t)}catch(e){throw console.error(e.message),new Error(r.ChannelError.CreationFailed)}}async getSystemChannels(){return this.wire.sendAction("fdc3-get-system-channels").catch((e=>{})),this._getChannels()}async joinChannel(e){this.wire.sendAction("fdc3-join-channel").catch((e=>{}));try{return await this.client.joinContextGroup(e)}catch(e){if(e.message===s.BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup?console.error("The Channel you have tried to join is an App Channel. Custom Channels can only be defined by the Interop Broker through code or manifest configuration. Please use getOrCreateChannel."):console.error(e.message),e.message.startsWith("Attempting to join a context group that does not exist"))throw new Error(r.ChannelError.NoChannelFound);throw new Error(r.ChannelError.AccessDenied)}}async getCurrentChannel(){this.wire.sendAction("fdc3-get-current-channel").catch((e=>{}));const e=await this.getCurrentContextGroupInfo();return e?this.buildChannelObject(e):null}async leaveCurrentChannel(){return this.wire.sendAction("fdc3-leave-current-channel").catch((e=>{})),this.client.removeFromContextGroup()}async getCurrentContextGroupInfo(){const e=await this.client.getContextGroups(),t=e.map((async e=>this.client.getAllClientsInContextGroup(e.id))),n=(await Promise.all(t)).findIndex((e=>e.some((e=>{const{uuid:t,name:n}=e;return this.wire.me.uuid===t&&this.wire.me.name===n}))));return e[n]}async buildChannelObject(e){return{...e,type:"system",addContextListener:(...[e,t])=>{let n,i;"function"==typeof e?(console.warn("addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)"),n=e):(n=t,"string"==typeof e&&(i=e));const r=(async()=>{let e=!0;const t=await this.client.getCurrentContext(i);return this.client.addContextHandler(((i,r)=>{if(!e||(e=!1,!(0,c.isEqual)(t,i)))return n(i,r)}),i)})();return{...r,unsubscribe:()=>r.then((e=>e.unsubscribe()))}},broadcast:this.broadcast.bind(this),getCurrentContext:async e=>{const t=await this.client.getCurrentContext(e);return void 0===t?null:t}}}},e=new WeakMap,Zi}Xi.PrivateChannelClient=class{constructor(e,t){this.id=t,this.client=e,this.listeners=new Map}async broadcast(e){return this.client.dispatch("broadcast",{context:e})}async getCurrentContext(e){return this.client.dispatch("getCurrentContext",{contextType:e})}async addContextListener(e,t){if("function"!=typeof t)throw new Error("Non-function argument passed to the second parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");let n;n=e?`contextHandler:invoke-${this.id}-${e}-${er.generateId()}`:`contextHandler:invoke-${this.id}-${er.generateId()}`,this.client.register(n,er.wrapContextHandler(t,n));const i={unsubscribe:await this.createContextUnsubscribeCb(n)};return this.listeners.set(n,i),await this.client.dispatch("contextHandlerAdded",{handlerId:n,contextType:e}),i}createNonStandardUnsubscribeCb(e){return async()=>{this.client.remove(e),this.listeners.delete(e),await this.client.dispatch("nonStandardHandlerRemoved",{handlerId:e})}}createContextUnsubscribeCb(e){return async()=>{this.client.remove(e),this.listeners.delete(e),await this.client.dispatch("contextHandlerRemoved",{handlerId:e})}}onAddContextListener(e){const t=`onContextHandlerAdded:invoke-${this.id}-${er.generateId()}`;this.client.register(t,e);const n={unsubscribe:this.createNonStandardUnsubscribeCb(t)};return this.listeners.set(t,n),this.client.dispatch("onAddContextHandlerAdded",{handlerId:t}),n}onDisconnect(e){const t=`onDisconnect:invoke-${this.id}-${er.generateId()}`;this.client.register(t,e);const n={unsubscribe:this.createNonStandardUnsubscribeCb(t)};return this.listeners.set(t,n),this.client.dispatch("onDisconnectHandlerAdded",{handlerId:t}),n}onUnsubscribe(e){const t=`onUnsubscribe:invoke-${this.id}-${er.generateId()}`;this.client.register(t,e);const n={unsubscribe:this.createNonStandardUnsubscribeCb(t)};return this.listeners.set(t,n),this.client.dispatch("onUnsubscribeHandlerAdded",{handlerId:t}),n}async cleanUpAllSubs(){Array.from(this.listeners.keys()).forEach((e=>{this.client.remove(e),this.listeners.delete(e)}))}async disconnect(){try{await this.client.dispatch("clientDisconnecting"),await this.cleanUpAllSubs(),await this.client.disconnect()}catch(e){throw new Error(e.message)}}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getIntentResolution=e.isChannel=e.isContext=e.connectPrivateChannel=e.buildAppChannelObject=e.buildPrivateChannelObject=e.ChannelError=e.ResultError=e.UnsupportedChannelApiError=e.getUnsupportedChannelApis=void 0;const t=$i,i=Xi,r=n;e.getUnsupportedChannelApis=e=>({addContextListener:()=>{throw new o("Channel.addContextListener",e)},broadcast:()=>{throw new o("Channel.broadcast",e)},getCurrentContext:()=>{throw new o("Channel.getCurrentContext",e)}});class o extends Error{constructor(e,t="System"){super(e),this.message=`Calling ${e} on an instance of a ${t} Channel returned by fdc3.get${t}Channels is not supported. If you would like to use a ${t} Channel, please use fdc3.joinChannel, fdc3.addContextListener, and fdc3.broadcast instead.`}}var s,a;e.UnsupportedChannelApiError=o,function(e){e.NoResultReturned="NoResultReturned",e.IntentHandlerRejected="IntentHandlerRejected"}(s=e.ResultError||(e.ResultError={})),(a=e.ChannelError||(e.ChannelError={})).NoChannelFound="NoChannelFound",a.AccessDenied="AccessDenied",a.CreationFailed="CreationFailed";e.buildPrivateChannelObject=e=>{let t=!1;const n=()=>{if(t)throw new Error("Private Channel Client has been disconnected from the Private Channel")};return{id:e.id,type:"private",broadcast:async t=>(n(),e.broadcast(t)),getCurrentContext:async t=>(n(),e.getCurrentContext(t)),addContextListener:async(t,i)=>{n();let r=i,o=t;"function"==typeof t&&(console.warn("addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)"),r=t,o=null);return e.addContextListener(o,r)},onAddContextListener:t=>(n(),e.onAddContextListener(t)),disconnect:async()=>(n(),t=!0,e.disconnect()),onDisconnect:t=>(n(),e.onDisconnect(t)),onUnsubscribe:t=>(n(),e.onUnsubscribe(t))}};e.buildAppChannelObject=e=>({id:e.id,type:"app",broadcast:e.setContext,getCurrentContext:async t=>{const n=await e.getCurrentContext(t);return void 0===n?null:n},addContextListener:(t,n)=>{let i,o;"function"==typeof t?(console.warn("addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)"),i=t):(i=n,"string"==typeof t&&(o=t));const s=(async()=>{let t=!0;const n=await e.getCurrentContext(o);return e.addContextHandler(((e,o)=>{if(!t||(t=!1,!(0,r.isEqual)(n,e)))return i(e,o)}),o)})();return{...s,unsubscribe:()=>s.then((e=>e.unsubscribe()))}}});e.connectPrivateChannel=async t=>{try{const n=await fin.InterApplicationBus.Channel.connect(t),r=new i.PrivateChannelClient(n,t);return(0,e.buildPrivateChannelObject)(r)}catch(e){throw new Error(`Private Channel with id: ${t} doesn't exist`)}};e.isContext=e=>{if(e&&"object"==typeof e&&"type"in e){const{type:t}=e;return"string"==typeof t}return!1};e.isChannel=e=>{if(e&&"object"==typeof e&&"type"in e&&"id"in e){const{type:t,id:n}=e;return"string"==typeof t&&"string"==typeof n&&("app"===t||"private"===t)}return!1};e.getIntentResolution=async(n,i,r,o)=>{const a=(0,t.generateId)(),c=new Promise(((e,t)=>{fin.InterApplicationBus.subscribe({uuid:"*"},a,(t=>{e(t)})).catch((()=>t(new Error("getResult is not supported in this environment"))))})),d=r?{target:r,intentResolutionResultId:a}:{intentResolutionResultId:a},h=o?{name:o,context:i,metadata:d}:{...i,metadata:d},l=async()=>{let t=await c;if(!t||"object"!=typeof t)throw new Error(s.NoResultReturned);const{error:i}=t;if(i)throw new Error(s.IntentHandlerRejected);if((0,e.isChannel)(t)){const{id:i,type:r}=t;switch(r){case"private":t=await(0,e.connectPrivateChannel)(i);break;case"app":{const r=await n.joinSessionContextGroup(i);t=(0,e.buildAppChannelObject)(r);break}}}else if(!(0,e.isContext)(t))throw new Error(s.NoResultReturned);return t},u=o?await n.fireIntent(h):await n.fireIntentForContext(h);return"object"!=typeof u?{source:{appId:"",instanceId:""},intent:"",version:"2.0",getResult:l}:{...u,getResult:l}}}(Qi);var rr,or,sr={};function ar(){if(or)return Di;or=1;var e,t,n=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},i=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Di,"__esModule",{value:!0}),Di.InteropClient=void 0;const r=c,s=Ui,a=function(){if(nr)return Ji;nr=1,Object.defineProperty(Ji,"__esModule",{value:!0}),Ji.Fdc3Module=void 0;const e=$i,t=ir();class n extends t.FDC3ModuleBase{async open(e,t){await super._open(e,t)}addContextListener(e,t){let n;return this.wire.sendAction("fdc3-add-context-listener").catch((e=>{})),"function"==typeof e?(console.warn("addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)"),n=this.client.addContextHandler(e)):n=this.client.addContextHandler(t,null===e?void 0:e),{...n,unsubscribe:()=>n.then((e=>e.unsubscribe()))}}addIntentListener(e,t){this.wire.sendAction("fdc3-add-intent-listener").catch((e=>{}));const n=this.client.registerIntentHandler((e=>{const{context:n,metadata:i}=e,{metadata:r}=n,o=i?.intentResolutionResultId||r?.intentResolutionResultId;o&&this.fin.InterApplicationBus.publish(o,null).catch((()=>null)),t(e.context)}),e,{fdc3Version:"1.2"});return{...n,unsubscribe:()=>n.then((e=>e.unsubscribe()))}}async raiseIntent(t,n,i){this.wire.sendAction("fdc3-raise-intent").catch((e=>{}));const r=i?{name:t,context:n,metadata:{target:i}}:{name:t,context:n};try{return await this.client.fireIntent(r)}catch(t){const n=t.message===e.BROKER_ERRORS.fireIntent?"ResolverUnavailable":t.message;throw new Error(n)}}async findIntent(t,n){this.wire.sendAction("fdc3-find-intent").catch((e=>{}));try{return await this.client.getInfoForIntent({name:t,context:n})}catch(t){const n=t.message===e.BROKER_ERRORS.getInfoForIntent?"ResolverUnavailable":t.message;throw new Error(n)}}async findIntentsByContext(t){this.wire.sendAction("fdc3-find-intents-by-context").catch((e=>{}));try{return await this.client.getInfoForIntentsByContext(t)}catch(t){const n=t.message===e.BROKER_ERRORS.getInfoForIntentsByContext?"ResolverUnavailable":t.message;throw new Error(n)}}async raiseIntentForContext(t,n){this.wire.sendAction("fdc3-raise-intent-for-context").catch((e=>{}));try{return await this.client.fireIntentForContext({...t,metadata:{target:n}})}catch(t){const n=t.message===e.BROKER_ERRORS.fireIntentForContext?"ResolverUnavailable":t.message;throw new Error(n)}}async getOrCreateChannel(e){return super.getOrCreateChannel(e)}getInfo(){return this.wire.sendAction("fdc3-get-info").catch((e=>{})),{providerVersion:this.wire.environment.getAdapterVersionSync(),provider:`openfin-${this.wire.me.uuid}`,fdc3Version:"1.2"}}}return Ji.Fdc3Module=n,Ji}(),d=function(){if(rr)return sr;rr=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.Fdc3Module2=void 0;const e=ir(),t=$i,n=ar(),i=Qi,r=Xi;class o extends e.FDC3ModuleBase{async open(e,t){return"string"==typeof e&&console.warn("Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string })."),super._open(e,t)}async findInstances(e){this.wire.sendAction("fdc3-find-instances").catch((e=>{}));try{return await n.InteropClient.ferryFdc3Call(this.client,"fdc3FindInstances",e)}catch(e){const n=e.message===t.BROKER_ERRORS.fdc3FindInstances?"ResolverUnavailable":e.message;throw new Error(n)}}async getAppMetadata(e){this.wire.sendAction("fdc3-get-app-metadata").catch((e=>{}));try{return await n.InteropClient.ferryFdc3Call(this.client,"fdc3GetAppMetadata",e)}catch(e){const n=e.message===t.BROKER_ERRORS.fdc3GetAppMetadata?"ResolverUnavailable":e.message;throw new Error(n)}}async addContextListener(e,t){this.wire.sendAction("fdc3-add-context-listener").catch((e=>{}));const n=e=>t=>{const{contextMetadata:n,...i}=t,r=n?[{...i},n]:[t,null];e(...r)};let i=t,r=n(i);return"function"==typeof e?(console.warn("addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)"),i=e,r=n(i),this.client.addContextHandler(r)):this.client.addContextHandler(r,null===e?void 0:e)}async findIntent(e,n,i){this.wire.sendAction("fdc3-find-intent").catch((e=>{}));try{return await this.client.getInfoForIntent({name:e,context:n,metadata:{resultType:i}})}catch(e){const n=e.message===t.BROKER_ERRORS.getInfoForIntent?"ResolverUnavailable":e.message;throw new Error(n)}}async findIntentsByContext(e,i){this.wire.sendAction("fdc3-find-intents-by-context").catch((e=>{}));const r=i?{context:e,metadata:{resultType:i}}:e;try{return await n.InteropClient.ferryFdc3Call(this.client,"fdc3v2FindIntentsByContext",r)}catch(e){const n=e.message===t.BROKER_ERRORS.getInfoForIntentsByContext?"ResolverUnavailable":e.message;throw new Error(n)}}async raiseIntent(e,n,r){this.wire.sendAction("fdc3-raise-intent").catch((e=>{}));try{return"string"==typeof r&&console.warn("Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string })."),(0,i.getIntentResolution)(this.client,n,r,e)}catch(e){const n=e.message===t.BROKER_ERRORS.fireIntent?"ResolverUnavailable":e.message;throw new Error(n)}}async raiseIntentForContext(e,n){this.wire.sendAction("fdc3-raise-intent-for-context").catch((e=>{}));try{return"string"==typeof n&&console.warn("Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string })."),(0,i.getIntentResolution)(this.client,e,n)}catch(e){const n=e.message===t.BROKER_ERRORS.fireIntent?"ResolverUnavailable":e.message;throw new Error(n)}}async addIntentListener(e,t){if(this.wire.sendAction("fdc3-add-intent-listener").catch((e=>{})),"string"!=typeof e)throw new Error("First argument must be an Intent name");return this.client.registerIntentHandler((async e=>{let n,i;const{context:r,metadata:o}=e,{contextMetadata:s,metadata:a,...c}=r,d=o?.intentResolutionResultId||a?.intentResolutionResultId;try{const e=a?{metadata:a,...c}:{...c};n=await t(e,s),i=n}catch(e){n=e,i={error:!0}}if(d&&this.fin.InterApplicationBus.publish(d,i).catch((()=>null)),n instanceof Error)throw new Error(n.message);return n}),e,{fdc3Version:"2.0"})}async getOrCreateChannel(e){return super.getOrCreateChannel(e)}async createPrivateChannel(){const e=(0,t.generateId)();await n.InteropClient.ferryFdc3Call(this.client,"createPrivateChannelProvider",{channelId:e});const o=await this.fin.InterApplicationBus.Channel.connect(e),s=new r.PrivateChannelClient(o,e);return(0,i.buildPrivateChannelObject)(s)}async getUserChannels(){return(await this.client.getContextGroups()).map((e=>({...e,type:"user",...(0,i.getUnsupportedChannelApis)("User")})))}async getSystemChannels(){return console.warn("This API has been deprecated. Please use fdc3.getUserChannels instead."),super.getSystemChannels()}async joinUserChannel(e){return super.joinChannel(e)}async joinChannel(e){return console.warn("This API has been deprecated. Please use fdc3.joinUserChannel instead."),super.joinChannel(e)}async getCurrentChannel(){const e=await super.getCurrentChannel();return e?{...e,type:"user",broadcast:this.broadcast.bind(this)}:null}async getInfo(){return n.InteropClient.ferryFdc3Call(this.client,"fdc3v2GetInfo",{fdc3Version:"2.0"})}}return sr.Fdc3Module2=o,sr}(),h=$i;let l=class extends r.Base{constructor(i,r){super(i),e.set(this,void 0),t.set(this,void 0),n(this,t,new Map,"f"),n(this,e,r,"f")}async setContext(t){this.wire.sendAction("interop-client-set-context").catch((e=>{}));return(await i(this,e,"f")).dispatch("setContext",{context:t})}async addContextHandler(t,n){if(this.wire.sendAction("interop-client-add-context-handler").catch((e=>{})),"function"!=typeof t)throw new Error("Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.");const r=await i(this,e,"f");let o;o=n?`invokeContextHandler-${n}-${(0,h.generateId)()}`:"invokeContextHandler";const s=(0,h.wrapContextHandler)(t,o);return r.register(o,s),await r.dispatch("contextHandlerRegistered",{handlerId:o,contextType:n}),{unsubscribe:async()=>{r.remove(o),await r.dispatch("removeContextHandler",{handlerId:o})}}}async getContextGroups(){this.wire.sendAction("interop-client-get-context-groups").catch((e=>{}));return(await i(this,e,"f")).dispatch("getContextGroups")}async joinContextGroup(t,n){this.wire.sendAction("interop-client-join-context-group").catch((e=>{}));const r=await i(this,e,"f");if(!t)throw new Error("No contextGroupId specified for joinContextGroup.");return r.dispatch("joinContextGroup",{contextGroupId:t,target:n})}async removeFromContextGroup(t){this.wire.sendAction("interop-client-remove-from-context-group").catch((e=>{}));return(await i(this,e,"f")).dispatch("removeFromContextGroup",{target:t})}async getAllClientsInContextGroup(t){this.wire.sendAction("interop-client-get-all-clients-in-context-group").catch((e=>{}));const n=await i(this,e,"f");if(!t)throw new Error("No contextGroupId specified for getAllClientsInContextGroup.");return n.dispatch("getAllClientsInContextGroup",{contextGroupId:t})}async getInfoForContextGroup(t){this.wire.sendAction("interop-client-get-info-for-context-group").catch((e=>{}));const n=await i(this,e,"f");if(!t)throw new Error("No contextGroupId specified for getInfoForContextGroup.");return n.dispatch("getInfoForContextGroup",{contextGroupId:t})}async fireIntent(t){this.wire.sendAction("interop-client-fire-intent").catch((e=>{}));return(await i(this,e,"f")).dispatch("fireIntent",t)}async registerIntentHandler(t,n,r){this.wire.sendAction("interop-client-register-intent-handler").catch((e=>{}));const o=await i(this,e,"f"),s=`intent-handler-${n}`,a=(0,h.wrapIntentHandler)(t,s);try{await o.register(s,a),await o.dispatch("intentHandlerRegistered",{handlerId:s,...r})}catch(e){throw new Error("Unable to register intent handler")}return{unsubscribe:async()=>{o.remove(s)}}}async getCurrentContext(t){this.wire.sendAction("interop-client-get-current-context").catch((e=>{}));return(await i(this,e,"f")).dispatch("getCurrentContext",{contextType:t})}async getInfoForIntent(t){this.wire.sendAction("interop-client-get-info-for-intent").catch((e=>{}));return(await i(this,e,"f")).dispatch("getInfoForIntent",t)}async getInfoForIntentsByContext(t){this.wire.sendAction("interop-client-get-info-for-intents-by-context").catch((e=>{}));return(await i(this,e,"f")).dispatch("getInfoForIntentsByContext",t)}async fireIntentForContext(t){this.wire.sendAction("interop-client-fire-intent-for-context").catch((e=>{}));return(await i(this,e,"f")).dispatch("fireIntentForContext",t)}async joinSessionContextGroup(n){try{const r=i(this,t,"f").get(n);if(r)return r.getUserInstance();const o=await i(this,e,"f"),{hasConflict:a}=await o.dispatch("sessionContextGroup:createIfNeeded",{sessionContextGroupId:n});a&&console.warn(`A (non-session) context group with the name "${n}" already exists. If you are trying to join a Context Group, call joinContextGroup instead.`);const c=new s.default(this.wire,i(this,e,"f"),n);return i(this,t,"f").set(n,c),c.getUserInstance()}catch(e){throw console.error(`Error thrown trying to create Session Context Group with id "${n}": ${e}`),e}}async onDisconnection(t){this.wire.sendAction("interop-client-add-ondisconnection-listener").catch((e=>{}));return(await i(this,e,"f")).onDisconnection((e=>{const{uuid:n}=e;t({type:"interop-broker",topic:"disconnected",brokerName:n})}))}getFDC3Sync(e){switch(e){case"1.2":return new a.Fdc3Module((()=>this),this.wire);case"2.0":return new d.Fdc3Module2((()=>this),this.wire);default:throw new Error(`Invalid FDC3 version provided: ${e}. Must be '1.2' or '2.0'`)}}async getFDC3(e){return this.getFDC3Sync(e)}static async ferryFdc3Call(t,n,r){return(await i(t,e,"f")).dispatch(n,r||null)}};return Di.InteropClient=l,e=new WeakMap,t=new WeakMap,Di}var cr,dr,hr,lr={};function ur(){if(cr)return lr;cr=1,Object.defineProperty(lr,"__esModule",{value:!0}),lr.overrideCheck=lr.checkFDC32Overrides=lr.getDefaultViewFdc3VersionFromAppInfo=void 0;const e=Hi();function t(t){return["fdc3HandleFindInstances","handleInfoForIntent","handleInfoForIntentsByContext","fdc3HandleGetAppMetadata","fdc3HandleGetInfo","fdc3HandleOpen","handleFiredIntent","handleFiredIntentForContext"].filter((n=>t[n]===e.InteropBroker.prototype[n]))}return lr.getDefaultViewFdc3VersionFromAppInfo=function({manifest:e,initialOptions:t}){const n=e?.platform?.defaultViewOptions?.fdc3InteropApi??t.defaultViewOptions?.fdc3InteropApi;return["1.2","2.0"].includes(n??"")?n:void 0},lr.checkFDC32Overrides=t,lr.overrideCheck=function(e,n){if(n&&"2.0"===n){const n=t(e);n.length>0&&console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\nThe following APIs need to be overridden:\n${n.join("\n")}`)}},lr}function pr(){return hr||(hr=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),i=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),i(function(){if(dr)return Fi;dr=1,Object.defineProperty(Fi,"__esModule",{value:!0}),Fi.InteropModule=void 0;const e=n,t=ji,i=c,r=Hi(),o=ar(),s=ur(),a=ri,d=e=>new e,h="You have attempted to use or modify InteropBroker parameters, which is not allowed. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.";class l extends i.Base{async init(n,i=d){this.wire.sendAction("interop-init").catch((()=>{}));const o=await this.wire.environment.getInteropInfo(this.wire.getFin()),c=(0,t.createUnusableObject)(h),l=(0,t.createWarningObject)(h,(0,e.cloneDeep)(o)),u=async()=>{throw new Error(h)},p=r.InteropBroker.createClosedConstructor(this.wire,(()=>this.fin.InterApplicationBus.Channel.create(`interop-broker-${n}`)),o);let w;return w=Array.isArray(i)?new((0,a.overrideFromComposables)(...i)(p))(c,u,l):await i(p,c,u,l),(0,s.overrideCheck)(w,o.fdc3Version),w}connectSync(e,t){return this.wire.sendAction("interop-connect-sync").catch((()=>{})),new o.InteropClient(this.wire,this.wire.environment.whenReady().then((()=>this.fin.InterApplicationBus.Channel.connect(`interop-broker-${e}`,{payload:t}))))}}return Fi.InteropModule=l,Fi}(),e),i(ar(),e),i(Hi(),e)}(Ri)),Ri}var wr={},yr={},fr={},gr={};Object.defineProperty(gr,"__esModule",{value:!0}),gr.getSnapshotSourceChannelName=void 0;gr.getSnapshotSourceChannelName=e=>`snapshot-source-provider-${e.uuid}`;var mr,vr,Cr,br,Ir,Er=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},xr=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(fr,"__esModule",{value:!0}),fr.SnapshotSource=void 0;const Ar=c,Pr=gr,Mr=new Map;class Or extends Ar.Base{constructor(e,t){super(e),mr.set(this,void 0),vr.set(this,(()=>(Mr.has(this.identity.uuid)||Mr.set(this.identity.uuid,{eventFired:null,clientPromise:null}),Mr.get(this.identity.uuid)))),Cr.set(this,(()=>(xr(this,vr,"f").call(this).clientPromise||(xr(this,vr,"f").call(this).clientPromise=xr(this,br,"f").call(this)),xr(this,vr,"f").call(this).clientPromise))),br.set(this,(async()=>{const e=(0,Pr.getSnapshotSourceChannelName)(this.identity);try{xr(this,vr,"f").call(this).eventFired||await xr(this,Ir,"f").call(this);const t=await this.fin.InterApplicationBus.Channel.connect(e,{wait:!1});return t.onDisconnection((()=>{xr(this,vr,"f").call(this).clientPromise=null,xr(this,vr,"f").call(this).eventFired=null})),t}catch(e){throw xr(this,vr,"f").call(this).clientPromise=null,new Error("The targeted SnapshotSource is not currently initialized. Await this object's ready() method.")}})),Ir.set(this,(async()=>{const e=(0,Pr.getSnapshotSourceChannelName)(this.identity);let t,n;const i=new Promise(((e,i)=>{t=e,n=i}));xr(this,vr,"f").call(this).eventFired=i;const r=async i=>{try{i.channelName===e&&(t(),await this.fin.InterApplicationBus.Channel.removeListener("connected",r))}catch(e){n(e)}};await this.fin.InterApplicationBus.Channel.on("connected",r)})),Er(this,mr,t,"f")}get identity(){return xr(this,mr,"f")}async ready(){this.wire.sendAction("snapshot-source-ready").catch((e=>{}));try{await xr(this,Cr,"f").call(this)}catch(e){await xr(this,vr,"f").call(this).eventFired}}async getSnapshot(){this.wire.sendAction("snapshot-source-get-snapshot").catch((e=>{}));const e=await xr(this,Cr,"f").call(this),t=await e.dispatch("get-snapshot");return(await t).snapshot}async applySnapshot(e){this.wire.sendAction("snapshot-source-apply-snapshot").catch((e=>{}));return(await xr(this,Cr,"f").call(this)).dispatch("apply-snapshot",{snapshot:e})}}fr.SnapshotSource=Or,mr=new WeakMap,vr=new WeakMap,Cr=new WeakMap,br=new WeakMap,Ir=new WeakMap,Object.defineProperty(yr,"__esModule",{value:!0}),yr.SnapshotSourceModule=void 0;const _r=c,Sr=fr,Rr=gr;class Fr extends _r.Base{async init(e){if(this.wire.sendAction("snapshot-source-init").catch((e=>{})),"object"!=typeof e||"function"!=typeof e.getSnapshot||"function"!=typeof e.applySnapshot)throw new Error("you must pass in a valid SnapshotProvider");const t=await this.fin.InterApplicationBus.Channel.create((0,Rr.getSnapshotSourceChannelName)(this.fin.me));t.register("get-snapshot",(async()=>({snapshot:await e.getSnapshot()}))),t.register("apply-snapshot",(({snapshot:t})=>e.applySnapshot(t)))}wrapSync(e){return this.wire.sendAction("snapshot-source-wrap-sync").catch((e=>{})),new Sr.SnapshotSource(this.wire,e)}async wrap(e){return this.wire.sendAction("snapshot-source-wrap").catch((e=>{})),this.wrapSync(e)}}yr.SnapshotSourceModule=Fr,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(yr,e),n(fr,e)}(wr),Object.defineProperty(s,"__esModule",{value:!0});var jr=s.Fin=void 0;const Lr=t,kr=a,Tr=Pe(),$r=Ce(),Br=Fe,Gr=En,Wr=Pn,Hr=Ln,Nr=Dn,Dr=me(),Ur=Kn,Vr=Si,zr=pr(),Kr=wr;class qr extends Lr.EventEmitter{constructor(e){super(),this.wire=e,this.System=new kr.System(e),this.Window=new Tr._WindowModule(e),this.Application=new $r.ApplicationModule(e),this.InterApplicationBus=new Br.InterApplicationBus(e),this.Clipboard=new Gr.Clipboard(e),this.ExternalApplication=new Wr.ExternalApplicationModule(e),this.Frame=new Hr._FrameModule(e),this.GlobalHotkey=new Nr.GlobalHotkey(e),this.Platform=new Ur.PlatformModule(e,this.InterApplicationBus.Channel),this.View=new Dr.ViewModule(e),this.Interop=new zr.InteropModule(e),this.SnapshotSource=new Kr.SnapshotSourceModule(e),e.registerFin(this),this.me=(0,Vr.getMe)(e),e.on("disconnected",(()=>{this.emit("disconnected")}))}}jr=s.Fin=qr;var Yr={},Jr={};function Zr(e){return"string"==typeof e.manifestUrl}function Qr(e){return eo(e)&&"string"==typeof e.address}function Xr(e){return Qr(e)&&"string"==typeof e.token}function eo(e){return"string"==typeof e.uuid}function to(e){return e.runtime&&"string"==typeof e.runtime.version}function no(e){return eo(e)&&to(e)}Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.isInternalConnectConfig=Jr.isPortDiscoveryConfig=Jr.isNewConnectConfig=Jr.isConfigWithReceiver=Jr.isRemoteConfig=Jr.isExistingConnectConfig=Jr.isExternalConfig=void 0,Jr.isExternalConfig=Zr,Jr.isExistingConnectConfig=Qr,Jr.isRemoteConfig=Xr,Jr.isConfigWithReceiver=function(e){return"object"==typeof e.receiver&&Xr({...e,address:""})},Jr.isNewConnectConfig=no,Jr.isPortDiscoveryConfig=function(e){return Zr(e)&&to(e)||no(e)},Jr.isInternalConnectConfig=function(e){return Qr(e)||no(e)};var io={},ro={};Object.defineProperty(ro,"__esModule",{value:!0}),ro.EmitterMap=void 0;const oo=t;function so(e){return Buffer.from(e).toString("base64")}ro.EmitterMap=class{constructor(){this.storage=new Map}hashKeys(e){return e.map(so).join("/")}getOrCreate(e){const t=this.hashKeys(e);return this.storage.has(t)||this.storage.set(t,new oo.EventEmitter),this.storage.get(t)}has(e){return this.storage.has(this.hashKeys(e))}delete(e){const t=this.hashKeys(e);return this.storage.delete(t)}},Object.defineProperty(io,"__esModule",{value:!0});const ao=ro;class co extends ao.EmitterMap{constructor(){super(...arguments),this.dispatchEvent=e=>{if(function(e){return"process-desktop-event"===e.action}(e)){const{payload:t}=e,n=function(e){const{topic:t}=e;if("frame"===t||"window"===t||"view"===t){const{uuid:n,name:i}=e;return[t,n,i]}if("application"===t){const{uuid:n}=e;return[t,n]}return[t]}(t);if(this.has(n))return this.getOrCreate(n).emit(t.type,t),!0}return!1}}}io.default=co;var ho,lo,uo=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},po=o&&o.__classPrivateFieldGet||function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Yr,"__esModule",{value:!0});var wo=Yr.Transport=void 0;const yo=t,fo=Jr,go=f,mo=io,vo=Si,Co=it;class bo extends yo.EventEmitter{constructor(e,t,n){super(),this.wireListeners=new Map,this.topicRefMap=new Map,this.eventAggregator=new mo.default,this.messageHandlers=[this.eventAggregator.dispatchEvent],ho.set(this,void 0),lo.set(this,void 0),this.connectSync=()=>{po(this,ho,"f").connectSync()},this.getPort=()=>po(this,ho,"f").getPort(),uo(this,ho,new e(this.onmessage.bind(this)),"f"),this.environment=t,this.sendRaw=po(this,ho,"f").send.bind(po(this,ho,"f")),this.registerMessageHandler(this.handleMessage.bind(this)),po(this,ho,"f").on("disconnected",(()=>{for(const[,{handleNack:e}]of this.wireListeners)e({reason:"Remote connection has closed"});this.wireListeners.clear(),this.emit("disconnected")}));const{uuid:i,name:r}=n,o=this.environment.getCurrentEntityType();this.me=(0,vo.getBaseMe)(o,i,r)}getFin(){if(!po(this,lo,"f"))throw new Error("No Fin object registered for this transport");return po(this,lo,"f")}registerFin(e){if(po(this,lo,"f"))throw new Error("Fin object has already been registered for this transport");uo(this,lo,e,"f")}shutdown(){return po(this,ho,"f").shutdown()}async connect(e){if((0,fo.isConfigWithReceiver)(e))return await po(this,ho,"f").connect(e.receiver),this.authorize(e);if((0,fo.isRemoteConfig)(e))return this.connectRemote(e);if((0,fo.isExistingConnectConfig)(e))return this.connectByPort(e);if((0,fo.isNewConnectConfig)(e)){const t=await this.environment.retrievePort(e);return this.connectByPort({...e,address:`ws://localhost:${t}`})}}async connectRemote(e){return await po(this,ho,"f").connect(new(this.environment.getWsConstructor())(e.address)),this.authorize(e)}async connectByPort(e){const{address:t,uuid:n}=e,i={...e,type:"file-token"},r=po(this,ho,"f");await r.connect(new(this.environment.getWsConstructor())(e.address));const o=await this.sendAction("request-external-authorization",{uuid:n,type:"file-token"},!0);if("external-authorization-response"!==o.action)throw new go.UnexpectedActionError(o.action);return await this.environment.writeToken(o.payload.file,o.payload.token),this.authorize(i)}async authorize(e){const t=await this.sendAction("request-authorization",e,!0);if("authorization-response"!==t.action)throw new go.UnexpectedActionError(t.action);if(!0!==t.payload.success)throw new go.RuntimeError(t.payload)}sendAction(e,t={},n=!1){let i=()=>{};const r=go.RuntimeError.getCallSite(1),o=this.environment.getNextMessageId(),s=new Promise(((s,a)=>{i=a;const c={action:e,payload:t,messageId:o},d=po(this,ho,"f");return this.addWireListener(o,s,(e=>this.nackHandler(e,a,r)),n),d.send(c).catch(a)}));return Object.assign(s,{cancel:i,messageId:o})}nackHandler(e,t,n){t("string"==typeof e?e:new go.RuntimeError(e,n))}ferryAction(e){return new Promise(((t,n)=>{const i=this.environment.getNextMessageId();e.messageId=i;const r=e=>{t(e.payload)};return po(this,ho,"f").send(e).then((()=>this.addWireListener(i,r,(e=>this.nackHandler(e,n)),!1))).catch(n)}))}registerMessageHandler(e){this.messageHandlers.push(e)}addWireListener(e,t,n,i){i?this.uncorrelatedListener=t:this.wireListeners.has(e)?n({reason:"Duplicate handler id",error:(0,Co.errorToPOJO)(new go.DuplicateCorrelationError(String(e)))}):this.wireListeners.set(e,{resolve:t,handleNack:n})}onmessage(e){for(const t of this.messageHandlers)t.call(null,e)}handleMessage(e){const t=e.correlationId||NaN;if("correlationId"in e){if(!this.wireListeners.has(t))return!1;{const{resolve:n,handleNack:i}=this.wireListeners.get(t);"ack"!==e.action?i({reason:"Did not receive ack action",error:(0,Co.errorToPOJO)(new go.NoAckError(e.action))}):"payload"in e?e.payload.success?n.call(null,e):i(e.payload):"string"==typeof e.reason?i(e):(console.warn("Received invalid response from core",e),i({reason:"invalid response shape"})),this.wireListeners.delete(t)}}else this.uncorrelatedListener&&this.uncorrelatedListener.call(null,e),this.uncorrelatedListener=()=>{};return!0}}wo=Yr.Transport=bo,ho=new WeakMap,lo=new WeakMap;const Io=(...e)=>({log:(...t)=>console.log(`[${(new Date).toISOString()}]`,...(e=>e.map((e=>`[${e}]`)))(e),...t),getLogger:(...t)=>Io(...e,...t)}),Eo=Io("[@openfin/core-web/client");function xo(e,t){if(!function(e){return"string"==typeof e}(e))throw new Error(`Property ${t} has invalid type. Expected string, got ${typeof e}.`)}const Ao="web-broker-ports-ready",Po=Eo.getLogger("get-web-interop-ports");function Mo(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)}function Oo(e,t,n,i,r){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?r.call(e,n):r?r.value=n:t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;const _o=e=>{var n,i,r;return r=class extends t.EventEmitter{constructor(t){super(),n.set(this,void 0),i.set(this,!1),this.connectSync=()=>{Mo(this,i,"f")||(e.addEventListener("message",(e=>{e.data?.topic?.startsWith("wire-message")&&e.data.message&&Mo(this,n,"f").call(this,{...JSON.parse(e.data.message),ports:e.ports})})),e.start())},this.connect=async()=>{this.connectSync()},this.send=t=>(e.postMessage({topic:"wire-message",message:JSON.stringify(t)}),Promise.resolve()),this.shutdown=async()=>{e.close()},Oo(this,n,t,"f")}getPort(){return e}},n=new WeakMap,i=new WeakMap,r};var So={},Ro={};Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.BaseEnvironment=void 0;const Fo=ur();Ro.BaseEnvironment=class{async getInteropInfo(e){const t=await e.Application.getCurrentSync().getInfo().catch((()=>null)),n=t?.initialOptions?.interopBrokerConfiguration??{};return{fdc3Version:t?(0,Fo.getDefaultViewFdc3VersionFromAppInfo)(t):void 0,...n,fdc3Info:{providerVersion:await e.System.getVersion(),provider:"OpenFin"}}}},Object.defineProperty(So,"__esModule",{value:!0});var jo=So.BrowserEnvironment=void 0;const Lo=Ro;class ko extends Lo.BaseEnvironment{constructor(){super(...arguments),this.type="other",this.getRandomId=()=>{const e=new Uint32Array(1);return window.crypto.getRandomValues(e)[0].toString(32)}}getAdapterVersionSync(){return""}observeBounds(e,t){throw new Error("Method not implemented.")}layoutAllowedInContext(e){return!1}initLayoutManager(e,t,n){throw new Error("Method not implemented.")}applyLayoutSnapshot(e,t,n){throw new Error("Method not implemented.")}createLayout(e,t){throw new Error("Method not implemented.")}destroyLayout(e,t){throw new Error("Method not implemented.")}resolveLayout(e,t){throw new Error("Method not implemented.")}initPlatform(...e){throw new Error("Method not implemented.")}writeToken(e,t){return Promise.resolve("")}retrievePort(e){throw new Error("Method not implemented.")}getNextMessageId(){return this.getRandomId()}createChildContent(e){throw new Error("Method not implemented.")}getWebWindow(e){throw new Error("Method not implemented.")}getCurrentEntityIdentity(){throw new Error("Method not implemented.")}getCurrentEntityType(){return"external connection"}raiseEvent(e,t){throw new Error("Method not implemented.")}getUrl(){return location.href}getDefaultChannelOptions(){return{create:{},connect:{}}}getRtcPeer(){return new RTCPeerConnection}getWsConstructor(){return WebSocket}whenReady(){return Promise.resolve()}}jo=So.BrowserEnvironment=ko;const To=e=>"platform"in e&&void 0!==e.platform;var $o,Bo;class Go extends jo{constructor(e){super(),this.connectConfig=e,$o.set(this,void 0),Bo.set(this,new G((async()=>Promise.resolve().then((function(){return __webpack_require__(/*! ./main-8d24addc.js */ "./node_modules/@openfin/core-web/out/main-8d24addc.js")}))))),To(e)&&this.validatePlatformOptions(e)}getAdapterVersionSync(){return"0.38.63"}validatePlatformOptions({platform:e}){if(!("layoutSnapshot"in e))throw new Error("Platform options are missing layoutSnapshot. Please provide a layoutSnapshot in the platform options.");if("windows"in e||"windows"in e.layoutSnapshot)throw new Error("It appears you tried to call connect() with a snapshot object from an OpenFin desktop environment. Note that connect() expects to be called with a platform property with this structure: { platform: { layoutSnapshot } }. To get a layoutSnapshot of the expected structure, use fin.Platform.Layout.getCurrentLayoutManagerSync().getLayoutSnapshot() in v34+ in your desktop environment.");const{layouts:t}=e.layoutSnapshot;Object.entries(t).map((([e,t])=>{if("object"!=typeof t||null===t)throw new Error(`Invalid layout detected: layoutSnapshot.layouts.${e} must be an object.`);if(!("content"in t))throw new Error(`Invalid layout detected: layoutSnapshot.layouts.${e} must contain a 'content' property.`)}))}async getInteropInfo(e){return{...{contextGroups:void 0,logging:{beforeAction:{enabled:!1},afterAction:{enabled:!1}}},fdc3Version:void 0,fdc3Info:{providerVersion:"0.38.63",provider:"OpenFin Web"}}}layoutAllowedInContext(e){return!0}async initLayoutManager(e,t,n){if(Mo(this,$o,"f"))throw new Error("Layout already initialized.");if(!To(this.connectConfig))throw new Error("Platform options are missing from connection config.");const{WebLayoutEntryPoint:i}=await Mo(this,Bo,"f").getValue();return Oo(this,$o,new i(this.connectConfig),"f"),await Mo(this,$o,"f").initLayoutManager(e,t,n)}async applyLayoutSnapshot(e,t,n){Mo(this,$o,"f")?.applyLayoutSnapshot(e,t,n)}async createLayout(e,t){return Mo(this,$o,"f")?.createLayout(e,t)}async destroyLayout(e,t){return Mo(this,$o,"f")?.destroyLayout(e,t)}}$o=new WeakMap,Bo=new WeakMap;const Wo=()=>{const e=((e,t)=>{const n=new RegExp(`^${t}<(?.*)>$`).exec(e)?.groups?.meta;if(n)try{return JSON.parse(atob(n))}catch(e){throw new Error(`Failed to decode JSON from ${n}.`)}})(window.name,"of-frame");if(e)try{const{name:t,uuid:n,brokerUrl:i,providerId:r,contextGroup:o}=e;return xo(i,"brokerUrl"),xo(n,"uuid"),xo(t,"name"),{identity:{name:t,uuid:n},brokerUrl:i,interopConfig:{providerId:r,currentContextGroup:o}}}catch(e){throw new Error(`Unexpected error occurred when inferring platform information: ${e.stack}`)}},Ho=()=>{const e=i.v4();return{uuid:e,name:e}},No=async e=>{if("enabled"===e.connectionInheritance){const t=await(async e=>{const t=Wo();if(t){const{validateOptions:n=(()=>!0)}=e,{identity:i,...r}=t;if(!await n(r))throw new Error("Parent options were rejected by validateOptions.");return t}})(e);if(t)return t}if(!e.options){const t="enabled"===e.connectionInheritance?"Broker URL was not specified nor provided by a platform container.":"Connection inheritance is disabled but no options were provided.";throw new Error(t)}return{...e.options,identity:Ho()}};exports.__classPrivateFieldGet=Mo,exports.__classPrivateFieldSet=Oo,exports.commonjsGlobal=o,exports.connect=async t=>{try{Eo.log("Establishing connection",t);const{brokerUrl:n,identity:i,timeout:o,interopConfig:s}=await No(t),{workerPort:a,iframeBrokerPort:c}=await(async(e,t,n)=>{const{origin:i}=new URL(e),o=document.createElement("IFRAME");let s;o.style.display="none";try{return await new Promise(((a,c)=>{const d=e=>{if(e.source===o.contentWindow&&e.data?.topic===`ack-${Ao}`){if(e.origin!==i)c(new Error(`Broker redirected to unexpected origin ${e.origin}, expected ${i}.`));else if(e.data.success){const[t,n]=e.ports;a({iframeBrokerPort:t,workerPort:n})}else c(new g(e.data));window.removeEventListener("message",d),clearTimeout(s)}};window.addEventListener("message",d),Po.log(`Connecting to broker ${e}`),o.setAttribute("src",e),o.setAttribute("name",r(t,"of-broker")),document.body.appendChild(o),Po.log("Iframe loaded, awaiting init message from iframe"),n&&(s=setTimeout((()=>{window.removeEventListener("message",d),document.body.removeChild(o),c(new Error("Worker did not initialize in time"))}),n))}))}catch(e){throw new Error(`Failed to initialise Fin Web Client. ${e.message}`,{cause:e})}})(n,i,o);Eo.log("Successfully established connection to shared worker");const d={entityType:"external connection",...i};a.start(),c.start();const h=((t,n,i)=>{const r=_o(n),o=new Go(t),s=new wo(r,o,i);return s.connectSync(),window.Buffer=e.Buffer,new jr(s)})(t,a,d);return s?.providerId&&(h.me.interop=h.Interop.connectSync(s.providerId),s?.currentContextGroup&&h.me.interop.joinContextGroup(s.currentContextGroup).catch((e=>{console.warn(`Error joining specified context group: ${s?.currentContextGroup}, continuing`,e)}))),{...h,me:{...h.me,identity:{uuid:h.me.uuid,name:h.me.name}}}}catch(e){throw new Error(`An error occured during web-interop connection: ${e.message}`)}},exports.encodeOptions=r; /***/ }), @@ -29922,7 +29922,7 @@ var __WEBPACK_AMD_DEFINE_RESULT__;/** Object.defineProperty(exports, "__esModule", ({ value: true })); exports.init = void 0; -const core_web_1 = __webpack_require__(/*! @openfin/core-web */ "../../node_modules/@openfin/core-web/out/api-client.js"); +const core_web_1 = __webpack_require__(/*! @openfin/core-web */ "./node_modules/@openfin/core-web/out/api-client.js"); const settings_1 = __webpack_require__(/*! ./settings */ "./client/src/platform/settings.ts"); /** * Initializes the OpenFin Web Broker connection. diff --git a/dev/joe/add-remove-layouts/web-layout/js/fdc3-panel.bundle.js.map b/dev/joe/add-remove-layouts/web-layout/js/fdc3-panel.bundle.js.map index d453a23..0fd64ca 100644 --- a/dev/joe/add-remove-layouts/web-layout/js/fdc3-panel.bundle.js.map +++ b/dev/joe/add-remove-layouts/web-layout/js/fdc3-panel.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"fdc3-panel.bundle.js","mappings":";;;;;;;;;;AAAa,MAAM,mBAAO,CAAC,qFAAoB,EAAE,mBAAO,CAAC,mDAAS,EAAE,mBAAO,CAAC,+DAAM,EAAE,mBAAO,CAAC,mDAAQ,EAAE,mBAAO,CAAC,mDAAQ,EAAE,eAAe;;;;;;;;;;;;ACA1H,MAAM,mBAAO,CAAC,mDAAS,IAAI,mBAAO,CAAC,mDAAQ,IAAI,mBAAO,CAAC,mDAAQ,IAAI,mBAAO,CAAC,+DAAM,EAAE,kBAAkB,EAAE,GAAG,wBAAwB,GAAG,sGAAsG,qBAAM,CAAC,qBAAM,iCAAiC,KAAK,KAAK,KAAK,MAAM,oBAAoB,WAAW,kBAAkB,kBAAkB,UAAU,SAAS,sCAAsC,SAAS,sFAAsF,mCAAmC,6BAA6B,GAAG,kCAAkC,6BAA6B,mDAAmD,0CAA0C,yDAAyD,iEAAiE,oFAAoF,2IAA2I,mDAAmD,kDAAkD,oFAAoF,4IAA4I,sDAAsD,sCAAsC,SAAS,sCAAsC,UAAU,QAAQ,eAAe,mNAAmN,UAAU,0BAA0B,SAAS,qBAAqB,SAAS,8BAA8B,sBAAsB,yiBAAyiB,QAAQ,SAAS,2EAA2E,6BAA6B,KAAK,IAAI,2DAA2D,SAAS,uDAAuD,0CAA0C,IAAI,sBAAsB,SAAS,4EAA4E,+EAA+E,iCAAiC,yBAAyB,sGAAsG,gBAAgB,iDAAiD,UAAU,OAAO,sBAAsB,QAAQ,yBAAyB,sBAAsB,kBAAkB,4CAA4C,iDAAiD,wBAAwB,OAAO,4CAA4C,QAAQ,6BAA6B,iDAAiD,uBAAuB,OAAO,sBAAsB,QAAQ,iCAAiC,4CAA4C,iDAAiD,uCAAuC,OAAO,4CAA4C,QAAQ,4BAA4B,gDAAgD,gFAAgF,gCAAgC,SAAS,0CAA0C,sBAAsB,iEAAiE,YAAY,IAAI,qFAAqF,+BAA+B,4BAA4B,kBAAkB,6CAA6C,uEAAuE,gBAAgB,2BAA2B,+CAA+C,2BAA2B,YAAY,oCAAoC,4EAA4E,eAAe,gBAAgB,SAAS,sCAAsC,SAAS,EAAE,2JAA2J,sBAAsB,eAAe,iDAAiD,EAAE,sBAAsB,sBAAsB,uBAAuB,0BAA0B,uBAAuB,8BAA8B,uBAAuB,eAAe,uBAAuB,wBAAwB,uBAAuB,sBAAsB,sBAAsB,eAAe,MAAM,8BAA8B,GAAG,wFAAwF,aAAa,IAAI,sBAAsB,wBAAwB,oCAAoC,0BAA0B,gCAAgC,iCAAiC,wCAAwC,2DAA2D,8BAA8B,kFAAkF,SAAS,2BAA2B,cAAc,EAAE,gCAAgC,aAAa,EAAE,SAAS,iBAAiB,MAAM,iBAAiB,GAAG,+GAA+G,mBAAmB,QAAQ,KAAK,MAAM,sCAAsC,SAAS,2DAA2D,MAAM,wFAAwF,QAAQ,KAAK,KAAK,KAAK,KAAK,KAAK,MAAM,sCAAsC,SAAS,oCAAoC,MAAM,+BAA+B,ySAAyS,QAAQ,MAAM,sCAAsC,SAAS,uCAAuC,mBAAmB,eAAe,kBAAkB,WAAW,+DAA+D,2BAA2B,eAAe,kBAAkB,iBAAiB,gEAAgE,4BAA4B,mBAAmB,QAAQ,KAAK,MAAM,sCAAsC,SAAS,uBAAuB,oBAAoB,eAAe,oGAAoG,+CAA+C,KAAK,IAAI,QAAQ,MAAM,sCAAsC,SAAS,yCAAyC,oCAAoC,mDAAmD,sBAAsB,yBAAyB,6BAA6B,EAAE,uCAAuC,SAAS,sBAAsB,UAAU,mBAAmB,eAAe,iDAAiD,wEAAwE,gBAAgB,KAAK,+DAA+D,uBAAuB,EAAE,KAAK,uCAAuC,QAAQ,KAAK,MAAM,sCAAsC,SAAS,4BAA4B,yBAAyB,eAAe,kDAAkD,MAAM,KAAK,IAAI,QAAQ,yCAAyC,EAAE,GAAG,SAAS,iCAAiC,MAAM,SAAS,WAAW,gCAAgC,OAAO,KAAK,SAAS,sCAAsC,SAAS,2BAA2B,wBAAwB,eAAe,gEAAgE,MAAM,uBAAuB,IAAI,KAAK,QAAQ,EAAE,GAAG,aAAa,EAAE,6DAA6D,OAAO,cAAc,UAAU,wBAAwB,KAAK,MAAM,oBAAoB,EAAE,EAAE,qDAAqD,QAAQ,MAAM,aAAa,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,gBAAgB,gBAAgB,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,SAAS,gBAAgB,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,8BAA8B,IAAI,SAAS,sCAAsC,SAAS,yDAAyD,2JAA2J,qCAAqC,oBAAoB,EAAE,KAAK,4BAA4B,gDAAgD,gDAAgD,IAAI,iCAAiC,EAAE,GAAG,4BAA4B,EAAE,SAAS,gEAAgE,QAAQ,OAAO,gEAAgE,iEAAiE,oFAAoF,2IAA2I,mDAAmD,mDAAmD,oFAAoF,4IAA4I,sDAAsD,sCAAsC,SAAS,+CAA+C,gBAAgB,SAAS,iBAAiB,sJAAsJ,sDAAsD,2CAA2C,uCAAuC,oEAAoE,qBAAqB,wBAAwB,iBAAiB,0EAA0E,8BAA8B,yBAAyB,iCAAiC,qDAAqD,wEAAwE,qKAAqK,mDAAmD,WAAW,YAAY,KAAK,EAAE,sBAAsB,MAAM,kBAAkB,GAAG,UAAU,4CAA4C,+BAA+B,oEAAoE,kBAAkB,MAAM,oBAAoB,iBAAiB,wIAAwI,QAAQ,+EAA+E,2DAA2D,8BAA8B,0DAA0D,oBAAoB,6BAA6B,oBAAoB,mBAAmB,mLAAmL,gCAAgC,UAAU,uCAAuC,SAAS,qIAAqI,UAAU,uCAAuC,SAAS,wBAAwB,WAAW,gCAAgC,mBAAmB,2DAA2D,eAAe,4CAA4C,2BAA2B,UAAU,UAAU,YAAY,qBAAqB,4DAA4D,wBAAwB,UAAU,UAAU,YAAY,eAAe,oEAAoE,UAAU,YAAY,gBAAgB,8CAA8C,yBAAyB,cAAc,GAAG,YAAY,+CAA+C,uBAAuB,cAAc,GAAG,eAAe,oDAAoD,iBAAiB,cAAc,GAAG,wBAAwB,sDAAsD,iBAAiB,EAAE,iBAAiB,sDAAsD,iBAAiB,cAAc,GAAG,aAAa,6CAA6C,+BAA+B,cAAc,GAAG,UAAU,EAAE,qCAAqC,2BAA2B,cAAc,GAAG,gBAAgB,4CAA4C,wCAAwC,UAAU,UAAU,YAAY,kBAAkB,iDAAiD,0BAA0B,cAAc,GAAG,cAAc,4CAA4C,iBAAiB,UAAU,UAAU,YAAY,aAAa,mBAAmB,EAAE,oBAAoB,EAAE,2CAA2C,oCAAoC,EAAE,2BAA2B,iEAAiE,uBAAuB,MAAM,SAAS,QAAQ,8DAA8D,SAAS,yBAAyB,wEAAwE,UAAU,YAAY,4BAA4B,oDAAoD,iBAAiB,EAAE,iCAAiC,0DAA0D,4BAA4B,EAAE,6BAA6B,qDAAqD,iBAAiB,EAAE,yBAAyB,2BAA2B,gBAAgB,gDAAgD,oBAAoB,eAAe,YAAY,IAAI,IAAI,kCAAkC,6BAA6B,EAAE,wBAAwB,SAAS,uEAAuE,EAAE,KAAK,iCAAiC,MAAM,UAAU,uDAAuD,SAAS,6EAA6E,kBAAkB,GAAG,MAAM,sBAAsB,GAAG,kDAAkD,qBAAqB,kBAAkB,2BAA2B,MAAM,8BAA8B,MAAM,UAAU,cAAc,WAAW,uBAAuB,MAAM,aAAa,6CAA6C,oEAAoE,MAAM,UAAU,iDAAiD,2BAA2B,EAAE,eAAe,mBAAmB,cAAc,6BAA6B,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,eAAe,cAAc,0CAA0C,SAAS,sBAAsB,yBAAyB,uBAAuB,gBAAgB,MAAM,OAAO,cAAc,6HAA6H,yHAAyH,2BAA2B,aAAa,4CAA4C,YAAY,iBAAiB,mBAAmB,EAAE,cAAc,kCAAkC,kCAAkC,wBAAwB,+BAA+B,YAAY,mDAAmD,GAAG,kCAAkC,wBAAwB,+BAA+B,aAAa,wDAAwD,yEAAyE,MAAM,cAAc,cAAc,kBAAkB,cAAc,EAAE,iBAAiB,6DAA6D,yEAAyE,MAAM,cAAc,cAAc,sBAAsB,cAAc,GAAG,wBAAwB,mBAAmB,eAAe,KAAK,uDAAuD,oFAAoF,4IAA4I,sDAAsD,sCAAsC,SAAS,gBAAgB,mCAAmC,8BAA8B,iBAAiB,4IAA4I,0CAA0C,0BAA0B,EAAE,wBAAwB,2CAA2C,iBAAiB,EAAE,qBAAqB,wCAAwC,iBAAiB,EAAE,uBAAuB,2CAA2C,0BAA0B,EAAE,qBAAqB,wCAAwC,iBAAiB,EAAE,0BAA0B,8CAA8C,0BAA0B,EAAE,wEAAwE,iBAAiB,mFAAmF,iBAAiB,+CAA+C,+CAA+C,iBAAiB,eAAe,GAAG,sCAAsC,IAAI,kLAAkL,wCAAwC,SAAS,wIAAwI,kDAAkD,mEAAmE,iBAAiB,UAAU,UAAU,oFAAoF,2BAA2B,cAAc,mCAAmC,MAAM,SAAS,QAAQ,+CAA+C,iBAAiB,EAAE,kCAAkC,gCAAgC,4DAA4D,GAAG,IAAI,iMAAiM,mCAAmC,SAAS,0BAA0B,uDAAuD,GAAG,wFAAwF,iBAAiB,6CAA6C,4CAA4C,4EAA4E,aAAa,mBAAmB,EAAE,oBAAoB,EAAE,sCAAsC,sDAAsD,mBAAmB,GAAG,gCAAgC,MAAM,OAAO,cAAc,eAAe,2CAA2C,SAAS,uBAAuB,wBAAwB,8BAA8B,iBAAiB,mFAAmF,gDAAgD,EAAE,8BAA8B,WAAW,sBAAsB,gCAAgC,wBAAwB,GAAG,KAAK,YAAY,4EAA4E,UAAU,YAAY,iBAAiB,IAAI,uEAAuE,yBAAyB,EAAE,SAAS,4HAA4H,mBAAmB,IAAI,gDAAgD,yBAAyB,EAAE,SAAS,gEAAgE,YAAY,4KAA4K,kBAAkB,kBAAkB,uEAAuE,UAAU,IAAI,WAAW,2BAA2B,QAAQ,+BAA+B,EAAE,sCAAsC,GAAG,cAAc,8EAA8E,UAAU,YAAY,gBAAgB,4EAA4E,UAAU,YAAY,eAAe,mEAAmE,UAAU,YAAY,iBAAiB,MAAM,UAAU,mEAAmE,gDAAgD,eAAe,gFAAgF,UAAU,YAAY,YAAY,gFAAgF,gCAAgC,kBAAkB,6CAA6C,sCAAsC,cAAc,GAAG,iBAAiB,0EAA0E,GAAG,UAAU,6EAA6E,GAAG,MAAM,6KAA6K,eAAe,SAAS,EAAE,+CAA+C,sDAAsD,cAAc,GAAG,kBAAkB,2EAA2E,GAAG,2BAA2B,MAAM,UAAU,kEAAkE,cAAc,qBAAqB,4CAA4C,0BAA0B,EAAE,eAAe,6CAA6C,+BAA+B,cAAc,GAAG,gBAAgB,6CAA6C,wBAAwB,cAAc,GAAG,gCAAgC,sDAAsD,wBAAwB,EAAE,gBAAgB,0DAA0D,yBAAyB,cAAc,GAAG,2BAA2B,mDAAmD,wBAAwB,EAAE,kBAAkB,wEAAwE,UAAU,YAAY,cAAc,mEAAmE,UAAU,YAAY,YAAY,+EAA+E,GAAG,OAAO,mFAAmF,GAAG,UAAU,8DAA8D,UAAU,YAAY,uBAAuB,MAAM,SAAS,QAAQ,0EAA0E,SAAS,iCAAiC,MAAM,OAAO,iBAAiB,gCAAgC,yDAAyD,wBAAwB,EAAE,gCAAgC,MAAM,SAAS,QAAQ,wEAAwE,SAAS,+BAA+B,MAAM,OAAO,iBAAiB,+BAA+B,EAAE,UAAU,yDAAyD,eAAe,EAAE,cAAc,+BAA+B,MAAM,OAAO,iBAAiB,gCAAgC,yDAAyD,KAAK,GAAG,yBAAyB,cAAc,6BAA6B,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,eAAe,eAAe,2CAA2C,SAAS,6BAA6B,qBAAqB,uBAAuB,cAAc,qDAAqD,GAAG,kCAAkC,wBAAwB,sCAAsC,YAAY,0DAA0D,GAAG,kCAAkC,wBAAwB,sCAAsC,iBAAiB,8LAA8L,YAAY,EAAE,UAAU,0KAA0K,mBAAmB,eAAe,sDAAsD,GAAG,8BAA8B,qDAAqD,YAAY,IAAI,8BAA8B,gDAAgD,sBAAsB,cAAc,GAAG,aAAa,mEAAmE,cAAc,uBAAuB,EAAE,iBAAiB,wEAAwE,kBAAkB,uBAAuB,EAAE,6BAA6B,oEAAoE,GAAG,0CAA0C,yBAAyB,sBAAsB,gNAAgN,+BAA+B,uBAAuB,wDAAwD,cAAc,UAAU,UAAU,IAAI,qEAAqE,kBAAkB,OAAO,EAAE,oCAAoC,+BAA+B,gBAAgB,OAAO,kBAAkB,UAAU,uCAAuC,SAAS,kCAAkC,aAAa,cAAc,eAAe,2CAA2C,SAAS,mBAAmB,kCAAkC,8BAA8B,iBAAiB,oBAAoB,sBAAsB,uEAAuE,GAAG,2EAA2E,0HAA0H,kDAAkD,8BAA8B,0CAA0C,MAAM,MAAM,UAAU,aAAa,UAAU,GAAG,KAAK,8DAA8D,EAAE,qEAAqE,SAAS,iCAAiC,IAAI,4DAA4D,UAAU,wCAAwC,eAAe,oEAAoE,UAAU,YAAY,YAAY,uEAAuE,UAAU,YAAY,SAAS,uEAAuE,GAAG,OAAO,qEAAqE,GAAG,eAAe,+EAA+E,GAAG,aAAa,8CAA8C,yCAAyC,cAAc,GAAG,OAAO,qEAAqE,GAAG,YAAY,4CAA4C,yBAAyB,aAAa,iCAAiC,GAAG,2BAA2B,iFAAiF,GAAG,cAAc,0EAA0E,UAAU,YAAY,wBAAwB,MAAM,UAAU,8DAA8D,gDAAgD,eAAe,6CAA6C,0GAA0G,GAAG,sBAAsB,8EAA8E,GAAG,cAAc,6CAA6C,wGAAwG,GAAG,qBAAqB,6EAA6E,GAAG,QAAQ,sEAAsE,GAAG,eAAe,2EAA2E,GAAG,UAAU,qEAAqE,UAAU,YAAY,mBAAmB,oEAAoE,GAAG,gCAAgC,iFAAiF,uDAAuD,aAAa,wEAAwE,UAAU,YAAY,uBAAuB,uFAAuF,+DAA+D,kBAAkB,kFAAkF,wFAAwF,qBAAqB,SAAS,yBAAyB,sFAAsF,yEAAyE,WAAW,sEAAsE,UAAU,YAAY,eAAe,+EAA+E,qDAAqD,eAAe,+EAA+E,+BAA+B,YAAY,uEAAuE,UAAU,YAAY,WAAW,yEAAyE,GAAG,WAAW,yEAAyE,GAAG,cAAc,8CAA8C,6DAA6D,cAAc,GAAG,cAAc,2CAA2C,mDAAmD,cAAc,GAAG,kBAAkB,gDAAgD,kGAAkG,cAAc,GAAG,kBAAkB,6CAA6C,wFAAwF,cAAc,GAAG,UAAU,wEAAwE,GAAG,kBAAkB,+EAA+E,GAAG,eAAe,iDAAiD,2CAA2C,cAAc,GAAG,WAAW,2CAA2C,yBAAyB,cAAc,GAAG,iBAAiB,8CAA8C,8DAA8D,cAAc,GAAG,iBAAiB,qDAAqD,2BAA2B,cAAc,GAAG,kBAAkB,mDAAmD,uCAAuC,cAAc,GAAG,uBAAuB,MAAM,UAAU,+CAA+C,2BAA2B,EAAE,cAAc,uBAAuB,gDAAgD,iBAAiB,cAAc,GAAG,6BAA6B,+EAA+E,uDAAuD,wBAAwB,EAAE,eAAe,eAAe,EAAE,kBAAkB,6CAA6C,2FAA2F,GAAG,uDAAuD,2BAA2B,cAAc,GAAG,iBAAiB,qBAAqB,cAAc,6BAA6B,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,eAAe,eAAe,2CAA2C,SAAS,yBAAyB,qBAAqB,uBAAuB,cAAc,gDAAgD,GAAG,kCAAkC,wBAAwB,kCAAkC,YAAY,qDAAqD,GAAG,kCAAkC,wBAAwB,kCAAkC,UAAU,yDAAyD,4BAA4B,8BAA8B,kBAAkB,aAAa,0DAA0D,6EAA6E,MAAM,cAAc,cAAc,kBAAkB,cAAc,EAAE,iBAAiB,+DAA+D,6EAA6E,MAAM,cAAc,cAAc,sBAAsB,cAAc,GAAG,2BAA2B,gBAAgB,OAAO,mDAAmD,UAAU,6BAA6B,QAAQ,SAAS,8BAA8B,kGAAkG,wCAAwC,IAAI,gBAAgB,uCAAuC,SAAS,kBAAkB,6BAA6B,gCAAgC,eAAe,kBAAkB,gCAAgC,4BAA4B,kCAAkC,YAAY,sCAAsC,cAAc,GAAG,6DAA6D,0DAA0D,gJAAgJ,UAAU,IAAI,6EAA6E,cAAc,8BAA8B,GAAG,GAAG,aAAa,mDAAmD,UAAU,YAAY,cAAc,yDAAyD,GAAG,oBAAoB,gEAAgE,GAAG,OAAO,wDAAwD,GAAG,uBAAuB,MAAM,SAAS,QAAQ,8CAA8C,cAAc,EAAE,SAAS,mBAAmB,8DAA8D,GAAG,gBAAgB,uDAAuD,UAAU,YAAY,qBAAqB,4DAA4D,UAAU,YAAY,0BAA0B,kEAAkE,UAAU,YAAY,8BAA8B,MAAM,SAAS,MAAM,+BAA+B,wDAAwD,sGAAsG,gDAAgD,4BAA4B,aAAa,wDAAwD,EAAE,SAAS,MAAM,+BAA+B,sDAAsD,OAAO,gDAAgD,kBAAkB,0DAA0D,UAAU,YAAY,mBAAmB,+CAA+C,cAAc,UAAU,UAAU,YAAY,0BAA0B,wDAAwD,uBAAuB,UAAU,UAAU,YAAY,mBAAmB,0DAA0D,UAAU,YAAY,wBAAwB,MAAM,SAAS,MAAM,kBAAkB,gDAAgD,cAAc,EAAE,SAAS,uBAAuB,8DAA8D,UAAU,qBAAqB,yBAAyB,MAAM,SAAS,MAAM,kBAAkB,kDAAkD,SAAS,UAAU,kDAAkD,UAAU,YAAY,eAAe,sDAAsD,UAAU,YAAY,iBAAiB,yDAAyD,UAAU,YAAY,aAAa,iDAAiD,UAAU,YAAY,iBAAiB,wDAAwD,UAAU,YAAY,mBAAmB,0DAA0D,UAAU,YAAY,iBAAiB,gQAAgQ,UAAU,YAAY,0BAA0B,MAAM,SAAS,QAAQ,kEAAkE,SAAS,mBAAmB,0DAA0D,UAAU,YAAY,iBAAiB,wDAAwD,UAAU,YAAY,aAAa,oDAAoD,UAAU,YAAY,eAAe,sDAAsD,UAAU,YAAY,yBAAyB,oEAAoE,0BAA0B,qEAAqE,SAAS,4CAA4C,kBAAkB,cAAc,GAAG,sBAAsB,qDAAqD,MAAM,cAAc,GAAG,gCAAgC,sHAAsH,yDAAyD,kCAAkC,yDAAyD,eAAe,EAAE,gCAAgC,yDAAyD,eAAe,UAAU,UAAU,YAAY,0BAA0B,wDAAwD,OAAO,cAAc,GAAG,sBAAsB,kEAAkE,GAAG,4BAA4B,wEAAwE,GAAG,uBAAuB,0DAA0D,GAAG,yBAAyB,eAAe,YAAY,6BAA6B,QAAQ,GAAG,sIAAsI,yHAAyH,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,QAAQ,SAAS,2DAA2D,KAAK,QAAQ,0BAA0B,iDAAiD,IAAI,MAAM,eAAe,GAAG,uBAAuB,iBAAiB,KAAK,qBAAqB,QAAQ,KAAK,yBAAyB,aAAa,EAAE,iEAAiE,YAAY,KAAK,qBAAqB,sCAAsC,4BAA4B,iJAAiJ,2FAA2F,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,QAAQ,SAAS,2DAA2D,KAAK,QAAQ,0BAA0B,8BAA8B,IAAI,MAAM,eAAe,GAAG,uBAAuB,iBAAiB,KAAK,qBAAqB,QAAQ,GAAG,yBAAyB,aAAa,EAAE,sDAAsD,SAAS,GAAG,GAAG,0BAA0B,wDAAwD,UAAU,UAAU,UAAU,YAAY,6BAA6B,qEAAqE,UAAU,YAAY,mBAAmB,4DAA4D,UAAU,YAAY,cAAc,0DAA0D,MAAM,EAAE,qDAAqD,UAAU,YAAY,kBAAkB,iDAAiD,QAAQ,cAAc,GAAG,eAAe,4CAA4C,YAAY,UAAU,UAAU,YAAY,qBAAqB,uDAAuD,yBAAyB,mDAAmD,2BAA2B,UAAU,UAAU,YAAY,8BAA8B,4DAA4D,OAAO,UAAU,UAAU,YAAY,iCAAiC,kHAAkH,MAAM,OAAO,GAAG,yDAAyD,OAAO,UAAU,UAAU,YAAY,4BAA4B,4FAA4F,4DAA4D,OAAO,UAAU,UAAU,YAAY,iCAAiC,qEAAqE,GAAG,MAAM,cAAc,cAAc,+BAA+B,GAAG,aAAa,wEAAwE,kCAAkC,GAAG,EAAE,GAAG,oBAAoB,4DAA4D,UAAU,YAAY,2BAA2B,EAAE,MAAM,iBAAiB,OAAO,MAAM,4BAA4B,KAAK,uJAAuJ,iBAAiB,wBAAwB,MAAM,mCAAmC,GAAG,OAAO,sCAAsC,OAAO,aAAa,iBAAiB,QAAQ,uBAAuB,EAAE,GAAG,EAAE,4BAA4B,EAAE,GAAG,EAAE,4BAA4B,EAAE,GAAG,EAAE,4BAA4B,EAAE,GAAG,EAAE,4BAA4B,EAAE,GAAG,EAAE,4BAA4B,EAAE,GAAG,EAAE,MAAM,8BAA8B,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,kBAAkB,EAAE,GAAG,EAAE,OAAO,qDAAqD,qBAAqB,yBAAyB,0CAA0C,SAAS,+CAA+C,0EAA0E,qBAAqB,gBAAgB,+CAA+C,MAAM,UAAU,yEAAyE,cAAc,EAAE,cAAc,qBAAqB,cAAc,EAAE,6CAA6C,cAAc,EAAE,oBAAoB,MAAM,UAAU,mDAAmD,cAAc,qCAAqC,oEAAoE,UAAU,EAAE,0BAA0B,MAAM,SAAS,QAAQ,iEAAiE,SAAS,2BAA2B,kDAAkD,kCAAkC,GAAG,YAAY,SAAS,OAAO,uCAAuC,SAAS,uBAAuB,oBAAoB,cAAc,yBAAyB,eAAe,gCAAgC,MAAM,MAAM,YAAY,8BAA8B,mCAAmC,SAAS,eAAe,gCAAgC,MAAM,MAAM,YAAY,8BAA8B,UAAU,SAAS,kBAAkB,uCAAuC,iBAAiB,yCAAyC,SAAS,MAAM,OAAO,uCAAuC,SAAS,0CAA0C,2BAA2B,uBAAuB,uBAAuB,wBAAwB,iBAAiB,uCAAuC,SAAS,wBAAwB,sDAAsD,EAAE,GAAG,cAAc,2BAA2B,2BAA2B,IAAI,+KAA+K,sDAAsD,SAAS,2DAA2D,SAAS,gBAAgB,gFAAgF,qBAAqB,WAAW,+EAA+E,uBAAuB,eAAe,gFAAgF,sBAAsB,UAAU,6BAA6B,oBAAoB,6EAA6E,qBAAqB,cAAc,4FAA4F,EAAE,+CAA+C,uCAAuC,kBAAkB,+DAA+D,oFAAoF,4IAA4I,qDAAqD,qDAAqD,iEAAiE,oFAAoF,2IAA2I,oDAAoD,uCAAuC,SAAS,0BAA0B,uBAAuB,gCAAgC,mCAAmC,kBAAkB,wBAAwB,mCAAmC,sHAAsH,mBAAmB,yHAAyH,mDAAmD,4EAA4E,2GAA2G,uBAAuB,wCAAwC,oBAAoB,yIAAyI,wGAAwG,mBAAmB,4BAA4B,IAAI,KAAK,SAAS,qEAAqE,UAAU,GAAG,QAAQ,iCAAiC,mBAAmB,6DAA6D,6BAA6B,wBAAwB,gBAAgB,8BAA8B,MAAM,4BAA4B,GAAG,8CAA8C,yCAAyC,GAAG,iEAAiE,SAAS,OAAO,uCAAuC,SAAS,6DAA6D,sCAAsC,EAAE,EAAE,8BAA8B,WAAW,KAAK,IAAI,kBAAkB,qDAAqD,iEAAiE,oFAAoF,2IAA2I,mDAAmD,mDAAmD,oFAAoF,4IAA4I,sDAAsD,uCAAuC,SAAS,2CAA2C,yBAAyB,qBAAqB,wJAAwJ,+BAA+B,oEAAoE,EAAE,GAAG,SAAS,MAAM,oEAAoE,2DAA2D,+DAA+D,EAAE,+BAA+B,0BAA0B,2BAA2B,iBAAiB,kCAAkC,wBAAwB,sBAAsB,6KAA6K,mBAAmB,2BAA2B,WAAW,oFAAoF,uBAAuB,+BAA+B,0BAA0B,+BAA+B,gBAAgB,kDAAkD,SAAS,UAAU,SAAS,gBAAgB,GAAG,sBAAsB,uBAAuB,GAAG,uBAAuB,8BAA8B,iBAAiB,yEAAyE,0BAA0B,yGAAyG,8DAA8D,2CAA2C,SAAS,MAAM,OAAO,uCAAuC,SAAS,mDAAmD,OAAO,iFAAiF,4DAA4D,oFAAoF,4IAA4I,qDAAqD,qDAAqD,iEAAiE,oFAAoF,2IAA2I,oDAAoD,uCAAuC,SAAS,wBAAwB,YAAY,qBAAqB,iCAAiC,wCAAwC,6FAA6F,aAAa,yBAAyB,EAAE,qGAAqG,+MAA+M,wBAAwB,mBAAmB,cAAc,yBAAyB,wBAAwB,mBAAmB,EAAE,GAAG,sDAAsD,+BAA+B,KAAK,iBAAiB,2LAA2L,+FAA+F,IAAI,OAAO,GAAG,oEAAoE,MAAM,wCAAwC,gBAAgB,mBAAmB,6BAA6B,gHAAgH,mEAAmE,IAAI,OAAO,GAAG,oEAAoE,MAAM,+BAA+B,eAAe,uBAAuB,+CAA+C,gDAAgD,iCAAiC,GAAG,SAAS,gGAAgG,mDAAmD,GAAG,oGAAoG,qDAAqD,GAAG,gJAAgJ,cAAc,wQAAwQ,GAAG,gBAAgB,0FAA0F,kBAAkB,WAAW,6FAA6F,kBAAkB,gBAAgB,wDAAwD,+BAA+B,kBAAkB,mDAAmD,oFAAoF,4IAA4I,qDAAqD,qDAAqD,iEAAiE,oFAAoF,2IAA2I,oDAAoD,uCAAuC,SAAS,6BAA6B,0BAA0B,mBAAmB,8KAA8K,sGAAsG,+BAA+B,0BAA0B,wCAAwC,WAAW,+EAA+E,mBAAmB,WAAW,2EAA2E,mBAAmB,+BAA+B,iDAAiD,GAAG,mBAAmB,SAAS,gBAAgB,uBAAuB,uBAAuB,8BAA8B,iBAAiB,gFAAgF,mBAAmB,WAAW,iCAAiC,qEAAqE,uBAAuB,2BAA2B,qFAAqF,SAAS,mCAAmC,kBAAkB,qCAAqC,cAAc,mEAAmE,8BAA8B,uCAAuC,UAAU,uCAAuC,SAAS,0BAA0B,WAAW,gCAAgC,eAAe,oEAAoE,6BAA6B,qCAAqC,aAAa,qCAAqC,6BAA6B,qDAAqD,GAAG,qCAAqC,MAAM,yBAAyB,IAAI,SAAS,aAAa,sDAAsD,oGAAoG,6CAA6C,gCAAgC,iDAAiD,qBAAqB,EAAE,4BAA4B,kGAAkG,8BAA8B,+CAA+C,qBAAqB,EAAE,0BAA0B,gGAAgG,uBAAuB,gHAAgH,yBAAyB,oBAAoB,EAAE,EAAE,2BAA2B,sBAAsB,EAAE,EAAE,qBAAqB,iBAAiB,EAAE,EAAE,gBAAgB,0CAA0C,yBAAyB,wDAAwD,6CAA6C,0CAA0C,gCAAgC,EAAE,gDAAgD,qCAAqC,GAAG,SAAS,gFAAgF,yBAAyB,+BAA+B,sFAAsF,GAAG,OAAO,mEAAmE,+BAA+B,kDAAkD,gCAAgC,oHAAoH,6CAA6C,4CAA4C,gCAAgC,EAAE,8CAA8C,qCAAqC,mCAAmC,+BAA+B,+BAA+B,wEAAwE,qBAAqB,IAAI,OAAO,kCAAkC,oBAAoB,SAAS,OAAO,eAAe,gFAAgF,iBAAiB,oBAAoB,eAAe,uBAAuB,uCAAuC,SAAS,mNAAmN,oBAAoB,qEAAqE,oFAAoF,4IAA4I,qDAAqD,qDAAqD,iEAAiE,oFAAoF,2IAA2I,oDAAoD,uCAAuC,SAAS,4BAA4B,kBAAkB,gCAAgC,kBAAkB,2BAA2B,sCAAsC,6DAA6D,4BAA4B,KAAK,kFAAkF,wBAAwB,+BAA+B,uBAAuB,mBAAmB,qFAAqF,kEAAkE,8DAA8D,iQAAiQ,wBAAwB,gCAAgC,OAAO,yEAAyE,+BAA+B,oEAAoE,gBAAgB,0DAA0D,+IAA+I,QAAQ,UAAU,QAAQ,gBAAgB,GAAG,wBAAwB,6BAA6B,yDAAyD,aAAa,yEAAyE,gBAAgB,uBAAuB,mBAAmB,0BAA0B,gBAAgB,wBAAwB,iFAAiF,yBAAyB,iCAAiC,MAAM,wDAAwD,GAAG,OAAO,yDAAyD,GAAG,4BAA4B,gKAAgK,QAAQ,OAAO,UAAU,OAAO,gBAAgB,cAAc,GAAG,qBAAqB,wKAAwK,2BAA2B,oEAAoE,kCAAkC,sKAAsK,QAAQ,OAAO,UAAU,OAAO,gBAAgB,cAAc,GAAG,+BAA+B,uEAAuE,gBAAgB,yBAAyB,cAAc,yDAAyD,wMAAwM,QAAQ,EAAE,UAAU,GAAG,4FAA4F,EAAE,wCAAwC,QAAQ,EAAE,UAAU,GAAG,gEAAgE,2BAA2B,2CAA2C,6BAA6B,+BAA+B,8BAA8B,4BAA4B,sCAAsC,cAAc,GAAG,2HAA2H,UAAU,uCAAuC,SAAS,4BAA4B,iBAAiB,yBAAyB,eAAe,0NAA0N,+BAA+B,MAAM,8FAA8F,oHAAoH,4FAA4F,mBAAmB,UAAU,mBAAmB,gBAAgB,GAAG,2CAA2C,IAAI,uBAAuB,8CAA8C,iDAAiD,SAAS,6EAA6E,mBAAmB,2EAA2E,oBAAoB,mHAAmH,oCAAoC,gDAAgD,uQAAuQ,sBAAsB,UAAU,uCAAuC,SAAS,4BAA4B,yBAAyB,eAAe,gJAAgJ,iGAAiG,wFAAwF,2CAA2C,IAAI,SAAS,+BAA+B,mGAAmG,wFAAwF,2CAA2C,IAAI,SAAS,4LAA4L,UAAU,uCAAuC,SAAS,EAAE,SAAS,oBAAoB,mBAAmB,iBAAiB,gCAAgC,0BAA0B,0CAA0C,2CAA2C,+CAA+C,yCAAyC,GAAG,0BAA0B,wFAAwF,uBAAuB,0EAA0E,uBAAuB,kFAAkF,uBAAuB,4JAA4J,WAAW,kDAAkD,YAAY,+FAA+F,cAAc,kEAAkE,cAAc,8DAA8D,iEAAiE,oFAAoF,2IAA2I,mDAAmD,mDAAmD,oFAAoF,4IAA4I,sDAAsD,uCAAuC,SAAS,8BAA8B,2DAA2D,yBAAyB,wCAAwC,kBAAkB,UAAU,4BAA4B,oCAAoC,2DAA2D,GAAG,eAAe,uFAAuF,2BAA2B,gXAAgX,oBAAoB,mFAAmF,yEAAyE,UAAU,oCAAoC,qFAAqF,2DAA2D,GAAG,MAAM,iBAAiB,aAAa,0BAA0B,KAAK,gEAAgE,MAAM,8GAA8G,+BAA+B,6EAA6E,0FAA0F,2BAA2B,8DAA8D,MAAM,OAAO,OAAO,sDAAsD,UAAU,WAAW,MAAM,kEAAkE,0CAA0C,UAAU,wCAAwC,EAAE,+CAA+C,4BAA4B,qBAAqB,+CAA+C,2DAA2D,mBAAmB,QAAQ,gCAAgC,oIAAoI,mBAAmB,qBAAqB,yBAAyB,EAAE,0SAA0S,MAAM,oHAAoH,KAAK,wDAAwD,MAAM,SAAS,0BAA0B,sCAAsC,kCAAkC,MAAM,oEAAoE,WAAW,mHAAmH,8CAA8C,+DAA+D,cAAc,4CAA4C,MAAM,2CAA2C,GAAG,IAAI,wFAAwF,YAAY,qBAAqB,yBAAyB,iBAAiB,oDAAoD,6FAA6F,uCAAuC,wCAAwC,OAAO,8DAA8D,mBAAmB,GAAG,sCAAsC,gBAAgB,mBAAmB,MAAM,gCAAgC,uFAAuF,2BAA2B,+CAA+C,UAAU,0EAA0E,UAAU,wBAAwB,MAAM,gCAAgC,8CAA8C,EAAE,SAAS,mKAAmK,SAAS,8EAA8E,sDAAsD,iEAAiE,iEAAiE,oFAAoF,2IAA2I,mDAAmD,mDAAmD,oFAAoF,4IAA4I,sDAAsD,uCAAuC,SAAS,oBAAoB,uCAAuC,eAAe,kDAAkD,wBAAwB,iBAAiB,MAAM,KAAK,GAAG,gCAAgC,eAAe,yHAAyH,+CAA+C,6CAA6C,iCAAiC,uCAAuC,6EAA6E,gDAAgD,uBAAuB,wDAAwD,UAAU,YAAY,0BAA0B,6BAA6B,6BAA6B,gCAAgC,yBAAyB,SAAS,SAAS,GAAG,aAAa,yBAAyB,MAAM,yBAAyB,mCAAmC,GAAG,IAAI,cAAc,wDAAwD,yDAAyD,iBAAiB,EAAE,6DAA6D,EAAE,kBAAkB,qDAAqD,gCAAgC,6BAA6B,SAAS,gDAAgD,kEAAkE,EAAE,8BAA8B,QAAQ,0DAA0D,SAAS,qDAAqD,EAAE,IAAI,oBAAoB,EAAE,2IAA2I,SAAS,yEAAyE,EAAE,cAAc,4CAA4C,MAAM,uGAAuG,SAAS,2CAA2C,+KAA+K,qDAAqD,IAAI,+BAA+B,SAAS,6EAA6E,QAAQ,UAAU,QAAQ,gBAAgB,aAAa,IAAI,QAAQ,8CAA8C,KAAK,kBAAkB,0EAA0E,MAAM,SAAS,QAAQ,8CAA8C,cAAc,wCAAwC,0CAA0C,qEAAqE,MAAM,kGAAkG,SAAS,mDAAmD,iCAAiC,yBAAyB,eAAe,sBAAsB,0EAA0E,6QAA6Q,mBAAmB,8CAA8C,gDAAgD,EAAE,kBAAkB,mCAAmC,wBAAwB,2CAA2C,oGAAoG,EAAE,iBAAiB,yDAAyD,oEAAoE,wCAAwC,0FAA0F,EAAE,2BAA2B,mBAAmB,6DAA6D,+EAA+E,0CAA0C,gFAAgF,EAAE,uCAAuC,KAAK,kBAAkB,MAAM,SAAS,mDAAmD,sHAAsH,eAAe,eAAe,yBAAyB,GAAG,yBAAyB,MAAM,SAAS,6BAA6B,MAAM,uBAAuB,uBAAuB,6BAA6B,eAAe,qEAAqE,sBAAsB,gCAAgC,EAAE,kCAAkC,QAAQ,aAAa,MAAM,SAAS,GAAG,UAAU,6CAA6C,MAAM,yFAAyF,MAAM,6FAA6F,UAAU,0BAA0B,2BAA2B,UAAU,uCAAuC,SAAS,sBAAsB,WAAW,yBAAyB,mBAAmB,qDAAqD,kBAAkB,MAAM,UAAU,mDAAmD,OAAO,EAAE,cAAc,oBAAoB,sDAAsD,mBAAmB,iBAAiB,EAAE,MAAM,UAAU,sDAAsD,cAAc,mBAAmB,qDAAqD,kBAAkB,MAAM,UAAU,mDAAmD,OAAO,EAAE,cAAc,kBAAkB,oDAAoD,iBAAiB,MAAM,UAAU,kDAAkD,OAAO,EAAE,cAAc,eAAe,gDAAgD,6BAA6B,MAAM,UAAU,sDAAsD,OAAO,EAAE,eAAe,gBAAgB,SAAS,MAAM,OAAO,uCAAuC,SAAS,gCAAgC,WAAW,gCAAgC,iBAAiB,uDAAuD,UAAU,mFAAmF,UAAU,aAAa,iEAAiE,SAAS,sCAAsC,iBAAiB,yBAAyB,QAAQ,qEAAqE,yDAAyD,OAAO,GAAG,YAAY,0EAA0E,yCAAyC,OAAO,GAAG,4CAA4C,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,kBAAkB,KAAK,SAAS,MAAM,OAAO,uCAAuC,SAAS,mBAAmB,WAAW,gCAAgC,iBAAiB,+CAA+C,UAAU,oEAAoE,UAAU,YAAY,kBAAkB,uEAAuE,UAAU,aAAa,oDAAoD,SAAS,yBAAyB,sBAAsB,yBAAyB,cAAc,+CAA+C,GAAG,mCAAmC,wBAAwB,kCAAkC,YAAY,oDAAoD,GAAG,mCAAmC,wBAAwB,kCAAkC,aAAa,6DAA6D,8FAA8F,iBAAiB,kEAAkE,8EAA8E,+BAA+B,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,kBAAkB,KAAK,UAAU,uCAAuC,SAAS,yBAAyB,WAAW,gCAAgC,eAAe,yBAAyB,oBAAoB,wEAAwE,SAAS,EAAE,oBAAoB,wFAAwF,SAAS,EAAE,sBAAsB,2LAA2L,EAAE,sBAAsB,MAAM,SAAS,QAAQ,2DAA2D,SAAS,EAAE,UAAU,mBAAmB,YAAY,MAAM,MAAM,mDAAmD,oFAAoF,4IAA4I,sDAAsD,uCAAuC,SAAS,qBAAqB,2BAA2B,gCAAgC,iBAAiB,sDAAsD,sEAAsE,GAAG,0BAA0B,OAAO,GAAG,eAAe,qCAAqC,YAAY,iBAAiB,wBAAwB,IAAI,wBAAwB,EAAE,mCAAmC,QAAQ,EAAE,+BAA+B,aAAa,KAAK,SAAS,0IAA0I,wDAAwD,mCAAmC,wBAAwB,+BAA+B,YAAY,oGAAoG,wBAAwB,uEAAuE,GAAG,iEAAiE,6BAA6B,EAAE,kKAAkK,kBAAkB,GAAG,0CAA0C,sBAAsB,yEAAyE,GAAG,+BAA+B,gCAAgC,oDAAoD,oKAAoK,kBAAkB,GAAG,MAAM,WAAW,iCAAiC,qCAAqC,aAAa,gEAAgE,GAAG,gDAAgD,mBAAmB,sEAAsE,GAAG,+BAA+B,+BAA+B,OAAO,EAAE,wBAAwB,mKAAmK,GAAG,SAAS,qCAAqC,sDAAsD,4BAA4B,oBAAoB,wEAAwE,GAAG,wDAAwD,yBAAyB,6DAA6D,eAAe,EAAE,yBAAyB,0EAA0E,GAAG,sGAAsG,MAAM,0BAA0B,mEAAmE,cAAc,gBAAgB,SAAS,mBAAmB,EAAE,IAAI,EAAE,GAAG,SAAS,iCAAiC,+BAA+B,0CAA0C,qBAAqB,OAAO,uBAAuB,mEAAmE,cAAc,EAAE,+BAA+B,oFAAoF,GAAG,6DAA6D,0CAA0C,yBAAyB,OAAO,2BAA2B,IAAI,iFAAiF,4FAA4F,gCAAgC,aAAa,kEAAkE,uCAAuC,kCAAkC,6CAA6C,EAAE,0BAA0B,8EAA8E,GAAG,gCAAgC,aAAa,kEAAkE,wCAAwC,WAAW,4CAA4C,cAAc,EAAE,uBAAuB,oBAAoB,EAAE,wEAAwE,GAAG,wDAAwD,qBAAqB,GAAG,8BAA8B,SAAS,MAAM,MAAM,OAAO,eAAe,UAAU,wDAAwD,kBAAkB,uCAAuC,SAAS,2HAA2H,uDAAuD,aAAa,sBAAsB,yDAAyD,oFAAoF,4IAA4I,sDAAsD,uCAAuC,SAAS,mBAAmB,sCAAsC,yBAAyB,iBAAiB,kLAAkL,mDAAmD,GAAG,wCAAwC,mCAAmC,2BAA2B,UAAU,EAAE,+BAA+B,wDAAwD,GAAG,wCAAwC,iCAAiC,2BAA2B,2BAA2B,EAAE,4BAA4B,wDAAwD,GAAG,yCAAyC,aAAa,GAAG,gKAAgK,wCAAwC,2BAA2B,cAAc,GAAG,mCAAmC,wBAAwB,0DAA0D,YAAY,kGAAkG,kBAAkB,sDAAsD,GAAG,uEAAuE,qBAAqB,EAAE,wBAAwB,qDAAqD,GAAG,wCAAwC,4CAA4C,qBAAqB,uCAAuC,oBAAoB,0DAA0D,GAAG,8GAA8G,qCAAqC,4BAA4B,qEAAqE,oFAAoF,4IAA4I,qDAAqD,qDAAqD,iEAAiE,oFAAoF,2IAA2I,oDAAoD,uCAAuC,SAAS,yBAAyB,uBAAuB,yBAAyB,cAAc,uFAAuF,IAAI,mDAAmD,oIAAoI,0HAA0H,mLAAmL,SAAS,6CAA6C,6BAA6B,SAAS,uCAAuC,oCAAoC,wBAAwB,kBAAkB,uIAAuI,EAAE,SAAS,mDAAmD,aAAa,iBAAiB,oCAAoC,gBAAgB,EAAE,oBAAoB,SAAS,sEAAsE,aAAa,gBAAgB,aAAa,EAAE,6WAA6W,cAAc,uDAAuD,8BAA8B,YAAY,4DAA4D,8BAA8B,mBAAmB,0DAA0D,8GAA8G,MAAM,cAAc,aAAa,kBAAkB,cAAc,EAAE,iBAAiB,+DAA+D,8GAA8G,MAAM,cAAc,aAAa,sBAAsB,cAAc,GAAG,8FAA8F,+EAA+E,EAAE,GAAG,uBAAuB,aAAa,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,kBAAkB,4CAA4C,SAAS,2BAA2B,uBAAuB,yBAAyB,iBAAiB,oEAAoE,cAAc,oMAAoM,sDAAsD,cAAc,yDAAyD,oBAAoB,YAAY,gBAAgB,YAAY,8DAA8D,oBAAoB,YAAY,gBAAgB,mBAAmB,gEAAgE,cAAc,uBAAuB,EAAE,iBAAiB,qEAAqE,kBAAkB,uBAAuB,EAAE,SAAS,0DAA0D,6BAA6B,IAAI,MAAM,OAAO,yCAAyC,6BAA6B,EAAE,kDAAkD,OAAO,aAAa,OAAO,EAAE,SAAS,MAAM,GAAG,uBAAuB,wEAAwE,6BAA6B,IAAI,0DAA0D,kDAAkD,qBAAqB,eAAe,SAAS,MAAM,IAAI,iCAAiC,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,kBAAkB,KAAK,UAAU,aAAa,sCAAsC,SAAS,6DAA6D,8BAA8B,kBAAkB,OAAO,IAAI,kGAAkG,6BAA6B,oGAAoG,MAAM,2BAA2B,SAAS,aAAa,iDAAiD,qBAAqB,iDAAiD,oBAAoB,iDAAiD,oBAAoB,iDAAiD,0BAA0B,iDAAiD,+BAA+B,iDAAiD,0BAA0B,kDAAkD,6HAA6H,aAAa,mBAAmB,qBAAqB,mBAAmB,oBAAoB,mBAAmB,oBAAoB,mBAAmB,0BAA0B,mBAAmB,+BAA+B,mBAAmB,0BAA0B,oBAAoB,IAAI,gBAAgB,iDAAiD,WAAW,iDAAiD,gBAAgB,iDAAiD,oBAAoB,iDAAiD,SAAS,iDAAiD,kBAAkB,iDAAiD,WAAW,iDAAiD,sBAAsB,iDAAiD,0BAA0B,iDAAiD,qBAAqB,iDAAiD,yBAAyB,mDAAmD,UAAU,8CAA8C,cAAc,YAAY,uBAAuB,EAAE,mDAAmD,cAAc,YAAY,uBAAuB,EAAE,kDAAkD,cAAc,YAAY,uBAAuB,EAAE,4EAA4E,OAAO,YAAY,uBAAuB,EAAE,eAAe,2CAA2C,KAAK,SAAS,MAAM,OAAO,uCAAuC,SAAS,4FAA4F,aAAa,oBAAoB,mBAAmB,EAAE,kLAAkL,EAAE,sCAAsC,oBAAoB,kPAAkP,GAAG,YAAY,OAAO,UAAU,aAAa,sCAAsC,SAAS,kJAAkJ,oBAAoB,cAAc,EAAE,WAAW,EAAE,iCAAiC,IAAI,eAAe,SAAS,6BAA6B,sCAAsC,IAAI,WAAW,SAAS,+CAA+C,GAAG,mBAAmB,OAAO,IAAI,EAAE,OAAO,2DAA2D,GAAG,MAAM,GAAG,yHAAyH,sCAAsC,MAAM,cAAc,GAAG,kCAAkC,EAAE,GAAG,GAAG,aAAa,GAAG,KAAK,GAAG,MAAM,GAAG,mDAAmD,EAAE,GAAG,GAAG,aAAa,GAAG,MAAM,GAAG,0BAA0B,kBAAkB,08BAA08B,qCAAqC,IAAI,YAAY,SAAS,+CAA+C,EAAE,IAAI,EAAE,OAAO,KAAK,gBAAgB,cAAc,gBAAgB,KAAK,6DAA6D,iEAAiE,oFAAoF,2IAA2I,mDAAmD,kDAAkD,oFAAoF,4IAA4I,sDAAsD,uCAAuC,SAAS,0BAA0B,uBAAuB,gBAAgB,4CAA4C,SAAS,EAAE,aAAa,wBAAwB,iBAAiB,6HAA6H,oBAAoB,yDAAyD,QAAQ,8FAA8F,QAAQ,yFAAyF,QAAQ,6FAA6F,QAAQ,kCAAkC,qBAAqB,gEAAgE,gBAAgB,MAAM,UAAU,8CAA8C,kFAAkF,SAAS,aAAa,kBAAkB,GAAG,oEAAoE,QAAQ,EAAE,QAAQ,kCAAkC,qGAAqG,4CAA4C,6CAA6C,+EAA+E,GAAG,kBAAkB,sCAAsC,wBAAwB,MAAM,0BAA0B,4BAA4B,+CAA+C,QAAQ,EAAE,QAAQ,0BAA0B,MAAM,qCAAqC,kCAAkC,oCAAoC,uCAAuC,KAAK,kBAAkB,wDAAwD,oCAAoC,uCAAuC,GAAG,sBAAsB,oBAAoB,MAAM,YAAY,oCAAoC,mDAAmD,qBAAqB,oBAAoB,yIAAyI,EAAE,oBAAoB,EAAE,GAAG,qBAAqB,oCAAoC,SAAS,+DAA+D,kCAAkC,mBAAmB,mCAAmC,IAAI,yBAAyB,gBAAgB,4CAA4C,SAAS,mCAAmC,aAAa,yCAAyC,iBAAiB,sOAAsO,MAAM,aAAa,GAAG,0IAA0I,GAAG,kBAAkB,sCAAsC,oBAAoB,8tBAA8tB,kCAAkC,GAAG,eAAe,MAAM,UAAU,GAAG,oEAAoE,QAAQ,EAAE,OAAO,sEAAsE,iDAAiD,gFAAgF,SAAS,aAAa,kBAAkB,GAAG,0GAA0G,+CAA+C,kBAAkB,6CAA6C,+EAA+E,GAAG,uBAAuB,MAAM,cAAc,GAAG,oEAAoE,QAAQ,EAAE,OAAO,8EAA8E,eAAe,8CAA8C,8CAA8C,yBAAyB,MAAM,0BAA0B,4BAA4B,+CAA+C,QAAQ,EAAE,OAAO,+EAA+E,MAAM,8CAA8C,2CAA2C,uBAAuB,+CAA+C,wJAAwJ,GAAG,iCAAiC,MAAM,YAAY,4BAA4B,MAAM,MAAM,8CAA8C,kDAAkD,qBAAqB,0BAA0B,0DAA0D,MAAM,iCAAiC,aAAa,0BAA0B,GAAG,yDAAyD,GAAG,IAAI,qBAAqB,SAAS,4FAA4F,GAAG,mBAAmB,EAAE,UAAU,OAAO,UAAU,OAAO,gBAAgB,aAAa,iBAAiB,4FAA4F,EAAE,UAAU,OAAO,UAAU,OAAO,gBAAgB,aAAa,IAAI,+BAA+B,MAAM,YAAY,4BAA4B,+RAA+R,EAAE,oBAAoB,EAAE,GAAG,8BAA8B,gCAAgC,YAAY,GAAG,+CAA+C,QAAQ,EAAE,OAAO,iFAAiF,iFAAiF,uGAAuG,8BAA8B,GAAG,GAAG,8BAA8B,gCAAgC,YAAY,GAAG,+CAA+C,QAAQ,EAAE,OAAO,yEAAyE,0BAA0B,+BAA+B,gCAAgC,YAAY,GAAG,+CAA+C,QAAQ,EAAE,OAAO,0EAA0E,2BAA2B,gBAAgB,+BAA+B,+CAA+C,QAAQ,EAAE,OAAO,uEAAuE,qEAAqE,yCAAyC,MAAM,aAAa,uDAAuD,MAAM,gBAAgB,aAAa,yBAAyB,GAAG,2DAA2D,GAAG,IAAI,qBAAqB,SAAS,2FAA2F,GAAG,8BAA8B,OAAO,UAAU,OAAO,gBAAgB,aAAa,iBAAiB,wBAAwB,MAAM,aAAa,yBAAyB,MAAM,iFAAiF,eAAe,oDAAoD,YAAY,MAAM,IAAI,qBAAqB,SAAS,0BAA0B,SAAS,kCAAkC,YAAY,IAAI,SAAS,2BAA2B,mCAAmC,gGAAgG,qBAAqB,oCAAoC,SAAS,wKAAwK,kCAAkC,4BAA4B,+CAA+C,qDAAqD,MAAM,cAAc,kBAAkB,2CAA2C,GAAG,iBAAiB,mBAAmB,IAAI,WAAW,4BAA4B,8BAA8B,EAAE,6BAA6B,+BAA+B,EAAE,6BAA6B,+BAA+B,EAAE,0BAA0B,4BAA4B,EAAE,2BAA2B,6BAA6B,EAAE,6BAA6B,+BAA+B,EAAE,6BAA6B,mBAAmB,8bAA8b,qCAAqC,uBAAuB,kBAAkB,aAAa,eAAe,+WAA+W,+SAA+S,cAAc,YAAY,UAAU,IAAI,+DAA+D,GAAG,+BAA+B,2IAA2I,QAAQ,EAAE,QAAQ,2BAA2B,MAAM,iBAAiB,GAAG,yBAAyB,UAAU,KAAK,oBAAoB,UAAU,IAAI,yEAAyE,GAAG,sCAAsC,0GAA0G,EAAE,IAAI,mCAAmC,kFAAkF,SAAS,aAAa,kBAAkB,GAAG,eAAe,wCAAwC,wFAAwF,wIAAwI,GAAG,uBAAuB,uEAAuE,GAAG,+BAA+B,2GAA2G,MAAM,iBAAiB,oFAAoF,4BAA4B,wBAAwB,0BAA0B,IAAI,yEAAyE,mHAAmH,MAAM,wDAAwD,iBAAiB,IAAI,IAAI,+EAA+E,+CAA+C,QAAQ,EAAE,QAAQ,0CAA0C,wEAAwE,QAAQ,EAAE,OAAO,GAAG,WAAW,sDAAsD,iBAAiB,KAAK,qBAAqB,SAAS,oBAAoB,yCAAyC,iBAAiB,IAAI,+BAA+B,iBAAiB,IAAI,+EAA+E,GAAG,+BAA+B,+CAA+C,QAAQ,EAAE,QAAQ,0BAA0B,2HAA2H,EAAE,+CAA+C,yBAAyB,yEAAyE,sCAAsC,mCAAmC,MAAM,0BAA0B,GAAG,iCAAiC,iCAAiC,GAAG,kBAAkB,iBAAiB,uCAAuC,8BAA8B,SAAS,IAAI,gFAAgF,MAAM,+DAA+D,IAAI,+EAA+E,uEAAuE,QAAQ,EAAE,OAAO,GAAG,wEAAwE,QAAQ,EAAE,OAAO,GAAG,WAAW,8DAA8D,qBAAqB,SAAS,oBAAoB,gDAAgD,sCAAsC,oFAAoF,GAAG,+BAA+B,sFAAsF,mBAAmB,6EAA6E,2BAA2B,KAAK,IAAI,wBAAwB,iBAAiB,EAAE,qFAAqF,+CAA+C,6BAA6B,iBAAiB,EAAE,oFAAoF,GAAG,6GAA6G,6BAA6B,yHAAyH,4DAA4D,2BAA2B,qEAAqE,GAAG,6DAA6D,OAAO,EAAE,MAAM,iBAAiB,MAAM,yDAAyD,MAAM,kCAAkC,GAAG,IAAI,sBAAsB,0DAA0D,SAAS,0DAA0D,OAAO,GAAG,OAAO,GAAG,aAAa,kBAAkB,cAAc,8BAA8B,EAAE,KAAK,yCAAyC,yCAAyC,YAAY,8BAA8B,GAAG,+BAA+B,gIAAgI,kEAAkE,yCAAyC,8JAA8J,4EAA4E,uCAAuC,uJAAuJ,sEAAsE,6BAA6B,sBAAsB,gBAAgB,IAAI,oFAAoF,0DAA0D,mCAAmC,6FAA6F,mEAAmE,oCAAoC,wGAAwG,oEAAoE,kCAAkC,iCAAiC,IAAI,wBAAwB,SAAS,gDAAgD,GAAG,mBAAmB,QAAQ,YAAY,OAAO,GAAG,OAAO,GAAG,aAAa,MAAM,iCAAiC,iCAAiC,wBAAwB,6BAA6B,MAAM,cAAc,GAAG,OAAO,iDAAiD,uDAAuD,cAAc,yBAAyB,yBAAyB,oDAAoD,oBAAoB,OAAO,6BAA6B,kDAAkD,mBAAmB,sDAAsD,gGAAgG,yBAAyB,iCAAiC,MAAM,oDAAoD,GAAG,MAAM,aAAa,iDAAiD,MAAM,0BAA0B,GAAG,sEAAsE,IAAI,GAAG,wBAAwB,0CAA0C,+BAA+B,0BAA0B,oBAAoB,0BAA0B,qDAAqD,uCAAuC,wIAAwI,EAAE,IAAI,0BAA0B,0BAA0B,IAAI,SAAS,0BAA0B,0BAA0B,oDAAoD,MAAM,iBAAiB,mCAAmC,iCAAiC,iCAAiC,GAAG,kBAAkB,iBAAiB,sCAAsC,mCAAmC,MAAM,YAAY,kDAAkD,WAAW,MAAM,iBAAiB,GAAG,gCAAgC,IAAI,eAAe,sBAAsB,2DAA2D,SAAS,gDAAgD,GAAG,aAAa,OAAO,GAAG,OAAO,GAAG,aAAa,IAAI,cAAc,8CAA8C,EAAE,KAAK,yCAAyC,yCAAyC,YAAY,8CAA8C,GAAG,sBAAsB,YAAY,IAAI,+BAA+B,+BAA+B,+BAA+B,wBAAwB,IAAI,IAAI,sFAAsF,2CAA2C,4BAA4B,KAAK,sCAAsC,4DAA4D,OAAO,2CAA2C,SAAS,oBAAoB,kBAAkB,6CAA6C,mBAAmB,mCAAmC,4CAA4C,8BAA8B,OAAO,KAAK,gCAAgC,aAAa,yCAAyC,6BAA6B,+CAA+C,kBAAkB,uDAAuD,sCAAsC,gGAAgG,SAAS,MAAM,KAAK,oBAAoB,SAAS,oBAAoB,4EAA4E,kBAAkB,kDAAkD,YAAY,6EAA6E,wCAAwC,iEAAiE,EAAE,YAAY,wBAAwB,6BAA6B,oCAAoC,yBAAyB,qBAAqB,gFAAgF,iDAAiD,IAAI,2DAA2D,MAAM,yIAAyI,SAAS,uBAAuB,EAAE,WAAW,6BAA6B,IAAI,iCAAiC,mCAAmC,SAAS,qEAAqE,EAAE,IAAI,eAAe,6BAA6B,4FAA4F,OAAO,IAAI,OAAO,GAAG,yIAAyI,SAAS,gEAAgE,6JAA6J,0BAA0B,yCAAyC,yCAAyC,6CAA6C,aAAa,4CAA4C,qBAAqB,8BAA8B,kCAAkC,oEAAoE,EAAE,uBAAuB,OAAO,IAAI,OAAO,GAAG,wDAAwD,4BAA4B,uDAAuD,q/CAAq/C,MAAM,YAAY,0DAA0D,mCAAmC,GAAG,4BAA4B,mFAAmF,uBAAuB,0BAA0B,+EAA+E,yBAAyB,uEAAuE,YAAY,MAAM,qDAAqD,iEAAiE,oFAAoF,2IAA2I,mDAAmD,mDAAmD,oFAAoF,4IAA4I,sDAAsD,uCAAuC,SAAS,EAAE,iBAAiB,yBAAyB,mBAAmB,yDAAyD,oBAAoB,8EAA8E,GAAG,yEAAyE,QAAQ,GAAG,wCAAwC,EAAE,2BAA2B,8EAA8E,GAAG,yEAAyE,QAAQ,GAAG,qCAAqC,EAAE,6BAA6B,iFAAiF,6KAA6K,8BAA8B,MAAM,2CAA2C,QAAQ,GAAG,EAAE,GAAG,oBAAoB,kCAAkC,QAAQ,oGAAoG,QAAQ,GAAG,0BAA0B,GAAG,+CAA+C,6BAA6B,8BAA8B,iBAAiB,mEAAmE,QAAQ,GAAG,YAAY,GAAG,kBAAkB,OAAO,sTAAsT,6BAA6B,SAAS,MAAM,MAAM,OAAO,uCAAuC,SAAS,iCAAiC,YAAY,UAAU,cAAc,gBAAgB,KAAK,uDAAuD,oFAAoF,4IAA4I,qDAAqD,oDAAoD,iEAAiE,oFAAoF,2IAA2I,oDAAoD,uCAAuC,SAAS,2BAA2B,2BAA2B,+BAA+B,aAAa,gCAAgC,UAAU,0BAA0B,iBAAiB,+CAA+C,mBAAmB,0DAA0D,6BAA6B,iBAAiB,8CAA8C,GAAG,IAAI,mEAAmE,gBAAgB,EAAE,SAAS,6EAA6E,oBAAoB,qBAAqB,uDAAuD,wDAAwD,IAAI,4BAA4B,+DAA+D,GAAG,wDAAwD,YAAY,yDAAyD,IAAI,qDAAqD,qCAAqC,SAAS,yEAAyE,0BAA0B,oEAAoE,uBAAuB,qBAAqB,sDAAsD,GAAG,IAAI,6CAA6C,SAAS,0aAA0a,8CAA8C,0BAA0B,6DAA6D,GAAG,gDAAgD,yCAAyC,4BAA4B,sEAAsE,wCAAwC,mCAAmC,kKAAkK,MAAM,cAAc,GAAG,oDAAoD,KAAK,YAAY,4BAA4B,OAAO,mDAAmD,QAAQ,yKAAyK,mBAAmB,SAAS,+CAA+C,8CAA8C,gDAAgD,KAAK,IAAI,OAAO,mDAAmD,iEAAiE,+CAA+C,4BAA4B,kBAAkB,8BAA8B,iBAAiB,+CAA+C,mBAAmB,yCAAyC,UAAU,EAAE,2BAA2B,iDAAiD,cAAc,EAAE,8BAA8B,8KAA8K,MAAM,6BAA6B,QAAQ,GAAG,EAAE,GAAG,gBAAgB,2BAA2B,QAAQ,GAAG,gBAAgB,qDAAqD,SAAS,sDAAsD,iFAAiF,0BAA0B,IAAI,kCAAkC,iBAAiB,uGAAuG,YAAY,GAAG,8BAA8B,iBAAiB,mGAAmG,YAAY,GAAG,wBAAwB,wCAAwC,QAAQ,GAAG,gBAAgB,EAAE,0BAA0B,SAAS,oDAAoD,gFAAgF,YAAY,IAAI,gBAAgB,+BAA+B,QAAQ,GAAG,gBAAgB,EAAE,0BAA0B,SAAS,oDAAoD,gFAAgF,YAAY,IAAI,iBAAiB,gCAAgC,QAAQ,GAAG,gBAAgB,EAAE,0BAA0B,SAAS,oDAAoD,iFAAiF,YAAY,IAAI,uBAAuB,+CAA+C,+CAA+C,GAAG,mBAAmB,IAAI,6GAA6G,SAAS,6BAA6B,aAAa,sCAAsC,SAAS,yNAAyN,oBAAoB,iCAAiC,wBAAwB,4CAA4C,gBAAgB,mCAAmC,wBAAwB,4CAA4C,EAAE,sBAAsB,0BAA0B,iCAAiC,GAAG,sBAAsB,GAAG,8BAA8B,EAAE,wDAAwD,GAAG,6FAA6F,QAAQ,2CAA2C,sFAAsF,mCAAmC,wCAAwC,mGAAmG,gCAAgC,SAAS,aAAa,+FAA+F,OAAO,uJAAuJ,IAAI,YAAY,iJAAiJ,iCAAiC,2LAA2L,6BAA6B,sEAAsE,qCAAqC,yBAAyB,4BAA4B,QAAQ,yKAAyK,mBAAmB,SAAS,qCAAqC,oCAAoC,gDAAgD,KAAK,IAAI,OAAO,oDAAoD,EAAE,kCAAkC,IAAI,2FAA2F,yCAAyC,SAAS,4CAA4C,GAAG,kBAAkB,gBAAgB,sCAAsC,MAAM,OAAO,GAAG,yBAAyB,UAAU,gBAAgB,gDAAgD,MAAM,YAAY,GAAG,yEAAyE,UAAU,uCAAuC,kDAAkD,mCAAmC,SAAS,QAAQ,KAAK,+EAA+E,QAAQ,oCAAoC,EAAE,2BAA2B,MAAM,4BAA4B,EAAE,gBAAgB,aAAa,cAAc,8DAA8D,MAAM,QAAQ,GAAG,8CAA8C,uBAAuB,MAAM,YAAY,GAAG,UAAU,oDAAoD,MAAM,WAAW,2CAA2C,iCAAiC,QAAQ,gEAAgE,SAAS,2DAA2D,0BAA0B,QAAQ,uBAAuB,qCAAqC,EAAE,mBAAmB,KAAK,gBAAgB,cAAc,gBAAgB,KAAK,2DAA2D,iEAAiE,oFAAoF,2IAA2I,mDAAmD,kDAAkD,oFAAoF,4IAA4I,sDAAsD,uCAAuC,SAAS,0BAA0B,4BAA4B,gBAAgB,4CAA4C,SAAS,uBAAuB,kBAAkB,iCAAiC,gBAAgB,uBAAuB,wBAAwB,MAAM,qEAAqE,iOAAiO,mDAAmD,uBAAuB,6DAA6D,GAAG,+CAA+C,MAAM,qBAAqB,IAAI,WAAW,8DAA8D,+EAA+E,KAAK,kBAAkB,EAAE,OAAO,mDAAmD,yBAAyB,sDAAsD,GAAG,WAAW,2BAA2B,UAAU,EAAE,kBAAkB,IAAI,uCAAuC,SAAS,+EAA+E,oBAAoB,sBAAsB,qDAAqD,GAAG,IAAI,2CAA2C,iBAAiB,EAAE,SAAS,qFAAqF,oBAAoB,8BAA8B,iEAAiE,GAAG,IAAI,uDAAuD,SAAS,+FAA+F,oBAAoB,iCAAiC,kEAAkE,GAAG,IAAI,+CAA+C,eAAe,UAAU,EAAE,SAAS,yFAAyF,oBAAoB,4BAA4B,mCAAmC,UAAU,kDAAkD,GAAG,MAAM,wBAAwB,gCAAgC,OAAO,kCAAkC,EAAE,6CAA6C,0BAA0B,gBAAgB,gBAAgB,4CAA4C,SAAS,wBAAwB,mCAAmC,iCAAiC,gBAAgB,4HAA4H,eAAe,qBAAqB,sBAAsB,uBAAuB,wDAAwD,GAAG,IAAI,8EAA8E,SAAS,sFAAsF,oBAAoB,wBAAwB,0DAA0D,GAAG,IAAI,+EAA+E,SAAS,uFAAuF,oBAAoB,8BAA8B,8DAA8D,GAAG,eAAe,MAAM,uBAAuB,SAAS,KAAK,aAAa,SAAS,eAAe,0OAA0O,wBAAwB,qDAAqD,GAAG,IAAI,2CAA2C,2BAA2B,cAAc,EAAE,SAAS,qFAAqF,oBAAoB,gCAAgC,iEAAiE,GAAG,WAAW,oBAAoB,cAAc,GAAG,IAAI,uFAAuF,SAAS,+FAA+F,oBAAoB,yBAAyB,sDAAsD,GAAG,IAAI,4HAA4H,eAAe,qBAAqB,kDAAkD,SAAS,+EAA+E,oBAAoB,iCAAiC,kEAAkE,GAAG,IAAI,4HAA4H,eAAe,qBAAqB,gDAAgD,SAAS,+EAA+E,oBAAoB,6BAA6B,gEAAgE,+EAA+E,oDAAoD,QAAQ,MAAM,qBAAqB,IAAI,kCAAkC,8DAA8D,IAAI,WAAW,gBAAgB,EAAE,MAAM,mBAAmB,SAAS,OAAO,UAAU,gHAAgH,SAAS,KAAK,kBAAkB,EAAE,4BAA4B,mCAAmC,6BAA6B,2BAA2B,gFAAgF,YAAY,EAAE,gGAAgG,yCAAyC,wBAAwB,uDAAuD,4DAA4D,IAAI,0BAA0B,wHAAwH,yBAAyB,4BAA4B,qBAAqB,mHAAmH,0BAA0B,wCAAwC,UAAU,qDAAqD,MAAM,gBAAgB,kEAAkE,kBAAkB,GAAG,2BAA2B,QAAQ,2BAA2B,iBAAiB,qFAAqF,oBAAoB,+DAA+D,GAAG,mDAAmD,UAAU,EAAE,6BAA6B,0EAA0E,6KAA6K,4BAA4B,MAAM,4BAA4B,EAAE,GAAG,mBAAmB,yBAAyB,sCAAsC,oEAAoE,0BAA0B,GAAG,sBAAsB,qDAAqD,YAAY,IAAI,yBAAyB,sEAAsE,GAAG,yDAAyD,4BAA4B,sEAAsE,GAAG,4BAA4B,2EAA2E,sCAAsC,0BAA0B,EAAE,gCAAgC,6EAA6E,GAAG,+DAA+D,SAAS,EAAE,qCAAqC,oFAAoF,GAAG,4BAA4B,sFAAsF,iDAAiD,iBAAiB,EAAE,gCAAgC,8EAA8E,GAAG,4BAA4B,iFAAiF,4CAA4C,iBAAiB,EAAE,oBAAoB,+DAA+D,GAAG,qDAAqD,mCAAmC,2EAA2E,GAAG,gDAAgD,EAAE,iCAAiC,IAAI,kEAAkE,iBAAiB,EAAE,SAAS,qDAAqD,OAAO,sBAAsB,cAAc,2BAA2B,uEAAuE,GAAG,0DAA0D,cAAc,EAAE,0BAA0B,uEAAuE,GAAG,2DAA2D,oCAAoC,mFAAmF,GAAG,qEAAqE,8BAA8B,2EAA2E,GAAG,+DAA+D,iCAAiC,IAAI,6BAA6B,gCAAgC,6BAA6B,cAAc,wDAAwD,wBAAwB,EAAE,gEAAgE,EAAE,8FAA8F,iDAAiD,kDAAkD,SAAS,oFAAoF,EAAE,KAAK,EAAE,MAAM,yBAAyB,gFAAgF,GAAG,iDAAiD,MAAM,OAAO,GAAG,GAAG,wDAAwD,EAAE,GAAG,eAAe,UAAU,wDAAwD,yDAAyD,0DAA0D,EAAE,4BAA4B,iBAAiB,2BAA2B,kCAAkC,+CAA+C,yDAAyD,mBAAmB,cAAc,gBAAgB,4CAA4C,SAAS,yFAAyF,aAAa,cAAc,2PAA2P,yDAAyD,4BAA4B,EAAE,8FAA8F,6CAA6C,yDAAyD,iBAAiB,aAAa,iPAAiP,aAAa,IAAI,IAAI,cAAc,6BAA6B,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,eAAe,gBAAgB,4CAA4C,SAAS,0BAA0B,mSAAmS,uBAAuB,kBAAkB,kDAAkD,GAAG,qKAAqK,mBAAmB,wHAAwH,EAAE,OAAO,MAAM,qIAAqI,iBAAiB,iEAAiE,4IAA4I,EAAE,GAAG,UAAU,MAAM,6BAA6B,0BAA0B,SAAS,SAAS,MAAM,MAAM,OAAO,uCAAuC,SAAS,yCAAyC,+DAA+D,OAAO,EAAE,uEAAuE,iEAAiE,oFAAoF,2IAA2I,mDAAmD,mDAAmD,oFAAoF,4IAA4I,sDAAsD,uCAAuC,SAAS,2BAA2B,4BAA4B,yBAAyB,iBAAiB,sGAAsG,mCAAmC,qOAAqO,2DAA2D,IAAI,wEAAwE,8DAA8D,QAAQ,EAAE,+BAA+B,yFAAyF,KAAK,SAAS,gKAAgK,0BAA0B,2DAA2D,QAAQ,6BAA6B,QAAQ,GAAG,wCAAwC,kBAAkB,IAAI,kGAAkG,SAAS,OAAO,6DAA6D,qBAAqB,eAAe,uBAAuB,cAAc,0DAA0D,GAAG,IAAI,iCAAiC,SAAS,6CAA6C,oBAAoB,iEAAiE,GAAG,4EAA4E,yBAAyB,uBAAuB,mEAAmE,GAAG,oEAAoE,WAAW,GAAG,uIAAuI,SAAS,iCAAiC,uBAAuB,yBAAyB,cAAc,4DAA4D,yJAAyJ,4GAA4G,sCAAsC,+BAA+B,mCAAmC,WAAW,wBAAwB,YAAY,qEAAqE,sCAAsC,cAAc,gEAAgE,qBAAqB,uCAAuC,6DAA6D,kBAAkB,2CAA2C,8DAA8D,6BAA6B,aAAa,+BAA+B,mBAAmB,4BAA4B,qCAAqC,mFAAmF,sCAAsC,SAAS,kBAAkB,2CAA2C,SAAS,EAAE,oBAAoB,gGAAgG,iCAAiC,eAAe,ymBAAymB,0BAA0B,IAAI,YAAY,SAAS,OAAO,eAAe,qCAAqC,eAAe,yCAAyC,eAAe,uCAAuC,eAAe,8BAA8B,eAAe,qDAAqD,eAAe,oBAAoB,uCAAuC,SAAS,0RAA0R,uCAAuC,gBAAgB,EAAE,+DAA+D,2BAA2B,wCAAwC,qBAAqB,SAAS,OAAO,uCAAuC,SAAS,uBAAuB,WAAW,eAAe,yCAAyC,oBAAoB,cAAc,qBAAqB,YAAY,2BAA2B,eAAe,yBAAyB,wFAAwF,OAAO,0CAA0C,UAAU,yBAAyB,+BAA+B,wCAAwC,SAAS,EAAE,YAAY,+BAA+B,cAAc,2CAA2C,eAAe,yCAAyC,KAAK,MAAM,UAAU,iBAAiB,MAAM,QAAQ,GAAG,0CAA0C,MAAM,cAAc,GAAG,cAAc,sBAAsB,MAAM,OAAO,GAAG,YAAY,UAAU,IAAI,4DAA4D,WAAW,cAAc,8DAA8D,iEAAiE,oFAAoF,2IAA2I,mDAAmD,mDAAmD,oFAAoF,4IAA4I,sDAAsD,uCAAuC,SAAS,EAAE,2BAA2B,wCAAwC,iCAAiC,mBAAmB,wNAAwN,8BAA8B,2QAA2Q,YAAY,aAAa,0BAA0B,sCAAsC,EAAE,qDAAqD,GAAG,MAAM,cAAc,6CAA6C,gCAAgC,SAAS,mFAAmF,uBAAuB,eAAe,gGAAgG,kBAAkB,WAAW,kCAAkC,iBAAiB,qGAAqG,yDAAyD,kEAAkE,iCAAiC,+CAA+C,2BAA2B,+BAA+B,EAAE,EAAE,GAAG,uBAAuB,4GAA4G,uBAAuB,MAAM,iBAAiB,MAAM,uBAAuB,mBAAmB,qEAAqE,gEAAgE,yBAAyB,KAAK,6FAA6F,2FAA2F,mBAAmB,4DAA4D,oFAAoF,+DAA+D,iBAAiB,OAAO,aAAa,oGAAoG,IAAI,SAAS,+BAA+B,mBAAmB,mFAAmF,GAAG,wBAAwB,qBAAqB,EAAE,mBAAmB,iDAAiD,eAAe,4BAA4B,4CAA4C,cAAc,YAAY,cAAc,4GAA4G,GAAG,0BAA0B,6BAA6B,yBAAyB,2DAA2D,oGAAoG,4BAA4B,uBAAuB,EAAE,aAAa,mDAAmD,iBAAiB,6BAA6B,wBAAwB,wCAAwC,MAAM,uBAAuB,2BAA2B,oBAAoB,0FAA0F,uJAAuJ,gCAAgC,iCAAiC,wGAAwG,UAAU,iDAAiD,mBAAmB,4BAA4B,yBAAyB,wBAAwB,EAAE,+CAA+C,qCAAqC,iBAAiB,gBAAgB,yBAAyB,gCAAgC,GAAG,yCAAyC,SAAS,IAAI,2EAA2E,qBAAqB,oFAAoF,4IAA4I,qDAAqD,uBAAuB,iEAAiE,oFAAoF,2IAA2I,mDAAmD,oDAAoD,aAAa,UAAU,sCAAsC,eAAe,gEAAgE,mDAAmD,qFAAqF,4CAA4C,EAAE,cAAc,wBAAwB,mBAAmB,8BAA8B,+CAA+C,6CAA6C,UAAU,kBAAkB,UAAU,UAAU,gCAAgC,SAAS,OAAO,uCAAuC,SAAS,4BAA4B,cAAc,yBAAyB,wBAAwB,6HAA6H,OAAO,mFAAmF,kEAAkE,wCAAwC,SAAS,EAAE,oCAAoC,YAAY,oCAAoC,cAAc,4DAA4D,2BAA2B,yDAAyD,mBAAmB,2CAA2C,0BAA0B,SAAS,yBAAyB,2CAA2C,2BAA2B,2CAA2C,kBAAkB,2CAA2C,mBAAmB,2CAA2C,mBAAmB,2CAA2C,mBAAmB,2CAA2C,gBAAgB,2BAA2B,gBAAgB,2CAA2C,mBAAmB,0BAA0B,sBAAsB,2CAA2C,gBAAgB,2CAA2C,2BAA2B,2CAA2C,uBAAuB,4BAA4B,gBAAgB,2CAA2C,SAAS,qBAAqB,2BAA2B,OAAO,SAAS,aAAa,aAAa,6BAA6B,mBAAmB,iBAAiB,YAAY,0BAA0B,4BAA4B,gDAAgD,UAAU,oBAAoB,eAAe,gHAAgH,OAAO,mBAAO,CAAC,qFAAoB,EAAE,6CAA6C,yBAAyB,WAAW,EAAE,oJAAoJ,4PAA4P,YAAY,kBAAkB,sKAAsK,MAAM,UAAU,kBAAkB,iCAAiC,mGAAmG,GAAG,qBAAqB,uFAAuF,GAAG,qCAAqC,GAAG,wBAAwB,OAAO,IAAI,8BAA8B,cAAc,WAAW,cAAc,aAAa,8BAA8B,mDAAmD,0BAA0B,SAAS,+BAA+B,kEAAkE,mGAAmG,MAAM,wBAAwB,kCAAkC,yHAAyH,kCAAkC,wBAAwB,iCAAiC,yBAAyB,mCAAmC,8BAA8B,cAAc,iBAAiB,uBAAuB,EAAE,uCAAuC,SAAS,2BAA2B,SAAS,8CAA8C,EAAE,KAAK,0BAA0B,SAAS,MAAM,sDAAsD,GAAG,oDAAoD,UAAU,cAAc,4BAA4B,qCAAqC,SAAS,kFAAkF,QAAQ,IAAI,SAAS,eAAe,OAAO,eAAe,cAAc,wCAAwC,wBAAwB,aAAa,MAAM,MAAM,2BAA2B,IAAI,gBAAgB,GAAG,mFAAmF,UAAU,KAAK,cAAc,eAAe,oLAAoL,mBAAmB,OAAO,6BAA6B,8BAA8B,IAAI,8BAA8B,IAAI,sBAAsB,GAAG,eAAe,WAAW,IAAI,oCAAoC,MAAM,iDAAiD,cAAc,gCAAgC,sBAAsB,MAAM,SAAS,+CAA+C,MAAM,uBAAuB,IAAI,kCAAkC,YAAY,sDAAsD,GAAG,GAAG,sEAAsE,SAAS,aAAa,EAAE,KAAK,wBAAwB,mBAAmB,GAAG,gCAAgC,EAAE,sBAAsB,0DAA0D,oEAAoE,EAAE,kLAAkL,uHAAuH,MAAM,GAAG,SAAS,wDAAwD,UAAU,GAAG,QAAQ,GAAG,SAAS,+DAA+D,SAAS,uCAAuC,oBAAoB,mBAAmB,0CAA0C,wDAAwD,SAAS,gKAAgK,uDAAuD,uBAAuB,iBAAiB,KAAK,SAAS,kBAAkB,iCAAiC,SAAS,mEAAmE,UAAU,IAAI,CAAC,qBAAqB;;;;;;;;;;;;ACA5qoL,MAAM,mBAAO,CAAC,qFAAoB,IAAI,mBAAO,CAAC,+DAAM,IAAI,mBAAO,CAAC,yEAAe,EAAE,mBAAO,CAAC,mDAAS,EAAE,mBAAO,CAAC,mDAAQ,EAAE,mBAAO,CAAC,mDAAQ,EAAE,QAAQ,MAAM,sCAAsC,SAAS,4CAA4C,qBAAqB,WAAW,EAAE,sBAAsB,8EAA8E,EAAE,yDAAyD,MAAM,qEAAqE,6FAA6F,iEAAiE,oFAAoF,2IAA2I,mDAAmD,gFAAgF,oFAAoF,4IAA4I,sDAAsD,sCAAsC,SAAS,EAAE,oCAAoC,UAAU,QAAQ,eAAe,uDAAuD,OAAO,0BAA0B,2BAA2B,UAAU,EAAE,kTAAkT,+BAA+B,2BAA2B,sBAAsB,EAAE,kBAAkB,aAAa,GAAG,0BAA0B,OAAO,4EAA4E,oBAAoB,aAAa,GAAG,4BAA4B,+GAA+G,2BAA2B,iBAAiB,aAAa,EAAE,+CAA+C,yBAAyB,gCAAgC,oCAAoC,qCAAqC,mCAAmC,2BAA2B,gCAAgC,mCAAmC,wLAAwL,2CAA2C,qCAAqC,qCAAqC,yCAAyC,uDAAuD,2BAA2B,2BAA2B,wBAAwB,cAAc,wCAAwC,kEAAkE,8BAA8B,aAAa,EAAE,8DAA8D,+BAA+B,MAAM,aAAa,GAAG,oDAAoD,GAAG,iBAAiB,mCAAmC,6BAA6B,oBAAoB,wBAAwB,+BAA+B,+BAA+B,iCAAiC,qCAAqC,uBAAuB,cAAc,eAAe,2EAA2E,0BAA0B,8FAA8F,EAAE,IAAI,UAAU,SAAS,sCAAsC,SAAS,EAAE,0BAA0B,uBAAuB,SAAS,sCAAsC,SAAS,EAAE,0BAA0B,qBAAqB,eAAe,iBAAiB,wBAAwB,SAAS,+BAA+B,OAAO,iCAAiC,OAAO,6BAA6B,gDAAgD,SAAS,KAAK,SAAS,sCAAsC,SAAS,EAAE,yBAAyB,8MAA8M,SAAS,0CAA0C,IAAI,gBAAgB,IAAI,cAAc,IAAI,8OAA8O,mBAAmB,4FAA4F,2BAA2B,oBAAoB,sFAAsF,mEAAmE,6QAA6Q,iHAAiH,8EAA8E,GAAG,gBAAgB,sCAAsC,iBAAiB,oCAAoC,WAAW,oCAAoC,YAAY,kCAAkC,qBAAqB,2CAA2C,sBAAsB,yCAAyC,WAAW,oCAAoC,YAAY,kCAAkC,UAAU,gCAAgC,WAAW,8BAA8B,iBAAiB,2CAA2C,kBAAkB,yCAAyC,mBAAmB,6CAA6C,oBAAoB,2CAA2C,gCAAgC,iBAAiB,QAAQ,iBAAiB,0CAA0C,4CAA4C,oBAAoB,MAAM,gDAAgD,QAAQ,mBAAmB,4BAA4B,EAAE,iBAAiB,MAAM,oCAAoC,OAAO,2FAA2F,EAAE,iDAAiD,uCAAuC,6CAA6C,6CAA6C,uDAAuD,gFAAgF,oBAAoB,sBAAsB,EAAE,wCAAwC,uBAAuB,0GAA0G,mBAAmB,sCAAsC,wCAAwC,qEAAqE,kBAAkB,yBAAyB,oBAAoB,cAAc,GAAG,4BAA4B,wBAAwB,SAAS,gDAAgD,mBAAmB,UAAU,EAAE,sSAAsS,WAAW,2CAA2C,aAAa,0BAA0B,EAAE,2CAA2C,iBAAiB,2CAA2C,aAAa,2CAA2C,eAAe,2CAA2C,kBAAkB,2CAA2C,yBAAyB,mBAAmB,WAAW,kCAAkC,qBAAqB,EAAE,eAAe,4BAA4B,SAAS,sDAAsD,YAAY,yBAAyB,uBAAuB,2CAA2C,gBAAgB,sBAAsB,iBAAiB,iCAAiC,6EAA6E,eAAe,oBAAoB,EAAE,sDAAsD,mCAAmC,SAAS,IAAI,UAAU,yBAAyB,iFAAiF,eAAe,2EAA2E,uDAAuD,6BAA6B,GAAG,KAAK,IAAI,QAAQ,mBAAmB,oEAAoE,wBAAwB,4GAA4G,MAAM,sBAAsB,4CAA4C,oCAAoC,mCAAmC,oDAAoD,2BAA2B,6BAA6B,+BAA+B,4CAA4C,cAAc,aAAa,QAAQ,eAAe,sFAAsF,oCAAoC,IAAI,kGAAkG,uMAAuM,waAAwa,eAAe,iCAAiC,cAAc,OAAO,qEAAqE,sGAAsG,6BAA6B;;;;;;;;;;;;ACA18V;;AAEZ,kBAAkB;AAClB,mBAAmB;AACnB,qBAAqB;;AAErB;AACA;AACA;;AAEA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,cAAc,SAAS;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2CAA2C,UAAU;AACrD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;ACrJA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEY;;AAEZ,eAAe,mBAAO,CAAC,wDAAW;AAClC,gBAAgB,mBAAO,CAAC,oDAAS;AACjC;AACA;AACA;AACA;;AAEA,cAAc;AACd,kBAAkB;AAClB,yBAAyB;;AAEzB;AACA,kBAAkB;;AAElB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,YAAY;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA,wCAAwC,SAAS;AACjD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;;AAEA;AACA;AACA,cAAc,iBAAiB;AAC/B;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iDAAiD,EAAE;AACnD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,SAAS;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB,eAAe;AACxC;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,yBAAyB,QAAQ;AACjC;AACA,sBAAsB,eAAe;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,sBAAsB,SAAS;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB,sBAAsB;AACxC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,mBAAmB;AACnB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA,qBAAqB,WAAW,GAAG,IAAI;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,gBAAgB,WAAW,GAAG,IAAI,KAAK,aAAa;AACpD;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAgB,MAAM;AACtB;;AAEA;AACA,GAAG;AACH;AACA;AACA,mBAAmB,KAAK,mDAAmD,cAAc;AACzF,GAAG;AACH;AACA;AACA,+BAA+B,IAAI;AACnC;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,MAAM,aAAa,SAAS;AACtD;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,SAAS,gBAAgB;AACzB,cAAc,oBAAoB,EAAE,IAAI;AACxC;AACA,YAAY,gBAAgB,EAAE,IAAI;AAClC;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,GAAG,SAAS,GAAG,KAAK,qBAAqB,EAAE,EAAE;AACpE,QAAQ;AACR,yBAAyB,GAAG,KAAK,yBAAyB,EAAE,EAAE;AAC9D,mBAAmB,yBAAyB,EAAE,EAAE;AAChD;AACA,MAAM;AACN,oBAAoB,IAAI,EAAE,GAAG,SAAS,IAAI,EAAE,EAAE;AAC9C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,0CAA0C,cAAc,SAAS,OAAO;AACxE;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,YAAY;AAC9B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,cAAc,YAAY;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kBAAkB,QAAQ;AAC1B;AACA,oBAAoB,QAAQ;AAC5B;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;;;;;;ACzjEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,sBAAsB;AACxC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA,eAAe;AACf;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA,IAAI;AACJ;AACA;AACA,oBAAoB,SAAS;AAC7B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA,MAAM;AACN;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;;AAEA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,QAAQ;AACR;AACA,uCAAuC,QAAQ;AAC/C;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAM;AACN;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,OAAO;AACzB;AACA;AACA;;AAEA;AACA,SAAS,yBAAyB;AAClC;AACA;AACA;;AAEA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,8DAA8D,YAAY;AAC1E;AACA,8DAA8D,YAAY;AAC1E;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA,qCAAqC,YAAY;AACjD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,IAAI;AACJ;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AChfmC;AACS;AAC4B;AACX;AACN;AACT;AACN;AACG;AACO;AACQ;AACJ;AACC;AACd;AACW;AACI;AACR;AACR;AACoB;AAC3B;AACmB;AACpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpB8D;AACyC;AACnD;AACI;AAC2B;AAC+J;AAClP;AACO;AACP;AACA;AACA;AACA;AACA,iBAAiB,kDAAQ;AACzB,0BAA0B,sEAAkB;AAC5C,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB;AACA,iBAAiB,kDAAQ;AACzB;AACA,iBAAiB,kDAAQ;AACzB;AACA;AACA,0BAA0B,wEAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,gEAAkB;AACrC;AACA;AACA;AACA;AACA,2BAA2B,gEAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sDAAY,UAAU,sDAAY;AACtE;AACA;AACA;AACA;AACA,6BAA6B,uBAAuB,sDAAY;AAChE;AACA;AACA;AACA,iCAAiC,wBAAwB,sDAAY;AACrE;AACA;AACA,kCAAkC,4EAAwB;AAC1D;AACA;AACA;AACA;AACA;AACA,6BAA6B,oBAAoB,sDAAY;AAC7D;AACA;AACA,6BAA6B,MAAM,gEAAkB,0BAA0B,gEAAkB;AACjG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sDAAY;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,0BAA0B,sDAAY;AACnE;AACA;AACA,6BAA6B,2BAA2B,sDAAY;AACpE;AACA;AACA;AACA,yBAAyB,MAAM,gEAAkB,6BAA6B,gEAAkB;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,kDAAQ;AACvC;AACA;AACA;AACA,+BAA+B,kDAAQ;AACvC;AACA;AACA;AACA,+BAA+B,kDAAQ;AACvC;AACA;AACA;AACA,+BAA+B,kDAAQ;AACvC;AACA;AACA;AACA,+BAA+B,kDAAQ;AACvC;AACA;AACA,CAAC,gCAAgC;AACjC;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mLAAmL,kEAAoB;AACvM;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,uEAAuE;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,gEAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gEAAkB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA,CAAC,gDAAgD;AACjD;AACO;AACP;AACA;AACA;AACA;AACA,gBAAgB,gBAAgB;AAChC,gBAAgB,iBAAiB;AACjC,gBAAgB,uCAAuC;AACvD;AACA,kBAAkB,kDAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,gEAAkB;AACxG,gGAAgG,qEAAuB;AACvH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kDAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wEAA0B;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA,qBAAqB,gEAAkB;AACvC,8BAA8B,+DAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA,CAAC,0CAA0C;AAC3C;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,iBAAiB;AACrC,oBAAoB,uCAAuC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0FAA0F,gEAAkB;AAC5G,kGAAkG,yEAA2B;AAC7H;AACA;AACA;AACA,oGAAoG;AACpG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kDAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,wEAA0B;AAC9C;AACA,4BAA4B,6DAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kDAAkD;AACnD;AACO;AACP;AACA;AACA;AACA,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB;AACA,iBAAiB,kDAAQ;AACzB;AACA;AACA,0BAA0B,wEAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,iBAAiB;AACjC,gBAAgB,uCAAuC;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,gEAAkB;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA,8BAA8B,sEAAkB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,wEAAoB;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA,qBAAqB,2EAA6B;AAClD,8BAA8B,+DAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA,qBAAqB,kDAAQ;AAC7B,qBAAqB,kDAAQ;AAC7B;AACA;AACA,qBAAqB,kDAAQ;AAC7B;AACA;AACA,qBAAqB,kDAAQ;AAC7B;AACA;AACA;AACA,8BAA8B,wEAAoB;AAClD;AACA;AACA;AACA;AACA;AACA,CAAC,sDAAsD;AACvD;AACO;AACP;AACA;AACA;AACA,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB;AACA,iBAAiB,kDAAQ;AACzB;AACA;AACA,0BAA0B,wEAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,oEAAsB;AACvC,0BAA0B,sEAAkB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,kDAAQ;AAC7B,qBAAqB,kDAAQ;AAC7B;AACA,qBAAqB,kDAAQ;AAC7B;AACA,qBAAqB,kDAAQ;AAC7B;AACA;AACA,8BAA8B,wEAAoB;AAClD;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AACzC;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,wKAAwK,kEAAoB;AAC5L,oJAAoJ,kEAAoB;AACxK,wJAAwJ,kEAAoB;AAC5K,wKAAwK,kEAAoB;AAC5L,gKAAgK,kEAAoB;AACpL,oJAAoJ,kEAAoB;AACxK,8JAA8J,kEAAoB;AAClL,kKAAkK,kEAAoB;AACtL,wJAAwJ,kEAAoB;AAC5K,gJAAgJ,kEAAoB;AACpK;AACA;AACA;AACA;AACA,KAAK,iEAAiE;AACtE;AACA;AACA;AACA;AACA;AACA,oBAAoB,iEAAiE;AACrF,oBAAoB,+DAA+D;AACnF;AACA,oJAAoJ,kEAAoB;AACxK,4JAA4J,kEAAoB;AAChL;AACA;AACA;AACA;AACA,sJAAsJ,kEAAoB;AAC1K,0JAA0J,kEAAoB;AAC9K,4JAA4J,kEAAoB;AAChL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,MAAM,kEAAoB,qDAAqD,kEAAoB;AAC5H;AACA;AACA,0CAA0C,sDAAY;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,MAAM,kEAAoB,oDAAoD,kEAAoB;AAC3H;AACA;AACA,yCAAyC,sDAAY;AACrD;AACA;AACA;AACA,KAAK,uEAAuE;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,kEAAoB;AACrE;AACA;AACA,2BAA2B,kEAAoB;AAC/C;AACA;AACA;AACA;AACA,uUAAuU,kEAAoB;AAC3V,gOAAgO,kEAAoB;AACpP,+UAA+U,kEAAoB;AACnW,mUAAmU,kEAAoB;AACvV,0OAA0O,kEAAoB;AAC9P,mPAAmP,kEAAoB;AACvQ;AACA;AACA;AACA;AACA,KAAK,2DAA2D;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,kEAAoB;AAC1C;AACA,oBAAoB,kEAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,WAAW;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wEAA0B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,uEAAuE;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,kEAAoB;AAC1C,oBAAoB,kEAAoB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,6BAA6B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gDAAgD;AACjD;AACO;AACP,YAAY,sEAAsE,EAAE,8EAAgC;AACpH;AACA;AACA,kBAAkB,sEAAkB,IAAI,4DAAW,wCAAwC,IAAI,WAAW;AAC1G;AACA;AACA,yBAAyB,sDAAY;AACrC;AACA,sBAAsB,sEAAkB,IAAI,4DAAW,kCAAkC,IAAI,WAAW;AACxG;AACA;AACA;AACA,0BAA0B,sEAAkB,IAAI,4DAAW,sCAAsC,IAAI,WAAW;AAChH;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACO;AACP,+BAA+B,sDAAY;AAC3C;AACA;AACO;AACP;AACA;AACA;AACA;AACA,mCAAmC,sDAAY;AAC/C;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;AC/1B6E;AACnB;AACoB;AAC7B;AACjD;AACO;AACP;AACA;AACA,cAAc,kDAAQ;AACtB;AACA;AACA,kBAAkB,sDAAY;AAC9B;AACA,qBAAqB,sDAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB;AACA,iBAAiB,kDAAQ;AACzB;AACA,iBAAiB,kDAAQ;AACzB;AACA;AACA,0BAA0B,wEAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAQ;AACzB,0BAA0B,+DAAW,iBAAiB;AACtD,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB;AACA,iBAAiB,kDAAQ;AACzB;AACA,iBAAiB,kDAAQ;AACzB;AACA;AACA,0BAA0B,wEAAoB;AAC9C;AACA;AACA;AACA;AACA,mCAAmC,kDAAQ;AAC3C;AACA;AACA;AACA,mCAAmC,kDAAQ;AAC3C;AACA;AACA;AACA;AACA,mCAAmC,kDAAQ;AAC3C;AACA;AACA,CAAC,gDAAgD;AACjD;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,uFAAuF;AAC5F,CAAC,gEAAgE;AACjE;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kDAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,0DAA0D;AAC3D;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,6DAAe;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kDAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,6DAAe,GAAG;AACjC;AACA;AACA,CAAC,kEAAkE;AACnE;AACO;AACP;AACA;AACA;AACA,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB;AACA,iBAAiB,kDAAQ;AACzB;AACA;AACA,0BAA0B,wEAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sEAAsE;AACvE;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB;AACA,iBAAiB,kDAAQ;AACzB;AACA;AACA,0BAA0B,wEAAoB;AAC9C;AACA;AACA;AACA,CAAC,wDAAwD;AACzD;AACO;AACP;AACA;AACA;AACA;AACA,kBAAkB,kDAAQ;AAC1B;AACA;AACA,sBAAsB,sDAAY;AAClC;AACA,yBAAyB,sDAAY;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4DAA4D;AAC7D;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wDAAc;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,iFAAiF;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,sDAAY;AAClD;AACA,qCAAqC,sDAAY;AACjD;AACA;AACA;AACA;AACA,KAAK,uFAAuF;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,8CAAI;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,2EAA2E;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kEAAc;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,kEAAc;AAC7B;AACA;AACA,CAAC,oDAAoD;AACrD;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,uFAAuF;AAC5F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gEAAgE;AACjE;;;;;;;;;;;;;;;;;;;;ACzdmE;AACS;AACtB;AACoB;AACK;AAC/E;AACO,iCAAiC,8DAAY;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB,mBAAmB;AACnB,mBAAmB;AACnB,mCAAmC,gDAAgD;AACnF,0BAA0B;AAC1B,0BAA0B;AAC1B,oBAAoB;AACpB,sBAAsB;AACtB,gBAAgB;AAChB,kBAAkB;AAClB,0BAA0B;AAC1B,qBAAqB;AACrB,oBAAoB;AACpB,kBAAkB;AAClB;AACA,yBAAyB;AACzB;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,2CAA2C;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,+DAAW;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uEAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sCAAsC;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,sDAAU;AACvB;AACA;AACA;AACA,2BAA2B,+DAAmB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,8BAA8B,wDAAU;AACxC;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uDAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAe;AACvB,QAAQ,8DAAgB;AACxB,8BAA8B,uDAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uDAAa;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,6DAAe;AAC3B,YAAY,8DAAgB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,mEAAyB;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACvZiE;AACH;AAC2B;AACnC;AACoB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,4BAA4B,8DAAY;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C,wDAAU,GAAG;AAC1D;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,kCAAkC,sEAAkB;AACpD;AACA;AACA;AACA;AACA;AACA;AACA,mFAAmF,eAAe;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI,eAAe;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,yDAAW;AAC5D,uBAAuB,yEAAoB;AAC3C;AACA;AACA;AACA;AACA,qEAAqE,6DAAe;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;ACrSyF;AAClD;AACe;AAChB;AACU;AAChD;AACA;AACA;AACA;AACA;AACA;AACO,wBAAwB,8DAAY;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,+CAAK;AACjD;AACA;AACA,iBAAiB,8CAAI,QAAQ,8CAAI;AACjC;AACA;AACA;AACA,mCAAmC,4DAAc;AACjD,kCAAkC,4DAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4DAAc;AACjD,kCAAkC,4DAAc;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,4DAAc;AAClD,qCAAqC,4DAAc;AACnD;AACA;AACA,kDAAkD,4DAAc;AAChE,mDAAmD,4DAAc;AACjE;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;ACxNoF,CAAC;AACX;AACX;AACP;AACN;AACI;AACb;AACzC;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,kFAA6B;AACjE,2CAA2C,0DAAU;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,8DAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,+DAAyB;AAC5D,kCAAkC,gEAAa;AAC/C;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA,kCAAkC,kDAAS;AAC3C;AACA;AACA,0BAA0B,uEAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;;;;;;;;;;;;;;;;AChJ6E;AAC7E;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,4DAAc;AACjD,kCAAkC,4DAAc;AAChD,oCAAoC,4DAAc;AAClD,qCAAqC,4DAAc;AACnD;AACA;AACA;AACA,QAAQ,yEAA2B;AACnC;AACA;AACA;;;;;;;;;;;;;;;AC1BA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4EAA4E,eAAe;AAC3F,sFAAsF,eAAe;AACrG;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC7BoE;AACd;AAChB;AACuC;AAC9B;AACE;AACjD;AACA;AACA;AACA;AACO,qBAAqB,8DAAY;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,0DAAa;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uEAAuE,eAAe;AACtF,iFAAiF,eAAe;AAChG;AACA,yFAAyF,eAAe;AACxG;AACA;AACA,0CAA0C,wDAAY;AACtD;AACA;AACA,qCAAqC,wDAAY;AACjD;AACA;AACA;AACA;AACA;AACA,uCAAuC,wDAAY;AACnD;AACA;AACA;AACA;AACA;AACA,oCAAoC,wDAAY;AAChD;AACA;AACA;AACA;AACA,kEAAkE;AAClE,iBAAiB;AACjB,iBAAiB;AACjB,2BAA2B;AAC3B,0BAA0B;AAC1B,mBAAmB;AACnB,iBAAiB;AACjB,gCAAgC;AAChC,oBAAoB;AACpB,iCAAiC;AACjC,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8CAAI,QAAQ,8CAAI;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yEAA2B;AACvC;AACA;AACA,YAAY,yEAA2B;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,4DAAc;AAC1D;AACA;AACA;AACA,6CAA6C,4DAAc;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,4EAAwB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,4EAAwB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yEAA2B;AACvC;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,4EAAwB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACzWsD;AACN;AAChD;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,4DAAc;AACxD,6CAA6C,4DAAc;AAC3D;AACA,yCAAyC,4DAAc;AACvD;AACA;AACA,2CAA2C,4DAAc;AACzD,4CAA4C,4DAAc;AAC1D;AACA,wCAAwC,4DAAc;AACtD;AACA;AACA,iCAAiC,8DAAY;AAC7C;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;ACrCoE;AACd;AACtD;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0EAA0E,eAAe;AACzF,oFAAoF,eAAe;AACnG;AACA,qFAAqF,eAAe;AACpG,+FAA+F,eAAe;AAC9G,gGAAgG,eAAe;AAC/G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,8BAA8B;AAC9B,0BAA0B;AAC1B,yBAAyB,iCAAiC;AAC1D,wBAAwB;AACxB,oBAAoB;AACpB,yBAAyB;AACzB,yBAAyB;AACzB,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA,0BAA0B,4EAAwB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,8DAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACjQuD;AACS;AACpC;AAC5B;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,qBAAqB;AACrB,gCAAgC;AAChC,oBAAoB;AACpB,4BAA4B;AAC5B,2BAA2B;AAC3B;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,wBAAwB,qCAAG;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,+DAAW;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,OAAO;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,4DAAc;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,4DAAc;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,QAAQ;AACpD,0FAA0F,4DAAc;AACxG,qEAAqE,4DAAc;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;ACvOA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;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;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACrCA;AACA;AACA;AACA,iBAAiB,KAAK,IAAI,KAAK,EAAE,4CAA4C;AAC7E;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA,0CAA0C,cAAc,EAAE,4CAA4C;AACtG;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC9BuE;AACT;AACkB;AAC7B;AAC4G;AAC9G;AACjD;AACO,2BAA2B,0DAAa;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,oBAAoB;AACpB,WAAW;AACX;AACA;AACA;AACA,sBAAsB,4DAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,4DAAW;AACvC;AACA;AACA;AACA,sBAAsB,6DAAS,IAAI,4DAAW,uCAAuC,IAAI,SAAS;AAClG;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,6DAAS;AAC/B;AACA;AACA;AACA,sBAAsB,6DAAS,IAAI,4DAAW,uCAAuC,IAAI,SAAS;AAClG;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,oDAAoD,+CAA+C;AACnG,QAAQ,mDAAmD;AAC3D,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,+CAA+C;AACnG,QAAQ,mDAAmD;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gFAA2B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gFAA2B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,6DAAe,GAAG;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+DAAW;AACzC;AACA;AACA;AACA;AACA,8BAA8B,4EAAwB;AACtD;AACA;AACA;AACA;AACA;AACA,kCAAkC,6DAAS,IAAI,4DAAW,qDAAqD,IAAI,SAAS;AAC5H;AACA;AACA,wBAAwB,2EAA6B;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,+DAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA,0BAA0B,6DAAS,CAAC,4DAAW;AAC/C;AACA;AACA;AACA;AACA,yCAAyC,4DAAc;AACvD;AACA,wCAAwC,4DAAc;AACtD,gBAAgB,6DAAe;AAC/B,gBAAgB,8DAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA,0BAA0B,6DAAS,CAAC,4DAAW;AAC/C;AACA;AACA,gBAAgB,yEAA2B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA,0BAA0B,6DAAS,CAAC,4DAAW;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;ACtSoG;AAC9B;AACP;AACrB;AACmD;AAChD;AAC7C;AACO,4BAA4B,sDAAW;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,8EAAkB;AAChD;AACA,mCAAmC,2CAA2C;AAC9E,0BAA0B;AAC1B,0BAA0B;AAC1B,2BAA2B;AAC3B;AACA,gCAAgC;AAChC,sBAAsB;AACtB,sBAAsB;AACtB,uBAAuB;AACvB,yBAAyB;AACzB,kBAAkB;AAClB,gBAAgB;AAChB,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,kDAAQ;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,+EAA0B;AAC9C,2BAA2B,gFAA2B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,6DAAe;AACvB,QAAQ,8DAAgB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB,EAAE,sEAAwB;AAC9D;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;ACzL6C;AACtC,sCAAsC,sDAAW;AACxD;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;ACb4E;AACtB;AACoB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACO,0BAA0B,8DAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,eAAe;AACf,oBAAoB;AACpB;AACA,2BAA2B;AAC3B,mBAAmB;AACnB,yBAAyB;AACzB,uBAAuB;AACvB,oBAAoB;AACpB,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uEAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,+DAAW;AACjC;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,uEAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,yDAAW;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yEAA2B;AACvC;AACA,4BAA4B,+BAA+B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,yEAA2B;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,8DAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,8DAAY;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;;;;ACzZ8C;AACwH;AAC1F;AACpB;AACqC;AAC5C;AACqB;AACzB;AACC;AAC9C;AACA;AACA;AACA;AACA;AACA;AACO,yBAAyB,+EAAuB;AACvD;AACA,6BAA6B,6EAAwB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,+DAAW;AACrC;AACA;AACA;AACA;AACA;AACA,oDAAoD;AACpD;AACA;AACA;AACA;AACA,mCAAmC,sDAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sDAAU;AAC7C;AACA;AACA;AACA;AACA,wCAAwC,0DAAa;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA,gBAAgB,2EAAsB;AACtC;AACA;AACA;AACA,0BAA0B,+DAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA,YAAY,6DAAe;AAC3B,YAAY,8DAAgB;AAC5B;AACA;AACA,gBAAgB,6DAAe;AAC/B,gBAAgB,8DAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA,kEAAkE;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,uEAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4EAAuB;AACtD;AACA;AACA,gCAAgC,+EAA0B;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,kDAAQ,6BAA6B,kDAAQ;AAClF,mCAAmC,4EAAuB;AAC1D;AACA;AACA;AACA;AACA,+CAA+C,kDAAQ,OAAO,kDAAQ;AACtE;AACA;AACA,oCAAoC,uDAAW;AAC/C,mCAAmC,uEAAkB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sDAAY;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sDAAY;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,+DAAW;AAC7B;AACA;AACA;AACA;AACA;AACA,kBAAkB,+DAAW;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,sDAAW;AAC3B;AACA;AACA;AACA,oBAAoB,sDAAW;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gBAAgB,EAAE,sEAAwB;AAC1D,QAAQ,6DAAe;AACvB,QAAQ,8DAAgB;AACxB;AACA;AACA;AACA;AACA,YAAY,6DAAe;AAC3B,YAAY,8DAAgB;AAC5B;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,oBAAoB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,iDAAiD;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,gCAAgC;AACjC;;;;;;;;;;;;;;;;;;;;;AC3V8C;AACE;AAC4B;AACpB;AACwG;AACnH;AAC7C;AACO,0BAA0B,sDAAW;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kDAAQ;AACzB,iBAAiB,kDAAQ;AACzB;AACA;AACA;AACA,0BAA0B,+DAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,sDAAW,0BAA0B,sDAAU;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sDAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA,wBAAwB,kCAAkC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA,gBAAgB,6DAAe;AAC/B,gBAAgB,8DAAgB;AAChC;AACA;AACA,gBAAgB,6DAAe;AAC/B,gBAAgB,8DAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,6CAA6C,EAAE,sEAAwB;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA,yCAAyC,sDAAY;AACrD;AACA;AACA;AACA,0BAA0B,+DAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA,qBAAqB,sDAAY;AACjC;AACA;AACA;AACA,qBAAqB,sDAAY;AACjC;AACA;AACA;AACA;AACA;AACA,8BAA8B,+DAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,oCAAoC;AACpE;AACA;AACA,2CAA2C,sDAAY;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,oCAAoC;AACxE;AACA;AACA,+CAA+C,sDAAY;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8BAA8B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,oCAAoC;AAChE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,2BAA2B;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8BAA8B;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,wDAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C,sDAAY;AACxD;AACA;AACA;AACA,0BAA0B,+DAAW;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,4DAAc;AAC1C,0BAA0B,4DAAc;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA,6BAA6B,4DAAc;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA,+BAA+B,4DAAc;AAC7C,8BAA8B,4DAAc;AAC5C;AACA;AACA;AACA;AACA,yCAAyC,4DAAc;AACvD,0CAA0C,4DAAc;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,6DAAe;AAClC;AACA;AACA,mBAAmB,8DAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,6DAAe;AAClC;AACA;AACA,mBAAmB,8DAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;AACnC;;;;;;;;;;;;;;;;;;;;;;;;;AC5lB8C;AACsE;AACxE;AAC0D;AAChD;AACmC;AACc;AACtD;AACqB;AACzB;AAC7C;AACO,oBAAoB,+EAAuB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE;AACjE;AACA;AACA,yGAAyG;AACzG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,8CAAI;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oDAAM;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;AAClC,mBAAmB;AACnB,uBAAuB;AACvB,uBAAuB;AACvB,iCAAiC;AACjC;AACA,kCAAkC;AAClC;AACA,gCAAgC;AAChC,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA,iEAAiE,8BAA8B,MAAM,QAAQ;AAC7G;AACA;AACA,gCAAgC,sBAAsB;AACtD;AACA,iDAAiD,0DAAa;AAC9D,4FAA4F,GAAG,MAAM,QAAQ;AAC7G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,4CAA4C;AACrE;AACA,aAAa,sDAAW;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,4CAA4C;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sDAAU;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,+DAAW,cAAc;AAC/C;AACA,qCAAqC,0DAAa;AAClD,sBAAsB,+DAAW,eAAe;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA,2CAA2C,0DAAa;AACxD;AACA;AACA;AACA,8BAA8B,+DAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA,2CAA2C,0DAAa;AACxD;AACA;AACA;AACA,8BAA8B,+DAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,2BAA2B;AACtG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,4EAAwB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,4EAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,kDAAQ,6BAA6B,kDAAQ;AAC9E,+BAA+B,4EAAuB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,kDAAQ,UAAU,kDAAQ;AAChE,+BAA+B,uEAAkB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sDAAY;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sEAAwB;AACpD;AACA,gEAAgE,mEAAyB,SAAS,mEAAyB;AAC3H;AACA;AACA,sDAAsD,4DAAc;AACpE,uDAAuD,4DAAc;AACrE,4BAA4B,8BAA8B;AAC1D,2DAA2D,4DAAc;AACzE,4DAA4D,4DAAc;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,yEAA2B;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA,0BAA0B,uEAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,8DAAY;AACtC,kCAAkC,8DAAY;AAC9C;AACA;AACA;AACA;AACA,0BAA0B,8DAAY;AACtC,kCAAkC,8DAAY;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,+EAA0B;AAC7C;AACA;AACA;AACA,yBAAyB,+EAA0B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sBAAsB;AACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACp0B2D;AACiD;AAClD;AACR;AACE;AACmB;AACD;AACT;AAC8D;AACpE;AACJ;AACF;AACG;AACd;AACmB;AACJ;AACR;AACmB;AACP;AACoD;AAC7G;AACA;AACA;AACA;AACO,4BAA4B,8DAAY;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,sDAAQ;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,4DAAW;AACnB,QAAQ,kEAAc;AACtB;AACA;AACA;AACA;AACA,sBAAsB;AACtB,0BAA0B;AAC1B;AACA,uBAAuB;AACvB,mCAAmC,wCAAwC;AAC3E,iBAAiB;AACjB,wBAAwB;AACxB;AACA,gCAAgC;AAChC;AACA,gCAAgC;AAChC,kBAAkB;AAClB,mBAAmB;AACnB;AACA,sBAAsB,wBAAwB;AAC9C;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,+BAA+B;AAC/B,2BAA2B;AAC3B;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,qDAAqD;AAC7E;AACA;AACA,eAAe,yEAAoB;AACnC;AACA;AACA;AACA;AACA,wBAAwB,uDAAuD;AAC/E;AACA;AACA,eAAe,yEAAoB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,gFAAmB;AAC3D,wCAAwC,+EAAmB;AAC3D;AACA;AACA;AACA;AACA;AACA,0BAA0B,4EAAwB;AAClD;AACA;AACA;AACA;AACA;AACA,8BAA8B,+DAAW;AACzC;AACA;AACA,wBAAwB,sDAAU;AAClC;AACA;AACA;AACA;AACA,kCAAkC,+DAAW;AAC7C;AACA;AACA,6CAA6C,wDAAY;AACzD;AACA,kEAAkE,2BAA2B,iBAAiB;AAC9G;AACA;AACA;AACA;AACA,oCAAoC,yEAAoB,kBAAkB;AAC1E;AACA;AACA;AACA,oCAAoC,wDAAY;AAChD;AACA;AACA;AACA,+BAA+B,0DAAU;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,4EAAwB;AAClD;AACA;AACA,yCAAyC;AACzC,oCAAoC,wDAAY;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,4EAAwB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,8BAA8B;AAC9D;AACA;AACA;AACA;AACA;AACA,8BAA8B,yEAAoB;AAClD,gCAAgC,yEAAoB;AACpD,4BAA4B,yEAAoB;AAChD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,+DAAW;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0DAA0D;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,6DAAW;AAChC,8BAA8B,+DAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,+DAAW;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0DAA0D;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,+DAAW;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0DAA0D;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,+DAAW;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,0DAA0D;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,mDAAQ;AACjC;AACA;AACA;AACA,2EAA2E;AAC3E;AACA;AACA,wCAAwC;AACxC;AACA;AACA;AACA,yBAAyB,mDAAQ;AACjC,yBAAyB,mDAAQ;AACjC;AACA;AACA;AACA;AACA,yBAAyB,mDAAQ;AACjC,6BAA6B,sDAAU;AACvC,wCAAwC,4DAAW;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,mDAAQ;AACjC,kCAAkC,+DAAW;AAC7C;AACA;AACA,kCAAkC,wEAAoB;AACtD;AACA,oBAAoB,sDAAU;AAC9B;AACA;AACA,wBAAwB,6DAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,qCAAqC;AAC9D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,4EAAwB;AAClD;AACA;AACA;AACA;AACA,4BAA4B,gBAAgB,EAAE,uEAAwB;AACtE,oBAAoB,8DAAe;AACnC,oBAAoB,+DAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB,gBAAgB,EAAE,uEAAwB;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAkB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,uEAAkB;AAC1B;AACA,gCAAgC,gDAAK;AACrC;AACA;AACA;AACA,6DAA6D,0DAAU;AACvE;AACA,sBAAsB,mDAAQ;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA,8DAA8D,mDAAQ;AACtE;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,2BAA2B,IAAI,8BAA8B,yCAAyC,6BAA6B;AAC7I;AACA;AACA;AACA;AACA;AACA,+CAA+C,6DAAW;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,mCAAmC;AAC9D,wBAAwB,gBAAgB,EAAE,uEAAwB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,2EAAsB;AACvC,mCAAmC,4DAAW,oDAAoD;AAClG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,WAAW;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,oEAAa;AAC/C;AACA;AACA;AACA;AACA,4FAA4F,eAAe;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,8DAAU;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ,8DAAe;AACvB;AACA;AACA;AACA;AACA,YAAY,4DAAS;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,mDAAQ,mBAAmB,+DAAW;AACvD,iBAAiB,mDAAQ,iBAAiB,8DAAW;AACrD,iBAAiB,mDAAQ,oBAAoB,8DAAW;AACxD,iBAAiB,mDAAQ,mBAAmB,gDAAK;AACjD,iBAAiB,mDAAQ;AACzB,2BAA2B,iEAAa;AACxC;AACA,0BAA0B,wEAAoB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4BAA4B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,uEAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,4BAA4B;AAC5D;AACA,wBAAwB,6DAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,4EAAwB;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA,oBAAoB,6DAAW;AAC/B;AACA;AACA,kCAAkC,uEAAmB;AACrD;AACA;AACA;AACA;AACA;AACA,qBAAqB,6DAAW;AAChC,8BAA8B,+DAAW;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA,oBAAoB,gBAAgB,EAAE,uEAAwB;AAC9D,YAAY,8DAAe;AAC3B,YAAY,+DAAgB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,+DAAW;AACjC;AACA;AACA;AACA;AACA,0BAA0B,uEAAmB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,8BAA8B;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,0CAA0C;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,4EAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,+DAAW;AACrD;AACA;AACA;AACA,gDAAgD,sBAAsB;AACtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D;AAC1D;AACA;AACA;AACA;AACA,iEAAiE,yDAAc;AAC/E,yEAAyE,yDAAc;AACvF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gDAAK;AACjC,4BAA4B,yBAAyB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,yBAAyB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,4EAAwB;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA,4BAA4B,sBAAsB;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,yBAAyB;AACjD;AACA,gCAAgC,gDAAK;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,WAAW;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,mDAAQ;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,mDAAQ;AACvE;AACA;AACA;AACA;AACA,+DAA+D,mDAAQ;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,mDAAQ;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,mDAAQ;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,4EAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,4EAAwB;AACtD;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,gDAAgD;AAC1D,UAAU,8CAA8C;AACxD,UAAU,oDAAoD;AAC9D,UAAU,wCAAwC;AAClD;AACA;AACA;AACA;AACA;AACA;AACA,UAAU,uCAAuC;AACjD,UAAU,8CAA8C;AACxD,UAAU,oDAAoD;AAC9D,UAAU,wCAAwC;AAClD;AACA,CAAC,sCAAsC;AACvC;;;;;;;;;;;;;;;AC7kDA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4CAA4C;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,iBAAiB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,mBAAmB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AACzC;;;;;;;;;;;;;;;;ACtN+C;AAC/C;AACO,2BAA2B,wDAAY;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yFAAyF,eAAe;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sFAAsF,eAAe;AACrG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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,IAAI,0CAA0C;AAC9C;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,yBAAyB;AACrD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,iBAAiB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,gCAAgC;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB,uBAAuB;AACvB,6BAA6B,6DAA6D;AAC1F,uBAAuB;AACvB,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA,CAAC,oCAAoC;AACrC;;;;;;;;;;;;;;;;;ACpM+D;AAChB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,uBAAuB,wDAAY;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yFAAyF,eAAe;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,uEAAmB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,4CAA4C;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;;;;;;;;;;;;;;;;;AClIuD;AACvD;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,yBAAyB;AACrD;AACA;AACA,8BAA8B,+DAAW,iBAAiB,EAAE,IAAI,QAAQ;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,kCAAkC;AACnC;AACO;AACP;;;;;;;;;;;;;;;ACtEA;AACO;AACP;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AACzC;;;;;;;;;;;;;;;;;;;;;;;;ACPgE;AACb;AACnD;AACO;AACP;AACA;AACA;AACA,CAAC,8DAA8D;AAC/D;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,oBAAoB;AACrB;AACO;AACP;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;AACO;AACP,UAAU,4DAAc;AACxB,UAAU,4DAAc;AACxB,oBAAoB,4DAAc;AAClC;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,8BAA8B;AAC/B;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,4BAA4B;AAC7B;AACO;AACP;AACA;AACA;AACA;AACA,CAAC,wCAAwC;AACzC;AACO;AACP;AACA;AACA;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,wEAAoB;AAC9C;AACA;AACA;AACA,CAAC,oCAAoC;AACrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AC1FA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,YAAY;AACxC;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,aAAa;AACrD;AACA;AACA;AACA,4CAA4C,aAAa;AACzD;AACA;AACA;AACA,gDAAgD,aAAa;AAC7D;AACA;AACA;AACA,oDAAoD,aAAa;AACjE;AACA;AACA;AACA,gFAAgF;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;;;;;;;;AC9L+C;AACiB;AACZ;AACe;AAClB;AACE;AACnD;AACO,4BAA4B,0DAAa;AAChD;AACA;AACA;AACA;AACA,oEAAoE;AACpE;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,4EAAwB;AACtD;AACA;AACA,iDAAiD,wDAAY;AAC7D;AACA,sEAAsE,2BAA2B,iBAAiB;AAClH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,6BAA6B;AACtF,QAAQ,wCAAwC,4CAA4C,6BAA6B;AACzH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,eAAe;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kCAAkC;AAChE;AACA,kCAAkC,iCAAiC;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,4DAAW;AACxC,mCAAmC,KAAK,IAAI,2BAA2B;AACvE,0BAA0B,6DAAS;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,4EAAwB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,yEAAoB;AACvD,qBAAqB,wDAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,sCAAsC;AACvC;;;;;;;;;;AClPA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,SAAS,WAAW;;AAEpB;AACA;AACA;AACA,SAAS,WAAW;;AAEpB;AACA;AACA,IAAI;AACJ;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;;AAEA,SAAS,WAAW;;AAEpB;AACA;AACA,SAAS,UAAU;;AAEnB;AACA;;;;;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2CAA2C;AAC3C;AACA,2DAA2D;;AAE3D;AACA,+CAA+C;AAC/C;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA,yBAAyB;AACzB,yBAAyB;AACzB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA,2CAA2C;;AAE3C;AACA;;AAEA;AACA;AACA;AACA;AACA,0BAA0B,MAAM,aAAa,OAAO;;AAEpD;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,EAAE;AACnD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,2CAA2C,EAAE;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf,cAAc;AACd,cAAc;AACd,gBAAgB;AAChB,eAAe;AACf;;AAEA;AACA;AACA,UAAU;AACV,SAAS;AACT,SAAS;AACT,WAAW;AACX,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,0BAA0B,qBAAM,gBAAgB,qBAAM,IAAI,qBAAM,sBAAsB,qBAAM;;AAE5F;AACA;;AAEA;AACA;;AAEA;AACA,oBAAoB,KAA0B;;AAE9C;AACA,kCAAkC,QAAa;;AAE/C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAM;AACN,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,UAAU;AACvB,aAAa,GAAG;AAChB,aAAa,OAAO;AACpB,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB,eAAe,UAAU;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,eAAe,OAAO;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,GAAG;AAChB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,GAAG;AAChB,aAAa,UAAU;AACvB,eAAe,SAAS;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,aAAa,GAAG;AAChB,aAAa,SAAS;AACtB;AACA,eAAe,GAAG;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,aAAa,GAAG;AAChB,aAAa,SAAS;AACtB;AACA,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,cAAc;AAC3B,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,aAAa,QAAQ;AACrB,aAAa,SAAS;AACtB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,GAAG;AAChB,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,GAAG;AAChB,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,GAAG;AAChB,eAAe,SAAS;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,cAAc;AAC3B,aAAa,UAAU;AACvB,aAAa,GAAG;AAChB,aAAa,SAAS;AACtB;AACA,aAAa,UAAU;AACvB,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,eAAe,OAAO;AACtB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,UAAU;AACvB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,UAAU;AACvB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,OAAO;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,UAAU;AACvB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,OAAO;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,SAAS;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,OAAO;AACpB,eAAe,QAAQ;AACvB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,GAAG;AAChB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,aAAa,QAAQ;AACrB,eAAe,GAAG;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,SAAS;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,SAAS;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,UAAU;AACvB,aAAa,UAAU;AACvB,eAAe,UAAU;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,GAAG;AAChB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,GAAG;AAChB,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,OAAO;AACpB,aAAa,GAAG;AAChB,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,QAAQ;AACrB,eAAe,UAAU;AACzB;AACA;AACA,eAAe,0BAA0B;AACzC;AACA;AACA,oBAAoB,+BAA+B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,4BAA4B;AAC9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA,QAAQ;AACR,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,SAAS;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,YAAY;AACZ;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,SAAS;AACxB;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;;AAEA;AACA;AACA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,iBAAiB,eAAe;AAChC;AACA;AACA;AACA;AACA;AACA,qCAAqC,8BAA8B;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,cAAc;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,cAAc;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,iBAAiB,GAAG;AACpB;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,OAAO;AACtB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,SAAS;AACxB;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,8BAA8B;AAC7C,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,QAAQ;AACR;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,iBAAiB;AACjB,OAAO;;AAEP;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,GAAG;AAClB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,sEAAsE;AACtE;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,SAAS;AACxB,eAAe,SAAS;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,OAAO;AACtB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,eAAe;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B,iBAAiB,aAAa;AAC9B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,oBAAoB;AACnC,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,SAAS;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB,SAAS;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,eAAe,QAAQ,UAAU;AACjC,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,4BAA4B;;AAE5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ,UAAU;AACjC,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ,UAAU;AACjC,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,SAAS;AACxB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,oEAAoE;AACpE;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB,eAAe,OAAO;AACtB;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,SAAS;AACxB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,OAAO;AACtB;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB;AACA,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2CAA2C;AAC3C,yCAAyC;AACzC,gEAAgE;AAChE,kEAAkE;AAClE;AACA;AACA,eAAe;AACf;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,SAAS;AAC1B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6CAA6C;AAC7C;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,GAAG;AAClB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,OAAO;AACtB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,GAAG;AAClB,iBAAiB,UAAU;AAC3B;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,eAAe;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,eAAe;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,UAAU;AACV;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,QAAQ,IAAI,QAAQ,MAAM,QAAQ;AAC3D,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA,wBAAwB,gBAAgB,IAAI,gBAAgB;AAC5D;AACA,oCAAoC,gBAAgB;AACpD,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,WAAW,mCAAmC;AAC9C,WAAW,oCAAoC;AAC/C,WAAW;AACX;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA,iCAAiC,oCAAoC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,WAAW,oCAAoC;AAC/C,WAAW,oCAAoC;AAC/C,WAAW;AACX;AACA;AACA,wCAAwC,mBAAmB;AAC3D;AACA;AACA;AACA,4BAA4B,mCAAmC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,WAAW,oCAAoC;AAC/C,WAAW,oCAAoC;AAC/C,WAAW;AACX;AACA;AACA,wCAAwC,4BAA4B;AACpE;AACA;AACA;AACA,4BAA4B,iCAAiC;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,WAAW,mCAAmC;AAC9C,WAAW,oCAAoC;AAC/C,WAAW;AACX;AACA;AACA,4CAA4C,6BAA6B;AACzE;AACA;AACA;AACA,gCAAgC,kCAAkC;AAClE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ,MAAM,QAAQ,IAAI,QAAQ;AAC7D,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA,wBAAwB,gBAAgB,IAAI,gBAAgB;AAC5D,uBAAuB,gBAAgB,IAAI,gBAAgB;AAC3D;AACA;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA,sBAAsB,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,QAAQ;AAClE;AACA,6BAA6B,QAAQ,IAAI,QAAQ;AACjD;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA,sBAAsB,gBAAgB,IAAI,gBAAgB,IAAI,gBAAgB;AAC9E;AACA,+BAA+B,gBAAgB;AAC/C;AACA,gBAAgB,gBAAgB,IAAI,gBAAgB;AACpD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,sBAAsB;AACrC,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;;AAEP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,wBAAwB,QAAQ,IAAI,QAAQ;AAC5C;AACA,kCAAkC,QAAQ,gBAAgB,aAAa;AACvE;AACA;AACA;AACA,kCAAkC,QAAQ;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,wBAAwB,QAAQ,IAAI,QAAQ;AAC5C;AACA,sCAAsC,QAAQ,gBAAgB,aAAa;AAC3E;AACA;AACA;AACA,sCAAsC,QAAQ;AAC9C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,WAAW,mCAAmC;AAC9C,WAAW,oCAAoC;AAC/C,WAAW;AACX;AACA;AACA,6CAA6C,mBAAmB;AAChE;AACA;AACA;AACA,iCAAiC,oCAAoC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,WAAW,oCAAoC;AAC/C,WAAW,oCAAoC;AAC/C,WAAW;AACX;AACA;AACA,wCAAwC,mBAAmB;AAC3D;AACA;AACA;AACA,4BAA4B,mCAAmC;AAC/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ,MAAM,QAAQ,IAAI,QAAQ;AACtD,gBAAgB,QAAQ,IAAI,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA,wBAAwB,gBAAgB,IAAI,gBAAgB;AAC5D,uBAAuB,gBAAgB,IAAI,gBAAgB;AAC3D;AACA;AACA,gBAAgB,gBAAgB,IAAI,gBAAgB,IAAI,gBAAgB;AACxE;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ,IAAI,QAAQ,IAAI,QAAQ;AACnD,gBAAgB,QAAQ,IAAI,QAAQ;AACpC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA,wBAAwB,gBAAgB,IAAI,gBAAgB,IAAI,gBAAgB;AAChF;AACA;AACA,gBAAgB,gBAAgB,IAAI,gBAAgB;AACpD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,QAAQ,MAAM,QAAQ,IAAI,QAAQ;AACpD,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA,wBAAwB,gBAAgB,IAAI,gBAAgB;AAC5D,uBAAuB,gBAAgB,IAAI,gBAAgB;AAC3D;AACA;AACA,gBAAgB,gBAAgB,IAAI,gBAAgB;AACpD;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,eAAe,OAAO,QAAQ,QAAQ,IAAI,QAAQ;AAClD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,WAAW,8BAA8B;AACzC,WAAW,8BAA8B;AACzC,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,sBAAsB;AACrC,iBAAiB,QAAQ;AACzB;AACA;AACA,sBAAsB,QAAQ,OAAO,UAAU;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,WAAW,6BAA6B;AACxC,WAAW;AACX;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,eAAe;AACf;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,gBAAgB,QAAQ;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,8CAA8C;AACzD,WAAW;AACX;AACA;AACA;AACA,wBAAwB,mCAAmC;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,WAAW,6CAA6C;AACxD,WAAW;AACX;AACA;AACA,qCAAqC,mBAAmB;AACxD;AACA;AACA;AACA,yBAAyB,2BAA2B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC,WAAW;AAChD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA,WAAW,8CAA8C;AACzD,WAAW,+CAA+C;AAC1D,WAAW;AACX;AACA;AACA,mCAAmC,oBAAoB;AACvD;AACA;AACA;AACA,uBAAuB,0BAA0B;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,cAAc;AAC/B;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,eAAe,GAAG;AAClB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,gBAAgB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,uBAAuB;AACtC;AACA,eAAe,MAAM;AACrB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,WAAW,2BAA2B;AACtC,WAAW;AACX;AACA;AACA;AACA;AACA,QAAQ;AACR,eAAe,OAAO,2BAA2B,SAAS;AAC1D;AACA;AACA,eAAe,UAAU,2BAA2B,aAAa;AACjE;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,gBAAgB;AAC/B;AACA;AACA;AACA,WAAW,kBAAkB;AAC7B,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,sCAAsC;AACrD;AACA,eAAe,UAAU;AACzB,gBAAgB,QAAQ;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,WAAW,6BAA6B;AACxC,WAAW,6BAA6B;AACxC,WAAW,6BAA6B;AACxC,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,WAAW,+CAA+C;AAC1D,WAAW,8CAA8C;AACzD,WAAW;AACX;AACA;AACA,wCAAwC,kBAAkB;AAC1D;AACA;AACA;AACA,4BAA4B,2BAA2B;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,eAAe,kBAAkB;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,eAAe,GAAG;AAClB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,kBAAkB,wBAAwB;AAC1C;AACA;AACA,QAAQ,IAAI;AACZ,eAAe,8BAA8B;AAC7C;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,eAAe,GAAG;AAClB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA,WAAW,8CAA8C;AACzD,WAAW;AACX;AACA;AACA,qCAAqC,mBAAmB;AACxD;AACA;AACA;AACA,yBAAyB,2BAA2B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,qBAAqB;AACpC,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,gBAAgB,QAAQ;AACxB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,kCAAkC;AAC7C,WAAW;AACX;AACA;AACA;AACA,uBAAuB,mCAAmC;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,0BAA0B;AACzC;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA,WAAW,6BAA6B;AACxC,WAAW,6BAA6B;AACxC,WAAW,6BAA6B;AACxC,WAAW;AACX;AACA;AACA,sCAAsC,gBAAgB;AACtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,qBAAqB,gCAAgC;AACrD,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,GAAG;AAClB,eAAe,MAAM;AACrB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,QAAQ,WAAW;AAClC,eAAe,SAAS;AACxB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,SAAS;AACxB;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,mDAAmD,iBAAiB;AACpE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,MAAM;AACrB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA,sBAAsB;AACtB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,0BAA0B;AACzC;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,MAAM;AACrB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,MAAM;AACrB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,sBAAsB;AACrC,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,QAAQ;AACvB,eAAe,QAAQ,WAAW;AAClC,eAAe,SAAS;AACxB;AACA,eAAe,SAAS;AACxB;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,wDAAwD,mBAAmB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA,qBAAqB,QAAQ;AAC7B,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA,wBAAwB,QAAQ,IAAI,QAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA,wBAAwB,QAAQ,IAAI,QAAQ;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA,sBAAsB;AACtB;AACA,8BAA8B,mBAAmB,iBAAiB;AAClE;AACA;AACA,8BAA8B,mBAAmB,iBAAiB;AAClE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA,sBAAsB;AACtB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA,kCAAkC,mBAAmB;AACrD;AACA;AACA;AACA;AACA;AACA,mDAAmD,mBAAmB;AACtE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,QAAQ;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA,sBAAsB;AACtB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA,oBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA,sBAAsB;AACtB;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,OAAO;AACxB;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,QAAQ;AAC1B,eAAe;AACf;AACA,kBAAkB,QAAQ;AAC1B,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,QAAQ;AAC1B,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,QAAQ;AAC5B,eAAe;AACf;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,QAAQ,IAAI,QAAQ,IAAI,QAAQ;AAClD,eAAe;AACf;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB,QAAQ,IAAI,QAAQ,IAAI,QAAQ;AAClD,eAAe;AACf;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,sBAAsB;AACrC,iBAAiB,OAAO;AACxB;AACA;AACA,sBAAsB,QAAQ,OAAO,UAAU;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,oBAAoB,QAAQ,IAAI,QAAQ,IAAI,QAAQ;AACpD,eAAe;AACf;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,wBAAwB,OAAO,UAAU,IAAI,OAAO,kBAAkB;AACtE,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA,sBAAsB,2BAA2B;AACjD,sBAAsB,4BAA4B;AAClD,sBAAsB;AACtB;AACA;AACA,sCAAsC,oBAAoB;AAC1D;AACA;AACA;AACA,0BAA0B,0BAA0B;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA,sBAAsB,2BAA2B;AACjD,sBAAsB,4BAA4B;AAClD,sBAAsB;AACtB;AACA;AACA,0CAA0C,oBAAoB;AAC9D;AACA;AACA;AACA,8BAA8B,2BAA2B;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,GAAG;AAClB,iBAAiB,GAAG;AACpB;AACA;AACA,sBAAsB,QAAQ,OAAO,UAAU;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,iBAAiB,SAAS;AAC1B;AACA;AACA,sBAAsB,OAAO;AAC7B,8BAA8B,gBAAgB,QAAQ,GAAG;AACzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,iBAAiB,SAAS;AAC1B;AACA;AACA,+BAA+B,gBAAgB,QAAQ,GAAG;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,QAAQ;AACR,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,iBAAiB,GAAG;AACpB;AACA;AACA,sBAAsB,QAAQ,OAAO,qBAAqB;AAC1D;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,mBAAmB,gBAAgB;AACnC;AACA,QAAQ;AACR,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,sBAAsB,8BAA8B;AACpD,sBAAsB;AACtB;AACA;AACA,wCAAwC,eAAe;AACvD,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA,eAAe,2BAA2B;AAC1C;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,iBAAiB,QAAQ,IAAI,QAAQ;AACrC;AACA;AACA;AACA,iBAAiB,QAAQ,IAAI,QAAQ;AACrC;AACA;AACA;AACA,eAAe,QAAQ,gBAAgB,IAAI,gBAAgB;AAC3D;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,WAAW;AAC1B,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB,qBAAqB;AACrB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,KAAK;;AAEL;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,sBAAsB;AACrC,iBAAiB,QAAQ;AACzB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,sBAAsB;AACrC,iBAAiB,QAAQ;AACzB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,eAAe;AACf;AACA;AACA,iCAAiC;AACjC,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,GAAG;AAClB,iBAAiB,GAAG;AACpB;AACA;AACA,sBAAsB,QAAQ,OAAO,gCAAgC;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,GAAG;AAClB,iBAAiB,QAAQ;AACzB;AACA;AACA,sBAAsB,QAAQ,OAAO,UAAU;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,GAAG;AAClB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,eAAe,GAAG;AAClB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,qBAAqB,wBAAwB;AAC7C;AACA,QAAQ,IAAI;AACZ,eAAe;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,iBAAiB,SAAS;AAC1B;AACA;AACA,sBAAsB,QAAQ,OAAO,UAAU;AAC/C;AACA;AACA;AACA;AACA,eAAe,QAAQ,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ,SAAS;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA,sBAAsB,QAAQ,OAAO,UAAU;AAC/C;AACA,kDAAkD,eAAe;AACjE;AACA;AACA;AACA,kDAAkD,uBAAuB;AACzE;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,cAAc;AAC7B,eAAe,UAAU;AACzB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,SAAS;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA,kCAAkC;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC,KAAK;AACvC;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B,eAAe,iBAAiB;AAChC,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ,WAAW;AAClC,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB;AACA,eAAe,QAAQ;AACvB;AACA,gBAAgB,QAAQ;AACxB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA,kBAAkB,gBAAgB;AAClC;AACA;AACA;AACA;AACA,kBAAkB,qBAAqB;AACvC,qBAAqB,UAAU;AAC/B;AACA;AACA,uEAAuE,0BAA0B,GAAG;AACpG,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA,6DAA6D;AAC7D,kBAAkB,kBAAkB;AACpC;AACA;AACA;AACA;AACA,2CAA2C,MAAM;AACjD,kBAAkB,mBAAmB;AACrC;AACA;AACA;AACA;AACA,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA,sDAAsD,0BAA0B,GAAG;AACnF,yCAAyC,aAAa,gBAAgB;AACtE,kBAAkB,6BAA6B;AAC/C;AACA;AACA;AACA,yDAAyD,oCAAoC;AAC7F;AACA;AACA;AACA;AACA,2DAA2D,oBAAoB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA2C,YAAY;AACvD,2CAA2C,OAAO;AAClD,kBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,+BAA+B;;AAE/B,mCAAmC;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,wBAAwB;AAC/C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP,mBAAmB;;AAEnB;AACA;AACA;AACA;AACA,8BAA8B,mBAAmB;AACjD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA,uDAAuD;AACvD;AACA;AACA,6BAA6B,EAAE;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C;AAC1C,gCAAgC,gCAAgC;AAChE,cAAc;AACd;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,gBAAgB,QAAQ;AACxB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ,WAAW;AAClC,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC;AAClC,aAAa,QAAQ,QAAQ,UAAU,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,eAAe;AAC9B,gBAAgB,QAAQ;AACxB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,UAAU;AACzB,eAAe,MAAM;AACrB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,sBAAsB;AACrC,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,sBAAsB,QAAQ;AAC9B,uBAAuB,iBAAiB;AACxC;AACA;AACA;AACA,cAAc,gBAAgB;AAC9B;AACA;AACA,cAAc,gBAAgB;AAC9B;AACA;AACA,cAAc,oBAAoB;AAClC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,WAAW,gBAAgB;AAC3B,WAAW;AACX;AACA;AACA,sCAAsC,mBAAmB,iBAAiB;AAC1E,gBAAgB,gBAAgB;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,UAAU;AAC3B;AACA;AACA,6CAA6C,QAAQ;AACrD;AACA;AACA,gBAAgB,QAAQ,IAAI,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,eAAe,GAAG;AAClB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0BAA0B;AACzC,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0BAA0B;AACzC,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,GAAG;AACpB;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,WAAW,6CAA6C;AACxD,WAAW;AACX;AACA;AACA;AACA,oCAAoC,kCAAkC;AACtE,gBAAgB,6CAA6C;AAC7D;AACA;AACA;AACA,gBAAgB,2BAA2B;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,WAAW;AACX;AACA;AACA,qCAAqC,gBAAgB;AACrD,gBAAgB,wBAAwB;AACxC;AACA;AACA,iDAAiD,QAAQ,eAAe,QAAQ;AAChF,gBAAgB,wBAAwB,IAAI,wBAAwB;AACpE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,GAAG;AAClB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,WAAW,wBAAwB;AACnC,WAAW;AACX;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,gBAAgB,wBAAwB,IAAI,wBAAwB;AACpE;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,eAAe,MAAM;AACrB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,WAAW,OAAO,sBAAsB;AACxC,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,MAAM;AACrB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,iBAAiB;AAChC,eAAe,QAAQ;AACvB,eAAe,QAAQ,WAAW;AAClC,eAAe,SAAS;AACxB,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,kBAAkB,IAAI,gBAAgB;AACvD;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAA6B,oDAAoD;AACjF;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0BAA0B;AACzC;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0BAA0B;AACzC;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,0BAA0B;AACzC;AACA,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,QAAQ,IAAI,QAAQ;AAC3D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,WAAW,OAAO,UAAU;AAC5B,WAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,UAAU;AAC3B;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA,gBAAgB,IAAI;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,SAAS;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mEAAmE;AACnE;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,UAAU;AACzB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,GAAG;AAClB,iBAAiB,OAAO;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,GAAG;AACpB;AACA;AACA,wBAAwB,QAAQ,IAAI,QAAQ;AAC5C;AACA,sCAAsC,aAAa;AACnD,eAAe;AACf;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA,wBAAwB,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,QAAQ;AACpE;AACA,uCAAuC,aAAa;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,GAAG;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,GAAG;AACpB;AACA;AACA,wBAAwB,QAAQ,IAAI,QAAQ;AAC5C;AACA,sCAAsC,aAAa;AACnD,eAAe;AACf;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,eAAe,QAAQ;AACvB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,iBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,UAAU;AACzB,iBAAiB,QAAQ;AACzB;AACA;AACA,wBAAwB,QAAQ,IAAI,QAAQ,IAAI,QAAQ,IAAI,QAAQ;AACpE;AACA,sCAAsC,aAAa;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK,OAAO,gBAAgB;;AAE5B;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,QAAQ;AACR;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,oCAAoC,2DAA2D;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,wCAAwC;AACtE;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;;AAEA;AACA,MAAM,IAA0E;AAChF;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,IAAI,mCAAO;AACX;AACA,KAAK;AAAA,kGAAC;AACN;AACA;AACA,OAAO,EASJ;AACH,CAAC;;;;;;;;;;;;;;;ACxzhBD,0HAAwE;AACxE,8FAAyC;AAEzC;;;GAGG;AACI,KAAK,UAAU,IAAI,CAAC,UAAmB,IAAI;IACjD,sCAAsC;IACtC,IAAI,OAA0C,CAAC;IAC/C,IAAI,MAAM,CAAC,GAAG,KAAK,SAAS,EAAE,CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,MAAM,QAAQ,GAAG,MAAM,0BAAW,GAAE,CAAC;YACrC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;gBAC5B,OAAO,CAAC,KAAK,CACZ,wOAAwO,CACxO,CAAC;gBACF,OAAO;YACR,CAAC;YACD,OAAO,GAAG;gBACT,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS;gBAC9C,aAAa,EAAE;oBACd,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU;oBAChD,mBAAmB,EAAE,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,mBAAmB;iBAClE;aACD,CAAC;QACH,CAAC;QACD,oIAAoI;QACpI,IAAI,OAAO,EAAE,CAAC;YACb,MAAM,CAAC,GAAG,GAAG,MAAM,sBAAO,EAAC;gBAC1B,OAAO;aACP,CAAC,CAAC;QACJ,CAAC;aAAM,CAAC;YACP,MAAM,CAAC,GAAG,GAAG,MAAM,sBAAO,EAAC;gBAC1B,qBAAqB,EAAE,SAAS;aAChC,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QAClD,yCAAyC;QACzC,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC;QAC1C,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,EAAE,CAAC;QACrF,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;QACnD,0CAA0C;QAC1C,MAAM,KAAK,GAAG,IAAI,WAAW,CAAC,WAAW,CAAC,CAAC;QAC3C,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;AACF,CAAC;AA3CD,oBA2CC;;;;;;;;;;;;;;;AC/CD;;;GAGG;AACI,KAAK,UAAU,WAAW;IAChC,MAAM,QAAQ,GAAG,MAAM,mBAAmB,EAAE,CAAC;IAC7C,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,CAAC,KAAK,CACZ,6MAA6M,CAC7M,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AACjB,CAAC;AARD,kCAQC;AAED;;;GAGG;AACI,KAAK,UAAU,gBAAgB;IACrC,MAAM,QAAQ,GAAG,MAAM,WAAW,EAAE,CAAC;IACrC,IAAI,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,aAAa,KAAK,SAAS,EAAE,CAAC;QAC7D,OAAO,CAAC,KAAK,CACZ,kIAAkI,CAClI,CAAC;QACF,OAAO;IACR,CAAC;IACD,IAAI,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,KAAK,QAAQ,EAAE,CAAC;QAChE,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC3E,MAAM,UAAU,GAAG,CAAC,MAAM,cAAc,CAAC,IAAI,EAAE,CAAsB,CAAC;QACtE,OAAO,UAAU,CAAC;IACnB,CAAC;IACD,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,aAAa,CAAC;AAC/C,CAAC;AAdD,4CAcC;AAED;;;GAGG;AACI,KAAK,UAAU,eAAe;IACpC,MAAM,QAAQ,GAAG,MAAM,WAAW,EAAE,CAAC;IACrC,IAAI,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,KAAK,SAAS,EAAE,CAAC;QAC5D,OAAO,CAAC,KAAK,CACZ,kIAAkI,CAClI,CAAC;QACF,OAAO;IACR,CAAC;IACD,IAAI,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,KAAK,QAAQ,EAAE,CAAC;QAC/D,MAAM,cAAc,GAAG,MAAM,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC1E,MAAM,UAAU,GAAG,CAAC,MAAM,cAAc,CAAC,IAAI,EAAE,CAAsB,CAAC;QACtE,OAAO,UAAU,CAAC;IACnB,CAAC;IACD,OAAO,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC;AAC9C,CAAC;AAdD,0CAcC;AACD;;;GAGG;AACH,KAAK,UAAU,mBAAmB;IACjC,wBAAwB;IACxB,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAkB,sBAAsB,CAAC,CAAC;IAC7E,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,YAAY,GAAG,CAAC,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAkC,CAAC;QACtF,OAAO,YAAY,CAAC,eAAe,CAAC;IACrC,CAAC;AACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACpEuC;AACA;AACA;AACA;AACE;AACQ;AACE;AACE;;;;;;;;;;;;;;;;ACPtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD;;AAEnD;;AAEA,oBAAoB,gBAAgB;AACpC;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,kBAAkB,cAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,kBAAkB,aAAa;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iEAAe,GAAG;;;;;;;;;;;;;;;ACtNlB,iEAAe,sCAAsC;;;;;;;;;;;;;;;;ACAhB;;AAErC;AACA,OAAO,wDAAQ;AACf;AACA;;AAEA;AACA,gCAAgC;;AAEhC;AACA;AACA;AACA,qBAAqB;;AAErB;AACA,qBAAqB;;AAErB;AACA,qBAAqB;;AAErB;AACA,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,iEAAe,KAAK;;;;;;;;;;;;;;;AClCpB,iEAAe,cAAc,EAAE,UAAU,EAAE,eAAe,EAAE,gBAAgB,EAAE,UAAU,GAAG,yCAAyC;;;;;;;;;;;;;;;ACApI;AACA;AACA;AACA;AACA;AACe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;AClBA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,mDAAmD;;AAEnD;;AAEA,oBAAoB,gBAAgB;AACpC;AACA;AACA,IAAI;AACJ;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mBAAmB,QAAQ;AAC3B;;AAEA,oBAAoB,QAAQ;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAoB,SAAS;AAC7B;;AAEA,oBAAoB,QAAQ;AAC5B;AACA;;AAEA,sBAAsB,SAAS;AAC/B;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB,UAAU;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,iEAAe,IAAI;;;;;;;;;;;;;;;;AC/FkB;AACrC;AACA;AACA;AACA;;AAEA;;AAEA,gBAAgB,SAAS;AACzB;AACA;;AAEA;AACA;AACA;AACA;AACA,0gBAA0gB;AAC1gB;AACA;AACA;AACA;;AAEA,OAAO,wDAAQ;AACf;AACA;;AAEA;AACA;;AAEA,iEAAe,SAAS;;;;;;;;;;;;;;;;;AC7BG;AACY,CAAC;AACxC;AACA;AACA;;AAEA;;AAEA,eAAe;;;AAGf;AACA,oBAAoB;;AAEpB;AACA;AACA;AACA;AACA;AACA,gFAAgF;AAChF;AACA;;AAEA;AACA,sDAAsD,+CAAG;;AAEzD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAI;AACJ;AACA;AACA;;;AAGA,wEAAwE;AACxE;;AAEA,4EAA4E;;AAE5E,8DAA8D;;AAE9D;AACA;AACA,IAAI;AACJ;;;AAGA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;;AAEA;AACA;AACA,wBAAwB;;AAExB,2BAA2B;;AAE3B;AACA;AACA;AACA;AACA,sBAAsB;;AAEtB;AACA;AACA,uBAAuB;;AAEvB,oCAAoC;;AAEpC,8BAA8B;;AAE9B,kCAAkC;;AAElC,4BAA4B;;AAE5B,kBAAkB,OAAO;AACzB;AACA;;AAEA,gBAAgB,yDAAS;AACzB;;AAEA,iEAAe,EAAE;;;;;;;;;;;;;;;;;AC9FU;AACA;AAC3B,SAAS,mDAAG,aAAa,+CAAG;AAC5B,iEAAe,EAAE;;;;;;;;;;;;;;;;;;;ACHsB;AACR;;AAE/B;AACA,2CAA2C;;AAE3C;;AAEA,kBAAkB,gBAAgB;AAClC;AACA;;AAEA;AACA;;AAEO;AACA;AACP,6BAAe,oCAAU;AACzB;AACA;AACA;AACA;;AAEA;AACA,kBAAkB,qDAAK;AACvB;;AAEA;AACA;AACA,MAAM;AACN;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,QAAQ;AAC9B;AACA;;AAEA;AACA;;AAEA,WAAW,yDAAS;AACpB,IAAI;;;AAGJ;AACA,8BAA8B;AAC9B,IAAI,eAAe;;;AAGnB;AACA;AACA;AACA;;;;;;;;;;;;;;;;;AC/D2B;AACY;;AAEvC;AACA;AACA,+CAA+C,+CAAG,KAAK;;AAEvD;AACA,mCAAmC;;AAEnC;AACA;;AAEA,oBAAoB,QAAQ;AAC5B;AACA;;AAEA;AACA;;AAEA,SAAS,yDAAS;AAClB;;AAEA,iEAAe,EAAE;;;;;;;;;;;;;;;;;ACvBU;AACE;AAC7B,SAAS,mDAAG,aAAa,gDAAI;AAC7B,iEAAe,EAAE;;;;;;;;;;;;;;;;ACHc;;AAE/B;AACA,qCAAqC,iDAAK;AAC1C;;AAEA,iEAAe,QAAQ;;;;;;;;;;;;;;;;ACNc;;AAErC;AACA,OAAO,wDAAQ;AACf;AACA;;AAEA;AACA;;AAEA,iEAAe,OAAO;;;;;;UCVtB;UACA;;UAEA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;;UAEA;UACA;;UAEA;UACA;;UAEA;UACA;UACA;;;;;WCzBA;WACA;WACA;WACA;WACA,yCAAyC,wCAAwC;WACjF;WACA;WACA;;;;;WCPA;WACA;WACA;WACA;WACA,GAAG;WACH;WACA;WACA,CAAC;;;;;WCPD;;;;;WCAA;WACA;WACA;WACA,uDAAuD,iBAAiB;WACxE;WACA,gDAAgD,aAAa;WAC7D;;;;;WCNA;WACA;WACA;WACA;WACA;;;;;;;;;;;;;;ACHA,yFAAuC;AAEvC,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;IACtD,MAAM,cAAI,EAAC,KAAK,CAAC,CAAC;IAClB,MAAM,aAAa,EAAE,CAAC;AACvB,CAAC,CAAC,CAAC;AAEH;;GAEG;AACH,KAAK,UAAU,eAAe;IAC7B,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QACjB,MAAM,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE;YACtD,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACJ,CAAC;SAAM,CAAC;QACP,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;YAC/C,MAAM,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE;gBACtD,iBAAiB,CAAC,OAAO,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;IACJ,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,SAAS,iBAAiB,CAAC,OAAgB;IAC1C,MAAM,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAkB,cAAc,CAAC,CAAC;IAChF,MAAM,eAAe,GAAG,QAAQ,CAAC,aAAa,CAAkB,cAAc,CAAC,CAAC;IAChF,MAAM,cAAc,GAAG,QAAQ,CAAC,aAAa,CAAiB,cAAc,CAAC,CAAC;IAE9E,IAAI,eAAe,KAAK,IAAI,IAAI,eAAe,KAAK,IAAI,IAAI,cAAc,KAAK,IAAI,EAAE,CAAC;QACrF,eAAe,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;QAC3C,eAAe,CAAC,WAAW,GAAG,OAAO,CAAC,IAAI,IAAI,mBAAmB,CAAC;QAClE,cAAc,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/D,CAAC;AACF,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,aAAa;IAC3B,MAAM,eAAe,EAAE,CAAC;AACzB,CAAC","sources":["webpack://openfin-web--web-layout/../../node_modules/@openfin/core-web/out/api-client.js","webpack://openfin-web--web-layout/../../node_modules/@openfin/core-web/out/main-48131439.js","webpack://openfin-web--web-layout/../../node_modules/@openfin/core-web/out/main-92c82377.js","webpack://openfin-web--web-layout/../../node_modules/base64-js/index.js","webpack://openfin-web--web-layout/../../node_modules/buffer/index.js","webpack://openfin-web--web-layout/../../node_modules/events/events.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/index.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/config/config.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/config/resolved-config.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/container/component-container.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/controls/browser-popout.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/controls/drag-proxy.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/controls/drag-source.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/controls/drop-target-indicator.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/controls/header-button.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/controls/header.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/controls/splitter.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/controls/tab.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/controls/tabs-container.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/controls/transition-indicator.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/errors/external-error.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/errors/internal-error.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/golden-layout.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/items/component-item.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/items/component-parentable-item.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/items/content-item.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/items/ground-item.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/items/row-or-column.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/items/stack.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/layout-manager.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/utils/config-minifier.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/utils/drag-listener.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/utils/event-emitter.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/utils/event-hub.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/utils/i18n-strings.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/utils/style-constants.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/utils/types.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/utils/utils.js","webpack://openfin-web--web-layout/../../node_modules/golden-layout/dist/esm/ts/virtual-layout.js","webpack://openfin-web--web-layout/../../node_modules/ieee754/index.js","webpack://openfin-web--web-layout/../../node_modules/lodash/lodash.js","webpack://openfin-web--web-layout/./client/src/platform/api.ts","webpack://openfin-web--web-layout/./client/src/platform/settings.ts","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/index.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/md5.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/nil.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/parse.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/regex.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/rng.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/sha1.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/stringify.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/v1.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/v3.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/v35.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/v4.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/v5.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/validate.js","webpack://openfin-web--web-layout/../../node_modules/uuid/dist/esm-browser/version.js","webpack://openfin-web--web-layout/webpack/bootstrap","webpack://openfin-web--web-layout/webpack/runtime/define property getters","webpack://openfin-web--web-layout/webpack/runtime/global","webpack://openfin-web--web-layout/webpack/runtime/hasOwnProperty shorthand","webpack://openfin-web--web-layout/webpack/runtime/make namespace object","webpack://openfin-web--web-layout/webpack/runtime/node module decorator","webpack://openfin-web--web-layout/./client/src/content/fdc3-panel.ts"],"sourcesContent":["\"use strict\";var e=require(\"./main-48131439.js\");require(\"buffer/\"),require(\"uuid\"),require(\"events\"),require(\"lodash\"),exports.connect=e.connect;\n","\"use strict\";var e=require(\"buffer/\"),t=require(\"events\"),n=require(\"lodash\"),i=require(\"uuid\");const r=(e,t)=>`${t}<${btoa(JSON.stringify(e))}>`;var o=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:{},s={},a={},c={},d={};async function h(e){const t=[];for(const n of e){const e=await n();t.push(e)}return t}Object.defineProperty(d,\"__esModule\",{value:!0}),d.promiseMapSerial=d.serial=d.promiseMap=d.promisify=void 0,d.promisify=function(e){return(...t)=>new Promise(((n,i)=>{e(...t,((e,t)=>e?i(e):n(t)))}))},d.promiseMap=async function(e,t){return Promise.all(e.map(t))},d.serial=h,d.promiseMapSerial=async function(e,t){return h(e.map(((e,n,i)=>()=>t(e,n,i))))};var l,u=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},p=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(c,\"__esModule\",{value:!0}),c.Reply=c.EmitterBase=c.Base=void 0;const w=d;class y{constructor(e){this.isNodeEnvironment=()=>\"node\"===this.wire.environment.type,this.isOpenFinEnvironment=()=>\"openfin\"===this.wire.environment.type,this.isBrowserEnvironment=()=>\"other\"===this.wire.environment.type,this.wire=e}get fin(){return this.wire.getFin()}get me(){return this.wire.me}}c.Base=y;c.EmitterBase=class extends y{constructor(e,t,...n){super(e),this.topic=t,l.set(this,void 0),this.eventNames=()=>this.hasEmitter()?this.getOrCreateEmitter().eventNames():[],this.emit=(e,t,...n)=>!!this.hasEmitter()&&this.getOrCreateEmitter().emit(e,t,...n),this.hasEmitter=()=>this.wire.eventAggregator.has(p(this,l,\"f\")),this.getOrCreateEmitter=()=>this.wire.eventAggregator.getOrCreate(p(this,l,\"f\")),this.listeners=e=>this.hasEmitter()?this.getOrCreateEmitter().listeners(e):[],this.listenerCount=e=>this.hasEmitter()?this.getOrCreateEmitter().listenerCount(e):0,this.registerEventListener=async(e,t={},n,i)=>{const r={...this.identity,timestamp:t.timestamp||Date.now(),topic:this.topic,type:e},o=this.getOrCreateEmitter();n(o);try{await this.wire.sendAction(\"subscribe-to-desktop-event\",r)}catch(e){throw i(o),this.deleteEmitterIfNothingRegistered(o),e}},this.deregisterEventListener=async(e,t={})=>{if(this.hasEmitter()){const n={...this.identity,timestamp:t.timestamp||Date.now(),topic:this.topic,type:e};await this.wire.sendAction(\"unsubscribe-to-desktop-event\",n).catch((()=>null));return this.getOrCreateEmitter()}return Promise.resolve()},u(this,l,[t,...n],\"f\"),this.listeners=e=>this.hasEmitter()?this.getOrCreateEmitter().listeners(e):[]}async on(e,t,n){return await this.registerEventListener(e,n,(n=>{n.on(e,t)}),(n=>{n.removeListener(e,t)})),this}async addListener(e,t,n){return this.on(e,t,n)}async once(e,t,n){const i=()=>this.deregisterEventListener(e);return await this.registerEventListener(e,n,(n=>{n.once(e,i),n.once(e,t)}),(n=>{n.removeListener(e,i),n.removeListener(e,t)})),this}async prependListener(e,t,n){return await this.registerEventListener(e,n,(n=>{n.prependListener(e,t)}),(n=>{n.removeListener(e,t)})),this}async prependOnceListener(e,t,n){const i=()=>this.deregisterEventListener(e);return await this.registerEventListener(e,n,(n=>{n.prependOnceListener(e,t),n.once(e,i)}),(n=>{n.removeListener(e,t),n.removeListener(e,i)})),this}async removeListener(e,t,n){const i=await this.deregisterEventListener(e,n);return i&&(i.removeListener(e,t),this.deleteEmitterIfNothingRegistered(i)),this}async deregisterAllListeners(e){const t={...this.identity,type:e,topic:this.topic};if(this.hasEmitter()){const e=this.getOrCreateEmitter(),n=e.listenerCount(t.type),i=[];for(let e=0;enull)));return await Promise.all(i),e}}async removeAllListeners(e){const t=async e=>{const t=await this.deregisterAllListeners(e);t&&(t.removeAllListeners(e),this.deleteEmitterIfNothingRegistered(t))};if(e)await t(e);else if(this.hasEmitter()){const e=this.getOrCreateEmitter().eventNames();await(0,w.promiseMap)(e,t)}return this}deleteEmitterIfNothingRegistered(e){0===e.eventNames().length&&this.wire.eventAggregator.delete(p(this,l,\"f\"))}},l=new WeakMap;c.Reply=class{};var f={};Object.defineProperty(f,\"__esModule\",{value:!0});var g=f.RuntimeError=f.NotSupportedError=f.NotImplementedError=f.NoAckError=f.DuplicateCorrelationError=f.UnexpectedActionError=f.DisconnectedError=void 0;class m extends Error{constructor(e){super(`Expected websocket state OPEN but found ${e}`),this.readyState=e}}f.DisconnectedError=m;class v extends Error{}f.UnexpectedActionError=v;class C extends Error{}f.DuplicateCorrelationError=C;class b extends Error{}f.NoAckError=b;class I extends Error{}f.NotImplementedError=I;class E extends Error{}f.NotSupportedError=E;class x extends Error{constructor(e){const{message:t,name:n,stack:i,...r}=e;super(t),this.name=n||\"Error\",this.stack=i??this.toString(),Object.keys(r).forEach((e=>{this[e]=r[e]}))}}class A extends Error{static getCallSite(e=0){const t=Error.stackTraceLimit,n=e+1;Error.stackTraceLimit=t+n;const i=Error.prepareStackTrace;Error.prepareStackTrace=(e,t)=>t;const r=(new Error).stack?.slice(n)??[];return Error.prepareStackTrace=i,Error.stackTraceLimit=t,r}static prepareStackTrace(e,t){if(\"function\"==typeof Error.prepareStackTrace)return Error.prepareStackTrace(e,t);let n=\"\";n+=e.name||\"Error\",n+=`: ${e.message||\"\"}`;for(const e of t)n+=`\\n at ${e.toString()}`;return n}constructor(e,t){const{reason:n,error:i}=e;super(n),this.name=\"RuntimeError\",i?.stack&&(this.cause=new x(i)),t&&(this.stack=A.prepareStackTrace(this,t))}}g=f.RuntimeError=A;var P={},M={},O={};Object.defineProperty(O,\"__esModule\",{value:!0}),O.validateIdentity=void 0,O.validateIdentity=function(e){let t;return\"object\"==typeof e&&\"string\"==typeof e.uuid||(t=\"Not a valid identity object\"),t};var _={},S={},R={},F={},j={},k={},L={};Object.defineProperty(L,\"__esModule\",{value:!0}),L.handleDeprecatedWarnings=void 0;var T;L.handleDeprecatedWarnings=e=>{(e.contentNavigation?.whitelist||e.contentNavigation?.blacklist||e.contentRedirect?.whitelist||e.contentRedirect?.blacklist)&&console.warn(\"The properties 'whitelist' and 'blacklist' have been marked as deprecated and will be removed in a future version. Please use 'allowlist' and 'denylist'.\")};var $={},B={};Object.defineProperty(B,\"__esModule\",{value:!0}),B.AsyncRetryableLazy=G=B.Lazy=void 0;var G=B.Lazy=class{constructor(e){this.producerFn=e}getValue(){return this.value||(this.value=this.producerFn()),this.value}};B.AsyncRetryableLazy=class{constructor(e){this.producerFn=e}async getValue(){return this.promise||(this.promise=this.producerFn().catch((e=>{throw delete this.promise,e}))),this.promise}};var W={},H={},N={};Object.defineProperty(N,\"__esModule\",{value:!0}),N.ApiConsumer=void 0;N.ApiConsumer=class{constructor(e){this.strategy=e,this.consume=async e=>(await this.strategy.getExposedFunctions(e)).reduce(((t,n)=>({...t,[n.key]:this.strategy.createFunction(n,e)})),{})}};var D={},U={};Object.defineProperty(U,\"__esModule\",{value:!0}),U.expose=U.getExposedProperties=void 0;const V=Symbol(\"exposedProperties\");U.getExposedProperties=e=>e[V]||e.prototype[V]||[];U.expose=e=>(t,n,i)=>{t[V]=t[V]||[],t[V].push({key:n,descriptor:i,options:e})},Object.defineProperty(D,\"__esModule\",{value:!0}),D.ApiExposer=void 0;const z=U;D.ApiExposer=class{constructor(e){this.strategy=e,this.exposeInstance=async(e,t)=>{const n=(0,z.getExposedProperties)(e),i=await Promise.all(n.map((async({key:n,options:i})=>({key:n,options:await this.strategy.exposeFunction(e[n].bind(e),{key:n,options:i,meta:t})}))));await this.strategy.exposeMeta(t,i)}}};var K={},q={},Y={};Object.defineProperty(Y,\"__esModule\",{value:!0}),Y.ChannelsConsumer=void 0;Y.ChannelsConsumer=class{constructor(e){this.channel=e,this.getExposedFunctions=async e=>{const{id:t}=e,{props:n}=await this.channel.dispatch(`api-meta:${t}`);return n},this.createFunction=e=>(...t)=>{const{action:n}=e.options;return this.channel.dispatch(n,{args:t})}}};var J={};Object.defineProperty(J,\"__esModule\",{value:!0}),J.ChannelsExposer=void 0;J.ChannelsExposer=class{constructor(e){this.channelProviderOrClient=e,this.exposeFunction=async(e,t)=>{const{key:n,options:i,meta:r}=t,{id:o}=r,s=`${o}.${i?.action||n}`;return await this.channelProviderOrClient.register(s,(async({args:t})=>e(...t))),{action:s}},this.exposeMeta=async({id:e},t)=>{const n=`api-meta:${e}`;await this.channelProviderOrClient.register(n,(()=>({props:t})))}}},function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(Y,e),n(J,e)}(q),function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(q,e)}(K),function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(N,e),n(D,e),n(K,e),n(U,e)}(H);var Z={};Object.defineProperty(Z,\"__esModule\",{value:!0}),Z.createRelayedDispatch=Z.relayChannelClientApi=void 0;const Q=[\"no longer connected\",\"RTCDataChannel closed unexpectedly\",\"The client you are trying to dispatch from is disconnected from the target provider\"];Z.relayChannelClientApi=async(e,t)=>{e.register(`relay:${t}`,(({action:t,target:n,payload:i})=>e.dispatch(n,t,i))),await Promise.resolve()};Z.createRelayedDispatch=(e,t,n,i)=>async(r,o)=>{try{return await e.dispatch(`relay:${n}`,{action:r,payload:o,target:t})}catch(e){if(s=e.message,Q.some((e=>s.includes(e)))&&i)throw new Error(i);throw e}var s};var X,ee,te,ne=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},ie=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(W,\"__esModule\",{value:!0}),W.ColumnOrRow=W.TabStack=W.LayoutNode=void 0;const re=H,oe=Z;class se{constructor(e,t){X.set(this,void 0),this.isRoot=()=>ie(this,X,\"f\").isRoot(this.entityId),this.exists=()=>ie(this,X,\"f\").exists(this.entityId),this.getParent=async()=>{const e=await ie(this,X,\"f\").getParent(this.entityId);if(e)return se.getEntity(e,ie(this,X,\"f\"))},this.createAdjacentStack=async(e,t)=>{const n=await ie(this,X,\"f\").createAdjacentStack(this.entityId,e,t);return se.getEntity({entityId:n,type:\"stack\"},ie(this,X,\"f\"))},this.getAdjacentStacks=async e=>(await ie(this,X,\"f\").getAdjacentStacks({targetId:this.entityId,edge:e})).map((e=>se.getEntity({type:\"stack\",entityId:e.entityId},ie(this,X,\"f\")))),ne(this,X,e,\"f\"),this.entityId=t}}W.LayoutNode=se,X=new WeakMap,se.newLayoutEntitiesClient=async(e,t,n)=>{const i=(0,oe.createRelayedDispatch)(e,n,\"layout-relay\",\"You are trying to interact with a layout component on a window that does not exist or has been destroyed.\");return new re.ApiConsumer(new re.ChannelsConsumer({dispatch:i})).consume({id:t})},se.getEntity=(e,t)=>{const{entityId:n,type:i}=e;switch(i){case\"column\":case\"row\":return new ce(t,n,i);case\"stack\":return new ae(t,n);default:throw new Error(`Unrecognised Layout Entity encountered ('${JSON.stringify(e)})`)}};class ae extends se{constructor(e,t){super(e,t),ee.set(this,void 0),this.type=\"stack\",this.getViews=()=>ie(this,ee,\"f\").getStackViews(this.entityId),this.addView=async(e,t={index:0})=>ie(this,ee,\"f\").addViewToStack(this.entityId,e,t),this.removeView=async e=>{await ie(this,ee,\"f\").removeViewFromStack(this.entityId,e)},this.setActiveView=async e=>{await ie(this,ee,\"f\").setStackActiveView(this.entityId,e)},ne(this,ee,e,\"f\")}}W.TabStack=ae,ee=new WeakMap;class ce extends se{constructor(e,t,n){super(e,t),te.set(this,void 0),this.getContent=async()=>(await ie(this,te,\"f\").getContent(this.entityId)).map((e=>se.getEntity(e,ie(this,te,\"f\")))),ne(this,te,e,\"f\"),this.type=n}}W.ColumnOrRow=ce,te=new WeakMap;var de={};Object.defineProperty(de,\"__esModule\",{value:!0}),de.DEFAULT_LAYOUT_KEY=de.LAYOUT_CONTROLLER_ID=void 0,de.LAYOUT_CONTROLLER_ID=\"layout-entities\",de.DEFAULT_LAYOUT_KEY=\"__default__\";var he={};Object.defineProperty(he,\"__esModule\",{value:!0}),he.WebContents=void 0;const le=c;class ue extends le.EmitterBase{constructor(e,t,n){super(e,n,t.uuid,t.name),this.identity=t,this.entityType=n}capturePage(e){return this.wire.sendAction(\"capture-page\",{options:e,...this.identity}).then((({payload:e})=>e.data))}executeJavaScript(e){return this.wire.sendAction(\"execute-javascript-in-window\",{...this.identity,code:e}).then((({payload:e})=>e.data))}getZoomLevel(){return this.wire.sendAction(\"get-zoom-level\",this.identity).then((({payload:e})=>e.data))}setZoomLevel(e){return this.wire.sendAction(\"set-zoom-level\",{...this.identity,level:e}).then((()=>{}))}navigate(e){return this.wire.sendAction(\"navigate-window\",{...this.identity,url:e}).then((()=>{}))}navigateBack(){return this.wire.sendAction(\"navigate-window-back\",{...this.identity}).then((()=>{}))}async navigateForward(){await this.wire.sendAction(\"navigate-window-forward\",{...this.identity})}stopNavigation(){return this.wire.sendAction(\"stop-window-navigation\",{...this.identity}).then((()=>{}))}reload(e=!1){return this.wire.sendAction(\"reload-window\",{ignoreCache:e,...this.identity}).then((()=>{}))}print(e={}){return this.wire.sendAction(\"print\",{...this.identity,options:e}).then((()=>{}))}findInPage(e,t){return this.wire.sendAction(\"find-in-page\",{...this.identity,searchTerm:e,options:t}).then((({payload:e})=>e.data))}stopFindInPage(e){return this.wire.sendAction(\"stop-find-in-page\",{...this.identity,action:e}).then((()=>{}))}getPrinters(){return this.wire.sendAction(\"get-printers\",{...this.identity}).then((({payload:e})=>e.data))}async focus({emitSynthFocused:e}={emitSynthFocused:!0}){await this.wire.sendAction(\"focus-window\",{emitSynthFocused:e,...this.identity})}async showDeveloperTools(){await this.wire.sendAction(\"show-developer-tools\",this.identity)}async getProcessInfo(){const{payload:{data:e}}=await this.wire.sendAction(\"get-process-info\",this.identity);return e}async getSharedWorkers(){return this.wire.sendAction(\"get-shared-workers\",this.identity).then((({payload:e})=>e.data))}async inspectSharedWorker(){await this.wire.sendAction(\"inspect-shared-worker\",{...this.identity})}async inspectSharedWorkerById(e){await this.wire.sendAction(\"inspect-shared-worker-by-id\",{...this.identity,workerId:e})}async inspectServiceWorker(){await this.wire.sendAction(\"inspect-service-worker\",{...this.identity})}async showPopupWindow(e){if(this.wire.sendAction(`${this.entityType}-show-popup-window`,this.identity).catch((()=>{})),e?.onPopupReady){const t=async({popupName:t})=>{try{const n=this.fin.Window.wrapSync({uuid:this.fin.me.uuid,name:t});await e.onPopupReady(n)}catch(e){throw new Error(`Something went wrong during onPopupReady execution: ${e}`)}};await this.once(\"popup-ready\",t)}const{payload:t}=await this.wire.sendAction(\"try-create-popup-window\",{options:{...e,hasResultCallback:!!e?.onPopupResult,hasReadyCallback:!!e?.onPopupReady},...this.identity}),{data:{willOpen:n,options:i}}=t;n&&await this.fin.Window.create(i.initialOptions);if(e?.onPopupResult){const t=async t=>{await e.onPopupResult((e=>{const{name:t,uuid:n,result:i,data:r}=e,o={identity:{name:t,uuid:n},result:i};return r&&(o.data=r),o})(t))},n=async()=>{await this.removeListener(\"popup-result\",t)};await this.on(\"popup-result\",t),await this.once(\"popup-teardown\",n)}const{payload:r}=await this.wire.sendAction(\"show-popup-window\",{options:i,...this.identity});return r.data}}var pe,we,ye,fe,ge;function me(){return we||(we=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(function(){if(T)return k;T=1,Object.defineProperty(k,\"__esModule\",{value:!0}),k.ViewModule=void 0;const e=c,t=O,n=me(),i=L;class r extends e.Base{async create(e){const{uuid:t}=this.wire.me;if(!e.name||\"string\"!=typeof e.name)throw new Error(\"Please provide a name property as a string in order to create a View.\");return(0,i.handleDeprecatedWarnings)(e),this.wire.environment.childViews?await this.wire.environment.createChildContent({entityType:\"view\",options:{...e,uuid:t}}):await this.wire.sendAction(\"create-view\",{...e,uuid:t}),this.wrapSync({uuid:t,name:e.name})}async wrap(e){this.wire.sendAction(\"view-wrap\");const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.View(this.wire,e)}wrapSync(e){this.wire.sendAction(\"view-wrap-sync\").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.View(this.wire,e)}getCurrent(){if(this.wire.sendAction(\"view-get-current\").catch((e=>{})),!this.wire.me.isView)throw new Error(\"You are not in a View context\");const{uuid:e,name:t}=this.wire.me;return this.wrap({uuid:e,name:t})}getCurrentSync(){if(this.wire.sendAction(\"view-get-current-sync\").catch((e=>{})),!this.wire.me.isView)throw new Error(\"You are not in a View context\");const{uuid:e,name:t}=this.wire.me;return this.wrapSync({uuid:e,name:t})}}return k.ViewModule=r,k}(),e),n(function(){if(pe)return $;pe=1;var e,t=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty($,\"__esModule\",{value:!0}),$.View=void 0;const n=f,i=B,r=W,s=de,a=he,c=Pe();class d extends a.WebContents{constructor(o,a){super(o,a,\"view\"),this.identity=a,e.set(this,new i.Lazy((()=>this.fin.Platform.wrapSync(this.identity).getClient()))),this.attach=async e=>{await this.wire.sendAction(\"attach-view\",{target:e,...this.identity})},this.destroy=async()=>{await this.wire.sendAction(\"destroy-view\",{...this.identity})},this.show=async()=>{await this.wire.sendAction(\"show-view\",{...this.identity})},this.showAt=async e=>{await this.wire.sendAction(\"show-view-at\",{bounds:e,...this.identity})},this.hide=async()=>{await this.wire.sendAction(\"hide-view\",{...this.identity})},this.setBounds=async e=>{await this.wire.sendAction(\"set-view-bounds\",{bounds:e,...this.identity})},this.getBounds=async()=>(await this.wire.sendAction(\"get-view-bounds\",{...this.identity})).payload.data,this.getInfo=async()=>(await this.wire.sendAction(\"get-view-info\",{...this.identity})).payload.data,this.getParentLayout=async()=>{this.wire.sendAction(\"view-get-parent-layout\",{...this.identity}).catch((()=>{}));const n=await this.getCurrentWindow();try{const i=await t(this,e,\"f\").getValue(),o=await r.LayoutNode.newLayoutEntitiesClient(i,s.LAYOUT_CONTROLLER_ID,n.identity),a=await o.getLayoutIdentityForViewOrThrow(this.identity);return this.fin.Platform.Layout.wrap(a)}catch(e){if(![\"No action registered at target for\",\"getLayoutIdentityForViewOrThrow is not a function\"].some((t=>e.message.includes(t))))throw e;return this.fin.Platform.Layout.wrap(n.identity)}},this.getOptions=async()=>this.wire.sendAction(\"get-view-options\",{...this.identity}).then((({payload:e})=>e.data)),this.updateOptions=async e=>this.wire.sendAction(\"update-view-options\",{options:e,...this.identity}).then((()=>{})),this.getCurrentWindow=async()=>{const{payload:{data:e}}=await this.wire.sendAction(\"get-view-window\",{...this.identity});return new c._Window(this.wire,e)},this.getCurrentStack=async()=>{this.wire.sendAction(\"view-get-current-stack\").catch((()=>{}));try{const n=await this.getCurrentWindow(),i=await t(this,e,\"f\").getValue(),o=await r.LayoutNode.newLayoutEntitiesClient(i,s.LAYOUT_CONTROLLER_ID,n.identity),a=await o.getStackByView(this.identity);return r.LayoutNode.getEntity(a,o)}catch(e){throw new n.RuntimeError({reason:\"This view does not belong to a stack.\",error:e})}},this.triggerBeforeUnload=async()=>(await this.wire.sendAction(\"trigger-before-unload\",{...this.identity})).payload.data,this.bindToElement=async e=>{if(!e)throw new Error(\"Element not found.\");return this.wire.environment.observeBounds(e,(async e=>this.setBounds(e)))}}async focus({emitSynthFocused:e}={emitSynthFocused:!0}){const t=await this.getCurrentWindow();await t.focusedWebViewWasChanged(),await super.focus({emitSynthFocused:e})}}return $.View=d,e=new WeakMap,$}(),e)}(j)),j}function ve(){if(ye)return F;ye=1,Object.defineProperty(F,\"__esModule\",{value:!0}),F.Application=void 0;const e=c,t=Pe(),n=me();class i extends e.EmitterBase{constructor(e,n){super(e,\"application\",n.uuid),this.identity=n,this.window=new t._Window(this.wire,{uuid:this.identity.uuid,name:this.identity.uuid})}windowListFromIdentityList(e){const n=[];return e.forEach((e=>{n.push(new t._Window(this.wire,{uuid:e.uuid,name:e.name}))})),n}isRunning(){return this.wire.sendAction(\"is-application-running\",this.identity).then((({payload:e})=>e.data))}async quit(e=!1){try{await this._close(e),await this.wire.sendAction(\"destroy-application\",{force:e,...this.identity})}catch(e){if(![\"Remote connection has closed\",\"Could not locate the requested application\"].some((t=>e.message.includes(t))))throw e}}async _close(e=!1){try{await this.wire.sendAction(\"close-application\",{force:e,...this.identity})}catch(e){if(!e.message.includes(\"Remote connection has closed\"))throw e}}close(e=!1){return console.warn(\"Deprecation Warning: Application.close is deprecated Please use Application.quit\"),this.wire.sendAction(\"application-close\",this.identity).catch((e=>{})),this._close(e)}getChildWindows(){return this.wire.sendAction(\"get-child-windows\",this.identity).then((({payload:e})=>{const t=[];return e.data.forEach((e=>{t.push({uuid:this.identity.uuid,name:e})})),this.windowListFromIdentityList(t)}))}getManifest(){return this.wire.sendAction(\"get-application-manifest\",this.identity).then((({payload:e})=>e.data))}getParentUuid(){return this.wire.sendAction(\"get-parent-application\",this.identity).then((({payload:e})=>e.data))}getShortcuts(){return this.wire.sendAction(\"get-shortcuts\",this.identity).then((({payload:e})=>e.data))}async getViews(){const{payload:e}=await this.wire.sendAction(\"application-get-views\",this.identity);return e.data.map((e=>new n.View(this.wire,e)))}getZoomLevel(){return this.wire.sendAction(\"get-application-zoom-level\",this.identity).then((({payload:e})=>e.data))}getWindow(){return this.wire.sendAction(\"application-get-window\",this.identity).catch((e=>{})),Promise.resolve(this.window)}registerUser(e,t){return this.wire.sendAction(\"register-user\",{userName:e,appName:t,...this.identity}).then((()=>{}))}removeTrayIcon(){return this.wire.sendAction(\"remove-tray-icon\",this.identity).then((()=>{}))}restart(){return this.wire.sendAction(\"restart-application\",this.identity).then((()=>{}))}run(){return console.warn(\"Deprecation Warning: Application.run is deprecated Please use fin.Application.start\"),this.wire.sendAction(\"application-run\",this.identity).catch((e=>{})),this._run()}_run(e={}){return this.wire.sendAction(\"run-application\",{manifestUrl:this._manifestUrl,opts:e,...this.identity}).then((()=>{}))}scheduleRestart(){return this.wire.sendAction(\"relaunch-on-close\",this.identity).then((()=>{}))}async sendApplicationLog(){const{payload:e}=await this.wire.sendAction(\"send-application-log\",this.identity);return e.data}async setJumpList(e){await this.wire.sendAction(\"set-jump-list\",{config:e,...this.identity})}setTrayIcon(e){return this.wire.sendAction(\"set-tray-icon\",{enabledIcon:e,...this.identity}).then((()=>{}))}setShortcuts(e){return this.wire.sendAction(\"set-shortcuts\",{data:e,...this.identity}).then((()=>{}))}async setShortcutQueryParams(e){await this.wire.sendAction(\"set-shortcut-query-args\",{data:e,...this.identity})}setZoomLevel(e){return this.wire.sendAction(\"set-application-zoom-level\",{level:e,...this.identity}).then((()=>{}))}async setAppLogUsername(e){await this.wire.sendAction(\"set-app-log-username\",{data:e,...this.identity})}getTrayIconInfo(){return this.wire.sendAction(\"get-tray-icon-info\",this.identity).then((({payload:e})=>e.data))}hasTrayIcon(){return this.wire.sendAction(\"has-tray-icon\",this.identity).then((({payload:e})=>e.data))}terminate(){return this.wire.sendAction(\"terminate-application\",this.identity).then((()=>{}))}wait(){return this.wire.sendAction(\"wait-for-hung-application\",this.identity).then((()=>{}))}getInfo(){return this.wire.sendAction(\"get-info\",this.identity).then((({payload:e})=>e.data))}async getProcessInfo(){const{payload:{data:e}}=await this.wire.sendAction(\"application-get-process-info\",this.identity);return e}async setFileDownloadLocation(e){const{name:t}=this.wire.me,n={uuid:this.identity.uuid,name:t};await this.wire.sendAction(\"set-file-download-location\",{...n,downloadLocation:e})}async getFileDownloadLocation(){const{payload:{data:e}}=await this.wire.sendAction(\"get-file-download-location\",this.identity);return e}async showTrayIconPopupMenu(e){const{name:t}=this.wire.me,n={uuid:this.identity.uuid,name:t},{payload:i}=await this.wire.sendAction(\"show-tray-icon-popup-menu\",{...n,options:e});return i.data}async closeTrayIconPopupMenu(){const{name:e}=this.wire.me,t={uuid:this.identity.uuid,name:e};await this.wire.sendAction(\"close-tray-icon-popup-menu\",{...t})}}return F.Application=i,F}function Ce(){return ge||(ge=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(function(){if(fe)return R;fe=1,Object.defineProperty(R,\"__esModule\",{value:!0}),R.ApplicationModule=void 0;const e=c,t=O,n=ve();class i extends e.Base{async wrap(e){this.wire.sendAction(\"wrap-application\").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.Application(this.wire,e)}wrapSync(e){this.wire.sendAction(\"wrap-application-sync\").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n.Application(this.wire,e)}async _create(e){return void 0===e.waitForPageLoad&&(e.waitForPageLoad=!1),void 0===e.autoShow&&void 0===e.isPlatformController&&(e.autoShow=!0),await this.wire.sendAction(\"create-application\",e),this.wrap({uuid:e.uuid})}create(e){return console.warn(\"Deprecation Warning: fin.Application.create is deprecated. Please use fin.Application.start\"),this.wire.sendAction(\"application-create\").catch((e=>{})),this._create(e)}async start(e){this.wire.sendAction(\"start-application\").catch((e=>{}));const t=await this._create(e);return await this.wire.sendAction(\"run-application\",{uuid:e.uuid}),t}async startManyManifests(e,t){return this.wire.sendAction(\"run-applications\",{applications:e,opts:t}).then((()=>{}))}getCurrent(){return this.wire.sendAction(\"get-current-application\").catch((e=>{})),this.wrap({uuid:this.wire.me.uuid})}getCurrentSync(){return this.wire.sendAction(\"get-current-application-sync\").catch((e=>{})),this.wrapSync({uuid:this.wire.me.uuid})}async startFromManifest(e,t){this.wire.sendAction(\"application-start-from-manifest\").catch((e=>{}));const n=await this._createFromManifest(e);return await n._run(t),n}createFromManifest(e){return console.warn(\"Deprecation Warning: fin.Application.createFromManifest is deprecated. Please use fin.Application.startFromManifest\"),this.wire.sendAction(\"application-create-from-manifest\").catch((e=>{})),this._createFromManifest(e)}_createFromManifest(e){return this.wire.sendAction(\"get-application-manifest\",{manifestUrl:e}).then((({payload:e})=>{const t=e.data.platform?e.data.platform.uuid:e.data.startup_app.uuid;return this.wrap({uuid:t})})).then((t=>(t._manifestUrl=e,t)))}}return R.ApplicationModule=i,R}(),e),n(ve(),e)}(S)),S}he.WebContents=ue;var be={};Object.defineProperty(be,\"__esModule\",{value:!0}),be.promisifySubscription=void 0;var Ie,Ee,xe;function Ae(){if(Ie)return _;Ie=1,Object.defineProperty(_,\"__esModule\",{value:!0}),_._Window=void 0;const e=Ce(),t=he,n=me(),i=L,r=be;class o extends t.WebContents{constructor(e,t){super(e,t,\"window\")}async createWindow(e){this.wire.sendAction(\"window-create-window\",this.identity).catch((e=>{}));const t=await(0,r.promisifySubscription)(this,\"fire-constructor-callback\");void 0===e.waitForPageLoad&&(e.waitForPageLoad=!1),void 0===e.autoShow&&(e.autoShow=!0),(0,i.handleDeprecatedWarnings)(e);const n=this.wire.environment.createChildContent({entityType:\"window\",options:e}),[o]=await Promise.all([t.getValue(),n]);let s;const{success:a}=o,c=o.data,{message:d}=c;s=a?{httpResponseCode:c.httpResponseCode,apiInjected:c.apiInjected}:{message:c.message,networkErrorCode:c.networkErrorCode,stack:c.stack};const h={message:d,cbPayload:s,success:a};try{this.getWebWindow().fin.__internal_.openerSuccessCBCalled()}catch(e){}return h.success?this:Promise.reject(h)}getAllFrames(){return this.wire.sendAction(\"get-all-frames\",this.identity).then((({payload:e})=>e.data))}getBounds(){return this.wire.sendAction(\"get-window-bounds\",this.identity).then((({payload:e})=>e.data))}center(){return this.wire.sendAction(\"center-window\",this.identity).then((()=>{}))}blur(){return this.wire.sendAction(\"blur-window\",this.identity).then((()=>{}))}bringToFront(){return this.wire.sendAction(\"bring-window-to-front\",this.identity).then((()=>{}))}animate(e,t){return this.wire.sendAction(\"animate-window\",{transitions:e,options:t,...this.identity}).then((()=>{}))}hide(){return this.wire.sendAction(\"hide-window\",this.identity).then((()=>{}))}close(e=!1){return this.wire.sendAction(\"close-window\",{force:e,...this.identity}).then((()=>{Object.setPrototypeOf(this,null)}))}focusedWebViewWasChanged(){return this.wire.sendAction(\"focused-webview-changed\",this.identity).then((()=>{}))}getNativeId(){return this.wire.sendAction(\"get-window-native-id\",this.identity).then((({payload:e})=>e.data))}async getCurrentViews(){const{payload:e}=await this.wire.sendAction(\"window-get-views\",this.identity);return e.data.map((e=>new n.View(this.wire,e)))}disableFrame(){return console.warn(\"Function is deprecated; use disableUserMovement instead.\"),this.wire.sendAction(\"disable-window-frame\",this.identity).then((()=>{}))}disableUserMovement(){return this.wire.sendAction(\"disable-window-frame\",this.identity).then((()=>{}))}enableFrame(){return console.warn(\"Function is deprecated; use enableUserMovement instead.\"),this.wire.sendAction(\"enable-window-frame\",this.identity).then((()=>{}))}enableUserMovement(){return this.wire.sendAction(\"enable-window-frame\",this.identity).then((()=>{}))}flash(){return this.wire.sendAction(\"flash-window\",this.identity).then((()=>{}))}stopFlashing(){return this.wire.sendAction(\"stop-flash-window\",this.identity).then((()=>{}))}getInfo(){return this.wire.sendAction(\"get-window-info\",this.identity).then((({payload:e})=>e.data))}async getLayout(e){this.wire.sendAction(\"window-get-layout\",this.identity).catch((e=>{}));const t=await this.getOptions();if(!t.layout||!t.layoutSnapshot)throw new Error(\"Window does not have a Layout\");return this.fin.Platform.Layout.wrap(e??this.identity)}getOptions(){return this.wire.sendAction(\"get-window-options\",this.identity).then((({payload:e})=>e.data))}getParentApplication(){return this.wire.sendAction(\"window-get-parent-application\",this.identity).catch((e=>{})),Promise.resolve(new e.Application(this.wire,this.identity))}getParentWindow(){return this.wire.sendAction(\"window-get-parent-window\",this.identity).catch((e=>{})),Promise.resolve(new e.Application(this.wire,this.identity)).then((e=>e.getWindow()))}async getSnapshot(e){const t={area:e,...this.identity};console.warn(\"Window.getSnapshot has been deprecated, please use Window.capturePage\");return(await this.wire.sendAction(\"get-window-snapshot\",t)).payload.data}getState(){return this.wire.sendAction(\"get-window-state\",this.identity).then((({payload:e})=>e.data))}getWebWindow(){return this.wire.sendAction(\"window-get-web-window\",this.identity).catch((e=>{})),this.wire.environment.getWebWindow(this.identity)}isMainWindow(){return this.wire.sendAction(\"window-is-main-window\",this.identity).catch((e=>{})),this.me.uuid===this.me.name}isShowing(){return this.wire.sendAction(\"is-window-showing\",this.identity).then((({payload:e})=>e.data))}maximize(){return this.wire.sendAction(\"maximize-window\",this.identity).then((()=>{}))}minimize(){return this.wire.sendAction(\"minimize-window\",this.identity).then((()=>{}))}moveBy(e,t,n){return this.wire.sendAction(\"move-window-by\",{deltaLeft:e,deltaTop:t,positioningOptions:n,...this.identity}).then((()=>{}))}moveTo(e,t,n){return this.wire.sendAction(\"move-window\",{left:e,top:t,positioningOptions:n,...this.identity}).then((()=>{}))}resizeBy(e,t,n,i){return this.wire.sendAction(\"resize-window-by\",{deltaWidth:Math.floor(e),deltaHeight:Math.floor(t),anchor:n,positioningOptions:i,...this.identity}).then((()=>{}))}resizeTo(e,t,n,i){return this.wire.sendAction(\"resize-window\",{width:Math.floor(e),height:Math.floor(t),anchor:n,positioningOptions:i,...this.identity}).then((()=>{}))}restore(){return this.wire.sendAction(\"restore-window\",this.identity).then((()=>{}))}setAsForeground(){return this.wire.sendAction(\"set-foreground-window\",this.identity).then((()=>{}))}setBounds(e,t){return this.wire.sendAction(\"set-window-bounds\",{...e,...this.identity,positioningOptions:t}).then((()=>{}))}show(e=!1){return this.wire.sendAction(\"show-window\",{force:e,...this.identity}).then((()=>{}))}showAt(e,t,n=!1){return this.wire.sendAction(\"show-at-window\",{force:n,left:Math.floor(e),top:Math.floor(t),...this.identity}).then((()=>{}))}updateOptions(e){return this.wire.sendAction(\"update-window-options\",{options:e,...this.identity}).then((()=>{}))}authenticate(e,t){return this.wire.sendAction(\"window-authenticate\",{userName:e,password:t,...this.identity}).then((()=>{}))}async showPopupMenu(e){const{payload:t}=await this.wire.sendAction(\"show-popup-menu\",{options:e,...this.identity});return t.data}async closePopupMenu(){return this.wire.sendAction(\"close-popup-menu\",{...this.identity}).then((()=>{}))}async dispatchPopupResult(e){this.wire.sendAction(\"window-dispatch-popup-result\",this.identity).catch((e=>{})),await this.wire.sendAction(\"dispatch-popup-result\",{data:e,...this.identity})}async print(e={content:\"self\"}){switch(e.content){case void 0:case\"self\":return super.print(e);case\"screenshot\":return this.wire.sendAction(\"print-screenshot\",this.identity).then((()=>{}));case\"views\":return this.wire.sendAction(\"print-views\",{...this.identity,options:e}).then((()=>{}));default:return}}}return _._Window=o,_}function Pe(){return xe||(xe=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(function(){if(Ee)return M;Ee=1,Object.defineProperty(M,\"__esModule\",{value:!0}),M._WindowModule=void 0;const e=c,t=O,n=Ae();class i extends e.Base{async wrap(e){this.wire.sendAction(\"window-wrap\").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n._Window(this.wire,e)}wrapSync(e){this.wire.sendAction(\"window-wrap-sync\").catch((e=>{}));const i=(0,t.validateIdentity)(e);if(i)throw new Error(i);return new n._Window(this.wire,e)}create(e){return this.wire.sendAction(\"create-window\").catch((e=>{})),new n._Window(this.wire,{uuid:this.me.uuid,name:e.name}).createWindow(e)}getCurrent(){if(this.wire.sendAction(\"get-current-window\").catch((e=>{})),!this.wire.me.isWindow)throw new Error(\"You are not in a Window context\");const{uuid:e,name:t}=this.wire.me;return this.wrap({uuid:e,name:t})}getCurrentSync(){if(this.wire.sendAction(\"get-current-window-sync\").catch((e=>{})),!this.wire.me.isWindow)throw new Error(\"You are not in a Window context\");const{uuid:e,name:t}=this.wire.me;return this.wrapSync({uuid:e,name:t})}}return M._WindowModule=i,M}(),e),n(Ae(),e)}(P)),P}be.promisifySubscription=async(e,t,n=(()=>!0),i)=>{let r,o,s;const a=new Promise(((e,t)=>{r=e,o=t})),c=e=>{n(e)&&(clearTimeout(s),r(e))};return await e.on(t,c),i&&(s=setTimeout((()=>o(new Error(\"event timed out\"))),i)),a.finally((()=>{e.removeListener(t,c).catch((()=>null))})),{getValue:()=>a}},Object.defineProperty(a,\"__esModule\",{value:!0}),a.System=void 0;const Me=c,Oe=f,_e=Pe(),Se=t;class Re extends Me.EmitterBase{constructor(e){super(e,\"system\")}sendExternalProcessRequest(e,t){return new Promise(((n,i)=>{const r=\"external-process-exited\";let o,s,a,c;\"function\"==typeof t.listener&&(a=e=>{const n=e||{};s={topic:\"exited\",uuid:n.processUuid||\"\",exitCode:n.exitCode||0},o===e.processUuid&&(t.listener(s),c.removeListener(r,a))},this.wire.me.name||(this.wire.me.name=this.wire.me.uuid),c=new _e._Window(this.wire,this.wire.me),c.on(r,a)),this.wire.sendAction(e,t).then((({payload:e})=>{o=e.data.uuid,n(e.data),s&&o===s.uuid&&(t.listener(s),c.removeListener(r,a))})).catch((e=>{c&&c.removeListener(r,a),i(e)}))}))}getVersion(){return this.wire.sendAction(\"get-version\").then((({payload:e})=>e.data))}clearCache(e){return this.wire.sendAction(\"clear-cache\",e).then((()=>{}))}deleteCacheOnExit(){return this.wire.sendAction(\"delete-cache-request\").then((()=>{}))}exit(){return this.wire.sendAction(\"exit-desktop\").then((()=>{}))}async fetchManifest(e){const{payload:{data:t}}=await this.wire.sendAction(\"fetch-manifest\",{manifestUrl:e});return t}flushCookieStore(){return this.wire.sendAction(\"flush-cookie-store\").then((()=>{}))}getAllWindows(){return this.wire.sendAction(\"get-all-windows\").then((({payload:e})=>e.data))}getAllApplications(){return this.wire.sendAction(\"get-all-applications\").then((({payload:e})=>e.data))}getCommandLineArguments(){return this.wire.sendAction(\"get-command-line-arguments\").then((({payload:e})=>e.data))}async getCrashReporterState(){const{payload:{data:{diagnosticMode:e,isRunning:t}}}=await this.wire.sendAction(\"get-crash-reporter-state\");return console.warn(\"diagnosticMode property is deprecated. It will be removed in a future version\"),{diagnosticMode:e,diagnosticsMode:e,isRunning:t}}async startCrashReporter(e){const t=e,n={...t,diagnosticMode:t.diagnosticsMode||t.diagnosticMode},{payload:{data:{diagnosticMode:i,isRunning:r}}}=await this.wire.sendAction(\"start-crash-reporter\",n);return{diagnosticMode:i,diagnosticsMode:i,isRunning:r}}getUniqueUserId(){return this.wire.sendAction(\"get-unique-user-id\").then((({payload:e})=>e.data))}getEntityInfo(e,t){return this.wire.sendAction(\"get-entity-info\",{uuid:e,name:t}).then((({payload:e})=>e.data))}getEnvironmentVariable(e){return this.wire.sendAction(\"get-environment-variable\",{environmentVariables:e}).then((({payload:e})=>e.data))}getFocusedWindow(){return this.wire.sendAction(\"get-focused-window\").then((({payload:e})=>e.data))}async isAppCertified(e){const{payload:{data:{certifiedInfo:t}}}=await this.wire.sendAction(\"is-app-certified\",{manifestUrl:e});return t}getInstalledRuntimes(){return this.wire.sendAction(\"get-installed-runtimes\").then((({payload:e})=>e.data.runtimes))}async getInstalledApps(){const{payload:{data:{installedApps:e}}}=await this.wire.sendAction(\"get-installed-apps\");return e}getLog(e){return this.wire.sendAction(\"view-log\",e).then((({payload:e})=>e.data))}getMachineId(){return this.wire.sendAction(\"get-machine-id\").then((({payload:e})=>e.data))}getMinLogLevel(){return this.wire.sendAction(\"get-min-log-level\").then((({payload:e})=>e.data))}getLogList(){return this.wire.sendAction(\"list-logs\").then((({payload:e})=>e.data))}getMonitorInfo(){return this.wire.sendAction(\"get-monitor-info\").then((({payload:e})=>e.data))}getMousePosition(){return this.wire.sendAction(\"get-mouse-position\").then((({payload:e})=>e.data))}getProcessList(){return console.warn(\"System.getProcessList has been deprecated. Please consider using our new process APIs: Window.getProcessInfo, View.getProcessInfo, Application.getProcessInfo, System.getAllProcessInfo\"),this.wire.sendAction(\"process-snapshot\").then((({payload:e})=>e.data))}async getAllProcessInfo(){const{payload:{data:e}}=await this.wire.sendAction(\"get-all-process-info\",this.identity);return e}getProxySettings(){return this.wire.sendAction(\"get-proxy-settings\").then((({payload:e})=>e.data))}getRuntimeInfo(){return this.wire.sendAction(\"get-runtime-info\").then((({payload:e})=>e.data))}getRvmInfo(){return this.wire.sendAction(\"get-rvm-info\").then((({payload:e})=>e.data))}getHostSpecs(){return this.wire.sendAction(\"get-host-specs\").then((({payload:e})=>e.data))}launchExternalProcess(e){return this.sendExternalProcessRequest(\"launch-external-process\",e)}monitorExternalProcess(e){return this.sendExternalProcessRequest(\"monitor-external-process\",e)}log(e,t){return this.wire.sendAction(\"write-to-log\",{level:e,message:t}).then((()=>{}))}openUrlWithBrowser(e){return this.wire.sendAction(\"open-url-with-browser\",{url:e}).then((()=>{}))}async registerCustomProtocol(e){if(\"object\"!=typeof e)throw new Error(\"Must provide an object with a `protocolName` property having a string value.\");await this.wire.sendAction(\"register-custom-protocol\",e)}async unregisterCustomProtocol(e){await this.wire.sendAction(\"unregister-custom-protocol\",{protocolName:e})}async getCustomProtocolState(e){return this.wire.sendAction(\"get-custom-protocol-state\",{protocolName:e}).then((({payload:e})=>e.data))}releaseExternalProcess(e){return this.wire.sendAction(\"release-external-process\",{uuid:e}).then((()=>{}))}showDeveloperTools(e){return this.wire.sendAction(\"show-developer-tools\",e).then((()=>{}))}terminateExternalProcess(e){return this.wire.sendAction(\"terminate-external-process\",e).then((()=>{}))}updateProxySettings(e){return this.wire.sendAction(\"update-proxy\",e).then((()=>{}))}async downloadAsset(e,t){const n=()=>{};let i=n,r=n;const o=new Promise(((e,t)=>{i=e,r=t}));if(\"openfin\"!==this.wire.environment.type)throw new Oe.NotSupportedError(\"downloadAsset only supported in an OpenFin Render process\");const s=Oe.RuntimeError.getCallSite(),a=this.wire.environment.getNextMessageId().toString(),c=`asset-download-progress-${a}`,d=`asset-download-error-${a}`,h=`asset-download-complete-${a}`,l=e=>{const n={downloadedBytes:e.downloadedBytes,totalBytes:e.totalBytes};t(n)},u=()=>{this.removeListener(c,l)};await Promise.all([this.on(c,l),this.once(d,(e=>{u();const{reason:t,err:n}=e;r(new Oe.RuntimeError({reason:t,error:n},s))})),this.once(h,(()=>{u(),i()}))]);const p=Object.assign(e,{downloadId:a});return await this.wire.sendAction(\"download-asset\",p).catch((e=>{throw u(),e})),o}downloadRuntime(e,t){const n=Oe.RuntimeError.getCallSite();return new Promise(((i,r)=>{if(\"openfin\"!==this.wire.environment.type)return void r(new Oe.NotSupportedError(\"downloadRuntime only supported in an OpenFin Render process\"));const o=this.wire.environment.getNextMessageId().toString(),s=`runtime-download-progress-${o}`,a=`runtime-download-error-${o}`,c=`runtime-download-complete-${o}`,d=e=>{const n={downloadedBytes:e.downloadedBytes,totalBytes:e.totalBytes};t(n)},h=()=>{this.removeListener(s,d)};this.on(s,d),this.once(a,(e=>{h();const{reason:t,err:i}=e;r(new Oe.RuntimeError({reason:t,error:i},n))})),this.once(c,(()=>{h(),i()}));const l=Object.assign(e,{downloadId:o});this.wire.sendAction(\"download-runtime\",l).catch((e=>{h(),r(e)}))}))}downloadPreloadScripts(e){return this.wire.sendAction(\"download-preload-scripts\",{scripts:e}).then((({payload:e})=>e.data))}getAllExternalApplications(){return this.wire.sendAction(\"get-all-external-applications\").then((({payload:e})=>e.data))}getAppAssetInfo(e){return this.wire.sendAction(\"get-app-asset-info\",e).then((({payload:e})=>e.data))}getCookies(e){const t=this.wire.environment.getUrl(),n=Object.assign(e,{url:t});return this.wire.sendAction(\"get-cookies\",n).then((({payload:e})=>e.data))}setMinLogLevel(e){return this.wire.sendAction(\"set-min-log-level\",{level:e}).then((()=>{}))}resolveUuid(e){return this.wire.sendAction(\"resolve-uuid\",{entityKey:e}).then((({payload:e})=>e.data))}executeOnRemote(e,t){return t.requestingIdentity=e,this.wire.ferryAction(t)}readRegistryValue(e,t,n){return this.wire.sendAction(\"read-registry-value\",{rootKey:e,subkey:t,value:n}).then((({payload:e})=>e.data))}registerExternalConnection(e){return this.wire.sendAction(\"register-external-connection\",{uuid:e}).then((({payload:e})=>e.data))}async getServiceConfiguration(e){if(\"string\"!=typeof e.name)throw new Error(\"Must provide an object with a `name` property having a string value\");const{name:t}=e;return this.wire.sendAction(\"get-service-configuration\",{name:t}).then((({payload:e})=>e.data))}async getSystemAppConfig(e){if(\"string\"!=typeof e)throw new Error(\"Must provide a string value for name of system app\");return this.wire.sendAction(\"get-system-app-configuration\",{name:e}).then((({payload:e})=>e.data))}async registerShutdownHandler(e){this.wire.sendAction(\"system-register-shutdown-handler\").catch((e=>{}));const{uuid:t,name:n}=this.wire.me;this.on(\"system-shutdown\",(i=>{e({proceed:()=>{this.wire.environment.raiseEvent(\"application/system-shutdown-handled\",{uuid:t,name:n,topic:\"application\"})}})}))}runRvmHealthCheck(){return this.wire.sendAction(\"run-rvm-health-check\").then((({payload:e})=>e.data))}async launchManifest(e,t={}){const{subscribe:n,...i}=t,r=i;if(n){const e=new Se.EventEmitter;n(e);const t=\"app-version-progress\",i=\"runtime-status\",o=\"app-version-complete\",s=\"app-version-error\",a=this.wire.environment.getNextMessageId().toString();r.appVersionId=a;const c=[o,t,i,s],d=e=>{const{appVersionId:t,topic:n,type:i,...r}=e;return{...r,type:c.find((e=>i.includes(e)))}},h=t=>{const n=d(t);e.emit(n.type,n)},l=()=>{this.removeListener(`${t}.${a}`,h),this.removeListener(`${i}.${a}`,h),this.removeListener(`${o}.${a}`,h),this.removeListener(`${s}.${a}`,h),this.removeListener(`${o}.${a}`,l),this.removeListener(`${s}.${a}`,l)};await Promise.all([this.on(`${t}.${a}`,h),this.on(`${i}.${a}`,h),this.once(`${o}.${a}`,h),this.once(`${s}.${a}`,h),this.once(`${o}.${a}`,l),this.once(`${s}.${a}`,l)])}return(await this.wire.sendAction(\"launch-manifest\",{manifestUrl:e,opts:r})).payload.data.manifest}async queryPermissionForCurrentContext(e){const t={uuid:this.wire.me.uuid,name:this.wire.me.name};return(await this.wire.sendAction(\"query-permission-for-current-context\",{apiName:e,identity:t})).payload.data}async enableNativeWindowIntegrationProvider(e){const{payload:t}=await this.wire.sendAction(\"enable-native-window-integration-provider\",{permissions:e});return t.data}async registerUsage({data:e,type:t}){await this.wire.sendAction(\"register-usage\",{data:e,type:t})}async getPrinters(){const{payload:e}=await this.wire.sendAction(\"system-get-printers\");return e.data}async updateProcessLoggingOptions(e){await this.wire.sendAction(\"system-update-process-logging-options\",{options:e})}async getDomainSettings(){const{payload:{data:e}}=await this.wire.sendAction(\"get-domain-settings\",this.identity);return e}async setDomainSettings(e){await this.wire.sendAction(\"set-domain-settings\",{domainSettings:e,...this.identity})}}a.System=Re;var Fe={},je={};Object.defineProperty(je,\"__esModule\",{value:!0}),je.RefCounter=void 0;je.RefCounter=class{constructor(){this.topicRefMap=new Map}incRefCount(e){const t=this.topicRefMap.get(e);let n;if(t){const i=t+1;n=i,this.topicRefMap.set(e,i)}else this.topicRefMap.set(e,1),n=1;return n}decRefCount(e){const t=this.topicRefMap.get(e);let n;if(t){const i=t-1;this.topicRefMap.set(e,i),n=i}else n=-1;return n}actOnFirst(e,t,n){return 1===this.incRefCount(e)?t():n()}actOnLast(e,t,n){return 0===this.decRefCount(e)?t():n()}};var ke={},Le={},Te={};Object.defineProperty(Te,\"__esModule\",{value:!0}),Te.ChannelBase=Te.ProtectedItems=void 0;const $e=e=>async(t,n,i)=>{const r=await e(t,n,i);return void 0===r?n:r};Te.ProtectedItems=class{constructor(e,t){this.providerIdentity=e,this.close=t}};class Be{static defaultAction(e){throw new Error(`No action registered at target for ${e}`)}constructor(){this.subscriptions=new Map}async processAction(e,t,n){try{const i=this.subscriptions.has(e)?this.subscriptions.get(e):(t,n)=>(this.defaultAction??Be.defaultAction)(e,t,n),r=this.preAction?await this.preAction(e,t,n):t,o=await i(r,n);return this.postAction?await this.postAction(e,o,n):o}catch(t){if(this.errorMiddleware)return this.errorMiddleware(e,t,n);throw t}}beforeAction(e){if(this.preAction)throw new Error(\"Already registered beforeAction middleware\");this.preAction=$e(e)}onError(e){if(this.errorMiddleware)throw new Error(\"Already registered error middleware\");this.errorMiddleware=e}afterAction(e){if(this.postAction)throw new Error(\"Already registered afterAction middleware\");this.postAction=$e(e)}remove(e){this.subscriptions.delete(e)}setDefaultAction(e){if(this.defaultAction)throw new Error(\"default action can only be set once\");this.defaultAction=e}register(e,t){if(this.subscriptions.has(e))throw new Error(`Subscription already registered for action: ${e}. Unsubscribe before adding new subscription`);return this.subscriptions.set(e,t),!0}}Te.ChannelBase=Be;var Ge,We,He,Ne=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)},De=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(Le,\"__esModule\",{value:!0}),Le.ChannelClient=void 0;const Ue=Te,Ve=new Map;class ze extends Ue.ChannelBase{static closeChannelByEndpointId(e){const t=Ve.get(e);t&&Ne(t,He,\"f\").call(t)}static handleProviderDisconnect(e){for(const t of Ve.values())t.providerIdentity.channelId===e.channelId&&(t.disconnectListener(e),Ne(t,He,\"f\").call(t))}constructor(e,t,n){super(),Ge.set(this,void 0),We.set(this,void 0),this.processAction=(e,t,n)=>super.processAction(e,t,n),He.set(this,(()=>{Ve.delete(this.endpointId),Ne(this,We,\"f\").close()})),De(this,Ge,new Ue.ProtectedItems(e,t),\"f\"),this.disconnectListener=()=>{},this.endpointId=e.endpointId,De(this,We,n,\"f\"),Ve.set(this.endpointId,this),n.receive(this.processAction)}get providerIdentity(){return Ne(this,Ge,\"f\").providerIdentity}async dispatch(e,t){if(Ne(this,We,\"f\").isEndpointConnected(this.providerIdentity.channelId))return Ne(this,We,\"f\").send(this.providerIdentity.channelId,e,t);throw new Error(\"The client you are trying to dispatch from is disconnected from the target provider.\")}onDisconnection(e){this.disconnectListener=t=>{try{e(t)}catch(e){throw new Error(`Error while calling the onDisconnection callback: ${e.message}`)}finally{this.disconnectListener=()=>{}}}}async disconnect(){await this.sendDisconnectAction(),Ne(this,He,\"f\").call(this)}async sendDisconnectAction(){const e=Ne(this,Ge,\"f\");await e.close()}static async wireClose(e,t,n){const{channelName:i,uuid:r,name:o}=t;await e.sendAction(\"disconnect-from-channel\",{channelName:i,uuid:r,name:o,endpointId:n})}}Le.ChannelClient=ze,Ge=new WeakMap,We=new WeakMap,He=new WeakMap;var Ke={},qe={};Object.defineProperty(qe,\"__esModule\",{value:!0}),qe.exhaustiveCheck=void 0,qe.exhaustiveCheck=function(e,t){throw new Error(`Unsupported value: ${e}${t?`\\n Supported values are: ${t.join(\"\")}`:\"\"}`)};var Ye,Je,Ze,Qe={},Xe=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},et=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Qe,\"__esModule\",{value:!0}),Qe.ClassicInfo=Qe.ClassicStrategy=void 0;Qe.ClassicStrategy=class{constructor(e,t,n,i){this.messageReceiver=t,this.endpointId=n,this.providerIdentity=i,Ye.set(this,void 0),Je.set(this,new Map),Ze.set(this,new Map),this.send=async(e,t,n)=>{const i=et(this,Je,\"f\").get(e);if(!i)throw new Error(`Could not locate routing info for endpoint ${e}`);const r={...i};r.isLocalEndpointId&&delete r.endpointId,delete r.isLocalEndpointId;const o=et(this,Ye,\"f\").sendAction(\"send-channel-message\",{...r,providerIdentity:this.providerIdentity,action:t,payload:n});et(this,Ze,\"f\").get(e)?.add(o);return(await o.catch((e=>{throw new Error(e.message)})).finally((()=>{et(this,Ze,\"f\").get(e)?.delete(o)}))).payload.data.result},this.close=async()=>{this.messageReceiver.removeEndpoint(this.providerIdentity.channelId,this.endpointId),[...et(this,Je,\"f\").keys()].forEach((e=>this.closeEndpoint(e))),Xe(this,Je,new Map,\"f\")},Xe(this,Ye,e,\"f\")}onEndpointDisconnect(e,t){}receive(e){this.messageReceiver.addEndpoint(e,this.providerIdentity.channelId,this.endpointId)}async closeEndpoint(e){const t=et(this,Je,\"f\").get(e);et(this,Je,\"f\").delete(e);const n=et(this,Ze,\"f\").get(e);n?.forEach((n=>{const i=`Channel connection with identity uuid: ${t?.uuid} / name: ${t?.name} / endpointId: ${e} no longer connected.`;n.cancel(new Error(i))}))}isEndpointConnected(e){return et(this,Je,\"f\").has(e)}addEndpoint(e,t){et(this,Je,\"f\").set(e,t.endpointIdentity),et(this,Ze,\"f\").set(e,new Set)}isValidEndpointPayload(e){return\"string\"==typeof e?.endpointIdentity?.endpointId||\"string\"==typeof e?.endpointIdentity?.channelId}},Ye=new WeakMap,Je=new WeakMap,Ze=new WeakMap,Qe.ClassicInfo={version:5,minimumVersion:0,type:\"classic\"};var tt={},nt={},it={};Object.defineProperty(it,\"__esModule\",{value:!0}),it.errorToPOJO=void 0,it.errorToPOJO=function(e){return{stack:e.stack,name:e.name,message:e.message,toString:()=>e.stack||e.toString()}};var rt,ot,st=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)},at=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(nt,\"__esModule\",{value:!0}),nt.RTCEndpoint=void 0;const ct=it;nt.RTCEndpoint=class{static isValidEndpointPayload(e){const t=e=>\"object\"==typeof e&&null!==e;return t(e)&&t(e.endpointIdentity)&&t(e.rtc)&&\"string\"==typeof e.endpointIdentity.endpointId}constructor({rtc:e,endpointIdentity:t}){this.responseMap=new Map,rt.set(this,null),ot.set(this,void 0),this.connectionStateChangeHandler=e=>{\"connected\"!==this.rtc.rtcClient.connectionState&&(this.rtc.rtcClient.removeEventListener(\"connectionstatechange\",this.connectionStateChangeHandler),this.close(),st(this,ot,\"f\")&&st(this,ot,\"f\").call(this))},this.send=async(e,t)=>{const n=`message-${Math.random()}`,i=new Promise(((e,t)=>{this.responseMap.set(n,{resolve:e,reject:t})}));return this.rtc.channels.request.send(JSON.stringify({action:e,payload:t,messageId:n})),i},this.close=()=>{this.responseMap.forEach((e=>e.reject(\"Connection has closed.\"))),this.responseMap=new Map,this.rtc.channels.request.close(),this.rtc.channels.response.close(),this.rtc.rtcClient.close()},this.rtc=e,this.endpointIdentity=t,this.rtc.channels.response.addEventListener(\"message\",(e=>{let{data:t}=e;e.data instanceof ArrayBuffer&&(t=(new TextDecoder).decode(e.data));const{messageId:n,payload:i,success:r,error:o}=JSON.parse(t),{resolve:s,reject:a}=this.responseMap.get(n)??{};s&&a?(this.responseMap.delete(n),r?s(i):a(o)):(console.log(\"Could not find id in responseMap.\"),console.log(e))})),this.rtc.channels.request.addEventListener(\"message\",(async e=>{let{data:n}=e;e.data instanceof ArrayBuffer&&(n=(new TextDecoder).decode(e.data));const{messageId:i,action:r,payload:o}=JSON.parse(n);if(st(this,rt,\"f\"))try{const e=await st(this,rt,\"f\").call(this,r,o,t);this.rtc.channels.response.send(JSON.stringify({messageId:i,payload:e,success:!0}))}catch(e){\"open\"===this.rtc.channels.response.readyState&&this.rtc.channels.response.send(JSON.stringify({messageId:i,error:(0,ct.errorToPOJO)(e),success:!1}))}else\"open\"===this.rtc.channels.response.readyState&&this.rtc.channels.response.send(JSON.stringify({messageId:i,success:!1,error:\"Connection not ready.\"}))})),this.rtc.rtcClient.addEventListener(\"connectionstatechange\",this.connectionStateChangeHandler),Object.values(this.rtc.channels).forEach((e=>{e.onclose=e=>{[...this.responseMap.values()].forEach((e=>e.reject(new Error(\"RTCDataChannel closed unexpectedly, this is most commonly caused by message size. Note: RTC Channels have a message size limit of ~255kB.\")))),this.close(),st(this,ot,\"f\")&&st(this,ot,\"f\").call(this)}}))}onDisconnect(e){if(st(this,ot,\"f\"))throw new Error(\"RTCEndpoint disconnectListener cannot be set twice.\");at(this,ot,e,\"f\")}receive(e){if(st(this,rt,\"f\"))throw new Error(\"You have already set a listener for this RTC Endpoint.\");at(this,rt,e,\"f\")}get connected(){return\"connected\"===this.rtc.rtcClient.connectionState}},rt=new WeakMap,ot=new WeakMap;var dt,ht,lt,ut={},pt=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)},wt=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(ut,\"__esModule\",{value:!0}),ut.EndpointStrategy=void 0;ut.EndpointStrategy=class{constructor(e,t,n){this.EndpointType=e,this.StrategyName=n,dt.set(this,null),ht.set(this,new Map),lt.set(this,!0),this.send=async(e,t,n)=>this.getEndpointById(e).send(t,n),this.close=async()=>{pt(this,lt,\"f\")&&(pt(this,ht,\"f\").forEach((e=>e.close())),wt(this,ht,new Map,\"f\")),wt(this,lt,!1,\"f\")},this.isValidEndpointPayload=t}onEndpointDisconnect(e,t){this.getEndpointById(e).onDisconnect(t)}receive(e){if(pt(this,dt,\"f\"))throw new Error(`You have already set a listener for this ${this.StrategyName} Strategy`);wt(this,dt,e,\"f\"),pt(this,ht,\"f\").forEach((e=>e.receive(pt(this,dt,\"f\"))))}getEndpointById(e){const t=pt(this,ht,\"f\").get(e);if(!t)throw new Error(`Client with endpoint id ${e} is not connected`);return t}get connected(){return pt(this,lt,\"f\")}isEndpointConnected(e){return pt(this,ht,\"f\").has(e)}addEndpoint(e,t){if(!pt(this,lt,\"f\"))return void console.warn(`Adding endpoint to disconnected ${this.StrategyName} Strategy`);const n=new this.EndpointType(t);pt(this,dt,\"f\")&&n.receive(pt(this,dt,\"f\")),pt(this,ht,\"f\").set(e,n)}async closeEndpoint(e){pt(this,ht,\"f\").delete(e)}},dt=new WeakMap,ht=new WeakMap,lt=new WeakMap,Object.defineProperty(tt,\"__esModule\",{value:!0}),tt.RTCInfo=tt.RTCStrategy=void 0;const yt=nt,ft=ut;class gt extends ft.EndpointStrategy{constructor(){super(yt.RTCEndpoint,yt.RTCEndpoint.isValidEndpointPayload,\"RTC\")}}tt.RTCStrategy=gt,tt.RTCInfo={version:2,minimumVersion:0,type:\"rtc\"};var mt={};Object.defineProperty(mt,\"__esModule\",{value:!0}),mt.RTCICEManager=void 0;const vt=c;class Ct extends vt.EmitterBase{constructor(e){super(e,\"channel\"),this.ensureChannelOpened=e=>new Promise(((t,n)=>{if(\"open\"===e.readyState)t();else if(\"connecting\"===e.readyState){const n=()=>{e.removeEventListener(\"open\",n),t()};e.addEventListener(\"open\",n)}else n(new Error(\"This Channel has already closed\"))}))}static createDataChannelPromise(e,t){let n;const i=new Promise((e=>{n=e})),r=i=>{const o=()=>{i.channel.removeEventListener(\"open\",o),n(i.channel)};i.channel.label===e&&(i.channel.addEventListener(\"open\",o),t.removeEventListener(\"datachannel\",r))};return t.addEventListener(\"datachannel\",r),i}async listenForProviderIce(e,t){await this.on(this.createProviderEventName(e),t,{timestamp:Date.now()})}async raiseProviderIce(e,t){await this.wire.environment.raiseEvent(this.createRouteString(this.createProviderEventName(e)),t)}async listenForClientIce(e,t){await this.on(this.createClientEventName(e),t,{timestamp:Date.now()})}async raiseClientIce(e,t){await this.wire.environment.raiseEvent(this.createRouteString(this.createClientEventName(e)),t)}cleanupIceListeners(e){this.removeAllListeners(this.createClientEventName(e)),this.removeAllListeners(this.createProviderEventName(e))}createClientEventName(e){return`ice-client-${e}`}createProviderEventName(e){return`ice-provider-${e}`}createRouteString(e){return`channel/${e}`}createRtcPeer(){return this.wire.environment.getRtcPeer()}async startClientOffer(){const e=Math.random().toString(),t=this.createRtcPeer();t.addEventListener(\"icecandidate\",(async t=>{t.candidate&&await this.raiseClientIce(e,{candidate:t.candidate?.toJSON()})})),await this.listenForProviderIce(e,(async e=>{await t.addIceCandidate(e.candidate)}));const n={request:t.createDataChannel(\"request\"),response:t.createDataChannel(\"response\")},i=await t.createOffer();await t.setLocalDescription(i);const r=Promise.all([n.request,n.response].map(this.ensureChannelOpened)).then((()=>{}));return{rtcClient:t,channels:n,offer:i,rtcConnectionId:e,channelsOpened:r}}async finishClientOffer(e,t,n){return await e.setRemoteDescription(t),await n,!0}async createProviderAnswer(e,t){const n=this.createRtcPeer(),i=Ct.createDataChannelPromise(\"request\",n),r=Ct.createDataChannelPromise(\"response\",n);n.addEventListener(\"icecandidate\",(async t=>{t.candidate&&await this.raiseProviderIce(e,{candidate:t.candidate?.toJSON()})})),await this.listenForClientIce(e,(async e=>{await n.addIceCandidate(e.candidate)})),await n.setRemoteDescription(t);const o=await n.createAnswer();await n.setLocalDescription(o);const s=Promise.all([i,r]).then((([t,n])=>(this.cleanupIceListeners(e),{request:t,response:n})));return{rtcClient:n,answer:o,channels:s}}}mt.RTCICEManager=Ct;var bt={},It={};function Et(e){return[...e.split(\".\").reverse().entries()].reduce(((e,[t,n])=>e+ +n*1e4**t),0)}function xt(e,t){return Et(e)>=Et(t)}function At(e){return e.split(\"/\")[0]}Object.defineProperty(It,\"__esModule\",{value:!0}),It.runtimeUuidMeetsMinimumRuntimeVersion=It.parseRuntimeUuid=It.meetsMinimumRuntimeVersion=void 0,It.meetsMinimumRuntimeVersion=xt,It.parseRuntimeUuid=At,It.runtimeUuidMeetsMinimumRuntimeVersion=function(e,t){return xt(At(e),t)};var Pt,Mt,Ot,_t,St,Rt=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)},Ft=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(bt,\"__esModule\",{value:!0}),bt.ChannelProvider=void 0;const jt=Te,kt=It;class Lt extends jt.ChannelBase{get connections(){return[...Rt(this,Pt,\"f\")]}static handleClientDisconnection(e,t){const n=e.connections.find((e=>e.endpointId===t.endpointId));if(n)Rt(e,_t,\"f\").call(e,n);else{e.connections.filter((e=>e.uuid===t.uuid&&e.name===t.name)).forEach(Rt(e,_t,\"f\"))}e.disconnectListener(t)}static setProviderRemoval(e,t){Lt.removalMap.set(e,t)}constructor(e,t,n){super(),Pt.set(this,void 0),Mt.set(this,void 0),Ot.set(this,void 0),_t.set(this,(e=>{const t=this.connections.filter((t=>t.endpointId!==e.endpointId));Rt(this,Ot,\"f\").closeEndpoint(e.endpointId),Ft(this,Pt,t,\"f\")})),this.processAction=async(e,t,n)=>(Lt.clientIsMultiRuntime(n)&&!(0,kt.runtimeUuidMeetsMinimumRuntimeVersion)(n.runtimeUuid,\"18.87.56.0\")?this.handleMultiRuntimeLegacyClient(n):this.checkForClientConnection(n),super.processAction(e,t,n)),St.set(this,(()=>{Rt(this,Ot,\"f\").close();const e=Lt.removalMap.get(this);e&&e()})),Ft(this,Mt,new jt.ProtectedItems(e,t),\"f\"),this.connectListener=()=>{},this.disconnectListener=()=>{},Ft(this,Pt,[],\"f\"),Ft(this,Ot,n,\"f\"),n.receive(this.processAction)}dispatch(e,t,n){const i=e.endpointId??this.getEndpointIdForOpenFinId(e,t);return i&&Rt(this,Ot,\"f\").isEndpointConnected(i)?Rt(this,Ot,\"f\").send(i,t,n):Promise.reject(new Error(`Client connection with identity uuid: ${e.uuid} / name: ${e.name} / endpointId: ${i} no longer connected.`))}async processConnection(e,t){return Rt(this,Pt,\"f\").push(e),this.connectListener(e,t)}publish(e,t){return this.connections.map((n=>Rt(this,Ot,\"f\").send(n.endpointId,e,t)))}onConnection(e){this.connectListener=e}onDisconnection(e){this.disconnectListener=e}async destroy(){const e=Rt(this,Mt,\"f\");e.providerIdentity,Ft(this,Pt,[],\"f\"),await e.close(),Rt(this,St,\"f\").call(this)}async getAllClientInfo(){return this.connections.map((e=>{const{uuid:t,name:n,endpointId:i,entityType:r,connectionUrl:o}=e;return{uuid:t,name:n,endpointId:i,entityType:r,connectionUrl:o}}))}checkForClientConnection(e){if(!this.isClientConnected(e))throw new Error(`This action was sent from a client that is not connected to the provider.\\n Client Identity: {uuid: ${e.uuid}, name: ${e.name}, endpointId: ${e.endpointId}}`)}isClientConnected(e){return Lt.clientIdentityIncludesEndpointId(e)?this.connections.some((t=>t.endpointId===e.endpointId&&t.uuid===e.uuid&&t.name===e.name)):this.isLegacyClientConnected(e)}isLegacyClientConnected(e){return this.connections.some((t=>t.uuid===e.uuid&&t.name===e.name))}handleMultiRuntimeLegacyClient(e){if(!this.isLegacyClientConnected(e))throw new Error(`This action was sent from a client that is not connected to the provider. Client Identity:\\n {uuid: ${e.uuid}, name: ${e.name}, endpointId: ${e.endpointId}}`)}getEndpointIdForOpenFinId(e,t){const n=this.connections.filter((t=>t.name===e.name&&t.uuid===e.uuid));if(n.length>=2){const n=Rt(this,Mt,\"f\"),{uuid:i,name:r}=e,o=n?.providerIdentity.uuid,s=n?.providerIdentity.name;console.warn(`WARNING: Dispatch call may have unintended results. The \"to\" argument of your dispatch call is missing the\\n \"endpointId\" parameter. The identity you are dispatching to ({uuid: ${i}, name: ${r}})\\n has multiple channelClients for this channel. Your dispatched action: (${t}) from the provider:\\n ({uuid: ${o}, name: ${s}}) will only be processed by the most recently-created client.`)}return n.pop()?.endpointId}static clientIdentityIncludesEndpointId(e){return void 0!==e.endpointId}static clientIsMultiRuntime(e){return void 0!==e.runtimeUuid}static async wireClose(e,t){await e.sendAction(\"destroy-channel\",{channelName:t})}}bt.ChannelProvider=Lt,Pt=new WeakMap,Mt=new WeakMap,Ot=new WeakMap,_t=new WeakMap,St=new WeakMap,Lt.removalMap=new WeakMap;var Tt={};Object.defineProperty(Tt,\"__esModule\",{value:!0}),Tt.MessageReceiver=void 0;const $t=Le,Bt=c;class Gt extends Bt.Base{constructor(e){super(e),this.onmessage=e=>\"process-channel-message\"===e.action&&(this.processChannelMessage(e),!0),this.endpointMap=new Map,this.latestEndpointIdByChannelId=new Map,e.registerMessageHandler(this.onmessage.bind(this))}async processChannelMessage(e){const{senderIdentity:t,providerIdentity:n,action:i,ackToSender:r,payload:o,intendedTargetIdentity:s}=e.payload,a=s.channelId??s.endpointId??this.latestEndpointIdByChannelId.get(n.channelId),c=this.endpointMap.get(a);if(!c)return r.payload.success=!1,r.payload.reason=`Client connection with identity uuid: ${this.wire.me.uuid} / name: ${this.wire.me.name} / endpointId: ${a} no longer connected.`,this.wire.sendRaw(r);try{const e=await c(i,o,t);return r.payload.payload=r.payload.payload||{},r.payload.payload.result=e,this.wire.sendRaw(r)}catch(e){return r.payload.success=!1,r.payload.reason=e.message,this.wire.sendRaw(r)}}addEndpoint(e,t,n){this.endpointMap.set(n,e),t!==n&&this.latestEndpointIdByChannelId.set(t,n)}removeEndpoint(e,t){this.endpointMap.delete(t),this.latestEndpointIdByChannelId.get(e)===t&&this.latestEndpointIdByChannelId.delete(e)}checkForPreviousClientConnection(e){const t=this.latestEndpointIdByChannelId.get(e);t&&($t.ChannelClient.closeChannelByEndpointId(t),console.warn(\"You have created a second connection to an older provider. First connection has been removed from the clientMap\"),console.warn(\"If the provider calls publish(), you may receive multiple messages.\"))}}Tt.MessageReceiver=Gt;var Wt={};Object.defineProperty(Wt,\"__esModule\",{value:!0}),Wt.ProtocolManager=void 0;Wt.ProtocolManager=class{constructor(e){this.ProtocolsInPreferenceOrder=e,this.DefaultClientProtocols=[\"classic\"],this.DefaultProviderProtocols=[\"classic\"],this.getClientProtocols=e=>{const t=e?this.ProtocolsInPreferenceOrder.filter((t=>e.includes(t))):this.DefaultClientProtocols;if(!t.length)throw new Error(`No valid protocols were passed in. Accepted values are: ${this.ProtocolsInPreferenceOrder.join(\", \")}.`);return t},this.getProviderProtocols=e=>{const t=e?this.ProtocolsInPreferenceOrder.filter((t=>e.includes(t))):this.DefaultProviderProtocols;if(!t.length)throw new Error(`No valid protocols were passed in. Accepted values are: ${this.ProtocolsInPreferenceOrder.join(\", \")}.`);return t},this.getCompatibleProtocols=(e,t)=>t.supportedProtocols.filter((t=>e.some((e=>e.type===t.type&&t.version>=e.minimumVersion&&e.version>=(t.minimumVersion??0))))).slice(0,t.maxProtocols)}};var Ht={};Object.defineProperty(Ht,\"__esModule\",{value:!0});class Nt{static combine(e,t){return new Nt(e,t)}constructor(e,t){this.primary=e,this.secondary=t}onEndpointDisconnect(e,t){this.primary.onEndpointDisconnect(e,(()=>{this.secondary.isEndpointConnected(e)||t()})),this.secondary.onEndpointDisconnect(e,(()=>{this.primary.isEndpointConnected(e)||t()}))}isValidEndpointPayload(e){return this.primary.isValidEndpointPayload(e)||this.secondary.isValidEndpointPayload(e)}async closeEndpoint(e){await this.primary.closeEndpoint(e),await this.secondary.closeEndpoint(e)}isEndpointConnected(e){return this.primary.isEndpointConnected(e)||this.secondary.isEndpointConnected(e)}async addEndpoint(e,t){this.primary.isValidEndpointPayload(t)&&await this.primary.addEndpoint(e,t),this.secondary.isValidEndpointPayload(t)&&await this.secondary.addEndpoint(e,t)}receive(e){this.primary.receive(e),this.secondary.receive(e)}send(e,t,n){return this.primary.isEndpointConnected(e)?this.primary.send(e,t,n):this.secondary.send(e,t,n)}async close(){await Promise.all([this.primary.close(),this.secondary.close()])}}Ht.default=Nt;var Dt,Ut,Vt=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},zt=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Ke,\"__esModule\",{value:!0}),Ke.ConnectionManager=void 0;const Kt=qe,qt=c,Yt=Qe,Jt=tt,Zt=mt,Qt=bt,Xt=Tt,en=Wt,tn=Ht;class nn extends qt.Base{static getProtocolOptionsFromStrings(e){return e.map((e=>{switch(e){case\"rtc\":return Jt.RTCInfo;case\"classic\":return Yt.ClassicInfo;default:return(0,Kt.exhaustiveCheck)(e,[\"rtc\",\"classic\"])}}))}constructor(e){super(e),Dt.set(this,void 0),Ut.set(this,void 0),this.removeChannelFromProviderMap=e=>{this.providerMap.delete(e)},this.onmessage=e=>\"process-channel-connection\"===e.action&&(this.processChannelConnection(e),!0),this.providerMap=new Map,this.protocolManager=new en.ProtocolManager(\"node\"===this.wire.environment.type?[\"classic\"]:[\"rtc\",\"classic\"]),Vt(this,Dt,new Xt.MessageReceiver(e),\"f\"),Vt(this,Ut,new Zt.RTCICEManager(e),\"f\"),e.registerMessageHandler(this.onmessage.bind(this))}createProvider(e,t){const n=Object.assign(this.wire.environment.getDefaultChannelOptions().create,e||{}),i=this.protocolManager.getProviderProtocols(n?.protocols),r=i.map((e=>{switch(e){case\"rtc\":return new Jt.RTCStrategy;case\"classic\":return new Yt.ClassicStrategy(this.wire,zt(this,Dt,\"f\"),t.channelId,t);default:return(0,Kt.exhaustiveCheck)(e,[\"rtc\",\"classic\"])}}));let o;if(2===r.length){const[e,t]=r;o=tn.default.combine(e,t)}else{if(1!==r.length)throw new Error(\"failed to combine strategies\");[o]=r}const s=new Qt.ChannelProvider(t,(()=>Qt.ChannelProvider.wireClose(this.wire,t.channelName)),o),a=t.channelId;return this.providerMap.set(a,{provider:s,strategy:o,supportedProtocols:nn.getProtocolOptionsFromStrings(i)}),Qt.ChannelProvider.setProviderRemoval(s,this.removeChannelFromProviderMap.bind(this)),s}async createClientOffer(e){const t=this.protocolManager.getClientProtocols(e?.protocols);let n;return{offer:{supportedProtocols:await Promise.all(t.map((async e=>{switch(e){case\"rtc\":{const{rtcClient:e,channels:t,offer:i,rtcConnectionId:r,channelsOpened:o}=await zt(this,Ut,\"f\").startClientOffer();return n={rtcClient:e,channels:t,channelsOpened:o},{type:\"rtc\",version:Jt.RTCInfo.version,payload:{offer:i,rtcConnectionId:r}}}case\"classic\":return{type:\"classic\",version:Yt.ClassicInfo.version};default:return(0,Kt.exhaustiveCheck)(e,[\"rtc\",\"classic\"])}}))),maxProtocols:2},rtc:n}}async createClientStrategy(e,t){t.endpointId||(t.endpointId=this.wire.environment.getNextMessageId(),zt(this,Dt,\"f\").checkForPreviousClientConnection(t.channelId));const n=t.answer??{supportedProtocols:[{type:\"classic\",version:1}]},i=(await Promise.all(n.supportedProtocols.map((async n=>\"rtc\"===n.type&&e?(await zt(this,Ut,\"f\").finishClientOffer(e.rtcClient,n.payload.answer,e.channelsOpened),new Jt.RTCStrategy):\"classic\"===n.type?new Yt.ClassicStrategy(this.wire,zt(this,Dt,\"f\"),t.endpointId,t):null)))).filter((e=>null!==e));let r;if(e&&!i.some((e=>e instanceof Jt.RTCStrategy))&&e&&e.rtcClient.close(),i.length>=2)r=tn.default.combine(i[0],i[1]);else{if(!i.length)throw new Error(\"No compatible protocols\");[r]=i}const o={endpointIdentity:t,rtc:e};return r.addEndpoint(t.channelId,o),r}async processChannelConnection(e){const{clientIdentity:t,providerIdentity:n,ackToSender:i,payload:r,offer:o}=e.payload;t.endpointId?t.isLocalEndpointId=!1:(t.endpointId=this.wire.environment.getNextMessageId(),t.isLocalEndpointId=!0);const s=n.channelId,a=this.providerMap.get(s);if(!a)return i.payload.success=!1,i.payload.reason=`Channel \"${n.channelName}\" has been destroyed.`,this.wire.sendRaw(i);const{provider:c,strategy:d,supportedProtocols:h}=a;try{if(!(c instanceof Qt.ChannelProvider))throw Error(\"Cannot connect to a channel client\");const e=o??{supportedProtocols:[{type:\"classic\",version:1}],maxProtocols:1},n=this.protocolManager.getCompatibleProtocols(h,e);if(!n.length)throw new Error(\"This provider does not support any of the offered protocols.\");const s=await c.processConnection(t,r);i.payload.payload=i.payload.payload||{};let a={supportedProtocols:[],endpointPayloadPromise:Promise.resolve({endpointIdentity:t})};return a=await n.reduce((async(e,t)=>{const n=await e;if(\"rtc\"===t.type){const{answer:e,rtcClient:i,channels:r}=await zt(this,Ut,\"f\").createProviderAnswer(t.payload.rtcConnectionId,t.payload.offer);n.supportedProtocols.push({type:\"rtc\",version:Jt.RTCInfo.version,payload:{answer:e}}),n.endpointPayloadPromise=n.endpointPayloadPromise.then((e=>r.then((t=>({...e,rtc:{rtcClient:i,channels:t}})))))}else n.supportedProtocols.push({type:\"classic\",version:Yt.ClassicInfo.version});return n}),Promise.resolve(a)),a.endpointPayloadPromise.then((e=>d.addEndpoint(t.endpointId,e))),i.payload.payload.result=s,i.payload.payload.answer=a,this.wire.sendRaw(i)}catch(e){return i.payload.success=!1,i.payload.reason=e.message,this.wire.sendRaw(i)}}}Ke.ConnectionManager=nn,Dt=new WeakMap,Ut=new WeakMap;var rn,on,sn,an=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},cn=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(ke,\"__esModule\",{value:!0}),ke.Channel=void 0;const dn=t,hn=B,ln=c,un=Le,pn=Ke,wn=bt;function yn(e){const t=Math.floor(e/10),n=Math.min(3e4,500*2**t);return new Promise((e=>{setTimeout((()=>{e(!1)}),n)}))}class fn extends ln.EmitterBase{constructor(e){super(e,\"channel\"),rn.set(this,void 0),on.set(this,new dn.EventEmitter),sn.set(this,new hn.AsyncRetryableLazy((async()=>{await Promise.all([this.on(\"disconnected\",(e=>{un.ChannelClient.handleProviderDisconnect(e)})),this.on(\"connected\",((...e)=>{cn(this,on,\"f\").emit(\"connected\",...e)}))]).catch((()=>new Error(\"error setting up channel connection listeners\")))}))),an(this,rn,new pn.ConnectionManager(e),\"f\")}async getAllChannels(){return this.wire.sendAction(\"get-all-channels\").then((({payload:e})=>e.data))}async onChannelConnect(e){await this.on(\"connected\",e)}async onChannelDisconnect(e){await this.on(\"disconnected\",e)}async safeConnect(e,t,n){const i={count:0};do{let r=()=>{};const o=new Promise((t=>{r=n=>{e===n.channelName&&t(!0)},cn(this,on,\"f\").on(\"connected\",r)}));try{if(i.count>0){i.gotConnectedEvent=await Promise.race([yn(i.count),o]);const t=await this.wire.sendAction(\"connect-to-channel\",{...n,retryInfo:i});return console.log(`Successfully connected to channelName: ${e}`),t.payload.data}const t=this.wire.sendAction(\"connect-to-channel\",n);i.originalMessageId=t.messageId;return(await t).payload.data}catch(n){if(!n.message.includes(\"internal-nack\"))throw n;t&&0===i.count&&console.warn(`No channel found for channelName: ${e}. Waiting for connection...`)}finally{i.count+=1,cn(this,on,\"f\").removeListener(\"connected\",r)}}while(t);throw new Error(`No channel found for channelName: ${e}.`)}async connect(e,t={}){if(await cn(this,sn,\"f\").getValue(),!e||\"string\"!=typeof e)throw new Error(\"Please provide a channelName string to connect to a channel.\");const n={wait:!0,...this.wire.environment.getDefaultChannelOptions().connect,...t},{offer:i,rtc:r}=await cn(this,rn,\"f\").createClientOffer(n);let o;(this.fin.me.isFrame||this.fin.me.isView||this.fin.me.isWindow)&&(o=(await this.fin.me.getInfo()).url);const s={channelName:e,...n,offer:i,connectionUrl:o},a=await this.safeConnect(e,n.wait,s),c=await cn(this,rn,\"f\").createClientStrategy(r,a),d=new un.ChannelClient(a,(()=>un.ChannelClient.wireClose(this.wire,a,a.endpointId)),c);return c.onEndpointDisconnect(a.channelId,(async()=>{try{await d.sendDisconnectAction()}catch(e){console.warn(`Something went wrong during disconnect for client with uuid: ${a.uuid} / name: ${a.name} / endpointId: ${a.endpointId}.`)}finally{un.ChannelClient.handleProviderDisconnect(a)}})),d}async create(e,t){if(!e)throw new Error(\"Please provide a channelName to create a channel\");const{payload:{data:n}}=await this.wire.sendAction(\"create-channel\",{channelName:e}),i=cn(this,rn,\"f\").createProvider(t,n);return this.on(\"client-disconnected\",(t=>{t.channelName===e&&wn.ChannelProvider.handleClientDisconnection(i,t)})),i}}ke.Channel=fn,rn=new WeakMap,on=new WeakMap,sn=new WeakMap,Object.defineProperty(Fe,\"__esModule\",{value:!0}),Fe.InterAppPayload=Fe.InterApplicationBus=void 0;const gn=t,mn=c,vn=je,Cn=ke,bn=O;class In extends mn.Base{constructor(e){super(e),this.events={subscriberAdded:\"subscriber-added\",subscriberRemoved:\"subscriber-removed\"},this.refCounter=new vn.RefCounter,this.Channel=new Cn.Channel(e),this.emitter=new gn.EventEmitter,e.registerMessageHandler(this.onmessage.bind(this)),this.on=this.emitter.on.bind(this.emitter),this.removeAllListeners=this.emitter.removeAllListeners.bind(this.emitter)}async publish(e,t){await this.wire.sendAction(\"publish-message\",{topic:e,message:t,sourceWindowName:this.me.name})}async send(e,t,n){const i=(0,bn.validateIdentity)(e);if(i)throw new Error(i);await this.wire.sendAction(\"send-message\",{destinationUuid:e.uuid,destinationWindowName:e.name,topic:t,message:n,sourceWindowName:this.me.name})}subscribe(e,t,n){const i=this.createSubscriptionKey(e.uuid,e.name||\"*\",t);return this.emitter.on(i,n),this.refCounter.actOnFirst(i,(async()=>{await this.wire.sendAction(\"subscribe\",{sourceUuid:e.uuid,sourceWindowName:e.name||\"*\",topic:t,destinationWindowName:this.me.name})}),(()=>Promise.resolve()))}unsubscribe(e,t,n){const i=e.name||\"*\",r=this.createSubscriptionKey(e.uuid,i,t);return this.emitter.removeListener(r,n),this.refCounter.actOnLast(r,(async()=>{await this.wire.sendAction(\"unsubscribe\",{sourceUuid:e.uuid,sourceWindowName:i,topic:t,destinationWindowName:this.me.name})}),(()=>new Promise((e=>e)).then((()=>{}))))}processMessage(e){const{payload:{message:t,sourceWindowName:n,sourceUuid:i,topic:r}}=e,o=[this.createSubscriptionKey(i,n,r),this.createSubscriptionKey(i,\"*\",r),this.createSubscriptionKey(\"*\",\"*\",r)],s={uuid:i,name:n};o.forEach((e=>{this.emitter.emit(e,t,s)}))}emitSubscriverEvent(e,t){const{payload:{targetName:n,uuid:i,topic:r}}=t,o={name:n,uuid:i,topic:r};this.emitter.emit(e,o)}createSubscriptionKey(e,t,n){const i=t||\"*\";if(!(e&&i&&n))throw new Error(\"Missing uuid, name, or topic string\");return function(...e){return e.map((e=>Buffer.from(`${e}`).toString(\"base64\"))).join(\"/\")}(e,i,n)}onmessage(e){const{action:t}=e;switch(t){case\"process-message\":this.processMessage(e);break;case this.events.subscriberAdded:this.emitSubscriverEvent(this.events.subscriberAdded,e);break;case this.events.subscriberRemoved:this.emitSubscriverEvent(this.events.subscriberRemoved,e)}return!0}}Fe.InterApplicationBus=In;Fe.InterAppPayload=class{};var En={};Object.defineProperty(En,\"__esModule\",{value:!0}),En.Clipboard=void 0;const xn=c;class An extends xn.Base{async writeText(e){await this.wire.sendAction(\"clipboard-write-text\",e)}async readText(e){const{payload:t}=await this.wire.sendAction(\"clipboard-read-text\",{type:e});return t.data}async writeImage(e){await this.wire.sendAction(\"clipboard-write-image\",e)}async readImage(e={format:\"dataURL\"}){const{payload:t}=await this.wire.sendAction(\"clipboard-read-image\",e);return t.data}async writeHtml(e){await this.wire.sendAction(\"clipboard-write-html\",e)}async readHtml(e){const{payload:t}=await this.wire.sendAction(\"clipboard-read-html\",{type:e});return t.data}async writeRtf(e){await this.wire.sendAction(\"clipboard-write-rtf\",e)}async readRtf(e){const{payload:t}=await this.wire.sendAction(\"clipboard-read-rtf\",{type:e});return t.data}async write(e){await this.wire.sendAction(\"clipboard-write\",e)}async getAvailableFormats(e){const{payload:t}=await this.wire.sendAction(\"clipboard-read-formats\",{type:e});return t.data}}En.Clipboard=An;var Pn={},Mn={},On={};Object.defineProperty(On,\"__esModule\",{value:!0}),On.ExternalApplication=void 0;const _n=c;class Sn extends _n.EmitterBase{constructor(e,t){super(e,\"external-application\",t.uuid),this.identity=t}getInfo(){return this.wire.sendAction(\"get-external-application-info\",this.identity).then((({payload:e})=>e.data))}}On.ExternalApplication=Sn,Object.defineProperty(Mn,\"__esModule\",{value:!0}),Mn.ExternalApplicationModule=void 0;const Rn=c,Fn=On;class jn extends Rn.Base{wrap(e){return this.wire.sendAction(\"external-application-wrap\").catch((e=>{})),Promise.resolve(new Fn.ExternalApplication(this.wire,{uuid:e}))}wrapSync(e){return this.wire.sendAction(\"external-application-wrap-sync\").catch((e=>{})),new Fn.ExternalApplication(this.wire,{uuid:e})}}Mn.ExternalApplicationModule=jn,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(Mn,e),n(On,e)}(Pn);var kn={},Ln={},Tn={};Object.defineProperty(Tn,\"__esModule\",{value:!0}),Tn._Frame=void 0;const $n=c;class Bn extends $n.EmitterBase{constructor(e,t){super(e,\"frame\",t.uuid,t.name),this.identity=t}getInfo(){return this.wire.sendAction(\"get-frame-info\",this.identity).then((({payload:e})=>e.data))}getParentWindow(){return this.wire.sendAction(\"get-parent-window\",this.identity).then((({payload:e})=>e.data))}}Tn._Frame=Bn,Object.defineProperty(Ln,\"__esModule\",{value:!0}),Ln._FrameModule=void 0;const Gn=c,Wn=O,Hn=Tn;class Nn extends Gn.Base{async wrap(e){this.wire.sendAction(\"frame-wrap\").catch((e=>{}));const t=(0,Wn.validateIdentity)(e);if(t)throw new Error(t);return new Hn._Frame(this.wire,e)}wrapSync(e){this.wire.sendAction(\"frame-wrap-sync\").catch((e=>{}));const t=(0,Wn.validateIdentity)(e);if(t)throw new Error(t);return new Hn._Frame(this.wire,e)}getCurrent(){return this.wire.sendAction(\"frame-get-current\").catch((e=>{})),Promise.resolve(new Hn._Frame(this.wire,this.wire.environment.getCurrentEntityIdentity()))}getCurrentSync(){return this.wire.sendAction(\"frame-get-current-sync\").catch((e=>{})),new Hn._Frame(this.wire,this.wire.environment.getCurrentEntityIdentity())}}Ln._FrameModule=Nn,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(Ln,e),n(Tn,e)}(kn);var Dn={};Object.defineProperty(Dn,\"__esModule\",{value:!0}),Dn.GlobalHotkey=void 0;const Un=c;class Vn extends Un.EmitterBase{constructor(e){super(e,\"global-hotkey\")}async register(e,t){await this.on(e,t),await this.wire.sendAction(\"global-hotkey-register\",{hotkey:e})}async unregister(e){await this.removeAllListeners(e),await this.wire.sendAction(\"global-hotkey-unregister\",{hotkey:e})}async unregisterAll(){await Promise.all(this.eventNames().filter((e=>!(\"registered\"===e||\"unregistered\"===e))).map((e=>this.removeAllListeners(e)))),await this.wire.sendAction(\"global-hotkey-unregister-all\",{})}async isRegistered(e){const{payload:{data:t}}=await this.wire.sendAction(\"global-hotkey-is-registered\",{hotkey:e});return t}}Dn.GlobalHotkey=Vn;var zn,Kn={},qn={},Yn={},Jn=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Yn,\"__esModule\",{value:!0}),Yn.Platform=void 0;const Zn=c,Qn=O,Xn=new Map;class ei extends Zn.EmitterBase{constructor(e,t){super(t.wire,\"application\",e.uuid),this.getClient=e=>{this.wire.sendAction(\"platform-get-client\",this.identity).catch((e=>{}));const t=e||this.identity,{uuid:n}=t;if(!Xn.has(n)){const e=Jn(this,zn,\"f\").call(this,n);Xn.set(n,e)}return Xn.get(n)},zn.set(this,(async e=>{try{const t=`custom-frame-${e}`,n=await this._channel.connect(t,{wait:!1});return n.onDisconnection((()=>{Xn.delete(e)})),n}catch(t){throw Xn.delete(e),new Error(\"The targeted Platform is not currently running. Listen for application-started event for the given Uuid.\")}})),this.launchLegacyManifest=this.launchContentManifest;const n=(0,Qn.validateIdentity)(e);if(n)throw new Error(n);this._channel=t,this.identity={uuid:e.uuid},this.Layout=this.fin.Platform.Layout,this.Application=this.fin.Application.wrapSync(this.identity)}async createView(e,t,n){this.wire.sendAction(\"platform-create-view\",this.identity).catch((e=>{}));const i=await this.getClient(),r=await i.dispatch(\"create-view\",{target:t,opts:e,targetView:n});if(!r||(0,Qn.validateIdentity)(r.identity))throw new Error(`When overwriting the createView call, please return an object that has a valid 'identity' property: ${JSON.stringify(r)}`);return this.fin.View.wrapSync(r.identity)}async createWindow(e){this.wire.sendAction(\"platform-create-window\",this.identity).catch((e=>{}));const t=await this.getClient();e.reason||(e.reason=\"api-call\");const n=await t.dispatch(\"create-view-container\",e);if(!n||(0,Qn.validateIdentity)(n.identity))throw new Error(`When overwriting the createWindow call, please return an object that has a valid 'identity' property: ${JSON.stringify(n)}`);const{identity:i}=n,r=this.fin.Window.wrapSync(i);return r.name=i.name,r.uuid=i.uuid,r}async quit(){this.wire.sendAction(\"platform-quit\",this.identity).catch((e=>{}));return(await this.getClient()).dispatch(\"quit\")}async closeView(e){this.wire.sendAction(\"platform-close-view\",this.identity).catch((e=>{}));const t=await this.getClient();await t.dispatch(\"close-view\",{view:e})}async reparentView(e,t){console.warn(\"Platform.reparentView has been deprecated, please use Platform.createView\"),this.wire.sendAction(\"platform-reparent-view\",this.identity).catch((e=>{}));const n={...e,uuid:e.uuid??this.identity.uuid},i=await this.fin.View.wrap(n),r=await i.getOptions();return this.createView(r,t)}async getSnapshot(){this.wire.sendAction(\"platform-get-snapshot\",this.identity).catch((e=>{}));return(await this.getClient()).dispatch(\"get-snapshot\")}async getViewSnapshot(e){return(await this.getClient()).dispatch(\"get-view-snapshot\",{viewIdentity:e})}async applySnapshot(e,t){this.wire.sendAction(\"platform-apply-snapshot\",this.identity).catch((e=>{}));const n=\"Requested snapshot must be a valid Snapshot object, or a url or filepath to such an object.\";let i;if(\"string\"==typeof e)try{i=(await this._channel.wire.sendAction(\"get-application-manifest\",{manifestUrl:e})).payload.data}catch(e){throw new Error(`${n}: ${e}`)}else i=e;if(!i.windows)throw new Error(n);const r=await this.getClient();return await r.dispatch(\"apply-snapshot\",{snapshot:i,options:t}),this}async fetchManifest(e){return(await this.getClient()).dispatch(\"platform-fetch-manifest\",{manifestUrl:e})}async launchContentManifest(e){this.wire.sendAction(\"platform-launch-content-manifest\",this.identity).catch((()=>{}));const t=await this.getClient(),n=await this.fetchManifest(e);return t.dispatch(\"launch-into-platform\",{manifest:n,manifestUrl:e}),this}async setWindowContext(e={},t){if(this.wire.sendAction(\"platform-set-window-context\",this.identity).catch((e=>{})),!e)throw new Error(\"Please provide a serializable object or string to set the context.\");const n=await this.getClient(),{entityType:i}=t?await this.fin.System.getEntityInfo(t.uuid,t.name):this.fin.me;await n.dispatch(\"set-window-context\",{context:e,entityType:i,target:t||{uuid:this.fin.me.uuid,name:this.fin.me.name}})}async getWindowContext(e){this.wire.sendAction(\"platform-get-window-context\",this.identity).catch((e=>{}));const t=await this.getClient(),{entityType:n}=e?await this.fin.System.getEntityInfo(e.uuid,e.name):this.fin.me;return t.dispatch(\"get-window-context\",{target:e||{uuid:this.fin.me.uuid,name:this.fin.me.name},entityType:n})}async closeWindow(e,t={skipBeforeUnload:!1}){this.wire.sendAction(\"platform-close-window\",this.identity).catch((e=>{}));return(await this.getClient()).dispatch(\"close-window\",{windowId:e,options:t})}}Yn.Platform=ei,zn=new WeakMap;var ti={},ni={},ii={},ri={};function oi(e){switch(e){case\"columns\":case\"grid\":case\"rows\":case\"tabs\":return!0;default:return!1}}Object.defineProperty(ri,\"__esModule\",{value:!0}),ri.overrideFromComposables=ri.isValidPresetType=void 0,ri.isValidPresetType=oi,ri.overrideFromComposables=function(...e){return t=>e.reduceRight(((e,t)=>n=>t(e(n))),(e=>e))(t)},ri.default={isValidPresetType:oi};var si,ai=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(ii,\"__esModule\",{value:!0}),ii.Layout=void 0;const ci=B,di=O,hi=c,li=ri,ui=W,pi=de;class wi extends hi.Base{constructor(e,t){super(t),si.set(this,new ci.Lazy((async()=>ui.LayoutNode.newLayoutEntitiesClient(await this.platform.getClient(),pi.LAYOUT_CONTROLLER_ID,this.identity)))),this.replace=async e=>{this.wire.sendAction(\"layout-replace\").catch((e=>{}));const t=await this.platform.getClient();await t.dispatch(\"replace-layout\",{target:this.identity,opts:{layout:e}})},this.replaceView=async(e,t)=>{this.wire.sendAction(\"layout-replace-view\").catch((e=>{}));const n=await this.platform.getClient();await n.dispatch(\"replace-view\",{target:this.identity,opts:{viewToReplace:e,newView:t}})},this.applyPreset=async e=>{this.wire.sendAction(\"layout-apply-preset\").catch((e=>{}));const t=await this.platform.getClient(),{presetType:n}=e;if(!n||!(0,li.isValidPresetType)(n))throw new Error(\"Cannot apply preset layout, please include an applicable presetType property in the PresetLayoutOptions.\");await t.dispatch(\"apply-preset-layout\",{target:this.identity,opts:{presetType:n}})};const n=(0,di.validateIdentity)(e);if(n)throw new Error(n);this.identity=e,this.platform=this.fin.Platform.wrapSync({uuid:e.uuid}),e.uuid===this.fin.me.uuid&&e.name===this.fin.me.name&&(this.init=this.fin.Platform.Layout.init)}async getConfig(){this.wire.sendAction(\"layout-get-config\").catch((e=>{}));return(await this.platform.getClient()).dispatch(\"get-frame-snapshot\",{target:this.identity})}async getCurrentViews(){this.wire.sendAction(\"layout-get-views\").catch((e=>{}));const e=await this.platform.getClient();return(await e.dispatch(\"get-layout-views\",{target:this.identity})).map((e=>this.fin.View.wrapSync(e)))}async getRootItem(){this.wire.sendAction(\"layout-get-root-item\").catch((()=>{}));const e=await ai(this,si,\"f\").getValue(),t=await e.getRoot(\"layoutName\"in this.identity?this.identity:void 0);return ui.LayoutNode.getEntity(t,e)}}ii.Layout=wi,si=new WeakMap;var yi,fi,gi,mi,vi,Ci=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)},bi=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(ni,\"__esModule\",{value:!0}),ni.LayoutModule=void 0;const Ii=c,Ei=ii,xi=de;class Ai extends Ii.Base{constructor(){super(...arguments),yi.add(this),fi.set(this,!1),gi.set(this,null),this.init=async(e={})=>{if(this.wire.sendAction(\"layout-init\").catch((e=>{})),!this.wire.environment.layoutAllowedInContext(this.fin))throw new Error(\"Layout.init can only be called from a Window context.\");if(Ci(this,fi,\"f\"))throw new Error(\"Layout.init was already called, please use Layout.create to add additional layouts.\");bi(this,fi,!0,\"f\"),bi(this,gi,await this.wire.environment.initLayoutManager(this.fin,this.wire,e),\"f\"),await this.wire.environment.applyLayoutSnapshot(this.fin,Ci(this,gi,\"f\"),e);const t={name:this.fin.me.name,uuid:this.fin.me.uuid};if(!e.layoutManagerOverride){const e={layoutName:xi.DEFAULT_LAYOUT_KEY,...t};return Ci(this,mi,\"f\").call(this,e)}return this.wrapSync(t)},mi.set(this,(e=>{const t=\"[Layout] You are using a deprecated property `layoutManager` - it will throw if you access it starting in v37.\",n=new Proxy({},{get(e,n){throw console.warn(`[Layout-mgr-proxy] accessing ${n.toString()}`),new Error(t)}}),i=Object.assign(this.wrapSync(e),{layoutManager:n});return new Proxy(i,{get(e,n){if(\"layoutManager\"===n)throw console.warn(`[Layout-proxy] accessing ${n.toString()}`),new Error(t);return e[n]}})})),this.getCurrentLayoutManagerSync=()=>Ci(this,yi,\"m\",vi).call(this,\"fin.Platform.Layout.getCurrentLayoutManagerSync()\"),this.create=async e=>this.wire.environment.createLayout(Ci(this,yi,\"m\",vi).call(this,\"fin.Platform.Layout.create()\"),e),this.destroy=async e=>this.wire.environment.destroyLayout(Ci(this,yi,\"m\",vi).call(this,\"fin.Platform.Layout.destroy()\"),e)}async wrap(e){return this.wire.sendAction(\"layout-wrap\").catch((e=>{})),new Ei.Layout(e,this.wire)}wrapSync(e){return this.wire.sendAction(\"layout-wrap-sync\").catch((e=>{})),new Ei.Layout(e,this.wire)}async getCurrent(){if(this.wire.sendAction(\"layout-get-current\").catch((e=>{})),!this.fin.me.isWindow)throw new Error(\"You are not in a Window context. Only Windows can have a Layout.\");const{uuid:e,name:t}=this.fin.me;return this.wrap({uuid:e,name:t})}getCurrentSync(){if(this.wire.sendAction(\"layout-get-current-sync\").catch((e=>{})),!this.fin.me.isWindow)throw new Error(\"You are not in a Window context. Only Windows can have a Layout.\");const{uuid:e,name:t}=this.fin.me;return this.wrapSync({uuid:e,name:t})}}ni.LayoutModule=Ai,fi=new WeakMap,gi=new WeakMap,mi=new WeakMap,yi=new WeakSet,vi=function(e){if(!Ci(this,gi,\"f\"))throw new Error(`You must call init before using the API ${e}`);return Ci(this,gi,\"f\")},function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(ni,e),n(ii,e)}(ti),Object.defineProperty(qn,\"__esModule\",{value:!0}),qn.PlatformModule=void 0;const Pi=c,Mi=Yn,Oi=ti;class _i extends Pi.Base{constructor(e,t){super(e),this._channel=t,this.Layout=new Oi.LayoutModule(this.wire)}async init(e){if(!fin.__internal_.isPlatform||fin.me.name!==fin.me.uuid)throw new Error(\"fin.Platform.init should only be called from a custom platform provider running in the main window of the application.\");return this.wire.environment.initPlatform(this.fin,e)}async wrap(e){return this.wire.sendAction(\"platform-wrap\").catch((e=>{})),new Mi.Platform({uuid:e.uuid},this._channel)}wrapSync(e){return this.wire.sendAction(\"platform-wrap-sync\").catch((e=>{})),new Mi.Platform({uuid:e.uuid},this._channel)}async getCurrent(){return this.wire.sendAction(\"platform-get-current\").catch((e=>{})),this.wrap({uuid:this.wire.me.uuid})}getCurrentSync(){return this.wire.sendAction(\"platform-get-current-sync\").catch((e=>{})),this.wrapSync({uuid:this.wire.me.uuid})}start(e){return this.wire.sendAction(\"platform-start\").catch((e=>{})),new Promise((async(t,n)=>{try{const{uuid:n}=e,i=await this.fin.Application._create({...e,isPlatformController:!0});i.once(\"platform-api-ready\",(()=>t(this.wrapSync({uuid:n})))),i._run({uuid:n})}catch(e){n(e)}}))}startFromManifest(e,t){return this.wire.sendAction(\"platform-start-from-manifest\").catch((e=>{})),new Promise((async(n,i)=>{try{const i=await this.fin.Application._createFromManifest(e);i.once(\"platform-api-ready\",(()=>n(this.wrapSync({uuid:i.identity.uuid})))),i._run(t)}catch(e){i(e)}}))}}qn.PlatformModule=_i,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(qn,e),n(Yn,e)}(Kn);var Si={};!function(e){Object.defineProperty(e,\"__esModule\",{value:!0}),e.getMe=e.getBaseMe=e.environmentUnsupportedMessage=void 0;const t=me(),n=kn,i=Pe(),r=Pn;function o(e,t,n){return{...{isView:\"view\"===e,isWindow:\"window\"===e,isFrame:\"iframe\"===e,isExternal:\"external connection\"===e},uuid:t,name:n,entityType:e}}e.environmentUnsupportedMessage=\"You are not running in OpenFin.\",e.getBaseMe=o,e.getMe=function(s){const{uuid:a,name:c,entityType:d}=s.me,h={setContext(){throw new Error(e.environmentUnsupportedMessage)},addContextHandler(){throw new Error(e.environmentUnsupportedMessage)},getContextGroups(){throw new Error(e.environmentUnsupportedMessage)},joinContextGroup(){throw new Error(e.environmentUnsupportedMessage)},removeFromContextGroup(){throw new Error(e.environmentUnsupportedMessage)},getAllClientsInContextGroup(){throw new Error(e.environmentUnsupportedMessage)},getInfoForContextGroup(){throw new Error(e.environmentUnsupportedMessage)}},l=\"Interop API has not been instantiated. Either connection has failed or you have not declared interop in your config.\",u={setContext(){throw new Error(l)},addContextHandler(){throw new Error(l)},getContextGroups(){throw new Error(l)},joinContextGroup(){throw new Error(l)},removeFromContextGroup(){throw new Error(l)},getAllClientsInContextGroup(){throw new Error(l)},getInfoForContextGroup(){throw new Error(l)}},p={eventNames:()=>{throw new Error(e.environmentUnsupportedMessage)},emit:()=>{throw new Error(e.environmentUnsupportedMessage)},listeners:()=>{throw new Error(e.environmentUnsupportedMessage)},listenerCount:()=>{throw new Error(e.environmentUnsupportedMessage)},on:()=>{throw new Error(e.environmentUnsupportedMessage)},addListener:()=>{throw new Error(e.environmentUnsupportedMessage)},once:()=>{throw new Error(e.environmentUnsupportedMessage)},prependListener:()=>{throw new Error(e.environmentUnsupportedMessage)},prependOnceListener:()=>{throw new Error(e.environmentUnsupportedMessage)},removeListener:()=>{throw new Error(e.environmentUnsupportedMessage)},removeAllListeners:()=>{throw new Error(e.environmentUnsupportedMessage)}};switch(d){case\"view\":return Object.assign(new t.View(s,{uuid:a,name:c}),o(d,a,c),{interop:u,isOpenFin:!0});case\"window\":return Object.assign(new i._Window(s,{uuid:a,name:c}),o(d,a,c),{interop:u,isOpenFin:!0});case\"iframe\":return Object.assign(new n._Frame(s,{uuid:a,name:c}),o(d,a,c),{interop:u,isOpenFin:!0});case\"external connection\":return Object.assign(new r.ExternalApplication(s,{uuid:a}),o(d,a,c),{interop:u,isOpenFin:!1});default:return{...o(d,a,c),...p,interop:h,isOpenFin:!1}}}}(Si);var Ri={},Fi={},ji={};Object.defineProperty(ji,\"__esModule\",{value:!0}),ji.createWarningObject=ji.createUnusableObject=void 0,ji.createUnusableObject=function(e){const t=()=>{throw new Error(e)};return new Proxy({},{apply:t,construct:t,defineProperty:t,deleteProperty:t,get:t,getOwnPropertyDescriptor:t,getPrototypeOf:t,has:t,isExtensible:t,ownKeys:t,preventExtensions:t,set:t,setPrototypeOf:t})},ji.createWarningObject=function(e,t){return new Proxy(t,{get:(...t)=>(console.warn(e),Reflect.get(...t)),set:(...t)=>(console.warn(e),Reflect.set(...t)),getOwnPropertyDescriptor:(...t)=>(console.warn(e),Reflect.getOwnPropertyDescriptor(...t)),ownKeys:(...t)=>(console.warn(e),Reflect.ownKeys(...t))})};var ki,Li={},Ti={};var $i={};!function(e){Object.defineProperty(e,\"__esModule\",{value:!0}),e.wrapIntentHandler=e.BROKER_ERRORS=e.generateOverrideWarning=e.generateOverrideError=e.wrapContextHandler=e.wrapInTryCatch=e.generateId=void 0;e.generateId=()=>`${Math.random()}${Date.now()}`;e.wrapInTryCatch=(e,t)=>(...n)=>{try{return e(...n)}catch(e){throw new Error((t||\"\")+e)}};e.wrapContextHandler=(e,t)=>async n=>{try{await e(n)}catch(e){throw console.error(`Error thrown by handler ${t} for context type ${n.type}: ${e}`),e}};e.generateOverrideError=(e,t)=>`You have tried to to use ${e} but ${t} has not been overridden in the Interop Broker. Please override this function. Refer to our documentation for more info.`;e.generateOverrideWarning=(e,t,n,i)=>{const{uuid:r,name:o}=n;return i?`Entity with identity: ${r}/${o} has called ${i} or ${e} but ${t} has not been overridden.`:`Entity with identity: ${r}/${o} has called ${e} but ${t} has not been overridden.`},e.BROKER_ERRORS={fireIntent:(0,e.generateOverrideError)(\"fireIntent\",\"handleFiredIntent\"),fireIntentForContext:(0,e.generateOverrideError)(\"fireIntentForContext\",\"handleFiredIntentForContext\"),getInfoForIntent:(0,e.generateOverrideError)(\"getInfoForIntent\",\"handleInfoForIntent\"),getInfoForIntentsByContext:(0,e.generateOverrideError)(\"getInfoForIntentsByContext\",\"handleInfoForIntentsByContext\"),joinSessionContextGroupWithJoinContextGroup:\"The Context Group you have tried to join is a Session Context Group. Custom Context Groups can only be defined by the Interop Broker through code or manifest configuration. Please use joinSessionContextGroup.\",fdc3Open:(0,e.generateOverrideError)(\"fdc3.open\",\"fdc3HandleOpen\"),fdc3FindInstances:(0,e.generateOverrideError)(\"fdc3.findInstances\",\"fdc3HandleFindInstances\"),fdc3GetAppMetadata:(0,e.generateOverrideError)(\"fdc3.getAppMetadata\",\"fdc3HandleGetAppMetadata\"),fdc3GetInfo:(0,e.generateOverrideError)(\"fdc3.getInfo\",\"fdc3HandleGetInfo\")};e.wrapIntentHandler=(e,t)=>async n=>{try{return e(n)}catch(e){throw console.error(`Error thrown by handler ${t}: ${e}`),e}}}($i);var Bi,Gi,Wi={};function Hi(){if(Gi)return Li;Gi=1;var e,t,i,r=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},s=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Li,\"__esModule\",{value:!0}),Li.InteropBroker=void 0;const a=c,d=function(){if(ki)return Ti;ki=1,Object.defineProperty(Ti,\"__esModule\",{value:!0});const e=pr();return Ti.default=class{constructor(e,t){this.provider=e,this.id=t,this.lastContext=void 0,this.contextGroupMap=new Map,this.clients=new Map,this.registerListeners()}registerListeners(){this.provider.register(`sessionContextGroup:getContext-${this.id}`,this.getCurrentContext.bind(this)),this.provider.register(`sessionContextGroup:setContext-${this.id}`,this.setContext.bind(this)),this.provider.register(`sessionContextGroup:handlerAdded-${this.id}`,this.handlerAdded.bind(this)),this.provider.register(`sessionContextGroup:handlerRemoved-${this.id}`,this.handlerRemoved.bind(this))}getCurrentContext(e){return e.type?this.contextGroupMap.get(e.type):this.lastContext}setContext(t,n){const{context:i}=t,r=e.InteropBroker.checkContextIntegrity(i);if(!1===r.isValid)throw new Error(`Failed to set Context - bad Context. Reason: ${r.reason}. Context: ${JSON.stringify(i)}`);if(!this.getClientState(n))throw new Error(`Client with Identity: ${n.uuid} ${n.name} not in Session Client State Map`);this.contextGroupMap.set(i.type,i),this.lastContext=i,Array.from(this.clients.values()).forEach((e=>{e.contextHandlers.get(i.type)?.forEach((t=>{this.provider.dispatch(e.clientIdentity,t,i)})),e.globalHandler&&this.provider.dispatch(e.clientIdentity,e.globalHandler,i)}))}getClientState(e){return this.clients.get(e.endpointId)}async handlerAdded(e,t){const{handlerId:n,contextType:i}=e,r=this.getClientState(t);if(!r)throw new Error(`Client with Identity: ${t.uuid} ${t.name} not in Client State Map`);if(i){const e=r.contextHandlers.get(i)||[];r.contextHandlers.set(i,[...e,n]);const o=this.contextGroupMap.get(i);o&&await this.provider.dispatch(t,n,o)}else{r.globalHandler=n;const e=[...this.contextGroupMap.keys()].map((async e=>{const i=this.contextGroupMap.get(e);i&&await this.provider.dispatch(t,n,i)}));await Promise.all(e)}}handlerRemoved(e,t){const{handlerId:n}=e,i=this.clients.get(t.endpointId);i?(Array.from(i.contextHandlers).forEach((([,e])=>{const t=e.indexOf(n);t>-1&&e.splice(t,1)})),i.globalHandler===n&&(i.globalHandler=void 0)):console.warn(`Trying to remove a handler from a client that isn't mapped. handlerId: ${n}. clientIdentity: ${t}`)}registerNewClient(e){if(!this.clients.has(e.endpointId)){const t={contextHandlers:new Map,clientIdentity:e,globalHandler:void 0};this.clients.set(e.endpointId,t)}}onDisconnection(e){this.clients.delete(e.endpointId)}},Ti}(),h=$i,l=n,u=function(){if(Bi)return Wi;Bi=1,Object.defineProperty(Wi,\"__esModule\",{value:!0}),Wi.PrivateChannelProvider=void 0;const e=Hi();return Wi.PrivateChannelProvider=class t{constructor(e,t){this.provider=e,this.id=t,this.clients=new Map,this.registerListeners(),this.contextByContextType=new Map,this.lastContext=void 0,this.provider.onConnection((e=>this.registerNewClient(e))),this.provider.onDisconnection((async e=>{const{endpointId:t}=e;this.clients.has(t)&&await this.handleClientDisconnecting(e),0===(await this.provider.getAllClientInfo()).length&&this.provider.destroy()}))}getClientState(e){return this.clients.get(e.endpointId)}registerListeners(){this.provider.register(\"broadcast\",this.broadcast.bind(this)),this.provider.register(\"getCurrentContext\",this.getCurrentContext.bind(this)),this.provider.register(\"contextHandlerAdded\",this.contextHandlerAdded.bind(this)),this.provider.register(\"contextHandlerRemoved\",this.contextHandlerRemoved.bind(this)),this.provider.register(\"nonStandardHandlerRemoved\",this.nonStandardHandlerRemoved.bind(this)),this.provider.register(\"onAddContextHandlerAdded\",this.onAddContextHandlerAdded.bind(this)),this.provider.register(\"onDisconnectHandlerAdded\",this.onDisconnectHandlerAdded.bind(this)),this.provider.register(\"onUnsubscribeHandlerAdded\",this.onUnsubscribeHandlerAdded.bind(this)),this.provider.register(\"clientDisconnecting\",((e,t)=>{this.handleClientDisconnecting(t)}))}broadcast(t,n){const{context:i}=t;if(!this.getClientState(n))throw new Error(`Client with Identity: ${n.uuid} ${n.name}, tried to call broadcast, is not connected to this Private Channel`);const r=e.InteropBroker.checkContextIntegrity(i);if(!1===r.isValid)throw new Error(`Failed to broadcast - bad Context. Reason: ${r.reason}. Context: ${JSON.stringify(i)}`);this.contextByContextType.set(i.type,i),this.lastContext=i,Array.from(this.clients.values()).forEach((e=>{const t=e.handlerIdsByContextTypes.get(i.type);t&&t.forEach((t=>{this.provider.dispatch(e.clientIdentity,t,i)})),e.globalHandler&&this.provider.dispatch(e.clientIdentity,e.globalHandler,i)}))}getCurrentContext(e,t){const{contextType:n}=e;if(!this.getClientState(t))throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call getCurrentContext, is not connected to this Private Channel`);if(void 0!==n){return this.contextByContextType.get(n)||null}return this.lastContext?this.lastContext:null}contextHandlerAdded(e,t){const{handlerId:n,contextType:i}=e,r=this.getClientState(t);if(!r)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call addContextListener, is not connected to this Private Channel`);if(i){const e=r.handlerIdsByContextTypes.get(i)||[];r.handlerIdsByContextTypes.set(i,[...e,n])}else r.globalHandler=n;Array.from(this.clients.values()).forEach((e=>{e.clientIdentity.endpointId!==t.endpointId&&e.onAddContextListenerHandlerId&&this.provider.dispatch(e.clientIdentity,e.onAddContextListenerHandlerId,i)}))}async contextHandlerRemoved(e,t){const{handlerId:n}=e,i=this.getClientState(t);if(i){let e;if(i.globalHandler===n)i.globalHandler=void 0;else for(const[t,r]of i.handlerIdsByContextTypes){const i=r.indexOf(n);i>-1&&(r.splice(i,1),e=t)}const r=(await this.getConnectedClients()).map((async n=>{const{clientIdentity:i,clientIdentity:{endpointId:r},onUnsubscribeHandlerId:o}=n;r!==t.endpointId&&o&&await this.provider.dispatch(i,o,e)}));try{await Promise.all(r)}catch(e){throw console.error(`Problem when attempting to dispatch to onUnsubscribeHandlers. Error: ${e} Removing Client: ${n}. uuid: ${t.uuid}. name: ${t.name}. endpointId: ${t.endpointId}`),new Error(e)}}else console.warn(`Trying to remove a handler from a client that isn't mapped. handlerId: ${n}. uuid: ${t.uuid}. name: ${t.name}. endpointId: ${t.endpointId}.`)}nonStandardHandlerRemoved(e,t){const{handlerId:n}=e,i=this.getClientState(t);i?i.onDisconnectHandlerId===n?i.onDisconnectHandlerId=void 0:i.onAddContextListenerHandlerId===n?i.onAddContextListenerHandlerId=void 0:i.onUnsubscribeHandlerId===n&&(i.onUnsubscribeHandlerId=void 0):console.warn(`Trying to remove a handler from a client that isn't mapped. handlerId: ${n}. clientIdentity: ${t}`)}onAddContextHandlerAdded(e,t){const n=this.getClientState(t),{handlerId:i}=e;if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call onAddContextListener, is not connected to this Private Channel`);n.onAddContextListenerHandlerId=i,Array.from(this.clients.values()).forEach((e=>{e.clientIdentity.endpointId!==t.endpointId&&Array.from(e.handlerIdsByContextTypes.keys()).forEach((e=>{this.provider.dispatch(t,i,e)}))}))}onDisconnectHandlerAdded(e,t){const n=this.getClientState(t),{handlerId:i}=e;if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call onDisconnect, is not connected to this Private Channel`);n.onDisconnectHandlerId=i}onUnsubscribeHandlerAdded(e,t){const n=this.getClientState(t),{handlerId:i}=e;if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name}, tried to call onUnsubscribe, is not connected to this Private Channel`);n.onUnsubscribeHandlerId=i}removeClient(e){const t=this.getClientState(e);if(!t)throw new Error(`Client with Identity: ${e.uuid} ${e.name}, tried to call disconnect, is not connected to this Private Channel`);t.handlerIdsByContextTypes.clear(),this.clients.delete(e.endpointId)}async fireOnDisconnectForOtherClients(e){const{endpointId:t}=e,n=(await this.getConnectedClients()).map((async e=>{const{clientIdentity:{endpointId:n},onDisconnectHandlerId:i}=e;n!==t&&i&&await this.provider.dispatch(e.clientIdentity,i)}));try{await Promise.all(n)}catch(t){throw console.error(`Problem when attempting to dispatch to onDisconnectHandlers. Error: ${t} Disconnecting Client: uuid: ${e.uuid}. name: ${e.name}. endpointId: ${e.endpointId}`),new Error(t)}}async unsubscribeAll(e){const{endpointId:t}=e,n=this.clients.get(t);if(n){const t=Array.from(n.handlerIdsByContextTypes.values()).flat(),i=n.globalHandler;if(t.length>0){const n=t.map((async t=>this.contextHandlerRemoved({handlerId:t},e)));try{await Promise.all(n)}catch(e){console.error(e.message)}}if(i)try{await this.contextHandlerRemoved({handlerId:i},e)}catch(e){console.error(e.message)}}}async handleClientDisconnecting(e){await this.unsubscribeAll(e),this.removeClient(e),await this.fireOnDisconnectForOtherClients(e)}registerNewClient(e){if(!this.clients.has(e.endpointId)){const t={clientIdentity:e,handlerIdsByContextTypes:new Map,globalHandler:void 0,onAddContextListenerHandlerId:void 0,onUnsubscribeHandlerId:void 0,onDisconnectHandlerId:void 0};this.clients.set(e.endpointId,t)}}async getConnectedClients(){const e=await this.provider.getAllClientInfo();return Array.from(this.clients.values()).filter((t=>{const{uuid:n,name:i}=t.clientIdentity;return e.some((e=>i===e.name&&n===e.uuid))}))}static init(e,n){return new t(e,n)}},Wi}(),p=B,w=[{id:\"green\",displayMetadata:{color:\"#00CC88\",name:\"green\"}},{id:\"purple\",displayMetadata:{color:\"#8C61FF\",name:\"purple\"}},{id:\"orange\",displayMetadata:{color:\"#FF8C4C\",name:\"orange\"}},{id:\"red\",displayMetadata:{color:\"#FF5E60\",name:\"red\"}},{id:\"pink\",displayMetadata:{color:\"#FF8FB8\",name:\"pink\"}},{id:\"yellow\",displayMetadata:{color:\"#E9FF8F\",name:\"yellow\"}}];let y=class n extends a.Base{constructor(n,o,a){super(n),e.set(this,void 0),t.set(this,void 0),i.set(this,void 0),this.getProvider=()=>s(this,i,\"f\").getValue(),this.interopClients=new Map,this.contextGroupsById=new Map,r(this,t,a.contextGroups??[...w],\"f\"),r(this,e,a.fdc3Info,\"f\"),a?.logging&&(this.logging=a.logging),this.intentClientMap=new Map,this.lastContextMap=new Map,this.sessionContextGroupMap=new Map,r(this,i,new p.Lazy(o),\"f\"),this.setContextGroupMap(),this.setupChannelProvider()}static createClosedConstructor(...e){return class extends n{constructor(...t){if(t.length){const[n,i,r]=t;if(r&&\"object\"==typeof r&&!(0,l.isEqual)(r,e[2]))return console.warn(\"You have modified the parameters of the InteropOverride constructor. This behavior is deprecated and will be removed in a future version. You can modify these options in your manifest. Please consult our Interop docs for guidance on migrating to the new override scheme.\"),void super(e[0],e[1],r);console.warn(\"You are attempting to pass arguments to the InteropOverride constructor. This is not necessary, and these passed arguments will be ignored. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.\")}super(...e)}}}setContext({context:e},t){this.wire.sendAction(\"interop-broker-set-context\").catch((e=>{}));const n=this.getClientState(t);if(!n||!n.contextGroupId)throw n?new Error(\"You must join a context group before you can set context.\"):new Error(`Client with Identity: ${t.uuid} ${t.name} not in Client State Map`);{const{contextGroupId:t}=n;this.setContextForGroup({context:e},t)}}setContextForGroup({context:e},t){this.wire.sendAction(\"interop-broker-set-context-for-group\").catch((e=>{}));const i=this.contextGroupsById.get(t);if(!i)throw new Error(`Unable to set context for context group that isn't in the context group mapping: ${t}.`);const r=n.checkContextIntegrity(e);if(!1===r.isValid)throw new Error(`Failed to set Context - bad Context. Reason: ${r.reason}. Context: ${JSON.stringify(e)}`);const o=e.type;i.set(o,e),this.lastContextMap.set(t,o);Array.from(this.interopClients.values()).filter((e=>e.contextGroupId===t)).forEach((t=>{for(const[,i]of t.contextHandlers)n.isContextTypeCompatible(o,i.contextType)&&this.invokeContextHandler(t.clientIdentity,i.handlerId,e)}))}getCurrentContext(e,t){this.wire.sendAction(\"interop-broker-get-current-context\").catch((e=>{}));const n=this.getClientState(t);if(!n?.contextGroupId)throw new Error(\"You must be a member of a context group to call getCurrentContext\");const{contextGroupId:i}=n,r=this.contextGroupsById.get(i),o=this.lastContextMap.get(i),s=e?.contextType??o;return r&&s?r.get(s):void 0}async joinContextGroup({contextGroupId:e,target:t},i){if(this.wire.sendAction(\"interop-broker-join-context-group\").catch((e=>{})),this.sessionContextGroupMap.has(e))throw new Error(h.BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup);if(t){n.hasEndpointId(t)&&await this.addClientToContextGroup({contextGroupId:e},t);try{const n=this.channel.connections.filter((e=>e.uuid===t.uuid&&e.name===t.name));if(!n.length)throw new Error(`Given Identity ${t.uuid} ${t.name} is not connected to the Interop Broker.`);n.length>1&&console.warn(`More than one connection found for identity ${t.uuid} ${t.name}`);const i=[];for(const t of n)i.push(this.addClientToContextGroup({contextGroupId:e},t));await Promise.all(i)}catch(e){throw new Error(e)}}else await this.addClientToContextGroup({contextGroupId:e},i)}async addClientToContextGroup({contextGroupId:e},t){this.wire.sendAction(\"interop-broker-add-client-to-context-group\").catch((e=>{}));const n=this.getClientState(t);if(!n)throw new Error(`Client with Identity: ${t.uuid} ${t.name} not in Client State Map`);if(!this.getContextGroups().find((t=>t.id===e)))throw new Error(`Attempting to join a context group that does not exist: ${e}. You may only join existing context groups.`);if(n.contextGroupId!==e){n.contextGroupId=e,await this.setCurrentContextGroupInClientOptions(t,e);const i=this.contextGroupsById.get(e);for(const[,e]of n.contextHandlers){const{contextType:n,handlerId:r}=e;if(void 0===n)i.forEach(((e,n)=>{this.invokeContextHandler(t,r,e)}));else if(i.has(n)){const e=i.get(n);e&&this.invokeContextHandler(t,r,e)}}}}async removeFromContextGroup({target:e},t){if(this.wire.sendAction(\"interop-broker-remove-from-context-group\").catch((e=>{})),e){n.hasEndpointId(e)&&await this.removeClientFromContextGroup(e);try{const t=this.channel.connections.filter((t=>t.uuid===e.uuid&&t.name===e.name));if(!t.length)throw new Error(`No connection found for given Identity ${e.uuid} ${e.name}`);t.length>1&&console.warn(`More than one connection found for identity ${e.uuid} ${e.name}`);const n=[];for(const e of t)n.push(this.removeClientFromContextGroup(e));await Promise.all(n)}catch(e){throw new Error(e)}}else await this.removeClientFromContextGroup(t)}async removeClientFromContextGroup(e){this.wire.sendAction(\"interop-broker-remove-client-from-context-group\").catch((e=>{}));const t=this.getClientState(e);t&&(t.contextGroupId=void 0),await this.setCurrentContextGroupInClientOptions(e,null)}getContextGroups(){return this.wire.sendAction(\"interop-broker-get-context-groups\").catch((e=>{})),s(this,t,\"f\").map((e=>({...e})))}getInfoForContextGroup({contextGroupId:e}){return this.wire.sendAction(\"interop-broker-get-info-for-context-group\").catch((e=>{})),this.getContextGroups().find((t=>t.id===e))}getAllClientsInContextGroup({contextGroupId:e}){this.wire.sendAction(\"interop-broker-get-all-clients-in-context-group\").catch((e=>{}));return Array.from(this.interopClients.values()).filter((t=>t.contextGroupId===e)).map((e=>e.clientIdentity))}async handleFiredIntent(e,t){const n=(0,h.generateOverrideWarning)(\"fdc3.raiseIntent\",\"InteropBroker.handleFiredIntent\",t,\"interopClient.fireIntent\");throw console.warn(n),new Error(h.BROKER_ERRORS.fireIntent)}async setIntentTarget(e,t){this.wire.sendAction(\"interop-broker-set-intent-target\").catch((e=>{}));const n=this.intentClientMap.get(t.name),i=`intent-handler-${e.name}`;if(n){const t=n.get(i);if(t){if(t.pendingIntents.push(e),t.clientIdentity&&t.isReady){const{clientIdentity:e,pendingIntents:n}=t;try{const r=n[n.length-1];await this.invokeIntentHandler(e,i,r),t.pendingIntents=[]}catch(n){console.error(`Error invoking intent handler for client ${e.uuid}/${e.name}/${e.endpointId}`),t.isReady=!1}}}else n.set(i,{isReady:!1,pendingIntents:[e]})}else{this.intentClientMap.set(t.name,new Map);const n=this.intentClientMap.get(t.name);n&&n.set(i,{isReady:!1,pendingIntents:[e]})}}async handleInfoForIntent(e,t){const n=(0,h.generateOverrideWarning)(\"fdc3.findIntent\",\"InteropBroker.handleInfoForIntent\",t,\"interopClient.getInfoForIntent\");throw console.warn(n),new Error(h.BROKER_ERRORS.getInfoForIntent)}async handleInfoForIntentsByContext(e,t){const n=(0,h.generateOverrideWarning)(\"fdc3.findIntentsByContext\",\"InteropBroker.handleInfoForIntentsByContext\",t,\"interopClient.getInfoForIntentsByContext\");throw console.warn(n),new Error(h.BROKER_ERRORS.getInfoForIntentsByContext)}async handleFiredIntentForContext(e,t){const n=(0,h.generateOverrideWarning)(\"fdc3.raiseIntentForContext\",\"InteropBroker.handleFiredIntentForContext\",t,\"interopClient.fireIntentForContext\");throw console.warn(n),new Error(h.BROKER_ERRORS.fireIntentForContext)}async clientDisconnected(e){}async fdc3HandleOpen({app:e,context:t},n){const i=(0,h.generateOverrideWarning)(\"fdc3.open\",\"InteropBroker.fdc3HandleOpen\",n);throw console.warn(i),new Error(h.BROKER_ERRORS.fdc3Open)}async fdc3HandleFindInstances(e,t){const n=(0,h.generateOverrideWarning)(\"fdc3.open\",\"InteropBroker.fdc3HandleFindInstances\",t);throw console.warn(n),new Error(h.BROKER_ERRORS.fdc3FindInstances)}async fdc3HandleGetAppMetadata(e,t){const n=(0,h.generateOverrideWarning)(\"fdc3.getAppMetadata\",\"InteropBroker.fdc3HandleGetAppMetadata\",t);throw console.warn(n),new Error(h.BROKER_ERRORS.fdc3GetAppMetadata)}async invokeContextHandler(e,t,n){const i=await this.getProvider();try{await i.dispatch(e,t,n)}catch(i){console.error(`Error invoking context handler ${t} for context type ${n.type} in client ${e.uuid}/${e.name}/${e.endpointId}`,i)}}async invokeIntentHandler(e,t,n){const i=await this.getProvider();await i.dispatch(e,t,n)}async fdc3HandleGetInfo(t,n){const{fdc3Version:i}=t;return{fdc3Version:i,...s(this,e,\"f\"),optionalFeatures:{OriginatingAppMetadata:!1,UserChannelMembershipAPIs:!0},appMetadata:{appId:\"\",instanceId:\"\"}}}async getAllClientInfo(){return(await this.getProvider()).getAllClientInfo()}decorateSnapshot(e){return{...e,interopSnapshotDetails:{contextGroupStates:this.getContextGroupStates()}}}applySnapshot(e,t){const n=e?.interopSnapshotDetails?.contextGroupStates;n&&(t?.closeExistingWindows||this.updateExistingClients(n),this.rehydrateContextGroupStates(n))}updateExistingClients(e){this.interopClients.forEach((t=>{const{clientIdentity:i,contextGroupId:r,contextHandlers:o}=t;if(r){const t=e[r];for(const[,e]of Object.entries(t))o.forEach((t=>{const{handlerId:r,contextType:o}=t;n.isContextTypeCompatible(e.type,o)&&this.invokeContextHandler(i,r,e)}))}}))}getContextGroupStates(){return n.toObject(this.contextGroupsById)}rehydrateContextGroupStates(e){const t=Object.entries(e);for(const[e,n]of t){const t=Object.entries(n);for(const[n,i]of t)if(this.contextGroupsById.has(e)){this.contextGroupsById.get(e).set(n,i)}else console.warn(`Attempting to set a context group that isn't in the context group mapping. Skipping context group rehydration for: ${e}`)}}contextHandlerRegistered({contextType:e,handlerId:t},n){const i={contextType:e,handlerId:t},r=this.getClientState(n);if(r?.contextHandlers.set(t,i),r&&r.contextGroupId){const{contextGroupId:i}=r,o=this.contextGroupsById.get(i);if(void 0===e)o.forEach(((e,i)=>{this.invokeContextHandler(n,t,e)}));else if(o.has(e)){const i=o.get(e);i&&this.invokeContextHandler(n,t,i)}}}async intentHandlerRegistered(e,t){const{handlerId:n}=e,i=this.intentClientMap.get(t.name),r=i?.get(n);if(i)if(r){const{pendingIntents:e}=r;r.clientIdentity=t,r.isReady=!0;try{if(e.length>0){const i=e[e.length-1];await this.invokeIntentHandler(t,n,i),r.pendingIntents=[]}}catch(e){console.error(`Error invoking intent handler: ${n} for client ${t.uuid}/${t.name}/${t.endpointId}`)}}else i.set(n,{isReady:!0,pendingIntents:[],clientIdentity:t});else{this.intentClientMap.set(t.name,new Map);const e=this.intentClientMap.get(t.name);e&&e.set(n,{isReady:!0,pendingIntents:[],clientIdentity:t})}}removeContextHandler({handlerId:e},t){const n=this.getClientState(t);n&&n.contextHandlers.delete(e)}handleJoinSessionContextGroup({sessionContextGroupId:e},t){try{if(!e)throw new Error(\"Failed to join session context group: must specify group id.\");const n=this.sessionContextGroupMap.get(e);if(n)n.registerNewClient(t);else{const n=new d.default(this.channel,e);n.registerNewClient(t),this.sessionContextGroupMap.set(e,n)}return{hasConflict:this.contextGroupsById.has(e)}}catch(e){throw new Error(e)}}getClientState(e){return this.interopClients.get(e.endpointId)}static toObject(e){const t=Object.fromEntries(e),n={};return Object.entries(t).forEach((([e,t])=>{const i=Object.fromEntries(t);n[e]=i})),n}static checkContextIntegrity(e){if(!e)return{isValid:!1,reason:\"No context supplied\"};if(\"object\"!=typeof e)return{isValid:!1,reason:\"Context must be an Object\"};if(!e.type)return{isValid:!1,reason:\"Context must have a type property\"};if(e.id&&\"object\"!=typeof e.id)return{isValid:!1,reason:\"Context id must be an Object populated with key-value identifiers (if set)\"};if(e.id){const{id:t}=e,n=Object.keys(t);let i=!1;if(!n.length)return{isValid:!1,reason:\"Context id must have at least one key-value identifier\"};if(n.forEach((e=>{\"string\"==typeof e&&\"string\"==typeof t[e]||(i=!0)})),i)return{isValid:!1,reason:\"Context id key-value identifiers must be of type string\"}}return e.name&&\"string\"!=typeof e.name?{isValid:!1,reason:\"Context name must be of string type (if set)\"}:{isValid:!0}}static hasEndpointId(e){return void 0!==e.endpointId}static isContextTypeCompatible(e,t){return void 0===t||e===t}setContextGroupMap(){for(const e of this.getContextGroups())this.contextGroupsById.set(e.id,new Map)}async setCurrentContextGroupInClientOptions(e,t){try{const n=await this.fin.System.getEntityInfo(e.uuid,e.name);let i;\"view\"===n.entityType?i=await this.fin.View.wrap(e):\"window\"===n.entityType&&(i=await this.fin.Window.wrap(e)),i&&await i.updateOptions({interop:{currentContextGroup:t}})}catch(e){}}async setupChannelProvider(){try{const e=await this.getProvider();this.channel=e,this.wireChannel(e)}catch(e){throw new Error(`Error setting up Interop Broker Channel Provider: ${e}`)}}wireChannel(e){e.onConnection((async(e,t)=>{if(!await this.isConnectionAuthorized(e,t))throw new Error(`Connection not authorized for ${e.uuid}, ${e.name}`);if(!e.endpointId)throw new Error(\"Version too old to be compatible with Interop. Please upgrade your runtime to a more recent version.\");const n={contextGroupId:void 0,contextHandlers:new Map,clientIdentity:e};t?.currentContextGroup&&this.contextGroupsById.has(t.currentContextGroup)&&(n.contextGroupId=t?.currentContextGroup),this.interopClients.set(e.endpointId,n)})),e.onDisconnection((e=>{this.interopClients.delete(e.endpointId);const t=this.intentClientMap.get(e.name);t&&e.uuid===this.fin.me.uuid&&t.forEach((e=>{e.isReady=!1})),this.sessionContextGroupMap.forEach((t=>{t.onDisconnection(e)})),this.clientDisconnected(e)})),e.beforeAction((async(e,t,n)=>{if(!await this.isActionAuthorized(e,t,n))throw new Error(`Action (${e}) not authorized for ${n.uuid}, ${n.name}`);this.logging?.beforeAction?.enabled&&console.log(e,t,n)})),e.afterAction(((e,t,n)=>{this.logging?.afterAction?.enabled&&console.log(e,t,n)})),e.register(\"setContext\",this.setContext.bind(this)),e.register(\"fireIntent\",this.handleFiredIntent.bind(this)),e.register(\"getCurrentContext\",this.getCurrentContext.bind(this)),e.register(\"getInfoForIntent\",this.handleInfoForIntent.bind(this)),e.register(\"getInfoForIntentsByContext\",this.handleInfoForIntentsByContext.bind(this)),e.register(\"fireIntentForContext\",this.handleFiredIntentForContext.bind(this)),e.register(\"getContextGroups\",this.getContextGroups.bind(this)),e.register(\"joinContextGroup\",this.joinContextGroup.bind(this)),e.register(\"removeFromContextGroup\",this.removeFromContextGroup.bind(this)),e.register(\"getAllClientsInContextGroup\",this.getAllClientsInContextGroup.bind(this)),e.register(\"getInfoForContextGroup\",this.getInfoForContextGroup.bind(this)),e.register(\"contextHandlerRegistered\",this.contextHandlerRegistered.bind(this)),e.register(\"intentHandlerRegistered\",this.intentHandlerRegistered.bind(this)),e.register(\"removeContextHandler\",this.removeContextHandler.bind(this)),e.register(\"sessionContextGroup:createIfNeeded\",this.handleJoinSessionContextGroup.bind(this)),e.register(\"fdc3Open\",this.fdc3HandleOpen.bind(this)),e.register(\"fdc3v2FindIntentsByContext\",this.handleInfoForIntentsByContext.bind(this)),e.register(\"fdc3FindInstances\",this.fdc3HandleFindInstances.bind(this)),e.register(\"fdc3GetAppMetadata\",this.fdc3HandleGetAppMetadata.bind(this)),e.register(\"fdc3v2GetInfo\",(async(e,t)=>this.fdc3HandleGetInfo.bind(this)(e,t))),e.register(\"createPrivateChannelProvider\",(async e=>{const{channelId:t}=e,n=await this.fin.InterApplicationBus.Channel.create(t);u.PrivateChannelProvider.init(n,t)}))}isConnectionAuthorized(e,t){return this.wire.sendAction(\"interop-broker-is-connection-authorized\").catch((e=>{})),Promise.resolve(!0)}isActionAuthorized(e,t,n){return this.wire.sendAction(\"interop-broker-is-action-authorized\").catch((e=>{})),Promise.resolve(!0)}};return Li.InteropBroker=y,e=new WeakMap,t=new WeakMap,i=new WeakMap,Li}var Ni,Di={},Ui={},Vi=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},zi=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Ui,\"__esModule\",{value:!0});const Ki=c,qi=$i;class Yi extends Ki.Base{constructor(e,t,n){super(e),Ni.set(this,void 0),this.id=n,Vi(this,Ni,t,\"f\")}async setContext(e){this.wire.sendAction(\"interop-session-context-group-set-context\").catch((e=>{}));return(await zi(this,Ni,\"f\")).dispatch(`sessionContextGroup:setContext-${this.id}`,{sessionContextGroupId:this.id,context:e})}async getCurrentContext(e){this.wire.sendAction(\"interop-session-context-group-get-context\").catch((e=>{}));return(await zi(this,Ni,\"f\")).dispatch(`sessionContextGroup:getContext-${this.id}`,{sessionContextGroupId:this.id,type:e})}async addContextHandler(e,t){if(this.wire.sendAction(\"interop-session-context-group-add-handler\").catch((e=>{})),\"function\"!=typeof e)throw new Error(\"Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.\");const n=await zi(this,Ni,\"f\");let i;return i=t?`sessionContextHandler:invoke-${this.id}-${t}-${(0,qi.generateId)()}`:`sessionContextHandler:invoke-${this.id}`,n.register(i,(0,qi.wrapContextHandler)(e,i)),await n.dispatch(`sessionContextGroup:handlerAdded-${this.id}`,{handlerId:i,contextType:t}),{unsubscribe:await this.createUnsubscribeCb(i)}}async createUnsubscribeCb(e){const t=await zi(this,Ni,\"f\");return async()=>{t.remove(e),await t.dispatch(`sessionContextGroup:handlerRemoved-${this.id}`,{handlerId:e})}}getUserInstance(){return{id:this.id,setContext:(0,qi.wrapInTryCatch)(this.setContext.bind(this),\"Failed to set context: \"),getCurrentContext:(0,qi.wrapInTryCatch)(this.getCurrentContext.bind(this),\"Failed to get context: \"),addContextHandler:(0,qi.wrapInTryCatch)(this.addContextHandler.bind(this),\"Failed to add context handler: \")}}}Ui.default=Yi,Ni=new WeakMap;var Ji={},Zi={},Qi={},Xi={};Object.defineProperty(Xi,\"__esModule\",{value:!0}),Xi.PrivateChannelClient=void 0;const er=$i;var tr,nr;function ir(){if(tr)return Zi;tr=1;var e,t=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)},i=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n};Object.defineProperty(Zi,\"__esModule\",{value:!0}),Zi.FDC3ModuleBase=void 0;const r=Qi,s=$i,a=ar(),c=n;return Zi.FDC3ModuleBase=class{get client(){return t(this,e,\"f\").call(this)}get fin(){return this.wire.getFin()}constructor(t,n){this.wire=n,e.set(this,void 0),i(this,e,t,\"f\")}async broadcast(e){return this.wire.sendAction(\"fdc3-broadcast\").catch((e=>{})),this.client.setContext(e)}async _open(e,t){this.wire.sendAction(\"fdc3-open\").catch((e=>{}));try{return await a.InteropClient.ferryFdc3Call(this.client,\"fdc3Open\",{app:e,context:t})}catch(e){const t=e.message===s.BROKER_ERRORS.fdc3Open?\"ResolverUnavailable\":e.message;throw new Error(t)}}async _getChannels(){return(await this.client.getContextGroups()).map((e=>({...e,type:\"system\",...(0,r.getUnsupportedChannelApis)()})))}async getOrCreateChannel(e){this.wire.sendAction(\"fdc3-get-or-create-channel\").catch((e=>{}));const t=(await this._getChannels()).find((t=>t.id===e));if(t)return{...t,type:\"system\",...(0,r.getUnsupportedChannelApis)()};try{const t=await this.client.joinSessionContextGroup(e);return(0,r.buildAppChannelObject)(t)}catch(e){throw console.error(e.message),new Error(r.ChannelError.CreationFailed)}}async getSystemChannels(){return this.wire.sendAction(\"fdc3-get-system-channels\").catch((e=>{})),this._getChannels()}async joinChannel(e){this.wire.sendAction(\"fdc3-join-channel\").catch((e=>{}));try{return await this.client.joinContextGroup(e)}catch(e){if(e.message===s.BROKER_ERRORS.joinSessionContextGroupWithJoinContextGroup?console.error(\"The Channel you have tried to join is an App Channel. Custom Channels can only be defined by the Interop Broker through code or manifest configuration. Please use getOrCreateChannel.\"):console.error(e.message),e.message.startsWith(\"Attempting to join a context group that does not exist\"))throw new Error(r.ChannelError.NoChannelFound);throw new Error(r.ChannelError.AccessDenied)}}async getCurrentChannel(){this.wire.sendAction(\"fdc3-get-current-channel\").catch((e=>{}));const e=await this.getCurrentContextGroupInfo();return e?this.buildChannelObject(e):null}async leaveCurrentChannel(){return this.wire.sendAction(\"fdc3-leave-current-channel\").catch((e=>{})),this.client.removeFromContextGroup()}async getCurrentContextGroupInfo(){const e=await this.client.getContextGroups(),t=e.map((async e=>this.client.getAllClientsInContextGroup(e.id))),n=(await Promise.all(t)).findIndex((e=>e.some((e=>{const{uuid:t,name:n}=e;return this.wire.me.uuid===t&&this.wire.me.name===n}))));return e[n]}async buildChannelObject(e){return{...e,type:\"system\",addContextListener:(...[e,t])=>{let n,i;\"function\"==typeof e?(console.warn(\"addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)\"),n=e):(n=t,\"string\"==typeof e&&(i=e));const r=(async()=>{let e=!0;const t=await this.client.getCurrentContext(i);return this.client.addContextHandler(((i,r)=>{if(!e||(e=!1,!(0,c.isEqual)(t,i)))return n(i,r)}),i)})();return{...r,unsubscribe:()=>r.then((e=>e.unsubscribe()))}},broadcast:this.broadcast.bind(this),getCurrentContext:async e=>{const t=await this.client.getCurrentContext(e);return void 0===t?null:t}}}},e=new WeakMap,Zi}Xi.PrivateChannelClient=class{constructor(e,t){this.id=t,this.client=e,this.listeners=new Map}async broadcast(e){return this.client.dispatch(\"broadcast\",{context:e})}async getCurrentContext(e){return this.client.dispatch(\"getCurrentContext\",{contextType:e})}async addContextListener(e,t){if(\"function\"!=typeof t)throw new Error(\"Non-function argument passed to the second parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.\");let n;n=e?`contextHandler:invoke-${this.id}-${e}-${er.generateId()}`:`contextHandler:invoke-${this.id}-${er.generateId()}`,this.client.register(n,er.wrapContextHandler(t,n));const i={unsubscribe:await this.createContextUnsubscribeCb(n)};return this.listeners.set(n,i),await this.client.dispatch(\"contextHandlerAdded\",{handlerId:n,contextType:e}),i}createNonStandardUnsubscribeCb(e){return async()=>{this.client.remove(e),this.listeners.delete(e),await this.client.dispatch(\"nonStandardHandlerRemoved\",{handlerId:e})}}createContextUnsubscribeCb(e){return async()=>{this.client.remove(e),this.listeners.delete(e),await this.client.dispatch(\"contextHandlerRemoved\",{handlerId:e})}}onAddContextListener(e){const t=`onContextHandlerAdded:invoke-${this.id}-${er.generateId()}`;this.client.register(t,e);const n={unsubscribe:this.createNonStandardUnsubscribeCb(t)};return this.listeners.set(t,n),this.client.dispatch(\"onAddContextHandlerAdded\",{handlerId:t}),n}onDisconnect(e){const t=`onDisconnect:invoke-${this.id}-${er.generateId()}`;this.client.register(t,e);const n={unsubscribe:this.createNonStandardUnsubscribeCb(t)};return this.listeners.set(t,n),this.client.dispatch(\"onDisconnectHandlerAdded\",{handlerId:t}),n}onUnsubscribe(e){const t=`onUnsubscribe:invoke-${this.id}-${er.generateId()}`;this.client.register(t,e);const n={unsubscribe:this.createNonStandardUnsubscribeCb(t)};return this.listeners.set(t,n),this.client.dispatch(\"onUnsubscribeHandlerAdded\",{handlerId:t}),n}async cleanUpAllSubs(){Array.from(this.listeners.keys()).forEach((e=>{this.client.remove(e),this.listeners.delete(e)}))}async disconnect(){try{await this.client.dispatch(\"clientDisconnecting\"),await this.cleanUpAllSubs(),await this.client.disconnect()}catch(e){throw new Error(e.message)}}},function(e){Object.defineProperty(e,\"__esModule\",{value:!0}),e.getIntentResolution=e.isChannel=e.isContext=e.connectPrivateChannel=e.buildAppChannelObject=e.buildPrivateChannelObject=e.ChannelError=e.ResultError=e.UnsupportedChannelApiError=e.getUnsupportedChannelApis=void 0;const t=$i,i=Xi,r=n;e.getUnsupportedChannelApis=e=>({addContextListener:()=>{throw new o(\"Channel.addContextListener\",e)},broadcast:()=>{throw new o(\"Channel.broadcast\",e)},getCurrentContext:()=>{throw new o(\"Channel.getCurrentContext\",e)}});class o extends Error{constructor(e,t=\"System\"){super(e),this.message=`Calling ${e} on an instance of a ${t} Channel returned by fdc3.get${t}Channels is not supported. If you would like to use a ${t} Channel, please use fdc3.joinChannel, fdc3.addContextListener, and fdc3.broadcast instead.`}}var s,a;e.UnsupportedChannelApiError=o,function(e){e.NoResultReturned=\"NoResultReturned\",e.IntentHandlerRejected=\"IntentHandlerRejected\"}(s=e.ResultError||(e.ResultError={})),(a=e.ChannelError||(e.ChannelError={})).NoChannelFound=\"NoChannelFound\",a.AccessDenied=\"AccessDenied\",a.CreationFailed=\"CreationFailed\";e.buildPrivateChannelObject=e=>{let t=!1;const n=()=>{if(t)throw new Error(\"Private Channel Client has been disconnected from the Private Channel\")};return{id:e.id,type:\"private\",broadcast:async t=>(n(),e.broadcast(t)),getCurrentContext:async t=>(n(),e.getCurrentContext(t)),addContextListener:async(t,i)=>{n();let r=i,o=t;\"function\"==typeof t&&(console.warn(\"addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)\"),r=t,o=null);return e.addContextListener(o,r)},onAddContextListener:t=>(n(),e.onAddContextListener(t)),disconnect:async()=>(n(),t=!0,e.disconnect()),onDisconnect:t=>(n(),e.onDisconnect(t)),onUnsubscribe:t=>(n(),e.onUnsubscribe(t))}};e.buildAppChannelObject=e=>({id:e.id,type:\"app\",broadcast:e.setContext,getCurrentContext:async t=>{const n=await e.getCurrentContext(t);return void 0===n?null:n},addContextListener:(t,n)=>{let i,o;\"function\"==typeof t?(console.warn(\"addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)\"),i=t):(i=n,\"string\"==typeof t&&(o=t));const s=(async()=>{let t=!0;const n=await e.getCurrentContext(o);return e.addContextHandler(((e,o)=>{if(!t||(t=!1,!(0,r.isEqual)(n,e)))return i(e,o)}),o)})();return{...s,unsubscribe:()=>s.then((e=>e.unsubscribe()))}}});e.connectPrivateChannel=async t=>{try{const n=await fin.InterApplicationBus.Channel.connect(t),r=new i.PrivateChannelClient(n,t);return(0,e.buildPrivateChannelObject)(r)}catch(e){throw new Error(`Private Channel with id: ${t} doesn't exist`)}};e.isContext=e=>{if(e&&\"object\"==typeof e&&\"type\"in e){const{type:t}=e;return\"string\"==typeof t}return!1};e.isChannel=e=>{if(e&&\"object\"==typeof e&&\"type\"in e&&\"id\"in e){const{type:t,id:n}=e;return\"string\"==typeof t&&\"string\"==typeof n&&(\"app\"===t||\"private\"===t)}return!1};e.getIntentResolution=async(n,i,r,o)=>{const a=(0,t.generateId)(),c=new Promise(((e,t)=>{fin.InterApplicationBus.subscribe({uuid:\"*\"},a,(t=>{e(t)})).catch((()=>t(new Error(\"getResult is not supported in this environment\"))))})),d=r?{target:r,intentResolutionResultId:a}:{intentResolutionResultId:a},h=o?{name:o,context:i,metadata:d}:{...i,metadata:d},l=async()=>{let t=await c;if(!t||\"object\"!=typeof t)throw new Error(s.NoResultReturned);const{error:i}=t;if(i)throw new Error(s.IntentHandlerRejected);if((0,e.isChannel)(t)){const{id:i,type:r}=t;switch(r){case\"private\":t=await(0,e.connectPrivateChannel)(i);break;case\"app\":{const r=await n.joinSessionContextGroup(i);t=(0,e.buildAppChannelObject)(r);break}}}else if(!(0,e.isContext)(t))throw new Error(s.NoResultReturned);return t},u=o?await n.fireIntent(h):await n.fireIntentForContext(h);return\"object\"!=typeof u?{source:{appId:\"\",instanceId:\"\"},intent:\"\",version:\"2.0\",getResult:l}:{...u,getResult:l}}}(Qi);var rr,or,sr={};function ar(){if(or)return Di;or=1;var e,t,n=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},i=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Di,\"__esModule\",{value:!0}),Di.InteropClient=void 0;const r=c,s=Ui,a=function(){if(nr)return Ji;nr=1,Object.defineProperty(Ji,\"__esModule\",{value:!0}),Ji.Fdc3Module=void 0;const e=$i,t=ir();class n extends t.FDC3ModuleBase{async open(e,t){await super._open(e,t)}addContextListener(e,t){let n;return this.wire.sendAction(\"fdc3-add-context-listener\").catch((e=>{})),\"function\"==typeof e?(console.warn(\"addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)\"),n=this.client.addContextHandler(e)):n=this.client.addContextHandler(t,null===e?void 0:e),{...n,unsubscribe:()=>n.then((e=>e.unsubscribe()))}}addIntentListener(e,t){this.wire.sendAction(\"fdc3-add-intent-listener\").catch((e=>{}));const n=this.client.registerIntentHandler((e=>{const{context:n,metadata:i}=e,{metadata:r}=n,o=i?.intentResolutionResultId||r?.intentResolutionResultId;o&&this.fin.InterApplicationBus.publish(o,null).catch((()=>null)),t(e.context)}),e,{fdc3Version:\"1.2\"});return{...n,unsubscribe:()=>n.then((e=>e.unsubscribe()))}}async raiseIntent(t,n,i){this.wire.sendAction(\"fdc3-raise-intent\").catch((e=>{}));const r=i?{name:t,context:n,metadata:{target:i}}:{name:t,context:n};try{return await this.client.fireIntent(r)}catch(t){const n=t.message===e.BROKER_ERRORS.fireIntent?\"ResolverUnavailable\":t.message;throw new Error(n)}}async findIntent(t,n){this.wire.sendAction(\"fdc3-find-intent\").catch((e=>{}));try{return await this.client.getInfoForIntent({name:t,context:n})}catch(t){const n=t.message===e.BROKER_ERRORS.getInfoForIntent?\"ResolverUnavailable\":t.message;throw new Error(n)}}async findIntentsByContext(t){this.wire.sendAction(\"fdc3-find-intents-by-context\").catch((e=>{}));try{return await this.client.getInfoForIntentsByContext(t)}catch(t){const n=t.message===e.BROKER_ERRORS.getInfoForIntentsByContext?\"ResolverUnavailable\":t.message;throw new Error(n)}}async raiseIntentForContext(t,n){this.wire.sendAction(\"fdc3-raise-intent-for-context\").catch((e=>{}));try{return await this.client.fireIntentForContext({...t,metadata:{target:n}})}catch(t){const n=t.message===e.BROKER_ERRORS.fireIntentForContext?\"ResolverUnavailable\":t.message;throw new Error(n)}}async getOrCreateChannel(e){return super.getOrCreateChannel(e)}getInfo(){this.wire.sendAction(\"fdc3-get-info\").catch((e=>{}));const{uuid:e,fdc3InteropApi:t}=fin.__internal_.initialOptions;return{fdc3Version:t,provider:`openfin-${e}`,providerVersion:fin.desktop.getVersion()}}}return Ji.Fdc3Module=n,Ji}(),d=function(){if(rr)return sr;rr=1,Object.defineProperty(sr,\"__esModule\",{value:!0}),sr.Fdc3Module2=void 0;const e=ir(),t=$i,n=ar(),i=Qi,r=Xi;class o extends e.FDC3ModuleBase{async open(e,t){return\"string\"==typeof e&&console.warn(\"Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).\"),super._open(e,t)}async findInstances(e){this.wire.sendAction(\"fdc3-find-instances\").catch((e=>{}));try{return await n.InteropClient.ferryFdc3Call(this.client,\"fdc3FindInstances\",e)}catch(e){const n=e.message===t.BROKER_ERRORS.fdc3FindInstances?\"ResolverUnavailable\":e.message;throw new Error(n)}}async getAppMetadata(e){this.wire.sendAction(\"fdc3-get-app-metadata\").catch((e=>{}));try{return await n.InteropClient.ferryFdc3Call(this.client,\"fdc3GetAppMetadata\",e)}catch(e){const n=e.message===t.BROKER_ERRORS.fdc3GetAppMetadata?\"ResolverUnavailable\":e.message;throw new Error(n)}}async addContextListener(e,t){this.wire.sendAction(\"fdc3-add-context-listener\").catch((e=>{}));const n=e=>t=>{const{contextMetadata:n,...i}=t,r=n?[{...i},n]:[t,null];e(...r)};let i=t,r=n(i);return\"function\"==typeof e?(console.warn(\"addContextListener(handler) has been deprecated. Please use addContextListener(null, handler)\"),i=e,r=n(i),this.client.addContextHandler(r)):this.client.addContextHandler(r,null===e?void 0:e)}async findIntent(e,n,i){this.wire.sendAction(\"fdc3-find-intent\").catch((e=>{}));try{return await this.client.getInfoForIntent({name:e,context:n,metadata:{resultType:i}})}catch(e){const n=e.message===t.BROKER_ERRORS.getInfoForIntent?\"ResolverUnavailable\":e.message;throw new Error(n)}}async findIntentsByContext(e,i){this.wire.sendAction(\"fdc3-find-intents-by-context\").catch((e=>{}));const r=i?{context:e,metadata:{resultType:i}}:e;try{return await n.InteropClient.ferryFdc3Call(this.client,\"fdc3v2FindIntentsByContext\",r)}catch(e){const n=e.message===t.BROKER_ERRORS.getInfoForIntentsByContext?\"ResolverUnavailable\":e.message;throw new Error(n)}}async raiseIntent(e,n,r){this.wire.sendAction(\"fdc3-raise-intent\").catch((e=>{}));try{return\"string\"==typeof r&&console.warn(\"Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).\"),(0,i.getIntentResolution)(this.client,n,r,e)}catch(e){const n=e.message===t.BROKER_ERRORS.fireIntent?\"ResolverUnavailable\":e.message;throw new Error(n)}}async raiseIntentForContext(e,n){this.wire.sendAction(\"fdc3-raise-intent-for-context\").catch((e=>{}));try{return\"string\"==typeof n&&console.warn(\"Passing a string as the app parameter is deprecated, please use an AppIdentifier ({ appId: string; instanceId?: string }).\"),(0,i.getIntentResolution)(this.client,e,n)}catch(e){const n=e.message===t.BROKER_ERRORS.fireIntent?\"ResolverUnavailable\":e.message;throw new Error(n)}}async addIntentListener(e,t){if(this.wire.sendAction(\"fdc3-add-intent-listener\").catch((e=>{})),\"string\"!=typeof e)throw new Error(\"First argument must be an Intent name\");return this.client.registerIntentHandler((async e=>{let n,i;const{context:r,metadata:o}=e,{contextMetadata:s,metadata:a,...c}=r,d=o?.intentResolutionResultId||a?.intentResolutionResultId;try{const e=a?{metadata:a,...c}:{...c};n=await t(e,s),i=n}catch(e){n=e,i={error:!0}}if(d&&this.fin.InterApplicationBus.publish(d,i).catch((()=>null)),n instanceof Error)throw new Error(n.message);return n}),e,{fdc3Version:\"2.0\"})}async getOrCreateChannel(e){return super.getOrCreateChannel(e)}async createPrivateChannel(){const e=(0,t.generateId)();await n.InteropClient.ferryFdc3Call(this.client,\"createPrivateChannelProvider\",{channelId:e});const o=await this.fin.InterApplicationBus.Channel.connect(e),s=new r.PrivateChannelClient(o,e);return(0,i.buildPrivateChannelObject)(s)}async getUserChannels(){return(await this.client.getContextGroups()).map((e=>({...e,type:\"user\",...(0,i.getUnsupportedChannelApis)(\"User\")})))}async getSystemChannels(){return console.warn(\"This API has been deprecated. Please use fdc3.getUserChannels instead.\"),super.getSystemChannels()}async joinUserChannel(e){return super.joinChannel(e)}async joinChannel(e){return console.warn(\"This API has been deprecated. Please use fdc3.joinUserChannel instead.\"),super.joinChannel(e)}async getCurrentChannel(){const e=await super.getCurrentChannel();return e?{...e,type:\"user\",broadcast:this.broadcast.bind(this)}:null}async getInfo(){return n.InteropClient.ferryFdc3Call(this.client,\"fdc3v2GetInfo\",{fdc3Version:\"2.0\"})}}return sr.Fdc3Module2=o,sr}(),h=$i;let l=class extends r.Base{constructor(i,r){super(i),e.set(this,void 0),t.set(this,void 0),n(this,t,new Map,\"f\"),n(this,e,r,\"f\")}async setContext(t){this.wire.sendAction(\"interop-client-set-context\").catch((e=>{}));return(await i(this,e,\"f\")).dispatch(\"setContext\",{context:t})}async addContextHandler(t,n){if(this.wire.sendAction(\"interop-client-add-context-handler\").catch((e=>{})),\"function\"!=typeof t)throw new Error(\"Non-function argument passed to the first parameter 'handler'. Be aware that the argument order does not match the FDC3 standard.\");const r=await i(this,e,\"f\");let o;o=n?`invokeContextHandler-${n}-${(0,h.generateId)()}`:\"invokeContextHandler\";const s=(0,h.wrapContextHandler)(t,o);return r.register(o,s),await r.dispatch(\"contextHandlerRegistered\",{handlerId:o,contextType:n}),{unsubscribe:async()=>{r.remove(o),await r.dispatch(\"removeContextHandler\",{handlerId:o})}}}async getContextGroups(){this.wire.sendAction(\"interop-client-get-context-groups\").catch((e=>{}));return(await i(this,e,\"f\")).dispatch(\"getContextGroups\")}async joinContextGroup(t,n){this.wire.sendAction(\"interop-client-join-context-group\").catch((e=>{}));const r=await i(this,e,\"f\");if(!t)throw new Error(\"No contextGroupId specified for joinContextGroup.\");return r.dispatch(\"joinContextGroup\",{contextGroupId:t,target:n})}async removeFromContextGroup(t){this.wire.sendAction(\"interop-client-remove-from-context-group\").catch((e=>{}));return(await i(this,e,\"f\")).dispatch(\"removeFromContextGroup\",{target:t})}async getAllClientsInContextGroup(t){this.wire.sendAction(\"interop-client-get-all-clients-in-context-group\").catch((e=>{}));const n=await i(this,e,\"f\");if(!t)throw new Error(\"No contextGroupId specified for getAllClientsInContextGroup.\");return n.dispatch(\"getAllClientsInContextGroup\",{contextGroupId:t})}async getInfoForContextGroup(t){this.wire.sendAction(\"interop-client-get-info-for-context-group\").catch((e=>{}));const n=await i(this,e,\"f\");if(!t)throw new Error(\"No contextGroupId specified for getInfoForContextGroup.\");return n.dispatch(\"getInfoForContextGroup\",{contextGroupId:t})}async fireIntent(t){this.wire.sendAction(\"interop-client-fire-intent\").catch((e=>{}));return(await i(this,e,\"f\")).dispatch(\"fireIntent\",t)}async registerIntentHandler(t,n,r){this.wire.sendAction(\"interop-client-register-intent-handler\").catch((e=>{}));const o=await i(this,e,\"f\"),s=`intent-handler-${n}`,a=(0,h.wrapIntentHandler)(t,s);try{await o.register(s,a),await o.dispatch(\"intentHandlerRegistered\",{handlerId:s,...r})}catch(e){throw new Error(\"Unable to register intent handler\")}return{unsubscribe:async()=>{o.remove(s)}}}async getCurrentContext(t){this.wire.sendAction(\"interop-client-get-current-context\").catch((e=>{}));return(await i(this,e,\"f\")).dispatch(\"getCurrentContext\",{contextType:t})}async getInfoForIntent(t){this.wire.sendAction(\"interop-client-get-info-for-intent\").catch((e=>{}));return(await i(this,e,\"f\")).dispatch(\"getInfoForIntent\",t)}async getInfoForIntentsByContext(t){this.wire.sendAction(\"interop-client-get-info-for-intents-by-context\").catch((e=>{}));return(await i(this,e,\"f\")).dispatch(\"getInfoForIntentsByContext\",t)}async fireIntentForContext(t){this.wire.sendAction(\"interop-client-fire-intent-for-context\").catch((e=>{}));return(await i(this,e,\"f\")).dispatch(\"fireIntentForContext\",t)}async joinSessionContextGroup(n){try{const r=i(this,t,\"f\").get(n);if(r)return r.getUserInstance();const o=await i(this,e,\"f\"),{hasConflict:a}=await o.dispatch(\"sessionContextGroup:createIfNeeded\",{sessionContextGroupId:n});a&&console.warn(`A (non-session) context group with the name \"${n}\" already exists. If you are trying to join a Context Group, call joinContextGroup instead.`);const c=new s.default(this.wire,i(this,e,\"f\"),n);return i(this,t,\"f\").set(n,c),c.getUserInstance()}catch(e){throw console.error(`Error thrown trying to create Session Context Group with id \"${n}\": ${e}`),e}}async onDisconnection(t){this.wire.sendAction(\"interop-client-add-ondisconnection-listener\").catch((e=>{}));return(await i(this,e,\"f\")).onDisconnection((e=>{const{uuid:n}=e;t({type:\"interop-broker\",topic:\"disconnected\",brokerName:n})}))}getFDC3Sync(e){switch(e){case\"1.2\":return new a.Fdc3Module((()=>this),this.wire);case\"2.0\":return new d.Fdc3Module2((()=>this),this.wire);default:throw new Error(`Invalid FDC3 version provided: ${e}. Must be '1.2' or '2.0'`)}}async getFDC3(e){return this.getFDC3Sync(e)}static async ferryFdc3Call(t,n,r){return(await i(t,e,\"f\")).dispatch(n,r||null)}};return Di.InteropClient=l,e=new WeakMap,t=new WeakMap,Di}var cr,dr,hr,lr={};function ur(){if(cr)return lr;cr=1,Object.defineProperty(lr,\"__esModule\",{value:!0}),lr.overrideCheck=lr.checkFDC32Overrides=lr.getDefaultViewFdc3VersionFromAppInfo=void 0;const e=Hi();function t(t){return[\"fdc3HandleFindInstances\",\"handleInfoForIntent\",\"handleInfoForIntentsByContext\",\"fdc3HandleGetAppMetadata\",\"fdc3HandleGetInfo\",\"fdc3HandleOpen\",\"handleFiredIntent\",\"handleFiredIntentForContext\"].filter((n=>t[n]===e.InteropBroker.prototype[n]))}return lr.getDefaultViewFdc3VersionFromAppInfo=function({manifest:e,initialOptions:t}){const n=e?.platform?.defaultViewOptions?.fdc3InteropApi??t.defaultViewOptions?.fdc3InteropApi;return[\"1.2\",\"2.0\"].includes(n??\"\")?n:void 0},lr.checkFDC32Overrides=t,lr.overrideCheck=function(e,n){if(n&&\"2.0\"===n){const n=t(e);n.length>0&&console.warn(`WARNING: FDC3 2.0 has been set as a default option for Views in this Platform, but the required InteropBroker APIs for FDC3 2.0 compliance have not all been overridden.\\nThe following APIs need to be overridden:\\n${n.join(\"\\n\")}`)}},lr}function pr(){return hr||(hr=1,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),i=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),i(function(){if(dr)return Fi;dr=1,Object.defineProperty(Fi,\"__esModule\",{value:!0}),Fi.InteropModule=void 0;const e=n,t=ji,i=c,r=Hi(),o=ar(),s=ur(),a=ri,d=e=>new e,h=\"You have attempted to use or modify InteropBroker parameters, which is not allowed. You are likely using an older InteropBroker override scheme. Please consult our Interop docs for guidance on migrating to the new override scheme.\";class l extends i.Base{async init(n,i=d){this.wire.sendAction(\"interop-init\").catch((()=>{}));const o=await this.wire.environment.getInteropInfo(this.wire.getFin()),c=(0,t.createUnusableObject)(h),l=(0,t.createWarningObject)(h,(0,e.cloneDeep)(o)),u=async()=>{throw new Error(h)},p=r.InteropBroker.createClosedConstructor(this.wire,(()=>this.fin.InterApplicationBus.Channel.create(`interop-broker-${n}`)),o);let w;return w=Array.isArray(i)?new((0,a.overrideFromComposables)(...i)(p))(c,u,l):await i(p,c,u,l),(0,s.overrideCheck)(w,o.fdc3Version),w}connectSync(e,t){return this.wire.sendAction(\"interop-connect-sync\").catch((()=>{})),new o.InteropClient(this.wire,this.wire.environment.whenReady().then((()=>this.fin.InterApplicationBus.Channel.connect(`interop-broker-${e}`,{payload:t}))))}}return Fi.InteropModule=l,Fi}(),e),i(ar(),e),i(Hi(),e)}(Ri)),Ri}var wr={},yr={},fr={},gr={};Object.defineProperty(gr,\"__esModule\",{value:!0}),gr.getSnapshotSourceChannelName=void 0;gr.getSnapshotSourceChannelName=e=>`snapshot-source-provider-${e.uuid}`;var mr,vr,Cr,br,Ir,Er=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},xr=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(fr,\"__esModule\",{value:!0}),fr.SnapshotSource=void 0;const Ar=c,Pr=gr,Mr=new Map;class Or extends Ar.Base{constructor(e,t){super(e),mr.set(this,void 0),vr.set(this,(()=>(Mr.has(this.identity.uuid)||Mr.set(this.identity.uuid,{eventFired:null,clientPromise:null}),Mr.get(this.identity.uuid)))),Cr.set(this,(()=>(xr(this,vr,\"f\").call(this).clientPromise||(xr(this,vr,\"f\").call(this).clientPromise=xr(this,br,\"f\").call(this)),xr(this,vr,\"f\").call(this).clientPromise))),br.set(this,(async()=>{const e=(0,Pr.getSnapshotSourceChannelName)(this.identity);try{xr(this,vr,\"f\").call(this).eventFired||await xr(this,Ir,\"f\").call(this);const t=await this.fin.InterApplicationBus.Channel.connect(e,{wait:!1});return t.onDisconnection((()=>{xr(this,vr,\"f\").call(this).clientPromise=null,xr(this,vr,\"f\").call(this).eventFired=null})),t}catch(e){throw xr(this,vr,\"f\").call(this).clientPromise=null,new Error(\"The targeted SnapshotSource is not currently initialized. Await this object's ready() method.\")}})),Ir.set(this,(async()=>{const e=(0,Pr.getSnapshotSourceChannelName)(this.identity);let t,n;const i=new Promise(((e,i)=>{t=e,n=i}));xr(this,vr,\"f\").call(this).eventFired=i;const r=async i=>{try{i.channelName===e&&(t(),await this.fin.InterApplicationBus.Channel.removeListener(\"connected\",r))}catch(e){n(e)}};await this.fin.InterApplicationBus.Channel.on(\"connected\",r)})),Er(this,mr,t,\"f\")}get identity(){return xr(this,mr,\"f\")}async ready(){this.wire.sendAction(\"snapshot-source-ready\").catch((e=>{}));try{await xr(this,Cr,\"f\").call(this)}catch(e){await xr(this,vr,\"f\").call(this).eventFired}}async getSnapshot(){this.wire.sendAction(\"snapshot-source-get-snapshot\").catch((e=>{}));const e=await xr(this,Cr,\"f\").call(this),t=await e.dispatch(\"get-snapshot\");return(await t).snapshot}async applySnapshot(e){this.wire.sendAction(\"snapshot-source-apply-snapshot\").catch((e=>{}));return(await xr(this,Cr,\"f\").call(this)).dispatch(\"apply-snapshot\",{snapshot:e})}}fr.SnapshotSource=Or,mr=new WeakMap,vr=new WeakMap,Cr=new WeakMap,br=new WeakMap,Ir=new WeakMap,Object.defineProperty(yr,\"__esModule\",{value:!0}),yr.SnapshotSourceModule=void 0;const _r=c,Sr=fr,Rr=gr;class Fr extends _r.Base{async init(e){if(this.wire.sendAction(\"snapshot-source-init\").catch((e=>{})),\"object\"!=typeof e||\"function\"!=typeof e.getSnapshot||\"function\"!=typeof e.applySnapshot)throw new Error(\"you must pass in a valid SnapshotProvider\");const t=await this.fin.InterApplicationBus.Channel.create((0,Rr.getSnapshotSourceChannelName)(this.fin.me));t.register(\"get-snapshot\",(async()=>({snapshot:await e.getSnapshot()}))),t.register(\"apply-snapshot\",(({snapshot:t})=>e.applySnapshot(t)))}wrapSync(e){return this.wire.sendAction(\"snapshot-source-wrap-sync\").catch((e=>{})),new Sr.SnapshotSource(this.wire,e)}async wrap(e){return this.wire.sendAction(\"snapshot-source-wrap\").catch((e=>{})),this.wrapSync(e)}}yr.SnapshotSourceModule=Fr,function(e){var t=o&&o.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!(\"get\"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),n=o&&o.__exportStar||function(e,n){for(var i in e)\"default\"===i||Object.prototype.hasOwnProperty.call(n,i)||t(n,e,i)};Object.defineProperty(e,\"__esModule\",{value:!0}),n(yr,e),n(fr,e)}(wr),Object.defineProperty(s,\"__esModule\",{value:!0});var jr=s.Fin=void 0;const kr=t,Lr=a,Tr=Pe(),$r=Ce(),Br=Fe,Gr=En,Wr=Pn,Hr=kn,Nr=Dn,Dr=me(),Ur=Kn,Vr=Si,zr=pr(),Kr=wr;class qr extends kr.EventEmitter{constructor(e){super(),this.wire=e,this.System=new Lr.System(e),this.Window=new Tr._WindowModule(e),this.Application=new $r.ApplicationModule(e),this.InterApplicationBus=new Br.InterApplicationBus(e),this.Clipboard=new Gr.Clipboard(e),this.ExternalApplication=new Wr.ExternalApplicationModule(e),this.Frame=new Hr._FrameModule(e),this.GlobalHotkey=new Nr.GlobalHotkey(e),this.Platform=new Ur.PlatformModule(e,this.InterApplicationBus.Channel),this.View=new Dr.ViewModule(e),this.Interop=new zr.InteropModule(e),this.SnapshotSource=new Kr.SnapshotSourceModule(e),e.registerFin(this),this.me=(0,Vr.getMe)(e),e.on(\"disconnected\",(()=>{this.emit(\"disconnected\")}))}}jr=s.Fin=qr;var Yr={},Jr={};function Zr(e){return\"string\"==typeof e.manifestUrl}function Qr(e){return eo(e)&&\"string\"==typeof e.address}function Xr(e){return Qr(e)&&\"string\"==typeof e.token}function eo(e){return\"string\"==typeof e.uuid}function to(e){return e.runtime&&\"string\"==typeof e.runtime.version}function no(e){return eo(e)&&to(e)}Object.defineProperty(Jr,\"__esModule\",{value:!0}),Jr.isInternalConnectConfig=Jr.isPortDiscoveryConfig=Jr.isNewConnectConfig=Jr.isConfigWithReceiver=Jr.isRemoteConfig=Jr.isExistingConnectConfig=Jr.isExternalConfig=void 0,Jr.isExternalConfig=Zr,Jr.isExistingConnectConfig=Qr,Jr.isRemoteConfig=Xr,Jr.isConfigWithReceiver=function(e){return\"object\"==typeof e.receiver&&Xr({...e,address:\"\"})},Jr.isNewConnectConfig=no,Jr.isPortDiscoveryConfig=function(e){return Zr(e)&&to(e)||no(e)},Jr.isInternalConnectConfig=function(e){return Qr(e)||no(e)};var io={},ro={};Object.defineProperty(ro,\"__esModule\",{value:!0}),ro.EmitterMap=void 0;const oo=t;function so(e){return Buffer.from(e).toString(\"base64\")}ro.EmitterMap=class{constructor(){this.storage=new Map}hashKeys(e){return e.map(so).join(\"/\")}getOrCreate(e){const t=this.hashKeys(e);return this.storage.has(t)||this.storage.set(t,new oo.EventEmitter),this.storage.get(t)}has(e){return this.storage.has(this.hashKeys(e))}delete(e){const t=this.hashKeys(e);return this.storage.delete(t)}},Object.defineProperty(io,\"__esModule\",{value:!0});const ao=ro;class co extends ao.EmitterMap{constructor(){super(...arguments),this.dispatchEvent=e=>{if(function(e){return\"process-desktop-event\"===e.action}(e)){const{payload:t}=e,n=function(e){const{topic:t}=e;if(\"frame\"===t||\"window\"===t||\"view\"===t){const{uuid:n,name:i}=e;return[t,n,i]}if(\"application\"===t){const{uuid:n}=e;return[t,n]}return[t]}(t);if(this.has(n))return this.getOrCreate(n).emit(t.type,t),!0}return!1}}}io.default=co;var ho,lo,uo=o&&o.__classPrivateFieldSet||function(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n},po=o&&o.__classPrivateFieldGet||function(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)};Object.defineProperty(Yr,\"__esModule\",{value:!0});var wo=Yr.Transport=void 0;const yo=t,fo=Jr,go=f,mo=io,vo=Si,Co=it;class bo extends yo.EventEmitter{constructor(e,t,n){super(),this.wireListeners=new Map,this.topicRefMap=new Map,this.eventAggregator=new mo.default,this.messageHandlers=[this.eventAggregator.dispatchEvent],ho.set(this,void 0),lo.set(this,void 0),this.connectSync=()=>{po(this,ho,\"f\").connectSync()},this.getPort=()=>po(this,ho,\"f\").getPort(),uo(this,ho,new e(this.onmessage.bind(this)),\"f\"),this.environment=t,this.sendRaw=po(this,ho,\"f\").send.bind(po(this,ho,\"f\")),this.registerMessageHandler(this.handleMessage.bind(this)),po(this,ho,\"f\").on(\"disconnected\",(()=>{for(const[,{handleNack:e}]of this.wireListeners)e({reason:\"Remote connection has closed\"});this.wireListeners.clear(),this.emit(\"disconnected\")}));const{uuid:i,name:r}=n,o=this.environment.getCurrentEntityType();this.me=(0,vo.getBaseMe)(o,i,r)}getFin(){if(!po(this,lo,\"f\"))throw new Error(\"No Fin object registered for this transport\");return po(this,lo,\"f\")}registerFin(e){if(po(this,lo,\"f\"))throw new Error(\"Fin object has already been registered for this transport\");uo(this,lo,e,\"f\")}shutdown(){return po(this,ho,\"f\").shutdown()}async connect(e){if((0,fo.isConfigWithReceiver)(e))return await po(this,ho,\"f\").connect(e.receiver),this.authorize(e);if((0,fo.isRemoteConfig)(e))return this.connectRemote(e);if((0,fo.isExistingConnectConfig)(e))return this.connectByPort(e);if((0,fo.isNewConnectConfig)(e)){const t=await this.environment.retrievePort(e);return this.connectByPort({...e,address:`ws://localhost:${t}`})}}async connectRemote(e){return await po(this,ho,\"f\").connect(new(this.environment.getWsConstructor())(e.address)),this.authorize(e)}async connectByPort(e){const{address:t,uuid:n}=e,i={...e,type:\"file-token\"},r=po(this,ho,\"f\");await r.connect(new(this.environment.getWsConstructor())(e.address));const o=await this.sendAction(\"request-external-authorization\",{uuid:n,type:\"file-token\"},!0);if(\"external-authorization-response\"!==o.action)throw new go.UnexpectedActionError(o.action);return await this.environment.writeToken(o.payload.file,o.payload.token),this.authorize(i)}async authorize(e){const t=await this.sendAction(\"request-authorization\",e,!0);if(\"authorization-response\"!==t.action)throw new go.UnexpectedActionError(t.action);if(!0!==t.payload.success)throw new go.RuntimeError(t.payload)}sendAction(e,t={},n=!1){let i=()=>{};const r=go.RuntimeError.getCallSite(1),o=this.environment.getNextMessageId(),s=new Promise(((s,a)=>{i=a;const c={action:e,payload:t,messageId:o},d=po(this,ho,\"f\");return this.addWireListener(o,s,(e=>this.nackHandler(e,a,r)),n),d.send(c).catch(a)}));return Object.assign(s,{cancel:i,messageId:o})}nackHandler(e,t,n){t(\"string\"==typeof e?e:new go.RuntimeError(e,n))}ferryAction(e){return new Promise(((t,n)=>{const i=this.environment.getNextMessageId();e.messageId=i;const r=e=>{t(e.payload)};return po(this,ho,\"f\").send(e).then((()=>this.addWireListener(i,r,(e=>this.nackHandler(e,n)),!1))).catch(n)}))}registerMessageHandler(e){this.messageHandlers.push(e)}addWireListener(e,t,n,i){i?this.uncorrelatedListener=t:this.wireListeners.has(e)?n({reason:\"Duplicate handler id\",error:(0,Co.errorToPOJO)(new go.DuplicateCorrelationError(String(e)))}):this.wireListeners.set(e,{resolve:t,handleNack:n})}onmessage(e){for(const t of this.messageHandlers)t.call(null,e)}handleMessage(e){const t=e.correlationId||NaN;if(\"correlationId\"in e){if(!this.wireListeners.has(t))return!1;{const{resolve:n,handleNack:i}=this.wireListeners.get(t);\"ack\"!==e.action?i({reason:\"Did not receive ack action\",error:(0,Co.errorToPOJO)(new go.NoAckError(e.action))}):\"payload\"in e?e.payload.success?n.call(null,e):i(e.payload):\"string\"==typeof e.reason?i(e):(console.warn(\"Received invalid response from core\",e),i({reason:\"invalid response shape\"})),this.wireListeners.delete(t)}}else this.uncorrelatedListener&&this.uncorrelatedListener.call(null,e),this.uncorrelatedListener=()=>{};return!0}}wo=Yr.Transport=bo,ho=new WeakMap,lo=new WeakMap;const Io=(...e)=>({log:(...t)=>console.log(`[${(new Date).toISOString()}]`,...(e=>e.map((e=>`[${e}]`)))(e),...t),getLogger:(...t)=>Io(...e,...t)}),Eo=Io(\"[@openfin/core-web/client\");function xo(e,t){if(!function(e){return\"string\"==typeof e}(e))throw new Error(`Property ${t} has invalid type. Expected string, got ${typeof e}.`)}const Ao=\"web-broker-ports-ready\",Po=Eo.getLogger(\"get-web-interop-ports\");function Mo(e,t,n,i){if(\"a\"===n&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof t?e!==t||!i:!t.has(e))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===n?i:\"a\"===n?i.call(e):i?i.value:t.get(e)}function Oo(e,t,n,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof t?e!==t||!r:!t.has(e))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(e,n):r?r.value=n:t.set(e,n),n}\"function\"==typeof SuppressedError&&SuppressedError;const _o=e=>{var n,i,r;return r=class extends t.EventEmitter{constructor(t){super(),n.set(this,void 0),i.set(this,!1),this.connectSync=()=>{Mo(this,i,\"f\")||(e.addEventListener(\"message\",(e=>{e.data?.topic?.startsWith(\"wire-message\")&&e.data.message&&Mo(this,n,\"f\").call(this,{...JSON.parse(e.data.message),ports:e.ports})})),e.start())},this.connect=async()=>{this.connectSync()},this.send=t=>(e.postMessage({topic:\"wire-message\",message:JSON.stringify(t)}),Promise.resolve()),this.shutdown=async()=>{e.close()},Oo(this,n,t,\"f\")}getPort(){return e}},n=new WeakMap,i=new WeakMap,r};var So={},Ro={};Object.defineProperty(Ro,\"__esModule\",{value:!0}),Ro.BaseEnvironment=void 0;const Fo=ur();Ro.BaseEnvironment=class{async getInteropInfo(e){const t=await e.Application.getCurrentSync().getInfo().catch((()=>null)),n=t?.initialOptions?.interopBrokerConfiguration??{};return{fdc3Version:t?(0,Fo.getDefaultViewFdc3VersionFromAppInfo)(t):void 0,...n,fdc3Info:{providerVersion:await e.System.getVersion(),provider:\"OpenFin\"}}}},Object.defineProperty(So,\"__esModule\",{value:!0});var jo=So.BrowserEnvironment=void 0;const ko=Ro;class Lo extends ko.BaseEnvironment{constructor(){super(...arguments),this.type=\"other\",this.getRandomId=()=>{const e=new Uint32Array(1);return window.crypto.getRandomValues(e)[0].toString(32)}}observeBounds(e,t){throw new Error(\"Method not implemented.\")}layoutAllowedInContext(e){return!1}initLayoutManager(e,t,n){throw new Error(\"Method not implemented.\")}applyLayoutSnapshot(e,t,n){throw new Error(\"Method not implemented.\")}createLayout(e,t){throw new Error(\"Method not implemented.\")}destroyLayout(e,t){throw new Error(\"Method not implemented.\")}resolveLayout(e,t){throw new Error(\"Method not implemented.\")}initPlatform(...e){throw new Error(\"Method not implemented.\")}writeToken(e,t){return Promise.resolve(\"\")}retrievePort(e){throw new Error(\"Method not implemented.\")}getNextMessageId(){return this.getRandomId()}createChildContent(e){throw new Error(\"Method not implemented.\")}getWebWindow(e){throw new Error(\"Method not implemented.\")}getCurrentEntityIdentity(){throw new Error(\"Method not implemented.\")}getCurrentEntityType(){return\"external connection\"}raiseEvent(e,t){throw new Error(\"Method not implemented.\")}getUrl(){return location.href}getDefaultChannelOptions(){return{create:{},connect:{}}}getRtcPeer(){return new RTCPeerConnection}getWsConstructor(){return WebSocket}whenReady(){return Promise.resolve()}}jo=So.BrowserEnvironment=Lo;const To=e=>\"platform\"in e&&void 0!==e.platform;var $o,Bo;class Go extends jo{constructor(e){super(),this.connectConfig=e,$o.set(this,void 0),Bo.set(this,new G((async()=>Promise.resolve().then((function(){return require(\"./main-92c82377.js\")}))))),To(e)&&this.validatePlatformOptions(e)}validatePlatformOptions({platform:e}){if(!(\"layoutSnapshot\"in e))throw new Error(\"Platform options are missing layoutSnapshot. Please provide a layoutSnapshot in the platform options.\");if(\"windows\"in e||\"windows\"in e.layoutSnapshot)throw new Error(\"It appears you tried to call connect() with a snapshot object from an OpenFin desktop environment. Note that connect() expects to be called with a platform property with this structure: { platform: { layoutSnapshot } }. To get a layoutSnapshot of the expected structure, use fin.Platform.Layout.getCurrentLayoutManagerSync().getLayoutSnapshot() in v34+ in your desktop environment.\");const{layouts:t}=e.layoutSnapshot;Object.entries(t).map((([e,t])=>{if(\"object\"!=typeof t||null===t)throw new Error(`Invalid layout detected: layoutSnapshot.layouts.${e} must be an object.`);if(!(\"content\"in t))throw new Error(`Invalid layout detected: layoutSnapshot.layouts.${e} must contain a 'content' property.`)}))}async getInteropInfo(e){return{...{contextGroups:void 0,logging:{beforeAction:{enabled:!1},afterAction:{enabled:!1}}},fdc3Version:void 0,fdc3Info:{providerVersion:\"0.38.49\",provider:\"OpenFin Web\"}}}layoutAllowedInContext(e){return!0}async initLayoutManager(e,t,n){if(Mo(this,$o,\"f\"))throw new Error(\"Layout already initialized.\");if(!To(this.connectConfig))throw new Error(\"Platform options are missing from connection config.\");const{createWebLayoutModule:i}=await Mo(this,Bo,\"f\").getValue();return Oo(this,$o,i(this.connectConfig),\"f\"),await Mo(this,$o,\"f\").init(n),Mo(this,$o,\"f\").getCurrentLayoutManagerSync()}async applyLayoutSnapshot(e,t,n){}async createLayout(e,t){return Mo(this,$o,\"f\").create(t)}async destroyLayout(e,t){return Mo(this,$o,\"f\").destroy(t)}}$o=new WeakMap,Bo=new WeakMap;const Wo=()=>{const e=((e,t)=>{const n=new RegExp(`^${t}<(?.*)>$`).exec(e)?.groups?.meta;if(n)try{return JSON.parse(atob(n))}catch(e){throw new Error(`Failed to decode JSON from ${n}.`)}})(window.name,\"of-frame\");if(e)try{const{name:t,uuid:n,brokerUrl:i,providerId:r,contextGroup:o}=e;return xo(i,\"brokerUrl\"),xo(n,\"uuid\"),xo(t,\"name\"),{identity:{name:t,uuid:n},brokerUrl:i,interopConfig:{providerId:r,currentContextGroup:o}}}catch(e){throw new Error(`Unexpected error occurred when inferring platform information: ${e.stack}`)}},Ho=()=>{const e=i.v4();return{uuid:e,name:e}},No=async e=>{if(\"enabled\"===e.connectionInheritance){const t=await(async e=>{const t=Wo();if(t){const{validateOptions:n=(()=>!0)}=e,{identity:i,...r}=t;if(!await n(r))throw new Error(\"Parent options were rejected by validateOptions.\");return t}})(e);if(t)return t}if(!e.options){const t=\"enabled\"===e.connectionInheritance?\"Broker URL was not specified nor provided by a platform container.\":\"Connection inheritance is disabled but no options were provided.\";throw new Error(t)}return{...e.options,identity:Ho()}};exports.__classPrivateFieldGet=Mo,exports.__classPrivateFieldSet=Oo,exports.commonjsGlobal=o,exports.connect=async t=>{try{Eo.log(\"Establishing connection\",t);const{brokerUrl:n,identity:i,timeout:o,interopConfig:s}=await No(t),{workerPort:a,iframeBrokerPort:c}=await(async(e,t,n)=>{const{origin:i}=new URL(e),o=document.createElement(\"IFRAME\");let s;o.style.display=\"none\";try{return await new Promise(((a,c)=>{const d=e=>{if(e.source===o.contentWindow&&e.data?.topic===`ack-${Ao}`){if(e.origin!==i)c(new Error(`Broker redirected to unexpected origin ${e.origin}, expected ${i}.`));else if(e.data.success){const[t,n]=e.ports;a({iframeBrokerPort:t,workerPort:n})}else c(new g(e.data));window.removeEventListener(\"message\",d),clearTimeout(s)}};window.addEventListener(\"message\",d),Po.log(`Connecting to broker ${e}`),o.setAttribute(\"src\",e),o.setAttribute(\"name\",r(t,\"of-broker\")),document.body.appendChild(o),Po.log(\"Iframe loaded, awaiting init message from iframe\"),n&&(s=setTimeout((()=>{window.removeEventListener(\"message\",d),document.body.removeChild(o),c(new Error(\"Worker did not initialize in time\"))}),n))}))}catch(e){throw new Error(`Failed to initialise Fin Web Client. ${e.message}`,{cause:e})}})(n,i,o);Eo.log(\"Successfully established connection to shared worker\");const d={entityType:\"external connection\",...i};a.start(),c.start();const h=((t,n,i)=>{const r=_o(n),o=new Go(t),s=new wo(r,o,i);return s.connectSync(),window.Buffer=e.Buffer,new jr(s)})(t,a,d);return s?.providerId&&(h.me.interop=h.Interop.connectSync(s.providerId),s?.currentContextGroup&&h.me.interop.joinContextGroup(s.currentContextGroup).catch((e=>{console.warn(`Error joining specified context group: ${s?.currentContextGroup}, continuing`,e)}))),{...h,me:{...h.me,identity:{uuid:h.me.uuid,name:h.me.name}}}}catch(e){throw new Error(`An error occured during web-interop connection: ${e.message}`)}},exports.encodeOptions=r;\n","\"use strict\";var t=require(\"./main-48131439.js\"),e=require(\"uuid\"),o=require(\"golden-layout\");require(\"buffer/\"),require(\"events\"),require(\"lodash\");var i={},r={};Object.defineProperty(r,\"__esModule\",{value:!0}),r.mapValuesAsync=r.mapEntriesAsync=void 0;const a=(t,[e,o])=>({...t,[e]:o});async function n(t,e){return(await Promise.all(e.map((async([e,o])=>[e,await t(o,e)])))).reduce(a,{})}r.mapEntriesAsync=n,r.mapValuesAsync=async function(t,e){let o;return o=e instanceof Map?[...e.entries()]:Object.entries(e),n(t,o)};var s,c,l,u,d=t.commonjsGlobal&&t.commonjsGlobal.__classPrivateFieldSet||function(t,e,o,i,r){if(\"m\"===i)throw new TypeError(\"Private method is not writable\");if(\"a\"===i&&!r)throw new TypeError(\"Private accessor was defined without a setter\");if(\"function\"==typeof e?t!==e||!r:!e.has(t))throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");return\"a\"===i?r.call(t,o):r?r.value=o:e.set(t,o),o},h=t.commonjsGlobal&&t.commonjsGlobal.__classPrivateFieldGet||function(t,e,o,i){if(\"a\"===o&&!i)throw new TypeError(\"Private accessor was defined without a getter\");if(\"function\"==typeof e?t!==e||!i:!e.has(t))throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");return\"m\"===o?i:\"a\"===o?i.call(t):i?i.value:e.get(t)};Object.defineProperty(i,\"__esModule\",{value:!0});var m=i.DefaultLayoutManager=void 0;const y=r;class f{constructor(t){c.set(this,void 0),l.set(this,new Map),d(this,c,t,\"f\")}size(){return h(this,l,\"f\").size}async applyLayoutSnapshot({layouts:t}){if(Object.keys(t).length>1)throw new Error(\"[LayoutManager] Tried to call applyLayoutSnapshot with more than 1 layout. When implementing multiple layouts via overridden LayoutManager class, you must override and fully implement the applyLayoutSnapshot method without calling super.applyLayoutSnapshot().\");const[[e,o]]=Object.entries(t);await f.createLayout(this,{layoutName:e,layout:o})}async showLayout({layoutName:t}){}async getLayoutSnapshot(){return{layouts:await(0,y.mapValuesAsync)((t=>t.getFrameSnapshot()),h(this,l,\"f\"))}}async removeLayout({layoutName:t}){}getLayoutIdentityForView(t){const e=[...h(this,l,\"f\").values()].find((e=>e.getCurrentViews().some((e=>e.name===t.name&&e.uuid===t.uuid))));return e?.identity??void 0}isLayoutVisible({layoutName:t}){return h(f,s,\"m\",u).call(f,this,t).isVisible()}resolveLayoutIdentity(t){if(t&&\"layoutName\"in t)return t;const e=[...h(this,l,\"f\").values()];if(1===e.length)return e[0].identity;const o=e.find((t=>t.isVisible()));return o?.identity??void 0}static async resolveLayout(t,e){const o=t.resolveLayoutIdentity(e);if(void 0===o||!(\"layoutName\"in o))throw new Error(\"[layout-manager] resolveLayout: Could not resolve the layout identity. Make sure you include 'layoutName' in the identity object.\");return h(f,s,\"m\",u).call(f,t,o.layoutName)}static async handleSharedView(t,e,o){await(0,y.mapValuesAsync)((async t=>{if(t.identity.layoutName!==e.layoutName){const e=t.getCurrentViews().find((t=>t.name===o.name));e&&await t.onViewDetached({viewIdentity:e,target:null}).catch(console.error)}}),h(t,l,\"f\"))}static async handleLastViewRemoved(t,e){await t.removeLayout(e),await h(t,c,\"f\").handleLastViewRemoved(t)}static async destroyLayout(t,{layoutName:e}){await h(f,s,\"m\",u).call(f,t,e).destroy(),h(t,l,\"f\").delete(e)}static async createLayout(t,e){const{layoutName:o}=e;if(h(t,l,\"f\").has(o))throw new Error(`Layout name ${o} already exists`);await h(t,c,\"f\").createLayout(e,t)}static registerLayout(t,e,o){h(t,l,\"f\").set(e,o)}static getAllLayouts(t){return[...h(t,l,\"f\").values()]}static setInitialSnapshot(t,e){h(t,c,\"f\").setInitialSnapshot(e)}static createClosedConstructor(...t){return class extends f{constructor(){super(...t)}}}}m=i.DefaultLayoutManager=f,s=f,c=new WeakMap,l=new WeakMap,u=function(t,e){const o=h(t,l,\"f\").get(e);if(!o)throw new Error(`[layout-manager] getLayoutByName: Could not locate layout with name '${e}'`);return o};var p={};Object.defineProperty(p,\"__esModule\",{value:!0});var w=p.BaseLayout=void 0;w=p.BaseLayout=class{};var v={};Object.defineProperty(v,\"__esModule\",{value:!0});var b=v.DOMEmitter=void 0;b=v.DOMEmitter=class{constructor(t){this.container=t}dispatchLocalEvent(t,e){const o={...e,type:t,tabSelector:`tab-${e.name}`,containerSelector:`container-${e.name}`,topic:\"openfin-DOM-event\"};this.container.dispatchEvent(new CustomEvent(t,{detail:o}))}};var g={};Object.defineProperty(g,\"__esModule\",{value:!0});var L=g.isVisible=void 0;L=g.isVisible=t=>(0!==t.offsetWidth||0!==t.offsetHeight)&&\"hidden\"!==window.getComputedStyle(t).visibility&&t.offsetTop>=0&&t.offsetLeft>=0&&t.offsetTop<=window.innerHeight&&t.offsetLeft<=window.innerWidth;const E={show:\"top\",popout:!1,maximise:!1,close:!1},_={headerHeight:31},C={hasHeaders:!0},M={reorderEnabled:!1,popoutWholeStack:!1,constrainDragToContainer:!1,constrainDragToHeaders:!1,preventDragout:!1,showMaximiseIcon:!1,showPopoutIcon:!1,showCloseIcon:!1,blockedPopoutsThrowError:!0,closePopoutsOnUnload:!0,selectionEnabled:!1};function A(t=[],e){for(const o of t)\"component\"===o.type?Object.keys(e).forEach((t=>o[t]=e[t])):A(o.content,e)}const P=e=>class extends e{connectedCallback(){if(!this.name||!this.uuid)throw new Error(\" Name or uuid attribute missing\");if(!this.src)throw new Error(\" missing 'src' attribute.\");this.#t||(this.#t=document.createElement(\"iframe\"),this.#t.src=this.src,this.#t.style.height=\"100%\",this.#t.style.width=\"100%\",this.#t.style.border=\"none\",this.forceFrameName?this.#t.setAttribute(\"name\",this.forceFrameName):this.#t.setAttribute(\"name\",t.encodeOptions({brokerUrl:this.brokerUrl,name:this.name,uuid:this.uuid,providerId:this.providerId,contextGroup:this.contextGroup},\"of-frame\")),this.#t.setAttribute(\"id\",this.name),this.appendChild(this.#t))}#t;get brokerUrl(){return this.getAttribute(\"of-broker\")}set brokerUrl(t){t&&this.setAttribute(\"of-broker\",t)}get name(){return this.getAttribute(\"of-name\")}set name(t){t&&this.setAttribute(\"of-name\",t)}get forceFrameName(){return this.getAttribute(\"forceFrameName\")}set forceFrameName(t){t&&this.setAttribute(\"forceFrameName\",t)}get uuid(){return this.getAttribute(\"of-uuid\")}set uuid(t){t&&this.setAttribute(\"of-uuid\",t)}get src(){return this.getAttribute(\"src\")}set src(t){t&&this.setAttribute(\"src\",t)}get providerId(){return this.getAttribute(\"of-provider-id\")}set providerId(t){t&&this.setAttribute(\"of-provider-id\",t)}get contextGroup(){return this.getAttribute(\"of-context-group\")}set contextGroup(t){t&&this.setAttribute(\"of-context-group\",t)}static get observedAttributes(){return[\"name\"]}};class N{static create(t){const e=document.createElement(\"of-view\");return Object.entries(t).forEach((([t,o])=>{e.setAttribute(t,o)})),e}}customElements.define(\"of-view\",P(HTMLElement));class S{constructor(t,o,i,{brokerUrl:r,interopConfig:a}){this.container=t;const{url:n,web:s,name:c=e.v4(),interop:l}=o||{};if(this.container.element.setAttribute(\"of-name\",c),this.container.element.id=`container-${c}`,void 0===n)return void this.handleUrlMissing();const u=this.updateTitleIfNotSet(n),d={\"of-broker\":r,\"of-uuid\":i,\"of-name\":c,src:n};s?.frameName&&(d.forceFrameName=s.frameName);const h=l?.currentContextGroup??a?.currentContextGroup;h&&(d[\"of-context-group\"]=h),a?.providerId&&(d[\"of-provider-id\"]=a?.providerId);const m=N.create(d);m.title=u??`Iframe: ${n}`,this.container.element.appendChild(m)}updateTitleIfNotSet(t){return\"view\"===this.container.parent.title&&this.container.parent.setTitle(t),this.container.parent.title}handleUrlMissing(){const t=document.createElement(\"div\");t.setAttribute(\"style\",\"padding: 20px\");t.innerText=\"No URL provided\",this.container.element.appendChild(t)}}class F extends w{static overrideConfig(t){return A(t.content,{isClosable:!1}),{dimensions:_,...t,settings:{...C,...t.settings,...M},header:{...E,show:!1!==t.settings?.hasHeaders&&E.show}}}constructor(t,e,i,{options:r}){super(),this.identity=t,this.container=e,this.domEmitter=new b(e),this.layout=new o.GoldenLayout(this.container),this.layout.resizeWithContainerAutomatically=!0,this.layout.registerComponent(\"view\",((e,o)=>new S(e,o,t.uuid,r))),this.setupListeners(),this.layout.loadLayout(F.overrideConfig(i))}addView(t){throw new Error(\"Method not implemented.\")}replaceView({viewToReplace:t,newView:e}){throw new Error(\"Method not implemented.\")}replaceLayout(t){throw new Error(\"Method not implemented.\")}closeView(t){throw new Error(\"Method not implemented.\")}applyPreset(t){throw new Error(\"Method not implemented.\")}getCurrentViews(){throw new Error(\"Method not implemented.\")}async getFrameSnapshot(){return function(t){if(t.root){t.root.content&&A(t.root.content,{componentName:\"view\"});const e=t.root;t.content=[e],delete t.root}return t}(o.LayoutConfig.fromResolved(this.layout.toConfig()))}isVisible(){return L(this.container)}async onViewDetached(){throw new Error(\"Method not implemented.\")}async destroy(){this.layout.destroy()}setupListeners(){this.layout.on(\"tabCreated\",(t=>{const o=t.componentItem.container.element.getAttribute(\"of-name\")??e.v4(),i={name:o,uuid:o};t.element.id=`tab-${o}`,this.domEmitter.dispatchLocalEvent(\"tab-created\",i)})),this.layout.on(\"itemCreated\",(({target:t})=>{const o=t;if(!o.isComponent)return;const i=o.element.querySelector(\"[of-name]\")?.getAttribute(\"of-name\")??e.v4(),r={name:i,uuid:i};this.domEmitter.dispatchLocalEvent(\"container-created\",r),setTimeout((()=>{document.querySelectorAll(\".lm_splitter\").forEach((t=>{t.style.pointerEvents=\"none\"}))}),1)}))}}class k{constructor(t,e,o){this.windowIdentity=t,this.connectConfig=e,this.fallbackContainer=o}async createLayout(t,e){if(!(\"container\"in t)&&!this.fallbackContainer)throw new Error(\"Container property is not optional in web\");const{layout:o,layoutName:i}=t,r=t.container??this.fallbackContainer,a={...this.windowIdentity,layoutName:i},n=new F(a,r,o,this.connectConfig);m.registerLayout(e,i,n),this.fallbackContainer=null}async getLayoutSnapshot(t){return t.getLayoutSnapshot()}async handleLastViewRemoved(t){throw new Error(\"Method not implemented.\")}}var V,G,I,j,x;const T=t=>t;class O{constructor(o){V.add(this),G.set(this,void 0),I.set(this,void 0),j.set(this,void 0),this.init=async({container:e,layoutManagerOverride:o})=>{const i=o??T,r=new k(t.__classPrivateFieldGet(this,j,\"f\"),t.__classPrivateFieldGet(this,G,\"f\"),e);t.__classPrivateFieldSet(this,I,new(i(m.createClosedConstructor(r))),\"f\"),await t.__classPrivateFieldGet(this,I,\"f\").applyLayoutSnapshot(t.__classPrivateFieldGet(this,G,\"f\").platform.layoutSnapshot)},this.getCurrentLayoutManagerSync=()=>(t.__classPrivateFieldGet(this,V,\"m\",x).call(this),t.__classPrivateFieldGet(this,I,\"f\")),this.create=async e=>(t.__classPrivateFieldGet(this,V,\"m\",x).call(this),m.createLayout(t.__classPrivateFieldGet(this,I,\"f\"),e)),this.destroy=async e=>(t.__classPrivateFieldGet(this,V,\"m\",x).call(this),m.destroyLayout(t.__classPrivateFieldGet(this,I,\"f\"),e)),t.__classPrivateFieldSet(this,G,o,\"f\");const i=e.v4();t.__classPrivateFieldSet(this,j,{name:i,uuid:i},\"f\")}}G=new WeakMap,I=new WeakMap,j=new WeakMap,V=new WeakSet,x=function(){if(!t.__classPrivateFieldGet(this,I,\"f\"))throw new Error(\"You must call init before using this API\")};exports.createWebLayoutModule=t=>new O(t);\n","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nconst base64 = require('base64-js')\nconst ieee754 = require('ieee754')\nconst customInspectSymbol =\n (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation\n ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation\n : null\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\nconst K_MAX_LENGTH = 0x7fffffff\nexports.kMaxLength = K_MAX_LENGTH\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Print warning and recommend using `buffer` v4.x which has an Object\n * implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * We report that the browser does not support typed arrays if the are not subclassable\n * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array`\n * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support\n * for __proto__ and has a buggy typed array implementation.\n */\nBuffer.TYPED_ARRAY_SUPPORT = typedArraySupport()\n\nif (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' &&\n typeof console.error === 'function') {\n console.error(\n 'This browser lacks typed array (Uint8Array) support which is required by ' +\n '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'\n )\n}\n\nfunction typedArraySupport () {\n // Can typed array instances can be augmented?\n try {\n const arr = new Uint8Array(1)\n const proto = { foo: function () { return 42 } }\n Object.setPrototypeOf(proto, Uint8Array.prototype)\n Object.setPrototypeOf(arr, proto)\n return arr.foo() === 42\n } catch (e) {\n return false\n }\n}\n\nObject.defineProperty(Buffer.prototype, 'parent', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.buffer\n }\n})\n\nObject.defineProperty(Buffer.prototype, 'offset', {\n enumerable: true,\n get: function () {\n if (!Buffer.isBuffer(this)) return undefined\n return this.byteOffset\n }\n})\n\nfunction createBuffer (length) {\n if (length > K_MAX_LENGTH) {\n throw new RangeError('The value \"' + length + '\" is invalid for option \"size\"')\n }\n // Return an augmented `Uint8Array` instance\n const buf = new Uint8Array(length)\n Object.setPrototypeOf(buf, Buffer.prototype)\n return buf\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new TypeError(\n 'The \"string\" argument must be of type string. Received type number'\n )\n }\n return allocUnsafe(arg)\n }\n return from(arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\nfunction from (value, encodingOrOffset, length) {\n if (typeof value === 'string') {\n return fromString(value, encodingOrOffset)\n }\n\n if (ArrayBuffer.isView(value)) {\n return fromArrayView(value)\n }\n\n if (value == null) {\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n }\n\n if (isInstance(value, ArrayBuffer) ||\n (value && isInstance(value.buffer, ArrayBuffer))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof SharedArrayBuffer !== 'undefined' &&\n (isInstance(value, SharedArrayBuffer) ||\n (value && isInstance(value.buffer, SharedArrayBuffer)))) {\n return fromArrayBuffer(value, encodingOrOffset, length)\n }\n\n if (typeof value === 'number') {\n throw new TypeError(\n 'The \"value\" argument must not be of type number. Received type number'\n )\n }\n\n const valueOf = value.valueOf && value.valueOf()\n if (valueOf != null && valueOf !== value) {\n return Buffer.from(valueOf, encodingOrOffset, length)\n }\n\n const b = fromObject(value)\n if (b) return b\n\n if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null &&\n typeof value[Symbol.toPrimitive] === 'function') {\n return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length)\n }\n\n throw new TypeError(\n 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' +\n 'or Array-like Object. Received type ' + (typeof value)\n )\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(value, encodingOrOffset, length)\n}\n\n// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug:\n// https://github.com/feross/buffer/pull/148\nObject.setPrototypeOf(Buffer.prototype, Uint8Array.prototype)\nObject.setPrototypeOf(Buffer, Uint8Array)\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be of type number')\n } else if (size < 0) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n}\n\nfunction alloc (size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpreted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(size).fill(fill, encoding)\n : createBuffer(size).fill(fill)\n }\n return createBuffer(size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(size, fill, encoding)\n}\n\nfunction allocUnsafe (size) {\n assertSize(size)\n return createBuffer(size < 0 ? 0 : checked(size) | 0)\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(size)\n}\n\nfunction fromString (string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n\n const length = byteLength(string, encoding) | 0\n let buf = createBuffer(length)\n\n const actual = buf.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n buf = buf.slice(0, actual)\n }\n\n return buf\n}\n\nfunction fromArrayLike (array) {\n const length = array.length < 0 ? 0 : checked(array.length) | 0\n const buf = createBuffer(length)\n for (let i = 0; i < length; i += 1) {\n buf[i] = array[i] & 255\n }\n return buf\n}\n\nfunction fromArrayView (arrayView) {\n if (isInstance(arrayView, Uint8Array)) {\n const copy = new Uint8Array(arrayView)\n return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength)\n }\n return fromArrayLike(arrayView)\n}\n\nfunction fromArrayBuffer (array, byteOffset, length) {\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\"offset\" is outside of buffer bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\"length\" is outside of buffer bounds')\n }\n\n let buf\n if (byteOffset === undefined && length === undefined) {\n buf = new Uint8Array(array)\n } else if (length === undefined) {\n buf = new Uint8Array(array, byteOffset)\n } else {\n buf = new Uint8Array(array, byteOffset, length)\n }\n\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(buf, Buffer.prototype)\n\n return buf\n}\n\nfunction fromObject (obj) {\n if (Buffer.isBuffer(obj)) {\n const len = checked(obj.length) | 0\n const buf = createBuffer(len)\n\n if (buf.length === 0) {\n return buf\n }\n\n obj.copy(buf, 0, 0, len)\n return buf\n }\n\n if (obj.length !== undefined) {\n if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) {\n return createBuffer(0)\n }\n return fromArrayLike(obj)\n }\n\n if (obj.type === 'Buffer' && Array.isArray(obj.data)) {\n return fromArrayLike(obj.data)\n }\n}\n\nfunction checked (length) {\n // Note: cannot use `length < K_MAX_LENGTH` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= K_MAX_LENGTH) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return b != null && b._isBuffer === true &&\n b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false\n}\n\nBuffer.compare = function compare (a, b) {\n if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength)\n if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength)\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError(\n 'The \"buf1\", \"buf2\" arguments must be one of type Buffer or Uint8Array'\n )\n }\n\n if (a === b) return 0\n\n let x = a.length\n let y = b.length\n\n for (let i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!Array.isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n let i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n const buffer = Buffer.allocUnsafe(length)\n let pos = 0\n for (i = 0; i < list.length; ++i) {\n let buf = list[i]\n if (isInstance(buf, Uint8Array)) {\n if (pos + buf.length > buffer.length) {\n if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf)\n buf.copy(buffer, pos)\n } else {\n Uint8Array.prototype.set.call(\n buffer,\n buf,\n pos\n )\n }\n } else if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n } else {\n buf.copy(buffer, pos)\n }\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n throw new TypeError(\n 'The \"string\" argument must be one of type string, Buffer, or ArrayBuffer. ' +\n 'Received type ' + typeof string\n )\n }\n\n const len = string.length\n const mustMatch = (arguments.length > 2 && arguments[2] === true)\n if (!mustMatch && len === 0) return 0\n\n // Use a for loop to avoid recursion\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) {\n return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8\n }\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n let loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coercion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package)\n// to detect a Buffer instance. It's not possible to use `instanceof Buffer`\n// reliably in a browserify context because there could be multiple different\n// copies of the 'buffer' package in use. This method works even for Buffer\n// instances that were created from another copy of the `buffer` package.\n// See: https://github.com/feross/buffer/issues/154\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n const i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n const len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (let i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n const len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (let i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n const len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (let i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n const length = this.length\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.toLocaleString = Buffer.prototype.toString\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n let str = ''\n const max = exports.INSPECT_MAX_BYTES\n str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim()\n if (this.length > max) str += ' ... '\n return ''\n}\nif (customInspectSymbol) {\n Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (isInstance(target, Uint8Array)) {\n target = Buffer.from(target, target.offset, target.byteLength)\n }\n if (!Buffer.isBuffer(target)) {\n throw new TypeError(\n 'The \"target\" argument must be one of type Buffer or Uint8Array. ' +\n 'Received type ' + (typeof target)\n )\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n let x = thisEnd - thisStart\n let y = end - start\n const len = Math.min(x, y)\n\n const thisCopy = this.slice(thisStart, thisEnd)\n const targetCopy = target.slice(start, end)\n\n for (let i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (numberIsNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n let indexSize = 1\n let arrLength = arr.length\n let valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n let i\n if (dir) {\n let foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n let found = true\n for (let j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n const remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n const strLen = string.length\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n let i\n for (i = 0; i < length; ++i) {\n const parsed = parseInt(string.substr(i * 2, 2), 16)\n if (numberIsNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset >>> 0\n if (isFinite(length)) {\n length = length >>> 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n const remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n let loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n case 'latin1':\n case 'binary':\n return asciiWrite(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n const res = []\n\n let i = start\n while (i < end) {\n const firstByte = buf[i]\n let codePoint = null\n let bytesPerSequence = (firstByte > 0xEF)\n ? 4\n : (firstByte > 0xDF)\n ? 3\n : (firstByte > 0xBF)\n ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n let secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nconst MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n const len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n let res = ''\n let i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n let ret = ''\n end = Math.min(buf.length, end)\n\n for (let i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n const len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n let out = ''\n for (let i = start; i < end; ++i) {\n out += hexSliceLookupTable[buf[i]]\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n const bytes = buf.slice(start, end)\n let res = ''\n // If bytes.length is odd, the last 8 bits must be ignored (same as node.js)\n for (let i = 0; i < bytes.length - 1; i += 2) {\n res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256))\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n const len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n const newBuf = this.subarray(start, end)\n // Return an augmented `Uint8Array` instance\n Object.setPrototypeOf(newBuf, Buffer.prototype)\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUintLE =\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUintBE =\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n let val = this[offset + --byteLength]\n let mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUint8 =\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUint16LE =\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUint16BE =\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUint32LE =\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUint32BE =\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const lo = first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24\n\n const hi = this[++offset] +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n last * 2 ** 24\n\n return BigInt(lo) + (BigInt(hi) << BigInt(32))\n})\n\nBuffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const hi = first * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n const lo = this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last\n\n return (BigInt(hi) << BigInt(32)) + BigInt(lo)\n})\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let val = this[offset]\n let mul = 1\n let i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n let i = byteLength\n let mul = 1\n let val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 2, this.length)\n const val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = this[offset + 4] +\n this[offset + 5] * 2 ** 8 +\n this[offset + 6] * 2 ** 16 +\n (last << 24) // Overflow\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(first +\n this[++offset] * 2 ** 8 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 24)\n})\n\nBuffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) {\n offset = offset >>> 0\n validateNumber(offset, 'offset')\n const first = this[offset]\n const last = this[offset + 7]\n if (first === undefined || last === undefined) {\n boundsError(offset, this.length - 8)\n }\n\n const val = (first << 24) + // Overflow\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n this[++offset]\n\n return (BigInt(val) << BigInt(32)) +\n BigInt(this[++offset] * 2 ** 24 +\n this[++offset] * 2 ** 16 +\n this[++offset] * 2 ** 8 +\n last)\n})\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n offset = offset >>> 0\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUintLE =\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let mul = 1\n let i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUintBE =\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n byteLength = byteLength >>> 0\n if (!noAssert) {\n const maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n let i = byteLength - 1\n let mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUint8 =\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeUint16LE =\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeUint16BE =\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeUint32LE =\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeUint32BE =\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nfunction wrtBigUInt64LE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n lo = lo >> 8\n buf[offset++] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n hi = hi >> 8\n buf[offset++] = hi\n return offset\n}\n\nfunction wrtBigUInt64BE (buf, value, offset, min, max) {\n checkIntBI(value, min, max, buf, offset, 7)\n\n let lo = Number(value & BigInt(0xffffffff))\n buf[offset + 7] = lo\n lo = lo >> 8\n buf[offset + 6] = lo\n lo = lo >> 8\n buf[offset + 5] = lo\n lo = lo >> 8\n buf[offset + 4] = lo\n let hi = Number(value >> BigInt(32) & BigInt(0xffffffff))\n buf[offset + 3] = hi\n hi = hi >> 8\n buf[offset + 2] = hi\n hi = hi >> 8\n buf[offset + 1] = hi\n hi = hi >> 8\n buf[offset] = hi\n return offset + 8\n}\n\nBuffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff'))\n})\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = 0\n let mul = 1\n let sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n const limit = Math.pow(2, (8 * byteLength) - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n let i = byteLength - 1\n let mul = 1\n let sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n return offset + 4\n}\n\nBuffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) {\n return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nBuffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) {\n return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff'))\n})\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n value = +value\n offset = offset >>> 0\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('Index out of range')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n const len = end - start\n\n if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') {\n // Use built-in when available, missing from IE11\n this.copyWithin(targetStart, start, end)\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, end),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n if (val.length === 1) {\n const code = val.charCodeAt(0)\n if ((encoding === 'utf8' && code < 128) ||\n encoding === 'latin1') {\n // Fast path: If `val` fits into a single byte, use that numeric value.\n val = code\n }\n }\n } else if (typeof val === 'number') {\n val = val & 255\n } else if (typeof val === 'boolean') {\n val = Number(val)\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n let i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n const bytes = Buffer.isBuffer(val)\n ? val\n : Buffer.from(val, encoding)\n const len = bytes.length\n if (len === 0) {\n throw new TypeError('The value \"' + val +\n '\" is invalid for argument \"value\"')\n }\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// CUSTOM ERRORS\n// =============\n\n// Simplified versions from Node, changed for Buffer-only usage\nconst errors = {}\nfunction E (sym, getMessage, Base) {\n errors[sym] = class NodeError extends Base {\n constructor () {\n super()\n\n Object.defineProperty(this, 'message', {\n value: getMessage.apply(this, arguments),\n writable: true,\n configurable: true\n })\n\n // Add the error code to the name to include it in the stack trace.\n this.name = `${this.name} [${sym}]`\n // Access the stack to generate the error message including the error code\n // from the name.\n this.stack // eslint-disable-line no-unused-expressions\n // Reset the name to the actual name.\n delete this.name\n }\n\n get code () {\n return sym\n }\n\n set code (value) {\n Object.defineProperty(this, 'code', {\n configurable: true,\n enumerable: true,\n value,\n writable: true\n })\n }\n\n toString () {\n return `${this.name} [${sym}]: ${this.message}`\n }\n }\n}\n\nE('ERR_BUFFER_OUT_OF_BOUNDS',\n function (name) {\n if (name) {\n return `${name} is outside of buffer bounds`\n }\n\n return 'Attempt to access memory outside buffer bounds'\n }, RangeError)\nE('ERR_INVALID_ARG_TYPE',\n function (name, actual) {\n return `The \"${name}\" argument must be of type number. Received type ${typeof actual}`\n }, TypeError)\nE('ERR_OUT_OF_RANGE',\n function (str, range, input) {\n let msg = `The value of \"${str}\" is out of range.`\n let received = input\n if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) {\n received = addNumericalSeparator(String(input))\n } else if (typeof input === 'bigint') {\n received = String(input)\n if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) {\n received = addNumericalSeparator(received)\n }\n received += 'n'\n }\n msg += ` It must be ${range}. Received ${received}`\n return msg\n }, RangeError)\n\nfunction addNumericalSeparator (val) {\n let res = ''\n let i = val.length\n const start = val[0] === '-' ? 1 : 0\n for (; i >= start + 4; i -= 3) {\n res = `_${val.slice(i - 3, i)}${res}`\n }\n return `${val.slice(0, i)}${res}`\n}\n\n// CHECK FUNCTIONS\n// ===============\n\nfunction checkBounds (buf, offset, byteLength) {\n validateNumber(offset, 'offset')\n if (buf[offset] === undefined || buf[offset + byteLength] === undefined) {\n boundsError(offset, buf.length - (byteLength + 1))\n }\n}\n\nfunction checkIntBI (value, min, max, buf, offset, byteLength) {\n if (value > max || value < min) {\n const n = typeof min === 'bigint' ? 'n' : ''\n let range\n if (byteLength > 3) {\n if (min === 0 || min === BigInt(0)) {\n range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}`\n } else {\n range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` +\n `${(byteLength + 1) * 8 - 1}${n}`\n }\n } else {\n range = `>= ${min}${n} and <= ${max}${n}`\n }\n throw new errors.ERR_OUT_OF_RANGE('value', range, value)\n }\n checkBounds(buf, offset, byteLength)\n}\n\nfunction validateNumber (value, name) {\n if (typeof value !== 'number') {\n throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value)\n }\n}\n\nfunction boundsError (value, length, type) {\n if (Math.floor(value) !== value) {\n validateNumber(value, type)\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value)\n }\n\n if (length < 0) {\n throw new errors.ERR_BUFFER_OUT_OF_BOUNDS()\n }\n\n throw new errors.ERR_OUT_OF_RANGE(type || 'offset',\n `>= ${type ? 1 : 0} and <= ${length}`,\n value)\n}\n\n// HELPER FUNCTIONS\n// ================\n\nconst INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node takes equal signs as end of the Base64 encoding\n str = str.split('=')[0]\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = str.trim().replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n let codePoint\n const length = string.length\n let leadSurrogate = null\n const bytes = []\n\n for (let i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n let c, hi, lo\n const byteArray = []\n for (let i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n let i\n for (i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\n// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass\n// the `instanceof` check but they should be treated as of that type.\n// See: https://github.com/feross/buffer/issues/166\nfunction isInstance (obj, type) {\n return obj instanceof type ||\n (obj != null && obj.constructor != null && obj.constructor.name != null &&\n obj.constructor.name === type.name)\n}\nfunction numberIsNaN (obj) {\n // For IE11 support\n return obj !== obj // eslint-disable-line no-self-compare\n}\n\n// Create lookup table for `toString('hex')`\n// See: https://github.com/feross/buffer/issues/219\nconst hexSliceLookupTable = (function () {\n const alphabet = '0123456789abcdef'\n const table = new Array(256)\n for (let i = 0; i < 16; ++i) {\n const i16 = i * 16\n for (let j = 0; j < 16; ++j) {\n table[i16 + j] = alphabet[i] + alphabet[j]\n }\n }\n return table\n})()\n\n// Return not function with Error if BigInt not supported\nfunction defineBigIntMethod (fn) {\n return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn\n}\n\nfunction BufferBigIntNotDefined () {\n throw new Error('BigInt not supported')\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function errorListener(err) {\n emitter.removeListener(name, resolver);\n reject(err);\n }\n\n function resolver() {\n if (typeof emitter.removeListener === 'function') {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n\n eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });\n if (name !== 'error') {\n addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });\n }\n });\n}\n\nfunction addErrorHandlerIfEventEmitter(emitter, handler, flags) {\n if (typeof emitter.on === 'function') {\n eventTargetAgnosticAddListener(emitter, 'error', handler, flags);\n }\n}\n\nfunction eventTargetAgnosticAddListener(emitter, name, listener, flags) {\n if (typeof emitter.on === 'function') {\n if (flags.once) {\n emitter.once(name, listener);\n } else {\n emitter.on(name, listener);\n }\n } else if (typeof emitter.addEventListener === 'function') {\n // EventTarget does not have `error` event semantics like Node\n // EventEmitters, we do not listen for `error` events here.\n emitter.addEventListener(name, function wrapListener(arg) {\n // IE does not have builtin `{ once: true }` support so we\n // have to do it manually.\n if (flags.once) {\n emitter.removeEventListener(name, wrapListener);\n }\n listener(arg);\n });\n } else {\n throw new TypeError('The \"emitter\" argument must be of type EventEmitter. Received type ' + typeof emitter);\n }\n}\n","export * from './ts/config/config';\nexport * from './ts/config/resolved-config';\nexport { ComponentContainer } from './ts/container/component-container';\nexport { BrowserPopout } from './ts/controls/browser-popout';\nexport { DragSource } from './ts/controls/drag-source';\nexport { Header } from './ts/controls/header';\nexport { Tab } from './ts/controls/tab';\nexport * from './ts/errors/external-error';\nexport { GoldenLayout } from './ts/golden-layout';\nexport { ComponentItem } from './ts/items/component-item';\nexport { ContentItem } from './ts/items/content-item';\nexport { RowOrColumn } from './ts/items/row-or-column';\nexport { Stack } from './ts/items/stack';\nexport { LayoutManager } from './ts/layout-manager';\nexport { EventEmitter } from './ts/utils/event-emitter';\nexport { EventHub } from './ts/utils/event-hub';\nexport * from './ts/utils/i18n-strings';\nexport { StyleConstants } from './ts/utils/style-constants';\nexport * from './ts/utils/types';\nexport { VirtualLayout } from './ts/virtual-layout';\n//# sourceMappingURL=index.js.map","import { ConfigurationError } from '../errors/external-error';\nimport { AssertError, UnexpectedUndefinedError, UnreachableCaseError } from '../errors/internal-error';\nimport { i18nStrings } from '../utils/i18n-strings';\nimport { ItemType, SizeUnitEnum } from '../utils/types';\nimport { deepExtendValue, splitStringAtFirstNonNumericChar } from '../utils/utils';\nimport { ResolvedComponentItemConfig, ResolvedHeaderedItemConfig, ResolvedItemConfig, ResolvedLayoutConfig, ResolvedPopoutLayoutConfig, ResolvedRootItemConfig, ResolvedRowOrColumnItemConfig, ResolvedStackItemConfig } from \"./resolved-config\";\n/** @public */\nexport var ItemConfig;\n(function (ItemConfig) {\n /** @internal */\n function resolve(itemConfig, rowAndColumnChildLegacySizeDefault) {\n switch (itemConfig.type) {\n case ItemType.ground:\n throw new ConfigurationError('ItemConfig cannot specify type ground', JSON.stringify(itemConfig));\n case ItemType.row:\n case ItemType.column:\n return RowOrColumnItemConfig.resolve(itemConfig, rowAndColumnChildLegacySizeDefault);\n case ItemType.stack:\n return StackItemConfig.resolve(itemConfig, rowAndColumnChildLegacySizeDefault);\n case ItemType.component:\n return ComponentItemConfig.resolve(itemConfig, rowAndColumnChildLegacySizeDefault);\n default:\n throw new UnreachableCaseError('UCUICR55499', itemConfig.type);\n }\n }\n ItemConfig.resolve = resolve;\n /** @internal */\n function resolveContent(content) {\n if (content === undefined) {\n return [];\n }\n else {\n const count = content.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ItemConfig.resolve(content[i], false);\n }\n return result;\n }\n }\n ItemConfig.resolveContent = resolveContent;\n /** @internal */\n function resolveId(id) {\n if (id === undefined) {\n return ResolvedItemConfig.defaults.id;\n }\n else {\n if (Array.isArray(id)) {\n if (id.length === 0) {\n return ResolvedItemConfig.defaults.id;\n }\n else {\n return id[0];\n }\n }\n else {\n return id;\n }\n }\n }\n ItemConfig.resolveId = resolveId;\n /** @internal */\n function resolveSize(size, width, height, rowAndColumnChildLegacySizeDefault) {\n // Remove support for rowAndColumnChildLegacySizeDefault in a major version release\n if (size !== undefined) {\n return parseSize(size, [SizeUnitEnum.Percent, SizeUnitEnum.Fractional]);\n }\n else {\n if (width !== undefined || height !== undefined) {\n if (width !== undefined) {\n return { size: width, sizeUnit: SizeUnitEnum.Percent };\n }\n else {\n if (height !== undefined) {\n return { size: height, sizeUnit: SizeUnitEnum.Percent };\n }\n else {\n throw new UnexpectedUndefinedError('CRS33390');\n }\n }\n }\n else {\n if (rowAndColumnChildLegacySizeDefault) {\n return { size: 50, sizeUnit: SizeUnitEnum.Percent };\n }\n else {\n return { size: ResolvedItemConfig.defaults.size, sizeUnit: ResolvedItemConfig.defaults.sizeUnit };\n }\n }\n }\n }\n ItemConfig.resolveSize = resolveSize;\n /** @internal */\n function resolveMinSize(minSize, minWidth, minHeight) {\n if (minSize !== undefined) {\n return parseSize(minSize, [SizeUnitEnum.Pixel]);\n }\n else {\n const minWidthDefined = minWidth !== undefined;\n const minHeightDefined = minHeight !== undefined;\n if (minWidthDefined || minHeightDefined) {\n if (minWidthDefined) {\n return { size: minWidth, sizeUnit: SizeUnitEnum.Pixel };\n }\n else {\n return { size: minHeight, sizeUnit: SizeUnitEnum.Pixel };\n }\n }\n else {\n return { size: ResolvedItemConfig.defaults.minSize, sizeUnit: ResolvedItemConfig.defaults.minSizeUnit };\n }\n }\n }\n ItemConfig.resolveMinSize = resolveMinSize;\n /** @internal */\n function calculateSizeWidthHeightSpecificationType(config) {\n if (config.size !== undefined) {\n return 1 /* Size */;\n }\n else {\n if (config.width !== undefined || config.height !== undefined) {\n return 2 /* WidthOrHeight */;\n }\n else {\n return 0 /* None */;\n }\n }\n }\n ItemConfig.calculateSizeWidthHeightSpecificationType = calculateSizeWidthHeightSpecificationType;\n function isGround(config) {\n return config.type === ItemType.ground;\n }\n ItemConfig.isGround = isGround;\n function isRow(config) {\n return config.type === ItemType.row;\n }\n ItemConfig.isRow = isRow;\n function isColumn(config) {\n return config.type === ItemType.column;\n }\n ItemConfig.isColumn = isColumn;\n function isStack(config) {\n return config.type === ItemType.stack;\n }\n ItemConfig.isStack = isStack;\n function isComponent(config) {\n return config.type === ItemType.component;\n }\n ItemConfig.isComponent = isComponent;\n})(ItemConfig || (ItemConfig = {}));\n/** @public */\nexport var HeaderedItemConfig;\n(function (HeaderedItemConfig) {\n const legacyMaximisedId = '__glMaximised';\n let Header;\n (function (Header) {\n function resolve(header, hasHeaders) {\n var _a;\n if (header === undefined && hasHeaders === undefined) {\n return undefined;\n }\n else {\n const result = {\n show: (_a = header === null || header === void 0 ? void 0 : header.show) !== null && _a !== void 0 ? _a : (hasHeaders === undefined ? undefined : hasHeaders ? ResolvedLayoutConfig.Header.defaults.show : false),\n popout: header === null || header === void 0 ? void 0 : header.popout,\n maximise: header === null || header === void 0 ? void 0 : header.maximise,\n close: header === null || header === void 0 ? void 0 : header.close,\n minimise: header === null || header === void 0 ? void 0 : header.minimise,\n tabDropdown: header === null || header === void 0 ? void 0 : header.tabDropdown,\n };\n return result;\n }\n }\n Header.resolve = resolve;\n })(Header = HeaderedItemConfig.Header || (HeaderedItemConfig.Header = {}));\n /** @internal */\n function resolveIdAndMaximised(config) {\n let id;\n // To support legacy configs with Id saved as an array of string, assign config.id to a type which includes string array\n let legacyId = config.id;\n let legacyMaximised = false;\n if (legacyId === undefined) {\n id = ResolvedItemConfig.defaults.id;\n }\n else {\n if (Array.isArray(legacyId)) {\n const idx = legacyId.findIndex((id) => id === legacyMaximisedId);\n if (idx > 0) {\n legacyMaximised = true;\n legacyId = legacyId.splice(idx, 1);\n }\n if (legacyId.length > 0) {\n id = legacyId[0];\n }\n else {\n id = ResolvedItemConfig.defaults.id;\n }\n }\n else {\n id = legacyId;\n }\n }\n let maximised;\n if (config.maximised !== undefined) {\n maximised = config.maximised;\n }\n else {\n maximised = legacyMaximised;\n }\n return { id, maximised };\n }\n HeaderedItemConfig.resolveIdAndMaximised = resolveIdAndMaximised;\n})(HeaderedItemConfig || (HeaderedItemConfig = {}));\n/** @public */\nexport var StackItemConfig;\n(function (StackItemConfig) {\n /** @internal */\n function resolve(itemConfig, rowAndColumnChildLegacySizeDefault) {\n var _a, _b;\n const { id, maximised } = HeaderedItemConfig.resolveIdAndMaximised(itemConfig);\n const { size, sizeUnit } = ItemConfig.resolveSize(itemConfig.size, itemConfig.width, itemConfig.height, rowAndColumnChildLegacySizeDefault);\n const { size: minSize, sizeUnit: minSizeUnit } = ItemConfig.resolveMinSize(itemConfig.minSize, itemConfig.minWidth, itemConfig.minHeight);\n const result = {\n type: ItemType.stack,\n content: resolveContent(itemConfig.content),\n size,\n sizeUnit,\n minSize,\n minSizeUnit,\n id,\n maximised,\n isClosable: (_a = itemConfig.isClosable) !== null && _a !== void 0 ? _a : ResolvedItemConfig.defaults.isClosable,\n activeItemIndex: (_b = itemConfig.activeItemIndex) !== null && _b !== void 0 ? _b : ResolvedStackItemConfig.defaultActiveItemIndex,\n header: HeaderedItemConfig.Header.resolve(itemConfig.header, itemConfig.hasHeaders),\n };\n return result;\n }\n StackItemConfig.resolve = resolve;\n /** @internal */\n function fromResolved(resolvedConfig) {\n const result = {\n type: ItemType.stack,\n content: fromResolvedContent(resolvedConfig.content),\n size: formatSize(resolvedConfig.size, resolvedConfig.sizeUnit),\n minSize: formatUndefinableSize(resolvedConfig.minSize, resolvedConfig.minSizeUnit),\n id: resolvedConfig.id,\n maximised: resolvedConfig.maximised,\n isClosable: resolvedConfig.isClosable,\n activeItemIndex: resolvedConfig.activeItemIndex,\n header: ResolvedHeaderedItemConfig.Header.createCopy(resolvedConfig.header),\n };\n return result;\n }\n StackItemConfig.fromResolved = fromResolved;\n /** @internal */\n function resolveContent(content) {\n if (content === undefined) {\n return [];\n }\n else {\n const count = content.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const childItemConfig = content[i];\n const itemConfig = ItemConfig.resolve(childItemConfig, false);\n if (!ResolvedItemConfig.isComponentItem(itemConfig)) {\n throw new AssertError('UCUSICRC91114', JSON.stringify(itemConfig));\n }\n else {\n result[i] = itemConfig;\n }\n }\n return result;\n }\n }\n /** @internal */\n function fromResolvedContent(resolvedContent) {\n const count = resolvedContent.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const resolvedContentConfig = resolvedContent[i];\n result[i] = ComponentItemConfig.fromResolved(resolvedContentConfig);\n }\n return result;\n }\n})(StackItemConfig || (StackItemConfig = {}));\n/** @public */\nexport var ComponentItemConfig;\n(function (ComponentItemConfig) {\n /** @internal */\n function resolve(itemConfig, rowAndColumnChildLegacySizeDefault) {\n var _a, _b, _c;\n let componentType = itemConfig.componentType;\n if (componentType === undefined) {\n componentType = itemConfig.componentName;\n }\n if (componentType === undefined) {\n throw new Error('ComponentItemConfig.componentType is undefined');\n }\n else {\n const { id, maximised } = HeaderedItemConfig.resolveIdAndMaximised(itemConfig);\n let title;\n if (itemConfig.title === undefined || itemConfig.title === '') {\n title = ComponentItemConfig.componentTypeToTitle(componentType);\n }\n else {\n title = itemConfig.title;\n }\n const { size, sizeUnit } = ItemConfig.resolveSize(itemConfig.size, itemConfig.width, itemConfig.height, rowAndColumnChildLegacySizeDefault);\n const { size: minSize, sizeUnit: minSizeUnit } = ItemConfig.resolveMinSize(itemConfig.minSize, itemConfig.minWidth, itemConfig.minHeight);\n const result = {\n type: itemConfig.type,\n content: [],\n size,\n sizeUnit,\n minSize,\n minSizeUnit,\n id,\n maximised,\n isClosable: (_a = itemConfig.isClosable) !== null && _a !== void 0 ? _a : ResolvedItemConfig.defaults.isClosable,\n reorderEnabled: (_b = itemConfig.reorderEnabled) !== null && _b !== void 0 ? _b : ResolvedComponentItemConfig.defaultReorderEnabled,\n title,\n header: HeaderedItemConfig.Header.resolve(itemConfig.header, itemConfig.hasHeaders),\n componentType,\n componentState: (_c = itemConfig.componentState) !== null && _c !== void 0 ? _c : {},\n };\n return result;\n }\n }\n ComponentItemConfig.resolve = resolve;\n /** @internal */\n function fromResolved(resolvedConfig) {\n const result = {\n type: ItemType.component,\n size: formatSize(resolvedConfig.size, resolvedConfig.sizeUnit),\n minSize: formatUndefinableSize(resolvedConfig.minSize, resolvedConfig.minSizeUnit),\n id: resolvedConfig.id,\n maximised: resolvedConfig.maximised,\n isClosable: resolvedConfig.isClosable,\n reorderEnabled: resolvedConfig.reorderEnabled,\n title: resolvedConfig.title,\n header: ResolvedHeaderedItemConfig.Header.createCopy(resolvedConfig.header),\n componentType: resolvedConfig.componentType,\n componentState: deepExtendValue(undefined, resolvedConfig.componentState),\n };\n return result;\n }\n ComponentItemConfig.fromResolved = fromResolved;\n function componentTypeToTitle(componentType) {\n const componentTypeType = typeof componentType;\n switch (componentTypeType) {\n case 'string': return componentType;\n case 'number': return componentType.toString();\n case 'boolean': return componentType.toString();\n default: return '';\n }\n }\n ComponentItemConfig.componentTypeToTitle = componentTypeToTitle;\n})(ComponentItemConfig || (ComponentItemConfig = {}));\n/** @public */\nexport var RowOrColumnItemConfig;\n(function (RowOrColumnItemConfig) {\n function isChildItemConfig(itemConfig) {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('UROCOSPCICIC13687', itemConfig.type);\n }\n }\n RowOrColumnItemConfig.isChildItemConfig = isChildItemConfig;\n /** @internal */\n function resolve(itemConfig, rowAndColumnChildLegacySizeDefault) {\n var _a;\n const { size, sizeUnit } = ItemConfig.resolveSize(itemConfig.size, itemConfig.width, itemConfig.height, rowAndColumnChildLegacySizeDefault);\n const { size: minSize, sizeUnit: minSizeUnit } = ItemConfig.resolveMinSize(itemConfig.minSize, itemConfig.minWidth, itemConfig.minHeight);\n const result = {\n type: itemConfig.type,\n content: RowOrColumnItemConfig.resolveContent(itemConfig.content),\n size,\n sizeUnit,\n minSize,\n minSizeUnit,\n id: ItemConfig.resolveId(itemConfig.id),\n isClosable: (_a = itemConfig.isClosable) !== null && _a !== void 0 ? _a : ResolvedItemConfig.defaults.isClosable,\n };\n return result;\n }\n RowOrColumnItemConfig.resolve = resolve;\n /** @internal */\n function fromResolved(resolvedConfig) {\n const result = {\n type: resolvedConfig.type,\n content: fromResolvedContent(resolvedConfig.content),\n size: formatSize(resolvedConfig.size, resolvedConfig.sizeUnit),\n minSize: formatUndefinableSize(resolvedConfig.minSize, resolvedConfig.minSizeUnit),\n id: resolvedConfig.id,\n isClosable: resolvedConfig.isClosable,\n };\n return result;\n }\n RowOrColumnItemConfig.fromResolved = fromResolved;\n /** @internal */\n function resolveContent(content) {\n if (content === undefined) {\n return [];\n }\n else {\n const count = content.length;\n const childItemConfigs = new Array(count);\n let widthOrHeightSpecifiedAtLeastOnce = false;\n let sizeSpecifiedAtLeastOnce = false;\n for (let i = 0; i < count; i++) {\n const childItemConfig = content[i];\n if (!RowOrColumnItemConfig.isChildItemConfig(childItemConfig)) {\n throw new ConfigurationError('ItemConfig is not Row, Column or Stack', childItemConfig);\n }\n else {\n if (!sizeSpecifiedAtLeastOnce) {\n const sizeWidthHeightSpecificationType = ItemConfig.calculateSizeWidthHeightSpecificationType(childItemConfig);\n switch (sizeWidthHeightSpecificationType) {\n case 0 /* None */:\n break;\n case 2 /* WidthOrHeight */:\n widthOrHeightSpecifiedAtLeastOnce = true;\n break;\n case 1 /* Size */:\n sizeSpecifiedAtLeastOnce = true;\n break;\n default:\n throw new UnreachableCaseError('ROCICRC87556', sizeWidthHeightSpecificationType);\n }\n }\n childItemConfigs[i] = childItemConfig;\n }\n }\n let legacySizeDefault;\n if (sizeSpecifiedAtLeastOnce) {\n legacySizeDefault = false;\n }\n else {\n if (widthOrHeightSpecifiedAtLeastOnce) {\n legacySizeDefault = true;\n }\n else {\n legacySizeDefault = false;\n }\n }\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const childItemConfig = childItemConfigs[i];\n const resolvedChildItemConfig = ItemConfig.resolve(childItemConfig, legacySizeDefault);\n if (!ResolvedRowOrColumnItemConfig.isChildItemConfig(resolvedChildItemConfig)) {\n throw new AssertError('UROCOSPIC99512', JSON.stringify(resolvedChildItemConfig));\n }\n else {\n result[i] = resolvedChildItemConfig;\n }\n }\n return result;\n }\n }\n RowOrColumnItemConfig.resolveContent = resolveContent;\n /** @internal */\n function fromResolvedContent(resolvedContent) {\n const count = resolvedContent.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const resolvedContentConfig = resolvedContent[i];\n const type = resolvedContentConfig.type;\n let contentConfig;\n switch (type) {\n case ItemType.row:\n case ItemType.column:\n contentConfig = RowOrColumnItemConfig.fromResolved(resolvedContentConfig);\n break;\n case ItemType.stack:\n contentConfig = StackItemConfig.fromResolved(resolvedContentConfig);\n break;\n case ItemType.component:\n contentConfig = ComponentItemConfig.fromResolved(resolvedContentConfig);\n break;\n default:\n throw new UnreachableCaseError('ROCICFRC44797', type);\n }\n result[i] = contentConfig;\n }\n return result;\n }\n})(RowOrColumnItemConfig || (RowOrColumnItemConfig = {}));\n/** @public */\nexport var RootItemConfig;\n(function (RootItemConfig) {\n function isRootItemConfig(itemConfig) {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('URICIR23687', itemConfig.type);\n }\n }\n RootItemConfig.isRootItemConfig = isRootItemConfig;\n /** @internal */\n function resolve(itemConfig) {\n if (itemConfig === undefined) {\n return undefined;\n }\n else {\n const result = ItemConfig.resolve(itemConfig, false);\n if (!ResolvedRootItemConfig.isRootItemConfig(result)) {\n throw new ConfigurationError('ItemConfig is not Row, Column or Stack', JSON.stringify(itemConfig));\n }\n else {\n return result;\n }\n }\n }\n RootItemConfig.resolve = resolve;\n /** @internal */\n function fromResolvedOrUndefined(resolvedItemConfig) {\n if (resolvedItemConfig === undefined) {\n return undefined;\n }\n else {\n const type = resolvedItemConfig.type;\n switch (type) {\n case ItemType.row:\n case ItemType.column:\n return RowOrColumnItemConfig.fromResolved(resolvedItemConfig);\n case ItemType.stack:\n return StackItemConfig.fromResolved(resolvedItemConfig);\n case ItemType.component:\n return ComponentItemConfig.fromResolved(resolvedItemConfig);\n default:\n throw new UnreachableCaseError('RICFROU89921', type);\n }\n }\n }\n RootItemConfig.fromResolvedOrUndefined = fromResolvedOrUndefined;\n})(RootItemConfig || (RootItemConfig = {}));\n/** Use to specify LayoutConfig with defaults or deserialise a LayoutConfig.\n * Deserialisation will handle backwards compatibility.\n * Note that LayoutConfig should be used for serialisation (not LayoutConfig)\n * @public\n */\nexport var LayoutConfig;\n(function (LayoutConfig) {\n let Settings;\n (function (Settings) {\n function resolve(settings) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n const result = {\n constrainDragToContainer: (_a = settings === null || settings === void 0 ? void 0 : settings.constrainDragToContainer) !== null && _a !== void 0 ? _a : ResolvedLayoutConfig.Settings.defaults.constrainDragToContainer,\n reorderEnabled: (_b = settings === null || settings === void 0 ? void 0 : settings.reorderEnabled) !== null && _b !== void 0 ? _b : ResolvedLayoutConfig.Settings.defaults.reorderEnabled,\n popoutWholeStack: (_c = settings === null || settings === void 0 ? void 0 : settings.popoutWholeStack) !== null && _c !== void 0 ? _c : ResolvedLayoutConfig.Settings.defaults.popoutWholeStack,\n blockedPopoutsThrowError: (_d = settings === null || settings === void 0 ? void 0 : settings.blockedPopoutsThrowError) !== null && _d !== void 0 ? _d : ResolvedLayoutConfig.Settings.defaults.blockedPopoutsThrowError,\n closePopoutsOnUnload: (_e = settings === null || settings === void 0 ? void 0 : settings.closePopoutsOnUnload) !== null && _e !== void 0 ? _e : ResolvedLayoutConfig.Settings.defaults.closePopoutsOnUnload,\n responsiveMode: (_f = settings === null || settings === void 0 ? void 0 : settings.responsiveMode) !== null && _f !== void 0 ? _f : ResolvedLayoutConfig.Settings.defaults.responsiveMode,\n tabOverlapAllowance: (_g = settings === null || settings === void 0 ? void 0 : settings.tabOverlapAllowance) !== null && _g !== void 0 ? _g : ResolvedLayoutConfig.Settings.defaults.tabOverlapAllowance,\n reorderOnTabMenuClick: (_h = settings === null || settings === void 0 ? void 0 : settings.reorderOnTabMenuClick) !== null && _h !== void 0 ? _h : ResolvedLayoutConfig.Settings.defaults.reorderOnTabMenuClick,\n tabControlOffset: (_j = settings === null || settings === void 0 ? void 0 : settings.tabControlOffset) !== null && _j !== void 0 ? _j : ResolvedLayoutConfig.Settings.defaults.tabControlOffset,\n popInOnClose: (_k = settings === null || settings === void 0 ? void 0 : settings.popInOnClose) !== null && _k !== void 0 ? _k : ResolvedLayoutConfig.Settings.defaults.popInOnClose,\n };\n return result;\n }\n Settings.resolve = resolve;\n })(Settings = LayoutConfig.Settings || (LayoutConfig.Settings = {}));\n let Dimensions;\n (function (Dimensions) {\n /** @internal */\n function resolve(dimensions) {\n var _a, _b, _c, _d, _e;\n const { size: defaultMinItemHeight, sizeUnit: defaultMinItemHeightUnit } = Dimensions.resolveDefaultMinItemHeight(dimensions);\n const { size: defaultMinItemWidth, sizeUnit: defaultMinItemWidthUnit } = Dimensions.resolveDefaultMinItemWidth(dimensions);\n const result = {\n borderWidth: (_a = dimensions === null || dimensions === void 0 ? void 0 : dimensions.borderWidth) !== null && _a !== void 0 ? _a : ResolvedLayoutConfig.Dimensions.defaults.borderWidth,\n borderGrabWidth: (_b = dimensions === null || dimensions === void 0 ? void 0 : dimensions.borderGrabWidth) !== null && _b !== void 0 ? _b : ResolvedLayoutConfig.Dimensions.defaults.borderGrabWidth,\n defaultMinItemHeight,\n defaultMinItemHeightUnit,\n defaultMinItemWidth,\n defaultMinItemWidthUnit,\n headerHeight: (_c = dimensions === null || dimensions === void 0 ? void 0 : dimensions.headerHeight) !== null && _c !== void 0 ? _c : ResolvedLayoutConfig.Dimensions.defaults.headerHeight,\n dragProxyWidth: (_d = dimensions === null || dimensions === void 0 ? void 0 : dimensions.dragProxyWidth) !== null && _d !== void 0 ? _d : ResolvedLayoutConfig.Dimensions.defaults.dragProxyWidth,\n dragProxyHeight: (_e = dimensions === null || dimensions === void 0 ? void 0 : dimensions.dragProxyHeight) !== null && _e !== void 0 ? _e : ResolvedLayoutConfig.Dimensions.defaults.dragProxyHeight,\n };\n return result;\n }\n Dimensions.resolve = resolve;\n /** @internal */\n function fromResolved(resolvedDimensions) {\n const result = {\n borderWidth: resolvedDimensions.borderWidth,\n borderGrabWidth: resolvedDimensions.borderGrabWidth,\n defaultMinItemHeight: formatSize(resolvedDimensions.defaultMinItemHeight, resolvedDimensions.defaultMinItemHeightUnit),\n defaultMinItemWidth: formatSize(resolvedDimensions.defaultMinItemWidth, resolvedDimensions.defaultMinItemWidthUnit),\n headerHeight: resolvedDimensions.headerHeight,\n dragProxyWidth: resolvedDimensions.dragProxyWidth,\n dragProxyHeight: resolvedDimensions.dragProxyHeight,\n };\n return result;\n }\n Dimensions.fromResolved = fromResolved;\n /** @internal */\n function resolveDefaultMinItemHeight(dimensions) {\n const height = dimensions === null || dimensions === void 0 ? void 0 : dimensions.defaultMinItemHeight;\n if (height === undefined) {\n return { size: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemHeight, sizeUnit: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemHeightUnit };\n }\n else {\n return parseSize(height, [SizeUnitEnum.Pixel]);\n }\n }\n Dimensions.resolveDefaultMinItemHeight = resolveDefaultMinItemHeight;\n /** @internal */\n function resolveDefaultMinItemWidth(dimensions) {\n const width = dimensions === null || dimensions === void 0 ? void 0 : dimensions.defaultMinItemWidth;\n if (width === undefined) {\n return { size: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemWidth, sizeUnit: ResolvedLayoutConfig.Dimensions.defaults.defaultMinItemWidthUnit };\n }\n else {\n return parseSize(width, [SizeUnitEnum.Pixel]);\n }\n }\n Dimensions.resolveDefaultMinItemWidth = resolveDefaultMinItemWidth;\n })(Dimensions = LayoutConfig.Dimensions || (LayoutConfig.Dimensions = {}));\n let Header;\n (function (Header) {\n /** @internal */\n function resolve(header, settings, labels) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;\n let show;\n if ((header === null || header === void 0 ? void 0 : header.show) !== undefined) {\n show = header.show;\n }\n else {\n if (settings !== undefined && settings.hasHeaders !== undefined) {\n show = settings.hasHeaders ? ResolvedLayoutConfig.Header.defaults.show : false;\n }\n else {\n show = ResolvedLayoutConfig.Header.defaults.show;\n }\n }\n const result = {\n show,\n popout: (_b = (_a = header === null || header === void 0 ? void 0 : header.popout) !== null && _a !== void 0 ? _a : labels === null || labels === void 0 ? void 0 : labels.popout) !== null && _b !== void 0 ? _b : ((settings === null || settings === void 0 ? void 0 : settings.showPopoutIcon) === false ? false : ResolvedLayoutConfig.Header.defaults.popout),\n dock: (_d = (_c = header === null || header === void 0 ? void 0 : header.popin) !== null && _c !== void 0 ? _c : labels === null || labels === void 0 ? void 0 : labels.popin) !== null && _d !== void 0 ? _d : ResolvedLayoutConfig.Header.defaults.dock,\n maximise: (_f = (_e = header === null || header === void 0 ? void 0 : header.maximise) !== null && _e !== void 0 ? _e : labels === null || labels === void 0 ? void 0 : labels.maximise) !== null && _f !== void 0 ? _f : ((settings === null || settings === void 0 ? void 0 : settings.showMaximiseIcon) === false ? false : ResolvedLayoutConfig.Header.defaults.maximise),\n close: (_h = (_g = header === null || header === void 0 ? void 0 : header.close) !== null && _g !== void 0 ? _g : labels === null || labels === void 0 ? void 0 : labels.close) !== null && _h !== void 0 ? _h : ((settings === null || settings === void 0 ? void 0 : settings.showCloseIcon) === false ? false : ResolvedLayoutConfig.Header.defaults.close),\n minimise: (_k = (_j = header === null || header === void 0 ? void 0 : header.minimise) !== null && _j !== void 0 ? _j : labels === null || labels === void 0 ? void 0 : labels.minimise) !== null && _k !== void 0 ? _k : ResolvedLayoutConfig.Header.defaults.minimise,\n tabDropdown: (_m = (_l = header === null || header === void 0 ? void 0 : header.tabDropdown) !== null && _l !== void 0 ? _l : labels === null || labels === void 0 ? void 0 : labels.tabDropdown) !== null && _m !== void 0 ? _m : ResolvedLayoutConfig.Header.defaults.tabDropdown,\n };\n return result;\n }\n Header.resolve = resolve;\n })(Header = LayoutConfig.Header || (LayoutConfig.Header = {}));\n function isPopout(config) {\n return 'parentId' in config || 'indexInParent' in config || 'window' in config;\n }\n LayoutConfig.isPopout = isPopout;\n /** @internal */\n function resolve(layoutConfig) {\n if (isPopout(layoutConfig)) {\n return PopoutLayoutConfig.resolve(layoutConfig);\n }\n else {\n let root;\n if (layoutConfig.root !== undefined) {\n root = layoutConfig.root;\n }\n else {\n if (layoutConfig.content !== undefined && layoutConfig.content.length > 0) {\n root = layoutConfig.content[0];\n }\n else {\n root = undefined;\n }\n }\n const config = {\n resolved: true,\n root: RootItemConfig.resolve(root),\n openPopouts: LayoutConfig.resolveOpenPopouts(layoutConfig.openPopouts),\n dimensions: LayoutConfig.Dimensions.resolve(layoutConfig.dimensions),\n settings: LayoutConfig.Settings.resolve(layoutConfig.settings),\n header: LayoutConfig.Header.resolve(layoutConfig.header, layoutConfig.settings, layoutConfig.labels),\n };\n return config;\n }\n }\n LayoutConfig.resolve = resolve;\n function fromResolved(config) {\n const result = {\n root: RootItemConfig.fromResolvedOrUndefined(config.root),\n openPopouts: PopoutLayoutConfig.fromResolvedArray(config.openPopouts),\n settings: ResolvedLayoutConfig.Settings.createCopy(config.settings),\n dimensions: LayoutConfig.Dimensions.fromResolved(config.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(config.header),\n };\n return result;\n }\n LayoutConfig.fromResolved = fromResolved;\n function isResolved(configOrResolvedConfig) {\n const config = configOrResolvedConfig;\n return config.resolved !== undefined && (config.resolved === true);\n }\n LayoutConfig.isResolved = isResolved;\n /** @internal */\n function resolveOpenPopouts(popoutConfigs) {\n if (popoutConfigs === undefined) {\n return [];\n }\n else {\n const count = popoutConfigs.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = PopoutLayoutConfig.resolve(popoutConfigs[i]);\n }\n return result;\n }\n }\n LayoutConfig.resolveOpenPopouts = resolveOpenPopouts;\n})(LayoutConfig || (LayoutConfig = {}));\n/** @public */\nexport var PopoutLayoutConfig;\n(function (PopoutLayoutConfig) {\n let Window;\n (function (Window) {\n /** @internal */\n function resolve(window, dimensions) {\n var _a, _b, _c, _d, _e, _f, _g, _h;\n let result;\n const defaults = ResolvedPopoutLayoutConfig.Window.defaults;\n if (window !== undefined) {\n result = {\n width: (_a = window.width) !== null && _a !== void 0 ? _a : defaults.width,\n height: (_b = window.height) !== null && _b !== void 0 ? _b : defaults.height,\n left: (_c = window.left) !== null && _c !== void 0 ? _c : defaults.left,\n top: (_d = window.top) !== null && _d !== void 0 ? _d : defaults.top,\n };\n }\n else {\n result = {\n width: (_e = dimensions === null || dimensions === void 0 ? void 0 : dimensions.width) !== null && _e !== void 0 ? _e : defaults.width,\n height: (_f = dimensions === null || dimensions === void 0 ? void 0 : dimensions.height) !== null && _f !== void 0 ? _f : defaults.height,\n left: (_g = dimensions === null || dimensions === void 0 ? void 0 : dimensions.left) !== null && _g !== void 0 ? _g : defaults.left,\n top: (_h = dimensions === null || dimensions === void 0 ? void 0 : dimensions.top) !== null && _h !== void 0 ? _h : defaults.top,\n };\n }\n return result;\n }\n Window.resolve = resolve;\n /** @internal */\n function fromResolved(resolvedWindow) {\n const result = {\n width: resolvedWindow.width === null ? undefined : resolvedWindow.width,\n height: resolvedWindow.height === null ? undefined : resolvedWindow.height,\n left: resolvedWindow.left === null ? undefined : resolvedWindow.left,\n top: resolvedWindow.top === null ? undefined : resolvedWindow.top,\n };\n return result;\n }\n Window.fromResolved = fromResolved;\n })(Window = PopoutLayoutConfig.Window || (PopoutLayoutConfig.Window = {}));\n /** @internal */\n function resolve(popoutConfig) {\n var _a, _b;\n let root;\n if (popoutConfig.root !== undefined) {\n root = popoutConfig.root;\n }\n else {\n if (popoutConfig.content !== undefined && popoutConfig.content.length > 0) {\n root = popoutConfig.content[0];\n }\n else {\n root = undefined;\n }\n }\n const config = {\n root: RootItemConfig.resolve(root),\n openPopouts: LayoutConfig.resolveOpenPopouts(popoutConfig.openPopouts),\n dimensions: LayoutConfig.Dimensions.resolve(popoutConfig.dimensions),\n settings: LayoutConfig.Settings.resolve(popoutConfig.settings),\n header: LayoutConfig.Header.resolve(popoutConfig.header, popoutConfig.settings, popoutConfig.labels),\n parentId: (_a = popoutConfig.parentId) !== null && _a !== void 0 ? _a : null,\n indexInParent: (_b = popoutConfig.indexInParent) !== null && _b !== void 0 ? _b : null,\n window: PopoutLayoutConfig.Window.resolve(popoutConfig.window, popoutConfig.dimensions),\n resolved: true,\n };\n return config;\n }\n PopoutLayoutConfig.resolve = resolve;\n /** @internal */\n function fromResolved(resolvedConfig) {\n const result = {\n root: RootItemConfig.fromResolvedOrUndefined(resolvedConfig.root),\n openPopouts: fromResolvedArray(resolvedConfig.openPopouts),\n dimensions: LayoutConfig.Dimensions.fromResolved(resolvedConfig.dimensions),\n settings: ResolvedLayoutConfig.Settings.createCopy(resolvedConfig.settings),\n header: ResolvedLayoutConfig.Header.createCopy(resolvedConfig.header),\n parentId: resolvedConfig.parentId,\n indexInParent: resolvedConfig.indexInParent,\n window: PopoutLayoutConfig.Window.fromResolved(resolvedConfig.window),\n };\n return result;\n }\n PopoutLayoutConfig.fromResolved = fromResolved;\n /** @internal */\n function fromResolvedArray(resolvedArray) {\n const resolvedOpenPopoutCount = resolvedArray.length;\n const result = new Array(resolvedOpenPopoutCount);\n for (let i = 0; i < resolvedOpenPopoutCount; i++) {\n const resolvedOpenPopout = resolvedArray[i];\n result[i] = PopoutLayoutConfig.fromResolved(resolvedOpenPopout);\n }\n return result;\n }\n PopoutLayoutConfig.fromResolvedArray = fromResolvedArray;\n})(PopoutLayoutConfig || (PopoutLayoutConfig = {}));\n/** @internal */\nexport function parseSize(sizeString, allowableSizeUnits) {\n const { numericPart: digitsPart, firstNonNumericCharPart: firstNonDigitPart } = splitStringAtFirstNonNumericChar(sizeString);\n const size = Number.parseInt(digitsPart, 10);\n if (isNaN(size)) {\n throw new ConfigurationError(`${i18nStrings[7 /* InvalidNumberPartInSizeString */]}: ${sizeString}`);\n }\n else {\n const sizeUnit = SizeUnitEnum.tryParse(firstNonDigitPart);\n if (sizeUnit === undefined) {\n throw new ConfigurationError(`${i18nStrings[8 /* UnknownUnitInSizeString */]}: ${sizeString}`);\n }\n else {\n if (!allowableSizeUnits.includes(sizeUnit)) {\n throw new ConfigurationError(`${i18nStrings[9 /* UnsupportedUnitInSizeString */]}: ${sizeString}`);\n }\n else {\n return { size, sizeUnit };\n }\n }\n }\n}\n/** @internal */\nexport function formatSize(size, sizeUnit) {\n return size.toString(10) + SizeUnitEnum.format(sizeUnit);\n}\n/** @internal */\nexport function formatUndefinableSize(size, sizeUnit) {\n if (size === undefined) {\n return undefined;\n }\n else {\n return size.toString(10) + SizeUnitEnum.format(sizeUnit);\n }\n}\n//# sourceMappingURL=config.js.map","import { AssertError, UnreachableCaseError } from '../errors/internal-error';\nimport { ConfigMinifier } from '../utils/config-minifier';\nimport { ItemType, ResponsiveMode, Side, SizeUnitEnum } from '../utils/types';\nimport { deepExtendValue } from '../utils/utils';\n/** @public */\nexport var ResolvedItemConfig;\n(function (ResolvedItemConfig) {\n ResolvedItemConfig.defaults = {\n type: ItemType.ground,\n content: [],\n size: 1,\n sizeUnit: SizeUnitEnum.Fractional,\n minSize: undefined,\n minSizeUnit: SizeUnitEnum.Pixel,\n id: '',\n isClosable: true,\n };\n /** Creates a copy of the original ResolvedItemConfig using an alternative content if specified */\n function createCopy(original, content) {\n switch (original.type) {\n case ItemType.ground:\n case ItemType.row:\n case ItemType.column:\n return ResolvedRowOrColumnItemConfig.createCopy(original, content);\n case ItemType.stack:\n return ResolvedStackItemConfig.createCopy(original, content);\n case ItemType.component:\n return ResolvedComponentItemConfig.createCopy(original);\n default:\n throw new UnreachableCaseError('CICC91354', original.type, 'Invalid Config Item type specified');\n }\n }\n ResolvedItemConfig.createCopy = createCopy;\n function createDefault(type) {\n switch (type) {\n case ItemType.ground:\n throw new AssertError('CICCDR91562'); // Get default root from LayoutConfig\n case ItemType.row:\n case ItemType.column:\n return ResolvedRowOrColumnItemConfig.createDefault(type);\n case ItemType.stack:\n return ResolvedStackItemConfig.createDefault();\n case ItemType.component:\n return ResolvedComponentItemConfig.createDefault();\n default:\n throw new UnreachableCaseError('CICCDD91563', type, 'Invalid Config Item type specified');\n }\n }\n ResolvedItemConfig.createDefault = createDefault;\n function isComponentItem(itemConfig) {\n return itemConfig.type === ItemType.component;\n }\n ResolvedItemConfig.isComponentItem = isComponentItem;\n function isStackItem(itemConfig) {\n return itemConfig.type === ItemType.stack;\n }\n ResolvedItemConfig.isStackItem = isStackItem;\n /** @internal */\n function isGroundItem(itemConfig) {\n return itemConfig.type === ItemType.ground;\n }\n ResolvedItemConfig.isGroundItem = isGroundItem;\n})(ResolvedItemConfig || (ResolvedItemConfig = {}));\n/** @public */\nexport var ResolvedHeaderedItemConfig;\n(function (ResolvedHeaderedItemConfig) {\n ResolvedHeaderedItemConfig.defaultMaximised = false;\n let Header;\n (function (Header) {\n function createCopy(original, show) {\n if (original === undefined) {\n return undefined;\n }\n else {\n return {\n show: show !== null && show !== void 0 ? show : original.show,\n popout: original.popout,\n close: original.close,\n maximise: original.maximise,\n minimise: original.minimise,\n tabDropdown: original.tabDropdown,\n };\n }\n }\n Header.createCopy = createCopy;\n })(Header = ResolvedHeaderedItemConfig.Header || (ResolvedHeaderedItemConfig.Header = {}));\n})(ResolvedHeaderedItemConfig || (ResolvedHeaderedItemConfig = {}));\n/** @public */\nexport var ResolvedStackItemConfig;\n(function (ResolvedStackItemConfig) {\n ResolvedStackItemConfig.defaultActiveItemIndex = 0;\n function createCopy(original, content) {\n const result = {\n type: original.type,\n content: content !== undefined ? copyContent(content) : copyContent(original.content),\n size: original.size,\n sizeUnit: original.sizeUnit,\n minSize: original.minSize,\n minSizeUnit: original.minSizeUnit,\n id: original.id,\n maximised: original.maximised,\n isClosable: original.isClosable,\n activeItemIndex: original.activeItemIndex,\n header: ResolvedHeaderedItemConfig.Header.createCopy(original.header),\n };\n return result;\n }\n ResolvedStackItemConfig.createCopy = createCopy;\n function copyContent(original) {\n const count = original.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ResolvedItemConfig.createCopy(original[i]);\n }\n return result;\n }\n ResolvedStackItemConfig.copyContent = copyContent;\n function createDefault() {\n const result = {\n type: ItemType.stack,\n content: [],\n size: ResolvedItemConfig.defaults.size,\n sizeUnit: ResolvedItemConfig.defaults.sizeUnit,\n minSize: ResolvedItemConfig.defaults.minSize,\n minSizeUnit: ResolvedItemConfig.defaults.minSizeUnit,\n id: ResolvedItemConfig.defaults.id,\n maximised: ResolvedHeaderedItemConfig.defaultMaximised,\n isClosable: ResolvedItemConfig.defaults.isClosable,\n activeItemIndex: ResolvedStackItemConfig.defaultActiveItemIndex,\n header: undefined,\n };\n return result;\n }\n ResolvedStackItemConfig.createDefault = createDefault;\n})(ResolvedStackItemConfig || (ResolvedStackItemConfig = {}));\n/** @public */\nexport var ResolvedComponentItemConfig;\n(function (ResolvedComponentItemConfig) {\n ResolvedComponentItemConfig.defaultReorderEnabled = true;\n function resolveComponentTypeName(itemConfig) {\n const componentType = itemConfig.componentType;\n if (typeof componentType === 'string') {\n return componentType;\n }\n else {\n return undefined;\n }\n }\n ResolvedComponentItemConfig.resolveComponentTypeName = resolveComponentTypeName;\n function createCopy(original) {\n const result = {\n type: original.type,\n content: [],\n size: original.size,\n sizeUnit: original.sizeUnit,\n minSize: original.minSize,\n minSizeUnit: original.minSizeUnit,\n id: original.id,\n maximised: original.maximised,\n isClosable: original.isClosable,\n reorderEnabled: original.reorderEnabled,\n title: original.title,\n header: ResolvedHeaderedItemConfig.Header.createCopy(original.header),\n componentType: original.componentType,\n componentState: deepExtendValue(undefined, original.componentState),\n };\n return result;\n }\n ResolvedComponentItemConfig.createCopy = createCopy;\n function createDefault(componentType = '', componentState, title = '') {\n const result = {\n type: ItemType.component,\n content: [],\n size: ResolvedItemConfig.defaults.size,\n sizeUnit: ResolvedItemConfig.defaults.sizeUnit,\n minSize: ResolvedItemConfig.defaults.minSize,\n minSizeUnit: ResolvedItemConfig.defaults.minSizeUnit,\n id: ResolvedItemConfig.defaults.id,\n maximised: ResolvedHeaderedItemConfig.defaultMaximised,\n isClosable: ResolvedItemConfig.defaults.isClosable,\n reorderEnabled: ResolvedComponentItemConfig.defaultReorderEnabled,\n title,\n header: undefined,\n componentType,\n componentState,\n };\n return result;\n }\n ResolvedComponentItemConfig.createDefault = createDefault;\n function copyComponentType(componentType) {\n return deepExtendValue({}, componentType);\n }\n ResolvedComponentItemConfig.copyComponentType = copyComponentType;\n})(ResolvedComponentItemConfig || (ResolvedComponentItemConfig = {}));\n/** @public */\nexport var ResolvedRowOrColumnItemConfig;\n(function (ResolvedRowOrColumnItemConfig) {\n function isChildItemConfig(itemConfig) {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('CROCOSPCICIC13687', itemConfig.type);\n }\n }\n ResolvedRowOrColumnItemConfig.isChildItemConfig = isChildItemConfig;\n function createCopy(original, content) {\n const result = {\n type: original.type,\n content: content !== undefined ? copyContent(content) : copyContent(original.content),\n size: original.size,\n sizeUnit: original.sizeUnit,\n minSize: original.minSize,\n minSizeUnit: original.minSizeUnit,\n id: original.id,\n isClosable: original.isClosable,\n };\n return result;\n }\n ResolvedRowOrColumnItemConfig.createCopy = createCopy;\n function copyContent(original) {\n const count = original.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ResolvedItemConfig.createCopy(original[i]);\n }\n return result;\n }\n ResolvedRowOrColumnItemConfig.copyContent = copyContent;\n function createDefault(type) {\n const result = {\n type,\n content: [],\n size: ResolvedItemConfig.defaults.size,\n sizeUnit: ResolvedItemConfig.defaults.sizeUnit,\n minSize: ResolvedItemConfig.defaults.minSize,\n minSizeUnit: ResolvedItemConfig.defaults.minSizeUnit,\n id: ResolvedItemConfig.defaults.id,\n isClosable: ResolvedItemConfig.defaults.isClosable,\n };\n return result;\n }\n ResolvedRowOrColumnItemConfig.createDefault = createDefault;\n})(ResolvedRowOrColumnItemConfig || (ResolvedRowOrColumnItemConfig = {}));\n/** @public */\nexport var ResolvedRootItemConfig;\n(function (ResolvedRootItemConfig) {\n function createCopy(config) {\n return ResolvedItemConfig.createCopy(config);\n }\n ResolvedRootItemConfig.createCopy = createCopy;\n function isRootItemConfig(itemConfig) {\n switch (itemConfig.type) {\n case ItemType.row:\n case ItemType.column:\n case ItemType.stack:\n case ItemType.component:\n return true;\n case ItemType.ground:\n return false;\n default:\n throw new UnreachableCaseError('CROCOSPCICIC13687', itemConfig.type);\n }\n }\n ResolvedRootItemConfig.isRootItemConfig = isRootItemConfig;\n})(ResolvedRootItemConfig || (ResolvedRootItemConfig = {}));\n/** @internal */\nexport var ResolvedGroundItemConfig;\n(function (ResolvedGroundItemConfig) {\n function create(rootItemConfig) {\n const content = rootItemConfig === undefined ? [] : [rootItemConfig];\n return {\n type: ItemType.ground,\n content,\n size: 100,\n sizeUnit: SizeUnitEnum.Percent,\n minSize: 0,\n minSizeUnit: SizeUnitEnum.Pixel,\n id: '',\n isClosable: false,\n title: '',\n reorderEnabled: false,\n };\n }\n ResolvedGroundItemConfig.create = create;\n})(ResolvedGroundItemConfig || (ResolvedGroundItemConfig = {}));\n/** @public */\nexport var ResolvedLayoutConfig;\n(function (ResolvedLayoutConfig) {\n let Settings;\n (function (Settings) {\n Settings.defaults = {\n constrainDragToContainer: true,\n reorderEnabled: true,\n popoutWholeStack: false,\n blockedPopoutsThrowError: true,\n closePopoutsOnUnload: true,\n responsiveMode: ResponsiveMode.none,\n tabOverlapAllowance: 0,\n reorderOnTabMenuClick: true,\n tabControlOffset: 10,\n popInOnClose: false,\n };\n function createCopy(original) {\n return {\n constrainDragToContainer: original.constrainDragToContainer,\n reorderEnabled: original.reorderEnabled,\n popoutWholeStack: original.popoutWholeStack,\n blockedPopoutsThrowError: original.blockedPopoutsThrowError,\n closePopoutsOnUnload: original.closePopoutsOnUnload,\n responsiveMode: original.responsiveMode,\n tabOverlapAllowance: original.tabOverlapAllowance,\n reorderOnTabMenuClick: original.reorderOnTabMenuClick,\n tabControlOffset: original.tabControlOffset,\n popInOnClose: original.popInOnClose,\n };\n }\n Settings.createCopy = createCopy;\n })(Settings = ResolvedLayoutConfig.Settings || (ResolvedLayoutConfig.Settings = {}));\n let Dimensions;\n (function (Dimensions) {\n function createCopy(original) {\n return {\n borderWidth: original.borderWidth,\n borderGrabWidth: original.borderGrabWidth,\n defaultMinItemHeight: original.defaultMinItemHeight,\n defaultMinItemHeightUnit: original.defaultMinItemHeightUnit,\n defaultMinItemWidth: original.defaultMinItemWidth,\n defaultMinItemWidthUnit: original.defaultMinItemWidthUnit,\n headerHeight: original.headerHeight,\n dragProxyWidth: original.dragProxyWidth,\n dragProxyHeight: original.dragProxyHeight,\n };\n }\n Dimensions.createCopy = createCopy;\n Dimensions.defaults = {\n borderWidth: 5,\n borderGrabWidth: 5,\n defaultMinItemHeight: 0,\n defaultMinItemHeightUnit: SizeUnitEnum.Pixel,\n defaultMinItemWidth: 10,\n defaultMinItemWidthUnit: SizeUnitEnum.Pixel,\n headerHeight: 20,\n dragProxyWidth: 300,\n dragProxyHeight: 200\n };\n })(Dimensions = ResolvedLayoutConfig.Dimensions || (ResolvedLayoutConfig.Dimensions = {}));\n let Header;\n (function (Header) {\n function createCopy(original) {\n return {\n show: original.show,\n popout: original.popout,\n dock: original.dock,\n close: original.close,\n maximise: original.maximise,\n minimise: original.minimise,\n tabDropdown: original.tabDropdown,\n };\n }\n Header.createCopy = createCopy;\n Header.defaults = {\n show: Side.top,\n popout: 'open in new window',\n dock: 'dock',\n maximise: 'maximise',\n minimise: 'minimise',\n close: 'close',\n tabDropdown: 'additional tabs'\n };\n })(Header = ResolvedLayoutConfig.Header || (ResolvedLayoutConfig.Header = {}));\n function isPopout(config) {\n return 'parentId' in config;\n }\n ResolvedLayoutConfig.isPopout = isPopout;\n function createDefault() {\n const result = {\n root: undefined,\n openPopouts: [],\n dimensions: ResolvedLayoutConfig.Dimensions.defaults,\n settings: ResolvedLayoutConfig.Settings.defaults,\n header: ResolvedLayoutConfig.Header.defaults,\n resolved: true,\n };\n return result;\n }\n ResolvedLayoutConfig.createDefault = createDefault;\n function createCopy(config) {\n if (isPopout(config)) {\n return ResolvedPopoutLayoutConfig.createCopy(config);\n }\n else {\n const result = {\n root: config.root === undefined ? undefined : ResolvedRootItemConfig.createCopy(config.root),\n openPopouts: ResolvedLayoutConfig.copyOpenPopouts(config.openPopouts),\n settings: ResolvedLayoutConfig.Settings.createCopy(config.settings),\n dimensions: ResolvedLayoutConfig.Dimensions.createCopy(config.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(config.header),\n resolved: config.resolved,\n };\n return result;\n }\n }\n ResolvedLayoutConfig.createCopy = createCopy;\n function copyOpenPopouts(original) {\n const count = original.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n result[i] = ResolvedPopoutLayoutConfig.createCopy(original[i]);\n }\n return result;\n }\n ResolvedLayoutConfig.copyOpenPopouts = copyOpenPopouts;\n /**\n * Takes a GoldenLayout configuration object and\n * replaces its keys and values recursively with\n * one letter counterparts\n */\n function minifyConfig(layoutConfig) {\n return ConfigMinifier.translateObject(layoutConfig, true);\n }\n ResolvedLayoutConfig.minifyConfig = minifyConfig;\n /**\n * Takes a configuration Object that was previously minified\n * using minifyConfig and returns its original version\n */\n function unminifyConfig(minifiedConfig) {\n return ConfigMinifier.translateObject(minifiedConfig, false);\n }\n ResolvedLayoutConfig.unminifyConfig = unminifyConfig;\n})(ResolvedLayoutConfig || (ResolvedLayoutConfig = {}));\n/** @public */\nexport var ResolvedPopoutLayoutConfig;\n(function (ResolvedPopoutLayoutConfig) {\n let Window;\n (function (Window) {\n function createCopy(original) {\n return {\n width: original.width,\n height: original.height,\n left: original.left,\n top: original.top,\n };\n }\n Window.createCopy = createCopy;\n Window.defaults = {\n width: null,\n height: null,\n left: null,\n top: null,\n };\n })(Window = ResolvedPopoutLayoutConfig.Window || (ResolvedPopoutLayoutConfig.Window = {}));\n function createCopy(original) {\n const result = {\n root: original.root === undefined ? undefined : ResolvedRootItemConfig.createCopy(original.root),\n openPopouts: ResolvedLayoutConfig.copyOpenPopouts(original.openPopouts),\n settings: ResolvedLayoutConfig.Settings.createCopy(original.settings),\n dimensions: ResolvedLayoutConfig.Dimensions.createCopy(original.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(original.header),\n parentId: original.parentId,\n indexInParent: original.indexInParent,\n window: ResolvedPopoutLayoutConfig.Window.createCopy(original.window),\n resolved: original.resolved,\n };\n return result;\n }\n ResolvedPopoutLayoutConfig.createCopy = createCopy;\n})(ResolvedPopoutLayoutConfig || (ResolvedPopoutLayoutConfig = {}));\n//# sourceMappingURL=resolved-config.js.map","import { ComponentItemConfig, ItemConfig } from '../config/config';\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { LogicalZIndex, LogicalZIndexToDefaultMap } from '../utils/types';\nimport { deepExtend, setElementHeight, setElementWidth } from '../utils/utils';\n/** @public */\nexport class ComponentContainer extends EventEmitter {\n /** @internal */\n constructor(\n /** @internal */\n _config, \n /** @internal */\n _parent, \n /** @internal */\n _layoutManager, \n /** @internal */\n _element, \n /** @internal */\n _updateItemConfigEvent, \n /** @internal */\n _showEvent, \n /** @internal */\n _hideEvent, \n /** @internal */\n _focusEvent, \n /** @internal */\n _blurEvent) {\n super();\n this._config = _config;\n this._parent = _parent;\n this._layoutManager = _layoutManager;\n this._element = _element;\n this._updateItemConfigEvent = _updateItemConfigEvent;\n this._showEvent = _showEvent;\n this._hideEvent = _hideEvent;\n this._focusEvent = _focusEvent;\n this._blurEvent = _blurEvent;\n /** @internal */\n this._stackMaximised = false;\n this._width = 0;\n this._height = 0;\n this._visible = true;\n this._isShownWithZeroDimensions = true;\n this._componentType = _config.componentType;\n this._isClosable = _config.isClosable;\n this._initialState = _config.componentState;\n this._state = this._initialState;\n this._boundComponent = this.layoutManager.bindComponent(this, _config);\n this.updateElementPositionPropertyFromBoundComponent();\n }\n get width() { return this._width; }\n get height() { return this._height; }\n get parent() { return this._parent; }\n /** @internal @deprecated use {@link (ComponentContainer:class).componentType} */\n get componentName() { return this._componentType; }\n get componentType() { return this._componentType; }\n get virtual() { return this._boundComponent.virtual; }\n get component() { return this._boundComponent.component; }\n get tab() { return this._tab; }\n get title() { return this._parent.title; }\n get layoutManager() { return this._layoutManager; }\n get isHidden() { return !this._visible; }\n get visible() { return this._visible; }\n get state() { return this._state; }\n /** Return the initial component state */\n get initialState() { return this._initialState; }\n /** The inner DOM element where the container's content is intended to live in */\n get element() { return this._element; }\n /** @internal */\n destroy() {\n this.releaseComponent();\n this.stateRequestEvent = undefined;\n this.emit('destroy');\n }\n /** @deprecated use {@link (ComponentContainer:class).element } */\n getElement() {\n return this._element;\n }\n /**\n * Hides the container's component item (and hence, the container) if not already hidden.\n * Emits hide event prior to hiding the container.\n */\n hide() {\n this._hideEvent();\n }\n /**\n * Shows the container's component item (and hence, the container) if not visible.\n * Emits show event prior to hiding the container.\n */\n show() {\n this._showEvent();\n }\n /**\n * Focus this component in Layout.\n */\n focus(suppressEvent = false) {\n this._focusEvent(suppressEvent);\n }\n /**\n * Remove focus from this component in Layout.\n */\n blur(suppressEvent = false) {\n this._blurEvent(suppressEvent);\n }\n /**\n * Set the size from within the container. Traverses up\n * the item tree until it finds a row or column element\n * and resizes its items accordingly.\n *\n * If this container isn't a descendant of a row or column\n * it returns false\n * @param width - The new width in pixel\n * @param height - The new height in pixel\n *\n * @returns resizeSuccesful\n *\n * @internal\n */\n setSize(width, height) {\n let ancestorItem = this._parent;\n if (ancestorItem.isColumn || ancestorItem.isRow || ancestorItem.parent === null) {\n throw new AssertError('ICSSPRC', 'ComponentContainer cannot have RowColumn Parent');\n }\n else {\n let ancestorChildItem;\n do {\n ancestorChildItem = ancestorItem;\n ancestorItem = ancestorItem.parent;\n } while (ancestorItem !== null && !ancestorItem.isColumn && !ancestorItem.isRow);\n if (ancestorItem === null) {\n // no Row or Column found\n return false;\n }\n else {\n // ancestorItem is Row or Column\n const direction = ancestorItem.isColumn ? 'height' : 'width';\n const currentSize = this[direction];\n if (currentSize === null) {\n throw new UnexpectedNullError('ICSSCS11194');\n }\n else {\n const newSize = direction === 'height' ? height : width;\n const totalPixel = currentSize * (1 / (ancestorChildItem.size / 100));\n const percentage = (newSize / totalPixel) * 100;\n const delta = (ancestorChildItem.size - percentage) / (ancestorItem.contentItems.length - 1);\n for (let i = 0; i < ancestorItem.contentItems.length; i++) {\n const ancestorItemContentItem = ancestorItem.contentItems[i];\n if (ancestorItemContentItem === ancestorChildItem) {\n ancestorItemContentItem.size = percentage;\n }\n else {\n ancestorItemContentItem.size += delta;\n }\n }\n ancestorItem.updateSize(false);\n return true;\n }\n }\n }\n }\n /**\n * Closes the container if it is closable. Can be called by\n * both the component within at as well as the contentItem containing\n * it. Emits a close event before the container itself is closed.\n */\n close() {\n if (this._isClosable) {\n this.emit('close');\n this._parent.close();\n }\n }\n /** Replaces component without affecting layout */\n replaceComponent(itemConfig) {\n this.releaseComponent();\n if (!ItemConfig.isComponent(itemConfig)) {\n throw new Error('ReplaceComponent not passed a component ItemConfig');\n }\n else {\n const config = ComponentItemConfig.resolve(itemConfig, false);\n this._initialState = config.componentState;\n this._state = this._initialState;\n this._componentType = config.componentType;\n this._updateItemConfigEvent(config);\n this._boundComponent = this.layoutManager.bindComponent(this, config);\n this.updateElementPositionPropertyFromBoundComponent();\n if (this._boundComponent.virtual) {\n if (this.virtualVisibilityChangeRequiredEvent !== undefined) {\n this.virtualVisibilityChangeRequiredEvent(this, this._visible);\n }\n if (this.virtualRectingRequiredEvent !== undefined) {\n this._layoutManager.fireBeforeVirtualRectingEvent(1);\n try {\n this.virtualRectingRequiredEvent(this, this._width, this._height);\n }\n finally {\n this._layoutManager.fireAfterVirtualRectingEvent();\n }\n }\n this.setBaseLogicalZIndex();\n }\n this.emit('stateChanged');\n }\n }\n /**\n * Returns the initial component state or the latest passed in setState()\n * @returns state\n * @deprecated Use {@link (ComponentContainer:class).initialState}\n */\n getState() {\n return this._state;\n }\n /**\n * Merges the provided state into the current one\n * @deprecated Use {@link (ComponentContainer:class).stateRequestEvent}\n */\n extendState(state) {\n const extendedState = deepExtend(this._state, state);\n this.setState(extendedState);\n }\n /**\n * Sets the component state\n * @deprecated Use {@link (ComponentContainer:class).stateRequestEvent}\n */\n setState(state) {\n this._state = state;\n this._parent.emitBaseBubblingEvent('stateChanged');\n }\n /**\n * Set's the components title\n */\n setTitle(title) {\n this._parent.setTitle(title);\n }\n /** @internal */\n setTab(tab) {\n this._tab = tab;\n this.emit('tab', tab);\n }\n /** @internal */\n setVisibility(value) {\n if (this._boundComponent.virtual) {\n if (this.virtualVisibilityChangeRequiredEvent !== undefined) {\n this.virtualVisibilityChangeRequiredEvent(this, value);\n }\n }\n if (value) {\n if (!this._visible) {\n this._visible = true;\n if (this._height === 0 && this._width === 0) {\n this._isShownWithZeroDimensions = true;\n }\n else {\n this._isShownWithZeroDimensions = false;\n this.setSizeToNodeSize(this._width, this._height, true);\n this.emitShow();\n }\n }\n else {\n if (this._isShownWithZeroDimensions && (this._height !== 0 || this._width !== 0)) {\n this._isShownWithZeroDimensions = false;\n this.setSizeToNodeSize(this._width, this._height, true);\n this.emitShow();\n }\n }\n }\n else {\n if (this._visible) {\n this._visible = false;\n this._isShownWithZeroDimensions = false;\n this.emitHide();\n }\n }\n }\n setBaseLogicalZIndex() {\n this.setLogicalZIndex(LogicalZIndex.base);\n }\n setLogicalZIndex(logicalZIndex) {\n if (logicalZIndex !== this._logicalZIndex) {\n this._logicalZIndex = logicalZIndex;\n this.notifyVirtualZIndexChangeRequired();\n }\n }\n /**\n * Set the container's size, but considered temporary (for dragging)\n * so don't emit any events.\n * @internal\n */\n enterDragMode(width, height) {\n this._width = width;\n this._height = height;\n setElementWidth(this._element, width);\n setElementHeight(this._element, height);\n this.setLogicalZIndex(LogicalZIndex.drag);\n this.drag();\n }\n /** @internal */\n exitDragMode() {\n this.setBaseLogicalZIndex();\n }\n /** @internal */\n enterStackMaximised() {\n this._stackMaximised = true;\n this.setLogicalZIndex(LogicalZIndex.stackMaximised);\n }\n /** @internal */\n exitStackMaximised() {\n this.setBaseLogicalZIndex();\n this._stackMaximised = false;\n }\n /** @internal */\n drag() {\n if (this._boundComponent.virtual) {\n if (this.virtualRectingRequiredEvent !== undefined) {\n this._layoutManager.fireBeforeVirtualRectingEvent(1);\n try {\n this.virtualRectingRequiredEvent(this, this._width, this._height);\n }\n finally {\n this._layoutManager.fireAfterVirtualRectingEvent();\n }\n }\n }\n }\n /**\n * Sets the container's size. Called by the container's component item.\n * To instead set the size programmatically from within the component itself,\n * use the public setSize method\n * @param width - in px\n * @param height - in px\n * @param force - set even if no change\n * @internal\n */\n setSizeToNodeSize(width, height, force) {\n if (width !== this._width || height !== this._height || force) {\n this._width = width;\n this._height = height;\n setElementWidth(this._element, width);\n setElementHeight(this._element, height);\n if (this._boundComponent.virtual) {\n this.addVirtualSizedContainerToLayoutManager();\n }\n else {\n this.emit('resize');\n this.checkShownFromZeroDimensions();\n }\n }\n }\n /** @internal */\n notifyVirtualRectingRequired() {\n if (this.virtualRectingRequiredEvent !== undefined) {\n this.virtualRectingRequiredEvent(this, this._width, this._height);\n this.emit('resize');\n this.checkShownFromZeroDimensions();\n }\n }\n /** @internal */\n notifyVirtualZIndexChangeRequired() {\n if (this.virtualZIndexChangeRequiredEvent !== undefined) {\n const logicalZIndex = this._logicalZIndex;\n const defaultZIndex = LogicalZIndexToDefaultMap[logicalZIndex];\n this.virtualZIndexChangeRequiredEvent(this, logicalZIndex, defaultZIndex);\n }\n }\n /** @internal */\n updateElementPositionPropertyFromBoundComponent() {\n if (this._boundComponent.virtual) {\n this._element.style.position = 'static';\n }\n else {\n this._element.style.position = ''; // set it back to attribute value\n }\n }\n /** @internal */\n addVirtualSizedContainerToLayoutManager() {\n this._layoutManager.beginVirtualSizedContainerAdding();\n try {\n this._layoutManager.addVirtualSizedContainer(this);\n }\n finally {\n this._layoutManager.endVirtualSizedContainerAdding();\n }\n }\n /** @internal */\n checkShownFromZeroDimensions() {\n if (this._isShownWithZeroDimensions && (this._height !== 0 || this._width !== 0)) {\n this._isShownWithZeroDimensions = false;\n this.emitShow();\n }\n }\n /** @internal */\n emitShow() {\n this.emit('shown');\n this.emit('show');\n }\n /** @internal */\n emitHide() {\n this.emit('hide');\n }\n /** @internal */\n releaseComponent() {\n if (this._stackMaximised) {\n this.exitStackMaximised();\n }\n this.emit('beforeComponentRelease', this._boundComponent.component);\n this.layoutManager.unbindComponent(this, this._boundComponent.virtual, this._boundComponent.component);\n }\n}\n//# sourceMappingURL=component-container.js.map","import { ResolvedLayoutConfig } from '../config/resolved-config';\nimport { PopoutBlockedError } from '../errors/external-error';\nimport { UnexpectedNullError, UnexpectedUndefinedError } from '../errors/internal-error';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { deepExtend, getErrorMessage, getUniqueId } from '../utils/utils';\n/**\n * Pops a content item out into a new browser window.\n * This is achieved by\n *\n * - Creating a new configuration with the content item as root element\n * - Serializing and minifying the configuration\n * - Opening the current window's URL with the configuration as a GET parameter\n * - GoldenLayout when opened in the new window will look for the GET parameter\n * and use it instead of the provided configuration\n * @public\n */\nexport class BrowserPopout extends EventEmitter {\n /**\n * @param _config - GoldenLayout item config\n * @param _initialWindowSize - A map with width, height, top and left\n * @internal\n */\n constructor(\n /** @internal */\n _config, \n /** @internal */\n _initialWindowSize, \n /** @internal */\n _layoutManager) {\n super();\n this._config = _config;\n this._initialWindowSize = _initialWindowSize;\n this._layoutManager = _layoutManager;\n this._isInitialised = false;\n this._popoutWindow = null;\n this.createWindow();\n }\n toConfig() {\n var _a, _b;\n if (this._isInitialised === false) {\n throw new Error('Can\\'t create config, layout not yet initialised');\n }\n const glInstance = this.getGlInstance();\n const glInstanceConfig = glInstance.saveLayout();\n let left;\n let top;\n if (this._popoutWindow === null) {\n left = null;\n top = null;\n }\n else {\n left = (_a = this._popoutWindow.screenX) !== null && _a !== void 0 ? _a : this._popoutWindow.screenLeft;\n top = (_b = this._popoutWindow.screenY) !== null && _b !== void 0 ? _b : this._popoutWindow.screenTop;\n }\n const window = {\n width: this.getGlInstance().width,\n height: this.getGlInstance().height,\n left,\n top,\n };\n const config = {\n root: glInstanceConfig.root,\n openPopouts: glInstanceConfig.openPopouts,\n settings: glInstanceConfig.settings,\n dimensions: glInstanceConfig.dimensions,\n header: glInstanceConfig.header,\n window,\n parentId: this._config.parentId,\n indexInParent: this._config.indexInParent,\n resolved: true,\n };\n return config;\n }\n getGlInstance() {\n if (this._popoutWindow === null) {\n throw new UnexpectedNullError('BPGGI24693');\n }\n return this._popoutWindow.__glInstance;\n }\n /**\n * Retrieves the native BrowserWindow backing this popout.\n * Might throw an UnexpectedNullError exception when the window is not initialized yet.\n * @public\n */\n getWindow() {\n if (this._popoutWindow === null) {\n throw new UnexpectedNullError('BPGW087215');\n }\n return this._popoutWindow;\n }\n close() {\n if (this.getGlInstance()) {\n this.getGlInstance().closeWindow();\n }\n else {\n try {\n this.getWindow().close();\n }\n catch (e) {\n //\n }\n }\n }\n /**\n * Returns the popped out item to its original position. If the original\n * parent isn't available anymore it falls back to the layout's topmost element\n */\n popIn() {\n let parentItem;\n let index = this._config.indexInParent;\n if (!this._config.parentId) {\n return;\n }\n /*\n * The deepExtend call seems a bit pointless, but it's crucial to\n * copy the config returned by this.getGlInstance().toConfig()\n * onto a new object. Internet Explorer keeps the references\n * to objects on the child window, resulting in the following error\n * once the child window is closed:\n *\n * The callee (server [not server application]) is not available and disappeared\n */\n const glInstanceLayoutConfig = this.getGlInstance().saveLayout();\n const copiedGlInstanceLayoutConfig = deepExtend({}, glInstanceLayoutConfig);\n const copiedRoot = copiedGlInstanceLayoutConfig.root;\n if (copiedRoot === undefined) {\n throw new UnexpectedUndefinedError('BPPIR19998');\n }\n const groundItem = this._layoutManager.groundItem;\n if (groundItem === undefined) {\n throw new UnexpectedUndefinedError('BPPIG34972');\n }\n parentItem = groundItem.getItemsByPopInParentId(this._config.parentId)[0];\n /*\n * Fallback if parentItem is not available. Either add it to the topmost\n * item or make it the topmost item if the layout is empty\n */\n if (!parentItem) {\n if (groundItem.contentItems.length > 0) {\n parentItem = groundItem.contentItems[0];\n }\n else {\n parentItem = groundItem;\n }\n index = 0;\n }\n const newContentItem = this._layoutManager.createAndInitContentItem(copiedRoot, parentItem);\n parentItem.addChild(newContentItem, index);\n if (this._layoutManager.layoutConfig.settings.popInOnClose) {\n this._onClose();\n }\n else {\n this.close();\n }\n }\n /**\n * Creates the URL and window parameter\n * and opens a new window\n * @internal\n */\n createWindow() {\n const url = this.createUrl();\n /**\n * Bogus title to prevent re-usage of existing window with the\n * same title. The actual title will be set by the new window's\n * GoldenLayout instance if it detects that it is in subWindowMode\n */\n const target = Math.floor(Math.random() * 1000000).toString(36);\n /**\n * The options as used in the window.open string\n */\n const features = this.serializeWindowFeatures({\n width: this._initialWindowSize.width,\n height: this._initialWindowSize.height,\n innerWidth: this._initialWindowSize.width,\n innerHeight: this._initialWindowSize.height,\n menubar: 'no',\n toolbar: 'no',\n location: 'no',\n personalbar: 'no',\n resizable: 'yes',\n scrollbars: 'no',\n status: 'no'\n });\n this._popoutWindow = globalThis.open(url, target, features);\n if (!this._popoutWindow) {\n if (this._layoutManager.layoutConfig.settings.blockedPopoutsThrowError === true) {\n const error = new PopoutBlockedError('Popout blocked');\n throw error;\n }\n else {\n return;\n }\n }\n this._popoutWindow.addEventListener('load', () => this.positionWindow(), { passive: true });\n this._popoutWindow.addEventListener('beforeunload', () => {\n if (this._layoutManager.layoutConfig.settings.popInOnClose) {\n this.popIn();\n }\n else {\n this._onClose();\n }\n }, { passive: true });\n /**\n * Polling the childwindow to find out if GoldenLayout has been initialised\n * doesn't seem optimal, but the alternatives - adding a callback to the parent\n * window or raising an event on the window object - both would introduce knowledge\n * about the parent to the child window which we'd rather avoid\n */\n this._checkReadyInterval = setInterval(() => this.checkReady(), 10);\n }\n /** @internal */\n checkReady() {\n if (this._popoutWindow === null) {\n throw new UnexpectedNullError('BPCR01844');\n }\n else {\n if (this._popoutWindow.__glInstance && this._popoutWindow.__glInstance.isInitialised) {\n this.onInitialised();\n if (this._checkReadyInterval !== undefined) {\n clearInterval(this._checkReadyInterval);\n this._checkReadyInterval = undefined;\n }\n }\n }\n }\n /**\n * Serialises a map of key:values to a window options string\n *\n * @param windowOptions -\n *\n * @returns serialised window options\n * @internal\n */\n serializeWindowFeatures(windowOptions) {\n const windowOptionsString = [];\n for (const key in windowOptions) {\n windowOptionsString.push(key + '=' + windowOptions[key].toString());\n }\n return windowOptionsString.join(',');\n }\n /**\n * Creates the URL for the new window, including the\n * config GET parameter\n *\n * @returns URL\n * @internal\n */\n createUrl() {\n const storageKey = 'gl-window-config-' + getUniqueId();\n const config = ResolvedLayoutConfig.minifyConfig(this._config);\n try {\n localStorage.setItem(storageKey, JSON.stringify(config));\n }\n catch (e) {\n throw new Error('Error while writing to localStorage ' + getErrorMessage(e));\n }\n const url = new URL(location.href);\n url.searchParams.set('gl-window', storageKey);\n return url.toString();\n }\n /**\n * Move the newly created window roughly to\n * where the component used to be.\n * @internal\n */\n positionWindow() {\n if (this._popoutWindow === null) {\n throw new Error('BrowserPopout.positionWindow: null popoutWindow');\n }\n else {\n this._popoutWindow.moveTo(this._initialWindowSize.left, this._initialWindowSize.top);\n this._popoutWindow.focus();\n }\n }\n /**\n * Callback when the new window is opened and the GoldenLayout instance\n * within it is initialised\n * @internal\n */\n onInitialised() {\n this._isInitialised = true;\n this.getGlInstance().on('popIn', () => this.popIn());\n this.emit('initialised');\n }\n /**\n * Invoked 50ms after the window unload event\n * @internal\n */\n _onClose() {\n setTimeout(() => this.emit('closed'), 50);\n }\n}\n//# sourceMappingURL=browser-popout.js.map","import { UnexpectedNullError, UnexpectedUndefinedError } from '../errors/internal-error';\nimport { Stack } from '../items/stack';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { Side } from '../utils/types';\nimport { numberToPixels } from '../utils/utils';\n/**\n * This class creates a temporary container\n * for the component whilst it is being dragged\n * and handles drag events\n * @internal\n */\nexport class DragProxy extends EventEmitter {\n /**\n * @param x - The initial x position\n * @param y - The initial y position\n * @internal\n */\n constructor(x, y, _dragListener, _layoutManager, _componentItem, _originalParent) {\n super();\n this._dragListener = _dragListener;\n this._layoutManager = _layoutManager;\n this._componentItem = _componentItem;\n this._originalParent = _originalParent;\n this._area = null;\n this._lastValidArea = null;\n this._dragListener.on('drag', (offsetX, offsetY, event) => this.onDrag(offsetX, offsetY, event));\n this._dragListener.on('dragStop', () => this.onDrop());\n this.createDragProxyElements(x, y);\n if (this._componentItem.parent === null) {\n // Note that _contentItem will have dummy GroundItem as parent if initiated by a external drag source\n throw new UnexpectedNullError('DPC10097');\n }\n this._componentItemFocused = this._componentItem.focused;\n if (this._componentItemFocused) {\n this._componentItem.blur();\n }\n this._componentItem.parent.removeChild(this._componentItem, true);\n this.setDimensions();\n document.body.appendChild(this._element);\n this.determineMinMaxXY();\n this._layoutManager.calculateItemAreas();\n this.setDropPosition(x, y);\n }\n get element() { return this._element; }\n /** Create Stack-like structure to contain the dragged component */\n createDragProxyElements(initialX, initialY) {\n this._element = document.createElement('div');\n this._element.classList.add(\"lm_dragProxy\" /* DragProxy */);\n const headerElement = document.createElement('div');\n headerElement.classList.add(\"lm_header\" /* Header */);\n const tabsElement = document.createElement('div');\n tabsElement.classList.add(\"lm_tabs\" /* Tabs */);\n const tabElement = document.createElement('div');\n tabElement.classList.add(\"lm_tab\" /* Tab */);\n const titleElement = document.createElement('span');\n titleElement.classList.add(\"lm_title\" /* Title */);\n tabElement.appendChild(titleElement);\n tabsElement.appendChild(tabElement);\n headerElement.appendChild(tabsElement);\n this._proxyContainerElement = document.createElement('div');\n this._proxyContainerElement.classList.add(\"lm_content\" /* Content */);\n this._element.appendChild(headerElement);\n this._element.appendChild(this._proxyContainerElement);\n if (this._originalParent instanceof Stack && this._originalParent.headerShow) {\n this._sided = this._originalParent.headerLeftRightSided;\n this._element.classList.add('lm_' + this._originalParent.headerSide);\n if ([Side.right, Side.bottom].indexOf(this._originalParent.headerSide) >= 0) {\n this._proxyContainerElement.insertAdjacentElement('afterend', headerElement);\n }\n }\n this._element.style.left = numberToPixels(initialX);\n this._element.style.top = numberToPixels(initialY);\n tabElement.setAttribute('title', this._componentItem.title);\n titleElement.insertAdjacentText('afterbegin', this._componentItem.title);\n this._proxyContainerElement.appendChild(this._componentItem.element);\n }\n determineMinMaxXY() {\n const groundItem = this._layoutManager.groundItem;\n if (groundItem === undefined) {\n throw new UnexpectedUndefinedError('DPDMMXY73109');\n }\n else {\n const groundElement = groundItem.element;\n const rect = groundElement.getBoundingClientRect();\n this._minX = rect.left + document.body.scrollLeft;\n this._minY = rect.top + document.body.scrollTop;\n this._maxX = this._minX + rect.width;\n this._maxY = this._minY + rect.height;\n }\n }\n /**\n * Callback on every mouseMove event during a drag. Determines if the drag is\n * still within the valid drag area and calls the layoutManager to highlight the\n * current drop area\n *\n * @param offsetX - The difference from the original x position in px\n * @param offsetY - The difference from the original y position in px\n * @param event -\n * @internal\n */\n onDrag(offsetX, offsetY, event) {\n const x = event.pageX;\n const y = event.pageY;\n this.setDropPosition(x, y);\n this._componentItem.drag();\n }\n /**\n * Sets the target position, highlighting the appropriate area\n *\n * @param x - The x position in px\n * @param y - The y position in px\n *\n * @internal\n */\n setDropPosition(x, y) {\n if (this._layoutManager.layoutConfig.settings.constrainDragToContainer) {\n if (x <= this._minX) {\n x = Math.ceil(this._minX);\n }\n else if (x >= this._maxX) {\n x = Math.floor(this._maxX);\n }\n if (y <= this._minY) {\n y = Math.ceil(this._minY);\n }\n else if (y >= this._maxY) {\n y = Math.floor(this._maxY);\n }\n }\n this._element.style.left = numberToPixels(x);\n this._element.style.top = numberToPixels(y);\n this._area = this._layoutManager.getArea(x, y);\n if (this._area !== null) {\n this._lastValidArea = this._area;\n this._area.contentItem.highlightDropZone(x, y, this._area);\n }\n }\n /**\n * Callback when the drag has finished. Determines the drop area\n * and adds the child to it\n * @internal\n */\n onDrop() {\n const dropTargetIndicator = this._layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('DPOD30011');\n }\n else {\n dropTargetIndicator.hide();\n }\n this._componentItem.exitDragMode();\n /*\n * Valid drop area found\n */\n let droppedComponentItem;\n if (this._area !== null) {\n droppedComponentItem = this._componentItem;\n this._area.contentItem.onDrop(droppedComponentItem, this._area);\n /**\n * No valid drop area available at present, but one has been found before.\n * Use it\n */\n }\n else if (this._lastValidArea !== null) {\n droppedComponentItem = this._componentItem;\n const newParentContentItem = this._lastValidArea.contentItem;\n newParentContentItem.onDrop(droppedComponentItem, this._lastValidArea);\n /**\n * No valid drop area found during the duration of the drag. Return\n * content item to its original position if a original parent is provided.\n * (Which is not the case if the drag had been initiated by createDragSource)\n */\n }\n else if (this._originalParent) {\n droppedComponentItem = this._componentItem;\n this._originalParent.addChild(droppedComponentItem);\n /**\n * The drag didn't ultimately end up with adding the content item to\n * any container. In order to ensure clean up happens, destroy the\n * content item.\n */\n }\n else {\n this._componentItem.destroy(); // contentItem children are now destroyed as well\n }\n this._element.remove();\n this._layoutManager.emit('itemDropped', this._componentItem);\n if (this._componentItemFocused && droppedComponentItem !== undefined) {\n droppedComponentItem.focus();\n }\n }\n /**\n * Updates the Drag Proxy's dimensions\n * @internal\n */\n setDimensions() {\n const dimensions = this._layoutManager.layoutConfig.dimensions;\n if (dimensions === undefined) {\n throw new Error('DragProxy.setDimensions: dimensions undefined');\n }\n let width = dimensions.dragProxyWidth;\n let height = dimensions.dragProxyHeight;\n if (width === undefined || height === undefined) {\n throw new Error('DragProxy.setDimensions: width and/or height undefined');\n }\n const headerHeight = this._layoutManager.layoutConfig.header.show === false ? 0 : dimensions.headerHeight;\n this._element.style.width = numberToPixels(width);\n this._element.style.height = numberToPixels(height);\n width -= (this._sided ? headerHeight : 0);\n height -= (!this._sided ? headerHeight : 0);\n this._proxyContainerElement.style.width = numberToPixels(width);\n this._proxyContainerElement.style.height = numberToPixels(height);\n this._componentItem.enterDragMode(width, height);\n this._componentItem.show();\n }\n}\n//# sourceMappingURL=drag-proxy.js.map","import { ComponentItemConfig as ConfigComponentItemConfig } from '../config/config'; // remove alias in version 3\nimport { ResolvedRowOrColumnItemConfig } from \"../config/resolved-config\";\nimport { UnexpectedNullError } from '../errors/internal-error';\nimport { ComponentItem } from '../items/component-item';\nimport { GroundItem } from '../items/ground-item';\nimport { DragListener } from '../utils/drag-listener';\nimport { DragProxy } from './drag-proxy';\n/**\n * Allows for any DOM item to create a component on drag\n * start to be dragged into the Layout\n * @public\n */\nexport class DragSource {\n /** @internal */\n constructor(\n /** @internal */\n _layoutManager, \n /** @internal */\n _element, \n /** @internal */\n _extraAllowableChildTargets, \n /** @internal @deprecated replace with componentItemConfigOrFtn in version 3 */\n _componentTypeOrFtn, \n /** @internal @deprecated remove in version 3 */\n _componentState, \n /** @internal @deprecated remove in version 3 */\n _title, \n /** @internal @deprecated remove in version 3 */\n _id) {\n this._layoutManager = _layoutManager;\n this._element = _element;\n this._extraAllowableChildTargets = _extraAllowableChildTargets;\n this._componentTypeOrFtn = _componentTypeOrFtn;\n this._componentState = _componentState;\n this._title = _title;\n this._id = _id;\n this._dragListener = null;\n this._dummyGroundContainer = document.createElement('div');\n const dummyRootItemConfig = ResolvedRowOrColumnItemConfig.createDefault('row');\n this._dummyGroundContentItem = new GroundItem(this._layoutManager, dummyRootItemConfig, this._dummyGroundContainer);\n this.createDragListener();\n }\n /**\n * Disposes of the drag listeners so the drag source is not usable any more.\n * @internal\n */\n destroy() {\n this.removeDragListener();\n }\n /**\n * Called initially and after every drag\n * @internal\n */\n createDragListener() {\n this.removeDragListener();\n this._dragListener = new DragListener(this._element, this._extraAllowableChildTargets);\n this._dragListener.on('dragStart', (x, y) => this.onDragStart(x, y));\n this._dragListener.on('dragStop', () => this.onDragStop());\n }\n /**\n * Callback for the DragListener's dragStart event\n *\n * @param x - The x position of the mouse on dragStart\n * @param y - The x position of the mouse on dragStart\n * @internal\n */\n onDragStart(x, y) {\n var _a;\n const type = 'component';\n let dragSourceItemConfig;\n if (typeof this._componentTypeOrFtn === \"function\") {\n const ftnDragSourceItemConfig = this._componentTypeOrFtn();\n // If the componentType property exists, then it is already a ComponentItemConfig so nothing to do\n if (DragSource.isDragSourceComponentItemConfig(ftnDragSourceItemConfig)) {\n dragSourceItemConfig = {\n type,\n componentState: ftnDragSourceItemConfig.state,\n componentType: ftnDragSourceItemConfig.type,\n title: (_a = ftnDragSourceItemConfig.title) !== null && _a !== void 0 ? _a : this._title,\n };\n }\n else {\n dragSourceItemConfig = ftnDragSourceItemConfig;\n }\n }\n else {\n dragSourceItemConfig = {\n type,\n componentState: this._componentState,\n componentType: this._componentTypeOrFtn,\n title: this._title,\n id: this._id,\n };\n }\n // Create a dummy ContentItem only for drag purposes\n // All ContentItems (except for GroundItem) need a parent. When dragging, the parent is not used.\n // Instead of allowing null parents (as Javascript version did), use a temporary dummy GroundItem parent and add ContentItem to that\n // If this does not work, need to create alternative GroundItem class\n const resolvedItemConfig = ConfigComponentItemConfig.resolve(dragSourceItemConfig, false);\n const componentItem = new ComponentItem(this._layoutManager, resolvedItemConfig, this._dummyGroundContentItem);\n this._dummyGroundContentItem.contentItems.push(componentItem);\n if (this._dragListener === null) {\n throw new UnexpectedNullError('DSODSD66746');\n }\n else {\n const dragProxy = new DragProxy(x, y, this._dragListener, this._layoutManager, componentItem, this._dummyGroundContentItem);\n const transitionIndicator = this._layoutManager.transitionIndicator;\n if (transitionIndicator === null) {\n throw new UnexpectedNullError('DSODST66746');\n }\n else {\n transitionIndicator.transitionElements(this._element, dragProxy.element);\n }\n }\n }\n /** @internal */\n onDragStop() {\n // if (this._dummyGroundContentItem === undefined) {\n // throw new UnexpectedUndefinedError('DSODSDRU08116');\n // } else {\n // this._dummyGroundContentItem._$destroy\n // this._dummyGroundContentItem = undefined;\n // }\n this.createDragListener();\n }\n /**\n * Called after every drag and when the drag source is being disposed of.\n * @internal\n */\n removeDragListener() {\n if (this._dragListener !== null) {\n this._dragListener.destroy();\n this._dragListener = null;\n }\n }\n}\n/** @public */\n(function (DragSource) {\n /** @deprecated remove in version 3 */\n function isDragSourceComponentItemConfig(config) {\n return !(\"componentType\" in config);\n }\n DragSource.isDragSourceComponentItemConfig = isDragSourceComponentItemConfig;\n})(DragSource || (DragSource = {}));\n//# sourceMappingURL=drag-source.js.map","import { numberToPixels, setElementDisplayVisibility } from '../utils/utils';\n/** @internal */\nexport class DropTargetIndicator {\n constructor() {\n // Maybe use container instead of Document Body?\n this._element = document.createElement('div');\n this._element.classList.add(\"lm_dropTargetIndicator\" /* DropTargetIndicator */);\n const innerElement = document.createElement('div');\n innerElement.classList.add(\"lm_inner\" /* Inner */);\n this._element.appendChild(innerElement);\n document.body.appendChild(this._element);\n }\n destroy() {\n this._element.remove();\n }\n highlightArea(area, margin) {\n this._element.style.left = numberToPixels(area.x1 + margin);\n this._element.style.top = numberToPixels(area.y1 + margin);\n this._element.style.width = numberToPixels(area.x2 - area.x1 - margin);\n this._element.style.height = numberToPixels(area.y2 - area.y1 - margin);\n this._element.style.display = 'block';\n }\n hide() {\n setElementDisplayVisibility(this._element, false);\n }\n}\n//# sourceMappingURL=drop-target-indicator.js.map","/** @internal */\nexport class HeaderButton {\n constructor(_header, label, cssClass, _pushEvent) {\n this._header = _header;\n this._pushEvent = _pushEvent;\n this._clickEventListener = (ev) => this.onClick(ev);\n this._touchStartEventListener = (ev) => this.onTouchStart(ev);\n this._element = document.createElement('div');\n this._element.classList.add(cssClass);\n this._element.title = label;\n this._header.on('destroy', () => this.destroy());\n this._element.addEventListener('click', this._clickEventListener, { passive: true });\n this._element.addEventListener('touchstart', this._touchStartEventListener, { passive: true });\n this._header.controlsContainerElement.appendChild(this._element);\n }\n get element() { return this._element; }\n destroy() {\n var _a;\n this._element.removeEventListener('click', this._clickEventListener);\n this._element.removeEventListener('touchstart', this._touchStartEventListener);\n (_a = this._element.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(this._element);\n }\n onClick(ev) {\n this._pushEvent(ev);\n }\n onTouchStart(ev) {\n this._pushEvent(ev);\n }\n}\n//# sourceMappingURL=header-button.js.map","import { UnexpectedUndefinedError } from '../errors/internal-error';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { Side } from '../utils/types';\nimport { numberToPixels, setElementDisplayVisibility } from '../utils/utils';\nimport { HeaderButton } from './header-button';\nimport { TabsContainer } from './tabs-container';\n/**\n * This class represents a header above a Stack ContentItem.\n * @public\n */\nexport class Header extends EventEmitter {\n /** @internal */\n constructor(\n /** @internal */\n _layoutManager, \n /** @internal */\n _parent, settings, \n /** @internal */\n _configClosable, \n /** @internal */\n _getActiveComponentItemEvent, closeEvent, \n /** @internal */\n _popoutEvent, \n /** @internal */\n _maximiseToggleEvent, \n /** @internal */\n _clickEvent, \n /** @internal */\n _touchStartEvent, \n /** @internal */\n _componentRemoveEvent, \n /** @internal */\n _componentFocusEvent, \n /** @internal */\n _componentDragStartEvent) {\n super();\n this._layoutManager = _layoutManager;\n this._parent = _parent;\n this._configClosable = _configClosable;\n this._getActiveComponentItemEvent = _getActiveComponentItemEvent;\n this._popoutEvent = _popoutEvent;\n this._maximiseToggleEvent = _maximiseToggleEvent;\n this._clickEvent = _clickEvent;\n this._touchStartEvent = _touchStartEvent;\n this._componentRemoveEvent = _componentRemoveEvent;\n this._componentFocusEvent = _componentFocusEvent;\n this._componentDragStartEvent = _componentDragStartEvent;\n /** @internal */\n this._clickListener = (ev) => this.onClick(ev);\n /** @internal */\n this._touchStartListener = (ev) => this.onTouchStart(ev);\n /** @internal */\n this._rowColumnClosable = true;\n /** @internal */\n this._closeButton = null;\n /** @internal */\n this._popoutButton = null;\n this._tabsContainer = new TabsContainer(this._layoutManager, (item) => this.handleTabInitiatedComponentRemoveEvent(item), (item) => this.handleTabInitiatedComponentFocusEvent(item), (x, y, dragListener, item) => this.handleTabInitiatedDragStartEvent(x, y, dragListener, item), () => this.processTabDropdownActiveChanged());\n this._show = settings.show;\n this._popoutEnabled = settings.popoutEnabled;\n this._popoutLabel = settings.popoutLabel;\n this._maximiseEnabled = settings.maximiseEnabled;\n this._maximiseLabel = settings.maximiseLabel;\n this._minimiseEnabled = settings.minimiseEnabled;\n this._minimiseLabel = settings.minimiseLabel;\n this._closeEnabled = settings.closeEnabled;\n this._closeLabel = settings.closeLabel;\n this._tabDropdownEnabled = settings.tabDropdownEnabled;\n this._tabDropdownLabel = settings.tabDropdownLabel;\n this.setSide(settings.side);\n this._canRemoveComponent = this._configClosable;\n this._element = document.createElement('section');\n this._element.classList.add(\"lm_header\" /* Header */);\n this._controlsContainerElement = document.createElement('section');\n this._controlsContainerElement.classList.add(\"lm_controls\" /* Controls */);\n this._element.appendChild(this._tabsContainer.element);\n this._element.appendChild(this._controlsContainerElement);\n this._element.appendChild(this._tabsContainer.dropdownElement);\n this._element.addEventListener('click', this._clickListener, { passive: true });\n this._element.addEventListener('touchstart', this._touchStartListener, { passive: true });\n this._documentMouseUpListener = () => this._tabsContainer.hideAdditionalTabsDropdown();\n globalThis.document.addEventListener('mouseup', this._documentMouseUpListener, { passive: true });\n this._tabControlOffset = this._layoutManager.layoutConfig.settings.tabControlOffset;\n if (this._tabDropdownEnabled) {\n this._tabDropdownButton = new HeaderButton(this, this._tabDropdownLabel, \"lm_tabdropdown\" /* TabDropdown */, () => this._tabsContainer.showAdditionalTabsDropdown());\n }\n if (this._popoutEnabled) {\n this._popoutButton = new HeaderButton(this, this._popoutLabel, \"lm_popout\" /* Popout */, () => this.handleButtonPopoutEvent());\n }\n /**\n * Maximise control - set the component to the full size of the layout\n */\n if (this._maximiseEnabled) {\n this._maximiseButton = new HeaderButton(this, this._maximiseLabel, \"lm_maximise\" /* Maximise */, (ev) => this.handleButtonMaximiseToggleEvent(ev));\n }\n /**\n * Close button\n */\n if (this._configClosable) {\n this._closeButton = new HeaderButton(this, this._closeLabel, \"lm_close\" /* Close */, () => closeEvent());\n }\n this.processTabDropdownActiveChanged();\n }\n // /** @internal */\n // private _activeComponentItem: ComponentItem | null = null; // only used to identify active tab\n get show() { return this._show; }\n get side() { return this._side; }\n get leftRightSided() { return this._leftRightSided; }\n get layoutManager() { return this._layoutManager; }\n get parent() { return this._parent; }\n get tabs() { return this._tabsContainer.tabs; }\n get lastVisibleTabIndex() { return this._tabsContainer.lastVisibleTabIndex; }\n get element() { return this._element; }\n get tabsContainerElement() { return this._tabsContainer.element; }\n get controlsContainerElement() { return this._controlsContainerElement; }\n /**\n * Destroys the entire header\n * @internal\n */\n destroy() {\n this.emit('destroy');\n this._popoutEvent = undefined;\n this._maximiseToggleEvent = undefined;\n this._clickEvent = undefined;\n this._touchStartEvent = undefined;\n this._componentRemoveEvent = undefined;\n this._componentFocusEvent = undefined;\n this._componentDragStartEvent = undefined;\n this._tabsContainer.destroy();\n globalThis.document.removeEventListener('mouseup', this._documentMouseUpListener);\n this._element.remove();\n }\n /**\n * Creates a new tab and associates it with a contentItem\n * @param index - The position of the tab\n * @internal\n */\n createTab(componentItem, index) {\n this._tabsContainer.createTab(componentItem, index);\n }\n /**\n * Finds a tab based on the contentItem its associated with and removes it.\n * Cannot remove tab if it has the active ComponentItem\n * @internal\n */\n removeTab(componentItem) {\n this._tabsContainer.removeTab(componentItem);\n }\n /** @internal */\n processActiveComponentChanged(newActiveComponentItem) {\n this._tabsContainer.processActiveComponentChanged(newActiveComponentItem);\n this.updateTabSizes();\n }\n /** @internal */\n setSide(value) {\n this._side = value;\n this._leftRightSided = [Side.right, Side.left].includes(this._side);\n }\n /**\n * Programmatically set closability.\n * @param value - Whether to enable/disable closability.\n * @returns Whether the action was successful\n * @internal\n */\n setRowColumnClosable(value) {\n this._rowColumnClosable = value;\n this.updateClosability();\n }\n /**\n * Updates the header's closability. If a stack/header is able\n * to close, but has a non closable component added to it, the stack is no\n * longer closable until all components are closable.\n * @internal\n */\n updateClosability() {\n let isClosable;\n if (!this._configClosable) {\n isClosable = false;\n }\n else {\n if (!this._rowColumnClosable) {\n isClosable = false;\n }\n else {\n isClosable = true;\n const len = this.tabs.length;\n for (let i = 0; i < len; i++) {\n const tab = this._tabsContainer.tabs[i];\n const item = tab.componentItem;\n if (!item.isClosable) {\n isClosable = false;\n break;\n }\n }\n }\n }\n if (this._closeButton !== null) {\n setElementDisplayVisibility(this._closeButton.element, isClosable);\n }\n if (this._popoutButton !== null) {\n setElementDisplayVisibility(this._popoutButton.element, isClosable);\n }\n this._canRemoveComponent = isClosable || this._tabsContainer.tabCount > 1;\n }\n /** @internal */\n applyFocusedValue(value) {\n if (value) {\n this._element.classList.add(\"lm_focused\" /* Focused */);\n }\n else {\n this._element.classList.remove(\"lm_focused\" /* Focused */);\n }\n }\n /** @internal */\n processMaximised() {\n if (this._maximiseButton === undefined) {\n throw new UnexpectedUndefinedError('HPMAX16997');\n }\n else {\n this._maximiseButton.element.setAttribute('title', this._minimiseLabel);\n }\n }\n /** @internal */\n processMinimised() {\n if (this._maximiseButton === undefined) {\n throw new UnexpectedUndefinedError('HPMIN16997');\n }\n else {\n this._maximiseButton.element.setAttribute('title', this._maximiseLabel);\n }\n }\n /**\n * Pushes the tabs to the tab dropdown if the available space is not sufficient\n * @internal\n */\n updateTabSizes() {\n if (this._tabsContainer.tabCount > 0) {\n const headerHeight = this._show ? this._layoutManager.layoutConfig.dimensions.headerHeight : 0;\n if (this._leftRightSided) {\n this._element.style.height = '';\n this._element.style.width = numberToPixels(headerHeight);\n }\n else {\n this._element.style.width = '';\n this._element.style.height = numberToPixels(headerHeight);\n }\n let availableWidth;\n if (this._leftRightSided) {\n availableWidth = this._element.offsetHeight - this._controlsContainerElement.offsetHeight - this._tabControlOffset;\n }\n else {\n availableWidth = this._element.offsetWidth - this._controlsContainerElement.offsetWidth - this._tabControlOffset;\n }\n this._tabsContainer.updateTabSizes(availableWidth, this._getActiveComponentItemEvent());\n }\n }\n /** @internal */\n handleTabInitiatedComponentRemoveEvent(componentItem) {\n if (this._canRemoveComponent) {\n if (this._componentRemoveEvent === undefined) {\n throw new UnexpectedUndefinedError('HHTCE22294');\n }\n else {\n this._componentRemoveEvent(componentItem);\n }\n }\n }\n /** @internal */\n handleTabInitiatedComponentFocusEvent(componentItem) {\n if (this._componentFocusEvent === undefined) {\n throw new UnexpectedUndefinedError('HHTAE22294');\n }\n else {\n this._componentFocusEvent(componentItem);\n }\n }\n /** @internal */\n handleTabInitiatedDragStartEvent(x, y, dragListener, componentItem) {\n if (!this._canRemoveComponent) {\n dragListener.cancelDrag();\n }\n else {\n if (this._componentDragStartEvent === undefined) {\n throw new UnexpectedUndefinedError('HHTDSE22294');\n }\n else {\n this._componentDragStartEvent(x, y, dragListener, componentItem);\n }\n }\n }\n /** @internal */\n processTabDropdownActiveChanged() {\n if (this._tabDropdownButton !== undefined) {\n setElementDisplayVisibility(this._tabDropdownButton.element, this._tabsContainer.dropdownActive);\n }\n }\n /** @internal */\n handleButtonPopoutEvent() {\n if (this._layoutManager.layoutConfig.settings.popoutWholeStack) {\n if (this._popoutEvent === undefined) {\n throw new UnexpectedUndefinedError('HHBPOE17834');\n }\n else {\n this._popoutEvent();\n }\n }\n else {\n const activeComponentItem = this._getActiveComponentItemEvent();\n if (activeComponentItem) {\n activeComponentItem.popout();\n }\n // else: if the stack is empty there won't be an active item (and nothing to popout)\n }\n }\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n handleButtonMaximiseToggleEvent(ev) {\n if (this._maximiseToggleEvent === undefined) {\n throw new UnexpectedUndefinedError('HHBMTE16834');\n }\n else {\n this._maximiseToggleEvent();\n }\n }\n /**\n * Invoked when the header's background is clicked (not it's tabs or controls)\n * @internal\n */\n onClick(event) {\n if (event.target === this._element) {\n this.notifyClick(event);\n }\n }\n /**\n * Invoked when the header's background is touched (not it's tabs or controls)\n * @internal\n */\n onTouchStart(event) {\n if (event.target === this._element) {\n this.notifyTouchStart(event);\n }\n }\n /** @internal */\n notifyClick(ev) {\n if (this._clickEvent === undefined) {\n throw new UnexpectedUndefinedError('HNHC46834');\n }\n else {\n this._clickEvent(ev);\n }\n }\n /** @internal */\n notifyTouchStart(ev) {\n if (this._touchStartEvent === undefined) {\n throw new UnexpectedUndefinedError('HNHTS46834');\n }\n else {\n this._touchStartEvent(ev);\n }\n }\n}\n//# sourceMappingURL=header.js.map","import { DragListener } from '../utils/drag-listener';\nimport { numberToPixels } from '../utils/utils';\n/** @internal */\nexport class Splitter {\n constructor(_isVertical, _size, grabSize) {\n this._isVertical = _isVertical;\n this._size = _size;\n this._grabSize = grabSize < this._size ? this._size : grabSize;\n this._element = document.createElement('div');\n this._element.classList.add(\"lm_splitter\" /* Splitter */);\n const dragHandleElement = document.createElement('div');\n dragHandleElement.classList.add(\"lm_drag_handle\" /* DragHandle */);\n const handleExcessSize = this._grabSize - this._size;\n const handleExcessPos = handleExcessSize / 2;\n if (this._isVertical) {\n dragHandleElement.style.top = numberToPixels(-handleExcessPos);\n dragHandleElement.style.height = numberToPixels(this._size + handleExcessSize);\n this._element.classList.add(\"lm_vertical\" /* Vertical */);\n this._element.style.height = numberToPixels(this._size);\n }\n else {\n dragHandleElement.style.left = numberToPixels(-handleExcessPos);\n dragHandleElement.style.width = numberToPixels(this._size + handleExcessSize);\n this._element.classList.add(\"lm_horizontal\" /* Horizontal */);\n this._element.style.width = numberToPixels(this._size);\n }\n this._element.appendChild(dragHandleElement);\n this._dragListener = new DragListener(this._element, [dragHandleElement]);\n }\n get element() { return this._element; }\n destroy() {\n this._element.remove();\n }\n on(eventName, callback) {\n this._dragListener.on(eventName, callback);\n }\n}\n//# sourceMappingURL=splitter.js.map","import { UnexpectedUndefinedError } from '../errors/internal-error';\nimport { DragListener } from '../utils/drag-listener';\n/**\n * Represents an individual tab within a Stack's header\n * @public\n */\nexport class Tab {\n /** @internal */\n constructor(\n /** @internal */\n _layoutManager, \n /** @internal */\n _componentItem, \n /** @internal */\n _closeEvent, \n /** @internal */\n _focusEvent, \n /** @internal */\n _dragStartEvent) {\n var _a;\n this._layoutManager = _layoutManager;\n this._componentItem = _componentItem;\n this._closeEvent = _closeEvent;\n this._focusEvent = _focusEvent;\n this._dragStartEvent = _dragStartEvent;\n /** @internal */\n this._isActive = false;\n /** @internal */\n this._tabClickListener = (ev) => this.onTabClickDown(ev);\n /** @internal */\n this._tabTouchStartListener = (ev) => this.onTabTouchStart(ev);\n /** @internal */\n this._closeClickListener = () => this.onCloseClick();\n /** @internal */\n this._closeTouchStartListener = () => this.onCloseTouchStart();\n // /** @internal */\n // private readonly _closeMouseDownListener = () => this.onCloseMousedown();\n /** @internal */\n this._dragStartListener = (x, y) => this.onDragStart(x, y);\n /** @internal */\n this._contentItemDestroyListener = () => this.onContentItemDestroy();\n /** @internal */\n this._tabTitleChangedListener = (title) => this.setTitle(title);\n this._element = document.createElement('div');\n this._element.classList.add(\"lm_tab\" /* Tab */);\n this._titleElement = document.createElement('span');\n this._titleElement.classList.add(\"lm_title\" /* Title */);\n this._closeElement = document.createElement('div');\n this._closeElement.classList.add(\"lm_close_tab\" /* CloseTab */);\n this._element.appendChild(this._titleElement);\n this._element.appendChild(this._closeElement);\n if (_componentItem.isClosable) {\n this._closeElement.style.display = '';\n }\n else {\n this._closeElement.style.display = 'none';\n }\n this.setTitle(_componentItem.title);\n this._componentItem.on('titleChanged', this._tabTitleChangedListener);\n const reorderEnabled = (_a = _componentItem.reorderEnabled) !== null && _a !== void 0 ? _a : this._layoutManager.layoutConfig.settings.reorderEnabled;\n if (reorderEnabled) {\n this.enableReorder();\n }\n this._element.addEventListener('click', this._tabClickListener, { passive: true });\n this._element.addEventListener('touchstart', this._tabTouchStartListener, { passive: true });\n if (this._componentItem.isClosable) {\n this._closeElement.addEventListener('click', this._closeClickListener, { passive: true });\n this._closeElement.addEventListener('touchstart', this._closeTouchStartListener, { passive: true });\n // this._closeElement.addEventListener('mousedown', this._closeMouseDownListener, { passive: true });\n }\n else {\n this._closeElement.remove();\n this._closeElement = undefined;\n }\n this._componentItem.setTab(this);\n this._layoutManager.emit('tabCreated', this);\n }\n get isActive() { return this._isActive; }\n // get header(): Header { return this._header; }\n get componentItem() { return this._componentItem; }\n /** @deprecated use {@link (Tab:class).componentItem} */\n get contentItem() { return this._componentItem; }\n get element() { return this._element; }\n get titleElement() { return this._titleElement; }\n get closeElement() { return this._closeElement; }\n get reorderEnabled() { return this._dragListener !== undefined; }\n set reorderEnabled(value) {\n if (value !== this.reorderEnabled) {\n if (value) {\n this.enableReorder();\n }\n else {\n this.disableReorder();\n }\n }\n }\n /**\n * Sets the tab's title to the provided string and sets\n * its title attribute to a pure text representation (without\n * html tags) of the same string.\n */\n setTitle(title) {\n this._titleElement.innerText = title;\n this._element.title = title;\n }\n /**\n * Sets this tab's active state. To programmatically\n * switch tabs, use Stack.setActiveComponentItem( item ) instead.\n */\n setActive(isActive) {\n if (isActive === this._isActive) {\n return;\n }\n this._isActive = isActive;\n if (isActive) {\n this._element.classList.add(\"lm_active\" /* Active */);\n }\n else {\n this._element.classList.remove(\"lm_active\" /* Active */);\n }\n }\n /**\n * Destroys the tab\n * @internal\n */\n destroy() {\n var _a, _b;\n this._closeEvent = undefined;\n this._focusEvent = undefined;\n this._dragStartEvent = undefined;\n this._element.removeEventListener('click', this._tabClickListener);\n this._element.removeEventListener('touchstart', this._tabTouchStartListener);\n (_a = this._closeElement) === null || _a === void 0 ? void 0 : _a.removeEventListener('click', this._closeClickListener);\n (_b = this._closeElement) === null || _b === void 0 ? void 0 : _b.removeEventListener('touchstart', this._closeTouchStartListener);\n // this._closeElement?.removeEventListener('mousedown', this._closeMouseDownListener);\n this._componentItem.off('titleChanged', this._tabTitleChangedListener);\n if (this.reorderEnabled) {\n this.disableReorder();\n }\n this._element.remove();\n }\n /** @internal */\n setBlurred() {\n this._element.classList.remove(\"lm_focused\" /* Focused */);\n this._titleElement.classList.remove(\"lm_focused\" /* Focused */);\n }\n /** @internal */\n setFocused() {\n this._element.classList.add(\"lm_focused\" /* Focused */);\n this._titleElement.classList.add(\"lm_focused\" /* Focused */);\n }\n /**\n * Callback for the DragListener\n * @param x - The tabs absolute x position\n * @param y - The tabs absolute y position\n * @internal\n */\n onDragStart(x, y) {\n if (this._dragListener === undefined) {\n throw new UnexpectedUndefinedError('TODSDLU10093');\n }\n else {\n if (this._dragStartEvent === undefined) {\n throw new UnexpectedUndefinedError('TODS23309');\n }\n else {\n this._dragStartEvent(x, y, this._dragListener, this.componentItem);\n }\n }\n }\n /** @internal */\n onContentItemDestroy() {\n if (this._dragListener !== undefined) {\n this._dragListener.destroy();\n this._dragListener = undefined;\n }\n }\n /**\n * Callback when the tab is clicked\n * @internal\n */\n onTabClickDown(event) {\n const target = event.target;\n if (target === this._element || target === this._titleElement) {\n // left mouse button\n if (event.button === 0) {\n // event.stopPropagation();\n this.notifyFocus();\n // middle mouse button\n }\n else if (event.button === 1 && this._componentItem.isClosable) {\n // event.stopPropagation();\n this.notifyClose();\n }\n }\n }\n /** @internal */\n onTabTouchStart(event) {\n if (event.target === this._element) {\n this.notifyFocus();\n }\n }\n /**\n * Callback when the tab's close button is clicked\n * @internal\n */\n onCloseClick() {\n this.notifyClose();\n }\n /** @internal */\n onCloseTouchStart() {\n this.notifyClose();\n }\n /**\n * Callback to capture tab close button mousedown\n * to prevent tab from activating.\n * @internal\n */\n // private onCloseMousedown(): void {\n // // event.stopPropagation();\n // }\n /** @internal */\n notifyClose() {\n if (this._closeEvent === undefined) {\n throw new UnexpectedUndefinedError('TNC15007');\n }\n else {\n this._closeEvent(this._componentItem);\n }\n }\n /** @internal */\n notifyFocus() {\n if (this._focusEvent === undefined) {\n throw new UnexpectedUndefinedError('TNA15007');\n }\n else {\n this._focusEvent(this._componentItem);\n }\n }\n /** @internal */\n enableReorder() {\n this._dragListener = new DragListener(this._element, [this._titleElement]);\n this._dragListener.on('dragStart', this._dragStartListener);\n this._componentItem.on('destroy', this._contentItemDestroyListener);\n }\n /** @internal */\n disableReorder() {\n if (this._dragListener === undefined) {\n throw new UnexpectedUndefinedError('TDR87745');\n }\n else {\n this._componentItem.off('destroy', this._contentItemDestroyListener);\n this._dragListener.off('dragStart', this._dragStartListener);\n this._dragListener = undefined;\n }\n }\n}\n//# sourceMappingURL=tab.js.map","import { AssertError } from '../errors/internal-error';\nimport { numberToPixels, pixelsToNumber } from '../utils/utils';\nimport { Tab } from './tab';\n/** @internal */\nexport class TabsContainer {\n constructor(_layoutManager, _componentRemoveEvent, _componentFocusEvent, _componentDragStartEvent, _dropdownActiveChangedEvent) {\n this._layoutManager = _layoutManager;\n this._componentRemoveEvent = _componentRemoveEvent;\n this._componentFocusEvent = _componentFocusEvent;\n this._componentDragStartEvent = _componentDragStartEvent;\n this._dropdownActiveChangedEvent = _dropdownActiveChangedEvent;\n // There is one tab per ComponentItem in stack. However they may not be ordered the same\n this._tabs = [];\n this._lastVisibleTabIndex = -1;\n this._dropdownActive = false;\n this._element = document.createElement('section');\n this._element.classList.add(\"lm_tabs\" /* Tabs */);\n this._dropdownElement = document.createElement('section');\n this._dropdownElement.classList.add(\"lm_tabdropdown_list\" /* TabDropdownList */);\n this._dropdownElement.style.display = 'none';\n }\n get tabs() { return this._tabs; }\n get tabCount() { return this._tabs.length; }\n get lastVisibleTabIndex() { return this._lastVisibleTabIndex; }\n get element() { return this._element; }\n get dropdownElement() { return this._dropdownElement; }\n get dropdownActive() { return this._dropdownActive; }\n destroy() {\n for (let i = 0; i < this._tabs.length; i++) {\n this._tabs[i].destroy();\n }\n }\n /**\n * Creates a new tab and associates it with a contentItem\n * @param index - The position of the tab\n */\n createTab(componentItem, index) {\n //If there's already a tab relating to the\n //content item, don't do anything\n for (let i = 0; i < this._tabs.length; i++) {\n if (this._tabs[i].componentItem === componentItem) {\n return;\n }\n }\n const tab = new Tab(this._layoutManager, componentItem, (item) => this.handleTabCloseEvent(item), (item) => this.handleTabFocusEvent(item), (x, y, dragListener, item) => this.handleTabDragStartEvent(x, y, dragListener, item));\n if (index === undefined) {\n index = this._tabs.length;\n }\n this._tabs.splice(index, 0, tab);\n if (index < this._element.childNodes.length) {\n this._element.insertBefore(tab.element, this._element.childNodes[index]);\n }\n else {\n this._element.appendChild(tab.element);\n }\n }\n removeTab(componentItem) {\n // componentItem cannot be ActiveComponentItem\n for (let i = 0; i < this._tabs.length; i++) {\n if (this._tabs[i].componentItem === componentItem) {\n const tab = this._tabs[i];\n tab.destroy();\n this._tabs.splice(i, 1);\n return;\n }\n }\n throw new Error('contentItem is not controlled by this header');\n }\n processActiveComponentChanged(newActiveComponentItem) {\n let activeIndex = -1;\n for (let i = 0; i < this._tabs.length; i++) {\n const isActive = this._tabs[i].componentItem === newActiveComponentItem;\n this._tabs[i].setActive(isActive);\n if (isActive) {\n activeIndex = i;\n }\n }\n if (activeIndex < 0) {\n throw new AssertError('HSACI56632');\n }\n else {\n if (this._layoutManager.layoutConfig.settings.reorderOnTabMenuClick) {\n /**\n * If the tab selected was in the dropdown, move everything down one to make way for this one to be the first.\n * This will make sure the most used tabs stay visible.\n */\n if (this._lastVisibleTabIndex !== -1 && activeIndex > this._lastVisibleTabIndex) {\n const activeTab = this._tabs[activeIndex];\n for (let j = activeIndex; j > 0; j--) {\n this._tabs[j] = this._tabs[j - 1];\n }\n this._tabs[0] = activeTab;\n // updateTabSizes will always be called after this and it will reposition tab elements\n }\n }\n }\n }\n /**\n * Pushes the tabs to the tab dropdown if the available space is not sufficient\n */\n updateTabSizes(availableWidth, activeComponentItem) {\n let dropDownActive = false;\n const success = this.tryUpdateTabSizes(dropDownActive, availableWidth, activeComponentItem);\n if (!success) {\n dropDownActive = true;\n // this will always succeed\n this.tryUpdateTabSizes(dropDownActive, availableWidth, activeComponentItem);\n }\n if (dropDownActive !== this._dropdownActive) {\n this._dropdownActive = dropDownActive;\n this._dropdownActiveChangedEvent();\n }\n }\n tryUpdateTabSizes(dropdownActive, availableWidth, activeComponentItem) {\n if (this._tabs.length > 0) {\n if (activeComponentItem === undefined) {\n throw new Error('non-empty tabs must have active component item');\n }\n let cumulativeTabWidth = 0;\n let tabOverlapAllowanceExceeded = false;\n const tabOverlapAllowance = this._layoutManager.layoutConfig.settings.tabOverlapAllowance;\n const activeIndex = this._tabs.indexOf(activeComponentItem.tab);\n const activeTab = this._tabs[activeIndex];\n this._lastVisibleTabIndex = -1;\n for (let i = 0; i < this._tabs.length; i++) {\n const tabElement = this._tabs[i].element;\n //Put the tab in the tabContainer so its true width can be checked\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n const tabMarginRightPixels = getComputedStyle(activeTab.element).marginRight;\n const tabMarginRight = pixelsToNumber(tabMarginRightPixels);\n const tabWidth = tabElement.offsetWidth + tabMarginRight;\n cumulativeTabWidth += tabWidth;\n //Include the active tab's width if it isn't already\n //This is to ensure there is room to show the active tab\n let visibleTabWidth = 0;\n if (activeIndex <= i) {\n visibleTabWidth = cumulativeTabWidth;\n }\n else {\n const activeTabMarginRightPixels = getComputedStyle(activeTab.element).marginRight;\n const activeTabMarginRight = pixelsToNumber(activeTabMarginRightPixels);\n visibleTabWidth = cumulativeTabWidth + activeTab.element.offsetWidth + activeTabMarginRight;\n }\n // If the tabs won't fit, check the overlap allowance.\n if (visibleTabWidth > availableWidth) {\n //Once allowance is exceeded, all remaining tabs go to menu.\n if (!tabOverlapAllowanceExceeded) {\n //No overlap for first tab or active tab\n //Overlap spreads among non-active, non-first tabs\n let overlap;\n if (activeIndex > 0 && activeIndex <= i) {\n overlap = (visibleTabWidth - availableWidth) / (i - 1);\n }\n else {\n overlap = (visibleTabWidth - availableWidth) / i;\n }\n //Check overlap against allowance.\n if (overlap < tabOverlapAllowance) {\n for (let j = 0; j <= i; j++) {\n const marginLeft = (j !== activeIndex && j !== 0) ? '-' + numberToPixels(overlap) : '';\n this._tabs[j].element.style.zIndex = numberToPixels(i - j);\n this._tabs[j].element.style.marginLeft = marginLeft;\n }\n this._lastVisibleTabIndex = i;\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n }\n else {\n tabOverlapAllowanceExceeded = true;\n }\n }\n else if (i === activeIndex) {\n //Active tab should show even if allowance exceeded. (We left room.)\n tabElement.style.zIndex = 'auto';\n tabElement.style.marginLeft = '';\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n }\n if (tabOverlapAllowanceExceeded && i !== activeIndex) {\n if (dropdownActive) {\n //Tab menu already shown, so we just add to it.\n tabElement.style.zIndex = 'auto';\n tabElement.style.marginLeft = '';\n if (tabElement.parentElement !== this._dropdownElement) {\n this._dropdownElement.appendChild(tabElement);\n }\n }\n else {\n //We now know the tab menu must be shown, so we have to recalculate everything.\n return false;\n }\n }\n }\n else {\n this._lastVisibleTabIndex = i;\n tabElement.style.zIndex = 'auto';\n tabElement.style.marginLeft = '';\n if (tabElement.parentElement !== this._element) {\n this._element.appendChild(tabElement);\n }\n }\n }\n }\n return true;\n }\n /**\n * Shows drop down for additional tabs when there are too many to display.\n */\n showAdditionalTabsDropdown() {\n this._dropdownElement.style.display = '';\n }\n /**\n * Hides drop down for additional tabs when there are too many to display.\n */\n hideAdditionalTabsDropdown() {\n this._dropdownElement.style.display = 'none';\n }\n handleTabCloseEvent(componentItem) {\n this._componentRemoveEvent(componentItem);\n }\n handleTabFocusEvent(componentItem) {\n this._componentFocusEvent(componentItem);\n }\n handleTabDragStartEvent(x, y, dragListener, componentItem) {\n this._componentDragStartEvent(x, y, dragListener, componentItem);\n }\n}\n//# sourceMappingURL=tabs-container.js.map","/** @internal @deprecated To be removed */\nexport class TransitionIndicator {\n constructor() {\n this._element = document.createElement('div');\n this._element.classList.add(\"lm_transition_indicator\" /* TransitionIndicator */);\n document.body.appendChild(this._element);\n this._toElement = null;\n this._fromDimensions = null;\n this._totalAnimationDuration = 200;\n this._animationStartTime = null;\n }\n destroy() {\n this._element.remove();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n transitionElements(fromElement, toElement) {\n /**\n * TODO - This is not quite as cool as expected. Review.\n */\n return;\n // this._toElement = toElement;\n // this._animationStartTime = now();\n // this._fromDimensions = this._measure(fromElement);\n // this._fromDimensions.opacity = 0.8;\n // this._element.show().css(this._fromDimensions);\n // animFrame(fnBind(this._nextAnimationFrame, this));\n }\n nextAnimationFrame() {\n // if (this._toElement === null || this._fromDimensions === null || this._animationStartTime === null) {\n // throw new UnexpectedNullError('TINAFTD97115');\n // } else {\n // const toDimensions = this.measure(this._toElement);\n // const animationProgress = (now() - this._animationStartTime) / this._totalAnimationDuration;\n // const currentFrameStyles = {};\n // const cssProperty;\n // if (animationProgress >= 1) {\n // this._element.style.display = 'none';\n // return;\n // }\n // toDimensions.opacity = 0;\n // for (const cssProperty in this._fromDimensions) {\n // currentFrameStyles[cssProperty] = this._fromDimensions[cssProperty] +\n // (toDimensions[cssProperty] - this._fromDimensions[cssProperty]) *\n // animationProgress;\n // }\n // this._element.css(currentFrameStyles);\n // animFrame(fnBind(this._nextAnimationFrame, this));\n // }\n }\n measure(element) {\n const rect = element.getBoundingClientRect();\n return {\n left: rect.left,\n top: rect.top,\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n }\n}\n//# sourceMappingURL=transition-indicator.js.map","/** @public */\nexport class ExternalError extends Error {\n /** @internal */\n constructor(type, message) {\n super(message);\n this.type = type;\n }\n}\n/** @public */\nexport class ConfigurationError extends ExternalError {\n /** @internal */\n constructor(message, node) {\n super('Configuration', message);\n this.node = node;\n }\n}\n/** @public */\nexport class PopoutBlockedError extends ExternalError {\n /** @internal */\n constructor(message) {\n super('PopoutBlocked', message);\n }\n}\n/** @public */\nexport class ApiError extends ExternalError {\n /** @internal */\n constructor(message) {\n super('API', message);\n }\n}\n/** @public */\nexport class BindError extends ExternalError {\n /** @internal */\n constructor(message) {\n super('Bind', message);\n }\n}\n//# sourceMappingURL=external-error.js.map","/** @internal */\nclass InternalError extends Error {\n constructor(type, code, message) {\n super(`${type}: ${code}${message === undefined ? '' : ': ' + message}`);\n }\n}\n/** @internal */\nexport class AssertError extends InternalError {\n constructor(code, message) {\n super('Assert', code, message);\n }\n}\n/** @internal */\nexport class UnreachableCaseError extends InternalError {\n constructor(code, variableValue, message) {\n super('UnreachableCase', code, `${variableValue}${message === undefined ? '' : ': ' + message}`);\n }\n}\n/** @internal */\nexport class UnexpectedNullError extends InternalError {\n constructor(code, message) {\n super('UnexpectedNull', code, message);\n }\n}\n/** @internal */\nexport class UnexpectedUndefinedError extends InternalError {\n constructor(code, message) {\n super('UnexpectedUndefined', code, message);\n }\n}\n//# sourceMappingURL=internal-error.js.map","import { ResolvedComponentItemConfig } from './config/resolved-config';\nimport { ApiError, BindError } from './errors/external-error';\nimport { AssertError, UnexpectedUndefinedError } from './errors/internal-error';\nimport { i18nStrings } from './utils/i18n-strings';\nimport { deepExtendValue, ensureElementPositionAbsolute, numberToPixels, setElementDisplayVisibility, setElementHeight, setElementWidth } from './utils/utils';\nimport { VirtualLayout } from './virtual-layout';\n/** @public */\nexport class GoldenLayout extends VirtualLayout {\n /** @internal */\n constructor(configOrOptionalContainer, containerOrBindComponentEventHandler, unbindComponentEventHandler) {\n super(configOrOptionalContainer, containerOrBindComponentEventHandler, unbindComponentEventHandler, true);\n /** @internal */\n this._componentTypesMap = new Map();\n /** @internal */\n this._registeredComponentMap = new Map();\n /** @internal */\n this._virtuableComponentMap = new Map();\n /** @internal */\n this._containerVirtualRectingRequiredEventListener = (container, width, height) => this.handleContainerVirtualRectingRequiredEvent(container, width, height);\n /** @internal */\n this._containerVirtualVisibilityChangeRequiredEventListener = (container, visible) => this.handleContainerVirtualVisibilityChangeRequiredEvent(container, visible);\n /** @internal */\n this._containerVirtualZIndexChangeRequiredEventListener = (container, logicalZIndex, defaultZIndex) => this.handleContainerVirtualZIndexChangeRequiredEvent(container, logicalZIndex, defaultZIndex);\n // we told VirtualLayout to not call init() (skipInit set to true) so that Golden Layout can initialise its properties before init is called\n if (!this.deprecatedConstructor) {\n this.init();\n }\n }\n /**\n * Register a new component type with the layout manager.\n *\n * @deprecated See {@link https://stackoverflow.com/questions/40922531/how-to-check-if-a-javascript-function-is-a-constructor}\n * instead use {@link (GoldenLayout:class).registerComponentConstructor}\n * or {@link (GoldenLayout:class).registerComponentFactoryFunction}\n */\n registerComponent(name, componentConstructorOrFactoryFtn, virtual = false) {\n if (typeof componentConstructorOrFactoryFtn !== 'function') {\n throw new ApiError('registerComponent() componentConstructorOrFactoryFtn parameter is not a function');\n }\n else {\n if (componentConstructorOrFactoryFtn.hasOwnProperty('prototype')) {\n const componentConstructor = componentConstructorOrFactoryFtn;\n this.registerComponentConstructor(name, componentConstructor, virtual);\n }\n else {\n const componentFactoryFtn = componentConstructorOrFactoryFtn;\n this.registerComponentFactoryFunction(name, componentFactoryFtn, virtual);\n }\n }\n }\n /**\n * Register a new component type with the layout manager.\n */\n registerComponentConstructor(typeName, componentConstructor, virtual = false) {\n if (typeof componentConstructor !== 'function') {\n throw new Error(i18nStrings[1 /* PleaseRegisterAConstructorFunction */]);\n }\n const existingComponentType = this._componentTypesMap.get(typeName);\n if (existingComponentType !== undefined) {\n throw new BindError(`${i18nStrings[3 /* ComponentIsAlreadyRegistered */]}: ${typeName}`);\n }\n this._componentTypesMap.set(typeName, {\n constructor: componentConstructor,\n factoryFunction: undefined,\n virtual,\n });\n }\n /**\n * Register a new component with the layout manager.\n */\n registerComponentFactoryFunction(typeName, componentFactoryFunction, virtual = false) {\n if (typeof componentFactoryFunction !== 'function') {\n throw new BindError('Please register a constructor function');\n }\n const existingComponentType = this._componentTypesMap.get(typeName);\n if (existingComponentType !== undefined) {\n throw new BindError(`${i18nStrings[3 /* ComponentIsAlreadyRegistered */]}: ${typeName}`);\n }\n this._componentTypesMap.set(typeName, {\n constructor: undefined,\n factoryFunction: componentFactoryFunction,\n virtual,\n });\n }\n /**\n * Register a component function with the layout manager. This function should\n * return a constructor for a component based on a config.\n * This function will be called if a component type with the required name is not already registered.\n * It is recommended that applications use the {@link (VirtualLayout:class).getComponentEvent} and\n * {@link (VirtualLayout:class).releaseComponentEvent} instead of registering a constructor callback\n * @deprecated use {@link (GoldenLayout:class).registerGetComponentConstructorCallback}\n */\n registerComponentFunction(callback) {\n this.registerGetComponentConstructorCallback(callback);\n }\n /**\n * Register a callback closure with the layout manager which supplies a Component Constructor.\n * This callback should return a constructor for a component based on a config.\n * This function will be called if a component type with the required name is not already registered.\n * It is recommended that applications use the {@link (VirtualLayout:class).getComponentEvent} and\n * {@link (VirtualLayout:class).releaseComponentEvent} instead of registering a constructor callback\n */\n registerGetComponentConstructorCallback(callback) {\n if (typeof callback !== 'function') {\n throw new Error('Please register a callback function');\n }\n if (this._getComponentConstructorFtn !== undefined) {\n console.warn('Multiple component functions are being registered. Only the final registered function will be used.');\n }\n this._getComponentConstructorFtn = callback;\n }\n getRegisteredComponentTypeNames() {\n const typeNamesIterableIterator = this._componentTypesMap.keys();\n return Array.from(typeNamesIterableIterator);\n }\n /**\n * Returns a previously registered component instantiator. Attempts to utilize registered\n * component type by first, then falls back to the component constructor callback function (if registered).\n * If neither gets an instantiator, then returns `undefined`.\n * Note that `undefined` will return if config.componentType is not a string\n *\n * @param config - The item config\n * @public\n */\n getComponentInstantiator(config) {\n let instantiator;\n const typeName = ResolvedComponentItemConfig.resolveComponentTypeName(config);\n if (typeName !== undefined) {\n instantiator = this._componentTypesMap.get(typeName);\n }\n if (instantiator === undefined) {\n if (this._getComponentConstructorFtn !== undefined) {\n instantiator = {\n constructor: this._getComponentConstructorFtn(config),\n factoryFunction: undefined,\n virtual: false,\n };\n }\n }\n return instantiator;\n }\n /** @internal */\n bindComponent(container, itemConfig) {\n let instantiator;\n const typeName = ResolvedComponentItemConfig.resolveComponentTypeName(itemConfig);\n if (typeName !== undefined) {\n instantiator = this._componentTypesMap.get(typeName);\n }\n if (instantiator === undefined) {\n if (this._getComponentConstructorFtn !== undefined) {\n instantiator = {\n constructor: this._getComponentConstructorFtn(itemConfig),\n factoryFunction: undefined,\n virtual: false,\n };\n }\n }\n let result;\n if (instantiator !== undefined) {\n const virtual = instantiator.virtual;\n // handle case where component is obtained by name or component constructor callback\n let componentState;\n if (itemConfig.componentState === undefined) {\n componentState = undefined;\n }\n else {\n // make copy\n componentState = deepExtendValue({}, itemConfig.componentState);\n }\n let component;\n const componentConstructor = instantiator.constructor;\n if (componentConstructor !== undefined) {\n component = new componentConstructor(container, componentState, virtual);\n }\n else {\n const factoryFunction = instantiator.factoryFunction;\n if (factoryFunction !== undefined) {\n component = factoryFunction(container, componentState, virtual);\n }\n else {\n throw new AssertError('LMBCFFU10008');\n }\n }\n if (virtual) {\n if (component === undefined) {\n throw new UnexpectedUndefinedError('GLBCVCU988774');\n }\n else {\n const virtuableComponent = component;\n const componentRootElement = virtuableComponent.rootHtmlElement;\n if (componentRootElement === undefined) {\n throw new BindError(`${i18nStrings[5 /* VirtualComponentDoesNotHaveRootHtmlElement */]}: ${typeName}`);\n }\n else {\n ensureElementPositionAbsolute(componentRootElement);\n this.container.appendChild(componentRootElement);\n this._virtuableComponentMap.set(container, virtuableComponent);\n container.virtualRectingRequiredEvent = this._containerVirtualRectingRequiredEventListener;\n container.virtualVisibilityChangeRequiredEvent = this._containerVirtualVisibilityChangeRequiredEventListener;\n container.virtualZIndexChangeRequiredEvent = this._containerVirtualZIndexChangeRequiredEventListener;\n }\n }\n }\n this._registeredComponentMap.set(container, component);\n result = {\n virtual: instantiator.virtual,\n component,\n };\n }\n else {\n // Use getComponentEvent\n result = super.bindComponent(container, itemConfig);\n }\n return result;\n }\n /** @internal */\n unbindComponent(container, virtual, component) {\n const registeredComponent = this._registeredComponentMap.get(container);\n if (registeredComponent === undefined) {\n super.unbindComponent(container, virtual, component); // was not created from registration so use virtual unbind events\n }\n else {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent !== undefined) {\n const componentRootElement = virtuableComponent.rootHtmlElement;\n if (componentRootElement === undefined) {\n throw new AssertError('GLUC77743', container.title);\n }\n else {\n this.container.removeChild(componentRootElement);\n this._virtuableComponentMap.delete(container);\n }\n }\n }\n }\n fireBeforeVirtualRectingEvent(count) {\n this._goldenLayoutBoundingClientRect = this.container.getBoundingClientRect();\n super.fireBeforeVirtualRectingEvent(count);\n }\n /** @internal */\n handleContainerVirtualRectingRequiredEvent(container, width, height) {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent === undefined) {\n throw new UnexpectedUndefinedError('GLHCSCE55933');\n }\n else {\n const rootElement = virtuableComponent.rootHtmlElement;\n if (rootElement === undefined) {\n throw new BindError(i18nStrings[4 /* ComponentIsNotVirtuable */] + ' ' + container.title);\n }\n else {\n const containerBoundingClientRect = container.element.getBoundingClientRect();\n const left = containerBoundingClientRect.left - this._goldenLayoutBoundingClientRect.left;\n rootElement.style.left = numberToPixels(left);\n const top = containerBoundingClientRect.top - this._goldenLayoutBoundingClientRect.top;\n rootElement.style.top = numberToPixels(top);\n setElementWidth(rootElement, width);\n setElementHeight(rootElement, height);\n }\n }\n }\n /** @internal */\n handleContainerVirtualVisibilityChangeRequiredEvent(container, visible) {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent === undefined) {\n throw new UnexpectedUndefinedError('GLHCVVCRE55934');\n }\n else {\n const rootElement = virtuableComponent.rootHtmlElement;\n if (rootElement === undefined) {\n throw new BindError(i18nStrings[4 /* ComponentIsNotVirtuable */] + ' ' + container.title);\n }\n else {\n setElementDisplayVisibility(rootElement, visible);\n }\n }\n }\n /** @internal */\n handleContainerVirtualZIndexChangeRequiredEvent(container, logicalZIndex, defaultZIndex) {\n const virtuableComponent = this._virtuableComponentMap.get(container);\n if (virtuableComponent === undefined) {\n throw new UnexpectedUndefinedError('GLHCVZICRE55935');\n }\n else {\n const rootElement = virtuableComponent.rootHtmlElement;\n if (rootElement === undefined) {\n throw new BindError(i18nStrings[4 /* ComponentIsNotVirtuable */] + ' ' + container.title);\n }\n else {\n rootElement.style.zIndex = defaultZIndex;\n }\n }\n }\n}\n//# sourceMappingURL=golden-layout.js.map","import { ResolvedComponentItemConfig, ResolvedHeaderedItemConfig } from '../config/resolved-config';\nimport { ComponentContainer } from '../container/component-container';\nimport { UnexpectedNullError } from '../errors/internal-error';\nimport { ItemType } from '../utils/types';\nimport { getElementWidthAndHeight, setElementHeight, setElementWidth } from '../utils/utils';\nimport { ContentItem } from './content-item';\n/** @public */\nexport class ComponentItem extends ContentItem {\n /** @internal */\n constructor(layoutManager, config, \n /** @internal */\n _parentItem) {\n super(layoutManager, config, _parentItem, document.createElement('div'));\n this._parentItem = _parentItem;\n /** @internal */\n this._focused = false;\n this.isComponent = true;\n this._reorderEnabled = config.reorderEnabled;\n this.applyUpdatableConfig(config);\n this._initialWantMaximise = config.maximised;\n const containerElement = document.createElement('div');\n containerElement.classList.add(\"lm_content\" /* Content */);\n this.element.appendChild(containerElement);\n this._container = new ComponentContainer(config, this, layoutManager, containerElement, (itemConfig) => this.handleUpdateItemConfigEvent(itemConfig), () => this.show(), () => this.hide(), (suppressEvent) => this.focus(suppressEvent), (suppressEvent) => this.blur(suppressEvent));\n }\n /** @internal @deprecated use {@link (ComponentItem:class).componentType} */\n get componentName() { return this._container.componentType; }\n get componentType() { return this._container.componentType; }\n get reorderEnabled() { return this._reorderEnabled; }\n /** @internal */\n get initialWantMaximise() { return this._initialWantMaximise; }\n get component() { return this._container.component; }\n get container() { return this._container; }\n get parentItem() { return this._parentItem; }\n get headerConfig() { return this._headerConfig; }\n get title() { return this._title; }\n get tab() { return this._tab; }\n get focused() { return this._focused; }\n /** @internal */\n destroy() {\n this._container.destroy();\n super.destroy();\n }\n applyUpdatableConfig(config) {\n this.setTitle(config.title);\n this._headerConfig = config.header;\n }\n toConfig() {\n const stateRequestEvent = this._container.stateRequestEvent;\n const state = stateRequestEvent === undefined ? this._container.state : stateRequestEvent();\n const result = {\n type: ItemType.component,\n content: [],\n size: this.size,\n sizeUnit: this.sizeUnit,\n minSize: this.minSize,\n minSizeUnit: this.minSizeUnit,\n id: this.id,\n maximised: false,\n isClosable: this.isClosable,\n reorderEnabled: this._reorderEnabled,\n title: this._title,\n header: ResolvedHeaderedItemConfig.Header.createCopy(this._headerConfig),\n componentType: ResolvedComponentItemConfig.copyComponentType(this.componentType),\n componentState: state,\n };\n return result;\n }\n close() {\n if (this.parent === null) {\n throw new UnexpectedNullError('CIC68883');\n }\n else {\n this.parent.removeChild(this, false);\n }\n }\n // Used by Drag Proxy\n /** @internal */\n enterDragMode(width, height) {\n setElementWidth(this.element, width);\n setElementHeight(this.element, height);\n this._container.enterDragMode(width, height);\n }\n /** @internal */\n exitDragMode() {\n this._container.exitDragMode();\n }\n /** @internal */\n enterStackMaximised() {\n this._container.enterStackMaximised();\n }\n /** @internal */\n exitStackMaximised() {\n this._container.exitStackMaximised();\n }\n // Used by Drag Proxy\n /** @internal */\n drag() {\n this._container.drag();\n }\n /** @internal */\n updateSize(force) {\n this.updateNodeSize(force);\n }\n /** @internal */\n init() {\n this.updateNodeSize(false);\n super.init();\n this._container.emit('open');\n this.initContentItems();\n }\n /**\n * Set this component's title\n *\n * @public\n * @param title -\n */\n setTitle(title) {\n this._title = title;\n this.emit('titleChanged', title);\n this.emit('stateChanged');\n }\n setTab(tab) {\n this._tab = tab;\n this.emit('tab', tab);\n this._container.setTab(tab);\n }\n /** @internal */\n hide() {\n super.hide();\n this._container.setVisibility(false);\n }\n /** @internal */\n show() {\n super.show();\n this._container.setVisibility(true);\n }\n /**\n * Focuses the item if it is not already focused\n */\n focus(suppressEvent = false) {\n this.parentItem.setActiveComponentItem(this, true, suppressEvent);\n }\n /** @internal */\n setFocused(suppressEvent) {\n this._focused = true;\n this.tab.setFocused();\n if (!suppressEvent) {\n this.emitBaseBubblingEvent('focus');\n }\n }\n /**\n * Blurs (defocuses) the item if it is focused\n */\n blur(suppressEvent = false) {\n if (this._focused) {\n this.layoutManager.setFocusedComponentItem(undefined, suppressEvent);\n }\n }\n /** @internal */\n setBlurred(suppressEvent) {\n this._focused = false;\n this.tab.setBlurred();\n if (!suppressEvent) {\n this.emitBaseBubblingEvent('blur');\n }\n }\n /** @internal */\n setParent(parent) {\n this._parentItem = parent;\n super.setParent(parent);\n }\n /** @internal */\n handleUpdateItemConfigEvent(itemConfig) {\n this.applyUpdatableConfig(itemConfig);\n }\n /** @internal */\n updateNodeSize(force) {\n if (this.element.style.display !== 'none') {\n // Do not update size of hidden components to prevent unwanted reflows\n const { width, height } = getElementWidthAndHeight(this.element);\n this._container.setSizeToNodeSize(width, height, force);\n }\n }\n}\n//# sourceMappingURL=component-item.js.map","import { ContentItem } from './content-item';\nexport class ComponentParentableItem extends ContentItem {\n constructor() {\n super(...arguments);\n /** @internal */\n this._focused = false;\n }\n get focused() { return this._focused; }\n /** @internal */\n setFocusedValue(value) {\n this._focused = value;\n }\n}\n//# sourceMappingURL=component-parentable-item.js.map","import { AssertError, UnexpectedNullError } from '../errors/internal-error';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { getUniqueId, setElementDisplayVisibility } from '../utils/utils';\n/**\n * This is the baseclass that all content items inherit from.\n * Most methods provide a subset of what the sub-classes do.\n *\n * It also provides a number of functions for tree traversal\n * @public\n */\nexport class ContentItem extends EventEmitter {\n /** @internal */\n constructor(layoutManager, config, \n /** @internal */\n _parent, \n /** @internal */\n _element) {\n super();\n this.layoutManager = layoutManager;\n this._parent = _parent;\n this._element = _element;\n /** @internal */\n this._popInParentIds = [];\n this._type = config.type;\n this._id = config.id;\n this._isInitialised = false;\n this.isGround = false;\n this.isRow = false;\n this.isColumn = false;\n this.isStack = false;\n this.isComponent = false;\n this.size = config.size;\n this.sizeUnit = config.sizeUnit;\n this.minSize = config.minSize;\n this.minSizeUnit = config.minSizeUnit;\n this._isClosable = config.isClosable;\n this._pendingEventPropagations = {};\n this._throttledEvents = ['stateChanged'];\n this._contentItems = this.createContentItems(config.content);\n }\n get type() { return this._type; }\n get id() { return this._id; }\n set id(value) { this._id = value; }\n /** @internal */\n get popInParentIds() { return this._popInParentIds; }\n get parent() { return this._parent; }\n get contentItems() { return this._contentItems; }\n get isClosable() { return this._isClosable; }\n get element() { return this._element; }\n get isInitialised() { return this._isInitialised; }\n static isStack(item) {\n return item.isStack;\n }\n static isComponentItem(item) {\n return item.isComponent;\n }\n static isComponentParentableItem(item) {\n return item.isStack || item.isGround;\n }\n /**\n * Removes a child node (and its children) from the tree\n * @param contentItem - The child item to remove\n * @param keepChild - Whether to destroy the removed item\n */\n removeChild(contentItem, keepChild = false) {\n /*\n * Get the position of the item that's to be removed within all content items this node contains\n */\n const index = this._contentItems.indexOf(contentItem);\n /*\n * Make sure the content item to be removed is actually a child of this item\n */\n if (index === -1) {\n throw new Error('Can\\'t remove child item. Unknown content item');\n }\n /**\n * Call destroy on the content item.\n * All children are destroyed as well\n */\n if (!keepChild) {\n this._contentItems[index].destroy();\n }\n /**\n * Remove the content item from this nodes array of children\n */\n this._contentItems.splice(index, 1);\n /**\n * If this node still contains other content items, adjust their size\n */\n if (this._contentItems.length > 0) {\n this.updateSize(false);\n }\n else {\n /**\n * If this was the last content item, remove this node as well\n */\n if (!this.isGround && this._isClosable === true) {\n if (this._parent === null) {\n throw new UnexpectedNullError('CIUC00874');\n }\n else {\n this._parent.removeChild(this);\n }\n }\n }\n }\n /**\n * Sets up the tree structure for the newly added child\n * The responsibility for the actual DOM manipulations lies\n * with the concrete item\n *\n * @param contentItem -\n * @param index - If omitted item will be appended\n * @param suspendResize - Used by descendent implementations\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n addChild(contentItem, index, suspendResize) {\n index !== null && index !== void 0 ? index : (index = this._contentItems.length);\n this._contentItems.splice(index, 0, contentItem);\n contentItem.setParent(this);\n if (this._isInitialised === true && contentItem._isInitialised === false) {\n contentItem.init();\n }\n return index;\n }\n /**\n * Replaces oldChild with newChild\n * @param oldChild -\n * @param newChild -\n * @internal\n */\n replaceChild(oldChild, newChild, destroyOldChild = false) {\n // Do not try to replace ComponentItem - will not work\n const index = this._contentItems.indexOf(oldChild);\n const parentNode = oldChild._element.parentNode;\n if (index === -1) {\n throw new AssertError('CIRCI23232', 'Can\\'t replace child. oldChild is not child of this');\n }\n if (parentNode === null) {\n throw new UnexpectedNullError('CIRCP23232');\n }\n else {\n parentNode.replaceChild(newChild._element, oldChild._element);\n /*\n * Optionally destroy the old content item\n */\n if (destroyOldChild === true) {\n oldChild._parent = null;\n oldChild.destroy(); // will now also destroy all children of oldChild\n }\n /*\n * Wire the new contentItem into the tree\n */\n this._contentItems[index] = newChild;\n newChild.setParent(this);\n // newChild inherits the sizes from the old child:\n newChild.size = oldChild.size;\n newChild.sizeUnit = oldChild.sizeUnit;\n newChild.minSize = oldChild.minSize;\n newChild.minSizeUnit = oldChild.minSizeUnit;\n //TODO This doesn't update the config... refactor to leave item nodes untouched after creation\n if (newChild._parent === null) {\n throw new UnexpectedNullError('CIRCNC45699');\n }\n else {\n if (newChild._parent._isInitialised === true && newChild._isInitialised === false) {\n newChild.init();\n }\n this.updateSize(false);\n }\n }\n }\n /**\n * Convenience method.\n * Shorthand for this.parent.removeChild( this )\n */\n remove() {\n if (this._parent === null) {\n throw new UnexpectedNullError('CIR11110');\n }\n else {\n this._parent.removeChild(this);\n }\n }\n /**\n * Removes the component from the layout and creates a new\n * browser window with the component and its children inside\n */\n popout() {\n const parentId = getUniqueId();\n const browserPopout = this.layoutManager.createPopoutFromContentItem(this, undefined, parentId, undefined);\n this.emitBaseBubblingEvent('stateChanged');\n return browserPopout;\n }\n /** @internal */\n calculateConfigContent() {\n const contentItems = this._contentItems;\n const count = contentItems.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const item = contentItems[i];\n result[i] = item.toConfig();\n }\n return result;\n }\n /** @internal */\n highlightDropZone(x, y, area) {\n const dropTargetIndicator = this.layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('ACIHDZ5593');\n }\n else {\n dropTargetIndicator.highlightArea(area, 1);\n }\n }\n /** @internal */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDrop(contentItem, area) {\n this.addChild(contentItem);\n }\n /** @internal */\n show() {\n this.layoutManager.beginSizeInvalidation();\n try {\n // Not sure why showAllActiveContentItems() was called. GoldenLayout seems to work fine without it. Left commented code\n // in source in case a reason for it becomes apparent.\n // this.layoutManager.showAllActiveContentItems();\n setElementDisplayVisibility(this._element, true);\n // this.layoutManager.updateSizeFromContainer();\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].show();\n }\n }\n finally {\n this.layoutManager.endSizeInvalidation();\n }\n }\n /**\n * Destroys this item ands its children\n * @internal\n */\n destroy() {\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].destroy();\n }\n this._contentItems = [];\n this.emitBaseBubblingEvent('beforeItemDestroyed');\n this._element.remove();\n this.emitBaseBubblingEvent('itemDestroyed');\n }\n /**\n * Returns the area the component currently occupies\n * @internal\n */\n getElementArea(element) {\n element = element !== null && element !== void 0 ? element : this._element;\n const rect = element.getBoundingClientRect();\n const top = rect.top + document.body.scrollTop;\n const left = rect.left + document.body.scrollLeft;\n const width = rect.width;\n const height = rect.height;\n return {\n x1: left,\n y1: top,\n x2: left + width,\n y2: top + height,\n surface: width * height,\n contentItem: this\n };\n }\n /**\n * The tree of content items is created in two steps: First all content items are instantiated,\n * then init is called recursively from top to bottem. This is the basic init function,\n * it can be used, extended or overwritten by the content items\n *\n * Its behaviour depends on the content item\n * @internal\n */\n init() {\n this._isInitialised = true;\n this.emitBaseBubblingEvent('itemCreated');\n this.emitUnknownBubblingEvent(this.type + 'Created');\n }\n /** @internal */\n setParent(parent) {\n this._parent = parent;\n }\n /** @internal */\n addPopInParentId(id) {\n if (!this.popInParentIds.includes(id)) {\n this.popInParentIds.push(id);\n }\n }\n /** @internal */\n initContentItems() {\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].init();\n }\n }\n /** @internal */\n hide() {\n this.layoutManager.beginSizeInvalidation();\n try {\n setElementDisplayVisibility(this._element, false);\n // this.layoutManager.updateSizeFromContainer();\n }\n finally {\n this.layoutManager.endSizeInvalidation();\n }\n }\n /** @internal */\n updateContentItemsSize(force) {\n for (let i = 0; i < this._contentItems.length; i++) {\n this._contentItems[i].updateSize(force);\n }\n }\n /**\n * creates all content items for this node at initialisation time\n * PLEASE NOTE, please see addChild for adding contentItems at runtime\n * @internal\n */\n createContentItems(content) {\n const count = content.length;\n const result = new Array(count);\n for (let i = 0; i < content.length; i++) {\n result[i] = this.layoutManager.createContentItem(content[i], this);\n }\n return result;\n }\n /**\n * Called for every event on the item tree. Decides whether the event is a bubbling\n * event and propagates it to its parent\n *\n * @param name - The name of the event\n * @param event -\n * @internal\n */\n propagateEvent(name, args) {\n if (args.length === 1) {\n const event = args[0];\n if (event instanceof EventEmitter.BubblingEvent &&\n event.isPropagationStopped === false &&\n this._isInitialised === true) {\n /**\n * In some cases (e.g. if an element is created from a DragSource) it\n * doesn't have a parent and is not a child of GroundItem. If that's the case\n * propagate the bubbling event from the top level of the substree directly\n * to the layoutManager\n */\n if (this.isGround === false && this._parent) {\n this._parent.emitUnknown(name, event);\n }\n else {\n this.scheduleEventPropagationToLayoutManager(name, event);\n }\n }\n }\n }\n tryBubbleEvent(name, args) {\n if (args.length === 1) {\n const event = args[0];\n if (event instanceof EventEmitter.BubblingEvent &&\n event.isPropagationStopped === false &&\n this._isInitialised === true) {\n /**\n * In some cases (e.g. if an element is created from a DragSource) it\n * doesn't have a parent and is not a child of GroundItem. If that's the case\n * propagate the bubbling event from the top level of the substree directly\n * to the layoutManager\n */\n if (this.isGround === false && this._parent) {\n this._parent.emitUnknown(name, event);\n }\n else {\n this.scheduleEventPropagationToLayoutManager(name, event);\n }\n }\n }\n }\n /**\n * All raw events bubble up to the Ground element. Some events that\n * are propagated to - and emitted by - the layoutManager however are\n * only string-based, batched and sanitized to make them more usable\n *\n * @param name - The name of the event\n * @internal\n */\n scheduleEventPropagationToLayoutManager(name, event) {\n if (this._throttledEvents.indexOf(name) === -1) {\n this.layoutManager.emitUnknown(name, event);\n }\n else {\n if (this._pendingEventPropagations[name] !== true) {\n this._pendingEventPropagations[name] = true;\n globalThis.requestAnimationFrame(() => this.propagateEventToLayoutManager(name, event));\n }\n }\n }\n /**\n * Callback for events scheduled by _scheduleEventPropagationToLayoutManager\n *\n * @param name - The name of the event\n * @internal\n */\n propagateEventToLayoutManager(name, event) {\n this._pendingEventPropagations[name] = false;\n this.layoutManager.emitUnknown(name, event);\n }\n}\n//# sourceMappingURL=content-item.js.map","import { ItemConfig } from '../config/config';\nimport { ResolvedGroundItemConfig, ResolvedHeaderedItemConfig, ResolvedItemConfig, ResolvedRootItemConfig, ResolvedStackItemConfig } from '../config/resolved-config';\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error';\nimport { ItemType, SizeUnitEnum } from '../utils/types';\nimport { getElementWidthAndHeight, setElementHeight, setElementWidth } from '../utils/utils';\nimport { ComponentItem } from './component-item';\nimport { ComponentParentableItem } from './component-parentable-item';\nimport { ContentItem } from './content-item';\nimport { RowOrColumn } from './row-or-column';\n/**\n * GroundItem is the ContentItem whose one child is the root ContentItem (Root is planted in Ground).\n * (Previously it was called root however this was incorrect as its child is the root item)\n * There is only one instance of GroundItem and it is automatically created by the Layout Manager\n * @internal\n */\nexport class GroundItem extends ComponentParentableItem {\n constructor(layoutManager, rootItemConfig, containerElement) {\n super(layoutManager, ResolvedGroundItemConfig.create(rootItemConfig), null, GroundItem.createElement(document));\n this.isGround = true;\n this._childElementContainer = this.element;\n this._containerElement = containerElement;\n // insert before any pre-existing content elements\n let before = null;\n while (true) {\n const prev = before ? before.previousSibling : this._containerElement.lastChild;\n if (prev instanceof Element\n && prev.classList.contains(\"lm_content\" /* Content */)) {\n before = prev;\n }\n else {\n break;\n }\n }\n this._containerElement.insertBefore(this.element, before);\n }\n init() {\n if (this.isInitialised === true)\n return;\n this.updateNodeSize();\n for (let i = 0; i < this.contentItems.length; i++) {\n this._childElementContainer.appendChild(this.contentItems[i].element);\n }\n super.init();\n this.initContentItems();\n }\n /**\n * Loads a new Layout\n * Internal only. To load a new layout with API, use {@link (LayoutManager:class).loadLayout}\n */\n loadRoot(rootItemConfig) {\n // Remove existing root if it exists\n this.clearRoot();\n if (rootItemConfig !== undefined) {\n const rootContentItem = this.layoutManager.createAndInitContentItem(rootItemConfig, this);\n this.addChild(rootContentItem, 0);\n }\n }\n clearRoot() {\n // Remove existing root if it exists\n const contentItems = this.contentItems;\n switch (contentItems.length) {\n case 0: {\n return;\n }\n case 1: {\n const existingRootContentItem = contentItems[0];\n existingRootContentItem.remove();\n return;\n }\n default: {\n throw new AssertError('GILR07721');\n }\n }\n }\n /**\n * Adds a ContentItem child to root ContentItem.\n * Internal only. To load a add with API, use {@link (LayoutManager:class).addItem}\n * @returns -1 if added as root otherwise index in root ContentItem's content\n */\n addItem(itemConfig, index) {\n this.layoutManager.checkMinimiseMaximisedStack();\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false);\n let parent;\n if (this.contentItems.length > 0) {\n parent = this.contentItems[0];\n }\n else {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n parent = this;\n }\n if (parent.isComponent) {\n throw new Error('Cannot add item as child to ComponentItem');\n }\n else {\n const contentItem = this.layoutManager.createAndInitContentItem(resolvedItemConfig, parent);\n index = parent.addChild(contentItem, index);\n return (parent === this) ? -1 : index;\n }\n }\n loadComponentAsRoot(itemConfig) {\n // Remove existing root if it exists\n this.clearRoot();\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false);\n if (resolvedItemConfig.maximised) {\n throw new Error('Root Component cannot be maximised');\n }\n else {\n const rootContentItem = new ComponentItem(this.layoutManager, resolvedItemConfig, this);\n rootContentItem.init();\n this.addChild(rootContentItem, 0);\n }\n }\n /**\n * Adds a Root ContentItem.\n * Internal only. To replace Root ContentItem with API, use {@link (LayoutManager:class).loadLayout}\n */\n addChild(contentItem, index) {\n if (this.contentItems.length > 0) {\n throw new Error('Ground node can only have a single child');\n }\n else {\n // contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n this._childElementContainer.appendChild(contentItem.element);\n index = super.addChild(contentItem, index);\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n return index;\n }\n }\n /** @internal */\n calculateConfigContent() {\n const contentItems = this.contentItems;\n const count = contentItems.length;\n const result = new Array(count);\n for (let i = 0; i < count; i++) {\n const item = contentItems[i];\n const itemConfig = item.toConfig();\n if (ResolvedRootItemConfig.isRootItemConfig(itemConfig)) {\n result[i] = itemConfig;\n }\n else {\n throw new AssertError('RCCC66832');\n }\n }\n return result;\n }\n /** @internal */\n setSize(width, height) {\n if (width === undefined || height === undefined) {\n this.updateSize(false); // For backwards compatibility with v1.x API\n }\n else {\n setElementWidth(this.element, width);\n setElementHeight(this.element, height);\n // GroundItem can be empty\n if (this.contentItems.length > 0) {\n setElementWidth(this.contentItems[0].element, width);\n setElementHeight(this.contentItems[0].element, height);\n }\n this.updateContentItemsSize(false);\n }\n }\n /**\n * Adds a Root ContentItem.\n * Internal only. To replace Root ContentItem with API, use {@link (LayoutManager:class).updateRootSize}\n */\n updateSize(force) {\n this.layoutManager.beginVirtualSizedContainerAdding();\n try {\n this.updateNodeSize();\n this.updateContentItemsSize(force);\n }\n finally {\n this.layoutManager.endVirtualSizedContainerAdding();\n }\n }\n createSideAreas() {\n const areaSize = 50;\n const oppositeSides = GroundItem.Area.oppositeSides;\n const result = new Array(Object.keys(oppositeSides).length);\n let idx = 0;\n for (const key in oppositeSides) {\n const side = key;\n const area = this.getElementArea();\n if (area === null) {\n throw new UnexpectedNullError('RCSA77553');\n }\n else {\n area.side = side;\n if (oppositeSides[side][1] === '2')\n area[side] = area[oppositeSides[side]] - areaSize;\n else\n area[side] = area[oppositeSides[side]] + areaSize;\n area.surface = (area.x2 - area.x1) * (area.y2 - area.y1);\n result[idx++] = area;\n }\n }\n return result;\n }\n highlightDropZone(x, y, area) {\n this.layoutManager.tabDropPlaceholder.remove();\n super.highlightDropZone(x, y, area);\n }\n onDrop(contentItem, area) {\n if (contentItem.isComponent) {\n const itemConfig = ResolvedStackItemConfig.createDefault();\n // since ResolvedItemConfig.contentItems not set up, we need to add header from Component\n const component = contentItem;\n itemConfig.header = ResolvedHeaderedItemConfig.Header.createCopy(component.headerConfig);\n const stack = this.layoutManager.createAndInitContentItem(itemConfig, this);\n stack.addChild(contentItem);\n contentItem = stack;\n }\n if (this.contentItems.length === 0) {\n this.addChild(contentItem);\n }\n else {\n /*\n * If the contentItem that's being dropped is not dropped on a Stack (cases which just passed above and\n * which would wrap the contentItem in a Stack) we need to check whether contentItem is a RowOrColumn.\n * If it is, we need to re-wrap it in a Stack like it was when it was dragged by its Tab (it was dragged!).\n */\n if (contentItem.type === ItemType.row || contentItem.type === ItemType.column) {\n const itemConfig = ResolvedStackItemConfig.createDefault();\n const stack = this.layoutManager.createContentItem(itemConfig, this);\n stack.addChild(contentItem);\n contentItem = stack;\n }\n const type = area.side[0] == 'x' ? ItemType.row : ItemType.column;\n const insertBefore = area.side[1] == '2';\n const column = this.contentItems[0];\n if (!(column instanceof RowOrColumn) || column.type !== type) {\n const itemConfig = ResolvedItemConfig.createDefault(type);\n const rowOrColumn = this.layoutManager.createContentItem(itemConfig, this);\n this.replaceChild(column, rowOrColumn);\n rowOrColumn.addChild(contentItem, insertBefore ? 0 : undefined, true);\n rowOrColumn.addChild(column, insertBefore ? undefined : 0, true);\n column.size = 50;\n contentItem.size = 50;\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n rowOrColumn.updateSize(false);\n }\n else {\n const sibling = column.contentItems[insertBefore ? 0 : column.contentItems.length - 1];\n column.addChild(contentItem, insertBefore ? 0 : undefined, true);\n sibling.size *= 0.5;\n contentItem.size = sibling.size;\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n column.updateSize(false);\n }\n }\n }\n // No ContentItem can dock with groundItem. However Stack can have a GroundItem parent and Stack requires that\n // its parent implement dock() function. Accordingly this function is implemented but throws an exception as it should\n // never be called\n dock() {\n throw new AssertError('GID87731');\n }\n // No ContentItem can dock with groundItem. However Stack can have a GroundItem parent and Stack requires that\n // its parent implement validateDocking() function. Accordingly this function is implemented but throws an exception as it should\n // never be called\n validateDocking() {\n throw new AssertError('GIVD87732');\n }\n getAllContentItems() {\n const result = [this];\n this.deepGetAllContentItems(this.contentItems, result);\n return result;\n }\n getConfigMaximisedItems() {\n const result = [];\n this.deepFilterContentItems(this.contentItems, result, (item) => {\n if (ContentItem.isStack(item) && item.initialWantMaximise) {\n return true;\n }\n else {\n if (ContentItem.isComponentItem(item) && item.initialWantMaximise) {\n return true;\n }\n else {\n return false;\n }\n }\n });\n return result;\n }\n getItemsByPopInParentId(popInParentId) {\n const result = [];\n this.deepFilterContentItems(this.contentItems, result, (item) => item.popInParentIds.includes(popInParentId));\n return result;\n }\n toConfig() {\n throw new Error('Cannot generate GroundItem config');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setActiveComponentItem(item, focus, suppressFocusEvent) {\n // only applicable if ComponentItem is root and then it always has focus\n }\n updateNodeSize() {\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n setElementWidth(this.element, width);\n setElementHeight(this.element, height);\n /*\n * GroundItem can be empty\n */\n if (this.contentItems.length > 0) {\n setElementWidth(this.contentItems[0].element, width);\n setElementHeight(this.contentItems[0].element, height);\n }\n }\n deepGetAllContentItems(content, result) {\n for (let i = 0; i < content.length; i++) {\n const contentItem = content[i];\n result.push(contentItem);\n this.deepGetAllContentItems(contentItem.contentItems, result);\n }\n }\n deepFilterContentItems(content, result, checkAcceptFtn) {\n for (let i = 0; i < content.length; i++) {\n const contentItem = content[i];\n if (checkAcceptFtn(contentItem)) {\n result.push(contentItem);\n }\n this.deepFilterContentItems(contentItem.contentItems, result, checkAcceptFtn);\n }\n }\n}\n/** @internal */\n(function (GroundItem) {\n let Area;\n (function (Area) {\n Area.oppositeSides = {\n y2: 'y1',\n x2: 'x1',\n y1: 'y2',\n x1: 'x2',\n };\n })(Area = GroundItem.Area || (GroundItem.Area = {}));\n function createElement(document) {\n const element = document.createElement('div');\n element.classList.add(\"lm_goldenlayout\" /* GoldenLayout */);\n element.classList.add(\"lm_item\" /* Item */);\n element.classList.add(\"lm_root\" /* Root */);\n return element;\n }\n GroundItem.createElement = createElement;\n})(GroundItem || (GroundItem = {}));\n//# sourceMappingURL=ground-item.js.map","import { ItemConfig } from '../config/config';\nimport { Splitter } from '../controls/splitter';\nimport { AssertError, UnexpectedNullError } from '../errors/internal-error';\nimport { ItemType, SizeUnitEnum } from '../utils/types';\nimport { getElementHeight, getElementWidth, getElementWidthAndHeight, numberToPixels, pixelsToNumber, setElementHeight, setElementWidth } from \"../utils/utils\";\nimport { ContentItem } from './content-item';\n/** @public */\nexport class RowOrColumn extends ContentItem {\n /** @internal */\n constructor(isColumn, layoutManager, config, \n /** @internal */\n _rowOrColumnParent) {\n super(layoutManager, config, _rowOrColumnParent, RowOrColumn.createElement(document, isColumn));\n this._rowOrColumnParent = _rowOrColumnParent;\n /** @internal */\n this._splitter = [];\n this.isRow = !isColumn;\n this.isColumn = isColumn;\n this._childElementContainer = this.element;\n this._splitterSize = layoutManager.layoutConfig.dimensions.borderWidth;\n this._splitterGrabSize = layoutManager.layoutConfig.dimensions.borderGrabWidth;\n this._isColumn = isColumn;\n this._dimension = isColumn ? 'height' : 'width';\n this._splitterPosition = null;\n this._splitterMinPosition = null;\n this._splitterMaxPosition = null;\n switch (config.type) {\n case ItemType.row:\n case ItemType.column:\n this._configType = config.type;\n break;\n default:\n throw new AssertError('ROCCCT00925');\n }\n }\n newComponent(componentType, componentState, title, index) {\n const itemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.newItem(itemConfig, index);\n }\n addComponent(componentType, componentState, title, index) {\n const itemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.addItem(itemConfig, index);\n }\n newItem(itemConfig, index) {\n index = this.addItem(itemConfig, index);\n const createdItem = this.contentItems[index];\n if (ContentItem.isStack(createdItem) && (ItemConfig.isComponent(itemConfig))) {\n // createdItem is a Stack which was created to hold wanted component. Return component\n return createdItem.contentItems[0];\n }\n else {\n return createdItem;\n }\n }\n addItem(itemConfig, index) {\n this.layoutManager.checkMinimiseMaximisedStack();\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false);\n const contentItem = this.layoutManager.createAndInitContentItem(resolvedItemConfig, this);\n return this.addChild(contentItem, index, false);\n }\n /**\n * Add a new contentItem to the Row or Column\n *\n * @param contentItem -\n * @param index - The position of the new item within the Row or Column.\n * If no index is provided the item will be added to the end\n * @param suspendResize - If true the items won't be resized. This will leave the item in\n * an inconsistent state and is only intended to be used if multiple\n * children need to be added in one go and resize is called afterwards\n *\n * @returns\n */\n addChild(contentItem, index, suspendResize) {\n // contentItem = this.layoutManager._$normalizeContentItem(contentItem, this);\n if (index === undefined) {\n index = this.contentItems.length;\n }\n if (this.contentItems.length > 0) {\n const splitterElement = this.createSplitter(Math.max(0, index - 1)).element;\n if (index > 0) {\n this.contentItems[index - 1].element.insertAdjacentElement('afterend', splitterElement);\n splitterElement.insertAdjacentElement('afterend', contentItem.element);\n }\n else {\n this.contentItems[0].element.insertAdjacentElement('beforebegin', splitterElement);\n splitterElement.insertAdjacentElement('beforebegin', contentItem.element);\n }\n }\n else {\n this._childElementContainer.appendChild(contentItem.element);\n }\n super.addChild(contentItem, index);\n const newItemSize = (1 / this.contentItems.length) * 100;\n if (suspendResize === true) {\n this.emitBaseBubblingEvent('stateChanged');\n return index;\n }\n for (let i = 0; i < this.contentItems.length; i++) {\n const indexedContentItem = this.contentItems[i];\n if (indexedContentItem === contentItem) {\n contentItem.size = newItemSize;\n }\n else {\n const itemSize = indexedContentItem.size *= (100 - newItemSize) / 100;\n indexedContentItem.size = itemSize;\n }\n }\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n return index;\n }\n /**\n * Removes a child of this element\n *\n * @param contentItem -\n * @param keepChild - If true the child will be removed, but not destroyed\n *\n */\n removeChild(contentItem, keepChild) {\n const index = this.contentItems.indexOf(contentItem);\n const splitterIndex = Math.max(index - 1, 0);\n if (index === -1) {\n throw new Error('Can\\'t remove child. ContentItem is not child of this Row or Column');\n }\n /**\n * Remove the splitter before the item or after if the item happens\n * to be the first in the row/column\n */\n if (this._splitter[splitterIndex]) {\n this._splitter[splitterIndex].destroy();\n this._splitter.splice(splitterIndex, 1);\n }\n super.removeChild(contentItem, keepChild);\n if (this.contentItems.length === 1 && this.isClosable === true) {\n const childItem = this.contentItems[0];\n this.contentItems.length = 0;\n this._rowOrColumnParent.replaceChild(this, childItem, true);\n }\n else {\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n }\n }\n /**\n * Replaces a child of this Row or Column with another contentItem\n */\n replaceChild(oldChild, newChild) {\n const size = oldChild.size;\n super.replaceChild(oldChild, newChild);\n newChild.size = size;\n this.updateSize(false);\n this.emitBaseBubblingEvent('stateChanged');\n }\n /**\n * Called whenever the dimensions of this item or one of its parents change\n */\n updateSize(force) {\n this.layoutManager.beginVirtualSizedContainerAdding();\n try {\n this.updateNodeSize();\n this.updateContentItemsSize(force);\n }\n finally {\n this.layoutManager.endVirtualSizedContainerAdding();\n }\n }\n /**\n * Invoked recursively by the layout manager. ContentItem.init appends\n * the contentItem's DOM elements to the container, RowOrColumn init adds splitters\n * in between them\n * @internal\n */\n init() {\n if (this.isInitialised === true)\n return;\n this.updateNodeSize();\n for (let i = 0; i < this.contentItems.length; i++) {\n this._childElementContainer.appendChild(this.contentItems[i].element);\n }\n super.init();\n for (let i = 0; i < this.contentItems.length - 1; i++) {\n this.contentItems[i].element.insertAdjacentElement('afterend', this.createSplitter(i).element);\n }\n this.initContentItems();\n }\n toConfig() {\n const result = {\n type: this.type,\n content: this.calculateConfigContent(),\n size: this.size,\n sizeUnit: this.sizeUnit,\n minSize: this.minSize,\n minSizeUnit: this.minSizeUnit,\n id: this.id,\n isClosable: this.isClosable,\n };\n return result;\n }\n /** @internal */\n setParent(parent) {\n this._rowOrColumnParent = parent;\n super.setParent(parent);\n }\n /** @internal */\n updateNodeSize() {\n if (this.contentItems.length > 0) {\n this.calculateRelativeSizes();\n this.setAbsoluteSizes();\n }\n this.emitBaseBubblingEvent('stateChanged');\n this.emit('resize');\n }\n /**\n * Turns the relative sizes calculated by calculateRelativeSizes into\n * absolute pixel values and applies them to the children's DOM elements\n *\n * Assigns additional pixels to counteract Math.floor\n * @internal\n */\n setAbsoluteSizes() {\n const absoluteSizes = this.calculateAbsoluteSizes();\n for (let i = 0; i < this.contentItems.length; i++) {\n if (absoluteSizes.additionalPixel - i > 0) {\n absoluteSizes.itemSizes[i]++;\n }\n if (this._isColumn) {\n setElementWidth(this.contentItems[i].element, absoluteSizes.crossAxisSize);\n setElementHeight(this.contentItems[i].element, absoluteSizes.itemSizes[i]);\n }\n else {\n setElementWidth(this.contentItems[i].element, absoluteSizes.itemSizes[i]);\n setElementHeight(this.contentItems[i].element, absoluteSizes.crossAxisSize);\n }\n }\n }\n /**\n * Calculates the absolute sizes of all of the children of this Item.\n * @returns Set with absolute sizes and additional pixels.\n * @internal\n */\n calculateAbsoluteSizes() {\n const totalSplitterSize = (this.contentItems.length - 1) * this._splitterSize;\n const { width: elementWidth, height: elementHeight } = getElementWidthAndHeight(this.element);\n let totalSize;\n let crossAxisSize;\n if (this._isColumn) {\n totalSize = elementHeight - totalSplitterSize;\n crossAxisSize = elementWidth;\n }\n else {\n totalSize = elementWidth - totalSplitterSize;\n crossAxisSize = elementHeight;\n }\n let totalAssigned = 0;\n const itemSizes = [];\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n let itemSize;\n if (contentItem.sizeUnit === SizeUnitEnum.Percent) {\n itemSize = Math.floor(totalSize * (contentItem.size / 100));\n }\n else {\n throw new AssertError('ROCCAS6692');\n }\n totalAssigned += itemSize;\n itemSizes.push(itemSize);\n }\n const additionalPixel = Math.floor(totalSize - totalAssigned);\n return {\n itemSizes,\n additionalPixel,\n totalSize,\n crossAxisSize,\n };\n }\n /**\n * Calculates the relative sizes of all children of this Item. The logic\n * is as follows:\n *\n * - Add up the total size of all items that have a configured size\n *\n * - If the total == 100 (check for floating point errors)\n * Excellent, job done\n *\n * - If the total is \\> 100,\n * set the size of items without set dimensions to 1/3 and add this to the total\n * set the size off all items so that the total is hundred relative to their original size\n *\n * - If the total is \\< 100\n * If there are items without set dimensions, distribute the remainder to 100 evenly between them\n * If there are no items without set dimensions, increase all items sizes relative to\n * their original size so that they add up to 100\n *\n * @internal\n */\n calculateRelativeSizes() {\n let total = 0;\n const itemsWithFractionalSize = [];\n let totalFractionalSize = 0;\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n const sizeUnit = contentItem.sizeUnit;\n switch (sizeUnit) {\n case SizeUnitEnum.Percent: {\n total += contentItem.size;\n break;\n }\n case SizeUnitEnum.Fractional: {\n itemsWithFractionalSize.push(contentItem);\n totalFractionalSize += contentItem.size;\n break;\n }\n default:\n throw new AssertError('ROCCRS49110', JSON.stringify(contentItem));\n }\n }\n /**\n * Everything adds up to hundred, all good :-)\n */\n if (Math.round(total) === 100) {\n this.respectMinItemSize();\n return;\n }\n else {\n /**\n * Allocate the remaining size to the items with a fractional size\n */\n if (Math.round(total) < 100 && itemsWithFractionalSize.length > 0) {\n const fractionalAllocatedSize = 100 - total;\n for (let i = 0; i < itemsWithFractionalSize.length; i++) {\n const contentItem = itemsWithFractionalSize[i];\n contentItem.size = fractionalAllocatedSize * (contentItem.size / totalFractionalSize);\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n }\n this.respectMinItemSize();\n return;\n }\n else {\n /**\n * If the total is > 100, but there are also items with a fractional size, assign another 50%\n * to the fractional items\n *\n * This will be reset in the next step\n */\n if (Math.round(total) > 100 && itemsWithFractionalSize.length > 0) {\n for (let i = 0; i < itemsWithFractionalSize.length; i++) {\n const contentItem = itemsWithFractionalSize[i];\n contentItem.size = 50 * (contentItem.size / totalFractionalSize);\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n }\n total += 50;\n }\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n contentItem.size = (contentItem.size / total) * 100;\n }\n this.respectMinItemSize();\n }\n }\n }\n /**\n * Adjusts the column widths to respect the dimensions minItemWidth if set.\n * @internal\n */\n respectMinItemSize() {\n const minItemSize = this.calculateContentItemMinSize(this);\n if (minItemSize <= 0 || this.contentItems.length <= 1) {\n return;\n }\n else {\n let totalOverMin = 0;\n let totalUnderMin = 0;\n const entriesOverMin = [];\n const allEntries = [];\n const absoluteSizes = this.calculateAbsoluteSizes();\n /**\n * Figure out how much we are under the min item size total and how much room we have to use.\n */\n for (let i = 0; i < absoluteSizes.itemSizes.length; i++) {\n const itemSize = absoluteSizes.itemSizes[i];\n let entry;\n if (itemSize < minItemSize) {\n totalUnderMin += minItemSize - itemSize;\n entry = {\n size: minItemSize\n };\n }\n else {\n totalOverMin += itemSize - minItemSize;\n entry = {\n size: itemSize\n };\n entriesOverMin.push(entry);\n }\n allEntries.push(entry);\n }\n /**\n * If there is nothing under min, or there is not enough over to make up the difference, do nothing.\n */\n if (totalUnderMin === 0 || totalUnderMin > totalOverMin) {\n return;\n }\n else {\n /**\n * Evenly reduce all columns that are over the min item width to make up the difference.\n */\n const reducePercent = totalUnderMin / totalOverMin;\n let remainingSize = totalUnderMin;\n for (let i = 0; i < entriesOverMin.length; i++) {\n const entry = entriesOverMin[i];\n const reducedSize = Math.round((entry.size - minItemSize) * reducePercent);\n remainingSize -= reducedSize;\n entry.size -= reducedSize;\n }\n /**\n * Take anything remaining from the last item.\n */\n if (remainingSize !== 0) {\n allEntries[allEntries.length - 1].size -= remainingSize;\n }\n /**\n * Set every items size relative to 100 relative to its size to total\n */\n for (let i = 0; i < this.contentItems.length; i++) {\n const contentItem = this.contentItems[i];\n contentItem.size = (allEntries[i].size / absoluteSizes.totalSize) * 100;\n }\n }\n }\n }\n /**\n * Instantiates a new Splitter, binds events to it and adds\n * it to the array of splitters at the position specified as the index argument\n *\n * What it doesn't do though is append the splitter to the DOM\n *\n * @param index - The position of the splitter\n *\n * @returns\n * @internal\n */\n createSplitter(index) {\n const splitter = new Splitter(this._isColumn, this._splitterSize, this._splitterGrabSize);\n splitter.on('drag', (offsetX, offsetY) => this.onSplitterDrag(splitter, offsetX, offsetY));\n splitter.on('dragStop', () => this.onSplitterDragStop(splitter));\n splitter.on('dragStart', () => this.onSplitterDragStart(splitter));\n this._splitter.splice(index, 0, splitter);\n return splitter;\n }\n /**\n * Locates the instance of Splitter in the array of\n * registered splitters and returns a map containing the contentItem\n * before and after the splitters, both of which are affected if the\n * splitter is moved\n *\n * @returns A map of contentItems that the splitter affects\n * @internal\n */\n getSplitItems(splitter) {\n const index = this._splitter.indexOf(splitter);\n return {\n before: this.contentItems[index],\n after: this.contentItems[index + 1]\n };\n }\n calculateContentItemMinSize(contentItem) {\n const minSize = contentItem.minSize;\n if (minSize !== undefined) {\n if (contentItem.minSizeUnit === SizeUnitEnum.Pixel) {\n return minSize;\n }\n else {\n throw new AssertError('ROCGMD98831', JSON.stringify(contentItem));\n }\n }\n else {\n const dimensions = this.layoutManager.layoutConfig.dimensions;\n return this._isColumn ? dimensions.defaultMinItemHeight : dimensions.defaultMinItemWidth;\n }\n }\n /**\n * Gets the minimum dimensions for the given item configuration array\n * @internal\n */\n calculateContentItemsTotalMinSize(contentItems) {\n let totalMinSize = 0;\n for (const contentItem of contentItems) {\n totalMinSize += this.calculateContentItemMinSize(contentItem);\n }\n return totalMinSize;\n }\n /**\n * Invoked when a splitter's dragListener fires dragStart. Calculates the splitters\n * movement area once (so that it doesn't need calculating on every mousemove event)\n * @internal\n */\n onSplitterDragStart(splitter) {\n const items = this.getSplitItems(splitter);\n const beforeWidth = pixelsToNumber(items.before.element.style[this._dimension]);\n const afterSize = pixelsToNumber(items.after.element.style[this._dimension]);\n const beforeMinSize = this.calculateContentItemsTotalMinSize(items.before.contentItems);\n const afterMinSize = this.calculateContentItemsTotalMinSize(items.after.contentItems);\n this._splitterPosition = 0;\n this._splitterMinPosition = -1 * (beforeWidth - beforeMinSize);\n this._splitterMaxPosition = afterSize - afterMinSize;\n }\n /**\n * Invoked when a splitter's DragListener fires drag. Updates the splitter's DOM position,\n * but not the sizes of the elements the splitter controls in order to minimize resize events\n *\n * @param splitter -\n * @param offsetX - Relative pixel values to the splitter's original position. Can be negative\n * @param offsetY - Relative pixel values to the splitter's original position. Can be negative\n * @internal\n */\n onSplitterDrag(splitter, offsetX, offsetY) {\n let offset = this._isColumn ? offsetY : offsetX;\n if (this._splitterMinPosition === null || this._splitterMaxPosition === null) {\n throw new UnexpectedNullError('ROCOSD59226');\n }\n offset = Math.max(offset, this._splitterMinPosition);\n offset = Math.min(offset, this._splitterMaxPosition);\n this._splitterPosition = offset;\n const offsetPixels = numberToPixels(offset);\n if (this._isColumn) {\n splitter.element.style.top = offsetPixels;\n }\n else {\n splitter.element.style.left = offsetPixels;\n }\n }\n /**\n * Invoked when a splitter's DragListener fires dragStop. Resets the splitters DOM position,\n * and applies the new sizes to the elements before and after the splitter and their children\n * on the next animation frame\n * @internal\n */\n onSplitterDragStop(splitter) {\n if (this._splitterPosition === null) {\n throw new UnexpectedNullError('ROCOSDS66932');\n }\n else {\n const items = this.getSplitItems(splitter);\n const sizeBefore = pixelsToNumber(items.before.element.style[this._dimension]);\n const sizeAfter = pixelsToNumber(items.after.element.style[this._dimension]);\n const splitterPositionInRange = (this._splitterPosition + sizeBefore) / (sizeBefore + sizeAfter);\n const totalRelativeSize = items.before.size + items.after.size;\n items.before.size = splitterPositionInRange * totalRelativeSize;\n items.after.size = (1 - splitterPositionInRange) * totalRelativeSize;\n splitter.element.style.top = numberToPixels(0);\n splitter.element.style.left = numberToPixels(0);\n globalThis.requestAnimationFrame(() => this.updateSize(false));\n }\n }\n}\n/** @public */\n(function (RowOrColumn) {\n /** @internal */\n function getElementDimensionSize(element, dimension) {\n if (dimension === 'width') {\n return getElementWidth(element);\n }\n else {\n return getElementHeight(element);\n }\n }\n RowOrColumn.getElementDimensionSize = getElementDimensionSize;\n /** @internal */\n function setElementDimensionSize(element, dimension, value) {\n if (dimension === 'width') {\n return setElementWidth(element, value);\n }\n else {\n return setElementHeight(element, value);\n }\n }\n RowOrColumn.setElementDimensionSize = setElementDimensionSize;\n /** @internal */\n function createElement(document, isColumn) {\n const element = document.createElement('div');\n element.classList.add(\"lm_item\" /* Item */);\n if (isColumn) {\n element.classList.add(\"lm_column\" /* Column */);\n }\n else {\n element.classList.add(\"lm_row\" /* Row */);\n }\n return element;\n }\n RowOrColumn.createElement = createElement;\n})(RowOrColumn || (RowOrColumn = {}));\n//# sourceMappingURL=row-or-column.js.map","import { ItemConfig } from '../config/config';\nimport { ResolvedHeaderedItemConfig, ResolvedItemConfig, ResolvedStackItemConfig } from '../config/resolved-config';\nimport { Header } from '../controls/header';\nimport { AssertError, UnexpectedNullError, UnexpectedUndefinedError } from '../errors/internal-error';\nimport { EventEmitter } from '../utils/event-emitter';\nimport { ItemType, Side, SizeUnitEnum, WidthOrHeightPropertyName } from '../utils/types';\nimport { getElementWidthAndHeight, numberToPixels, setElementDisplayVisibility } from '../utils/utils';\nimport { ComponentItem } from './component-item';\nimport { ComponentParentableItem } from './component-parentable-item';\nimport { ContentItem } from './content-item';\n/** @public */\nexport class Stack extends ComponentParentableItem {\n /** @internal */\n constructor(layoutManager, config, parent) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;\n super(layoutManager, config, parent, Stack.createElement(document));\n /** @internal */\n this._headerSideChanged = false;\n /** @internal */\n this._resizeListener = () => this.handleResize();\n /** @internal */\n this._maximisedListener = () => this.handleMaximised();\n /** @internal */\n this._minimisedListener = () => this.handleMinimised();\n this._headerConfig = config.header;\n const layoutHeaderConfig = layoutManager.layoutConfig.header;\n const configContent = config.content;\n // If stack has only one component, then we can also check this for header settings\n let componentHeaderConfig;\n if (configContent.length !== 1) {\n componentHeaderConfig = undefined;\n }\n else {\n const firstChildItemConfig = configContent[0];\n componentHeaderConfig = firstChildItemConfig.header; // will be undefined if not component (and wont be stack)\n }\n this._initialWantMaximise = config.maximised;\n this._initialActiveItemIndex = (_a = config.activeItemIndex) !== null && _a !== void 0 ? _a : 0; // make sure defined\n // check for defined value for each item in order of Stack (this Item), Component (first child), Manager.\n const show = (_d = (_c = (_b = this._headerConfig) === null || _b === void 0 ? void 0 : _b.show) !== null && _c !== void 0 ? _c : componentHeaderConfig === null || componentHeaderConfig === void 0 ? void 0 : componentHeaderConfig.show) !== null && _d !== void 0 ? _d : layoutHeaderConfig.show;\n const popout = (_g = (_f = (_e = this._headerConfig) === null || _e === void 0 ? void 0 : _e.popout) !== null && _f !== void 0 ? _f : componentHeaderConfig === null || componentHeaderConfig === void 0 ? void 0 : componentHeaderConfig.popout) !== null && _g !== void 0 ? _g : layoutHeaderConfig.popout;\n const maximise = (_k = (_j = (_h = this._headerConfig) === null || _h === void 0 ? void 0 : _h.maximise) !== null && _j !== void 0 ? _j : componentHeaderConfig === null || componentHeaderConfig === void 0 ? void 0 : componentHeaderConfig.maximise) !== null && _k !== void 0 ? _k : layoutHeaderConfig.maximise;\n const close = (_o = (_m = (_l = this._headerConfig) === null || _l === void 0 ? void 0 : _l.close) !== null && _m !== void 0 ? _m : componentHeaderConfig === null || componentHeaderConfig === void 0 ? void 0 : componentHeaderConfig.close) !== null && _o !== void 0 ? _o : layoutHeaderConfig.close;\n const minimise = (_r = (_q = (_p = this._headerConfig) === null || _p === void 0 ? void 0 : _p.minimise) !== null && _q !== void 0 ? _q : componentHeaderConfig === null || componentHeaderConfig === void 0 ? void 0 : componentHeaderConfig.minimise) !== null && _r !== void 0 ? _r : layoutHeaderConfig.minimise;\n const tabDropdown = (_u = (_t = (_s = this._headerConfig) === null || _s === void 0 ? void 0 : _s.tabDropdown) !== null && _t !== void 0 ? _t : componentHeaderConfig === null || componentHeaderConfig === void 0 ? void 0 : componentHeaderConfig.tabDropdown) !== null && _u !== void 0 ? _u : layoutHeaderConfig.tabDropdown;\n this._maximisedEnabled = maximise !== false;\n const headerSettings = {\n show: show !== false,\n side: show === false ? Side.top : show,\n popoutEnabled: popout !== false,\n popoutLabel: popout === false ? '' : popout,\n maximiseEnabled: this._maximisedEnabled,\n maximiseLabel: maximise === false ? '' : maximise,\n closeEnabled: close !== false,\n closeLabel: close === false ? '' : close,\n minimiseEnabled: true,\n minimiseLabel: minimise,\n tabDropdownEnabled: tabDropdown !== false,\n tabDropdownLabel: tabDropdown === false ? '' : tabDropdown,\n };\n this._header = new Header(layoutManager, this, headerSettings, config.isClosable && close !== false, () => this.getActiveComponentItem(), () => this.remove(), () => this.handlePopoutEvent(), () => this.toggleMaximise(), (ev) => this.handleHeaderClickEvent(ev), (ev) => this.handleHeaderTouchStartEvent(ev), (item) => this.handleHeaderComponentRemoveEvent(item), (item) => this.handleHeaderComponentFocusEvent(item), (x, y, dragListener, item) => this.handleHeaderComponentStartDragEvent(x, y, dragListener, item));\n // this._dropZones = {};\n this.isStack = true;\n this._childElementContainer = document.createElement('section');\n this._childElementContainer.classList.add(\"lm_items\" /* Items */);\n this.on('resize', this._resizeListener);\n if (this._maximisedEnabled) {\n this.on('maximised', this._maximisedListener);\n this.on('minimised', this._minimisedListener);\n }\n this.element.appendChild(this._header.element);\n this.element.appendChild(this._childElementContainer);\n this.setupHeaderPosition();\n this._header.updateClosability();\n }\n get childElementContainer() { return this._childElementContainer; }\n get header() { return this._header; }\n get headerShow() { return this._header.show; }\n get headerSide() { return this._header.side; }\n get headerLeftRightSided() { return this._header.leftRightSided; }\n /** @internal */\n get contentAreaDimensions() { return this._contentAreaDimensions; }\n /** @internal */\n get initialWantMaximise() { return this._initialWantMaximise; }\n get isMaximised() { return this === this.layoutManager.maximisedStack; }\n get stackParent() {\n if (!this.parent) {\n throw new Error('Stack should always have a parent');\n }\n return this.parent;\n }\n /** @internal */\n updateSize(force) {\n this.layoutManager.beginVirtualSizedContainerAdding();\n try {\n this.updateNodeSize();\n this.updateContentItemsSize(force);\n }\n finally {\n this.layoutManager.endVirtualSizedContainerAdding();\n }\n }\n /** @internal */\n init() {\n if (this.isInitialised === true)\n return;\n this.updateNodeSize();\n for (let i = 0; i < this.contentItems.length; i++) {\n this._childElementContainer.appendChild(this.contentItems[i].element);\n }\n super.init();\n const contentItems = this.contentItems;\n const contentItemCount = contentItems.length;\n if (contentItemCount > 0) { // contentItemCount will be 0 on drag drop\n if (this._initialActiveItemIndex < 0 || this._initialActiveItemIndex >= contentItemCount) {\n throw new Error(`ActiveItemIndex out of range: ${this._initialActiveItemIndex} id: ${this.id}`);\n }\n else {\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (!(contentItem instanceof ComponentItem)) {\n throw new Error(`Stack Content Item is not of type ComponentItem: ${i} id: ${this.id}`);\n }\n else {\n this._header.createTab(contentItem, i);\n contentItem.hide();\n contentItem.container.setBaseLogicalZIndex();\n }\n }\n this.setActiveComponentItem(contentItems[this._initialActiveItemIndex], false);\n this._header.updateTabSizes();\n }\n }\n this._header.updateClosability();\n this.initContentItems();\n }\n /** @deprecated Use {@link (Stack:class).setActiveComponentItem} */\n setActiveContentItem(item) {\n if (!ContentItem.isComponentItem(item)) {\n throw new Error('Stack.setActiveContentItem: item is not a ComponentItem');\n }\n else {\n this.setActiveComponentItem(item, false);\n }\n }\n setActiveComponentItem(componentItem, focus, suppressFocusEvent = false) {\n if (this._activeComponentItem !== componentItem) {\n if (this.contentItems.indexOf(componentItem) === -1) {\n throw new Error('componentItem is not a child of this stack');\n }\n else {\n this.layoutManager.beginSizeInvalidation();\n try {\n if (this._activeComponentItem !== undefined) {\n this._activeComponentItem.hide();\n }\n this._activeComponentItem = componentItem;\n this._header.processActiveComponentChanged(componentItem);\n componentItem.show();\n }\n finally {\n this.layoutManager.endSizeInvalidation();\n }\n this.emit('activeContentItemChanged', componentItem);\n this.layoutManager.emit('activeContentItemChanged', componentItem);\n this.emitStateChangedEvent();\n }\n }\n if (this.focused || focus) {\n this.layoutManager.setFocusedComponentItem(componentItem, suppressFocusEvent);\n }\n }\n /** @deprecated Use {@link (Stack:class).getActiveComponentItem} */\n getActiveContentItem() {\n var _a;\n return (_a = this.getActiveComponentItem()) !== null && _a !== void 0 ? _a : null;\n }\n getActiveComponentItem() {\n return this._activeComponentItem;\n }\n /** @internal */\n focusActiveContentItem() {\n var _a;\n (_a = this._activeComponentItem) === null || _a === void 0 ? void 0 : _a.focus();\n }\n /** @internal */\n setFocusedValue(value) {\n this._header.applyFocusedValue(value);\n super.setFocusedValue(value);\n }\n /** @internal */\n setRowColumnClosable(value) {\n this._header.setRowColumnClosable(value);\n }\n newComponent(componentType, componentState, title, index) {\n const itemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.newItem(itemConfig, index);\n }\n addComponent(componentType, componentState, title, index) {\n const itemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.addItem(itemConfig, index);\n }\n newItem(itemConfig, index) {\n index = this.addItem(itemConfig, index);\n return this.contentItems[index];\n }\n addItem(itemConfig, index) {\n this.layoutManager.checkMinimiseMaximisedStack();\n const resolvedItemConfig = ItemConfig.resolve(itemConfig, false);\n const contentItem = this.layoutManager.createAndInitContentItem(resolvedItemConfig, this);\n return this.addChild(contentItem, index);\n }\n addChild(contentItem, index, focus = false) {\n if (index !== undefined && index > this.contentItems.length) {\n index -= 1;\n throw new AssertError('SAC99728'); // undisplayChild() removed so this condition should no longer occur\n }\n if (!(contentItem instanceof ComponentItem)) {\n throw new AssertError('SACC88532'); // Stacks can only have Component children\n }\n else {\n index = super.addChild(contentItem, index);\n this._childElementContainer.appendChild(contentItem.element);\n this._header.createTab(contentItem, index);\n this.setActiveComponentItem(contentItem, focus);\n this._header.updateTabSizes();\n this.updateSize(false);\n contentItem.container.setBaseLogicalZIndex();\n this._header.updateClosability();\n this.emitStateChangedEvent();\n return index;\n }\n }\n removeChild(contentItem, keepChild) {\n const componentItem = contentItem;\n const index = this.contentItems.indexOf(componentItem);\n const stackWillBeDeleted = this.contentItems.length === 1;\n if (this._activeComponentItem === componentItem) {\n if (componentItem.focused) {\n componentItem.blur();\n }\n if (!stackWillBeDeleted) {\n // At this point we're already sure we have at least one content item left *after*\n // removing contentItem, so we can safely assume index 1 is a valid one if\n // the index of contentItem is 0, otherwise we just use the previous content item.\n const newActiveComponentIdx = index === 0 ? 1 : index - 1;\n this.setActiveComponentItem(this.contentItems[newActiveComponentIdx], false);\n }\n }\n this._header.removeTab(componentItem);\n super.removeChild(componentItem, keepChild);\n if (!stackWillBeDeleted) {\n this._header.updateClosability();\n }\n this.emitStateChangedEvent();\n }\n /**\n * Maximises the Item or minimises it if it is already maximised\n */\n toggleMaximise() {\n if (this.isMaximised) {\n this.minimise();\n }\n else {\n this.maximise();\n }\n }\n maximise() {\n if (!this.isMaximised) {\n this.layoutManager.setMaximisedStack(this);\n const contentItems = this.contentItems;\n const contentItemCount = contentItems.length;\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem instanceof ComponentItem) {\n contentItem.enterStackMaximised();\n }\n else {\n throw new AssertError('SMAXI87773');\n }\n }\n this.emitStateChangedEvent();\n }\n }\n minimise() {\n if (this.isMaximised) {\n this.layoutManager.setMaximisedStack(undefined);\n const contentItems = this.contentItems;\n const contentItemCount = contentItems.length;\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem instanceof ComponentItem) {\n contentItem.exitStackMaximised();\n }\n else {\n throw new AssertError('SMINI87773');\n }\n }\n this.emitStateChangedEvent();\n }\n }\n /** @internal */\n destroy() {\n var _a;\n if ((_a = this._activeComponentItem) === null || _a === void 0 ? void 0 : _a.focused) {\n this._activeComponentItem.blur();\n }\n super.destroy();\n this.off('resize', this._resizeListener);\n if (this._maximisedEnabled) {\n this.off('maximised', this._maximisedListener);\n this.off('minimised', this._minimisedListener);\n }\n this._header.destroy();\n }\n toConfig() {\n let activeItemIndex;\n if (this._activeComponentItem) {\n activeItemIndex = this.contentItems.indexOf(this._activeComponentItem);\n if (activeItemIndex < 0) {\n throw new Error('active component item not found in stack');\n }\n }\n if (this.contentItems.length > 0 && activeItemIndex === undefined) {\n throw new Error('expected non-empty stack to have an active component item');\n }\n else {\n const result = {\n type: 'stack',\n content: this.calculateConfigContent(),\n size: this.size,\n sizeUnit: this.sizeUnit,\n minSize: this.minSize,\n minSizeUnit: this.minSizeUnit,\n id: this.id,\n isClosable: this.isClosable,\n maximised: this.isMaximised,\n header: this.createHeaderConfig(),\n activeItemIndex,\n };\n return result;\n }\n }\n /**\n * Ok, this one is going to be the tricky one: The user has dropped a {@link (ContentItem:class)} onto this stack.\n *\n * It was dropped on either the stacks header or the top, right, bottom or left bit of the content area\n * (which one of those is stored in this._dropSegment). Now, if the user has dropped on the header the case\n * is relatively clear: We add the item to the existing stack... job done (might be good to have\n * tab reordering at some point, but lets not sweat it right now)\n *\n * If the item was dropped on the content part things are a bit more complicated. If it was dropped on either the\n * top or bottom region we need to create a new column and place the items accordingly.\n * Unless, of course if the stack is already within a column... in which case we want\n * to add the newly created item to the existing column...\n * either prepend or append it, depending on wether its top or bottom.\n *\n * Same thing for rows and left / right drop segments... so in total there are 9 things that can potentially happen\n * (left, top, right, bottom) * is child of the right parent (row, column) + header drop\n *\n * @internal\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDrop(contentItem, area) {\n /*\n * The item was dropped on the header area. Just add it as a child of this stack and\n * get the hell out of this logic\n */\n if (this._dropSegment === \"header\" /* Header */) {\n this.resetHeaderDropZone();\n if (this._dropIndex === undefined) {\n throw new UnexpectedUndefinedError('SODDI68990');\n }\n else {\n this.addChild(contentItem, this._dropIndex);\n return;\n }\n }\n /*\n * The stack is empty. Let's just add the element.\n */\n if (this._dropSegment === \"body\" /* Body */) {\n this.addChild(contentItem, 0, true);\n return;\n }\n /*\n * The item was dropped on the top-, left-, bottom- or right- part of the content. Let's\n * aggregate some conditions to make the if statements later on more readable\n */\n const isVertical = this._dropSegment === \"top\" /* Top */ || this._dropSegment === \"bottom\" /* Bottom */;\n const isHorizontal = this._dropSegment === \"left\" /* Left */ || this._dropSegment === \"right\" /* Right */;\n const insertBefore = this._dropSegment === \"top\" /* Top */ || this._dropSegment === \"left\" /* Left */;\n const hasCorrectParent = (isVertical && this.stackParent.isColumn) || (isHorizontal && this.stackParent.isRow);\n /*\n * The content item can be either a component or a stack. If it is a component, wrap it into a stack\n */\n if (contentItem.isComponent) {\n const itemConfig = ResolvedStackItemConfig.createDefault();\n itemConfig.header = this.createHeaderConfig();\n const stack = this.layoutManager.createAndInitContentItem(itemConfig, this);\n stack.addChild(contentItem);\n contentItem = stack;\n }\n /*\n * If the contentItem that's being dropped is not dropped on a Stack (cases which just passed above and\n * which would wrap the contentItem in a Stack) we need to check whether contentItem is a RowOrColumn.\n * If it is, we need to re-wrap it in a Stack like it was when it was dragged by its Tab (it was dragged!).\n */\n if (contentItem.type === ItemType.row || contentItem.type === ItemType.column) {\n const itemConfig = ResolvedStackItemConfig.createDefault();\n itemConfig.header = this.createHeaderConfig();\n const stack = this.layoutManager.createContentItem(itemConfig, this);\n stack.addChild(contentItem);\n contentItem = stack;\n }\n /*\n * If the item is dropped on top or bottom of a column or left and right of a row, it's already\n * layd out in the correct way. Just add it as a child\n */\n if (hasCorrectParent) {\n const index = this.stackParent.contentItems.indexOf(this);\n this.stackParent.addChild(contentItem, insertBefore ? index : index + 1, true);\n this.size *= 0.5;\n contentItem.size = this.size;\n contentItem.sizeUnit = this.sizeUnit;\n this.stackParent.updateSize(false);\n /*\n * This handles items that are dropped on top or bottom of a row or left / right of a column. We need\n * to create the appropriate contentItem for them to live in\n */\n }\n else {\n const type = isVertical ? ItemType.column : ItemType.row;\n const itemConfig = ResolvedItemConfig.createDefault(type);\n const rowOrColumn = this.layoutManager.createContentItem(itemConfig, this);\n this.stackParent.replaceChild(this, rowOrColumn);\n rowOrColumn.addChild(contentItem, insertBefore ? 0 : undefined, true);\n rowOrColumn.addChild(this, insertBefore ? undefined : 0, true);\n this.size = 50;\n contentItem.size = 50;\n contentItem.sizeUnit = SizeUnitEnum.Percent;\n rowOrColumn.updateSize(false);\n }\n }\n /**\n * If the user hovers above the header part of the stack, indicate drop positions for tabs.\n * otherwise indicate which segment of the body the dragged item would be dropped on\n *\n * @param x - Absolute Screen X\n * @param y - Absolute Screen Y\n * @internal\n */\n highlightDropZone(x, y) {\n for (const key in this._contentAreaDimensions) {\n const segment = key;\n const area = this._contentAreaDimensions[segment].hoverArea;\n if (area.x1 < x && area.x2 > x && area.y1 < y && area.y2 > y) {\n if (segment === \"header\" /* Header */) {\n this._dropSegment = \"header\" /* Header */;\n this.highlightHeaderDropZone(this._header.leftRightSided ? y : x);\n }\n else {\n this.resetHeaderDropZone();\n this.highlightBodyDropZone(segment);\n }\n return;\n }\n }\n }\n /** @internal */\n getArea() {\n if (this.element.style.display === 'none') {\n return null;\n }\n const headerArea = super.getElementArea(this._header.element);\n const contentArea = super.getElementArea(this._childElementContainer);\n if (headerArea === null || contentArea === null) {\n throw new UnexpectedNullError('SGAHC13086');\n }\n const contentWidth = contentArea.x2 - contentArea.x1;\n const contentHeight = contentArea.y2 - contentArea.y1;\n this._contentAreaDimensions = {\n header: {\n hoverArea: {\n x1: headerArea.x1,\n y1: headerArea.y1,\n x2: headerArea.x2,\n y2: headerArea.y2\n },\n highlightArea: {\n x1: headerArea.x1,\n y1: headerArea.y1,\n x2: headerArea.x2,\n y2: headerArea.y2\n }\n }\n };\n /**\n * Highlight the entire body if the stack is empty\n */\n if (this.contentItems.length === 0) {\n this._contentAreaDimensions.body = {\n hoverArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n }\n };\n return super.getElementArea(this.element);\n }\n else {\n this._contentAreaDimensions.left = {\n hoverArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x1 + contentWidth * 0.25,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x1 + contentWidth * 0.5,\n y2: contentArea.y2\n }\n };\n this._contentAreaDimensions.top = {\n hoverArea: {\n x1: contentArea.x1 + contentWidth * 0.25,\n y1: contentArea.y1,\n x2: contentArea.x1 + contentWidth * 0.75,\n y2: contentArea.y1 + contentHeight * 0.5\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y1 + contentHeight * 0.5\n }\n };\n this._contentAreaDimensions.right = {\n hoverArea: {\n x1: contentArea.x1 + contentWidth * 0.75,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1 + contentWidth * 0.5,\n y1: contentArea.y1,\n x2: contentArea.x2,\n y2: contentArea.y2\n }\n };\n this._contentAreaDimensions.bottom = {\n hoverArea: {\n x1: contentArea.x1 + contentWidth * 0.25,\n y1: contentArea.y1 + contentHeight * 0.5,\n x2: contentArea.x1 + contentWidth * 0.75,\n y2: contentArea.y2\n },\n highlightArea: {\n x1: contentArea.x1,\n y1: contentArea.y1 + contentHeight * 0.5,\n x2: contentArea.x2,\n y2: contentArea.y2\n }\n };\n return super.getElementArea(this.element);\n }\n }\n /**\n * Programmatically operate with header position.\n *\n * @param position -\n *\n * @returns previous header position\n * @internal\n */\n positionHeader(position) {\n if (this._header.side !== position) {\n this._header.setSide(position);\n this._headerSideChanged = true;\n this.setupHeaderPosition();\n }\n }\n /** @internal */\n updateNodeSize() {\n if (this.element.style.display !== 'none') {\n const content = getElementWidthAndHeight(this.element);\n if (this._header.show) {\n const dimension = this._header.leftRightSided ? WidthOrHeightPropertyName.width : WidthOrHeightPropertyName.height;\n content[dimension] -= this.layoutManager.layoutConfig.dimensions.headerHeight;\n }\n this._childElementContainer.style.width = numberToPixels(content.width);\n this._childElementContainer.style.height = numberToPixels(content.height);\n for (let i = 0; i < this.contentItems.length; i++) {\n this.contentItems[i].element.style.width = numberToPixels(content.width);\n this.contentItems[i].element.style.height = numberToPixels(content.height);\n }\n this.emit('resize');\n this.emitStateChangedEvent();\n }\n }\n /** @internal */\n highlightHeaderDropZone(x) {\n const visibleTabsLength = this._header.lastVisibleTabIndex + 1;\n const tabsContainerElement = this._header.tabsContainerElement;\n const tabsContainerElementChildNodes = tabsContainerElement.childNodes;\n // Create shallow copy of childNodes list, excluding DropPlaceHolder, as we will be modifying the childNodes list\n const visibleTabElements = new Array(visibleTabsLength);\n let tabIndex = 0;\n let tabCount = 0;\n while (tabCount < visibleTabsLength) {\n const visibleTabElement = tabsContainerElementChildNodes[tabIndex++];\n if (visibleTabElement !== this.layoutManager.tabDropPlaceholder) {\n visibleTabElements[tabCount++] = visibleTabElement;\n }\n }\n const dropTargetIndicator = this.layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('SHHDZDTI97110');\n }\n let area;\n // Empty stack\n if (visibleTabsLength === 0) {\n const headerRect = this._header.element.getBoundingClientRect();\n const headerTop = headerRect.top + document.body.scrollTop;\n const headerLeft = headerRect.left + document.body.scrollLeft;\n area = {\n x1: headerLeft,\n x2: headerLeft + 100,\n y1: headerTop + headerRect.height - 20,\n y2: headerTop + headerRect.height,\n };\n this._dropIndex = 0;\n }\n else {\n let tabIndex = 0;\n // This indicates whether our cursor is exactly over a tab\n let isAboveTab = false;\n let tabTop;\n let tabLeft;\n let tabWidth;\n let tabElement;\n do {\n tabElement = visibleTabElements[tabIndex];\n const tabRect = tabElement.getBoundingClientRect();\n const tabRectTop = tabRect.top + document.body.scrollTop;\n const tabRectLeft = tabRect.left + document.body.scrollLeft;\n if (this._header.leftRightSided) {\n tabLeft = tabRectTop;\n tabTop = tabRectLeft;\n tabWidth = tabRect.height;\n }\n else {\n tabLeft = tabRectLeft;\n tabTop = tabRectTop;\n tabWidth = tabRect.width;\n }\n if (x >= tabLeft && x < tabLeft + tabWidth) {\n isAboveTab = true;\n }\n else {\n tabIndex++;\n }\n } while (tabIndex < visibleTabsLength && !isAboveTab);\n // If we're not above any tabs, or to the right of any tab, we are out of the area, so give up\n if (isAboveTab === false && x < tabLeft) {\n return;\n }\n const halfX = tabLeft + tabWidth / 2;\n if (x < halfX) {\n this._dropIndex = tabIndex;\n tabElement.insertAdjacentElement('beforebegin', this.layoutManager.tabDropPlaceholder);\n }\n else {\n this._dropIndex = Math.min(tabIndex + 1, visibleTabsLength);\n tabElement.insertAdjacentElement('afterend', this.layoutManager.tabDropPlaceholder);\n }\n const tabDropPlaceholderRect = this.layoutManager.tabDropPlaceholder.getBoundingClientRect();\n const tabDropPlaceholderRectTop = tabDropPlaceholderRect.top + document.body.scrollTop;\n const tabDropPlaceholderRectLeft = tabDropPlaceholderRect.left + document.body.scrollLeft;\n const tabDropPlaceholderRectWidth = tabDropPlaceholderRect.width;\n if (this._header.leftRightSided) {\n const placeHolderTop = tabDropPlaceholderRectTop;\n area = {\n x1: tabTop,\n x2: tabTop + tabElement.clientHeight,\n y1: placeHolderTop,\n y2: placeHolderTop + tabDropPlaceholderRectWidth,\n };\n }\n else {\n const placeHolderLeft = tabDropPlaceholderRectLeft;\n area = {\n x1: placeHolderLeft,\n x2: placeHolderLeft + tabDropPlaceholderRectWidth,\n y1: tabTop,\n y2: tabTop + tabElement.clientHeight,\n };\n }\n }\n dropTargetIndicator.highlightArea(area, 0);\n return;\n }\n /** @internal */\n resetHeaderDropZone() {\n this.layoutManager.tabDropPlaceholder.remove();\n }\n /** @internal */\n setupHeaderPosition() {\n setElementDisplayVisibility(this._header.element, this._header.show);\n this.element.classList.remove(\"lm_left\" /* Left */, \"lm_right\" /* Right */, \"lm_bottom\" /* Bottom */);\n if (this._header.leftRightSided) {\n this.element.classList.add('lm_' + this._header.side);\n }\n //if ([Side.right, Side.bottom].includes(this._header.side)) {\n // // move the header behind the content.\n // this.element.appendChild(this._header.element);\n //}\n this.updateSize(false);\n }\n /** @internal */\n highlightBodyDropZone(segment) {\n if (this._contentAreaDimensions === undefined) {\n throw new UnexpectedUndefinedError('SHBDZC82265');\n }\n else {\n const highlightArea = this._contentAreaDimensions[segment].highlightArea;\n const dropTargetIndicator = this.layoutManager.dropTargetIndicator;\n if (dropTargetIndicator === null) {\n throw new UnexpectedNullError('SHBDZD96110');\n }\n else {\n dropTargetIndicator.highlightArea(highlightArea, 1);\n this._dropSegment = segment;\n }\n }\n }\n /** @internal */\n handleResize() {\n this._header.updateTabSizes();\n }\n /** @internal */\n handleMaximised() {\n this._header.processMaximised();\n }\n /** @internal */\n handleMinimised() {\n this._header.processMinimised();\n }\n /** @internal */\n handlePopoutEvent() {\n this.popout();\n }\n /** @internal */\n handleHeaderClickEvent(ev) {\n const eventName = EventEmitter.headerClickEventName;\n const bubblingEvent = new EventEmitter.ClickBubblingEvent(eventName, this, ev);\n this.emit(eventName, bubblingEvent);\n }\n /** @internal */\n handleHeaderTouchStartEvent(ev) {\n const eventName = EventEmitter.headerTouchStartEventName;\n const bubblingEvent = new EventEmitter.TouchStartBubblingEvent(eventName, this, ev);\n this.emit(eventName, bubblingEvent);\n }\n /** @internal */\n handleHeaderComponentRemoveEvent(item) {\n this.removeChild(item, false);\n }\n /** @internal */\n handleHeaderComponentFocusEvent(item) {\n this.setActiveComponentItem(item, true);\n }\n /** @internal */\n handleHeaderComponentStartDragEvent(x, y, dragListener, componentItem) {\n if (this.isMaximised === true) {\n this.toggleMaximise();\n }\n this.layoutManager.startComponentDrag(x, y, dragListener, componentItem, this);\n }\n /** @internal */\n createHeaderConfig() {\n if (!this._headerSideChanged) {\n return ResolvedHeaderedItemConfig.Header.createCopy(this._headerConfig);\n }\n else {\n const show = this._header.show ? this._header.side : false;\n let result = ResolvedHeaderedItemConfig.Header.createCopy(this._headerConfig, show);\n if (result === undefined) {\n result = {\n show,\n popout: undefined,\n maximise: undefined,\n close: undefined,\n minimise: undefined,\n tabDropdown: undefined,\n };\n }\n return result;\n }\n }\n /** @internal */\n emitStateChangedEvent() {\n this.emitBaseBubblingEvent('stateChanged');\n }\n}\n/** @public */\n(function (Stack) {\n /** @internal */\n function createElement(document) {\n const element = document.createElement('div');\n element.classList.add(\"lm_item\" /* Item */);\n element.classList.add(\"lm_stack\" /* Stack */);\n return element;\n }\n Stack.createElement = createElement;\n})(Stack || (Stack = {}));\n//# sourceMappingURL=stack.js.map","import { ItemConfig, LayoutConfig } from './config/config';\nimport { ResolvedItemConfig, ResolvedLayoutConfig, ResolvedRootItemConfig } from \"./config/resolved-config\";\nimport { BrowserPopout } from './controls/browser-popout';\nimport { DragProxy } from './controls/drag-proxy';\nimport { DragSource } from './controls/drag-source';\nimport { DropTargetIndicator } from './controls/drop-target-indicator';\nimport { TransitionIndicator } from './controls/transition-indicator';\nimport { ConfigurationError } from './errors/external-error';\nimport { AssertError, UnexpectedNullError, UnexpectedUndefinedError, UnreachableCaseError } from './errors/internal-error';\nimport { ComponentItem } from './items/component-item';\nimport { ContentItem } from './items/content-item';\nimport { GroundItem } from './items/ground-item';\nimport { RowOrColumn } from './items/row-or-column';\nimport { Stack } from './items/stack';\nimport { ConfigMinifier } from './utils/config-minifier';\nimport { EventEmitter } from './utils/event-emitter';\nimport { EventHub } from './utils/event-hub';\nimport { I18nStrings, i18nStrings } from './utils/i18n-strings';\nimport { ItemType, ResponsiveMode } from './utils/types';\nimport { getElementWidthAndHeight, removeFromArray, setElementHeight, setElementWidth } from './utils/utils';\n/**\n * The main class that will be exposed as GoldenLayout.\n */\n/** @public */\nexport class LayoutManager extends EventEmitter {\n /**\n * @param container - A Dom HTML element. Defaults to body\n * @internal\n */\n constructor(parameters) {\n super();\n /** Whether the layout will be automatically be resized to container whenever the container's size is changed\n * Default is true if is the container otherwise false\n * Default will be changed to true for any container in the future\n */\n this.resizeWithContainerAutomatically = false;\n /** The debounce interval (in milliseconds) used whenever a layout is automatically resized. 0 means next tick */\n this.resizeDebounceInterval = 100;\n /** Extend the current debounce delay time period if it is triggered during the delay.\n * If this is true, the layout will only resize when its container has stopped being resized.\n * If it is false, the layout will resize at intervals while its container is being resized.\n */\n this.resizeDebounceExtendedWhenPossible = true;\n /** @internal */\n this._isInitialised = false;\n /** @internal */\n this._groundItem = undefined;\n /** @internal */\n this._openPopouts = [];\n /** @internal */\n this._dropTargetIndicator = null;\n /** @internal */\n this._transitionIndicator = null;\n /** @internal */\n this._itemAreas = [];\n /** @internal */\n this._maximisePlaceholder = LayoutManager.createMaximisePlaceElement(document);\n /** @internal */\n this._tabDropPlaceholder = LayoutManager.createTabDropPlaceholderElement(document);\n /** @internal */\n this._dragSources = [];\n /** @internal */\n this._updatingColumnsResponsive = false;\n /** @internal */\n this._firstLoad = true;\n /** @internal */\n this._eventHub = new EventHub(this);\n /** @internal */\n this._width = null;\n /** @internal */\n this._height = null;\n /** @internal */\n this._virtualSizedContainers = [];\n /** @internal */\n this._virtualSizedContainerAddingBeginCount = 0;\n /** @internal */\n this._sizeInvalidationBeginCount = 0;\n /** @internal */\n this._resizeObserver = new ResizeObserver(() => this.handleContainerResize());\n /** @internal @deprecated to be removed in version 3 */\n this._windowBeforeUnloadListener = () => this.onBeforeUnload();\n /** @internal @deprecated to be removed in version 3 */\n this._windowBeforeUnloadListening = false;\n /** @internal */\n this._maximisedStackBeforeDestroyedListener = (ev) => this.cleanupBeforeMaximisedStackDestroyed(ev);\n this.isSubWindow = parameters.isSubWindow;\n this._constructorOrSubWindowLayoutConfig = parameters.constructorOrSubWindowLayoutConfig;\n I18nStrings.checkInitialise();\n ConfigMinifier.checkInitialise();\n if (parameters.containerElement !== undefined) {\n this._containerElement = parameters.containerElement;\n }\n }\n get container() { return this._containerElement; }\n get isInitialised() { return this._isInitialised; }\n /** @internal */\n get groundItem() { return this._groundItem; }\n /** @internal @deprecated use {@link (LayoutManager:class).groundItem} instead */\n get root() { return this._groundItem; }\n get openPopouts() { return this._openPopouts; }\n /** @internal */\n get dropTargetIndicator() { return this._dropTargetIndicator; }\n /** @internal @deprecated To be removed */\n get transitionIndicator() { return this._transitionIndicator; }\n get width() { return this._width; }\n get height() { return this._height; }\n /**\n * Retrieves the {@link (EventHub:class)} instance associated with this layout manager.\n * This can be used to propagate events between the windows\n * @public\n */\n get eventHub() { return this._eventHub; }\n get rootItem() {\n if (this._groundItem === undefined) {\n throw new Error('Cannot access rootItem before init');\n }\n else {\n const groundContentItems = this._groundItem.contentItems;\n if (groundContentItems.length === 0) {\n return undefined;\n }\n else {\n return this._groundItem.contentItems[0];\n }\n }\n }\n get focusedComponentItem() { return this._focusedComponentItem; }\n /** @internal */\n get tabDropPlaceholder() { return this._tabDropPlaceholder; }\n get maximisedStack() { return this._maximisedStack; }\n /** @deprecated indicates deprecated constructor use */\n get deprecatedConstructor() { return !this.isSubWindow && this._constructorOrSubWindowLayoutConfig !== undefined; }\n /**\n * Destroys the LayoutManager instance itself as well as every ContentItem\n * within it. After this is called nothing should be left of the LayoutManager.\n *\n * This function only needs to be called if an application wishes to destroy the Golden Layout object while\n * a page remains loaded. When a page is unloaded, all resources claimed by Golden Layout will automatically\n * be released.\n */\n destroy() {\n if (this._isInitialised) {\n if (this._windowBeforeUnloadListening) {\n globalThis.removeEventListener('beforeunload', this._windowBeforeUnloadListener);\n this._windowBeforeUnloadListening = false;\n }\n if (this.layoutConfig.settings.closePopoutsOnUnload === true) {\n this.closeAllOpenPopouts();\n }\n this._resizeObserver.disconnect();\n this.checkClearResizeTimeout();\n if (this._groundItem !== undefined) {\n this._groundItem.destroy();\n }\n this._tabDropPlaceholder.remove();\n if (this._dropTargetIndicator !== null) {\n this._dropTargetIndicator.destroy();\n }\n if (this._transitionIndicator !== null) {\n this._transitionIndicator.destroy();\n }\n this._eventHub.destroy();\n for (const dragSource of this._dragSources) {\n dragSource.destroy();\n }\n this._dragSources = [];\n this._isInitialised = false;\n }\n }\n /**\n * Takes a GoldenLayout configuration object and\n * replaces its keys and values recursively with\n * one letter codes\n * @deprecated use {@link (ResolvedLayoutConfig:namespace).minifyConfig} instead\n */\n minifyConfig(config) {\n return ResolvedLayoutConfig.minifyConfig(config);\n }\n /**\n * Takes a configuration Object that was previously minified\n * using minifyConfig and returns its original version\n * @deprecated use {@link (ResolvedLayoutConfig:namespace).unminifyConfig} instead\n */\n unminifyConfig(config) {\n return ResolvedLayoutConfig.unminifyConfig(config);\n }\n /**\n * Called from GoldenLayout class. Finishes of init\n * @internal\n */\n init() {\n this.setContainer();\n this._dropTargetIndicator = new DropTargetIndicator( /*this.container*/);\n this._transitionIndicator = new TransitionIndicator();\n this.updateSizeFromContainer();\n let subWindowRootConfig;\n if (this.isSubWindow) {\n if (this._constructorOrSubWindowLayoutConfig === undefined) {\n // SubWindow LayoutConfig should have been generated by constructor\n throw new UnexpectedUndefinedError('LMIU07155');\n }\n else {\n const root = this._constructorOrSubWindowLayoutConfig.root;\n if (root === undefined) {\n // SubWindow LayoutConfig must not be empty\n throw new AssertError('LMIC07156');\n }\n else {\n if (ItemConfig.isComponent(root)) {\n subWindowRootConfig = root;\n }\n else {\n // SubWindow LayoutConfig must have Component as Root\n throw new AssertError('LMIC07157');\n }\n }\n const resolvedLayoutConfig = LayoutConfig.resolve(this._constructorOrSubWindowLayoutConfig);\n // remove root from layoutConfig\n this.layoutConfig = Object.assign(Object.assign({}, resolvedLayoutConfig), { root: undefined });\n }\n }\n else {\n if (this._constructorOrSubWindowLayoutConfig === undefined) {\n this.layoutConfig = ResolvedLayoutConfig.createDefault(); // will overwritten be loaded via loadLayout\n }\n else {\n // backwards compatibility\n this.layoutConfig = LayoutConfig.resolve(this._constructorOrSubWindowLayoutConfig);\n }\n }\n const layoutConfig = this.layoutConfig;\n this._groundItem = new GroundItem(this, layoutConfig.root, this._containerElement);\n this._groundItem.init();\n this.checkLoadedLayoutMaximiseItem();\n this._resizeObserver.observe(this._containerElement);\n this._isInitialised = true;\n this.adjustColumnsResponsive();\n this.emit('initialised');\n if (subWindowRootConfig !== undefined) {\n // must be SubWindow\n this.loadComponentAsRoot(subWindowRootConfig);\n }\n }\n /**\n * Loads a new layout\n * @param layoutConfig - New layout to be loaded\n */\n loadLayout(layoutConfig) {\n if (!this.isInitialised) {\n // In case application not correctly using legacy constructor\n throw new Error('GoldenLayout: Need to call init() if LayoutConfig with defined root passed to constructor');\n }\n else {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMLL11119');\n }\n else {\n this.createSubWindows(); // still needs to be tested\n this.layoutConfig = LayoutConfig.resolve(layoutConfig);\n this._groundItem.loadRoot(this.layoutConfig.root);\n this.checkLoadedLayoutMaximiseItem();\n this.adjustColumnsResponsive();\n }\n }\n }\n /**\n * Creates a layout configuration object based on the the current state\n *\n * @public\n * @returns GoldenLayout configuration\n */\n saveLayout() {\n if (this._isInitialised === false) {\n throw new Error('Can\\'t create config, layout not yet initialised');\n }\n else {\n // if (root !== undefined && !(root instanceof ContentItem)) {\n // throw new Error('Root must be a ContentItem');\n // }\n /*\n * Content\n */\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMTC18244');\n }\n else {\n const groundContent = this._groundItem.calculateConfigContent();\n let rootItemConfig;\n if (groundContent.length !== 1) {\n rootItemConfig = undefined;\n }\n else {\n rootItemConfig = groundContent[0];\n }\n /*\n * Retrieve config for subwindows\n */\n this.reconcilePopoutWindows();\n const openPopouts = [];\n for (let i = 0; i < this._openPopouts.length; i++) {\n openPopouts.push(this._openPopouts[i].toConfig());\n }\n const config = {\n root: rootItemConfig,\n openPopouts,\n settings: ResolvedLayoutConfig.Settings.createCopy(this.layoutConfig.settings),\n dimensions: ResolvedLayoutConfig.Dimensions.createCopy(this.layoutConfig.dimensions),\n header: ResolvedLayoutConfig.Header.createCopy(this.layoutConfig.header),\n resolved: true,\n };\n return config;\n }\n }\n }\n /**\n * Removes any existing layout. Effectively, an empty layout will be loaded.\n */\n clear() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMCL11129');\n }\n else {\n this._groundItem.clearRoot();\n }\n }\n /**\n * @deprecated Use {@link (LayoutManager:class).saveLayout}\n */\n toConfig() {\n return this.saveLayout();\n }\n /**\n * Adds a new ComponentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added\n * @param componentTypeName - Name of component type to be created.\n * @param state - Optional initial state to be assigned to component\n * @returns New ComponentItem created.\n */\n newComponent(componentType, componentState, title) {\n const componentItem = this.newComponentAtLocation(componentType, componentState, title);\n if (componentItem === undefined) {\n throw new AssertError('LMNC65588');\n }\n else {\n return componentItem;\n }\n }\n /**\n * Adds a ComponentItem at the first valid selector location.\n * @param componentTypeName - Name of component type to be created.\n * @param state - Optional initial state to be assigned to component\n * @param locationSelectors - Array of location selectors used to find location in layout where component\n * will be added. First location in array which is valid will be used. If locationSelectors is undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used\n * @returns New ComponentItem created or undefined if no valid location selector was in array.\n */\n newComponentAtLocation(componentType, componentState, title, locationSelectors) {\n if (this._groundItem === undefined) {\n throw new Error('Cannot add component before init');\n }\n else {\n const location = this.addComponentAtLocation(componentType, componentState, title, locationSelectors);\n if (location === undefined) {\n return undefined;\n }\n else {\n const createdItem = location.parentItem.contentItems[location.index];\n if (!ContentItem.isComponentItem(createdItem)) {\n throw new AssertError('LMNC992877533');\n }\n else {\n return createdItem;\n }\n }\n }\n }\n /**\n * Adds a new ComponentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added\n * @param componentType - Type of component to be created.\n * @param state - Optional initial state to be assigned to component\n * @returns Location of new ComponentItem created.\n */\n addComponent(componentType, componentState, title) {\n const location = this.addComponentAtLocation(componentType, componentState, title);\n if (location === undefined) {\n throw new AssertError('LMAC99943');\n }\n else {\n return location;\n }\n }\n /**\n * Adds a ComponentItem at the first valid selector location.\n * @param componentType - Type of component to be created.\n * @param state - Optional initial state to be assigned to component\n * @param locationSelectors - Array of location selectors used to find determine location in layout where component\n * will be added. First location in array which is valid will be used. If undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used.\n * @returns Location of new ComponentItem created or undefined if no valid location selector was in array.\n */\n addComponentAtLocation(componentType, componentState, title, locationSelectors) {\n const itemConfig = {\n type: 'component',\n componentType,\n componentState,\n title,\n };\n return this.addItemAtLocation(itemConfig, locationSelectors);\n }\n /**\n * Adds a new ContentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @returns New ContentItem created.\n */\n newItem(itemConfig) {\n const contentItem = this.newItemAtLocation(itemConfig);\n if (contentItem === undefined) {\n throw new AssertError('LMNC65588');\n }\n else {\n return contentItem;\n }\n }\n /**\n * Adds a new child ContentItem under the root ContentItem. If a root does not exist, then create root ContentItem instead\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @param locationSelectors - Array of location selectors used to find determine location in layout where ContentItem\n * will be added. First location in array which is valid will be used. If undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used.\n * @returns New ContentItem created or undefined if no valid location selector was in array. */\n newItemAtLocation(itemConfig, locationSelectors) {\n if (this._groundItem === undefined) {\n throw new Error('Cannot add component before init');\n }\n else {\n const location = this.addItemAtLocation(itemConfig, locationSelectors);\n if (location === undefined) {\n return undefined;\n }\n else {\n const createdItem = location.parentItem.contentItems[location.index];\n return createdItem;\n }\n }\n }\n /**\n * Adds a new ContentItem. Will use default location selectors to ensure a location is found and\n * component is successfully added.\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @returns Location of new ContentItem created. */\n addItem(itemConfig) {\n const location = this.addItemAtLocation(itemConfig);\n if (location === undefined) {\n throw new AssertError('LMAI99943');\n }\n else {\n return location;\n }\n }\n /**\n * Adds a ContentItem at the first valid selector location.\n * @param itemConfig - ResolvedItemConfig of child to be added.\n * @param locationSelectors - Array of location selectors used to find determine location in layout where ContentItem\n * will be added. First location in array which is valid will be used. If undefined,\n * {@link (LayoutManager:namespace).defaultLocationSelectors} will be used.\n * @returns Location of new ContentItem created or undefined if no valid location selector was in array. */\n addItemAtLocation(itemConfig, locationSelectors) {\n if (this._groundItem === undefined) {\n throw new Error('Cannot add component before init');\n }\n else {\n if (locationSelectors === undefined) {\n // defaultLocationSelectors should always find a location\n locationSelectors = LayoutManager.defaultLocationSelectors;\n }\n const location = this.findFirstLocation(locationSelectors);\n if (location === undefined) {\n return undefined;\n }\n else {\n let parentItem = location.parentItem;\n let addIdx;\n switch (parentItem.type) {\n case ItemType.ground: {\n const groundItem = parentItem;\n addIdx = groundItem.addItem(itemConfig, location.index);\n if (addIdx >= 0) {\n parentItem = this._groundItem.contentItems[0]; // was added to rootItem\n }\n else {\n addIdx = 0; // was added as rootItem (which is the first and only ContentItem in GroundItem)\n }\n break;\n }\n case ItemType.row:\n case ItemType.column: {\n const rowOrColumn = parentItem;\n addIdx = rowOrColumn.addItem(itemConfig, location.index);\n break;\n }\n case ItemType.stack: {\n if (!ItemConfig.isComponent(itemConfig)) {\n throw Error(i18nStrings[6 /* ItemConfigIsNotTypeComponent */]);\n }\n else {\n const stack = parentItem;\n addIdx = stack.addItem(itemConfig, location.index);\n break;\n }\n }\n case ItemType.component: {\n throw new AssertError('LMAIALC87444602');\n }\n default:\n throw new UnreachableCaseError('LMAIALU98881733', parentItem.type);\n }\n if (ItemConfig.isComponent(itemConfig)) {\n // see if stack was inserted\n const item = parentItem.contentItems[addIdx];\n if (ContentItem.isStack(item)) {\n parentItem = item;\n addIdx = 0;\n }\n }\n location.parentItem = parentItem;\n location.index = addIdx;\n return location;\n }\n }\n }\n /** Loads the specified component ResolvedItemConfig as root.\n * This can be used to display a Component all by itself. The layout cannot be changed other than having another new layout loaded.\n * Note that, if this layout is saved and reloaded, it will reload with the Component as a child of a Stack.\n */\n loadComponentAsRoot(itemConfig) {\n if (this._groundItem === undefined) {\n throw new Error('Cannot add item before init');\n }\n else {\n this._groundItem.loadComponentAsRoot(itemConfig);\n }\n }\n /** @deprecated Use {@link (LayoutManager:class).setSize} */\n updateSize(width, height) {\n this.setSize(width, height);\n }\n /**\n * Updates the layout managers size\n *\n * @param width - Width in pixels\n * @param height - Height in pixels\n */\n setSize(width, height) {\n this._width = width;\n this._height = height;\n if (this._isInitialised === true) {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMUS18881');\n }\n else {\n this._groundItem.setSize(this._width, this._height);\n if (this._maximisedStack) {\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n setElementWidth(this._maximisedStack.element, width);\n setElementHeight(this._maximisedStack.element, height);\n this._maximisedStack.updateSize(false);\n }\n this.adjustColumnsResponsive();\n }\n }\n }\n /** @internal */\n beginSizeInvalidation() {\n this._sizeInvalidationBeginCount++;\n }\n /** @internal */\n endSizeInvalidation() {\n if (--this._sizeInvalidationBeginCount === 0) {\n this.updateSizeFromContainer();\n }\n }\n /** @internal */\n updateSizeFromContainer() {\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n this.setSize(width, height);\n }\n /**\n * Update the size of the root ContentItem. This will update the size of all contentItems in the tree\n * @param force - In some cases the size is not updated if it has not changed. In this case, events\n * (such as ComponentContainer.virtualRectingRequiredEvent) are not fired. Setting force to true, ensures the size is updated regardless, and\n * the respective events are fired. This is sometimes necessary when a component's size has not changed but it has become visible, and the\n * relevant events need to be fired.\n */\n updateRootSize(force = false) {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMURS28881');\n }\n else {\n this._groundItem.updateSize(force);\n }\n }\n /** @public */\n createAndInitContentItem(config, parent) {\n const newItem = this.createContentItem(config, parent);\n newItem.init();\n return newItem;\n }\n /**\n * Recursively creates new item tree structures based on a provided\n * ItemConfiguration object\n *\n * @param config - ResolvedItemConfig\n * @param parent - The item the newly created item should be a child of\n * @internal\n */\n createContentItem(config, parent) {\n if (typeof config.type !== 'string') {\n throw new ConfigurationError('Missing parameter \\'type\\'', JSON.stringify(config));\n }\n /**\n * We add an additional stack around every component that's not within a stack anyways.\n */\n if (\n // If this is a component\n ResolvedItemConfig.isComponentItem(config) &&\n // and it's not already within a stack\n !(parent instanceof Stack) &&\n // and we have a parent\n !!parent &&\n // and it's not the topmost item in a new window\n !(this.isSubWindow === true && parent instanceof GroundItem)) {\n const stackConfig = {\n type: ItemType.stack,\n content: [config],\n size: config.size,\n sizeUnit: config.sizeUnit,\n minSize: config.minSize,\n minSizeUnit: config.minSizeUnit,\n id: config.id,\n maximised: config.maximised,\n isClosable: config.isClosable,\n activeItemIndex: 0,\n header: undefined,\n };\n config = stackConfig;\n }\n const contentItem = this.createContentItemFromConfig(config, parent);\n return contentItem;\n }\n findFirstComponentItemById(id) {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFFCIBI82446');\n }\n else {\n return this.findFirstContentItemTypeByIdRecursive(ItemType.component, id, this._groundItem);\n }\n }\n /**\n * Creates a popout window with the specified content at the specified position\n *\n * @param itemConfigOrContentItem - The content of the popout window's layout manager derived from either\n * a {@link (ContentItem:class)} or {@link (ItemConfig:interface)} or ResolvedItemConfig content (array of {@link (ItemConfig:interface)})\n * @param positionAndSize - The width, height, left and top of Popout window\n * @param parentId -The id of the element this item will be appended to when popIn is called\n * @param indexInParent - The position of this item within its parent element\n */\n createPopout(itemConfigOrContentItem, positionAndSize, parentId, indexInParent) {\n if (itemConfigOrContentItem instanceof ContentItem) {\n return this.createPopoutFromContentItem(itemConfigOrContentItem, positionAndSize, parentId, indexInParent);\n }\n else {\n return this.createPopoutFromItemConfig(itemConfigOrContentItem, positionAndSize, parentId, indexInParent);\n }\n }\n /** @internal */\n createPopoutFromContentItem(item, window, parentId, indexInParent) {\n /**\n * If the item is the only component within a stack or for some\n * other reason the only child of its parent the parent will be destroyed\n * when the child is removed.\n *\n * In order to support this we move up the tree until we find something\n * that will remain after the item is being popped out\n */\n let parent = item.parent;\n let child = item;\n while (parent !== null && parent.contentItems.length === 1 && !parent.isGround) {\n child = parent;\n parent = parent.parent;\n }\n if (parent === null) {\n throw new UnexpectedNullError('LMCPFCI00834');\n }\n else {\n if (indexInParent === undefined) {\n indexInParent = parent.contentItems.indexOf(child);\n }\n if (parentId !== null) {\n parent.addPopInParentId(parentId);\n }\n if (window === undefined) {\n const windowLeft = globalThis.screenX || globalThis.screenLeft;\n const windowTop = globalThis.screenY || globalThis.screenTop;\n const offsetLeft = item.element.offsetLeft;\n const offsetTop = item.element.offsetTop;\n // const { left: offsetLeft, top: offsetTop } = getJQueryLeftAndTop(item.element);\n const { width, height } = getElementWidthAndHeight(item.element);\n window = {\n left: windowLeft + offsetLeft,\n top: windowTop + offsetTop,\n width,\n height,\n };\n }\n const itemConfig = item.toConfig();\n item.remove();\n if (!ResolvedRootItemConfig.isRootItemConfig(itemConfig)) {\n throw new Error(`${i18nStrings[0 /* PopoutCannotBeCreatedWithGroundItemConfig */]}`);\n }\n else {\n return this.createPopoutFromItemConfig(itemConfig, window, parentId, indexInParent);\n }\n }\n }\n /** @internal */\n beginVirtualSizedContainerAdding() {\n if (++this._virtualSizedContainerAddingBeginCount === 0) {\n this._virtualSizedContainers.length = 0;\n }\n }\n /** @internal */\n addVirtualSizedContainer(container) {\n this._virtualSizedContainers.push(container);\n }\n /** @internal */\n endVirtualSizedContainerAdding() {\n if (--this._virtualSizedContainerAddingBeginCount === 0) {\n const count = this._virtualSizedContainers.length;\n if (count > 0) {\n this.fireBeforeVirtualRectingEvent(count);\n for (let i = 0; i < count; i++) {\n const container = this._virtualSizedContainers[i];\n container.notifyVirtualRectingRequired();\n }\n this.fireAfterVirtualRectingEvent();\n this._virtualSizedContainers.length = 0;\n }\n }\n }\n /** @internal */\n fireBeforeVirtualRectingEvent(count) {\n if (this.beforeVirtualRectingEvent !== undefined) {\n this.beforeVirtualRectingEvent(count);\n }\n }\n /** @internal */\n fireAfterVirtualRectingEvent() {\n if (this.afterVirtualRectingEvent !== undefined) {\n this.afterVirtualRectingEvent();\n }\n }\n /** @internal */\n createPopoutFromItemConfig(rootItemConfig, window, parentId, indexInParent) {\n const layoutConfig = this.toConfig();\n const popoutLayoutConfig = {\n root: rootItemConfig,\n openPopouts: [],\n settings: layoutConfig.settings,\n dimensions: layoutConfig.dimensions,\n header: layoutConfig.header,\n window,\n parentId,\n indexInParent,\n resolved: true,\n };\n return this.createPopoutFromPopoutLayoutConfig(popoutLayoutConfig);\n }\n /** @internal */\n createPopoutFromPopoutLayoutConfig(config) {\n var _a, _b, _c, _d;\n const configWindow = config.window;\n const initialWindow = {\n left: (_a = configWindow.left) !== null && _a !== void 0 ? _a : (globalThis.screenX || globalThis.screenLeft + 20),\n top: (_b = configWindow.top) !== null && _b !== void 0 ? _b : (globalThis.screenY || globalThis.screenTop + 20),\n width: (_c = configWindow.width) !== null && _c !== void 0 ? _c : 500,\n height: (_d = configWindow.height) !== null && _d !== void 0 ? _d : 309,\n };\n const browserPopout = new BrowserPopout(config, initialWindow, this);\n browserPopout.on('initialised', () => this.emit('windowOpened', browserPopout));\n browserPopout.on('closed', () => this.reconcilePopoutWindows());\n this._openPopouts.push(browserPopout);\n if (this.layoutConfig.settings.closePopoutsOnUnload && !this._windowBeforeUnloadListening) {\n globalThis.addEventListener('beforeunload', this._windowBeforeUnloadListener, { passive: true });\n this._windowBeforeUnloadListening = true;\n }\n return browserPopout;\n }\n /**\n * Closes all Open Popouts\n * Applications can call this method when a page is unloaded to remove its open popouts\n */\n closeAllOpenPopouts() {\n for (let i = 0; i < this._openPopouts.length; i++) {\n this._openPopouts[i].close();\n }\n this._openPopouts.length = 0;\n if (this._windowBeforeUnloadListening) {\n globalThis.removeEventListener('beforeunload', this._windowBeforeUnloadListener);\n this._windowBeforeUnloadListening = false;\n }\n }\n newDragSource(element, componentTypeOrItemConfigCallback, componentState, title, id) {\n const dragSource = new DragSource(this, element, [], componentTypeOrItemConfigCallback, componentState, title, id);\n this._dragSources.push(dragSource);\n return dragSource;\n }\n /**\n * Removes a DragListener added by createDragSource() so the corresponding\n * DOM element is not a drag source any more.\n */\n removeDragSource(dragSource) {\n removeFromArray(dragSource, this._dragSources);\n dragSource.destroy();\n }\n /** @internal */\n startComponentDrag(x, y, dragListener, componentItem, stack) {\n new DragProxy(x, y, dragListener, this, componentItem, stack);\n }\n /**\n * Programmatically focuses an item. This focuses the specified component item\n * and the item emits a focus event\n *\n * @param item - The component item to be focused\n * @param suppressEvent - Whether to emit focus event\n */\n focusComponent(item, suppressEvent = false) {\n item.focus(suppressEvent);\n }\n /**\n * Programmatically blurs (defocuses) the currently focused component.\n * If a component item is focused, then it is blurred and and the item emits a blur event\n *\n * @param item - The component item to be blurred\n * @param suppressEvent - Whether to emit blur event\n */\n clearComponentFocus(suppressEvent = false) {\n this.setFocusedComponentItem(undefined, suppressEvent);\n }\n /**\n * Programmatically focuses a component item or removes focus (blurs) from an existing focused component item.\n *\n * @param item - If defined, specifies the component item to be given focus. If undefined, clear component focus.\n * @param suppressEvents - Whether to emit focus and blur events\n * @internal\n */\n setFocusedComponentItem(item, suppressEvents = false) {\n if (item !== this._focusedComponentItem) {\n let newFocusedParentItem;\n if (item === undefined) {\n newFocusedParentItem === undefined;\n }\n else {\n newFocusedParentItem = item.parentItem;\n }\n if (this._focusedComponentItem !== undefined) {\n const oldFocusedItem = this._focusedComponentItem;\n this._focusedComponentItem = undefined;\n oldFocusedItem.setBlurred(suppressEvents);\n const oldFocusedParentItem = oldFocusedItem.parentItem;\n if (newFocusedParentItem === oldFocusedParentItem) {\n newFocusedParentItem = undefined;\n }\n else {\n oldFocusedParentItem.setFocusedValue(false);\n }\n }\n if (item !== undefined) {\n this._focusedComponentItem = item;\n item.setFocused(suppressEvents);\n if (newFocusedParentItem !== undefined) {\n newFocusedParentItem.setFocusedValue(true);\n }\n }\n }\n }\n /** @internal */\n createContentItemFromConfig(config, parent) {\n switch (config.type) {\n case ItemType.ground: throw new AssertError('LMCCIFC68871');\n case ItemType.row: return new RowOrColumn(false, this, config, parent);\n case ItemType.column: return new RowOrColumn(true, this, config, parent);\n case ItemType.stack: return new Stack(this, config, parent);\n case ItemType.component:\n return new ComponentItem(this, config, parent);\n default:\n throw new UnreachableCaseError('CCC913564', config.type, 'Invalid Config Item type specified');\n }\n }\n /**\n * This should only be called from stack component.\n * Stack will look after docking processing associated with maximise/minimise\n * @internal\n **/\n setMaximisedStack(stack) {\n if (stack === undefined) {\n if (this._maximisedStack !== undefined) {\n this.processMinimiseMaximisedStack();\n }\n }\n else {\n if (stack !== this._maximisedStack) {\n if (this._maximisedStack !== undefined) {\n this.processMinimiseMaximisedStack();\n }\n this.processMaximiseStack(stack);\n }\n }\n }\n checkMinimiseMaximisedStack() {\n if (this._maximisedStack !== undefined) {\n this._maximisedStack.minimise();\n }\n }\n // showAllActiveContentItems() was called from ContentItem.show(). Not sure what its purpose was so have commented out\n // Everything seems to work ok without this. Have left commented code just in case there was a reason for it becomes\n // apparent\n // /** @internal */\n // showAllActiveContentItems(): void {\n // const allStacks = this.getAllStacks();\n // for (let i = 0; i < allStacks.length; i++) {\n // const stack = allStacks[i];\n // const activeContentItem = stack.getActiveComponentItem();\n // if (activeContentItem !== undefined) {\n // if (!(activeContentItem instanceof ComponentItem)) {\n // throw new AssertError('LMSAACIS22298');\n // } else {\n // activeContentItem.container.show();\n // }\n // }\n // }\n // }\n // hideAllActiveContentItems() was called from ContentItem.hide(). Not sure what its purpose was so have commented out\n // Everything seems to work ok without this. Have left commented code just in case there was a reason for it becomes\n // apparent\n // /** @internal */\n // hideAllActiveContentItems(): void {\n // const allStacks = this.getAllStacks();\n // for (let i = 0; i < allStacks.length; i++) {\n // const stack = allStacks[i];\n // const activeContentItem = stack.getActiveComponentItem();\n // if (activeContentItem !== undefined) {\n // if (!(activeContentItem instanceof ComponentItem)) {\n // throw new AssertError('LMSAACIH22298');\n // } else {\n // activeContentItem.container.hide();\n // }\n // }\n // }\n // }\n /** @internal */\n cleanupBeforeMaximisedStackDestroyed(event) {\n if (this._maximisedStack !== null && this._maximisedStack === event.target) {\n this._maximisedStack.off('beforeItemDestroyed', this._maximisedStackBeforeDestroyedListener);\n this._maximisedStack = undefined;\n }\n }\n /**\n * This method is used to get around sandboxed iframe restrictions.\n * If 'allow-top-navigation' is not specified in the iframe's 'sandbox' attribute\n * (as is the case with codepens) the parent window is forbidden from calling certain\n * methods on the child, such as window.close() or setting document.location.href.\n *\n * This prevented GoldenLayout popouts from popping in in codepens. The fix is to call\n * _$closeWindow on the child window's gl instance which (after a timeout to disconnect\n * the invoking method from the close call) closes itself.\n *\n * @internal\n */\n closeWindow() {\n globalThis.setTimeout(() => globalThis.close(), 1);\n }\n /** @internal */\n getArea(x, y) {\n let matchingArea = null;\n let smallestSurface = Infinity;\n for (let i = 0; i < this._itemAreas.length; i++) {\n const area = this._itemAreas[i];\n if (x >= area.x1 &&\n x < area.x2 && // x2 is not included in area\n y >= area.y1 &&\n y < area.y2 && // y2 is not included in area\n smallestSurface > area.surface) {\n smallestSurface = area.surface;\n matchingArea = area;\n }\n }\n return matchingArea;\n }\n /** @internal */\n calculateItemAreas() {\n const allContentItems = this.getAllContentItems();\n /**\n * If the last item is dragged out, highlight the entire container size to\n * allow to re-drop it. this.ground.contentiItems.length === 0 at this point\n *\n * Don't include ground into the possible drop areas though otherwise since it\n * will used for every gap in the layout, e.g. splitters\n */\n const groundItem = this._groundItem;\n if (groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMCIAR44365');\n }\n else {\n if (allContentItems.length === 1) {\n // No root ContentItem (just Ground ContentItem)\n const groundArea = groundItem.getElementArea();\n if (groundArea === null) {\n throw new UnexpectedNullError('LMCIARA44365');\n }\n else {\n this._itemAreas = [groundArea];\n }\n return;\n }\n else {\n if (groundItem.contentItems[0].isStack) {\n // if root is Stack, then split stack and sides of Layout are same, so skip sides\n this._itemAreas = [];\n }\n else {\n // sides of layout\n this._itemAreas = groundItem.createSideAreas();\n }\n for (let i = 0; i < allContentItems.length; i++) {\n const stack = allContentItems[i];\n if (ContentItem.isStack(stack)) {\n const area = stack.getArea();\n if (area === null) {\n continue;\n }\n else {\n this._itemAreas.push(area);\n const stackContentAreaDimensions = stack.contentAreaDimensions;\n if (stackContentAreaDimensions === undefined) {\n throw new UnexpectedUndefinedError('LMCIASC45599');\n }\n else {\n const highlightArea = stackContentAreaDimensions.header.highlightArea;\n const surface = (highlightArea.x2 - highlightArea.x1) * (highlightArea.y2 - highlightArea.y1);\n const header = {\n x1: highlightArea.x1,\n x2: highlightArea.x2,\n y1: highlightArea.y1,\n y2: highlightArea.y2,\n contentItem: stack,\n surface,\n };\n this._itemAreas.push(header);\n }\n }\n }\n }\n }\n }\n }\n /**\n * Called as part of loading a new layout (including initial init()).\n * Checks to see layout has a maximised item. If so, it maximises that item.\n * @internal\n */\n checkLoadedLayoutMaximiseItem() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMCLLMI43432');\n }\n else {\n const configMaximisedItems = this._groundItem.getConfigMaximisedItems();\n if (configMaximisedItems.length > 0) {\n let item = configMaximisedItems[0];\n if (ContentItem.isComponentItem(item)) {\n const stack = item.parent;\n if (stack === null) {\n throw new UnexpectedNullError('LMXLLMI69999');\n }\n else {\n item = stack;\n }\n }\n if (!ContentItem.isStack(item)) {\n throw new AssertError('LMCLLMI19993');\n }\n else {\n item.maximise();\n }\n }\n }\n }\n /** @internal */\n processMaximiseStack(stack) {\n this._maximisedStack = stack;\n stack.on('beforeItemDestroyed', this._maximisedStackBeforeDestroyedListener);\n stack.element.classList.add(\"lm_maximised\" /* Maximised */);\n stack.element.insertAdjacentElement('afterend', this._maximisePlaceholder);\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMMXI19993');\n }\n else {\n this._groundItem.element.prepend(stack.element);\n const { width, height } = getElementWidthAndHeight(this._containerElement);\n setElementWidth(stack.element, width);\n setElementHeight(stack.element, height);\n stack.updateSize(true);\n stack.focusActiveContentItem();\n this._maximisedStack.emit('maximised');\n this.emit('stateChanged');\n }\n }\n /** @internal */\n processMinimiseMaximisedStack() {\n if (this._maximisedStack === undefined) {\n throw new AssertError('LMMMS74422');\n }\n else {\n const stack = this._maximisedStack;\n if (stack.parent === null) {\n throw new UnexpectedNullError('LMMI13668');\n }\n else {\n stack.element.classList.remove(\"lm_maximised\" /* Maximised */);\n this._maximisePlaceholder.insertAdjacentElement('afterend', stack.element);\n this._maximisePlaceholder.remove();\n this.updateRootSize(true);\n this._maximisedStack = undefined;\n stack.off('beforeItemDestroyed', this._maximisedStackBeforeDestroyedListener);\n stack.emit('minimised');\n this.emit('stateChanged');\n }\n }\n }\n /**\n * Iterates through the array of open popout windows and removes the ones\n * that are effectively closed. This is necessary due to the lack of reliably\n * listening for window.close / unload events in a cross browser compatible fashion.\n * @internal\n */\n reconcilePopoutWindows() {\n const openPopouts = [];\n for (let i = 0; i < this._openPopouts.length; i++) {\n if (this._openPopouts[i].getWindow().closed === false) {\n openPopouts.push(this._openPopouts[i]);\n }\n else {\n this.emit('windowClosed', this._openPopouts[i]);\n }\n }\n if (this._openPopouts.length !== openPopouts.length) {\n this._openPopouts = openPopouts;\n this.emit('stateChanged');\n }\n }\n /**\n * Returns a flattened array of all content items,\n * regardles of level or type\n * @internal\n */\n getAllContentItems() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMGACI13130');\n }\n else {\n return this._groundItem.getAllContentItems();\n }\n }\n /**\n * Creates Subwindows (if there are any). Throws an error\n * if popouts are blocked.\n * @internal\n */\n createSubWindows() {\n for (let i = 0; i < this.layoutConfig.openPopouts.length; i++) {\n const popoutConfig = this.layoutConfig.openPopouts[i];\n this.createPopoutFromPopoutLayoutConfig(popoutConfig);\n }\n }\n /**\n * Debounces resize events\n * @internal\n */\n handleContainerResize() {\n if (this.resizeWithContainerAutomatically) {\n this.processResizeWithDebounce();\n }\n }\n /**\n * Debounces resize events\n * @internal\n */\n processResizeWithDebounce() {\n if (this.resizeDebounceExtendedWhenPossible) {\n this.checkClearResizeTimeout();\n }\n if (this._resizeTimeoutId === undefined) {\n this._resizeTimeoutId = setTimeout(() => {\n this._resizeTimeoutId = undefined;\n this.beginSizeInvalidation();\n this.endSizeInvalidation();\n }, this.resizeDebounceInterval);\n }\n }\n checkClearResizeTimeout() {\n if (this._resizeTimeoutId !== undefined) {\n clearTimeout(this._resizeTimeoutId);\n this._resizeTimeoutId = undefined;\n }\n }\n /**\n * Determines what element the layout will be created in\n * @internal\n */\n setContainer() {\n var _a;\n const bodyElement = document.body;\n const containerElement = (_a = this._containerElement) !== null && _a !== void 0 ? _a : bodyElement;\n if (containerElement === bodyElement) {\n this.resizeWithContainerAutomatically = true;\n const documentElement = document.documentElement;\n documentElement.style.height = '100%';\n documentElement.style.margin = '0';\n documentElement.style.padding = '0';\n documentElement.style.overflow = 'clip';\n bodyElement.style.height = '100%';\n bodyElement.style.margin = '0';\n bodyElement.style.padding = '0';\n bodyElement.style.overflow = 'clip';\n }\n this._containerElement = containerElement;\n }\n /**\n * Called when the window is closed or the user navigates away\n * from the page\n * @internal\n * @deprecated to be removed in version 3\n */\n onBeforeUnload() {\n this.destroy();\n }\n /**\n * Adjusts the number of columns to be lower to fit the screen and still maintain minItemWidth.\n * @internal\n */\n adjustColumnsResponsive() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMACR20883');\n }\n else {\n this._firstLoad = false;\n // If there is no min width set, or not content items, do nothing.\n if (this.useResponsiveLayout() &&\n !this._updatingColumnsResponsive &&\n this._groundItem.contentItems.length > 0 &&\n this._groundItem.contentItems[0].isRow) {\n if (this._groundItem === undefined || this._width === null) {\n throw new UnexpectedUndefinedError('LMACR77412');\n }\n else {\n // If there is only one column, do nothing.\n const columnCount = this._groundItem.contentItems[0].contentItems.length;\n if (columnCount <= 1) {\n return;\n }\n else {\n // If they all still fit, do nothing.\n const minItemWidth = this.layoutConfig.dimensions.defaultMinItemWidth;\n const totalMinWidth = columnCount * minItemWidth;\n if (totalMinWidth <= this._width) {\n return;\n }\n else {\n // Prevent updates while it is already happening.\n this._updatingColumnsResponsive = true;\n // Figure out how many columns to stack, and put them all in the first stack container.\n const finalColumnCount = Math.max(Math.floor(this._width / minItemWidth), 1);\n const stackColumnCount = columnCount - finalColumnCount;\n const rootContentItem = this._groundItem.contentItems[0];\n const allStacks = this.getAllStacks();\n if (allStacks.length === 0) {\n throw new AssertError('LMACRS77413');\n }\n else {\n const firstStackContainer = allStacks[0];\n for (let i = 0; i < stackColumnCount; i++) {\n // Stack from right.\n const column = rootContentItem.contentItems[rootContentItem.contentItems.length - 1];\n this.addChildContentItemsToContainer(firstStackContainer, column);\n }\n this._updatingColumnsResponsive = false;\n }\n }\n }\n }\n }\n }\n }\n /**\n * Determines if responsive layout should be used.\n *\n * @returns True if responsive layout should be used; otherwise false.\n * @internal\n */\n useResponsiveLayout() {\n const settings = this.layoutConfig.settings;\n const alwaysResponsiveMode = settings.responsiveMode === ResponsiveMode.always;\n const onLoadResponsiveModeAndFirst = settings.responsiveMode === ResponsiveMode.onload && this._firstLoad;\n return alwaysResponsiveMode || onLoadResponsiveModeAndFirst;\n }\n /**\n * Adds all children of a node to another container recursively.\n * @param container - Container to add child content items to.\n * @param node - Node to search for content items.\n * @internal\n */\n addChildContentItemsToContainer(container, node) {\n const contentItems = node.contentItems;\n if (node instanceof Stack) {\n for (let i = 0; i < contentItems.length; i++) {\n const item = contentItems[i];\n node.removeChild(item, true);\n container.addChild(item);\n }\n }\n else {\n for (let i = 0; i < contentItems.length; i++) {\n const item = contentItems[i];\n this.addChildContentItemsToContainer(container, item);\n }\n }\n }\n /**\n * Finds all the stacks.\n * @returns The found stack containers.\n * @internal\n */\n getAllStacks() {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFASC52778');\n }\n else {\n const stacks = [];\n this.findAllStacksRecursive(stacks, this._groundItem);\n return stacks;\n }\n }\n /** @internal */\n findFirstContentItemType(type) {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFFCIT82446');\n }\n else {\n return this.findFirstContentItemTypeRecursive(type, this._groundItem);\n }\n }\n /** @internal */\n findFirstContentItemTypeRecursive(type, node) {\n const contentItems = node.contentItems;\n const contentItemCount = contentItems.length;\n if (contentItemCount === 0) {\n return undefined;\n }\n else {\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem.type === type) {\n return contentItem;\n }\n }\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n const foundContentItem = this.findFirstContentItemTypeRecursive(type, contentItem);\n if (foundContentItem !== undefined) {\n return foundContentItem;\n }\n }\n return undefined;\n }\n }\n /** @internal */\n findFirstContentItemTypeByIdRecursive(type, id, node) {\n const contentItems = node.contentItems;\n const contentItemCount = contentItems.length;\n if (contentItemCount === 0) {\n return undefined;\n }\n else {\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n if (contentItem.type === type && contentItem.id === id) {\n return contentItem;\n }\n }\n for (let i = 0; i < contentItemCount; i++) {\n const contentItem = contentItems[i];\n const foundContentItem = this.findFirstContentItemTypeByIdRecursive(type, id, contentItem);\n if (foundContentItem !== undefined) {\n return foundContentItem;\n }\n }\n return undefined;\n }\n }\n /**\n * Finds all the stack containers.\n *\n * @param stacks - Set of containers to populate.\n * @param node - Current node to process.\n * @internal\n */\n findAllStacksRecursive(stacks, node) {\n const contentItems = node.contentItems;\n for (let i = 0; i < contentItems.length; i++) {\n const item = contentItems[i];\n if (item instanceof Stack) {\n stacks.push(item);\n }\n else {\n if (!item.isComponent) {\n this.findAllStacksRecursive(stacks, item);\n }\n }\n }\n }\n /** @internal */\n findFirstLocation(selectors) {\n const count = selectors.length;\n for (let i = 0; i < count; i++) {\n const selector = selectors[i];\n const location = this.findLocation(selector);\n if (location !== undefined) {\n return location;\n }\n }\n return undefined;\n }\n /** @internal */\n findLocation(selector) {\n const selectorIndex = selector.index;\n switch (selector.typeId) {\n case 0 /* FocusedItem */: {\n if (this._focusedComponentItem === undefined) {\n return undefined;\n }\n else {\n const parentItem = this._focusedComponentItem.parentItem;\n const parentContentItems = parentItem.contentItems;\n const parentContentItemCount = parentContentItems.length;\n if (selectorIndex === undefined) {\n return { parentItem, index: parentContentItemCount };\n }\n else {\n const focusedIndex = parentContentItems.indexOf(this._focusedComponentItem);\n const index = focusedIndex + selectorIndex;\n if (index < 0 || index > parentContentItemCount) {\n return undefined;\n }\n else {\n return { parentItem, index };\n }\n }\n }\n }\n case 1 /* FocusedStack */: {\n if (this._focusedComponentItem === undefined) {\n return undefined;\n }\n else {\n const parentItem = this._focusedComponentItem.parentItem;\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case 2 /* FirstStack */: {\n const parentItem = this.findFirstContentItemType(ItemType.stack);\n if (parentItem === undefined) {\n return undefined;\n }\n else {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case 3 /* FirstRowOrColumn */: {\n let parentItem = this.findFirstContentItemType(ItemType.row);\n if (parentItem !== undefined) {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n else {\n parentItem = this.findFirstContentItemType(ItemType.column);\n if (parentItem !== undefined) {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n else {\n return undefined;\n }\n }\n }\n case 4 /* FirstRow */: {\n const parentItem = this.findFirstContentItemType(ItemType.row);\n if (parentItem === undefined) {\n return undefined;\n }\n else {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case 5 /* FirstColumn */: {\n const parentItem = this.findFirstContentItemType(ItemType.column);\n if (parentItem === undefined) {\n return undefined;\n }\n else {\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n case 6 /* Empty */: {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFLRIF18244');\n }\n else {\n if (this.rootItem !== undefined) {\n return undefined;\n }\n else {\n if (selectorIndex === undefined || selectorIndex === 0)\n return { parentItem: this._groundItem, index: 0 };\n else {\n return undefined;\n }\n }\n }\n }\n case 7 /* Root */: {\n if (this._groundItem === undefined) {\n throw new UnexpectedUndefinedError('LMFLF18244');\n }\n else {\n const groundContentItems = this._groundItem.contentItems;\n if (groundContentItems.length === 0) {\n if (selectorIndex === undefined || selectorIndex === 0)\n return { parentItem: this._groundItem, index: 0 };\n else {\n return undefined;\n }\n }\n else {\n const parentItem = groundContentItems[0];\n return this.tryCreateLocationFromParentItem(parentItem, selectorIndex);\n }\n }\n }\n }\n }\n /** @internal */\n tryCreateLocationFromParentItem(parentItem, selectorIndex) {\n const parentContentItems = parentItem.contentItems;\n const parentContentItemCount = parentContentItems.length;\n if (selectorIndex === undefined) {\n return { parentItem, index: parentContentItemCount };\n }\n else {\n if (selectorIndex < 0 || selectorIndex > parentContentItemCount) {\n return undefined;\n }\n else {\n return { parentItem, index: selectorIndex };\n }\n }\n }\n}\n/** @public */\n(function (LayoutManager) {\n /** @internal */\n function createMaximisePlaceElement(document) {\n const element = document.createElement('div');\n element.classList.add(\"lm_maximise_place\" /* MaximisePlace */);\n return element;\n }\n LayoutManager.createMaximisePlaceElement = createMaximisePlaceElement;\n /** @internal */\n function createTabDropPlaceholderElement(document) {\n const element = document.createElement('div');\n element.classList.add(\"lm_drop_tab_placeholder\" /* DropTabPlaceholder */);\n return element;\n }\n LayoutManager.createTabDropPlaceholderElement = createTabDropPlaceholderElement;\n /**\n * Default LocationSelectors array used if none is specified. Will always find a location.\n * @public\n */\n LayoutManager.defaultLocationSelectors = [\n { typeId: 1 /* FocusedStack */, index: undefined },\n { typeId: 2 /* FirstStack */, index: undefined },\n { typeId: 3 /* FirstRowOrColumn */, index: undefined },\n { typeId: 7 /* Root */, index: undefined },\n ];\n /**\n * LocationSelectors to try to get location next to existing focused item\n * @public\n */\n LayoutManager.afterFocusedItemIfPossibleLocationSelectors = [\n { typeId: 0 /* FocusedItem */, index: 1 },\n { typeId: 2 /* FirstStack */, index: undefined },\n { typeId: 3 /* FirstRowOrColumn */, index: undefined },\n { typeId: 7 /* Root */, index: undefined },\n ];\n})(LayoutManager || (LayoutManager = {}));\n//# sourceMappingURL=layout-manager.js.map","/**\n * Minifies and unminifies configs by replacing frequent keys\n * and values with one letter substitutes. Config options must\n * retain array position/index, add new options at the end.\n * @internal\n*/\nexport var ConfigMinifier;\n(function (ConfigMinifier) {\n const keys = [\n 'settings',\n 'hasHeaders',\n 'constrainDragToContainer',\n 'selectionEnabled',\n 'dimensions',\n 'borderWidth',\n 'minItemHeight',\n 'minItemWidth',\n 'headerHeight',\n 'dragProxyWidth',\n 'dragProxyHeight',\n 'labels',\n 'close',\n 'maximise',\n 'minimise',\n 'popout',\n 'content',\n 'componentType',\n 'componentState',\n 'id',\n 'width',\n 'type',\n 'height',\n 'isClosable',\n 'title',\n 'popoutWholeStack',\n 'openPopouts',\n 'parentId',\n 'activeItemIndex',\n 'reorderEnabled',\n 'borderGrabWidth',\n //Maximum 36 entries, do not cross this line!\n ];\n const values = [\n true,\n false,\n 'row',\n 'column',\n 'stack',\n 'component',\n 'close',\n 'maximise',\n 'minimise',\n 'open in new window'\n ];\n function checkInitialise() {\n if (keys.length > 36) {\n throw new Error('Too many keys in config minifier map');\n }\n }\n ConfigMinifier.checkInitialise = checkInitialise;\n function translateObject(from, minify) {\n const to = {};\n for (const key in from) {\n if (from.hasOwnProperty(key)) { // In case something has extended Object prototypes\n let translatedKey;\n if (minify) {\n translatedKey = minifyKey(key);\n }\n else {\n translatedKey = unminifyKey(key);\n }\n const fromValue = from[key];\n to[translatedKey] = translateValue(fromValue, minify);\n }\n }\n return to;\n }\n ConfigMinifier.translateObject = translateObject;\n function translateArray(from, minify) {\n const length = from.length;\n const to = new Array(length);\n for (let i = 0; i < length; i++) {\n // In original code, array indices were numbers and not translated\n const fromValue = from[i];\n to[i] = translateValue(fromValue, minify);\n }\n return to;\n }\n function translateValue(from, minify) {\n if (typeof from === 'object') {\n if (from === null) {\n return null;\n }\n else {\n if (Array.isArray(from)) {\n return translateArray(from, minify);\n }\n else {\n return translateObject(from, minify);\n }\n }\n }\n else {\n if (minify) {\n return minifyValue(from);\n }\n else {\n return unminifyValue(from);\n }\n }\n }\n function minifyKey(value) {\n /**\n * If a value actually is a single character, prefix it\n * with ___ to avoid mistaking it for a minification code\n */\n if (typeof value === 'string' && value.length === 1) {\n return '___' + value;\n }\n const index = indexOfKey(value);\n /**\n * value not found in the dictionary, return it unmodified\n */\n if (index === -1) {\n return value;\n /**\n * value found in dictionary, return its base36 counterpart\n */\n }\n else {\n return index.toString(36);\n }\n }\n function unminifyKey(key) {\n /**\n * value is a single character. Assume that it's a translation\n * and return the original value from the dictionary\n */\n if (key.length === 1) {\n return keys[parseInt(key, 36)];\n }\n /**\n * value originally was a single character and was prefixed with ___\n * to avoid mistaking it for a translation. Remove the prefix\n * and return the original character\n */\n if (key.substr(0, 3) === '___') {\n return key[3];\n }\n /**\n * value was not minified\n */\n return key;\n }\n function minifyValue(value) {\n /**\n * If a value actually is a single character, prefix it\n * with ___ to avoid mistaking it for a minification code\n */\n if (typeof value === 'string' && value.length === 1) {\n return '___' + value;\n }\n const index = indexOfValue(value);\n /**\n * value not found in the dictionary, return it unmodified\n */\n if (index === -1) {\n return value;\n /**\n * value found in dictionary, return its base36 counterpart\n */\n }\n else {\n return index.toString(36);\n }\n }\n function unminifyValue(value) {\n /**\n * value is a single character. Assume that it's a translation\n * and return the original value from the dictionary\n */\n if (typeof value === 'string' && value.length === 1) {\n return values[parseInt(value, 36)];\n }\n /**\n * value originally was a single character and was prefixed with ___\n * to avoid mistaking it for a translation. Remove the prefix\n * and return the original character\n */\n if (typeof value === 'string' && value.substr(0, 3) === '___') {\n return value[3];\n }\n /**\n * value was not minified\n */\n return value;\n }\n function indexOfKey(key) {\n for (let i = 0; i < keys.length; i++) {\n if (keys[i] === key) {\n return i;\n }\n }\n return -1;\n }\n function indexOfValue(value) {\n for (let i = 0; i < values.length; i++) {\n if (values[i] === value) {\n return i;\n }\n }\n return -1;\n }\n})(ConfigMinifier || (ConfigMinifier = {}));\n//# sourceMappingURL=config-minifier.js.map","import { EventEmitter } from './event-emitter';\n/** @internal */\nexport class DragListener extends EventEmitter {\n constructor(_eElement, extraAllowableChildTargets) {\n super();\n this._eElement = _eElement;\n this._pointerTracking = false;\n this._pointerDownEventListener = (ev) => this.onPointerDown(ev);\n this._pointerMoveEventListener = (ev) => this.onPointerMove(ev);\n this._pointerUpEventListener = (ev) => this.onPointerUp(ev);\n this._timeout = undefined;\n this._allowableTargets = [_eElement, ...extraAllowableChildTargets];\n this._oDocument = document;\n this._eBody = document.body;\n /**\n * The delay after which to start the drag in milliseconds\n * Do NOT make too short (previous value of 200 was not long enough for my touchpad)\n * Should generally rely on the mouse move to start drag. Not this delay.\n */\n this._nDelay = 1800;\n /**\n * The distance the mouse needs to be moved to qualify as a drag\n * Previous comment: works better with delay only\n * ???\n * Probably somehow needs tuning for different devices\n */\n this._nDistance = 10;\n this._nX = 0;\n this._nY = 0;\n this._nOriginalX = 0;\n this._nOriginalY = 0;\n this._dragging = false;\n this._eElement.addEventListener('pointerdown', this._pointerDownEventListener, { passive: true });\n }\n destroy() {\n this.checkRemovePointerTrackingEventListeners();\n this._eElement.removeEventListener('pointerdown', this._pointerDownEventListener);\n }\n cancelDrag() {\n this.processDragStop(undefined);\n }\n onPointerDown(oEvent) {\n if (this._allowableTargets.includes(oEvent.target) && oEvent.isPrimary) {\n const coordinates = this.getPointerCoordinates(oEvent);\n this.processPointerDown(coordinates);\n }\n }\n processPointerDown(coordinates) {\n this._nOriginalX = coordinates.x;\n this._nOriginalY = coordinates.y;\n this._oDocument.addEventListener('pointermove', this._pointerMoveEventListener);\n this._oDocument.addEventListener('pointerup', this._pointerUpEventListener, { passive: true });\n this._pointerTracking = true;\n this._timeout = setTimeout(() => {\n try {\n this.startDrag();\n }\n catch (err) {\n console.error(err);\n throw err;\n }\n }, this._nDelay);\n }\n onPointerMove(oEvent) {\n if (this._pointerTracking) {\n this.processDragMove(oEvent);\n oEvent.preventDefault();\n }\n }\n processDragMove(dragEvent) {\n this._nX = dragEvent.pageX - this._nOriginalX;\n this._nY = dragEvent.pageY - this._nOriginalY;\n if (this._dragging === false) {\n if (Math.abs(this._nX) > this._nDistance ||\n Math.abs(this._nY) > this._nDistance) {\n this.startDrag();\n }\n }\n if (this._dragging) {\n this.emit('drag', this._nX, this._nY, dragEvent);\n }\n }\n onPointerUp(oEvent) {\n this.processDragStop(oEvent);\n }\n processDragStop(dragEvent) {\n var _a;\n if (this._timeout !== undefined) {\n clearTimeout(this._timeout);\n this._timeout = undefined;\n }\n this.checkRemovePointerTrackingEventListeners();\n if (this._dragging === true) {\n this._eBody.classList.remove(\"lm_dragging\" /* Dragging */);\n this._eElement.classList.remove(\"lm_dragging\" /* Dragging */);\n (_a = this._oDocument.querySelector('iframe')) === null || _a === void 0 ? void 0 : _a.style.setProperty('pointer-events', '');\n this._dragging = false;\n this.emit('dragStop', dragEvent);\n }\n }\n checkRemovePointerTrackingEventListeners() {\n if (this._pointerTracking) {\n this._oDocument.removeEventListener('pointermove', this._pointerMoveEventListener);\n this._oDocument.removeEventListener('pointerup', this._pointerUpEventListener);\n this._pointerTracking = false;\n }\n }\n startDrag() {\n var _a;\n if (this._timeout !== undefined) {\n clearTimeout(this._timeout);\n this._timeout = undefined;\n }\n this._dragging = true;\n this._eBody.classList.add(\"lm_dragging\" /* Dragging */);\n this._eElement.classList.add(\"lm_dragging\" /* Dragging */);\n (_a = this._oDocument.querySelector('iframe')) === null || _a === void 0 ? void 0 : _a.style.setProperty('pointer-events', 'none');\n this.emit('dragStart', this._nOriginalX, this._nOriginalY);\n }\n getPointerCoordinates(event) {\n const result = {\n x: event.pageX,\n y: event.pageY\n };\n return result;\n }\n}\n//# sourceMappingURL=drag-listener.js.map","/**\n * A generic and very fast EventEmitter implementation. On top of emitting the actual event it emits an\n * {@link (EventEmitter:namespace).ALL_EVENT} event for every event triggered. This allows to hook into it and proxy events forwards\n * @public\n */\nexport class EventEmitter {\n constructor() {\n /** @internal */\n this._allEventSubscriptions = [];\n /** @internal */\n this._subscriptionsMap = new Map();\n /**\n * Alias for off\n */\n this.unbind = this.removeEventListener;\n /**\n * Alias for emit\n */\n this.trigger = this.emit;\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n tryBubbleEvent(name, args) {\n // overridden by ContentItem\n }\n /**\n * Emit an event and notify listeners\n *\n * @param eventName - The name of the event\n * @param args - Additional arguments that will be passed to the listener\n */\n emit(eventName, ...args) {\n let subcriptions = this._subscriptionsMap.get(eventName);\n if (subcriptions !== undefined) {\n subcriptions = subcriptions.slice();\n for (let i = 0; i < subcriptions.length; i++) {\n const subscription = subcriptions[i];\n subscription(...args);\n }\n }\n this.emitAllEvent(eventName, args);\n this.tryBubbleEvent(eventName, args);\n }\n /** @internal */\n emitUnknown(eventName, ...args) {\n let subs = this._subscriptionsMap.get(eventName);\n if (subs !== undefined) {\n subs = subs.slice();\n for (let i = 0; i < subs.length; i++) {\n subs[i](...args);\n }\n }\n this.emitAllEvent(eventName, args);\n this.tryBubbleEvent(eventName, args);\n }\n /* @internal **/\n emitBaseBubblingEvent(eventName) {\n const event = new EventEmitter.BubblingEvent(eventName, this);\n this.emitUnknown(eventName, event);\n }\n /** @internal */\n emitUnknownBubblingEvent(eventName) {\n const event = new EventEmitter.BubblingEvent(eventName, this);\n this.emitUnknown(eventName, event);\n }\n /**\n * Removes a listener for an event.\n * @param eventName - The name of the event\n * @param callback - The previously registered callback method (optional)\n */\n removeEventListener(eventName, callback) {\n const unknownCallback = callback;\n this.removeUnknownEventListener(eventName, unknownCallback);\n }\n off(eventName, callback) {\n this.removeEventListener(eventName, callback);\n }\n /**\n * Listen for events\n *\n * @param eventName - The name of the event to listen to\n * @param callback - The callback to execute when the event occurs\n */\n addEventListener(eventName, callback) {\n const unknownCallback = callback;\n this.addUnknownEventListener(eventName, unknownCallback);\n }\n on(eventName, callback) {\n this.addEventListener(eventName, callback);\n }\n /** @internal */\n addUnknownEventListener(eventName, callback) {\n if (eventName === EventEmitter.ALL_EVENT) {\n this._allEventSubscriptions.push(callback);\n }\n else {\n let subscriptions = this._subscriptionsMap.get(eventName);\n if (subscriptions !== undefined) {\n subscriptions.push(callback);\n }\n else {\n subscriptions = [callback];\n this._subscriptionsMap.set(eventName, subscriptions);\n }\n }\n }\n /** @internal */\n removeUnknownEventListener(eventName, callback) {\n if (eventName === EventEmitter.ALL_EVENT) {\n this.removeSubscription(eventName, this._allEventSubscriptions, callback);\n }\n else {\n const subscriptions = this._subscriptionsMap.get(eventName);\n if (subscriptions === undefined) {\n throw new Error('No subscribtions to unsubscribe for event ' + eventName);\n }\n else {\n this.removeSubscription(eventName, subscriptions, callback);\n }\n }\n }\n /** @internal */\n removeSubscription(eventName, subscriptions, callback) {\n const idx = subscriptions.indexOf(callback);\n if (idx < 0) {\n throw new Error('Nothing to unbind for ' + eventName);\n }\n else {\n subscriptions.splice(idx, 1);\n }\n }\n /** @internal */\n emitAllEvent(eventName, args) {\n const allEventSubscriptionsCount = this._allEventSubscriptions.length;\n if (allEventSubscriptionsCount > 0) {\n const unknownArgs = args.slice();\n unknownArgs.unshift(eventName);\n const allEventSubcriptions = this._allEventSubscriptions.slice();\n for (let i = 0; i < allEventSubscriptionsCount; i++) {\n allEventSubcriptions[i](...unknownArgs);\n }\n }\n }\n}\n/** @public */\n(function (EventEmitter) {\n /**\n * The name of the event that's triggered for every event\n */\n EventEmitter.ALL_EVENT = '__all';\n EventEmitter.headerClickEventName = 'stackHeaderClick';\n EventEmitter.headerTouchStartEventName = 'stackHeaderTouchStart';\n class BubblingEvent {\n /** @internal */\n constructor(\n /** @internal */\n _name, \n /** @internal */\n _target) {\n this._name = _name;\n this._target = _target;\n /** @internal */\n this._isPropagationStopped = false;\n }\n get name() { return this._name; }\n get target() { return this._target; }\n /** @deprecated Use {@link (EventEmitter:namespace).(BubblingEvent:class).target} instead */\n get origin() { return this._target; }\n get isPropagationStopped() { return this._isPropagationStopped; }\n stopPropagation() {\n this._isPropagationStopped = true;\n }\n }\n EventEmitter.BubblingEvent = BubblingEvent;\n class ClickBubblingEvent extends BubblingEvent {\n /** @internal */\n constructor(name, target, \n /** @internal */\n _mouseEvent) {\n super(name, target);\n this._mouseEvent = _mouseEvent;\n }\n get mouseEvent() { return this._mouseEvent; }\n }\n EventEmitter.ClickBubblingEvent = ClickBubblingEvent;\n class TouchStartBubblingEvent extends BubblingEvent {\n /** @internal */\n constructor(name, target, \n /** @internal */\n _touchEvent) {\n super(name, target);\n this._touchEvent = _touchEvent;\n }\n get touchEvent() { return this._touchEvent; }\n }\n EventEmitter.TouchStartBubblingEvent = TouchStartBubblingEvent;\n})(EventEmitter || (EventEmitter = {}));\n//# sourceMappingURL=event-emitter.js.map","import { UnexpectedNullError } from '../errors/internal-error';\nimport { EventEmitter } from './event-emitter';\n/**\n * An EventEmitter singleton that propagates events\n * across multiple windows. This is a little bit trickier since\n * windows are allowed to open childWindows in their own right.\n *\n * This means that we deal with a tree of windows. Therefore, we do the event propagation in two phases:\n *\n * - Propagate events from this layout to the parent layout\n * - Repeat until the event arrived at the root layout\n * - Propagate events to this layout and to all children\n * - Repeat until all layouts got the event\n *\n * **WARNING**: Only userBroadcast events are propagated between windows.\n * This means the you have to take care of propagating state changes between windows yourself.\n *\n * @public\n */\nexport class EventHub extends EventEmitter {\n /**\n * Creates a new EventHub instance\n * @param _layoutManager - the layout manager to synchronize between the windows\n * @internal\n */\n constructor(\n /** @internal */\n _layoutManager) {\n super();\n this._layoutManager = _layoutManager;\n /** @internal */\n this._childEventListener = (childEvent) => this.onEventFromChild(childEvent);\n globalThis.addEventListener(EventHub.ChildEventName, this._childEventListener, { passive: true });\n }\n /**\n * Emit an event and notify listeners\n *\n * @param eventName - The name of the event\n * @param args - Additional arguments that will be passed to the listener\n * @public\n */\n emit(eventName, ...args) {\n if (eventName === 'userBroadcast') {\n // Explicitly redirect the user broadcast to our overridden method.\n this.emitUserBroadcast(...args);\n }\n else {\n super.emit(eventName, ...args);\n }\n }\n /**\n * Broadcasts a message to all other currently opened windows.\n * @public\n */\n emitUserBroadcast(...args) {\n // Step 1: Bubble up the event\n this.handleUserBroadcastEvent('userBroadcast', args);\n }\n /**\n * Destroys the EventHub\n * @internal\n */\n destroy() {\n globalThis.removeEventListener(EventHub.ChildEventName, this._childEventListener);\n }\n /**\n * Internal processor to process local events.\n * @internal\n */\n handleUserBroadcastEvent(eventName, args) {\n if (this._layoutManager.isSubWindow) {\n // We are a sub window and received an event from one of our children.\n // So propagate it to the Root.\n this.propagateToParent(eventName, args);\n }\n else {\n // We are the root window, propagate it to the subtree below us.\n this.propagateToThisAndSubtree(eventName, args);\n }\n }\n /**\n * Callback for child events raised on the window\n * @internal\n */\n onEventFromChild(event) {\n const detail = event.detail;\n this.handleUserBroadcastEvent(detail.eventName, detail.args);\n }\n /**\n * Propagates the event to the parent by emitting\n * it on the parent's DOM window\n * @internal\n */\n propagateToParent(eventName, args) {\n const detail = {\n layoutManager: this._layoutManager,\n eventName,\n args: args,\n };\n const eventInit = {\n bubbles: true,\n cancelable: true,\n detail,\n };\n const event = new CustomEvent(EventHub.ChildEventName, eventInit);\n const opener = globalThis.opener;\n if (opener === null) {\n throw new UnexpectedNullError('EHPTP15778');\n }\n opener.dispatchEvent(event);\n }\n /**\n * Propagate events to the whole subtree under this event hub.\n * @internal\n */\n propagateToThisAndSubtree(eventName, args) {\n this.emitUnknown(eventName, ...args);\n for (let i = 0; i < this._layoutManager.openPopouts.length; i++) {\n const childGl = this._layoutManager.openPopouts[i].getGlInstance();\n if (childGl) {\n childGl.eventHub.propagateToThisAndSubtree(eventName, args);\n }\n }\n }\n}\n/** @public */\n(function (EventHub) {\n /** @internal */\n EventHub.ChildEventName = 'gl_child_event';\n})(EventHub || (EventHub = {}));\n//# sourceMappingURL=event-hub.js.map","import { AssertError } from '../errors/internal-error';\n/** @public */\nexport var I18nStrings;\n(function (I18nStrings) {\n /** @internal */\n let initialised = false;\n /** @internal */\n const infosObject = {\n PopoutCannotBeCreatedWithGroundItemConfig: {\n id: 0 /* PopoutCannotBeCreatedWithGroundItemConfig */,\n default: 'Popout cannot be created with ground ItemConfig'\n },\n PleaseRegisterAConstructorFunction: {\n id: 1 /* PleaseRegisterAConstructorFunction */,\n default: 'Please register a constructor function'\n },\n ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned: {\n id: 2 /* ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned */,\n default: 'Component type not registered and BindComponentEvent handler not assigned',\n },\n ComponentIsAlreadyRegistered: {\n id: 3 /* ComponentIsAlreadyRegistered */,\n default: 'Component is already registered',\n },\n ComponentIsNotVirtuable: {\n id: 4 /* ComponentIsNotVirtuable */,\n default: 'Component is not virtuable. Requires rootHtmlElement field/getter',\n },\n VirtualComponentDoesNotHaveRootHtmlElement: {\n id: 5 /* VirtualComponentDoesNotHaveRootHtmlElement */,\n default: 'Virtual component does not have getter \"rootHtmlElement\"',\n },\n ItemConfigIsNotTypeComponent: {\n id: 6 /* ItemConfigIsNotTypeComponent */,\n default: 'ItemConfig is not of type component',\n },\n InvalidNumberPartInSizeString: {\n id: 7 /* InvalidNumberPartInSizeString */,\n default: 'Invalid number part in size string',\n },\n UnknownUnitInSizeString: {\n id: 8 /* UnknownUnitInSizeString */,\n default: 'Unknown unit in size string',\n },\n UnsupportedUnitInSizeString: {\n id: 9 /* UnsupportedUnitInSizeString */,\n default: 'Unsupported unit in size string',\n },\n };\n I18nStrings.idCount = Object.keys(infosObject).length;\n /** @internal */\n const infos = Object.values(infosObject);\n function checkInitialise() {\n if (!initialised) {\n for (let i = 0; i < I18nStrings.idCount; i++) {\n const info = infos[i];\n if (info.id !== i) {\n throw new AssertError('INSI00110', `${i}: ${info.id}`);\n }\n else {\n i18nStrings[i] = info.default;\n }\n }\n }\n initialised = true;\n }\n I18nStrings.checkInitialise = checkInitialise;\n})(I18nStrings || (I18nStrings = {}));\n/** @public */\nexport const i18nStrings = new Array(I18nStrings.idCount);\n//# sourceMappingURL=i18n-strings.js.map","/** @public */\nexport var StyleConstants;\n(function (StyleConstants) {\n StyleConstants.defaultComponentBaseZIndex = 'auto';\n StyleConstants.defaultComponentDragZIndex = '32';\n StyleConstants.defaultComponentStackMaximisedZIndex = '41';\n})(StyleConstants || (StyleConstants = {}));\n//# sourceMappingURL=style-constants.js.map","import { UnreachableCaseError } from '../errors/internal-error';\nimport { StyleConstants } from './style-constants';\n/** @internal */\nexport var WidthOrHeightPropertyName;\n(function (WidthOrHeightPropertyName) {\n WidthOrHeightPropertyName.width = 'width';\n WidthOrHeightPropertyName.height = 'height';\n})(WidthOrHeightPropertyName || (WidthOrHeightPropertyName = {}));\n/** @public */\nexport var Side;\n(function (Side) {\n Side.top = 'top';\n Side.left = 'left';\n Side.right = 'right';\n Side.bottom = 'bottom';\n})(Side || (Side = {}));\n/** @public */\nexport var LogicalZIndex;\n(function (LogicalZIndex) {\n LogicalZIndex.base = 'base';\n LogicalZIndex.drag = 'drag';\n LogicalZIndex.stackMaximised = 'stackMaximised';\n})(LogicalZIndex || (LogicalZIndex = {}));\n/** @public */\nexport const LogicalZIndexToDefaultMap = {\n base: StyleConstants.defaultComponentBaseZIndex,\n drag: StyleConstants.defaultComponentDragZIndex,\n stackMaximised: StyleConstants.defaultComponentStackMaximisedZIndex,\n};\n/** @public */\nexport var JsonValue;\n(function (JsonValue) {\n function isJson(value) {\n return isJsonObject(value);\n }\n JsonValue.isJson = isJson;\n // eslint-disable-next-line @typescript-eslint/ban-types\n function isJsonObject(value) {\n return !Array.isArray(value) && value !== null && typeof value === 'object';\n }\n JsonValue.isJsonObject = isJsonObject;\n})(JsonValue || (JsonValue = {}));\n/** @public */\nexport var ItemType;\n(function (ItemType) {\n ItemType.ground = 'ground';\n ItemType.row = 'row';\n ItemType.column = 'column';\n ItemType.stack = 'stack';\n ItemType.component = 'component';\n})(ItemType || (ItemType = {}));\n/** @public */\nexport var ResponsiveMode;\n(function (ResponsiveMode) {\n ResponsiveMode.none = 'none';\n ResponsiveMode.always = 'always';\n ResponsiveMode.onload = 'onload';\n})(ResponsiveMode || (ResponsiveMode = {}));\n/** @public */\nexport var SizeUnitEnum;\n(function (SizeUnitEnum) {\n SizeUnitEnum[\"Pixel\"] = \"px\";\n SizeUnitEnum[\"Percent\"] = \"%\";\n SizeUnitEnum[\"Fractional\"] = \"fr\";\n SizeUnitEnum[\"Em\"] = \"em\";\n})(SizeUnitEnum || (SizeUnitEnum = {}));\n/** @public */\n(function (SizeUnitEnum) {\n function tryParse(value) {\n switch (value) {\n case SizeUnitEnum.Pixel: return SizeUnitEnum.Pixel;\n case SizeUnitEnum.Percent: return SizeUnitEnum.Percent;\n case SizeUnitEnum.Fractional: return SizeUnitEnum.Fractional;\n case SizeUnitEnum.Em: return SizeUnitEnum.Em;\n default: return undefined;\n }\n }\n SizeUnitEnum.tryParse = tryParse;\n function format(value) {\n switch (value) {\n case SizeUnitEnum.Pixel: return SizeUnitEnum.Pixel;\n case SizeUnitEnum.Percent: return SizeUnitEnum.Percent;\n case SizeUnitEnum.Fractional: return SizeUnitEnum.Fractional;\n case SizeUnitEnum.Em: return SizeUnitEnum.Em;\n default:\n throw new UnreachableCaseError('SUEF44998', value);\n }\n }\n SizeUnitEnum.format = format;\n})(SizeUnitEnum || (SizeUnitEnum = {}));\n//# sourceMappingURL=types.js.map","/** @internal */\nexport function numberToPixels(value) {\n return value.toString(10) + 'px';\n}\n/** @internal */\nexport function pixelsToNumber(value) {\n const numberStr = value.replace(\"px\", \"\");\n return parseFloat(numberStr);\n}\n/** @internal */\nexport function splitStringAtFirstNonNumericChar(value) {\n value = value.trimStart();\n const length = value.length;\n if (length === 0) {\n return { numericPart: '', firstNonNumericCharPart: '' };\n }\n else {\n let firstNonDigitPartIndex = length;\n let gotDecimalPoint = false;\n for (let i = 0; i < length; i++) {\n const char = value[i];\n if (!isDigit(char)) {\n if (char !== '.') {\n firstNonDigitPartIndex = i;\n break;\n }\n else {\n if (gotDecimalPoint) {\n firstNonDigitPartIndex = i;\n break;\n }\n else {\n gotDecimalPoint = true;\n }\n }\n }\n }\n const digitsPart = value.substring(0, firstNonDigitPartIndex);\n const firstNonDigitPart = value.substring(firstNonDigitPartIndex).trim();\n return { numericPart: digitsPart, firstNonNumericCharPart: firstNonDigitPart };\n }\n}\n/** @internal */\nexport function isDigit(char) {\n return char >= '0' && char <= '9';\n}\n/** @internal */\nexport function getElementWidth(element) {\n return element.offsetWidth;\n}\n/** @internal */\nexport function setElementWidth(element, width) {\n const widthAsPixels = numberToPixels(width);\n element.style.width = widthAsPixels;\n}\n/** @internal */\nexport function getElementHeight(element) {\n return element.offsetHeight;\n}\n/** @internal */\nexport function setElementHeight(element, height) {\n const heightAsPixels = numberToPixels(height);\n element.style.height = heightAsPixels;\n}\n/** @internal */\nexport function getElementWidthAndHeight(element) {\n return {\n width: element.offsetWidth,\n height: element.offsetHeight,\n };\n}\n/** @internal */\nexport function setElementDisplayVisibility(element, visible) {\n if (visible) {\n element.style.display = '';\n }\n else {\n element.style.display = 'none';\n }\n}\n/** @internal */\nexport function ensureElementPositionAbsolute(element) {\n const absolutePosition = 'absolute';\n if (element.style.position !== absolutePosition) {\n element.style.position = absolutePosition;\n }\n}\n/**\n * Replacement for JQuery $.extend(target, obj)\n * @internal\n*/\nexport function extend(target, obj) {\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n target[key] = obj[key];\n }\n }\n return target;\n}\n/**\n * Replacement for JQuery $.extend(true, target, obj)\n * @internal\n*/\nexport function deepExtend(target, obj) {\n if (obj !== undefined) {\n for (const key in obj) {\n if (obj.hasOwnProperty(key)) {\n const value = obj[key];\n const existingTarget = target[key];\n target[key] = deepExtendValue(existingTarget, value);\n }\n }\n }\n return target;\n}\n/** @internal */\nexport function deepExtendValue(existingTarget, value) {\n if (typeof value !== 'object') {\n return value;\n }\n else {\n if (Array.isArray(value)) {\n const length = value.length;\n const targetArray = new Array(length);\n for (let i = 0; i < length; i++) {\n const element = value[i];\n targetArray[i] = deepExtendValue({}, element);\n }\n return targetArray;\n }\n else {\n if (value === null) {\n return null;\n }\n else {\n const valueObj = value;\n if (existingTarget === undefined) {\n return deepExtend({}, valueObj); // overwrite\n }\n else {\n if (typeof existingTarget !== \"object\") {\n return deepExtend({}, valueObj); // overwrite\n }\n else {\n if (Array.isArray(existingTarget)) {\n return deepExtend({}, valueObj); // overwrite\n }\n else {\n if (existingTarget === null) {\n return deepExtend({}, valueObj); // overwrite\n }\n else {\n const existingTargetObj = existingTarget;\n return deepExtend(existingTargetObj, valueObj); // merge\n }\n }\n }\n }\n }\n }\n }\n}\n/** @internal */\nexport function removeFromArray(item, array) {\n const index = array.indexOf(item);\n if (index === -1) {\n throw new Error('Can\\'t remove item from array. Item is not in the array');\n }\n array.splice(index, 1);\n}\n/** @internal */\nexport function getUniqueId() {\n return (Math.random() * 1000000000000000)\n .toString(36)\n .replace('.', '');\n}\n/** @internal */\nexport function getErrorMessage(e) {\n if (e instanceof Error) {\n return e.message;\n }\n else {\n if (typeof e === 'string') {\n return e;\n }\n else {\n return 'Unknown Error';\n }\n }\n}\n//# sourceMappingURL=utils.js.map","import { LayoutConfig } from './config/config';\nimport { ResolvedLayoutConfig } from './config/resolved-config';\nimport { BindError } from './errors/external-error';\nimport { UnexpectedUndefinedError } from './errors/internal-error';\nimport { LayoutManager } from './layout-manager';\nimport { i18nStrings } from './utils/i18n-strings';\n/** @public */\nexport class VirtualLayout extends LayoutManager {\n /** @internal */\n constructor(configOrOptionalContainer, containerOrBindComponentEventHandler, unbindComponentEventHandler, skipInit) {\n super(VirtualLayout.createLayoutManagerConstructorParameters(configOrOptionalContainer, containerOrBindComponentEventHandler));\n /** @internal @deprecated use while constructor is not determinate */\n this._bindComponentEventHanlderPassedInConstructor = false; // remove when constructor is determinate\n /** @internal @deprecated use while constructor is not determinate */\n this._creationTimeoutPassed = false; // remove when constructor is determinate\n if (containerOrBindComponentEventHandler !== undefined) {\n if (typeof containerOrBindComponentEventHandler === 'function') {\n this.bindComponentEvent = containerOrBindComponentEventHandler;\n this._bindComponentEventHanlderPassedInConstructor = true;\n if (unbindComponentEventHandler !== undefined) {\n this.unbindComponentEvent = unbindComponentEventHandler;\n }\n }\n }\n if (!this._bindComponentEventHanlderPassedInConstructor) {\n // backward compatibility\n if (this.isSubWindow) {\n // document.body.style.visibility = 'hidden';\n // Set up layoutConfig since constructor is not determinate and may exit early. Other functions may need\n // this.layoutConfig. this.layoutConfig is again calculated in the same way when init() completes.\n // Remove this when constructor is determinate.\n if (this._constructorOrSubWindowLayoutConfig === undefined) {\n throw new UnexpectedUndefinedError('VLC98823');\n }\n else {\n const resolvedLayoutConfig = LayoutConfig.resolve(this._constructorOrSubWindowLayoutConfig);\n // remove root from layoutConfig\n this.layoutConfig = Object.assign(Object.assign({}, resolvedLayoutConfig), { root: undefined });\n }\n }\n }\n if (skipInit !== true) {\n if (!this.deprecatedConstructor) {\n this.init();\n }\n }\n }\n destroy() {\n this.bindComponentEvent = undefined;\n this.unbindComponentEvent = undefined;\n super.destroy();\n }\n /**\n * Creates the actual layout. Must be called after all initial components\n * are registered. Recurses through the configuration and sets up\n * the item tree.\n *\n * If called before the document is ready it adds itself as a listener\n * to the document.ready event\n * @deprecated LayoutConfig should not be loaded in {@link (LayoutManager:class)} constructor, but rather in a\n * {@link (LayoutManager:class).loadLayout} call. If LayoutConfig is not specified in {@link (LayoutManager:class)} constructor,\n * then init() will be automatically called internally and should not be called externally.\n */\n init() {\n /**\n * If the document isn't ready yet, wait for it.\n */\n if (!this._bindComponentEventHanlderPassedInConstructor && (document.readyState === 'loading' || document.body === null)) {\n document.addEventListener('DOMContentLoaded', () => this.init(), { passive: true });\n return;\n }\n /**\n * If this is a subwindow, wait a few milliseconds for the original\n * page's js calls to be executed, then replace the bodies content\n * with GoldenLayout\n */\n if (!this._bindComponentEventHanlderPassedInConstructor && this.isSubWindow === true && !this._creationTimeoutPassed) {\n setTimeout(() => this.init(), 7);\n this._creationTimeoutPassed = true;\n return;\n }\n if (this.isSubWindow === true) {\n if (!this._bindComponentEventHanlderPassedInConstructor) {\n this.clearHtmlAndAdjustStylesForSubWindow();\n }\n // Expose this instance on the window object to allow the opening window to interact with it\n window.__glInstance = this;\n }\n super.init();\n }\n /**\n * Clears existing HTML and adjusts style to make window suitable to be a popout sub window\n * Curently is automatically called when window is a subWindow and bindComponentEvent is not passed in the constructor\n * If bindComponentEvent is not passed in the constructor, the application must either call this function explicitly or\n * (preferably) make the window suitable as a subwindow.\n * In the future, it is planned that this function is NOT automatically called in any circumstances. Applications will\n * need to determine whether a window is a Golden Layout popout window and either call this function explicitly or\n * hide HTML not relevant to the popout.\n * See apitest for an example of how HTML is hidden when popout windows are displayed\n */\n clearHtmlAndAdjustStylesForSubWindow() {\n const headElement = document.head;\n const appendNodeLists = new Array(4);\n appendNodeLists[0] = document.querySelectorAll('body link');\n appendNodeLists[1] = document.querySelectorAll('body style');\n appendNodeLists[2] = document.querySelectorAll('template');\n appendNodeLists[3] = document.querySelectorAll('.gl_keep');\n for (let listIdx = 0; listIdx < appendNodeLists.length; listIdx++) {\n const appendNodeList = appendNodeLists[listIdx];\n for (let nodeIdx = 0; nodeIdx < appendNodeList.length; nodeIdx++) {\n const node = appendNodeList[nodeIdx];\n headElement.appendChild(node);\n }\n }\n const bodyElement = document.body;\n bodyElement.innerHTML = '';\n bodyElement.style.visibility = 'visible';\n this.checkAddDefaultPopinButton();\n /*\n * This seems a bit pointless, but actually causes a reflow/re-evaluation getting around\n * slickgrid's \"Cannot find stylesheet.\" bug in chrome\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const x = document.body.offsetHeight;\n }\n /**\n * Will add button if not popinOnClose specified in settings\n * @returns true if added otherwise false\n */\n checkAddDefaultPopinButton() {\n if (this.layoutConfig.settings.popInOnClose) {\n return false;\n }\n else {\n const popInButtonElement = document.createElement('div');\n popInButtonElement.classList.add(\"lm_popin\" /* Popin */);\n popInButtonElement.setAttribute('title', this.layoutConfig.header.dock);\n const iconElement = document.createElement('div');\n iconElement.classList.add(\"lm_icon\" /* Icon */);\n const bgElement = document.createElement('div');\n bgElement.classList.add(\"lm_bg\" /* Bg */);\n popInButtonElement.appendChild(iconElement);\n popInButtonElement.appendChild(bgElement);\n popInButtonElement.addEventListener('click', () => this.emit('popIn'));\n document.body.appendChild(popInButtonElement);\n return true;\n }\n }\n /** @internal */\n bindComponent(container, itemConfig) {\n if (this.bindComponentEvent !== undefined) {\n const bindableComponent = this.bindComponentEvent(container, itemConfig);\n return bindableComponent;\n }\n else {\n if (this.getComponentEvent !== undefined) {\n return {\n virtual: false,\n component: this.getComponentEvent(container, itemConfig),\n };\n }\n else {\n // There is no component registered for this type, and we don't have a getComponentEvent defined.\n // This might happen when the user pops out a dialog and the component types are not registered upfront.\n const text = i18nStrings[2 /* ComponentTypeNotRegisteredAndBindComponentEventHandlerNotAssigned */];\n const message = `${text}: ${JSON.stringify(itemConfig)}`;\n throw new BindError(message);\n }\n }\n }\n /** @internal */\n unbindComponent(container, virtual, component) {\n if (this.unbindComponentEvent !== undefined) {\n this.unbindComponentEvent(container);\n }\n else {\n if (!virtual && this.releaseComponentEvent !== undefined) {\n if (component === undefined) {\n throw new UnexpectedUndefinedError('VCUCRCU333998');\n }\n else {\n this.releaseComponentEvent(container, component);\n }\n }\n }\n }\n}\n/** @public */\n(function (VirtualLayout) {\n /** @internal\n * Veriable to hold the state whether we already checked if we are running in a sub window.\n * Fixes popout and creation of nested golden-layouts.\n */\n let subWindowChecked = false;\n /** @internal */\n function createLayoutManagerConstructorParameters(configOrOptionalContainer, containerOrBindComponentEventHandler) {\n const windowConfigKey = subWindowChecked ? null : new URL(document.location.href).searchParams.get('gl-window');\n subWindowChecked = true;\n const isSubWindow = windowConfigKey !== null;\n let containerElement;\n let config;\n if (windowConfigKey !== null) {\n const windowConfigStr = localStorage.getItem(windowConfigKey);\n if (windowConfigStr === null) {\n throw new Error('Null gl-window Config');\n }\n localStorage.removeItem(windowConfigKey);\n const minifiedWindowConfig = JSON.parse(windowConfigStr);\n const resolvedConfig = ResolvedLayoutConfig.unminifyConfig(minifiedWindowConfig);\n config = LayoutConfig.fromResolved(resolvedConfig);\n if (configOrOptionalContainer instanceof HTMLElement) {\n containerElement = configOrOptionalContainer;\n }\n }\n else {\n if (configOrOptionalContainer === undefined) {\n config = undefined;\n }\n else {\n if (configOrOptionalContainer instanceof HTMLElement) {\n config = undefined;\n containerElement = configOrOptionalContainer;\n }\n else {\n // backwards compatibility\n config = configOrOptionalContainer;\n }\n }\n if (containerElement === undefined) {\n if (containerOrBindComponentEventHandler instanceof HTMLElement) {\n containerElement = containerOrBindComponentEventHandler;\n }\n }\n }\n return {\n constructorOrSubWindowLayoutConfig: config,\n isSubWindow,\n containerElement,\n };\n }\n VirtualLayout.createLayoutManagerConstructorParameters = createLayoutManagerConstructorParameters;\n})(VirtualLayout || (VirtualLayout = {}));\n//# sourceMappingURL=virtual-layout.js.map","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.21';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function',\n INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading whitespace. */\n var reTrimStart = /^\\s+/;\n\n /** Used to match a single whitespace character. */\n var reWhitespace = /\\s/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /**\n * Used to validate the `validate` option in `_.template` variable.\n *\n * Forbids characters which could potentially change the meaning of the function argument definition:\n * - \"(),\" (modification of function parameters)\n * - \"=\" (default value)\n * - \"[]{}\" (destructuring of function parameters)\n * - \"/\" (beginning of a comment)\n * - whitespace\n */\n var reForbiddenIdentifierChars = /[()=,{}\\[\\]\\/\\s]/;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\n function baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\n function trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n if (iteratees.length) {\n iteratees = arrayMap(iteratees, function(iteratee) {\n if (isArray(iteratee)) {\n return function(value) {\n return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);\n }\n }\n return iteratee;\n });\n } else {\n iteratees = [identity];\n }\n\n var index = -1;\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n var low = 0,\n high = array == null ? 0 : array.length;\n if (high === 0) {\n return 0;\n }\n\n value = iteratee(value);\n var valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n *\n * // Combining several predicates using `_.overEvery` or `_.overSome`.\n * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));\n * // => objects for ['fred', 'barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 30 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

' + func(text) + '

';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

fred, barney, & pebbles

'\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '