@finos/legend-application-pure-ide-deployment 8.33.0 → 8.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ide/index.html +1 -1
- package/dist/ide/static/{index.a19ad045.js → index.6f5b9fa2.js} +2 -2
- package/dist/ide/static/{index.a19ad045.js.map → index.6f5b9fa2.js.map} +1 -1
- package/dist/ide/static/{index.25b1901d.css → index.e807a956.css} +6 -6
- package/dist/ide/static/index.e807a956.css.map +1 -0
- package/dist/ide/version.json +1 -1
- package/package.json +3 -3
- package/dist/ide/static/index.25b1901d.css.map +0 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
(()=>{"use strict";var e,t,s,i,n,a={26067:(e,t,s)=>{const i=JSON.parse('{"i8":"6.2.14","Rw":{"k":"@finos/legend-logger-plugin-web-console"}}');var n,a=s(91004);class r{name;version;signature;uuid}class o{name;version;uuid=(0,a.Z)();constructor(e,t){this.name=e,this.version=t}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getInfo(){const e=new r;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e}configure(e){return this}}class l{name;version;signature;uuid;plugins=[]}class c{name;version;uuid=(0,a.Z)();plugins=[];constructor(e,t,s){this.name=e,this.version=t,this.plugins=s}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getPlugins(){return[...this.plugins]}getInfo(){const e=new l;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e.plugins=this.plugins.map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),e}configure(e){return this}install(e){this.plugins.forEach((t=>t.install(e)))}}class d{plugins=[];presets=[];usePlugins(e){return this.plugins=e,this}usePresets(e){return this.presets=e,this}configure(e){Object.keys(e).forEach((t=>{const s=e[t];this.presets.forEach((e=>{e.getName()===t&&e.configure(s)})),this.plugins.forEach((e=>{e.getName()===t&&e.configure(s)}))}))}install(){this.plugins.forEach((e=>e.install(this))),this.presets.forEach((e=>e.install(this)))}getInfo(){return{plugins:this.plugins.filter((e=>!this.getHiddenPluginNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),presets:this.presets.filter((e=>!this.getHiddenPresetNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name)))}}getHiddenPluginNames(){return[]}getHiddenPresetNames(){return[]}}!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(n=n||(n={}));class h{channel;name;timestamp=Date.now();static create(e){const t=new h;return t.name=e,t}}class u extends o{level=n.DEBUG;setLevel(e){this.level=e}install(e){e.registerLoggerPlugin(this)}debug(e,...t){this.level<=n.DEBUG&&this._debug(e,...t)}info(e,...t){this.level<=n.INFO&&this._info(e,...t)}warn(e,...t){this.level<=n.WARN&&this._warn(e,...t)}error(e,...t){this.level<=n.ERROR&&this._error(e,...t)}}class p{loggers=[];registerPlugins(e){this.loggers=e}debug(e,...t){this.loggers.forEach((s=>s.debug(e,...t)))}info(e,...t){this.loggers.forEach((s=>s.info(e,...t)))}warn(e,...t){this.loggers.forEach((s=>s.warn(e,...t)))}error(e,...t){this.loggers.forEach((s=>s.error(e,...t)))}}const{debug:m,info:_,warn:g,error:E}=console;class f extends u{constructor(){super(i.Rw.k,i.i8)}_debug(e,...t){m(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_info(e,...t){_(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_warn(e,...t){g(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_error(e,...t){E(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}var T=s(52322),C=s(17029),x=s(80075),N=s(90361);const A="Roboto Mono";var O,S;!function(e){e.LEGEND="LEGEND",e.TEMPORARY__VSCODE_LIGHT="vs"}(O=O||(O={})),function(e){e.TEXT="text",e.PURE="pure",e.JSON="json",e.JAVA="java",e.MARKDOWN="markdown",e.SQL="sql",e.XML="xml",e.YAML="yaml",e.GRAPHQL="graphql"}(S=S||(S={}));var y=s(85928),I=s(21112);const v=e=>e.constructor,R=()=>()=>{},P=e=>e.length?e[0]:void 0,w=e=>e.length?e[e.length-1]:void 0,L=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),b=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),D=(e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t))),a=e.findIndex((e=>i(e,s)));return-1!==n&&-1!==a&&(e[n]=s,e[a]=t,!0)},M=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class k extends Error{uuid=(0,a.Z)();constructor(e){super(),this.message=void 0===e||""===e?"(no error message)":e}get detail(){return this.message}}class F extends Error{constructor(e,t,s){if(super(s||(t instanceof Error?t.message:t)),this.name=e,t instanceof Error){const e=(this.message.match(/\n/g)??[]).length+1;this.stack=`${(this.stack??"").split("\n").slice(0,e+1).join("\n")}\nCaused by: ${t.stack}`}else"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack}}class j extends F{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class U extends F{constructor(e,t){super("Unsupported Operation Error",e||t?`${e}${t?`\n${((e,t)=>{const s=(i={printFunctionName:!1,maxDepth:t?.deep?void 0:1},(0,y.Z)(i,(e=>void 0!==e)));var i;return(0,I.WU)(e,s).replace(/.*\s\{/g,"{").replace(/\[.*\]/g,(e=>["[Array]","[Function]"].includes(e)?e:"[Object]"))})(t)}`:""}`:void 0)}}function V(e){if(!(e instanceof Error))throw new j("Expected error to be thrown")}const G=e=>{try{return e()}catch{return}};class $ extends F{constructor(e,t){super("Assertion Error",e,t)}}const z=e=>null!=e;function B(e,t=""){if(null==e)throw new $(t||"Value is nullable")}const H=(e,t="")=>(B(e,t),e),Y=e=>t=>((e,t)=>e instanceof t)(t,e);function W(e,t,s=""){if(!(e instanceof t))throw new $(s||`Value is expected to be of type '${t.name}'`)}const K=(e,t,s="")=>(W(e,t,s),e);function Z(e,t=""){if(""===H(e,t))throw new $(t||"Expected string value to be non-empty")}function X(e,t=""){return Z(e,t),e}function q(e,t=""){if(!e)throw new $(t||"Expected predicate to be truthy")}const J=e=>"string"==typeof e,Q=e=>"object"==typeof e&&null!==e;var ee=s(39391),te=s(33654),se=s(18247);s(72659);const ie=ee.W,ne="charset=utf-8";var ae,re,oe;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(ae=ae||(ae={})),function(e){e.APPLICATION_JSON="application/json",e.APPLICATION_XML="application/xml",e.APPLICATION_ZLIB="application/zlib",e.TEXT_PLAIN="text/plain",e.TEXT_CSV="text/csv",e.ALL="*/*"}(re=re||(re={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(oe=oe||(oe={}));const le={mode:"cors",credentials:"include",redirect:"manual"},ce=(e,t)=>{const s={};return e&&Object.entries(e).forEach((([e,t])=>{s[e]=t})),t&&Object.entries(t).forEach((([e,t])=>{s[e]=t})),s};class de extends Error{response;payload;constructor(e,t){super(),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="Network Client Error",this.response=e;const{status:s,statusText:i,url:n}=e,a=`Received response with status ${s} (${i}) for ${n}`;this.message=(t?(e=>{if(Q(e))return J(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&J(t.message)?t.message:e})(t).substring(0,5e3):"")||a,this.payload=t}}const he=async(e,t,s)=>{if(s?.preprocess?.(e),!e.ok){let t;try{t=await e.text(),t=JSON.parse(t)}catch{}return Promise.reject(new de(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===ie.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case re.APPLICATION_JSON:return e.json();case re.TEXT_PLAIN:return e.text();default:return Promise.reject(new de(e,`Can't process response for request with Content-Type '${i}'`))}},ue=async(e,t,s)=>s?.autoReAuthenticateUrl?(e=>new Promise((t=>{const s="AUTO_AUTHENTICATION_IFRAME";document.getElementById(s)?.remove();const i=document.createElement("iframe");i.id=s,i.src=e,i.style.display="none",i.addEventListener("load",(()=>{i.remove(),t()})),document.body.appendChild(i)})))(s.autoReAuthenticateUrl).then((()=>fetch(e,t))).then((e=>he(e,t,s))):fetch(e,t).then((e=>he(e,t,s))),pe=(e,t)=>{const s={};return s.Accept=re.APPLICATION_JSON,e!==oe.GET&&(s[ae.CONTENT_TYPE]=`${re.APPLICATION_JSON};${ne}`),ce(s,t)};class me{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...le,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(oe.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(oe.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(oe.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(oe.DELETE,e,t,s,i,n,a,r)}async request(e,t,s,i,n,a,r,o){const l=((e,t,s)=>{if(!e&&!G((()=>new URL(t))))throw new Error(`Can't build URL string: base URL is not specified and the provided URL '${t}' is not absolute`);const i=new URL(t,e);return s instanceof Object&&Object.entries(s).forEach((([e,t])=>{void 0!==t&&(Array.isArray(t)?t.filter(z).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,a??{});let c;if((J(s)||Q(s))&&r?.enableCompression&&(q(e!==oe.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,te.Wt)(Q(e)?JSON.stringify(e):e)]))(s),n=ce(n,{[ae.CONTENT_TYPE]:`${re.APPLICATION_ZLIB};${ne}`})),void 0!==s)if(J(s)||s instanceof Blob)c=s;else{if(!Q(s))throw new $("Request body can only be either a 'string' or an 'object'");c=JSON.stringify(s)}const d={...this.options,...i,method:e,body:c,headers:pe(e,n)};return fetch(l,d).then((e=>(e=>0===e.status||e.status===ie.UNAUTHORIZED)(e)?ue(l,d,o):he(e,d,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?ue(l,d,o):Promise.reject(e)))}}const _e=(e,t,s)=>{const i=new Blob([t],{type:s}),n=URL.createObjectURL(i),a=document.createElement("a");"string"==typeof a.download?(document.body.appendChild(a),a.download=e,a.href=n,a.click(),document.body.removeChild(a)):location.replace(n)};var ge;!function(e){e.TEXT_EDITOR_FONT_LOADED="application.load.font.success",e.APPLICATION_SETUP_FAILURE="application.setup.failure",e.ILLEGAL_APPLICATION_STATE_OCCURRED="application.error.illegal-state",e.APPLICATION_CONFIGURATION_FAILURE="application.configuration.failure",e.APPLICATION_DOCUMENTATION_FETCH_FAILURE="application.fetch.documentation.failure",e.APPLICATION_DOCUMENTATION_LOAD_SKIPPED="application.load.documentation.skipped",e.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK_FAILURE="application.load.documentation.requirement-check.failure",e.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE="application.load.keyboard-shortcuts.configuration-check.failure",e.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED="application.load.contextual-documentation.skipped",e.APPLICATION_COMMAND_CENTER_REGISTRATION_FAILURE="application.command-center.registration.failure",e.APPLICATION_LOADED="application.load.success",e.APPLICATION_LOAD_FAILURE="application.load.failure",e.DEVELOPMENT_ISSUE="development.issue",e.APPLICATION_CONTEXT_ACCESSED="application.context.accessed",e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED="application.virtual-assistant.documentation-entry.accessed"}(ge=ge||(ge={}));const Ee="::",fe="###",Te=["$implicit"];var Ce,xe,Ne,Ae,Oe;(Oe=Ce=Ce||(Ce={})).CORE="CORE",Oe.MAIN="ROOT",Oe.MODEL_GENERATION="MODEL_GENERATION_ROOT",Oe.SYSTEM="SYSTEM_ROOT",Oe.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(Ae=xe=xe||(xe={})).STRING="String",Ae.BOOLEAN="Boolean",Ae.BINARY="Binary",Ae.NUMBER="Number",Ae.INTEGER="Integer",Ae.FLOAT="Float",Ae.DECIMAL="Decimal",Ae.DATE="Date",Ae.STRICTDATE="StrictDate",Ae.DATETIME="DateTime",Ae.STRICTTIME="StrictTime",Ae.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(Ne=Ne||(Ne={}));const Se=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var ye,Ie,ve,Re,Pe,we,Le,be,De,Me;(Ie=ye=ye||(ye={})).ANY="meta::pure::metamodel::type::Any",Ie.NIL="meta::pure::metamodel::type::Nil",Ie.PROFILE_DOC="meta::pure::profiles::doc",Ie.PROFILE_TEMPORAL="meta::pure::profiles::temporal",Ie.PROFILE="meta::pure::metamodel::extension::Profile",Ie.ENUMERATION="meta::pure::metamodel::type::Enumeration",Ie.MEASURE="meta::pure::metamodel::type::Measure",Ie.CLASS="meta::pure::metamodel::type::Class",Ie.ASSOCIATION="meta::pure::metamodel::relationship::Association",Ie.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",Ie.FLAT_DATA="meta::flatData::metamodel::FlatData",Ie.DATABASE="meta::relational::metamodel::Database",Ie.MAPPING="meta::pure::mapping::Mapping",Ie.SERVICE="meta::legend::service::metamodel::Service",Ie.CONNECTION="meta::pure::runtime::PackageableConnection",Ie.RUNTIME="meta::pure::runtime::PackageableRuntime",Ie.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",Ie.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",Ie.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",Ie.DATA_ELEMENT="meta::pure::data::DataElement",Ie.TDS_ROW="meta::pure::tds::TDSRow",(we=ve=ve||(ve={})).BUSINESS_TEMPORAL="businesstemporal",we.PROCESSING_TEMPORAL="processingtemporal",we.BITEMPORAL="bitemporal",(Pe=Re=Re||(Re={})).ALL_VERSIONS="AllVersions",Pe.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(be=Le=Le||(Le={})).STORE="STORE",be.MAPPING="MAPPING",be.RUNTIME="RUNTIME",be.FILE_GENERATION="FILE_GENERATION",be.SERVICE="SERVICE",(Me=De=De||(De={})).TODAY="meta::pure::functions::date::today",Me.NOW="meta::pure::functions::date::now",Me.FIRST_DAY_OF_WEEK="meta::pure::functions::date::firstDayOfThisWeek",Me.FIRST_DAY_OF_MONTH="meta::pure::functions::date::firstDayOfThisMonth",Me.FIRST_DAY_OF_QUARTER="meta::pure::functions::date::firstDayOfThisQuarter",Me.FIRST_DAY_OF_YEAR="meta::pure::functions::date::firstDayOfThisYear",Me.PREVIOUS_DAY_OF_WEEK="meta::pure::functions::date::previousDayOfWeek",Me.IS_ON_DAY="meta::pure::functions::date::isOnDay",Me.IS_ON_OR_AFTER_DAY="meta::pure::functions::date::isOnOrAfterDay",Me.IS_AFTER_DAY="meta::pure::functions::date::isAfterDay",Me.IS_ON_OR_BEFORE_DAY="meta::pure::functions::date::isOnOrBeforeDay",Me.IS_BEFORE_DAY="meta::pure::functions::date::isBeforeDay",Me.MINUS="meta::pure::functions::math::minus",Me.ADJUST="meta::pure::functions::date::adjust",Me.LET="meta::pure::functions::lang::letFunction";const ke="yyyy-MM-dd'T'HH:mm:ssxxxx";var Fe,je,Ue;!function(e){e.PROFILE="Profile",e.CLASS="Class",e.ENUMERATION="Enum",e.MEASURE="Measure",e.ASSOCIATION="Association",e.FUNCTION="function",e.MAPPING="Mapping",e.FLAT_DATA="FlatData",e.DATABASE="Database",e.SERVICE="Service",e.RUNTIME="Runtime",e.CONNECTION="Connection",e.FILE_GENERATION="FileGeneration",e.GENERATION_SPECIFICATION="GenerationSpecification",e.DATA_ELEMENT="Data"}(Fe=Fe||(Fe={})),function(e){e.JSON_MODEL_CONNECTION="JsonModelConnection",e.XML_MODEL_CONNECTION="XmlModelConnection",e.MODEL_CHAIN_CONNECTION="ModelChainConnection",e.RELATIONAL_DATABASE_CONNECTION="RelationalDatabaseConnection",e.FLAT_DATA_CONNECTION="FlatDataConnection"}(je=je||(je={})),function(e){e.PURE="Pure",e.CONNECTION="Connection",e.RUNTIME="Runtime",e.MAPPING="Mapping",e.SERVICE="Service",e.FLATDATA="FlatData",e.RELATIONAL="Relational",e.GENERATION_SPECIFICATION="GenerationSpecification",e.FILE_GENERATION_SPECIFICATION="FileGeneration",e.DATA="Data"}(Ue=Ue||(Ue={}));const Ve=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`;var Ge;!function(e){e.WHITESPACE="",e.KEYWORD="keyword",e.IDENTIFIER="identifier",e.OPERATOR="operator",e.DELIMITER="delimiter",e.PARSER="parser",e.NUMBER="number",e.DATE="date",e.COLOR="color",e.PACKAGE="package",e.STRING="string",e.COMMENT="comment",e.LANGUAGE_STRUCT="language-struct",e.MULTIPLICITY="multiplicity",e.GENERICS="generics",e.PROPERTY="property",e.PARAMETER="property",e.VARIABLE="variable",e.TYPE="type",e.INVALID="invalid"}(Ge=Ge||(Ge={}));const $e={base:"vs-dark",inherit:!0,colors:{},rules:[{token:Ge.IDENTIFIER,foreground:"dcdcaa"},{token:Ge.NUMBER,foreground:"b5cea8"},{token:Ge.DATE,foreground:"b5cea8"},{token:Ge.COLOR,foreground:"b5cea8"},{token:Ge.PACKAGE,foreground:"808080"},{token:Ge.PARSER,foreground:"c586c0"},{token:Ge.LANGUAGE_STRUCT,foreground:"c586c0"},{token:Ge.MULTIPLICITY,foreground:"2d796b"},{token:Ge.GENERICS,foreground:"2d796b"},{token:Ge.PROPERTY,foreground:"9cdcfe"},{token:Ge.PARAMETER,foreground:"9cdcfe"},{token:Ge.VARIABLE,foreground:"4fc1ff"},{token:Ge.TYPE,foreground:"3dc9b0"}]},ze={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"},{open:"<<",close:">>"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}};var Be=s(79013);class He{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,Be.qC)(this.schema,e)}fromJson(e){return(0,Be.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,y.Z)(t,(e=>null!==e))):e);var t}}const Ye=e=>(0,Be.PG)((t=>void 0===t?Be.AM:(0,Be.qC)(e,t)),(t=>(0,Be.vB)(e,t))),We=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?Be.AM:[],Ke=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?Be.AM:[]:Be.AM,Ze=e=>(0,Be.PG)((()=>e),(()=>e));var Xe=s(4e4);class qe{_documentationKey;markdownText;title;text;url;related;static serialization=new He((0,Be.yu)(qe,{markdownText:(0,Be.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,Be.jt)((0,Be.pb)((0,Be.Ru)())),title:(0,Be.jt)((0,Be.Ru)()),text:(0,Be.jt)((0,Be.Ru)()),url:(0,Be.jt)((0,Be.Ru)())}));static create(e,t){const s=qe.serialization.fromJson(e);return s._documentationKey=t,s}}const Je=e=>Object.entries(e).map((e=>({key:e[0],content:qe.create(e[1],e[0])})));class Qe{url;docRegistry=new Map;contextualDocIndex=new Map;constructor(e){this.url=e.config.documentationUrl,e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedDocumentationEntries?.()??[])).forEach((t=>{this.hasDocEntry(t.key)?e.log.warn(h.create(ge.APPLICATION_DOCUMENTATION_LOAD_SKIPPED),t.key):this.docRegistry.set(t.key,t.content)})),e.config.keyedDocumentationEntries.forEach((e=>this.docRegistry.set(e.key,e.content)));const t=e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraContextualDocumentationEntries?.()??[])),s=[];(0,Xe.Z)(e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraRequiredDocumentationKeys?.()??[])).concat(t.map((e=>e.documentationKey)))).forEach((e=>{this.docRegistry.has(e)||s.push(e)})),s.length&&e.log.warn(h.create(ge.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK_FAILURE),`Can't find corresponding documentation entry for keys:\n${s.map((e=>`- ${e}`)).join("\n")}`),t.forEach((t=>{if(this.hasContextualDocEntry(t.context))e.log.warn(h.create(ge.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED),t.context);else{const e=this.getDocEntry(t.documentationKey);e&&this.contextualDocIndex.set(t.context,e)}})),e.config.contextualDocEntries.forEach((e=>{const t=this.getDocEntry(e.documentationKey);t&&this.contextualDocIndex.set(e.context,t)}))}getDocEntry(e){return this.docRegistry.get(e)}hasDocEntry(e){return this.docRegistry.has(e)}getContextualDocEntry(e){return this.contextualDocIndex.get(e)}hasContextualDocEntry(e){return this.contextualDocIndex.has(e)}getAllDocEntries(){return Array.from(this.docRegistry.values())}publishDocRegistry(){const e={};return this.docRegistry.forEach(((t,s)=>{e[s]=qe.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t._documentationKey})),e}}class et{}class tt extends et{debug(e,...t){console.debug(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}info(e,...t){console.info(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}warn(e,...t){console.warn(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}error(e,...t){console.error(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}class st{config;logger;pluginManager;basePresets=[];basePlugins=[];baseUrl;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new tt}setup(e){return this.baseUrl=X(e.baseUrl,"Can't setup application: 'baseUrl' is missing or empty"),this.pluginRegister=e.pluginRegister,this._isConfigured=!0,this}withBasePresets(e){return this.basePresets=e,this.withPresets([])}withBasePlugins(e){return this.basePlugins=e,this.withPlugins([])}withPresets(e){return this.pluginManager.usePresets([...this.basePresets,...e]),this}withPlugins(e){return this.pluginManager.usePlugins([...this.basePlugins,...e]),this}async fetchApplicationConfiguration(e){const t=new me;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){V(e),this.logger.error(h.create(ge.APPLICATION_CONFIGURATION_FAILURE),e)}B(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){V(e),this.logger.error(h.create(ge.APPLICATION_CONFIGURATION_FAILURE),e)}return B(i,"Can't fetch Legend application version"),[await this.configureApplication({configData:s,versionData:i,baseUrl:e}),s.extensions??{}]}async loadDocumentationRegistryData(e){const t={};await Promise.all([...e.documentationRegistryEntries,...this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraDocumentationRegistryEntries?.()??[]))].map((async e=>{try{const s=new me(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(X(e.url,"Can't load documentation registry: 'url' field is missing or empty"));B(i.entries,"Can't load documentation registry data: 'entries' field is missing");const n=e.includes?.map((e=>new RegExp(`^${e.trim().replace(/[\^$\\.+?()[\]{}|]/g,"\\$&").replace(/\*/g,".*")}$`)));Object.entries(i.entries).forEach((([e,s])=>{n&&!n.some((t=>t.test(e)))||t[e]||(t[e]=s)}))}catch(e){V(e),this.logger.warn(h.create(ge.APPLICATION_DOCUMENTATION_FETCH_FAILURE),e)}}))),e.keyedDocumentationEntries=[...Je(t),...e.keyedDocumentationEntries]}async start(){B(this._isConfigured,"Legend application has not been configured properly. Make sure to run setup() before start()");try{const[e,t]=await this.fetchApplicationConfiguration(this.baseUrl);this.config=e,this.pluginRegister?.(this.pluginManager,this.config),this.pluginManager.configure(t),this.pluginManager.install(),await Promise.all([this.loadDocumentationRegistryData(e)]),await this.loadApplication(),await Promise.all(this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraApplicationSetups?.()??[])).map((e=>e(this.pluginManager)))),this.logger.info(h.create(ge.APPLICATION_LOADED),"Legend application loaded")}catch(e){throw V(e),this.logger.error(h.create(ge.APPLICATION_LOAD_FAILURE),"Failed to load Legend application"),e}}}var it=s(8354),nt=s(69038),at=s(2784);class rt{historyAPI;_isNavigationBlocked=!1;_forceBypassNavigationBlocking=!1;_blockCheckers=[];_beforeUnloadListener=e=>{this._forceBypassNavigationBlocking||this._blockCheckers.some((e=>e()))&&(e.returnValue="")};onBlock;onNativePlatformNavigationBlock;constructor(e){(0,x.rC)(this,{_isNavigationBlocked:x.LO,isNavigationBlocked:x.Fl,blockNavigation:x.aD,unblockNavigation:x.aD}),this.historyAPI=e}get window(){return H(window,"Window object is not available in non-web environment")}goToLocation(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=this.generateAddress(e)};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}reload(e){e?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const t=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.reload()};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(t):t()}goToAddress(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=e};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}visitAddress(e){this.window.open(e,"_blank")}updateCurrentLocation(e){this.historyAPI.push(e)}getCurrentAddress(){return this.window.location.href}getCurrentLocation(){return this.historyAPI.location.pathname}generateAddress(e){return this.window.location.origin+this.historyAPI.createHref({pathname:e})}blockNavigation(e,t,s){this._isNavigationBlocked=!0,this.onBlock=t,this.onNativePlatformNavigationBlock=s,this.window.history.pushState(null,"",this.getCurrentAddress()),this.window.onpopstate=()=>{window.history.forward(),this.onNativePlatformNavigationBlock?.()},this._blockCheckers=e,this.window.removeEventListener("beforeunload",this._beforeUnloadListener),this.window.addEventListener("beforeunload",this._beforeUnloadListener)}unblockNavigation(){this._isNavigationBlocked=!1,this.onBlock=void 0,this.window.onpopstate=null,this._blockCheckers=[],this.window.removeEventListener("beforeunload",this._beforeUnloadListener)}get isNavigationBlocked(){return this._isNavigationBlocked}}var ot=s(76237);const lt=(0,at.createContext)(void 0),ct=({children:e})=>{const t=(0,ot.k6)(),s=(0,nt.fv)((()=>new rt(t)));return(0,T.jsx)(lt.Provider,{value:s,children:e})};class dt{plugins=[];registerPlugins(e){this.plugins=e}setUserId(e){this.plugins.forEach((t=>t.setUserId(e)))}logEvent(e,t){this.plugins.forEach((s=>s.logEvent(e,t)))}}var ht;!function(e){e.USER="user",e.ENV="env",e.RESULT="result",e.ERROR="error",e.HTTP_STATUS="status",e.HTTP_REQUEST_METHOD="method",e.HTTP_REQUEST_URL="url"}(ht=ht||(ht={}));class ut{traceEntries=[];setup(e){this.traceEntries=e}bootstrap(e){this.traceEntries.forEach((t=>{t.plugin.bootstrap(t.clientSpan,e)}))}reportSuccess(){this.traceEntries.forEach((e=>{e.plugin.concludeClientSpan(e.clientSpan,void 0)}))}reportError(e){this.traceEntries.forEach((t=>{t.plugin.concludeClientSpan(t.clientSpan,e)}))}close(){this.traceEntries.forEach((e=>{e.plugin.concludeServerSpan(e.serverSpan)}))}}class pt{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const n=new ut;return e&&n.setup(this.plugins.map((n=>{const a=n.createClientSpan(e);return{clientSpan:a,serverSpan:n.createServerSpan(a,t,s,i),plugin:n}}))),n}}var mt,_t,gt,Et=s(94174);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(mt||(mt={}));class ft{state;_message;_messageFormatter;constructor(){this.state=mt.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=mt.INITIAL,this}inProgress(){return this.state=mt.IN_PROGRESS,this}fail(){return this.state=mt.FAILED,this}pass(){return this.state=mt.SUCCEEDED,this}complete(e=!0){return e?this.pass():this.fail(),this}get isInInitialState(){return this.state===mt.INITIAL}get isInProgress(){return this.state===mt.IN_PROGRESS}get hasFailed(){return this.state===mt.FAILED}get hasSucceeded(){return this.state===mt.SUCCEEDED}get message(){return this._message?this._messageFormatter?this._messageFormatter(this._message):this._message:void 0}get hasCompleted(){return this.hasFailed||this.hasSucceeded}static create(){return(0,x.rC)(new ft,{state:x.LO,_message:x.LO,reset:x.aD,inProgress:x.aD,pass:x.aD,fail:x.aD,complete:x.aD,setMessage:x.aD,isInInitialState:x.Fl,isInProgress:x.Fl,hasFailed:x.Fl,hasSucceeded:x.Fl,hasCompleted:x.Fl,message:x.Fl})}}!function(e){e.STANDARD="standard",e.INCLUDE="include match",e.EXACT="exact match",e.INVERSE="excludes exact match"}(_t=_t||(_t={}));class Tt{currentMode=_t.STANDARD;onSearchModeChange;constructor(e){(0,x.rC)(this,{currentMode:x.LO,isAdvancedSearchActive:x.Fl,setCurrentMode:x.aD}),this.onSearchModeChange=e}get isAdvancedSearchActive(){return this.currentMode!==_t.STANDARD}generateSearchText(e){switch(this.currentMode){case _t.INCLUDE:return`'"${e}"`;case _t.EXACT:return`="${e}"`;case _t.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(gt=gt||(gt={}));class Ct{uuid=(0,a.Z)();documentationKey;title;content;url;isOpen=!1;constructor(e){(0,x.rC)(this,{isOpen:x.LO,setIsOpen:x.aD}),this.documentationKey=e._documentationKey,this.title=X(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class xt{uuid=(0,a.Z)();context;title;content;url;related;constructor(e,t,s){this.context=e,this.title=t.title,this.content=t.markdownText??t.text,this.url=t.url,this.related=s}}const Nt=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class At{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!1;isOpen=!1;selectedTab=gt.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=ft.create();searchText="";searchResults=[];showSearchConfigurationMenu=!1;isOverSearchLimit=!1;constructor(e){(0,x.rC)(this,{isHidden:x.LO,isOpen:x.LO,panelRenderingKey:x.LO,isOverSearchLimit:x.LO,selectedTab:x.LO,searchText:x.LO,searchResults:x.LO,currentDocumentationEntry:x.LO,showSearchConfigurationMenu:x.LO,currentContextualDocumentationEntry:x.Fl,setIsHidden:x.aD,setIsOpen:x.aD,setSelectedTab:x.aD,setSearchText:x.aD,resetSearch:x.aD,search:x.aD,openDocumentationEntry:x.aD,refreshPanelRendering:x.aD,setShowSearchConfigurationMenu:x.aD}),this.applicationStore=e,this.searchEngine=new Et.Fuse(this.applicationStore.documentationService.getAllDocEntries().filter(Nt),{includeScore:!0,shouldSort:!0,ignoreLocation:!0,threshold:.2,keys:[{name:"title",weight:4},{name:"text",weight:1},{name:"markdownText.value",weight:1}],useExtendedSearch:!0}),this.searchConfigurationState=new Tt((()=>{this.search()}))}get currentContextualDocumentationEntry(){if(!this.applicationStore.navigationContextService.currentContext)return;const e=this.applicationStore.navigationContextService.currentContext.key,t=this.applicationStore.documentationService.getContextualDocEntry(e);return t?new xt(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter(z).filter(Nt).map((e=>new Ct(e)))):void 0}openDocumentationEntry(e){const t=this.applicationStore.documentationService.getAllDocEntries().find((t=>t._documentationKey===e));t&&(this.setIsOpen(!0),this.setIsHidden(!1),this.currentDocumentationEntry=new Ct(t),this.currentDocumentationEntry.setIsOpen(!0),this.resetSearch())}setIsHidden(e){this.isHidden=e}hideAssistant(){this.setIsHidden(!0),this.setIsOpen(!1)}toggleAssistant(){this.isHidden?this.setIsHidden(!1):this.hideAssistant()}setIsOpen(e){this.isOpen=e}setSelectedTab(e){this.selectedTab=e}refreshPanelRendering(){this.panelRenderingKey=(0,a.Z)()}setSearchText(e){this.searchText=e}resetSearch(){this.searchText="",this.searchResults=[],this.searchState.complete()}search(){this.searchText?(this.currentDocumentationEntry=void 0,this.searchState.inProgress(),this.searchResults=Array.from(this.searchEngine.search(this.searchConfigurationState.generateSearchText(this.searchText),{limit:101}).values()).map((e=>new Ct(e.item))),this.searchResults.length>100?(this.isOverSearchLimit=!0,this.searchResults=this.searchResults.slice(0,100)):this.isOverSearchLimit=!1,this.searchState.complete()):this.searchResults=[]}setShowSearchConfigurationMenu(e){this.showSearchConfigurationMenu=e}}class Ot{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}class St{static logEvent_ApplicationInitialized(e,t){e.logEvent(ge.APPLICATION_LOADED,t)}static logEvent_ApplicationContextAccessed(e,t){e.logEvent(ge.APPLICATION_CONTEXT_ACCESSED,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(ge.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED,t)}}class yt{applicationStore;contextStack=[];constructor(e){(0,x.rC)(this,{contextStack:x.LO,currentContext:x.Fl,push:x.aD,pop:x.aD}),this.applicationStore=e}get currentContext(){return this.contextStack.length?this.contextStack[this.contextStack.length-1]:void 0}push(e){const t=this.contextStack.filter((e=>!e.isTransient));if(t.find((t=>t.key===e.key)))throw new j(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&St.logEvent_ApplicationContextAccessed(this.applicationStore.telemetryService,{key:e.key}),this.contextStack=t}pop(e){const t=this.contextStack.find((t=>t.key===e.key));if(!t)return;const s=this.contextStack.indexOf(t);-1!==s&&(this.contextStack=this.contextStack.slice(0,s).filter((e=>!e.isTransient)))}}class It{applicationStore;commandRegistry=new Map;constructor(e){(0,x.rC)(this,{commandRegistry:x.LO,registerCommand:x.aD,deregisterCommand:x.aD}),this.applicationStore=e}registerCommand(e){const t=e.key;this.commandRegistry.has(t)?this.applicationStore.log.warn(h.create(ge.APPLICATION_COMMAND_CENTER_REGISTRATION_FAILURE),"Can't register command: command is already registered"):this.commandRegistry.set(t,e)}deregisterCommand(e){this.commandRegistry.delete(e)}runCommand(e,t){const s=this.commandRegistry.get(e);return!(!s||s.trigger&&!s.trigger()||(s.action?.(t),0))}}class vt{applicationStore;keyMap=new Map;commandKeyMap=new Map;isHotkeysBlocked=!1;constructor(e){(0,x.rC)(this,{keyMap:x.LO,commandKeyMap:x.LO,isHotkeysBlocked:x.LO,updateHotkey:x.aD,blockGlobalHotkeys:x.aD,unblockGlobalHotkeys:x.aD}),this.applicationStore=e;const t=[];this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedCommandConfigEntries?.()??[])).forEach((e=>{e.content.defaultKeyboardShortcut&&this.commandKeyMap.get(e.key)&&b(t,e.key),this.updateHotkey(e.key,e.content.defaultKeyboardShortcut)})),t.length&&this.applicationStore.log.warn(h.create(ge.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE),`Found multiple key bindings in configuration for commands:\n${t.map((e=>`- ${e}`)).join("\n")}`)}blockGlobalHotkeys(){this.isHotkeysBlocked=!0}unblockGlobalHotkeys(){this.isHotkeysBlocked=!1}updateHotkey(e,t){const s=this.commandKeyMap.get(e);this.commandKeyMap.set(e,t),s&&this.keyMap.set(s,(this.keyMap.get(s)??[]).filter((t=>t===e))),t&&this.keyMap.set(t,[...(this.keyMap.get(t)??[]).filter((t=>t!==e)),e])}dispatch(e){if(this.isHotkeysBlocked)return;const t=this.keyMap.get(e)??[];for(const e of t)if(this.applicationStore.commandCenter.runCommand(e))return}}var Rt,Pt;!function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(Rt=Rt||(Rt={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(Pt=Pt||(Pt={}));const wt=6e3;var Lt;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(Lt=Lt||(Lt={}));class bt{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class Dt{config;pluginManager;navigator;navigationContextService;notification;blockingAlertInfo;actionAlertInfo;log=new p;documentationService;assistantService;eventService=new Ot;telemetryService=new dt;tracerService=new pt;commandCenter;keyboardShortcutsService;backdropContainerElementID;showBackdrop=!1;TEMPORARY__isLightThemeEnabled=!1;constructor(e,t,s){(0,x.rC)(this,{notification:x.LO,blockingAlertInfo:x.LO,actionAlertInfo:x.LO,TEMPORARY__isLightThemeEnabled:x.LO,backdropContainerElementID:x.LO,showBackdrop:x.LO,setBackdropContainerElementID:x.aD,setShowBackdrop:x.aD,setBlockingAlert:x.aD,setActionAlertInfo:x.aD,setNotification:x.aD,notify:x.aD,notifySuccess:x.aD,notifyWarning:x.aD,notifyIllegalState:x.aD,notifyError:x.aD,TEMPORARY__setIsLightThemeEnabled:x.aD}),this.config=e,this.navigator=t,this.pluginManager=s,this.log.registerPlugins(s.getLoggerPlugins()),this.navigationContextService=new yt(this),this.documentationService=new Qe(this),this.assistantService=new At(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.commandCenter=new It(this),this.keyboardShortcutsService=new vt(this),this.tracerService.registerPlugins(s.getTracerServicePlugins()),this.eventService.registerEventNotifierPlugins(s.getEventNotifierPlugins())}TEMPORARY__setIsLightThemeEnabled(e){this.TEMPORARY__isLightThemeEnabled=e}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}setBlockingAlert(e){e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.blockingAlertInfo=e}setActionAlertInfo(e){this.actionAlertInfo&&e&&this.notifyIllegalState("Action alert is stacked: new alert is invoked while another one is being displayed"),e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.actionAlertInfo=e}setNotification(e){this.notification=e}notify(e,t,s){this.setNotification(new bt(Lt.INFO,e,t??[],null===s?void 0:s??wt))}notifySuccess(e,t,s){this.setNotification(new bt(Lt.SUCCESS,e,t??[],null===s?void 0:s??wt))}notifyWarning(e,t,s){this.setNotification(new bt(Lt.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??wt))}notifyIllegalState(e,t,s){this.setNotification(new bt(Lt.ILEGAL_STATE,J(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??wt))}notifyError(e,t){let s;e instanceof k?s=e.detail:e instanceof Error?s=e.message:(q(J(e),"Can't display error"),s=e),s&&this.setNotification(new bt(Lt.ERROR,s,t??[],void 0))}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return V(e),this.notifyIllegalState(e.message),t}};alertUnhandledError=e=>{this.log.error(h.create(ge.ILLEGAL_APPLICATION_STATE_OCCURRED),"Encountered unhandled error in component tree",e),this.notifyIllegalState(e.message)};guardUnhandledError=e=>()=>{e().catch(this.alertUnhandledError)};async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.notifyError(e)}))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}}const Mt=(0,at.createContext)(void 0),kt=({children:e,config:t,pluginManager:s})=>{const i=H((0,at.useContext)(lt),"Can't find web application navigator in context"),n=(0,nt.fv)((()=>new Dt(t,i,s)));return(0,T.jsx)(Mt.Provider,{value:n,children:e})},Ft=()=>H((0,at.useContext)(Mt),"Can't find application store in context");class jt{appName;baseUrl;env;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseUrl=e.baseUrl,this.appName=X(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=X(e.configData.env,"Can't configure application: 'env' field is missing or empty"),this.documentationUrl=e.configData.documentation?.url,this.documentationRegistryEntries=e.configData.documentation?.registry??[],this.keyedDocumentationEntries=Je(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=H(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=H(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=H(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}}class Ut extends jt{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),B(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=X(e.configData.pure.url,"Can't configure application: 'pure.url' field is missing or empty"),void 0!==e.configData.pure.dynamic&&(this.useDynamicPureServer=Boolean(e.configData.pure.dynamic))}}class Vt extends d{loggerPlugins=[];telemetryServicePlugins=[];tracerServicePlugins=[];eventNotifierPlugins=[];applicationPlugins=[];registerLoggerPlugin(e){this.loggerPlugins.push(e)}registerTelemetryServicePlugin(e){this.telemetryServicePlugins.push(e)}registerTracerServicePlugin(e){this.tracerServicePlugins.push(e)}registerEventNotifierPlugin(e){this.eventNotifierPlugins.push(e)}registerApplicationPlugin(e){this.applicationPlugins.push(e)}getLoggerPlugins(){return[...this.loggerPlugins]}getTelemetryServicePlugins(){return[...this.telemetryServicePlugins]}getTracerServicePlugins(){return[...this.tracerServicePlugins]}getEventNotifierPlugins(){return[...this.eventNotifierPlugins]}getApplicationPlugins(){return[...this.applicationPlugins]}}class Gt extends Vt{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new Gt}registerPureProtocolProcessorPlugin(e){this.pureProtocolProcessorPlugins.push(e)}registerPureGraphManagerPlugin(e){this.pureGraphManagerPlugins.push(e)}registerPureGraphPlugin(e){this.pureGraphPlugins.push(e)}getPureGraphManagerPlugins(){return[...this.pureGraphManagerPlugins]}getPureProtocolProcessorPlugins(){return[...this.pureProtocolProcessorPlugins]}getPureGraphPlugins(){return[...this.pureGraphPlugins]}}const $t=JSON.parse('{"i8":"7.1.24","Rw":{"NA":"@finos/legend-graph-manager-preset-dsl-diagram","zE":"@finos/legend-pure-protocol-processor-plugin-dsl-diagram","LW":"@finos/legend-pure-graph-manager-plugin-dsl-diagram","f1":"@finos/legend-pure-graph-plugin-dsl-diagram"}}');class zt extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Bt=e=>t=>(0,x.bi)(t)?t:e(t),Ht=e=>(t,s)=>(0,x.bi)(t)?t:e(t,s),Yt=e=>{(0,x.rC)(e,{_isDeleted:x.LO,_isDisposed:x.LO,name:x.LO,package:x.LO,isDeleted:x.Fl,path:x.Fl,_elementHashCode:x.Fl,hashCode:x.Fl,setIsDeleted:x.aD,dispose:x.aD})},Wt=Bt((e=>(0,x.rC)(e,{value:x.LO,valueForSerialization:x.Fl})));var Kt=s(34485),Zt=s(3096);const Xt=e=>Kt.sha1().update(e).digest("hex"),qt=e=>Xt(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Xt(e):e.hashCode)).join(","));var Jt,Qt;(Qt=Jt=Jt||(Jt={})).PACKAGE="PACKAGE",Qt.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Qt.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Qt.PROFILE="PROFILE",Qt.TAG_POINTER="TAG_POINTER",Qt.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Qt.TAGGED_VALUE="TAGGED_VALUE",Qt.ENUMERATION="ENUMERATION",Qt.ENUM_VALUE="ENUM_VALUE",Qt.CLASS="CLASS",Qt.PROPERTY="PROPERTY",Qt.PROPERTY_POINTER="PROPERTY_POINTER",Qt.MULTIPLICITY="MULTIPLICITY",Qt.CONSTRAINT="CONSTRAINT",Qt.DERIVED_PROPERTY="DERIVED_PROPERTY",Qt.ASSOCIATION="ASSOCIATION",Qt.FUNCTION="FUNCTION",Qt.MEASURE="MEASURE",Qt.UNIT="UNIT",Qt.RUNTIME="RUNTIME",Qt.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Qt.ENGINE_RUNTIME="ENGINE_RUNTIME",Qt.LEGACY_RUNTIME="LEGACY_RUNTIME",Qt.RUNTIME_POINTER="RUNTIME_POINTER",Qt.STORE_CONNECTIONS="STORE_CONNECTIONS",Qt.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Qt.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Qt.CONNECTION_POINTER="CONNECTION_POINTER",Qt.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Qt.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Qt.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Qt.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Qt.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Qt.FLAT_DATA="FLAT_DATA",Qt.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Qt.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Qt.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Qt.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Qt.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Qt.FLAT_DATA_STRING="FLAT_DATA_STRING",Qt.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Qt.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Qt.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Qt.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Qt.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Qt.FLAT_DATA_DATE="FLAT_DATA_DATE",Qt.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Qt.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Qt.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Qt.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Qt.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Qt.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Qt.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Qt.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER",Qt.DATABASE="DATABASE",Qt.DATABASE_SCHEMA="DATABASE_SCHEMA",Qt.DATABASE_JOIN="DATABASE_JOIN",Qt.DATABASE_FILTER="DATABASE_FILTER",Qt.DATBASE_VIEW="DATBASE_VIEW",Qt.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Qt.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Qt.RELATIONAL="RELATIONAL",Qt.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Qt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Qt.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Qt.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Qt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Qt.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Qt.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Qt.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Qt.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Qt.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Qt.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Qt.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Qt.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Qt.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Qt.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Qt.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Qt.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Qt.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Qt.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Qt.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Qt.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Qt.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Qt.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Qt.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Qt.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Qt.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Qt.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Qt.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Qt.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Qt.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Qt.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Qt.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Qt.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Qt.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Qt.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Qt.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Qt.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Qt.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Qt.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Qt.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Qt.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Qt.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Qt.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Qt.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Qt.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Qt.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Qt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Qt.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Qt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Qt.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Qt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Qt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Qt.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Qt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Qt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Qt.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Qt.SCHEMA_MAPPER="SCHEMA_MAPPER",Qt.TABLE_MAPPER="TABLE_MAPPER",Qt.MAPPING="MAPPING",Qt.MAPPING_INCLUDE="MAPPING_INCLUDE",Qt.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Qt.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Qt.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Qt.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Qt.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Qt.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Qt.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Qt.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Qt.PROPERTY_MAPPING="PROPERTY_MAPPING",Qt.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Qt.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Qt.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Qt.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Qt.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Qt.MAPPING_TEST="MAPPING_TEST",Qt.STORE_TEST_DATA="STORE_TEST_DATA",Qt.INPUT_DATA="INPUT_DATA",Qt.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Qt.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Qt.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Qt.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Qt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Qt.FILTER_MAPPING="FILTER_MAPPING",Qt.COLUMN_MAPPING="COLUMN_MAPPING",Qt.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Qt.SERVICE="SERVICE",Qt.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Qt.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Qt.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Qt.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Qt.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Qt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Qt.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Qt.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Qt.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Qt.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Qt.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Qt.SERVICE_TEST="SERVICE_TEST",Qt.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Qt.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",Qt.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",Qt.GENERATION_TREE="GENERATION_TREE",Qt.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Qt.FILE_GENERATION="FILE_GENERATION",Qt.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Qt.SECTION_INDEX="SECTION_INDEX",Qt.SECTION="SECTION",Qt.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Qt.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Qt.RAW_LAMBDA="RAW_LAMBDA",Qt.RAW_VARIABLE="RAW_VARIABLE",Qt.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Qt.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Qt.ASSERT_FAIL="ASSERT_FAIL",Qt.ASSERT_PASS="ASSERT_PASS",Qt.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Qt.EQUAL_TO="EQUAL_TO",Qt.EQUAL_TO_JSON="EQUAL_TO_JSON",Qt.EQUAL_TO_TDS="EQUAL_TO_TDS",Qt.TEST_RESULT="TEST_RESULT",Qt.TEST_ERROR="TEST_ERROR",Qt.TEST_FAILED="TEST_FAILED",Qt.TEST_PASSED="TEST_PASSED",Qt.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Qt.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Qt.MODEL_STORE_DATA="MODEL_STORE_DATA",Qt.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Qt.DATA_ELEMENT="DATA_ELEMENT",Qt.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Qt.RELATIONAL_TDS="RELATIONAL_TDS",Qt.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Qt.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Qt.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Qt.EXPRESSION="EXPRESSION",Qt.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Qt.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Qt.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Qt.INSTANCE_VALUE="INSTANCE_VALUE",Qt.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Qt.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Qt.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Qt.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Qt.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Qt.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Qt.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Qt.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Qt.FUNCTION_TYPE="FUNCTION_TYPE",Qt.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Qt.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Qt.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Qt.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Qt.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Qt.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Qt.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Qt.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE";const es=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},q(Q(t=e),"Can't hash non-object value"),Zt(t,s);var t,s},ts=(e,t)=>qt([e?es(e):"",t?es(t):""]),ss=(e,t)=>[Jt.PACKAGEABLE_ELEMENT_POINTER,e,t].map(Xt).join(",");class is{stereotypes=[];taggedValues=[]}class ns extends is{name}class as extends ns{_UUID=(0,a.Z)();_isDeleted=!1;_isDisposed=!1;package;constructor(e){super(),this.name=e}get isDeleted(){return this._isDeleted}setIsDeleted(e){this._isDeleted=e}get path(){if(!this.package)return this.name;const e=this.package.path;return e?`${e}${Ee}${this.name}`:this.name}dispose(){this._isDisposed=!0;try{this.hashCode}catch{}}get _elementHashCode(){return qt([Jt.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new j(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class rs extends as{}class os extends rs{_subclasses=[];_generatedMilestonedProperties=[];properties=[];propertiesFromAssociations=[];derivedProperties=[];generalizations=[];constraints=[];dispose(){super.dispose(),this._subclasses=[],this.generalizations.forEach((e=>{const t=e.value.rawType;t._isDisposed||(t._subclasses=t._subclasses.filter((e=>!e._isDisposed)))}))}get _elementHashCode(){return qt([Jt.CLASS,this.path,qt(this.properties),qt(this.derivedProperties),qt(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),qt(this.constraints),qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class ls extends rs{}class cs extends ls{values=[];get _elementHashCode(){return qt([Jt.ENUMERATION,this.path,qt(this.values),qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class ds extends ls{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return qt([Jt.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new U}}class hs extends rs{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return qt([Jt.MEASURE,this.path,this.canonicalUnit??"",qt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class us extends as{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class ps{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return qt([Jt.SECTION,this.parserName,qt(this.elements.map((e=>e.valueForSerialization??"")))])}}class ms extends ps{imports=[];get hashCode(){return qt([Jt.IMPORT_AWARE_CODE_SECTION,super.hashCode,qt(this.imports.map((e=>e.valueForSerialization??"")))])}}class _s extends ps{get hashCode(){return qt([Jt.DEFAULT_CODE_SECTION,super.hashCode])}}class gs{_UUID=(0,a.Z)()}class Es extends gs{ownerReference;constructor(e){super(),this.ownerReference=e}}class fs extends gs{value;constructor(e){super(),this.value=e}}class Ts extends fs{constructor(e){super(e)}static create(e){return new Ts(e)}get valueForSerialization(){return this.value.path}}const Cs=Bt((e=>(0,x.rC)(e,{name:x.LO,value:x.LO.ref,hashCode:x.Fl}))),xs=Bt((e=>(Yt(e),(0,x.rC)(e,{type:x.LO,generationOutputPath:x.LO,scopeElements:x.LO,configurationProperties:x.LO,_elementHashCode:x.KG}),e.scopeElements.forEach((e=>{e instanceof fs&&Wt(e)})),e.configurationProperties.forEach(Cs),e))),Ns=Bt((e=>((0,x.rC)(e,{id:x.LO,hashCode:x.Fl}),Wt(e.generationElement),e))),As=Bt((e=>(Yt(e),(0,x.rC)(e,{generationNodes:x.LO,fileGenerations:x.LO,_elementHashCode:x.KG}),e.generationNodes.forEach(Ns),e.fileGenerations.forEach(Wt),e)));var Os=s(67295),Ss=s(72531);s(90286);const ys=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,Is=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],vs=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,Os.P)(e,void 0,s);return B(i,"Can't stringify lossless JSON value"),i})((0,Ss.Qc)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};class Rs{}class Ps extends Rs{expectedOutput;constructor(e){super(),this.expectedOutput=vs(e)}get hashCode(){return qt([Jt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class ws{}class Ls extends ws{mappings=[];connections=[];get hashCode(){return qt([Jt.ENGINE_RUNTIME,qt(this.mappings.map((e=>ss(Le.MAPPING,e.valueForSerialization??"")))),qt(this.connections.filter((e=>e.storeConnections.length)))])}}class bs extends ws{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return qt([Jt.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class Ds{}class Ms extends Ds{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return qt([Jt.FLAT_DATA_INPUT_DATA,ss(Le.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var ks,Fs,js;(js=ks=ks||(ks={})).JSON="JSON",js.XML="XML";class Us extends Ds{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===ks.JSON?vs(s):s}get hashCode(){return qt([Jt.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(Fs=Fs||(Fs={}));class Vs extends Ds{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return qt([Jt.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const Gs=Bt((e=>((0,x.rC)(e,{value:x.LO,hashCode:x.Fl}),Wt(e.type),e))),$s=Bt((e=>(0,x.rC)(e,{body:x.LO.ref,parameters:x.LO.ref,hashCode:x.Fl}))),zs=Bt((e=>((0,x.rC)(e,{name:x.LO,multiplicity:x.LO,hashCode:x.Fl}),Wt(e.type),e)));class Bs{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){$s(e)}visit_RawVariableExpression(e){zs(e)}visit_RawPrimitiveInstanceValue(e){Gs(e)}}Ht(((e,t)=>(e.accept_RawValueSpecificationVisitor(new Bs(t)),e)));class Hs{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class Ys extends Hs{trueString;falseString;get hashCode(){return qt([Jt.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class Ws extends Hs{get hashCode(){return qt([Jt.FLAT_DATA_STRING])}}class Ks extends Hs{get hashCode(){return qt([Jt.FLAT_DATA_NUMBER])}}class Zs extends Hs{dateFormat;timeZone;get hashCode(){return qt([Jt.FLAT_DATA_DATE,this.dateFormat?qt(this.dateFormat):"",this.timeZone??""])}}class Xs extends Hs{fields=[];get hashCode(){return qt([Jt.FLAT_DATA_RECORD_TYPE,qt(this.fields)])}}const qs=Ht(((e,t)=>(Ir(e,t),(0,x.rC)(e,{flatData:x.LO,sectionName:x.LO,hashCode:x.Fl}),e))),Js=Bt((e=>((0,x.rC)(e,{label:x.LO,flatDataDataType:x.LO,optional:x.LO,address:x.LO,hashCode:x.Fl}),(e=>{e instanceof Ys?(0,x.rC)(e,{trueString:x.LO,falseString:x.LO,hashCode:x.Fl}):e instanceof Ws||e instanceof Ks?(0,x.rC)(e,{hashCode:x.Fl}):e instanceof Zs?(0,x.rC)(e,{dateFormat:x.LO,timeZone:x.LO,hashCode:x.Fl}):e instanceof Xs&&Bt(Qs)(e)})(e.flatDataDataType),e)));function Qs(e){return(0,x.rC)(e,{fields:x.LO,hashCode:x.Fl}),e.fields.forEach(Js),e}Bt(Qs);const ei=Bt(Qs),ti=Bt((e=>((0,x.rC)(e,{name:x.LO,value:x.LO,hashCode:x.Fl}),e))),si=Bt((e=>((0,x.rC)(e,{driverId:x.LO,name:x.LO,sectionProperties:x.LO,recordType:x.LO,hashCode:x.Fl}),e.sectionProperties.forEach(ti),e.recordType&&ei(e.recordType),e))),ii=(Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),Wt(e.ownerReference),e))),Bt((e=>(Yt(e),(0,x.rC)(e,{sections:x.LO,_elementHashCode:x.KG}),e.sections.forEach(si),e)))),ni=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),ai=Ht(((e,t)=>(Mr(e,t),(0,x.rC)(e,{filter:x.LO,hashCode:x.Fl}),ni(e.sourceRootRecordType),e.filter&&$s(e.filter),e))),ri=Ht(((e,t)=>(Ir(e,t),Mr(e,t),(0,x.rC)(e,{rootInstanceSetImplementation:x.LO,hashCode:x.Fl}),e))),oi=Ht(((e,t)=>(Ir(e,t),(0,x.rC)(e,{transformer:x.LO,transform:x.LO,hashCode:x.Fl}),$s(e.transform),e))),li=Bt((e=>((0,x.rC)(e,{data:x.LO,hashCode:x.Fl}),Wt(e.sourceFlatData),e))),ci=Bt((e=>((0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),e)));class di{}class hi extends di{serverPrincipal;get hashCode(){return qt([Jt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class ui extends di{get hashCode(){return qt([Jt.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class pi extends di{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return qt([Jt.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class mi extends di{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return qt([Jt.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class _i extends di{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return qt([Jt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class gi extends di{get hashCode(){return qt([Jt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class Ei extends di{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return qt([Jt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,qt(this.additionalGcpScopes)])}}class fi extends di{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return qt([Jt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class Ti extends di{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return qt([Jt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class Ci{}class xi extends Ci{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return qt([Jt.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class Ni extends Ci{hostname;port;protocol;httpPath;constructor(e,t,s,i){super(),this.hostname=e,this.port=t,this.protocol=s,this.httpPath=i}get hashCode(){return qt([Jt.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class Ai extends Ci{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return qt([Jt.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class Oi extends Ci{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return qt([Jt.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",qt(this.testDataSetupSqls)])}}class Si extends Ci{accountName;region;warehouseName;databaseName;cloudType;quotedIdentifiersIgnoreCase;proxyHost;proxyPort;nonProxyHosts;organization;accountType;role;constructor(e,t,s,i){super(),this.region=t,this.warehouseName=s,this.databaseName=i,this.accountName=e}get hashCode(){return qt([Jt.SNOWFLAKE_DATASOURCE_SPECIFICATION,this.accountName,this.region,this.warehouseName,this.databaseName,this.cloudType??"",this.proxyHost??"",this.proxyPort??"",this.nonProxyHosts??"",this.organization??"",this.accountType??"",this.role??"",this.quotedIdentifiersIgnoreCase?.toString()??""])}}class yi extends Ci{clusterID;databaseName;host;port;region;endpointURL;constructor(e,t,s,i,n,a){super(),this.clusterID=n,this.region=a,this.host=i,this.databaseName=e,this.endpointURL=t,this.port=s}get hashCode(){return qt([Jt.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class Ii extends Ci{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return qt([Jt.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class vi{_UUID=(0,a.Z)()}class Ri extends vi{mappers=[];get hashCode(){return qt([Jt.MAPPER_POST_PROCESSOR,qt(this.mappers)])}}const Pi="{target}",wi="default";class Li{}class bi extends Li{}class Di extends bi{}class Mi extends Di{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return qt([Jt.RELATIONAL_OPERATION_DYNA_FUNC,this.name,qt(this.parameters)])}}var ki;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(ki=ki||(ki={}));const Fi=e=>[e].concat(e.children.length?Fi(e.children[0]):[]);class ji extends Li{relationalOperationElement;joinTreeNode;get hashCode(){return qt([Jt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,qt(this.joinTreeNode?Fi(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class Ui extends Li{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new U}}class Vi extends Li{alias;column;columnName;get hashCode(){return qt([Jt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?Pi:this.alias.name,this.column.value.name])}}class Gi extends Li{value;constructor(e){super(),this.value=e}get hashCode(){return qt([Jt.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class $i extends Li{values=[];get hashCode(){return qt([Jt.RELATIONAL_OPERATION_LITERAL_LIST,qt(this.values)])}}class zi extends Li{owner;name;type;nullable;get hashCode(){return qt([Jt.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Bi{}class Hi extends Bi{infinityDate}class Yi{}class Wi extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_BIGINT])}}class Ki extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_SMALLINT])}}class Zi extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_TINYINT])}}class Xi extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_INTEGER])}}class qi extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_FLOAT])}}class Ji extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_DOUBLE])}}class Qi extends Yi{size;constructor(e){super(),this.size=e}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class en extends Yi{size;constructor(e){super(),this.size=e}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class tn extends Yi{size;constructor(e){super(),this.size=e}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class sn extends Yi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class nn extends Yi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class an extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_TIMESTAMP])}}class rn extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_VARCHAR])}}class on extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_BIT])}}class ln extends Yi{size;constructor(e){super(),this.size=e}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class cn extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_REAL])}}class dn extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class hn extends Es{ownerReference;constructor(e){super(e),this.ownerReference=e}}class un extends hn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Jt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Xt).join(",")}get selfJoinPointerHashCode(){return[Jt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",wi,Pi].map(Xt).join(",")}}class pn extends hn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Jt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Xt).join(",")}get selfJoinPointerHashCode(){return[Jt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",wi,Pi].map(Xt).join(",")}}class mn{}class _n extends mn{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return qt([this.from,this.to])}}class gn extends _n{get hashCode(){return qt([super.hashCode,Jt.SCHEMA_MAPPER])}}class En extends _n{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return qt([super.hashCode,Jt.TABLE_MAPPER,this.schema])}}const fn=Bt((e=>((0,x.rC)(e,{packageableElementIncludes:x.LO,packageableElementExcludes:x.LO,hashCode:x.Fl}),e.packageableElementIncludes.forEach(Wt),e.packageableElementExcludes.forEach(Wt),e))),Tn=(Bt((e=>(Cr(e),(0,x.rC)(e,{schemaSet:x.LO,schemaId:x.LO,contentType:x.LO,modelUnit:x.LO,_elementHashCode:x.KG}),e.schemaSet&&Wt(e.schemaSet),fn(e.modelUnit),e))),Bt((e=>((0,x.rC)(e,{binding:x.LO,hashCode:x.Fl}),Wt(e.binding),e)))),Cn=Bt((e=>((0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),e))),xn=(Bt((e=>(Qr(e),(0,x.rC)(e,{externalSource:x.LO,hashCode:x.Fl}),Cn(e.externalSource),e))),Bt((e=>(0,x.rC)(e,{id:x.LO,location:x.LO,content:x.LO,hashCode:x.Fl})))),Nn=(Bt((e=>(Yt(e),(0,x.rC)(e,{format:x.LO,schemas:x.LO,_elementHashCode:x.KG}),e.schemas.forEach(xn),e))),Bt((e=>e instanceof Wi||e instanceof Ki||e instanceof Zi||e instanceof Xi||e instanceof qi||e instanceof Ji||e instanceof an||e instanceof Date||e instanceof rn||e instanceof on||e instanceof cn||e instanceof dn?(0,x.rC)(e,{hashCode:x.Fl}):e instanceof Qi||e instanceof en||e instanceof tn||e instanceof ln?(0,x.rC)(e,{size:x.LO,hashCode:x.Fl}):e instanceof sn||e instanceof nn?(0,x.rC)(e,{precision:x.LO,scale:x.LO,hashCode:x.Fl}):e))),An=Bt((e=>((0,x.rC)(e,{name:x.LO,type:x.LO,nullable:x.LO,hashCode:x.Fl}),Nn(e.type),e))),On=Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl,selfJoinPointerHashCode:x.Fl}),Wt(e.ownerReference),e))),Sn=Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl,selfJoinPointerHashCode:x.Fl}),Wt(e.ownerReference),e))),yn=Bt((e=>((0,x.rC)(e,{relation:x.LO,name:x.LO,database:x.LO,isSelfJoinTarget:x.LO}),(e=>{e instanceof pn?Sn(e):e instanceof un&&On(e)})(e.relation),e))),In=Bt((e=>((0,x.rC)(e,{name:x.LO,parameters:x.LO,hashCode:x.Fl}),e.parameters.forEach(Mn),e))),vn=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),Rn=Bt((e=>((0,x.rC)(e,{alias:x.LO,column:x.LO,columnName:x.LO,hashCode:x.Fl}),yn(e.alias),vn(e.column),e))),Pn=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),wn=Bt((e=>((0,x.rC)(e,{alias:x.LO,children:x.LO,joinType:x.LO,hashCode:x.Fl}),e.alias&&yn(e.alias),e.children.forEach(wn),Pn(e.join),e))),Ln=Bt((e=>((0,x.rC)(e,{relationalOperationElement:x.LO,joinTreeNode:x.LO,hashCode:x.Fl}),e.relationalOperationElement&&Mn(e.relationalOperationElement),e.joinTreeNode&&wn(e.joinTreeNode),e))),bn=Bt((e=>((0,x.rC)(e,{value:x.LO,hashCode:x.Fl}),e.value instanceof Li&&Mn(e.value),e))),Dn=Bt((e=>((0,x.rC)(e,{values:x.LO,hashCode:x.Fl}),e.values.forEach(bn),e)));function Mn(e){return e instanceof Mi?In(e):e instanceof Ui?yn(e):e instanceof Vi?Rn(e):e instanceof zi?An(e):e instanceof Gi?bn(e):e instanceof $i?Dn(e):e instanceof ji?Ln(e):e}const kn=Bt((e=>e)),Fn=Ht(((e,t)=>{if(e instanceof Hi)return kn(e);const s=t.plugins.flatMap((e=>e.getExtraMilestoningObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})),jn=Bt((e=>((0,x.rC)(e,{columnName:x.LO,relationalOperationElement:x.LO,hashCode:x.Fl}),Mn(e.relationalOperationElement),e))),Un=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),Vn=Bt((e=>((0,x.rC)(e,{joinTreeNode:x.LO,database:x.LO,filterName:x.LO,hashCode:x.Fl}),e.joinTreeNode&&wn(e.joinTreeNode),Un(e.filter),e))),Gn=Bt((e=>((0,x.rC)(e,{columns:x.LO}),e.columns.forEach(Mn),e))),$n=e=>{(0,x.rC)(e,{columns:x.LO,name:x.LO})},zn=Ht(((e,t)=>($n(e),(0,x.rC)(e,{primaryKey:x.LO,hashCode:x.Fl}),e.primaryKey.forEach(An),e.milestoning.forEach((e=>Fn(e,t))),e))),Bn=Ht(((e,t)=>($n(e),(0,x.rC)(e,{primaryKey:x.LO,columnMappings:x.LO,filter:x.LO,distinct:x.LO,groupBy:x.LO,hashCode:x.Fl}),e.primaryKey.forEach(An),e.columnMappings.forEach(jn),e.filter&&Vn(e.filter),e.groupBy&&Gn(e.groupBy),e))),Hn=Ht(((e,t)=>((0,x.rC)(e,{name:x.LO,tables:x.LO,views:x.LO,hashCode:x.Fl}),e.tables.forEach((e=>zn(e,t))),e.views.forEach((e=>Bn(e,t))),e))),Yn=Bt((e=>((0,x.rC)(e,{name:x.LO,operation:x.LO,hashCode:x.Fl}),Mn(e.operation),e))),Wn=Bt((e=>((0,x.rC)(e,{name:x.LO,target:x.LO,aliases:x.LO,operation:x.LO,hashCode:x.Fl}),e.target&&yn(e.target),Mn(e.operation),e))),Kn=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{schemas:x.LO,joins:x.LO,filters:x.LO,_elementHashCode:x.KG}),e.schemas.forEach((e=>Hn(e,t))),e.joins.forEach(Wn),e.filters.forEach(Yn),e))),Zn=Ht(((e,t)=>(Ir(e,t),(0,x.rC)(e,{transformer:x.LO,relationalOperation:x.LO.ref,bindingTransformer:x.LO,hashCode:x.Fl}),e.bindingTransformer&&Tn(e.bindingTransformer),e))),Xn=(e,t)=>(Mr(e,t),Ir(e,t),(0,x.rC)(e,{id:x.LO,rootInstanceSetImplementation:x.LO,primaryKey:x.LO}),e.primaryKey.forEach(Mn),e),qn=Ht(Xn),Jn=Ht(((e,t)=>(Xn(e,t),(0,x.rC)(e,{inlineSetImplementation:x.LO}),$r(e.inlineSetImplementation,t),e))),Qn=Ht(((e,t)=>(Xn(e,t),(0,x.rC)(e,{otherwisePropertyMapping:x.LO,hashCode:x.Fl}),Pr(e.otherwisePropertyMapping,t),e))),ea=Ht(((e,t)=>(Mr(e,t),(0,x.rC)(e,{primaryKey:x.LO}),e.primaryKey.forEach(Mn),e))),ta=Ht(((e,t)=>(Mr(e,t),(0,x.rC)(e,{columnMappings:x.LO,filter:x.LO,distinct:x.LO,groupBy:x.LO,mainTableAlias:x.LO,superSetImplementationId:x.LO,hashCode:x.Fl}),e.columnMappings.forEach(jn),e.filter&&Vn(e.filter),e.groupBy&&Gn(e.groupBy),e.mainTableAlias&&yn(e.mainTableAlias),e))),sa=Bt((e=>((0,x.rC)(e,{data:x.LO,inputType:x.LO,hashCode:x.Fl}),Wt(e.database),e))),ia=Bt((e=>(0,x.rC)(e,{host:x.LO,port:x.LO,databaseName:x.LO,hashCode:x.Fl}))),na=Bt((e=>(0,x.rC)(e,{hostname:x.LO,port:x.LO,protocol:x.LO,httpPath:x.LO,hashCode:x.Fl}))),aa=Bt((e=>(0,x.rC)(e,{databaseName:x.LO,directory:x.LO,autoServerMode:x.LO,hashCode:x.Fl}))),ra=Bt((e=>(0,x.rC)(e,{testDataSetupCsv:x.LO,testDataSetupSqls:x.LO,hashCode:x.Fl}))),oa=Bt((e=>(0,x.rC)(e,{accountName:x.LO,region:x.LO,warehouseName:x.LO,databaseName:x.LO,cloudType:x.LO,quotedIdentifiersIgnoreCase:x.LO,proxyHost:x.LO,proxyPort:x.LO,nonProxyHosts:x.LO,organization:x.LO,accountType:x.LO,role:x.LO,hashCode:x.Fl}))),la=Bt((e=>(0,x.rC)(e,{databaseName:x.LO,endpointURL:x.LO,port:x.LO,region:x.LO,clusterID:x.LO,host:x.LO,hashCode:x.Fl}))),ca=Bt((e=>(0,x.rC)(e,{projectId:x.LO,defaultDataset:x.LO,proxyHost:x.LO,proxyPort:x.LO,hashCode:x.Fl}))),da=Bt((e=>(0,x.rC)(e,{serverPrincipal:x.LO,hashCode:x.Fl}))),ha=Bt((e=>(0,x.rC)(e,{hashCode:x.Fl}))),ua=Bt((e=>(0,x.rC)(e,{apiToken:x.LO,hashCode:x.Fl}))),pa=Bt((e=>(0,x.rC)(e,{oauthKey:x.LO,scopeName:x.LO,hashCode:x.Fl}))),ma=Bt((e=>(0,x.rC)(e,{privateKeyVaultReference:x.LO,passPhraseVaultReference:x.LO,publicUserName:x.LO,hashCode:x.Fl}))),_a=Bt((e=>(0,x.rC)(e,{hashCode:x.Fl}))),ga=Bt((e=>(0,x.rC)(e,{hashCode:x.Fl,userNameVaultReference:x.LO,passwordVaultReference:x.LO,baseVaultReference:x.LO}))),Ea=Bt((e=>(0,x.rC)(e,{hashCode:x.Fl,serviceAccountEmail:x.LO,additionalGcpScopes:x.LO}))),fa=Bt((e=>(0,x.rC)(e,{hashCode:x.Fl,vaultReference:x.LO}))),Ta=e=>{(0,x.rC)(e,{from:x.LO,to:x.LO,hashCode:x.Fl})},Ca=Bt((e=>(Ta(e),e))),xa=Bt((e=>(Ta(e),(0,x.rC)(e,{schema:x.LO}),Ca(e.schema),e))),Na=Ht(((e,t)=>((e=>{Qr(e),(0,x.rC)(e,{type:x.LO,timeZone:x.LO,quoteIdentifiers:x.LO})})(e),(0,x.rC)(e,{datasourceSpecification:x.LO,authenticationStrategy:x.LO,postProcessors:x.LO,hashCode:x.Fl}),((e,t)=>{if(e instanceof xi)return ia(e);if(e instanceof Ni)return na(e);if(e instanceof Ai)return aa(e);if(e instanceof Oi)return ra(e);if(e instanceof Si)return oa(e);if(e instanceof yi)return la(e);if(e instanceof Ii)return ca(e);const s=t.plugins.flatMap((e=>e.getExtraDatasourceSpecificationObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.datasourceSpecification,t),((e,t)=>{if(e instanceof hi)return da(e);if(e instanceof ui)return ha(e);if(e instanceof pi)return ua(e);if(e instanceof mi)return pa(e);if(e instanceof _i)return ma(e);if(e instanceof gi)return _a(e);if(e instanceof fi)return ga(e);if(e instanceof Ei)return Ea(e);if(e instanceof Ti)return fa(e);const s=t.plugins.flatMap((e=>e.getExtraAuthenticationStrategyObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.authenticationStrategy,t),e.postProcessors.forEach((e=>{((e,t)=>{if(e instanceof Ri)return(e=>((e=>{(0,x.rC)(e,{hashCode:x.Fl})})(e),(0,x.rC)(e,{mappers:x.LO}),e.mappers.forEach((e=>{(e=>{e instanceof gn?Ca(e):e instanceof En&&xa(e)})(e)})),e))(e);const s=t.plugins.flatMap((e=>e.getExtraPostProcessorObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e,t)})),e)));class Aa{id}class Oa extends Aa{__parent;assertions=[]}class Sa extends Aa{__parent;tests=[]}class ya extends Oa{serializationFormat;parameters=[];keys=[];get hashCode(){return qt([Jt.SERVICE_TEST,this.id,qt(this.assertions),qt(this.parameters),qt(this.keys),this.serializationFormat??""])}}class Ia extends Oa{query;get hashCode(){return qt([Jt.MAPPING_TEST,this.query,this.id,qt(this.assertions)])}}class va extends Sa{storeTestDatas=[];get hashCode(){return qt([Jt.MAPPING_TEST_SUITE,qt(this.storeTestDatas),this.id,qt(this.tests)])}}class Ra extends Sa{testData;get hashCode(){return qt([Jt.SERVICE_TEST_SUITE,this.id,qt(this.tests),this.testData])}}class Pa{id;parentTest}class wa extends Pa{expected;get hashCode(){return qt([Jt.EQUAL_TO,this.id,es(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class La extends Pa{expected;get hashCode(){return qt([Jt.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class ba extends Pa{expected;get hashCode(){return qt([Jt.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class Da{}class Ma extends Da{dataElement;get hashCode(){return qt([Jt.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class ka extends Da{contentType;data;get hashCode(){return qt([Jt.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class Fa extends Da{instances;get hashCode(){return qt([Jt.MODEL_STORE_DATA,qt(Array.from(this.instances.keys()).map((e=>e.path))),es(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class ja extends Da{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return qt([Jt.RELATIONAL_CSV_DATA_TABLE,qt(this.tables)])}}const Ua=Bt((e=>((0,x.rC)(e,{contentType:x.LO,data:x.LO,hashCode:x.Fl}),e))),Va=Bt((e=>((0,x.rC)(e,{dataElement:x.LO,hashCode:x.Fl}),e))),Ga=Bt((e=>((0,x.rC)(e,{instances:x.LO,hashCode:x.Fl}),e))),$a=Bt((e=>((0,x.rC)(e,{values:x.LO,table:x.LO,schema:x.LO,hashCode:x.Fl}),e))),za=Bt((e=>((0,x.rC)(e,{tables:x.LO,hashCode:x.Fl}),e.tables.forEach($a),e)));function Ba(e,t){if(e instanceof Ma)return Va(e);if(e instanceof ka)return Ua(e);if(e instanceof Fa)return Ga(e);if(e instanceof ja)return za(e);const s=t.plugins.flatMap((e=>e.getExtraEmbeddedDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}const Ha=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{stereotypes:x.LO,taggedValues:x.LO,data:x.LO,_elementHashCode:x.KG}),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),Ba(e.data,t),e)));class Ya{}class Wa extends Ya{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return qt([Jt.SERVICE_PURE_EXECUTION,this.func])}}class Ka extends Wa{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return qt([Jt.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class Za extends Wa{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return qt([Jt.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,qt(this.executionParameters)])}}class Xa{_OWNER;constructor(e){this._OWNER=e}}class qa extends Xa{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return qt([Jt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,qt(this.asserts)])}}class Ja extends Xa{tests=[];get hashCode(){return qt([Jt.SERVICE_LEGACY_MULTI_EXECUTION_TEST,qt(this.tests)])}}const Qa=Ht(((e,t)=>((0,x.rC)(e,{connectionId:x.LO,testData:x.LO,hashCode:x.Fl}),Ba(e.testData,t),e))),er=Bt((e=>((0,x.rC)(e,{name:x.LO,value:x.LO.ref,hashCode:x.Fl}),e))),tr=Bt((e=>((0,x.rC)(e,{assertion:x.LO,hashCode:x.Fl,id:x.LO}),$s(e.assertion),e))),sr=Bt((e=>((0,x.rC)(e,{assertions:x.LO,description:x.LO,parameters:x.LO,hashCode:x.Fl}),e.assertions.forEach(tr),e.parameters.forEach($s),e))),ir=Ht(((e,t)=>((0,x.rC)(e,{connectionsTestData:x.LO,hashCode:x.Fl}),e.connectionsTestData.forEach((e=>Qa(e,t))),e))),nr=Bt((e=>((0,x.rC)(e,{id:x.LO,serializationFormat:x.LO,assertions:x.LO,parameters:x.LO,keys:x.LO,hashCode:x.Fl}),e.parameters.forEach(er),e.assertions.forEach(Tr),e))),ar=Ht(((e,t)=>((0,x.rC)(e,{id:x.LO,tests:x.LO,testData:x.LO,hashCode:x.Fl}),e.tests.forEach((e=>fr(e,t))),ir(e.testData,t),e))),rr=Bt((e=>((0,x.rC)(e,{parametersValues:x.LO,assert:x.LO,singleExecutionTestParent:x.LO,hashCode:x.Fl}),$s(e.assert),e))),or=Bt((e=>((0,x.rC)(e,{data:x.LO,asserts:x.LO,hashCode:x.Fl}),e.asserts.forEach(rr),e))),lr=Bt((e=>(or(e),(0,x.rC)(e,{key:x.LO}),e))),cr=Bt((e=>((0,x.rC)(e,{tests:x.LO,hashCode:x.Fl}),e.tests.forEach(lr),e))),dr=e=>{(0,x.rC)(e,{func:x.LO}),$s(e.func)},hr=Ht(((e,t)=>(dr(e),(0,x.rC)(e,{runtime:x.LO,hashCode:x.Fl}),e.mapping&&Wt(e.mapping),e.runtime&&uo(e.runtime,t),e))),ur=Ht(((e,t)=>((0,x.rC)(e,{key:x.LO,runtime:x.LO,hashCode:x.Fl}),Wt(e.mapping),uo(e.runtime,t),e))),pr=Ht(((e,t)=>(dr(e),(0,x.rC)(e,{executionKey:x.LO,executionParameters:x.LO,hashCode:x.Fl}),e.executionParameters.forEach((e=>ur(e,t))),e))),mr=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{pattern:x.LO,owners:x.LO,documentation:x.LO,autoActivateUpdates:x.LO,execution:x.LO,test:x.LO,tests:x.LO,postValidations:x.LO,patternParameters:x.Fl,_elementHashCode:x.KG}),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),((e,t)=>{e instanceof Ka?hr(e,t):e instanceof Za&&pr(e,t)})(e.execution,t),e.test&&(e=>{e instanceof qa?or(e):e instanceof Ja&&cr(e)})(e.test),e.tests.forEach((e=>ar(e,t))),e.postValidations.forEach((e=>sr(e))),e))),_r=Bt((e=>((0,x.rC)(e,{id:x.LO,expected:x.LO,hashCode:x.Fl}),e))),gr=Bt((e=>((0,x.rC)(e,{id:x.LO,expected:x.LO,hashCode:x.Fl}),Ua(e.expected),e))),Er=Bt((e=>((0,x.rC)(e,{id:x.LO,expected:x.LO,hashCode:x.Fl}),Ua(e.expected),e)));function fr(e,t){if(e instanceof ya)return nr(e);if(e instanceof Ia)return Nr(e);const s=t.plugins.flatMap((e=>e.getExtraAtomicTestObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}function Tr(e){return e instanceof wa?_r(e):e instanceof La?Er(e):e instanceof ba?gr(e):e}const Cr=e=>{Yt(e),(0,x.rC)(e,{includes:x.LO}),e.includes.forEach(Wt)},xr=Ht(((e,t)=>((0,x.rC)(e,{store:x.LO,data:x.LO,hashCode:x.Fl}),Ba(e.data,t),e))),Nr=Bt((e=>((0,x.rC)(e,{id:x.LO,query:x.LO,assertions:x.LO,hashCode:x.Fl}),e.assertions.forEach(Tr),e))),Ar=Ht(((e,t)=>((0,x.rC)(e,{id:x.LO,tests:x.LO,storeTestDatas:x.LO,hashCode:x.Fl}),e.tests.forEach((e=>fr(e,t))),e.storeTestDatas.forEach((e=>xr(e,t))),e))),Or=Bt((e=>((0,x.rC)(e,{value:x.LO,valueForSerialization:x.Fl}),Wt(e.ownerReference),e))),Sr=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),yr=Bt((e=>((0,x.rC)(e,{localMappingProperty:x.LO,localMappingPropertyType:x.LO,localMappingPropertyMultiplicity:x.LO,hashCode:x.Fl}),Wt(e.localMappingPropertyType),e))),Ir=(e,t)=>{(0,x.rC)(e,{sourceSetImplementation:x.LO,targetSetImplementation:x.LO}),Do(e.property),Sr(e.sourceSetImplementation),e.targetSetImplementation&&Sr(e.targetSetImplementation),e.localMappingProperty&&yr(e.localMappingProperty)},vr=Ht(((e,t)=>(Ir(e,t),(0,x.rC)(e,{transformer:x.LO,transform:x.LO,explodeProperty:x.LO,hashCode:x.Fl}),e.transformer&&Or(e.transformer),$s(e.transform),e)));class Rr{observerContext;constructor(e){this.observerContext=e}visit_PropertyMapping(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraPropertyMappingObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_PurePropertyMapping(e){vr(e,this.observerContext)}visit_FlatDataPropertyMapping(e){oi(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){ri(e,this.observerContext)}visit_RelationalPropertyMapping(e){Zn(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){qs(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){qn(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Jn(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){Qn(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const Pr=(e,t)=>(e.accept_PropertyMappingVisitor(new Rr(t)),e),wr=Bt((e=>(0,x.rC)(e,{isDefault:x.Fl,valueForSerialization:x.Fl}))),Lr=Bt((e=>(0,x.rC)(e,{valueForSerialization:x.Fl}))),br=e=>{(0,x.rC)(e,{root:x.LO}),Wt(e.class),wr(e.id),Lr(e.root)},Dr=Bt((e=>((0,x.rC)(e,{setImplementation:x.LO,class:x.LO,properties:x.LO}),e))),Mr=(e,t)=>{br(e),(0,x.rC)(e,{mappingClass:x.LO,propertyMappings:x.LO}),e.mappingClass&&Dr(e.mappingClass),e.propertyMappings.forEach((e=>Pr(e,t)))},kr=Bt((e=>((0,x.rC)(e,{}),Sr(e.setImplementation),e))),Fr=e=>{br(e),(0,x.rC)(e,{parameters:x.LO,operation:x.LO,hashCode:x.Fl}),e.parameters.forEach(kr)},jr=Bt((e=>(Fr(e),e))),Ur=Bt((e=>(Fr(e),(0,x.rC)(e,{validationFunction:x.LO}),$s(e.validationFunction),e))),Vr=Ht(((e,t)=>(Mr(e,t),(0,x.rC)(e,{filter:x.LO,hashCode:x.Fl}),e.srcClass&&Wt(e.srcClass),e.filter&&$s(e.filter),e)));class Gr{observerContext;constructor(e){this.observerContext=e}visit_SetImplementation(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraSetImplementationObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_MergeOperationSetImplementation(e){Ur(e)}visit_OperationSetImplementation(e){jr(e)}visit_PureInstanceSetImplementation(e){Vr(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){ai(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){ea(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){ta(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const $r=(e,t)=>(e.accept_SetImplementationVisitor(new Gr(t)),e),zr=Bt((e=>((0,x.rC)(e,{original:x.LO,substitute:x.LO}),Wt(e.original),Wt(e.substitute),e))),Br=Bt((e=>((0,x.rC)(e,{included:x.LO,storeSubstitutions:x.LO}),Wt(e.included),e.storeSubstitutions.forEach(zr),e))),Hr=Bt((e=>(0,x.rC)(e,{value:x.LO}))),Yr=Bt((e=>((0,x.rC)(e,{sourceValues:x.LO,hashCode:x.Fl}),vo(e.enum),e.sourceValues.forEach(Hr),e))),Wr=Bt((e=>((0,x.rC)(e,{sourceType:x.LO,enumValueMappings:x.LO,hashCode:x.Fl}),Wt(e.enumeration),wr(e.id),e.sourceType&&Wt(e.sourceType),e.enumValueMappings.forEach(Yr),e))),Kr=Ht(((e,t)=>((0,x.rC)(e,{id:x.LO,stores:x.LO,propertyMappings:x.LO,hashCode:x.Fl}),Wt(e.association),wr(e.id),e.stores.forEach(Wt),e.propertyMappings.forEach((e=>Pr(e,t))),e))),Zr=Bt((e=>((0,x.rC)(e,{inputType:x.LO,data:x.LO,hashCode:x.Fl}),Wt(e.sourceClass),e))),Xr=Bt((e=>(0,x.rC)(e,{expectedOutput:x.LO,hashCode:x.Fl}))),qr=Ht(((e,t)=>((0,x.rC)(e,{name:x.LO,query:x.LO,inputData:x.LO,assert:x.LO,hashCode:x.Fl}),$s(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof Us)return Zr(e);if(e instanceof Ms)return li(e);if(e instanceof Vs)return sa(e);const s=t.plugins.flatMap((e=>e.getExtraMappingTestInputDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})(e,t))),((e,t)=>{e instanceof Ps&&Xr(e)})(e.assert),e))),Jr=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{includes:x.LO,classMappings:x.LO,enumerationMappings:x.LO,associationMappings:x.LO,test:x.LO,tests:x.LO,_elementHashCode:x.KG}),e.includes.forEach(Br),e.classMappings.forEach((e=>$r(e,t))),e.enumerationMappings.forEach(Wr),e.associationMappings.forEach((e=>Kr(e,t))),e.test.forEach((e=>qr(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof Ra?ar(e,t):e instanceof va?Ar(e,t):e}(e,t))),e))),Qr=e=>{(0,x.rC)(e,{store:x.LO}),Wt(e.store)},eo=Bt((e=>(Qr(e),(0,x.rC)(e,{hashCode:x.Fl}),e))),to=Bt((e=>(Qr(e),(0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),Wt(e.class),e))),so=Bt((e=>(Qr(e),(0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),Wt(e.class),e))),io=Bt((e=>(Qr(e),(0,x.rC)(e,{mappings:x.LO,hashCode:x.Fl}),e.mappings.forEach(Wt),e)));class no{observerContext;constructor(e){this.observerContext=e}visit_Connection(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraConnectionObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_ConnectionPointer(e){eo(e)}visit_ModelChainConnection(e){io(e)}visit_JsonModelConnection(e){to(e)}visit_XmlModelConnection(e){so(e)}visit_FlatDataConnection(e){ci(e)}visit_RelationalDatabaseConnection(e){Na(e,this.observerContext)}}const ao=(e,t)=>(e.accept_ConnectionVisitor(new no(t)),e),ro=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{connectionValue:x.LO,_elementHashCode:x.KG}),ao(e.connectionValue,t),e))),oo=Ht(((e,t)=>((0,x.rC)(e,{id:x.LO,connection:x.LO,hashCode:x.Fl}),ao(e.connection,t),e))),lo=Ht(((e,t)=>((0,x.rC)(e,{storeConnections:x.LO,hashCode:x.Fl}),Wt(e.store),e.storeConnections.forEach((e=>oo(e,t))),e))),co=Ht(((e,t)=>((0,x.rC)(e,{mappings:x.LO,connections:x.LO,hashCode:x.Fl}),e.mappings.forEach(Wt),e.connections.forEach((e=>lo(e,t))),e))),ho=Bt((e=>((0,x.rC)(e,{hashCode:x.Fl}),Wt(e.packageableRuntime),e))),uo=(e,t)=>e instanceof bs?ho(e):e instanceof Ls?co(e,t):e,po=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{runtimeValue:x.LO,_elementHashCode:x.KG}),co(e.runtimeValue,t),e)));class mo{observerContext;constructor(e){this.observerContext=e}visit_PackageableElement(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraElementObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_Package(e){go(e,this.observerContext)}visit_SectionIndex(e){Ao(e)}visit_PrimitiveType(e){}visit_Profile(e){yo(e)}visit_Enumeration(e){Ro(e)}visit_Measure(e){wo(e)}visit_Class(e){ko(e)}visit_Association(e){Fo(e)}visit_ConcreteFunctionDefinition(e){jo(e)}visit_FlatData(e){ii(e)}visit_Database(e){Kn(e,this.observerContext)}visit_Mapping(e){Jr(e,this.observerContext)}visit_Service(e){mr(e,this.observerContext)}visit_PackageableRuntime(e){po(e,this.observerContext)}visit_PackageableConnection(e){ro(e,this.observerContext)}visit_FileGenerationSpecification(e){xs(e)}visit_GenerationSpecification(e){As(e)}visit_DataElement(e){Ha(e,this.observerContext)}}const _o=Ht(((e,t)=>(e.accept_PackageableElementVisitor(new mo(t)),e))),go=Ht(((e,t)=>((e=>{Yt(e),(0,x.rC)(e,{children:x.LO,hashCode:x.KG})})(e),e.children.forEach((e=>{e instanceof us?go(e,t):_o(e,t)})),e))),Eo=Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),Wt(e.ownerReference),e))),fo=Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),e))),To=Bt((e=>((0,x.rC)(e,{value:x.LO,hashCode:x.Fl}),fo(e.tag),e))),Co=Bt((e=>(0,x.rC)(e,{rawType:x.LO}))),xo=Bt((e=>((0,x.rC)(e,{value:x.LO}),Co(e.value),Wt(e.ownerReference),e))),No=Bt((e=>((0,x.rC)(e,{parserName:x.LO,elements:x.LO}),e instanceof ms?(0,x.rC)(e,{imports:x.LO,hashCode:x.Fl}):e instanceof _s&&(0,x.rC)(e,{hashCode:x.Fl}),e))),Ao=Bt((e=>(Yt(e),(0,x.rC)(e,{sections:x.LO,_elementHashCode:x.KG}),e.sections.forEach(No),e))),Oo=Bt((e=>(0,x.rC)(e,{value:x.LO}))),So=Bt((e=>(0,x.rC)(e,{value:x.LO}))),yo=Bt((e=>(Yt(e),(0,x.rC)(e,{p_stereotypes:x.LO,p_tags:x.LO,_elementHashCode:x.KG}),e.p_stereotypes.forEach(Oo),e.p_tags.forEach(So),e))),Io=Bt((e=>((0,x.rC)(e,{name:x.LO,stereotypes:x.LO,taggedValues:x.LO,hashCode:x.Fl}),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),vo=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),Ro=Bt((e=>(Yt(e),(0,x.rC)(e,{values:x.LO,stereotypes:x.LO,taggedValues:x.LO,_elementHashCode:x.KG}),e.values.forEach(Io),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),Po=Bt((e=>((0,x.rC)(e,{measure:x.LO,conversionFunction:x.LO,hashCode:x.Fl}),e.conversionFunction&&$s(e.conversionFunction),e))),wo=Bt((e=>(Yt(e),(0,x.rC)(e,{canonicalUnit:x.LO,nonCanonicalUnits:x.LO,_elementHashCode:x.KG}),e.canonicalUnit&&Po(e.canonicalUnit),e.nonCanonicalUnits.forEach(Po),e))),Lo=Bt((e=>((0,x.rC)(e,{name:x.LO,multiplicity:x.LO,stereotypes:x.LO,taggedValues:x.LO,hashCode:x.Fl}),xo(e.genericType),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),bo=Bt((e=>((0,x.rC)(e,{name:x.LO,multiplicity:x.LO,stereotypes:x.LO,taggedValues:x.LO,body:x.LO.ref,parameters:x.LO.ref,hashCode:x.Fl}),xo(e.genericType),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),Do=Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),Wt(e.ownerReference),e))),Mo=Bt((e=>((0,x.rC)(e,{name:x.LO,functionDefinition:x.LO,externalId:x.LO,enforcementLevel:x.LO,messageFunction:x.LO,hashCode:x.Fl}),$s(e.functionDefinition),e.messageFunction&&$s(e.messageFunction),e))),ko=Bt((e=>(Yt(e),(0,x.rC)(e,{_subclasses:x.LO,properties:x.LO,propertiesFromAssociations:x.LO,derivedProperties:x.LO,generalizations:x.LO,constraints:x.LO,stereotypes:x.LO,taggedValues:x.LO,dispose:x.KG,_elementHashCode:x.KG}),e.properties.forEach(Lo),e.propertiesFromAssociations.forEach(Lo),e.derivedProperties.forEach(bo),e.generalizations.forEach(xo),e.constraints.forEach(Mo),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),Fo=Bt((e=>(Yt(e),(0,x.rC)(e,{properties:x.LO,stereotypes:x.LO,taggedValues:x.LO,derivedProperties:x.LO,_elementHashCode:x.KG}),e.properties.forEach(Lo),e.derivedProperties.forEach(bo),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),jo=Bt((e=>(Yt(e),(0,x.rC)(e,{functionName:x.LO,returnMultiplicity:x.LO,parameters:x.LO.shallow,expressionSequence:x.LO.ref,stereotypes:x.LO,taggedValues:x.LO,_elementHashCode:x.KG}),e.parameters.forEach(zs),Wt(e.returnType),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),Uo=Bt((e=>e instanceof cs?Ro(e):e instanceof ds?Po(e):e instanceof os?ko(e):e instanceof hs?wo(e):e)),Vo=(Bt((e=>e instanceof cs?Ro(e):e instanceof ds?Po(e):e)),Bt((e=>(0,x.rC)(e,{_dummyObservable:x.LO})))),Go=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),$o=Bt((e=>(Vo(e),(0,x.rC)(e,{id:x.LO,hideProperties:x.LO,hideTaggedValues:x.LO,hideStereotypes:x.LO,hashCode:x.Fl}),Wt(e.class),e))),zo=Bt((e=>(Go(e.classView),e))),Bo=Bt((e=>((0,x.rC)(e,{path:x.LO,pathForSerialization:x.Fl}),zo(e.from),zo(e.to),e))),Ho=Bt((e=>(Bo(e),(0,x.rC)(e,{hashCode:x.Fl}),e))),Yo=Bt((e=>(Bo(e),(0,x.rC)(e,{hashCode:x.Fl}),Do(e.property),Wt(e.association),e))),Wo=Bt((e=>(Bo(e),(0,x.rC)(e,{hashCode:x.Fl}),Do(e.property),e))),Ko=Bt((e=>(Yt(e),(0,x.rC)(e,{classViews:x.LO,associationViews:x.LO,generalizationViews:x.LO,propertyViews:x.LO,_elementHashCode:x.KG}),e.classViews.forEach($o),e.associationViews.forEach(Yo),e.generalizationViews.forEach(Ho),e.propertyViews.forEach(Wo),e)));var Zo;!function(e){e.DIAGRAM="DIAGRAM",e.CLASS_VIEW="CLASS_VIEW",e.PROPERTY_VIEW="PROPERTY_VIEW",e.ASSOCIATION_VIEW="ASSOCIATION_VIEW",e.PROPERTY_HOLDER_VIEW="PROPERTY_HOLDER_VIEW",e.GENERALIZATION_VIEW="GENERALIZATION_VIEW",e.RELATIONSHIP_VIEW="RELATIONSHIP_VIEW",e.POINT="POINT",e.RECTANGLE="RECTANGLE",e.POSITIONED_RECTANGLE="POSITIONED_RECTANGLE"}(Zo=Zo||(Zo={}));class Xo extends as{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return qt([Zo.DIAGRAM,this.path,qt(this.classViews),qt(this.generalizationViews),qt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const qo="Diagram";class Jo extends zt{constructor(){super($t.Rw.LW,$t.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[qo]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Xo)return qo}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Xo)return Ko(e)}]}}class Qo{package;name;get path(){return`${this.package}${Ee}${this.name}`}get hashCode(){return qt([Jt.PACKAGEABLE_ELEMENT,this.path])}}class el extends Qo{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return qt([Zo.DIAGRAM,this.path,qt(this.classViews),qt(this.generalizationViews),qt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class tl{rectangle;position;get hashCode(){return qt([Zo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class sl extends tl{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return qt([Zo.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class il{x;y;get hashCode(){return qt([Zo.POINT,this.x.toString(),this.y.toString()])}}class nl{width;height;get hashCode(){return qt([Zo.RECTANGLE,this.width.toString(),this.height.toString()])}}class al{points=[]}class rl{sourceView;targetView;line;get hashCode(){return qt([Zo.RELATIONSHIP_VIEW,this.sourceView,this.targetView,qt(this.line.points)])}}class ol extends rl{property;get hashCode(){return qt([Zo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class ll extends ol{get hashCode(){return qt([Zo.PROPERTY_VIEW,super.hashCode])}}class cl extends rl{get hashCode(){return qt([Zo.GENERALIZATION_VIEW,super.hashCode])}}class dl{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return qt([Jt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new dl(0,0);static ZERO_ONE=new dl(0,1);static ZERO_MANY=new dl(0,void 0);static ONE=new dl(1,1);static ONE_MANY=new dl(1,void 0)}new He((0,Be.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)()})),(0,Be.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return qt([Jt.PACKAGEABLE_ELEMENT_POINTER,this.type,this.path])}},{path:(0,Be.Ru)(),type:(0,Be.Ru)()});const hl=(0,Be.yu)(dl,{lowerBound:(0,Be.Ru)(),upperBound:(0,Be.jt)((0,Be.Ru)())});class ul{class;property;get hashCode(){return qt([Jt.PROPERTY_POINTER,this.property,this.class??""])}}class pl{}class ml{queryTimeOutInSeconds=null;enableConstraints=!0}var _l,gl;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(_l||(_l={})),function(e){e.LAMBDA="lambda",e.VARIABLE="var",e.CINTEGER="integer",e.CDECIMAL="decimal",e.CSTRING="string",e.CBOOLEAN="boolean",e.CFLOAT="float",e.CDATETIME="dateTime",e.CSTRICTDATE="strictDate",e.CSTRICTTIME="strictTime",e.CLATESTDATE="latestDate"}(gl=gl||(gl={})),(0,Be.yu)(class extends ml{},{_type:Ze(_l.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,Be.Ru)(),enableConstraints:(0,Be.Ru)()});const El=(0,Be.yu)(class extends pl{body;parameters;get hashCode(){return qt([Jt.RAW_LAMBDA,ts(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:Ze(gl.LAMBDA),body:(0,Be.LZ)(),parameters:(0,Be.LZ)()}),fl=(0,Be.yu)(class extends pl{class;name;multiplicity;get hashCode(){return qt([Jt.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:Ze(gl.VARIABLE),class:(0,Be.Ru)(),multiplicity:Ye(hl),name:(0,Be.Ru)()});(0,Be.yu)(class extends pl{multiplicity=dl.ONE;type;value;get hashCode(){return qt([Jt.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,Be.bm)("_type",(0,Be.PG)((e=>{switch(e){case xe.INTEGER:return gl.CINTEGER;case xe.DECIMAL:return gl.CDECIMAL;case xe.STRING:return gl.CSTRING;case xe.BOOLEAN:return gl.CBOOLEAN;case xe.FLOAT:return gl.CFLOAT;case xe.DATETIME:return gl.CDATETIME;case xe.STRICTDATE:return gl.CSTRICTDATE;case xe.STRICTTIME:return gl.CSTRICTTIME;case xe.LATESTDATE:return gl.CLATESTDATE;default:throw new U(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case gl.CINTEGER:return xe.INTEGER;case gl.CDECIMAL:return xe.DECIMAL;case gl.CSTRING:return xe.STRING;case gl.CBOOLEAN:return xe.BOOLEAN;case gl.CFLOAT:return xe.FLOAT;case gl.CDATETIME:return xe.DATETIME;case gl.CSTRICTDATE:return xe.STRICTDATE;case gl.CSTRICTTIME:return xe.STRICTTIME;case gl.CLATESTDATE:return xe.LATESTDATE;default:throw new U(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,Be.jt)((0,Be.Ru)())});const Tl=(0,Be.yu)(ul,{class:(0,Be.jt)((0,Be.Ru)()),property:(0,Be.Ru)()}),Cl=(0,Be.yu)(class{profile;value;get hashCode(){return qt([Jt.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,Be.Ru)(),value:(0,Be.Ru)()}),xl=(0,Be.yu)(class{profile;value;get hashCode(){return qt([Jt.TAG_POINTER,this.value,this.profile])}},{profile:(0,Be.Ru)(),value:(0,Be.Ru)()}),Nl=(0,Be.yu)(class{tag;value;get hashCode(){return qt([Jt.TAGGED_VALUE,this.tag,this.value])}},{tag:Ye(xl),value:(0,Be.Ru)()}),Al=((0,Be.yu)(class extends Qo{stereotypes=[];tags=[];get hashCode(){return qt([Jt.PROFILE,this.path,qt(this.stereotypes),qt(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:Ze("profile"),name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ru)()),tags:(0,Be.pb)((0,Be.Ru)())}),(0,Be.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return qt([Jt.ENUM_VALUE,this.value,qt(this.stereotypes),qt(this.taggedValues)])}},{stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1}))),value:(0,Be.Ru)()})),Ol=((0,Be.yu)(class extends Qo{values=[];stereotypes=[];taggedValues=[];get hashCode(){return qt([Jt.ENUMERATION,this.path,qt(this.values),qt(this.stereotypes),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:Ze("Enumeration"),name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1}))),values:(0,Be.pb)(Ye(Al))}),(0,Be.yu)(class extends Qo{measure;conversionFunction;get hashCode(){return qt([Jt.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new U}},{_type:Ze("unit"),conversionFunction:(0,Be.jt)(Ye(El)),measure:(0,Be.Ru)(),name:(0,Be.Ru)(),package:(0,Be.Ru)()})),Sl=((0,Be.yu)(class extends Qo{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return qt([Jt.MEASURE,this.path,this.canonicalUnit??"",qt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:Ze("measure"),canonicalUnit:(0,Be.jt)(Ye(Ol)),name:(0,Be.Ru)(),nonCanonicalUnits:(0,Be.pb)(Ye(Ol)),package:(0,Be.Ru)()}),(0,Be.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return qt([Jt.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",qt(this.stereotypes),qt(this.taggedValues)])}},{aggregation:(0,Be.jt)((0,Be.Ru)()),multiplicity:Ye(hl),name:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1}))),type:(0,Be.Ru)()})),yl=(0,Be.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return qt([Jt.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,qt(this.stereotypes),qt(this.taggedValues),ts(this.parameters,this.body)])}},{body:(0,Be.LZ)(),name:(0,Be.Ru)(),parameters:(0,Be.LZ)(),returnMultiplicity:Ye(hl),returnType:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1})))}),Il=(0,Be.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return qt([Jt.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,Be.jt)((0,Be.Ru)()),externalId:(0,Be.jt)((0,Be.Ru)()),functionDefinition:Ye(El),messageFunction:(0,Be.jt)(Ye(El)),name:(0,Be.Ru)()}),vl=((0,Be.yu)(class extends Qo{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return qt([Jt.CLASS,this.path,qt(this.properties),qt(this.derivedProperties),qt(this.superTypes),qt(this.constraints),qt(this.stereotypes),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:Ze("class"),constraints:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Il,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Il,e)),{skipIfEmpty:!1}))),name:(0,Be.Ru)(),originalMilestonedProperties:(0,Be.PG)((e=>Ke(e,(e=>Be.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>Be.AM),{skipIfEmpty:!1}))),package:(0,Be.Ru)(),properties:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Sl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Sl,e)),{skipIfEmpty:!1}))),derivedProperties:(0,Be.bm)("qualifiedProperties",(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(yl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(yl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),superTypes:(0,Be.PG)((e=>Ke(e,(e=>e),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>e),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1})))}),(0,Be.yu)(class extends Qo{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return qt([Jt.ASSOCIATION,this.path,qt(this.properties),qt(this.derivedProperties),qt(this.stereotypes),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:Ze("association"),name:(0,Be.Ru)(),originalMilestonedProperties:(0,Be.PG)((e=>Ke(e,(e=>Be.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>Be.AM),{skipIfEmpty:!1}))),package:(0,Be.Ru)(),properties:(0,Be.pb)(Ye(Sl)),derivedProperties:(0,Be.bm)("qualifiedProperties",(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(yl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(yl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1})))}),(0,Be.yu)(class extends Qo{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return qt([Jt.FUNCTION,this.path,qt(this.parameters),this.returnType,qt(this.taggedValues),qt(this.stereotypes),ts(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:Ze("function"),body:(0,Be.pb)((0,Be.LZ)()),name:(0,Be.Ru)(),package:(0,Be.Ru)(),parameters:(0,Be.pb)(Ye(fl)),postConstraints:(0,Be.pb)((0,Be.Ru)()),preConstraints:(0,Be.pb)((0,Be.Ru)()),returnMultiplicity:Ye(hl),returnType:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1})))}),"diagram"),Rl=(0,Be.yu)(il,{x:(0,Be.Ru)(),y:(0,Be.Ru)()}),Pl=(0,Be.yu)(nl,{height:(0,Be.Ru)(),width:(0,Be.Ru)()}),wl=(0,Be.yu)(al,{points:(0,Be.pb)(Ye(Rl))}),Ll=(0,Be.yu)(sl,{class:(0,Be.Ru)(),hideProperties:(0,Be.jt)((0,Be.Ru)()),hideStereotypes:(0,Be.jt)((0,Be.Ru)()),hideTaggedValues:(0,Be.jt)((0,Be.Ru)()),id:(0,Be.Ru)(),position:Ye(Rl),rectangle:Ye(Pl)}),bl=(0,Be.yu)(ll,{line:Ye(wl),property:Ye(Tl),sourceView:(0,Be.Ru)(),targetView:(0,Be.Ru)()}),Dl=(0,Be.yu)(cl,{line:Ye(wl),sourceView:(0,Be.Ru)(),targetView:(0,Be.Ru)()}),Ml=(0,Be.yu)(el,{_type:Ze(vl),classViews:(0,Be.pb)(Ye(Ll)),generalizationViews:(0,Be.pb)(Ye(Dl)),name:(0,Be.Ru)(),package:(0,Be.Ru)(),propertyViews:(0,Be.pb)(Ye(bl))});class kl extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var Fl=s(95903);const jl=e=>H((0,Fl.Z)(e.split(Ee))),Ul=e=>{const t=e.lastIndexOf(Ee);return-1===t?void 0:e.substring(0,t)},Vl=(e,t)=>{const s=e.lastIndexOf(Ee);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+Ee.length,e.length)]},Gl=(e,t)=>`${e?`${e}${Ee}`:""}${t}`,$l=(e,t)=>{e.children.push(t),t.package=e},zl=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Bl=(e,t,s,i)=>{const n=t.indexOf(Ee),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof us&&e.name===a)),!r){if(!s)throw new $(`Can't find child package '${a}' in package '${e.path}'`);q(!Te.includes(a),`Can't create package with reserved name '${a}'`),r=new us(a),r.package=e,e.children.push(r)}return i&&i.set(Gl(e.path,a),r),-1!==n?Bl(r,t.substring(n+Ee.length),s,i):r},Hl=(e,t,s,i)=>{if(i){const n=i.get(Gl(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=Gl(e.path,a),r=i.get(n);if(r)return Bl(r,t.substring(a.length+Ee.length,t.length),s,i);const o=a.lastIndexOf(Ee);a=-1!==o?a.substring(0,o):""}}return Bl(e,t,s,i)},Yl=(e,t,s)=>(Z(t,"Package path is required"),Hl(e.root,t,!0,s)),Wl=(e,t)=>K(e.rawType,t),Kl=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Wl(e.value,os);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},Zl=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Xl=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,ql=(e,t)=>`${H(e,"Package path is required")}${Ee}${H(t,"Name is required")}`;class Jl{elementClassName;_class;prerequisites=[];firstPass;secondPass;thirdPass;fourthPass;fifthPass;constructor(e){this.elementClassName=e.elementClassName,this._class=e._class,this.prerequisites=e.prerequisites??[],this.firstPass=e.firstPass,this.secondPass=e.secondPass,this.thirdPass=e.thirdPass,this.fourthPass=e.fourthPass,this.fifthPass=e.fifthPass}getElementProtocolClass(){return this._class}getPrerequisiteElementProtocolClasses(){return this.prerequisites}runFirstPass(e,t,s,i){Z(e.package,"Element 'package' field is missing or empty"),Z(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new $(`Element '${e}' already exists`);s.add(e)}else q(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(ql(e.package,e.name),t,i);const n=this.firstPass(e,t);return $l(Yl(t.currentSubGraph,e.package,s),n),n}runSecondPass(e,t){this.secondPass?.(e,t)}runThirdPass(e,t){this.thirdPass?.(e,t)}runFourthPass(e,t){this.fourthPass?.(e,t)}runFifthPass(e,t){this.fifthPass?.(e,t)}}const Ql=e=>e.classView.value.id,ec=e=>{const t=new ll,s=new al;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new ul;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=Ql(e.from),t.targetView=Ql(e.to),t},tc=e=>{const t=new cl,s=new al;return s.points=e.pathForSerialization,t.line=s,t.sourceView=Ql(e.from),t.targetView=Ql(e.to),t},sc=e=>{const t=new sl;return t.class=e.class.valueForSerialization??"",t.hideProperties=e.hideProperties,t.hideStereotypes=e.hideStereotypes,t.hideTaggedValues=e.hideTaggedValues,t.id=e.id,t.position=((e,t)=>{const s=new il;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new nl;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class ic{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return qt([Zo.POINT,this.x.toString(),this.y.toString()])}}class nc{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return qt([Zo.RECTANGLE,this.width.toString(),this.height.toString()])}}class ac{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new ic(this.position.x+this.rectangle.width/2,this.position.y+this.rectangle.height/2);contains(e,t){const s=this.normalizeBox(this);return e>s.position.x&&e<s.position.x+s.rectangle.width&&t>s.position.y&&t<s.position.y+s.rectangle.height}normalizeBox(e){let t=e;return e.rectangle.width<0&&(t=new ac(new ic(e.position.x+e.rectangle.width,e.position.y),new nc(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new ac(new ic(e.position.x,e.position.y+e.rectangle.height),new nc(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,qt([Zo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class rc extends ac{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new ic(0,0),new nc(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return qt([Zo.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class oc{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class lc extends Es{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class cc extends lc{ownerReference;constructor(e){const t=Ts.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new cc(e)}}class dc{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new oc(cc.create(t)),this.to=new oc(cc.create(s))}computeEdgeEndpoint(e,t=!0){const s=e.classView.value,i=e.classView.value.center(),n=i.x+(e._offsetX??0),a=i.y+(e._offsetY??0);return s.contains(n,a)?new ic(n,a):(t&&(e._offsetX=0,e._offsetY=0),new ic(i.x,i.y))}buildFullPath(e=!0){return[this.computeEdgeEndpoint(this.from,e),...this.path,this.computeEdgeEndpoint(this.to,e)]}static pruneUnnecessaryInsidePoints=(e,t,s)=>{if(!e.length)return[];let i=0,n=e[i];for(;i<e.length-1&&t.contains(n.x,n.y);)i++,n=e[i];let a=e.length-1,r=e[a];for(;a>0&&s.contains(r.x,r.y);)a--,r=e[a];return e.slice(i-1,a+2)};get pathForSerialization(){return dc.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return qt([Zo.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,qt(this.pathForSerialization)])}}class hc extends dc{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return qt([Zo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class uc extends hc{get hashCode(){return qt([Zo.PROPERTY_VIEW,super.hashCode])}}class pc extends dc{get hashCode(){return qt([Zo.GENERALIZATION_VIEW,super.hashCode])}}class mc{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new mc(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new mc(this.x/e,this.y/e)}normal(e){return new mc(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const _c=(e,t)=>e.classViews.find((e=>e.id===t)),gc=(e,t)=>{e.path=t},Ec=e=>{const t=e.buildFullPath(),s=dc.pruneUnnecessaryInsidePoints(t,e.from.classView.value,e.to.classView.value);if(s[0]!==t[0]){const t=e.from.classView.value.center();e.from._offsetX=s[0].x-t.x,e.from._offsetY=s[0].y-t.y}if(s[s.length-1]!==t[t.length-1]){const t=e.to.classView.value.center();e.to._offsetX=s[s.length-1].x-t.x,e.to._offsetY=s[s.length-1].y-t.y}const i=[];for(let e=0;e<s.length-2;e++){const t=mc.fromPoints(s[e+1],s[e]).unit(),n=mc.fromPoints(s[e+1],s[e+2]).unit(),a=t.dotProduct(n),r=180*Math.acos(a)/Math.PI;Math.abs(r-180)>5&&i.push(s[e+1])}gc(e,i)},fc=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),Tc=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),Cc=e=>new ic(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),xc=e=>{const t=Cc(e);return new ac(new ic(t.x-5,t.y-5),new nc(10,10))},Nc=(e,t)=>(t=e.normalizeBox(t),e.contains(t.position.x,t.position.y)||e.contains(t.position.x+t.rectangle.width,t.position.y)||e.contains(t.position.x,t.position.y+t.rectangle.height)||e.contains(t.position.x+t.rectangle.width,t.position.y+t.rectangle.height)),Ac=e=>{const t=H(e.x,"Point 'x' coordinate is missing"),s=H(e.y,"Point 'y' coordinate is missing");return new ic(t,s)};class Oc extends kl{constructor(){super($t.Rw.zE,$t.i8)}V1_getExtraElementBuilders(){return[new Jl({elementClassName:"Diagram",_class:el,firstPass:(e,t)=>{W(e,el);const s=new Xo(e.name),i=ql(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Xo),s},secondPass:(e,t)=>{W(e,el);const s=(i=ql(e.package,e.name),n=t.currentSubGraph,H(n.getOwnNullableExtensionElement(i,Xo),`Can't find diagram '${i}'`));var i,n;s.classViews=e.classViews.map((e=>((e,t,s)=>{Z(e.class,"Class view 'class' field is missing or empty"),Z(e.id,"Class view 'id' field is missing or empty"),B(e.rectangle,"Class view 'rectangle' field is missing"),B(e.position,"Class view 'position' field is missing");const i=new rc(s,e.id,t.resolveClass(e.class));return i.hideProperties=e.hideProperties,i.hideTaggedValues=e.hideTaggedValues,i.hideStereotypes=e.hideStereotypes,i.rectangle=(e=>{const t=H(e.width,"Rectangle 'width' is missing"),s=H(e.height,"Rectangle 'height' is missing");return new nc(t,s)})(e.rectangle),i.position=Ac(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{B(e.property,"Property view 'property' field is missing"),B(e.line,"Property view 'line' field is missing");const i=H(_c(s,H(e.sourceView)),"Property view 'sourceView' field is missing"),n=H(_c(s,H(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new uc(s,a,i,n);return r.path=e.line.points.map((e=>Ac(e))),Ec(r),r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t)=>{B(e.line,"Generalization view 'line' field is missing");const s=H(_c(t,H(e.sourceView)),"Generalization view 'sourceView' field is missing"),i=H(_c(t,H(e.targetView)),"Generalization view 'targetView' field is missing"),n=new pc(t,s,i);return n.path=e.line.points.map((e=>Ac(e))),Ec(n),n})(e,s)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof el)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof el)return(0,Be.qC)(Ml,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===vl)return(0,Be.vB)(Ml,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Xo)return(e=>{const t=new el;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(sc),t.generalizationViews=e.generalizationViews.map(tc),t.propertyViews=e.propertyViews.map(ec),t})(e)}]}}class Sc extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class yc extends Sc{constructor(){super($t.Rw.f1,$t.i8)}getExtraPureGraphExtensionClasses(){return[Xo]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Xo).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof os?Zl(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>M(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>M(e.classViews,t))),e.generalizationViews.filter((e=>{const s=e.from.classView.value.class.value,i=e.to.classView.value.class.value;return!t.getNullableClass(s.path)||!t.getNullableClass(i.path)||0===s.generalizations.filter((e=>e.value.rawType===i)).length})).forEach((t=>M(e.generalizationViews,t)))})(t,e)))}]}}class Ic extends c{constructor(){super($t.Rw.NA,$t.i8,[new yc,new Jo,new Oc])}}var vc=s(4707),Rc=s(3493),Pc=s(82127);const wc=(0,vc.Z)({transitions:{create:()=>"none"}}),Lc=e=>{const{children:t}=e;return(0,T.jsx)(Rc.Z,{injectFirst:!0,children:(0,T.jsx)(Pc.Z,{theme:wc,children:t})})};var bc=s(83820),Dc=s(96242),Mc=s(12238),kc=s(78683),Fc=s(81934),jc=s(6277);const Uc=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,T.jsx)("div",{className:(0,jc.clsx)(t,i),children:s})};return s.displayName=e,s},Vc=e=>{const{children:t,darkMode:s,className:i}=e;return(0,T.jsx)("div",{className:(0,jc.clsx)("modal",{"modal--dark":s},i),children:t})},Gc=e=>{const{title:t,icon:s,className:i}=e;return(0,T.jsxs)("div",{className:(0,jc.clsx)("modal__title",i),children:[s&&(0,T.jsx)("div",{className:"modal__title__icon",children:s}),(0,T.jsx)("div",{className:"modal__title__label",children:(n=t,(n??"").trim().replace(/\b(?:\w+)\b/gu,(e=>Is.includes(e.toLowerCase())?e.toLowerCase():ys(e))).replace(/^(?:\w+)\b/u,(e=>ys(e))).replace(/\b(?:\w+)$/u,(e=>ys(e))))})]});var n},$c=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,T.jsx)("div",{className:(0,jc.clsx)("modal__header",i),children:(0,T.jsx)(Gc,{title:t})}):(0,T.jsx)("div",{className:(0,jc.clsx)("modal__header",i),children:s})},zc=(Uc("ModalHeaderActions","modal__header__actions"),Uc("ModalBody","modal__body")),Bc=Uc("ModalFooter","modal__footer"),Hc=e=>{switch(e){case Pt.PROCEED_WITH_CAUTION:return"btn--caution";case Pt.PROCEED:case Pt.STANDARD:default:return"btn--dark"}},Yc=(0,nt.Pi)((e=>{const{info:t}=e,s=Ft(),{title:i,message:n,prompt:a,type:r,onClose:o,onEnter:l,actions:c}=t,d=()=>{o?.(),s.setActionAlertInfo(void 0)};return(0,T.jsx)(Fc.Z,{open:Boolean(s.actionAlertInfo),onClose:R,TransitionProps:{onEnter:()=>l?.()},children:(0,T.jsxs)("form",{onSubmit:e=>{e.preventDefault(),c.find((e=>e.default))?.handler?.(),d()},className:`modal search-modal modal--dark blocking-alert blocking-alert--${(r??Rt.STANDARD).toLowerCase()}`,children:[i&&(0,T.jsx)($c,{title:i}),(0,T.jsxs)(zc,{children:[(0,T.jsx)("div",{className:"blocking-alert__summary-text",children:n}),(0,T.jsx)("div",{className:"blocking-alert__prompt-text",children:a})]}),(0,T.jsxs)(Bc,{children:[c.map((e=>(0,T.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${Hc(e.type??Pt.STANDARD)}`,onClick:t=>{t.preventDefault(),e.handler?.(),d()},autoFocus:Boolean(e.default),children:e.label},e.label))),!c.length&&(0,T.jsx)("button",{type:"button",className:"btn btn--dark blocking-alert__action--standard",onClick:d,children:"Cancel"})]})]})})})),Wc=(0,nt.Pi)((()=>{const e=Ft().actionAlertInfo;return e?(0,T.jsx)(Yc,{info:e}):null})),Kc=e=>{const{isLoading:t}=e,s=(0,at.useRef)(null);return(0,at.useEffect)((()=>{s.current&&(t?s.current.parentElement?.classList.add("panel-loading-indicator__container"):s.current.parentElement?.classList.remove("panel-loading-indicator__container"))}),[t]),(0,T.jsx)("div",{ref:s,className:"panel-loading-indicator"+(t?"":"--disabled")})},Zc=(0,nt.Pi)((()=>{const e=Ft().blockingAlertInfo;return e?(0,T.jsx)(Fc.Z,{open:Boolean(e),onClose:R,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,T.jsxs)(Vc,{darkMode:!0,className:"blocking-alert",children:[(0,T.jsx)(Kc,{isLoading:Boolean(e.showLoading)}),(0,T.jsxs)(zc,{children:[(0,T.jsx)("div",{className:"blocking-alert__message",children:e.message}),e.prompt&&(0,T.jsx)("div",{className:"blocking-alert__message__prompt",children:e.prompt})]})]})}):null}));var Xc=s(12889),qc=s(9415),Jc=s(53083);const Qc=(0,nt.Pi)((()=>{const e=Ft(),t=e.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??Lt.INFO,[a,r]=(0,at.useState)(!1);let o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,T.jsx)(Xc.uMt,{})});switch(n){case Lt.ILEGAL_STATE:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Xc.nnZ,{})});break;case Lt.ERROR:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Xc.xDH,{})});break;case Lt.WARNING:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,T.jsx)(Xc.LPM,{})});break;case Lt.SUCCESS:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,T.jsx)(Xc.rE2,{})})}const l=()=>{e.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.copyTextToClipboard(i)));return(0,T.jsx)(qc.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:e.notification?e.notification.autoHideDuration??null:wt,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,T.jsx)(Jc.Z,{classes:{root:"notification__content",message:"notification__message",action:"notification__actions"},message:(0,T.jsxs)("div",{className:"notification__message__content",children:[o,(0,T.jsx)("div",{className:(0,jc.clsx)("notification__message__content__text",{"notification__message__content__text--expanded":a}),onClick:c,title:"Click to Copy",children:i})]}),action:[(0,T.jsx)("button",{className:"notification__action",id:"expand_button",onClick:()=>r(!a),tabIndex:-1,title:a?"Collapse":"Expand",children:a?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.g8U,{})},"expand"),(0,T.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,T.jsx)(Xc.q1B,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var ed;!function(e){e.TAB="Tab",e.CAPSLOCK="CapsLock",e.SHIFT="Shift",e.META="Meta",e.ALT="Alt",e.CONTROL="Control",e.SPACE="Space",e.ESC="Escape",e.LEFT="ArrowLeft",e.RIGHT="ArrowRight",e.UP="ArrowUp",e.DOWN="ArrowDown",e.ENTER="Enter",e.DELETE="Delete",e.BACKSPACE="Backspace"}(ed=ed||(ed={}));var td=s(17954);const sd=e=>{const{children:t,classes:s,...i}=e;return(0,T.jsx)(td.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},id=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,at.useRef)(null),[c,d]=(0,at.useState)(!1),[h,u]=(0,at.useState)(),[p,m]=(0,at.useState)(0),[_,g]=(0,at.useState)(0),E=()=>{u(void 0),d(!1),g(0),m(0)},f=e=>{e.stopPropagation(),e.preventDefault(),E(),r?.()},C=e=>{if(e.stopPropagation(),e.preventDefault(),!a&&(o?.(),l.current)){const t=l.current.getBoundingClientRect(),s=t.left+(window.scrollX||document.documentElement.scrollLeft),i=t.top+(window.scrollY||document.documentElement.scrollTop),{clientX:n,clientY:a,target:o}=e,c=o;if(h!==c&&!(document.elementsFromPoint(n,a).some((e=>e===c))&&s<=n&&n<=s+t.width&&i<=a&&a<=i+t.height))return E(),void r?.();u(c),d(!0),g(a),m(n)}};return(0,T.jsxs)("div",{ref:l,className:t,onContextMenu:C,children:[s,(0,T.jsx)(sd,{open:c,anchorPosition:{left:p,top:_},onClose:f,anchorReference:"anchorPosition",BackdropProps:{invisible:!0,onContextMenu:C},disableRestoreFocus:!0,transitionDuration:0,onClick:f,...i,children:n},`${p}, ${_}`)]})},nd=(0,at.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,T.jsx)("div",{ref:t,className:(0,jc.clsx)("menu",s),...n,children:i})})),ad=e=>{const{className:t,onClick:s,disabled:i,children:n,...a}=e;return(0,T.jsx)("button",{className:(0,jc.clsx)("menu__item",t),disabled:Boolean(i),onClick:s,...a,children:n})},rd=Uc("MenuContentDivider","menu__divider");Uc("MenuContentItemIcon","menu__item__icon"),Uc("MenuContentItemLabel","menu__item__label");var od=s(68824),ld=s(71215);const cd=e=>(0,T.jsx)(od.D,{className:(0,jc.clsx)("markdown-content",e.className),remarkPlugins:[ld.Z],children:e.value.value});var dd=s(62515);const hd=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,dd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,at.useState)(!1),{ref:o,width:l,height:c}=(0,dd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,at.useEffect)((()=>{r((l??0)>(i??0)+40&&(c??0)>(n??0)+40)}),[l,c,i,n]),(0,T.jsx)("div",{ref:o,className:"panel__content__blank",children:(0,T.jsx)("div",{ref:s,className:(0,jc.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var ud=s(33207);const pd=e=>{const{children:t,...s}=e;return(0,T.jsx)(ud.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var md=s(13474),_d=s(65068),gd=s(41327),Ed=s(85688),fd=s(28019),Td=s(78785);const Cd=e=>{const{children:t,options:s,size:i,className:n,...a}=e,r=((e,t)=>{const s=[];for(let i=0;i<e.length;i+=t)s.push(e.slice(i,i+t));return s})(s,i);return(0,T.jsxs)("div",{className:(0,jc.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,T.jsx)("div",{children:(0,T.jsx)(Ed.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,T.jsx)(fd.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,T.jsx)(Td.Z,{className:"mui-radio-group__group__item__radio-btn"}),label:(0,T.jsx)("div",{className:"mui-radio-group__group__item__label",children:e})},e)))})},t))),t]})};var xd;!function(e){e.TUTORIAL_QUERY_BUILDER="tutorial.query.builder",e.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX="question.how-to-use-advanced-search-syntax",e.QUESTION_WHEN_TO_CONFIGURE_PLATFORM_VERSIONS="question.when-to-configure-project-platform-dependencies-versions",e.QUESTION_HOW_TO_WRITE_A_SERVICE_TEST="question.how-to-write-a-service-test",e.QUESTION_HOW_TO_ADD_PARAMETERS_TO_QUERY="question.how-to-add-parameters-to-query",e.QUESTION_HOW_TO_ADD_CONSTANTS_TO_QUERY="question.how-to-add-constants-to-query",e.QUESTION_HOW_TO_WRITE_SERVICE_CONNECTION_TEST_DATA="question.how-to-write-service-connection-test-data",e.QUESTION_HOW_TO_CREATE_A_DATA_ELEMENT="question.how-to-create-a-data-element"}(xd=xd||(xd={}));const Nd=(0,nt.Pi)((e=>{const{configState:t}=e,s=Ft();return(0,T.jsxs)("div",{className:"text-search-advanced-config__panel",children:[(0,T.jsxs)("div",{className:"text-search-advanced-config__panel__header__label",children:["search config",(0,T.jsx)("button",{className:"text-search-advanced-config__panel__header__hint",tabIndex:-1,onClick:()=>s.assistantService.openDocumentationEntry(xd.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,T.jsx)(Xc.uMt,{})})]}),(0,T.jsx)("div",{children:(0,T.jsx)(Cd,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[_t.STANDARD,_t.INCLUDE,_t.EXACT,_t.INVERSE],size:1})})]})})),Ad=(0,nt.Pi)((e=>{const{entry:t}=e,s=Ft(),i=()=>{t.isOpen||St.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.copyTextToClipboard(t.documentationKey)));return(0,T.jsx)(id,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsx)(nd,{children:(0,T.jsx)(ad,{onClick:n,children:"Copy Documentation Key"})}),children:(0,T.jsxs)("div",{className:"virtual-assistant__doc-entry",children:[(0,T.jsxs)("div",{className:"virtual-assistant__doc-entry__header",children:[(0,T.jsx)("button",{className:(0,jc.clsx)("virtual-assistant__doc-entry__expand-icon",{"virtual-assistant__doc-entry__expand-icon--disabled":!t.content}),disabled:!t.content,tabIndex:-1,onClick:i,children:t.isOpen?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.XCv,{})}),t.url?(0,T.jsx)("a",{className:"virtual-assistant__doc-entry__title virtual-assistant__doc-entry__title--link",rel:"noopener noreferrer",target:"_blank",href:t.url,onClick:()=>{St.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey})},title:"Click to see external documentation",children:t.title}):(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__title",onClick:i,children:t.title})]}),t.isOpen&&t.content&&(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__content",children:J(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,T.jsx)(cd,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),Od=(0,nt.Pi)((()=>{const e=Ft(),t=e.assistantService.currentContextualDocumentationEntry,s=e.guardUnhandledError((()=>e.copyTextToClipboard(t?.context??""))),i=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.currentContext?.key??""))),n=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.contextStack.map((e=>e.key)).join(" > "))));return(0,T.jsxs)(id,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(nd,{children:[(0,T.jsx)(ad,{onClick:s,children:"Copy Context ID"}),(0,T.jsx)(ad,{onClick:i,children:"Copy Current Context ID"}),(0,T.jsx)(ad,{onClick:n,children:"Copy Context Stack"})]}),children:[t&&(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__content",children:[t.title&&(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__title",children:t.title}),t.content&&(0,T.jsx)(T.Fragment,{children:J(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,T.jsx)(cd,{className:"virtual-assistant__contextual-support__markdown-text",value:t.content})}),t.related.length&&(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries",children:[(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries__title",children:["Related entries (",t.related.length,")"]}),t.related.map((e=>(0,T.jsx)(Ad,{entry:e},e.uuid)))]})]}),!t&&(0,T.jsx)(hd,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(Xc.jZm,{className:"virtual-assistant__panel__placeholder__icon"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No contextual documentation found!"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__instruction",children:"Keep using the app. When contextual help is available, we will let you know!"})]})})]})})),Sd=(0,nt.Pi)((()=>{const e=Ft(),t=(0,at.useRef)(null),s=(0,at.useRef)(null),i=e.assistantService,n=i.searchText,a=(0,at.useMemo)((()=>(0,md.Z)((()=>i.search()),100)),[i]);return(0,at.useEffect)((()=>{t.current?.focus()}),[]),(0,T.jsxs)("div",{className:"virtual-assistant__search",children:[(0,T.jsxs)("div",{className:"virtual-assistant__search__header",children:[(0,T.jsx)("input",{ref:t,onClick:()=>{document.querySelectorAll('[role="dialog"]').length&&t.current!==document.activeElement&&i.refreshPanelRendering()},className:(0,jc.clsx)("virtual-assistant__search__input input--dark",{"virtual-assistant__search__input--searching":n}),spellCheck:!1,onChange:e=>{i.setSearchText(e.target.value),a()},value:n,placeholder:"Ask me a question"}),n&&(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__count",children:i.searchResults.length+(i.isOverSearchLimit?"+":"")}),(0,T.jsx)("button",{ref:s,className:(0,jc.clsx)("virtual-assistant__search__input__config__trigger",{"virtual-assistant__search__input__config__trigger--toggled":i.showSearchConfigurationMenu,"virtual-assistant__search__input__config__trigger--active":i.searchConfigurationState.isAdvancedSearchActive}),tabIndex:-1,onClick:()=>i.setShowSearchConfigurationMenu(!i.showSearchConfigurationMenu),title:(i.searchConfigurationState.isAdvancedSearchActive?"Advanced search is currently active\n":"")+"Click to toggle search config menu",children:(0,T.jsx)(Xc.IEm,{})}),n?(0,T.jsx)("button",{className:"virtual-assistant__search__input__clear-btn",tabIndex:-1,onClick:()=>{i.resetSearch(),i.currentDocumentationEntry=void 0,t.current?.focus()},title:"Clear",children:(0,T.jsx)(Xc.q1B,{})}):(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,T.jsx)(Xc.W1M,{})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,T.jsx)(Kc,{isLoading:i.searchState.isInProgress}),(0,T.jsx)("div",{className:(0,jc.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":i.showSearchConfigurationMenu}),children:(0,T.jsx)(Nd,{configState:i.searchConfigurationState})}),i.currentDocumentationEntry&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:(0,T.jsx)(Ad,{entry:i.currentDocumentationEntry},i.currentDocumentationEntry.uuid)}),!i.currentDocumentationEntry&&(0,T.jsxs)(T.Fragment,{children:[Boolean(i.searchResults.length)&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:i.searchResults.map((e=>(0,T.jsx)(Ad,{entry:e},e.uuid)))}),n&&!i.searchResults.length&&(0,T.jsx)(hd,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(Xc.DXi,{className:"virtual-assistant__panel__placeholder__icon"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No result..."})]})}),!n&&!i.searchResults.length&&(0,T.jsx)(id,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(nd,{children:[(0,T.jsx)(ad,{onClick:()=>{_e(`documentation-registry_${(0,_d.Z)(new Date(Date.now()),ke)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),re.APPLICATION_JSON)},children:"Download documentation registry"}),(0,T.jsx)(ad,{onClick:()=>{_e(`documentation-registry_${(0,_d.Z)(new Date(Date.now()),ke)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),re.APPLICATION_JSON)},children:"Download contextual documentation mapping"})]}),children:(0,T.jsxs)("div",{className:"virtual-assistant__character",children:[(0,T.jsxs)("div",{className:"virtual-assistant__character__figure",children:[(0,T.jsx)(Xc.Oag,{className:"virtual-assistant__character__hat"}),(0,T.jsx)(Xc.ce8,{className:"virtual-assistant__character__glasses"}),(0,T.jsx)(Xc.dRK,{className:"virtual-assistant__character__beard"})]}),(0,T.jsx)("div",{className:"virtual-assistant__character__greeting",children:"Bonjour, It's Pierre!"}),(0,T.jsx)("div",{className:"virtual-assistant__character__question",children:"How can I help today?"})]})})]})]})]})})),yd=(0,nt.Pi)((e=>{const{triggerElement:t}=e,s=Ft().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,T.jsx)(pd,{open:s.isOpen,className:"virtual-assistant__panel__container",anchorEl:t,hideBackdrop:!0,PaperProps:{classes:{root:"virtual-assistant__panel__container__root"}},disableEnforceFocus:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"},children:(0,T.jsxs)("div",{className:"virtual-assistant__panel",tabIndex:0,onKeyDown:e=>{"Tab"===e.key&&(e.preventDefault(),e.stopPropagation())},children:[(0,T.jsxs)("div",{className:"virtual-assistant__panel__header",children:[(0,T.jsxs)("div",{className:"virtual-assistant__panel__header__tabs",children:[(0,T.jsx)("div",{className:(0,jc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===gt.SEARCH}),onClick:()=>s.setSelectedTab(gt.SEARCH),title:"Search",children:(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,T.jsx)(Xc.W1M,{})})}),(0,T.jsx)("div",{className:(0,jc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===gt.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(gt.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,T.jsx)(Xc.kdY,{}),i&&(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__indicator",title:"Contextual support available"})]})})]}),(0,T.jsx)("div",{className:"virtual-assistant__panel__header__actions",children:(0,T.jsx)("button",{className:"virtual-assistant__panel__header__action",tabIndex:-1,onClick:()=>s.setIsOpen(!1),title:"Close panel",children:(0,T.jsx)(Xc.Two,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===gt.SEARCH&&(0,T.jsx)(Sd,{}),n===gt.CONTEXTUAL_SUPPORT&&(0,T.jsx)(Od,{})]})]})},s.panelRenderingKey)})),Id=(0,nt.Pi)((()=>{const[e,t]=(0,at.useState)(!1),[s,i]=(0,at.useState)((0,a.Z)()),n=Ft(),r=(0,at.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,at.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,T.jsx)(gd,{bounds:"parent",onStart:()=>t(!0),onStop:()=>t(!1),handle:".virtual-assistant__station__drag-handle",children:(0,T.jsxs)("div",{className:"virtual-assistant",ref:r,children:[(0,T.jsxs)("div",{className:(0,jc.clsx)("virtual-assistant__station",{"virtual-assistant__station--hidden":o.isHidden,"virtual-assistant__station--active":Boolean(l)}),children:[(0,T.jsx)("button",{className:"virtual-assistant__station__trigger",tabIndex:-1,onClick:()=>{!o.isOpen&&l&&o.setSelectedTab(gt.CONTEXTUAL_SUPPORT),o.setIsOpen(!o.isOpen)},title:o.isOpen?"Click to close assistant panel":(l?"Contextual support available.\n":"")+"Click to open assistant panel...",children:o.isOpen?(0,T.jsx)(Xc.Two,{className:"virtual-assistant__station__trigger__close"}):l?(0,T.jsx)(Xc.J$M,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,T.jsx)(id,{className:(0,jc.clsx)("virtual-assistant__station__drag-handle",{"virtual-assistant__station__drag-handle--dragging":e}),menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(nd,{children:[(0,T.jsx)(ad,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,T.jsx)(ad,{onClick:()=>n.assistantService.hideAssistant(),children:"Hide Assistant"})]}),children:(0,T.jsx)("div",{className:"virtual-assistant__station__drag-handle__content",title:e?void 0:"Grab to drag assistant",children:(0,T.jsx)(Xc.POq,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,T.jsx)(yd,{triggerElement:r.current})]})},s)})),vd="app.container",Rd="app.backdrop-container",Pd=["Meta+KeyP","Control+KeyP","Meta+KeyS","Control+KeyS","F8","F10","F11","Meta+Shift+KeyP","Control+Shift+KeyP","Meta+KeyB","Control+KeyB","F7","Alt+F7","Control+Shift+KeyB"],wd=e=>(0,T.jsx)("div",{className:"backdrop__container",id:e.elementID}),Ld=(0,nt.Pi)((e=>{const{children:t}=e,s=Ft(),i=s.backdropContainerElementID?document.getElementById(s.backdropContainerElementID)??document.getElementById(Rd):document.getElementById(Rd),n=((e,t)=>{const s={};return e.forEach(((e,i)=>{e&&(s[i]={combinations:[e],handler:t(e)})})),s.INTERNAL__PLATFORM_NATIVE_KEYBOARD_COMMAND={combinations:Pd,handler:e=>{e?.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,(e=>t=>{Pd.includes(e)&&t?.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,at.useEffect)((()=>{const e=function(e){const t=new Map;let s=null;return i=>{i instanceof KeyboardEvent&&(Object.values(e).flatMap((e=>e.combinations.map((t=>({combination:t,handler:e.handler}))))).filter((e=>e.combination.length)).forEach((e=>{const s=e.combination,n=e.combination.trim().split(" ").map((e=>{const t=e.split(/\b\+/),s=H(t.pop(),"Can't parse key binding: last part must be a non-modifier key");return{modifiers:t,key:s}}));if(!n.length)return;const a=t.get(s)??n,r=H(a[0]),o=((e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![ed.SHIFT,ed.META,ed.ALT,ed.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))))(i,r);o?a.length>1?t.set(s,a.slice(1)):(t.delete(s),e.handler(i)):i.getModifierState(i.key)||t.delete(s)})),s&&clearTimeout(s),s=setTimeout(t.clear.bind(t),1e3))}}(n);return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n]),(0,T.jsxs)(Lc,{children:[(0,T.jsx)(Zc,{}),(0,T.jsx)(Wc,{}),(0,T.jsx)(Qc,{}),s.showBackdrop&&(0,T.jsx)(bc.Z,{container:i,children:(0,T.jsx)(Dc.Z,{className:"backdrop",open:s.showBackdrop})}),(0,T.jsx)(Mc.W,{backend:kc.PD,children:(0,T.jsxs)("div",{className:"app__container",id:vd,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,T.jsx)(wd,{elementID:Rd}),(0,T.jsx)(Id,{}),t]})})]})}));class bd{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const Dd=(0,at.createContext)(void 0),Md=({children:e})=>{const t=Ft(),s=(0,nt.fv)((()=>new bd(t)));return(0,T.jsx)(Dd.Provider,{value:s,children:e})};var kd,Fd;!function(e){e.CONCEPT="CONCEPT",e.FILE="FILE"}(kd=kd||(kd={})),function(e){e.CONSOLE="CONSOLE",e.SEARCH_RESULT="SEARCH_RESULT",e.TEST_RUNNER="TEST_RUNNER"}(Fd=Fd||(Fd={}));const jd=(e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)},Ud="dummy_problem_marker_owner";var Vd;!function(e){e.PACKAGE="Package",e.PROFILE="Profile",e.TAG="Tag",e.STEREOTYPE="Stereotype",e.CLASS="Class",e.ASSOCIATION="Association",e.PROPERTY="Property",e.QUALIFIED_PROPERTY="QualifiedProperty",e.ENUMERATION="Enumeration",e.ENUM_VALUE="Enum",e.MEASURE="Measure",e.UNIT="Unit",e.FUNCTION="ConcreteFunctionDefinition",e.NATIVE_FUNCTION="NativeFunction",e.DIAGRAM="Diagram",e.DATABASE="Database",e.MAPPING="Mapping"}(Vd=Vd||(Vd={}));class Gd{pureId;pureType;pureName;get id(){return this.pureId}}class $d extends Gd{deprecated}(0,Be.yu)($d,{pureId:(0,Be.Ru)(),pureType:(0,Be.Ru)(),deprecated:(0,Be.Ru)()});class zd extends Gd{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,Be.yu)(zd,{pureId:(0,Be.Ru)(),pureName:(0,Be.Ru)(),pureType:(0,Be.Ru)(),RO:(0,Be.Ru)(),classPath:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class Bd extends Gd{RO;notpublic;user;file;line;column}(0,Be.yu)(Bd,{pureId:(0,Be.Ru)(),pureName:(0,Be.jt)((0,Be.Ru)()),pureType:(0,Be.Ru)(),RO:(0,Be.Ru)(),notpublic:(0,Be.Ru)(),user:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class Hd{li_attr;id;text;icon;children;state;getNodeAttribute(e){return K(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,Be.yu)(Hd,{li_attr:(0,Be.PG)((()=>Be.AM),(e=>e.classPath?(0,Be.vB)(zd,e):e.file?(0,Be.vB)(Bd,e):(0,Be.vB)($d,e))),id:(0,Be.Ru)(),text:(0,Be.Ru)(),icon:(0,Be.Ru)(),children:(0,Be.Ru)(),state:(0,Be.Ru)()});const Yd=e=>e.startsWith("/")?e.substring(1,e.length):e;class Wd{content;constructor(){(0,x.rC)(this,{content:x.LO,hashCode:x.Fl,setContent:x.aD})}setContent(e){this.content=e}get hashCode(){return Xt(this.content)}}(0,Be.yu)(Wd,{content:(0,Be.Ru)()});class Kd{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class Zd extends Kd{error;constructor(e,t,s,i){super(e,t,s),this.error=i}}var Xd;!function(e){e.ENUM="meta::pure::ide::findusages::findUsagesForEnum_String_1__String_1__SourceInformation_MANY_",e.PROPERTY="meta::pure::ide::findusages::findUsagesForProperty_String_1__String_1__SourceInformation_MANY_",e.ELEMENT="meta::pure::ide::findusages::findUsagesForPath_String_1__SourceInformation_MANY_",e.MULTIPLE_PATHS="meta::pure::ide::findusages::findUsagesForMultiplePaths_String_1__Pair_MANY_"}(Xd=Xd||(Xd={}));const qd=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Jd{source;line;column;startLine;startColumn;endLine;endColumn}(0,Be.yu)(Jd,{source:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)()});class Qd{first;second}(0,Be.yu)(Qd,{first:(0,Be.Ru)(),second:(0,Be.pb)((0,Be.Ry)(Jd))});class eh{uuid=(0,a.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class th{currentTab;tabs=[];constructor(){(0,x.rC)(this,{currentTab:x.LO,tabs:x.LO,setCurrentTab:x.aD,closeTab:x.aD,closeAllTabs:x.aD,closeAllOtherTabs:x.aD,openTab:x.aD,swapTabs:x.aD})}setCurrentTab(e){this.currentTab=e}closeAllOtherTabs(e){B(this.tabs.find((t=>t===e)),"Specified tab should be currently opened"),this.setCurrentTab(e),this.tabs=[e]}closeAllTabs(){this.setCurrentTab(void 0),this.tabs=[]}swapTabs(e,t){D(this.tabs,e,t)}openTab(e){if(!this.tabs.find((t=>t.match(e))))if(this.currentTab){const t=this.tabs.findIndex((e=>e===this.currentTab));this.tabs.splice(t+1,0,e)}else this.tabs.push(e);this.setCurrentTab(e),e.onOpen()}closeTab(e){const t=this.tabs.findIndex((t=>t.match(e)));if(q(-1!==t,"Can't close a tab which is not opened"),this.tabs.splice(t,1),this.currentTab===e)if(this.tabs.length){const e=t-1;this.setCurrentTab(e>=0?this.tabs[e]:this.tabs[0])}else this.setCurrentTab(void 0);e.onClose()}}class sh extends eh{editorStore;constructor(e){super(),this.editorStore=e}}class ih extends th{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}closeTab(e){e instanceof uh&&e.hasChanged?this.editorStore.applicationStore.setActionAlertInfo({message:"Unsaved changes will be lost if you continue. Do you still want to proceed?",prompt:"To save changes, abort and compile",type:Rt.CAUTION,actions:[{label:"Proceed",type:Pt.PROCEED_WITH_CAUTION,handler:()=>super.closeTab(e)},{label:"Save changes",type:Pt.PROCEED_WITH_CAUTION,handler:()=>{(0,x.fl)(this.editorStore.executeGo()).then((()=>{super.closeTab(e)})).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Pt.PROCEED,default:!0}]}):super.closeTab(e)}}var nh;!function(e){e.SEARCH_FILE="editor.search.file",e.SEARCH_TEXT="editor.search.text",e.GO_TO_FILE="editor.go-to-file",e.TOGGLE_AUX_PANEL="editor.toggle-auxiliary-panel",e.EXECUTE="editor.execute",e.FULL_RECOMPILE="editor.full-compile",e.FULL_RECOMPILE_WITH_FULL_INIT="editor.full-compile.with-init",e.RUN_ALL_TESTS="editor.run-all-tests",e.RUN_RELAVANT_TESTS="editor.run-relavant-tests"}(nh=nh||(nh={}));const ah={[nh.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN"},[nh.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF"},[nh.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[nh.TOGGLE_AUX_PANEL]:{title:"Toggle auxiliary panel",defaultKeyboardShortcut:"Control+Backquote"},[nh.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[nh.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[nh.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[nh.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[nh.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"}};var rh;!function(e){e.RECENTER="editor.diagram-editor.recenter",e.USE_ZOOM_TOOL="editor.diagram-editor.use-zoom-tool",e.USE_VIEW_TOOL="editor.diagram-editor.use-view-tool",e.USE_PAN_TOOL="editor.diagram-editor.use-pan-tool"}(rh=rh||(rh={}));const oh={[rh.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[rh.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[rh.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[rh.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};var lh;!function(e){e.REVEAL_CONCEPT_IN_TREE="editor.file-editor.reveal-concept-in-tree",e.GO_TO_DEFINITION="editor.file-editor.go-to-definition",e.GO_BACK="editor.file-editor.go-back",e.FIND_USAGES="editor.file-editor.find-usage",e.RENAME_CONCEPT="editor.file-editor.rename-concept",e.GO_TO_LINE="editor.file-editor.go-to-line"}(lh=lh||(lh={}));const ch={[lh.REVEAL_CONCEPT_IN_TREE]:{title:"Reveal concept in tree (File)",defaultKeyboardShortcut:"Control+Shift+KeyB"},[lh.GO_TO_DEFINITION]:{title:"Go to definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[lh.GO_BACK]:{title:"Go back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[lh.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"},[lh.RENAME_CONCEPT]:{title:"Rename Concept (File)",defaultKeyboardShortcut:"F2"},[lh.GO_TO_LINE]:{title:"Go to Line (File)",defaultKeyboardShortcut:"Control+KeyG"}};class dh{model;editor;_dummyCursorObservable={};language;viewState;forcedCursorPosition;wrapText=!1;constructor(e){(0,x.rC)(this,{viewState:x.LO.ref,editor:x.LO.ref,_dummyCursorObservable:x.LO.ref,forcedCursorPosition:x.LO.ref,wrapText:x.LO,cursorObserver:x.Fl,notifyCursorObserver:x.aD,setViewState:x.aD,setEditor:x.aD,setForcedCursorPosition:x.aD,setWrapText:x.aD}),this.language=(e=>{switch(w(e.split("."))){case"pure":return S.PURE;case"java":return S.JAVA;case"md":case"xml":return S.MARKDOWN;case"sql":return S.SQL;case"json":return S.JSON;case"yml":case"yaml":return S.YAML;case"graphql":return S.GRAPHQL;default:return S.TEXT}})(e.filePath),this.model=N.editor.createModel(e.uuid,this.language),this.model.setValue(e.file.content)}notifyCursorObserver(){this._dummyCursorObservable={}}get cursorObserver(){return this._dummyCursorObservable,this.editor?{position:this.editor.getPosition()??void 0,selection:this.editor.getSelection()??void 0}:void 0}setViewState(e){this.viewState=e}setEditor(e){this.editor=e}setForcedCursorPosition(e){this.forcedCursorPosition=e}setWrapText(e){const t=this.wrapText;this.wrapText=e,t!==e&&this.editor&&(this.editor.updateOptions({wordWrap:e?"on":"off"}),this.editor.focus())}}class hh{fileEditorState;concept;coordinate;constructor(e,t,s){this.fileEditorState=e,this.concept=t,this.coordinate=s}}class uh extends sh{filePath;textEditorState;_currentHashCode;file;renameConceptState;showGoToLinePrompt=!1;constructor(e,t,s){super(e),(0,x.rC)(this,{_currentHashCode:x.LO,file:x.LO,renameConceptState:x.LO,showGoToLinePrompt:x.LO,hasChanged:x.Fl,resetChangeDetection:x.aD,setFile:x.aD,setShowGoToLinePrompt:x.aD,setConceptToRenameState:x.ls}),this.file=t,this._currentHashCode=t.hashCode,this.filePath=s,this.textEditorState=new dh(this)}get label(){return Yd(this.filePath)}get description(){return`File: ${Yd(this.filePath)}`}get fileName(){return H(w(this.filePath.split("/")))}match(e){return e instanceof uh&&this.filePath===e.filePath}onClose(){this.textEditorState.model.dispose()}get hasChanged(){return this._currentHashCode!==this.file.hashCode}resetChangeDetection(){this._currentHashCode=this.file.hashCode}setFile(e){this.file=e,this.textEditorState.model.setValue(e.content),this.resetChangeDetection()}setShowGoToLinePrompt(e){this.showGoToLinePrompt=e}*setConceptToRenameState(e){if(!e)return void(this.renameConceptState=void 0);if(this.hasChanged)return void this.editorStore.applicationStore.notifyWarning("Can't rename concept: source is not compiled");const t=yield this.editorStore.getConceptInfo(e);this.renameConceptState=t?new hh(this,t,e):void 0}showError(e){var t,s,i;t=this.textEditorState.model,s=[{message:e.error.message,startLineNumber:e.line,startColumn:e.column,endLineNumber:e.line,endColumn:e.column}],i=this.uuid,N.editor.setModelMarkers(t,i??Ud,s.map((e=>({startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn+1,message:""===e.message?"(no error message)":e.message,severity:N.MarkerSeverity.Error}))))}clearError(){var e;e=this.uuid,N.editor.removeAllMarkers(e??Ud)}registerCommands(){if(this.textEditorState.language!==S.PURE)throw new j("File editor commands should only be used for Pure files");this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.GO_TO_DEFINITION,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&(0,x.fl)(this.editorStore.executeNavigation(new Kd(this.filePath,e.lineNumber,e.column))).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.GO_BACK,action:()=>{(0,x.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.REVEAL_CONCEPT_IN_TREE,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&this.editorStore.revealConceptInTree(new Kd(this.filePath,e.lineNumber,e.column)).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.FIND_USAGES,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Kd(this.filePath,e.lineNumber,e.column);this.findConceptUsages(t)}}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.RENAME_CONCEPT,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){if(!this.textEditorState.model.getWordAtPosition(e))return;const t=new Kd(this.filePath,e.lineNumber,e.column);(0,x.fl)(this.setConceptToRenameState(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.GO_TO_LINE,trigger:()=>this.editorStore.tabManagerState.currentTab===this,action:()=>{this.setShowGoToLinePrompt(!0)}})}findConceptUsages(e){const t=()=>{(0,x.fl)(this.editorStore.findUsages(e)).catch(this.editorStore.applicationStore.alertUnhandledError)};this.hasChanged?this.editorStore.applicationStore.setActionAlertInfo({message:"Source is not compiled, finding concept usages might be inaccurate. Do you want compile to proceed?",type:Rt.CAUTION,actions:[{label:"Compile and Proceed",type:Pt.PROCEED_WITH_CAUTION,handler:()=>{(0,x.fl)(this.editorStore.executeGo()).then(t).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Pt.PROCEED,default:!0}]}):t()}async renameConcept(e){if(!this.renameConceptState)return;const t=this.renameConceptState.concept;try{this.editorStore.applicationStore.setBlockingAlert({message:"Finding concept usages...",showLoading:!0});const s=await this.editorStore.findConceptUsages(t.pureType===Vd.ENUM_VALUE?Xd.ENUM:t.pureType===Vd.PROPERTY||t.pureType===Vd.QUALIFIED_PROPERTY?Xd.PROPERTY:Xd.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`));await(0,x.fl)(this.editorStore.renameConcept(t.pureName,e,t.pureType,s)),this.textEditorState.setForcedCursorPosition({lineNumber:this.renameConceptState.coordinate.line,column:this.renameConceptState.coordinate.column})}catch(e){V(e),this.editorStore.applicationStore.notifyError(e)}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}}deregisterCommands(){if(this.textEditorState.language!==S.PURE)throw new j("File editor commands should only be used for Pure files");[lh.GO_TO_DEFINITION,lh.GO_BACK,lh.REVEAL_CONCEPT_IN_TREE,lh.FIND_USAGES,lh.RENAME_CONCEPT,lh.GO_TO_LINE].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class ph{editorStore;treeData;selectedNode;loadInitialDataState=ft.create();refreshDataState=ft.create();constructor(e){(0,x.rC)(this,{treeData:x.LO.ref,loadInitialDataState:x.LO,refreshDataState:x.LO,initialize:x.ls,expandNode:x.ls,openNode:x.ls,refreshTreeData:x.ls,setTreeData:x.aD,setSelectedNode:x.aD}),this.editorStore=e}getTreeData(){return H(this.treeData,"Tree data has not been initialized")}*initialize(){if(this.loadInitialDataState.isInProgress)this.editorStore.applicationStore.notifyWarning("Tree state initialization is in progress");else{this.loadInitialDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes()),this.loadInitialDataState.pass()}catch(e){V(e),this.editorStore.applicationStore.notifyError(e),this.loadInitialDataState.fail()}}}setSelectedNode(e){e!==this.selectedNode&&(this.selectedNode&&(this.selectedNode.isSelected=!1),e&&(e.isSelected=!0),this.selectedNode=e,this.refreshTree())}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...H(this.treeData)})}*expandNode(e){if(!e.isLoading)if(this.getTreeData().nodes.has(e.id)&&e.childrenIds)e.isLoading=!1,e.isOpen=!0,this.refreshTree();else{e.isLoading=!0;try{const t=yield this.getChildNodes(e);this.processChildNodes(e,t),e.isOpen=!0,this.refreshTree()}catch(e){V(e),this.editorStore.applicationStore.notifyError(e)}finally{e.isLoading=!1}}}*refreshTreeData(){const e=new Set(Array.from(this.getTreeData().nodes.values()).filter((e=>e.isOpen)).map((e=>e.id))),t=this.selectedNode?.id;this.refreshDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes())}catch(e){return V(e),this.editorStore.applicationStore.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>H(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode(H(this.getTreeData().nodes.get(t)))}async refreshOpenNodes(e,t){return await Promise.all(e.map((e=>(t.delete(e.id),(0,x.fl)(this.expandNode(e)).catch((()=>{})))))),(e=e.flatMap((e=>e.childrenIds??[])).map((e=>H(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class mh{id;path}class _h extends mh{file;statusType}(0,Be.yu)(_h,{id:(0,Be.Ru)(),path:(0,Be.Ru)(),file:(0,Be.Ru)(),statusType:(0,Be.Ru)()});class gh extends mh{repo}(0,Be.yu)(gh,{id:(0,Be.Ru)(),path:(0,Be.Ru)(),repo:(0,Be.Ru)()});class Eh{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof gh}get isFileNode(){return this.li_attr instanceof _h}getNodeAttribute(e){return K(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,Be.yu)(Eh,{li_attr:(0,Be.PG)((()=>Be.AM),(e=>e.file&&"true"===e.file?(0,Be.vB)(_h,e):(0,Be.vB)(gh,e))),text:(0,Be.Ru)(),icon:(0,Be.Ru)(),children:(0,Be.Ru)(),state:(0,Be.Ru)()});const fh=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},Th=e=>e.endsWith(".pure"),Ch=e=>`file_${e}`;class xh extends ph{nodeForCreateNewFile;nodeForCreateNewDirectory;nodeForRenameFile;constructor(e){super(e),(0,x.rC)(this,{nodeForCreateNewFile:x.LO,nodeForCreateNewDirectory:x.LO,nodeForRenameFile:x.LO,setNodeForCreateNewFile:x.aD,setNodeForCreateNewDirectory:x.aD,setNodeForRenameFile:x.aD,revealPath:x.ls})}setNodeForCreateNewFile=e=>{q(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{q(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};setNodeForRenameFile=e=>{q(!e||e.data.isFileNode,"Node selected for renaming must be a file"),this.nodeForRenameFile=e};async getRootNodes(){return(await this.editorStore.client.getDirectoryChildren()).map((e=>(0,Be.vB)(Eh,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.editorStore.client.getDirectoryChildren(e.data.li_attr.path)).map((e=>(0,Be.vB)(Eh,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((e=>{const t=e.li_attr.id;i.push(t),s.nodes.set(t,{data:e,id:t,label:e.text,isLoading:!1})})),e.childrenIds=i}*openNode(e){e.data.isFileNode&&(yield(0,x.fl)(this.editorStore.loadFile(e.data.li_attr.path)))}*revealPath(e,t,s){t&&this.editorStore.setActiveActivity(kd.FILE,{keepShowingIfMatchedCurrent:!0});const i=[];let n=e;for(;n;)i.unshift(n),n=fh(n);for(const e of i)if(Th(e))yield(0,x.fl)(this.editorStore.loadFile(e,s));else{const t=H(this.getTreeData().nodes.get(Ch(e)),`Can't find directory node with path '${e}'`);yield(0,x.fl)(this.expandNode(t))}const a=H(this.getTreeData().nodes.get(Ch(e)),`Can't find file node with path '${e}'`);this.setSelectedNode(a)}}class Nh extends ph{loadConceptActivity=ft.create();statusText;nodeForRenameConcept;nodeForMoveElement;constructor(e){super(e),(0,x.rC)(this,{statusText:x.LO,nodeForRenameConcept:x.LO,nodeForMoveElement:x.LO,setStatusText:x.aD,setNodeForRenameConcept:x.aD,setNodeForMoveElement:x.aD,pullConceptsActivity:x.aD,pollConceptsActivity:x.ls})}setStatusText(e){this.statusText=e}setNodeForRenameConcept(e){this.nodeForRenameConcept=e}setNodeForMoveElement(e){this.nodeForMoveElement=e}async getRootNodes(){return await(0,x.fl)(this.pollConceptsActivity()),(await this.editorStore.client.getConceptChildren()).map((e=>(0,Be.vB)(Hd,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.editorStore.client.getConceptChildren(e.data.li_attr.pureId)).map((e=>(0,Be.vB)(Hd,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((t=>{const n=t.li_attr.id;i.push(n),s.nodes.set(n,{data:t,id:n,label:t.text,isLoading:!1,parent:e})})),e.childrenIds=i}*openNode(e){(e.data.li_attr instanceof zd||e.data.li_attr instanceof Bd)&&("Diagram"===e.data.li_attr.pureType?yield(0,x.fl)(this.editorStore.loadDiagram(e.data.li_attr.file,e.data.li_attr.pureId,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10))):yield(0,x.fl)(this.editorStore.loadFile(e.data.li_attr.file,new Kd(e.data.li_attr.file,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10)))))}*pollConceptsActivity(){if(this.loadConceptActivity.isInInitialState){this.loadConceptActivity.inProgress(),this.setStatusText("Loading concepts activity...");try{yield this.pullConceptsActivity()}finally{this.setStatusText(void 0),this.loadConceptActivity.reset()}}}async pullConceptsActivity(){const e=await this.editorStore.client.getConceptActivity();return e.text&&this.setStatusText(`Preparing - ${e.text}`),e.initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullConceptsActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}async movePackageableElements(e,t){let s=[];try{s=(await this.editorStore.client.getPackageableElementsUsage(e.map((e=>e.pureId)))).map((e=>(0,Be.vB)(Qd,e)))}catch{return void this.editorStore.applicationStore.notifyError("Can't find usage for child packageable elements")}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}const i=[];q(s.length===e.length,"Can't find matching usages for packageable elements");for(let n=0;n<s.length;++n){const a=H(e[n]);i.push({pureName:a.pureName,pureType:a.pureType,sourcePackage:H(Ul(a.pureId)),destinationPackage:t,usages:H(s[n]).second})}await(0,x.fl)(this.editorStore.movePackageableElements(i))}async renameConcept(e,t){const s=e.data.li_attr,i=s.pureName??s.pureId;let n=[];try{switch(this.editorStore.applicationStore.setBlockingAlert({message:"Finding concept usages...",showLoading:!0}),s.pureType){case Vd.PROPERTY:case Vd.QUALIFIED_PROPERTY:W(s,zd),n=await this.editorStore.findConceptUsages(Xd.PROPERTY,[`'${s.classPath}'`,`'${s.pureId}'`]);break;case Vd.PACKAGE:{let e=[],s=[];try{s=await this.editorStore.client.getChildPackageableElements(i),e=(await this.editorStore.client.getPackageableElementsUsage(s.map((e=>e.pureId)))).map((e=>(0,Be.vB)(Qd,e)))}catch{return void this.editorStore.applicationStore.notifyError("Can't find usage for child packageable elements")}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}const n=[];q(e.length===s.length,"Can't find matching usages for child packageable elements");const a=Ul(i)?.concat(Ee).concat(t)??t;for(let t=0;t<e.length;++t){const r=H(s[t]),o=H(Ul(r.pureId)),l=a.concat(o.substring(o.indexOf(i)+i.length));n.push({pureName:r.pureName,pureType:r.pureType,sourcePackage:o,destinationPackage:l,usages:H(e[t]).second})}return void await(0,x.fl)(this.editorStore.movePackageableElements(n))}default:n=await this.editorStore.findConceptUsages(Xd.ELEMENT,[`'${s.pureId}'`])}}catch(e){return V(e),void this.editorStore.applicationStore.notifyError(e)}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}await(0,x.fl)(this.editorStore.renameConcept(i,t,s.pureType,n))}}class Ah{cached;datamarts;text}(0,Be.yu)(Ah,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)()});class Oh extends Ah{error;sessionError}(0,Be.yu)(Oh,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class Sh extends Oh{RO;line;column;source}(0,Be.yu)(Sh,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class yh{text;reinit}class Ih extends yh{cache;modifiedFiles=[]}(0,Be.yu)(Ih,{text:(0,Be.Ru)(),cache:(0,Be.Ru)(),modifiedFiles:(0,Be.pb)((0,Be.Ru)()),reinit:(0,Be.Ru)()});class vh extends yh{RO;line;column;source;error;sessionError}(0,Be.yu)(vh,{text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class Rh{RO;line;column;source}(0,Be.yu)(Rh,{RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)()});class Ph extends yh{jumpTo}(0,Be.yu)(Ph,{text:(0,Be.Ru)(),jumpTo:(0,Be.Ry)(Rh)});class wh{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,Be.yu)(wh,{sourceID:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),foundName:(0,Be.Ru)()});class Lh{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,Be.yu)(Lh,{sourceID:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),foundName:(0,Be.Ru)(),add:(0,Be.Ru)(),messageToBeModified:(0,Be.Ru)(),fileToBeModified:(0,Be.Ru)(),lineToBeModified:(0,Be.Ru)(),columnToBeModified:(0,Be.Ru)()});class bh extends vh{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,Be.yu)(bh,{candidateName:(0,Be.Ru)(),candidatesWithPackageImported:(0,Be.pb)((0,Be.Ry)(wh)),candidatesWithPackageNotImported:(0,Be.pb)((0,Be.Ry)(Lh))});class Dh extends vh{candidateName;candidates=[]}(0,Be.yu)(Dh,{candidateName:(0,Be.Ru)(),candidates:(0,Be.pb)((0,Be.Ry)(Lh))});class Mh{id;parentId;file;line;column}(0,Be.yu)(Mh,{id:(0,Be.Ru)(),parentId:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class kh{children=[];li_attr;text;type}(0,Be.yu)(kh,{children:(0,Be.pb)((0,Be.Ry)(kh)),li_attr:(0,Be.Ry)(Mh),text:(0,Be.Ru)(),type:(0,Be.Ru)()});class Fh extends yh{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,Be.yu)(Fh,{count:(0,Be.Ru)(),filterPaths:(0,Be.pb)((0,Be.Ru)()),path:(0,Be.Ru)(),relevantTestsOnly:(0,Be.Ru)(),runnerId:(0,Be.Ru)(),tests:(0,Be.pb)((0,Be.Ry)(kh))});class jh{uuid=(0,a.Z)()}class Uh{before;found;after}(0,Be.yu)(Uh,{after:(0,Be.Ru)(),before:(0,Be.Ru)(),found:(0,Be.Ru)()});class Vh{uuid=(0,a.Z)();sourceId;startLine;startColumn;endLine;endColumn;preview;constructor(e,t,s,i,n){this.sourceId=e,this.startLine=t,this.startColumn=s,this.endLine=i,this.endColumn=n}}(0,Be.yu)(Vh,{sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)(),preview:(0,Be.jt)((0,Be.Ry)(Uh))});class Gh extends jh{sourceId;coordinates=[];constructor(){super(),(0,x.rC)(this,{coordinates:x.LO,dismissCoordinate:x.aD})}setCoordinates(e){this.coordinates=e}dismissCoordinate(e){M(this.coordinates,e)}}(0,Be.yu)(Gh,{sourceId:(0,Be.Ru)(),coordinates:(0,Be.pb)((0,Be.Ry)(Vh))});class $h{editorStore;constructor(e){this.editorStore=e}}class zh extends $h{searchEntries=[];constructor(e,t){super(e),(0,x.rC)(this,{searchEntries:x.LO,numberOfFiles:x.Fl,numberOfResults:x.Fl}),this.searchEntries=t}dismissSearchEntry(e){M(this.searchEntries,e),this.searchEntries.length||this.editorStore.setSearchState(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class Bh extends zh{}class Hh extends zh{usageConcept;constructor(e,t,s,i){const n=new Map;s.forEach(((e,t)=>{let s;n.has(e.source)?s=H(n.get(e.source)):(s=new Gh,s.sourceId=e.source,n.set(e.source,s));const a=new Vh(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn);a.preview=i.find((t=>t.sourceId===e.source&&t.startLine===e.startLine&&t.startColumn===e.startColumn&&t.endLine===e.endLine&&t.endColumn===e.endColumn))?.preview,s.coordinates.push(a)})),super(e,Array.from(n.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=H(n.get(e));return t.setCoordinates(t.coordinates.sort(((e,t)=>e.startColumn-t.startColumn)).sort(((e,t)=>e.startLine-t.startLine))),t}))),this.usageConcept=t}}class Yh extends $h{result;constructor(e,t){super(e),this.result=t}}class Wh extends $h{result;constructor(e,t){super(e),this.result=t}}var Kh,Zh,Xh;!function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(Kh=Kh||(Kh={}));class qh{status;test}class Jh extends qh{test=[]}(0,Be.yu)(Jh,{status:(0,Be.Ru)(),test:(0,Be.pb)((0,Be.Ru)())});class Qh{text;RO;line;column;source;error}(0,Be.yu)(Qh,{text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)()});class eu extends qh{test=[];error}(0,Be.yu)(eu,{status:(0,Be.Ru)(),test:(0,Be.pb)((0,Be.Ru)()),error:(0,Be.Ry)(Qh)});class tu{}class su extends tu{finished;tests=[]}(0,Be.yu)(su,{finished:(0,Be.Ru)(),tests:(0,Be.pb)((0,Be.PG)((()=>Be.AM),(e=>e.error?(0,Be.vB)(eu,e):(0,Be.vB)(Jh,e))))});class iu extends tu{error;text}(0,Be.yu)(iu,{error:(0,Be.Ru)(),text:(0,Be.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(Zh=Zh||(Zh={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(Xh=Xh||(Xh={}));class nu{_START_TIME;total;time=0;passedTests=new Set;failedTests=new Map;testsWithError=new Map;notRunTests;results=new Map;constructor(e){(0,x.rC)(this,{total:x.LO,time:x.LO,passedTests:x.LO,failedTests:x.LO,testsWithError:x.LO,notRunTests:x.LO,results:x.LO,passed:x.Fl,error:x.Fl,failed:x.Fl,passedTestIds:x.Fl,failedTestIds:x.Fl,testWithErrorIds:x.Fl,notRunTestIds:x.Fl,numberOfTestsRun:x.Fl,runPercentage:x.Fl,suiteStatus:x.Fl,setTime:x.aD,addResult:x.aD}),this._START_TIME=Date.now(),this.total=e.size,this.notRunTests=new Set(e)}get passed(){return this.passedTests.size}get error(){return this.testsWithError.size}get failed(){return this.failedTests.size}get passedTestIds(){return Array.from(this.passedTests.values())}get failedTestIds(){return Array.from(this.failedTests.keys())}get testWithErrorIds(){return Array.from(this.testsWithError.keys())}get notRunTestIds(){return Array.from(this.notRunTests.values())}get numberOfTestsRun(){return this.passed+this.error+this.failed}get runPercentage(){return Math.floor(100*this.numberOfTestsRun/this.total)}get suiteStatus(){return this.failed+this.error?Zh.FAILED:this.passed?Zh.PASSED:Zh.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case Kh.PASSED:this.passedTests.add(t);break;case Kh.FAILED:this.failedTests.set(t,K(e,eu));break;case Kh.ERROR:this.testsWithError.set(t,K(e,eu));break;default:throw new U(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class au{editorStore;testExecutionResult;checkTestRunnerState=ft.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=ft.create();treeData;viewAsList=!1;constructor(e,t){(0,x.rC)(this,{testResultInfo:x.LO.ref,allTests:x.LO,selectedTestId:x.LO,treeData:x.LO.ref,viewAsList:x.LO,setViewAsList:x.aD,setSelectedTestId:x.aD,setTestResultInfo:x.aD,setTreeData:x.aD,refreshTree:x.aD,collapseTree:x.aD,expandTree:x.aD,buildTreeDataByLayer:x.aD,pullTestRunnerResult:x.aD,buildTestTreeData:x.ls,pollTestRunnerResult:x.ls,rerunTestSuite:x.ls,cancelTestRun:x.ls}),this.editorStore=e,this.testExecutionResult=t}getTreeData(){return H(this.treeData,"Test tree data has not been initialized")}setViewAsList(e){this.viewAsList=e}setSelectedTestId(e){this.selectedTestId=e}setTestResultInfo(e){this.testResultInfo=e}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...H(this.treeData)})}*buildTestTreeData(){if(this.treeBuildingState.isInProgress)return;this.treeBuildingState.inProgress();const e=this.testExecutionResult.tests.map((e=>{const t=e.li_attr.id;return e.type&&this.allTests.set(t,e),t})),t=new Map;this.treeData={rootIds:e,nodes:t},yield this.buildTreeDataByLayer(this.testExecutionResult.tests),this.treeBuildingState.reset()}collapseTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),this.refreshTree()}expandTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!0})),this.refreshTree()}async buildTreeDataByLayer(e){const t=this.getTreeData(),s=[];return await Promise.all(e.map((e=>new Promise(((i,n)=>setTimeout((()=>{const a=e.li_attr.id,r={id:a,label:e.text,data:e,childrenIds:e.type?void 0:[],isLoading:!1};if(e.type&&this.allTests.set(a,e),t.nodes.set(a,r),"Root"!==e.li_attr.parentId)try{const s=H(t.nodes.get((o=e,`test${this.testExecutionResult.runnerId}_${o.li_attr.parentId}`)),`Can't find parent test node with ID '${e.li_attr.parentId}'`);s.childrenIds?b(s.childrenIds,a):s.childrenIds=[a]}catch(e){return void n(e)}var o;s.push(...e.children),i()}),0)))))),s.length?this.buildTreeDataByLayer(s):Promise.resolve()}*pollTestRunnerResult(){if(this.checkTestRunnerState.isInInitialState){this.checkTestRunnerState.inProgress();try{q(this.allTests.size===this.testExecutionResult.count,`Number of tests scanned in tree (${this.allTests.size}) does not match the number of total reported tests (${this.testExecutionResult.count})`);const e=new nu(new Set(this.allTests.keys()));this.testResultInfo=e,yield this.pullTestRunnerResult(e)}finally{this.checkTestRunnerState.reset()}}}async pullTestRunnerResult(e){const t=(s=await this.editorStore.client.checkTestRunner(this.testExecutionResult.runnerId)).error?(0,Be.vB)(iu,s):(0,Be.vB)(su,s);var s;return t instanceof su?(await Promise.all(t.tests.map((t=>L((()=>{return e.addResult(t,(s=t,`test${this.testExecutionResult.runnerId}_${s.test.join("_")}`));var s}))))),t.finished?Promise.resolve():new Promise(((t,s)=>setTimeout((()=>{try{t(this.pullTestRunnerResult(e))}catch(e){V(e),this.editorStore.applicationStore.notifyWarning("Failed to run test"+(e.message?`: ${e.message}`:"")),s(e)}}),1e3)))):(this.setTestResultInfo(void 0),Promise.resolve())}*rerunTestSuite(){this.editorStore.testRunState.isInProgress||(yield(0,x.fl)(this.editorStore.executeTests(this.testExecutionResult.path,this.testExecutionResult.relevantTestsOnly)))}*cancelTestRun(){this.editorStore.testRunState.isInProgress&&(yield this.editorStore.client.cancelTestRunner(this.testExecutionResult.runnerId),this.editorStore.applicationStore.notifyWarning(`Stopped running test (id: ${this.testExecutionResult.runnerId}) successfully!`))}}class ru{}class ou extends ru{error;errorDialog;text}(0,Be.yu)(ou,{error:(0,Be.Ru)(),errorDialog:(0,Be.Ru)(),text:(0,Be.Ru)()});class lu{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return H(this.networkClient.baseUrl,"Pure client has not been configured properly")}initialize=e=>this.networkClient.get(`${this.baseUrl}/initialize`,void 0,void 0,{requestCache:e,sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getInitializationActivity=()=>this.networkClient.get(`${this.baseUrl}/initializationActivity`,void 0,void 0,{sessionId:this.sessionId});getConceptActivity=()=>this.networkClient.get(`${this.baseUrl}/conceptsActivity`,void 0,void 0,{sessionId:this.sessionId});execute=(e,t,s)=>this.networkClient.post(`${this.baseUrl}/${t}`,{extraParams:s,openFiles:e},void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getExecutionActivity=()=>this.networkClient.get(`${this.baseUrl}/executionActivity`,void 0,void 0,{sessionId:this.sessionId});findFiles=(e,t)=>this.networkClient.get(`${this.baseUrl}/findPureFiles`,void 0,void 0,{file:e,regex:t});searchText=(e,t,s,i=2e3)=>this.networkClient.get(`${this.baseUrl}/findInSources`,void 0,void 0,{string:e,caseSensitive:t,regex:s,limit:i});getTextSearchPreview=e=>this.networkClient.post(`${this.baseUrl}/getTextSearchPreview`,e);checkTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCheck`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});cancelTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCancel`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});getConceptChildren=e=>this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::display_ide(String[1]):String[1]",param:e?`'${e}'`:"'::'",format:"raw",mode:this.mode,sessionId:this.sessionId});getConceptInfo=async(e,t,s)=>{const i=await this.networkClient.get(`${this.baseUrl}/getConceptInfo`,void 0,void 0,{file:e,line:t,column:s});if(i.error)throw new Error(i.text);return i};getUsages=async(e,t)=>{const s=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:e,param:t});return Array.isArray(s)?s:[s]};renameConcept=e=>this.networkClient.put(`${this.baseUrl}/renameConcept`,e);movePackageableElements=e=>this.networkClient.put(`${this.baseUrl}/movePackageableElements`,e);getPackageableElementsUsage=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:Xd.MULTIPLE_PATHS,param:[`'${e.join(",")}'`]});return Array.isArray(t)?t:[t]};getChildPackageableElements=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::getChildPackageableElements_String_1__String_MANY_",param:[`'${e}'`]});return(Array.isArray(t)?t:[t]).map((e=>JSON.parse(e)))};getFile=e=>this.networkClient.get(`${this.baseUrl}/fileAsJson/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getDirectoryChildren=e=>this.networkClient.get(`${this.baseUrl}/dir`,void 0,void 0,{parameters:e??"/",mode:this.mode,sessionId:this.sessionId});updateSource=e=>this.networkClient.put(`${this.baseUrl}/updateSource`,e);createFile=e=>this.networkClient.post(`${this.baseUrl}/newFile/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});createFolder=e=>this.networkClient.post(`${this.baseUrl}/newFolder/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});renameFile=(e,t)=>this.networkClient.put(`${this.baseUrl}/renameFile`,{oldPath:e,newPath:t},void 0);deleteDirectoryOrFile=e=>this.networkClient.delete(`${this.baseUrl}/deleteFile/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId});getDiagramInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramInfo_String_1__String_1_",param:[`'${e}'`]}));getDiagramClassInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramClassInfo_String_1__String_1_",param:[`'${e}'`]}));getSuggestionsForIncompletePath=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/incompletePath`,{path:e,types:t});getSuggestionsForIdentifier=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/identifier`,{importPaths:e,types:t});getSuggestionsForAttribute=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/attribute`,{importPaths:e,path:t});getSuggestionsForClass=e=>this.networkClient.post(`${this.baseUrl}/suggestion/class`,{importPaths:e});getSuggestionsForVariable=(e,t,s)=>this.networkClient.post(`${this.baseUrl}/suggestion/variable`,{sourceId:e,line:t,column:s})}class cu{_initialDefaultSize;_tempSize;size;defaultSize;snapSize;maxSize;constructor(e){this.size=e.initial,this._tempSize=e.default,this.defaultSize=e.default,this._initialDefaultSize=e.default,this.snapSize=e.snap,(0,x.rC)(this,{_tempSize:x.LO,size:x.LO,defaultSize:x.LO,snapSize:x.LO,maxSize:x.LO,isOpen:x.Fl,isMaximizable:x.Fl,isMaximized:x.Fl,setSize:x.aD,open:x.aD,close:x.aD,toggle:x.aD,setMaxSize:x.aD,maximize:x.aD,minimize:x.aD,toggleMaximize:x.aD})}get isOpen(){return 0!==this.size}get isMaximizable(){return void 0!==this.maxSize}get isMaximized(){return void 0!==this.maxSize&&this.size===this.maxSize}setSize(e){e=Math.max(e,0),this.maxSize&&(e=Math.min(e,this.maxSize)),this.size!==e&&(void 0!==this.snapSize?e>this.size?this.maxSize&&e>this.maxSize-this.snapSize?this.size=this.maxSize:this.size=e<this.snapSize?this.defaultSize:e:this.size=e<this.snapSize?0:e:this.size=e)}open(){0===this.size&&(this.size=this._tempSize)}close(){0!==this.size&&(this._tempSize=this.size||this.defaultSize,this.size=0)}toggle(){0===this.size?this.open():this.close()}setMaxSize(e){this._tempSize=Math.min(this._tempSize,e),this.size=Math.min(this.size,e),this.defaultSize=Math.min(this._initialDefaultSize,e),this.maxSize=e}maximize(){void 0!==this.maxSize&&this.size!==this.maxSize&&(this._tempSize=this.size,this.size=this.maxSize)}minimize(){void 0!==this.maxSize&&this.size===this.maxSize&&(this.size=this._tempSize===this.maxSize?this.defaultSize:this._tempSize)}toggleMaximize(){void 0!==this.maxSize&&(this.size===this.maxSize?this.minimize():this.maximize())}}var du,hu=s(1367);class uu{_UUID=(0,a.Z)();_OWNER;name;genericType;multiplicity;stereotypes=[];taggedValues=[];body;parameters;constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return qt([Jt.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues),ts(this.parameters,this.body)])}}class pu extends Es{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class mu extends pu{ownerReference;constructor(e){const t=Ts.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new mu(e)}}class _u{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class gu{_UUID=(0,a.Z)();_OWNER;name;multiplicity;genericType;aggregation;stereotypes=[];taggedValues=[];constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return qt([Jt.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues)])}}class Eu{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return qt([Jt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new Eu(0,0);static ZERO_ONE=new Eu(0,1);static ZERO_MANY=new Eu(0,void 0);static ONE=new Eu(1,1);static ONE_MANY=new Eu(1,void 0)}class fu extends Es{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Jt.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Xt).join(",")}}class Tu extends fu{ownerReference;constructor(e){const t=Ts.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Tu(e)}}class Cu extends ls{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new Cu(xe.STRING);static BOOLEAN=new Cu(xe.BOOLEAN);static BINARY=new Cu(xe.BINARY);static NUMBER=new Cu(xe.NUMBER);static INTEGER=new Cu(xe.INTEGER);static FLOAT=new Cu(xe.FLOAT);static DECIMAL=new Cu(xe.DECIMAL);static DATE=new Cu(xe.DATE);static STRICTDATE=new Cu(xe.STRICTDATE);static DATETIME=new Cu(xe.DATETIME);static STRICTTIME=new Cu(xe.STRICTTIME);static LATESTDATE=new Cu(xe.LATESTDATE)}!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(du=du||(du={}));class xu extends hc{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return qt([Zo.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const Nu=()=>new os(""),Au=(e,t)=>new gu("",Eu.ONE,mu.create(new _u(e)),t),Ou=(0,x.aD)(((e,t)=>{e.value=t})),Su=((0,x.aD)(((e,t)=>{M(e.properties,t)})),(0,x.aD)(((e,t)=>{b(e.properties,Lo(t))}))),yu=((0,x.aD)(((e,t,s)=>{D(e.properties,t,s)})),(0,x.aD)(((e,t)=>{M(e.derivedProperties,t)})),(0,x.aD)(((e,t)=>{b(e.derivedProperties,bo(t))})),(0,x.aD)(((e,t,s)=>{D(e.derivedProperties,t,s)})),(0,x.aD)(((e,t)=>{b(e.constraints,Mo(t))})),(0,x.aD)(((e,t)=>{M(e.constraints,t)})),(0,x.aD)(((e,t,s)=>{D(e.constraints,t,s)})),(0,x.aD)(((e,t)=>{b(e.generalizations,xo(t))}))),Iu=((0,x.aD)(((e,t)=>{M(e.generalizations,t)})),(0,x.aD)(((e,t,s)=>{D(e.generalizations,t,s)})),(0,x.aD)(((e,t)=>{b(e._subclasses,t)})),(0,x.aD)(((e,t)=>{M(e._subclasses,t)})),(0,x.aD)(((e,t)=>{xo(e),Co(t),e.value=t,e.ownerReference.value=t.rawType}))),vu=((0,x.aD)(((e,t)=>{e.name=t})),(0,x.aD)(((e,t)=>{Iu(e.genericType,Co(t))})),(0,x.aD)(((e,t)=>{e.multiplicity=t})),(0,x.aD)(((e,t)=>{e.aggregation=t})),(0,x.aD)(((e,t)=>{e.value=Oo(t),Ou(e.ownerReference,t._OWNER)})),(0,x.aD)(((e,t)=>{b(e.taggedValues,To(t))})),(0,x.aD)(((e,t)=>{M(e.taggedValues,t)})),(0,x.aD)(((e,t)=>{b(e.stereotypes,Eo(t))})),(0,x.aD)(((e,t)=>{M(e.stereotypes,t)})),(0,x.aD)(((e,t)=>{e.tag.value=So(t),e.tag.ownerReference.value=t._OWNER})),(0,x.aD)(((e,t)=>{e.value=t})),(0,x.aD)(((e,t)=>{e.value=t})),(0,x.aD)(((e,t,s)=>{D(e.taggedValues,t,s)})),(0,x.aD)(((e,t,s)=>{D(e.stereotypes,t,s)})),(0,x.aD)(((e,t)=>{e.name=t})),(0,x.aD)(((e,t)=>{e.functionDefinition=$s(t)})),(0,x.aD)(((e,t)=>{b(e.p_tags,So(t))})),(0,x.aD)(((e,t)=>{M(e.p_tags,t)})),(0,x.aD)(((e,t)=>{b(e.p_stereotypes,Oo(t))})),(0,x.aD)(((e,t)=>{M(e.p_stereotypes,t)})),(0,x.aD)(((e,t,s)=>{D(e.p_tags,t,s)})),(0,x.aD)(((e,t,s)=>{D(e.p_stereotypes,t,s)})),(0,x.aD)(((e,t)=>{M(e.parameters,t)})),(0,x.aD)(((e,t)=>{b(e.parameters,zs(t))})),(0,x.aD)(((e,t)=>{Ou(e.returnType,Uo(t))})),(0,x.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,x.aD)(((e,t,s)=>{D(e.parameters,t,s)})),(0,x.aD)(((e,t)=>{e.name=t})),(0,x.aD)(((e,t)=>{b(e.values,Io(t))})),(0,x.aD)(((e,t)=>{M(e.values,t)})),(0,x.aD)(((e,t,s)=>{D(e.values,t,s)})),(0,x.aD)(((e,t)=>{e.value=Io(t),Ou(e.ownerReference,t._OWNER)})),(0,x.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return q(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),H(e.properties[(s+1)%2])})(e,t),n=K(t.genericType.ownerReference.value,os,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&q(M(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),b(s.propertiesFromAssociations,i);const r=new _u(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,x.aD)(((e,t)=>{e.canonicalUnit=Po(t)})),(0,x.aD)(((e,t)=>{e.conversionFunction=$s(t)})),(0,x.aD)(((e,t)=>{e.classViews=t.map($o)}))),Ru=(0,x.aD)(((e,t)=>{b(e.classViews,$o(t))})),Pu=(0,x.aD)(((e,t)=>{M(e.classViews,t)})),wu=(0,x.aD)(((e,t)=>{e.associationViews=t.map(Yo)})),Lu=(0,x.aD)(((e,t)=>{M(e.associationViews,t)})),bu=(0,x.aD)(((e,t)=>{e.generalizationViews=t.map(Ho)})),Du=(0,x.aD)(((e,t)=>{b(e.generalizationViews,Ho(t))})),Mu=(0,x.aD)(((e,t)=>{M(e.generalizationViews,t)})),ku=(0,x.aD)(((e,t)=>{e.propertyViews=t.map(Wo)})),Fu=(0,x.aD)(((e,t)=>{b(e.propertyViews,Wo(t))})),ju=(0,x.aD)(((e,t)=>{M(e.propertyViews,t)})),Uu=(0,x.aD)(((e,t)=>{e.hideProperties=t})),Vu=(0,x.aD)(((e,t)=>{e.hideStereotypes=t})),Gu=(0,x.aD)(((e,t)=>{e.hideTaggedValues=t})),$u=(0,x.aD)(((e,t)=>{e._offsetX=t})),zu=(0,x.aD)(((e,t)=>{e._offsetY=t})),Bu=(0,x.aD)(((e,t,s)=>{((e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t)));-1!==n&&(e[n]=s)})(e.path,t,s)})),Hu=(0,x.aD)(Ec),Yu=(0,x.aD)(((e,t,s,i,n)=>{for(const n of e.path)if(Math.sqrt((t-n.x)*(t-n.x)+(s-n.y)*(s-n.y))<10/i)return n;const a=e.buildFullPath(n),r=[];let o;for(let e=0;e<a.length-1;e++){const n=a[e],l=a[e+1],c=new mc(n.x,n.y).normal(new mc(l.x,l.y)).unit(),d=mc.fromPoints(n,new ic(t,s));if(Math.abs(c.dotProduct(d))<5/i){const e=(n.x<l.x?n.x:l.x)-5/i,a=(n.x<l.x?l.x:n.x)+5/i,c=(n.y<l.y?n.y:l.y)-5/i,d=(n.y<l.y?l.y:n.y)+5/i;e<=t&&t<=a&&c<=s&&s<=d&&(o=new ic(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&gc(e,r),o})),Wu=(0,x.aD)(gc),Ku=(0,x.aD)(((e,t)=>{e.rectangle=t})),Zu=(0,x.aD)(((e,t)=>{e.position=t})),Xu=(0,x.aD)((e=>{e._dummyObservable={}}));var qu,Ju,Qu;!function(e){e[e.LAYOUT=0]="LAYOUT",e[e.PAN=1]="PAN",e[e.ZOOM_IN=2]="ZOOM_IN",e[e.ZOOM_OUT=3]="ZOOM_OUT",e[e.ADD_RELATIONSHIP=4]="ADD_RELATIONSHIP",e[e.ADD_CLASS=5]="ADD_CLASS"}(qu=qu||(qu={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(Ju=Ju||(Ju={})),function(e){e[e.ALIGN_LEFT=0]="ALIGN_LEFT",e[e.ALIGN_CENTER=1]="ALIGN_CENTER",e[e.ALIGN_RIGHT=2]="ALIGN_RIGHT",e[e.ALIGN_TOP=3]="ALIGN_TOP",e[e.ALIGN_MIDDLE=4]="ALIGN_MIDDLE",e[e.ALIGN_BOTTOM=5]="ALIGN_BOTTOM",e[e.SPACE_HORIZONTALLY=6]="SPACE_HORIZONTALLY",e[e.SPACE_VERTICALLY=7]="SPACE_VERTICALLY"}(Qu=Qu||(Qu={}));const ep=.05,tp=[50,75,90,100,110,125,150,200,250,300,400],sp=e=>(e instanceof uu?"/ ":"")+e.name;class ip{diagram;isReadOnly;div;canvas;ctx;canvasDimension;canvasCenter;virtualScreen;screenOffset;zoom;interactionMode;relationshipMode;triangle;diamond;fontFamily;fontSize;lineHeight;truncateText;maxLineLength;screenPadding;classViewSpaceX;classViewSpaceY;propertySpacing;showScreenGrid;showScreenBoxGuide;screenGridAxisTickLength;screenGridSpacingX;screenGridSpacingY;screenGridLineWidth;screenGridLineColor;screenGridLabelTextColor;screenGuideLineColor;screenGuideLabelTextColor;showCanvasGrid;showCanvasBoxGuide;showScreenOffsetGuide;canvasGridAxisTickLength;canvasGridSpacingX;canvasGridSpacingY;canvasGridLineWidth;canvasGridLineColor;canvasGridLabelTextColor;canvasGuideLineColor;canvasGuideLabelTextColor;screenOffsetGuideLineColor;screenOffsetGuideLabelTextColor;defaultLineWidth;defaultLineColor;canvasColor;backgroundColor;classViewFillColor;classViewHeaderTextColor;classViewPropertyTextColor;classViewPrimitivePropertyTextColor;classViewDerivedPropertyTextColor;relationshipViewTextColor;propertyViewOwnedDiamondColor;propertyViewSharedDiamondColor;generalizationViewInheritanceTriangeFillColor;selectionBoxBorderColor;selection;selectionStart;selectedClassCorner;selectedClassProperty;selectedClasses;selectedPropertyOrAssociation;selectedInheritance;selectedPoint;_selectedClassesInitialPositions;startClassView;handleAddRelationship;mouseOverClassCorner;mouseOverClassName;mouseOverClassView;mouseOverClassProperty;mouseOverPropertyHolderViewLabel;cursorPosition;leftClick;middleClick;rightClick;clickX;clickY;positionBeforeLastMove;onAddClassViewClick=()=>{};onClassViewRightClick=()=>{};onBackgroundDoubleClick;onClassViewDoubleClick;onClassNameDoubleClick;onClassPropertyDoubleClick;handleEditClassView=()=>{};handleEditProperty=()=>{};handleAddSimpleProperty=()=>{};constructor(e,t){(0,x.rC)(this,{isReadOnly:x.LO,interactionMode:x.LO,relationshipMode:x.LO,zoom:x.LO,mouseOverClassView:x.LO,mouseOverClassName:x.LO,mouseOverClassCorner:x.LO,mouseOverClassProperty:x.LO,mouseOverPropertyHolderViewLabel:x.LO,selectionStart:x.LO,selectedClassCorner:x.LO,selectedClasses:x.LO,selectedPropertyOrAssociation:x.LO,selectedInheritance:x.LO,leftClick:x.LO,middleClick:x.LO,rightClick:x.LO,changeMode:x.aD,setIsReadOnly:x.aD,setMouseOverClassView:x.aD,setMouseOverClassName:x.aD,setMouseOverClassCorner:x.aD,setMouseOverClassProperty:x.aD,setMouseOverPropertyHolderViewLabel:x.aD,setSelectionStart:x.aD,setSelectedClassCorner:x.aD,setSelectedClasses:x.aD,setSelectedPropertyOrAssociation:x.aD,setSelectedInheritance:x.aD,setLeftClick:x.aD,setMiddleClick:x.aD,setRightClick:x.aD,setZoomLevel:x.aD,align:x.aD}),this.diagram=t,this.div=e,this.div.childNodes.forEach((e=>this.div.removeChild(e))),this.canvas=document.createElement("canvas"),this.canvasDimension=new nc(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new ic(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height,this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.div.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.screenOffset=new ic(0,0),this.virtualScreen=new ac(new ic(0,0),new nc(0,0)),this.zoom=1,this.triangle=[new ic(0,0),new ic(-15,-10),new ic(-15,10)],this.diamond=[new ic(0,0),new ic(-10,-5),new ic(-20,0),new ic(-10,5)],this.fontFamily="Arial",this.fontSize=12,this.lineHeight=14,this.truncateText=!0,this.maxLineLength=40,this.showScreenGrid=!1,this.showScreenBoxGuide=!0,this.screenGridAxisTickLength=50,this.screenGridSpacingX=100,this.screenGridSpacingY=100,this.screenGridLineWidth=.5,this.showCanvasGrid=!1,this.showCanvasBoxGuide=!0,this.showScreenOffsetGuide=!0,this.canvasGridAxisTickLength=50,this.canvasGridSpacingX=100,this.canvasGridSpacingY=100,this.canvasGridLineWidth=.5,this.defaultLineWidth=1,this.screenGridLineColor="rgba(61,126,154,0.56)",this.screenGridLabelTextColor="rgba(61,126,154,0.56)",this.screenGuideLineColor="red",this.screenGuideLabelTextColor="red",this.canvasGridLineColor="green",this.canvasGridLabelTextColor="green",this.canvasGuideLineColor="orange",this.canvasGuideLabelTextColor="orange",this.screenOffsetGuideLineColor="purple",this.screenOffsetGuideLabelTextColor="purple",this.defaultLineColor="rgb(0,0,0)",this.canvasColor="rgb(220,220,220)",this.backgroundColor="rgb(255,255,255)",this.classViewFillColor="rgb(185,185,185)",this.classViewHeaderTextColor="rgb(0,0,0)",this.classViewPropertyTextColor="rgb(0,0,0)",this.classViewPrimitivePropertyTextColor="rgb(255,255,255)",this.classViewDerivedPropertyTextColor="rgb(100,100,100)",this.relationshipViewTextColor="rgb(0,0,0)",this.propertyViewSharedDiamondColor="rgb(255,255,255)",this.propertyViewOwnedDiamondColor="rgb(0,0,0)",this.generalizationViewInheritanceTriangeFillColor="rgb(255,255,255)",this.selectionBoxBorderColor="rgba(0,0,0, 0.02)",this.interactionMode=qu.LAYOUT,this.relationshipMode=Ju.NONE,this.isReadOnly=!1,this.screenPadding=20,this.classViewSpaceX=10,this.classViewSpaceY=4,this.propertySpacing=10,this.selectionStart=void 0,this.selection=void 0,this.selectedClasses=[],this._selectedClassesInitialPositions=[],this.cursorPosition=new ic(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new ic(0,0),this.div.onwheel=this.mousewheel.bind(this),this.div.onmousedown=this.mousedown.bind(this),this.div.onkeydown=this.keydown.bind(this),this.div.ondblclick=this.mousedblclick.bind(this),this.div.onmouseup=this.mouseup.bind(this),this.div.onmousemove=this.mousemove.bind(this)}setIsReadOnly(e){this.isReadOnly=e}setMouseOverClassView(e){this.mouseOverClassView=e}setMouseOverClassName(e){this.mouseOverClassName=e}setMouseOverClassCorner(e){this.mouseOverClassCorner=e}setMouseOverClassProperty(e){this.mouseOverClassProperty=e}setMouseOverPropertyHolderViewLabel(e){this.mouseOverPropertyHolderViewLabel=e}setSelectionStart(e){this.selectionStart=e}setSelectedClassCorner(e){this.selectedClassCorner=e}setSelectedClasses(e){this.selectedClasses=e}setSelectedPropertyOrAssociation(e){this.selectedPropertyOrAssociation=e}setSelectedInheritance(e){this.selectedInheritance=e}setLeftClick(e){this.leftClick=e}setMiddleClick(e){this.middleClick=e}setRightClick(e){this.rightClick=e}setZoomLevel(e){this.zoom=e}render(){this.diagram.classViews.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),this.refresh()}refresh(){this.refreshCanvas(),this.drawScreen()}refreshCanvas(){this.canvasDimension=new nc(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new ic(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height}clearScreen(){this.ctx.fillStyle=this.canvasColor,this.ctx.fillRect(0,0,this.canvasDimension.width,this.canvasDimension.height)}drawScreen(){this.manageVirtualScreen(),this.clearScreen(),this.drawAll()}autoRecenter(){this.center(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}center(e,t){this.screenOffset=new ic(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case qu.LAYOUT:case qu.PAN:case qu.ZOOM_IN:case qu.ZOOM_OUT:case qu.ADD_CLASS:if(t!==Ju.NONE)throw new j(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case qu.ADD_RELATIONSHIP:if(t===Ju.NONE)throw new j("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new U(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===qu.ADD_RELATIONSHIP)switch(t){case Ju.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||Kl(e.class.value).includes(t.class.value)||Kl(t.class.value).includes(e.class.value)||yu(e.class.value,mu.create(new _u(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new pc(this.diagram,e,t);return Du(this.diagram,s),s}};break;case Ju.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new gu(`property_${e.class.value.properties.length+1}`,Eu.ONE,mu.create(new _u(t.class.value)),e.class.value);if(Su(e.class.value,s),e!==t){const i=new uc(this.diagram,Tu.create(s),e,t);return Fu(this.diagram,i),i}};break;default:throw new U(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case Qu.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Zu(t,new ic(e,t.position.y))));break}case Qu.ALIGN_CENTER:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.x+t.rectangle.width/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>Zu(t,new ic(e-t.rectangle.width/2,t.position.y))));break}case Qu.ALIGN_RIGHT:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.x+t.rectangle.width)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Zu(t,new ic(e-t.rectangle.width,t.position.y))));break}case Qu.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Zu(t,new ic(t.position.x,e))));break}case Qu.ALIGN_MIDDLE:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.y+t.rectangle.height/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>Zu(t,new ic(t.position.x,e-t.rectangle.height/2))));break}case Qu.ALIGN_BOTTOM:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.y+t.rectangle.height)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Zu(t,new ic(t.position.x,e-t.rectangle.height))));break}case Qu.SPACE_HORIZONTALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.x-t.position.x));if(2===e.length){const t=e[0],s=e[1];Zu(s,new ic(t.position.x+t.rectangle.width,s.position.y))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.x-(i.position.x+i.rectangle.width))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];Zu(n,new ic(i.position.x+i.rectangle.width+s,n.position.y))}}break}case Qu.SPACE_VERTICALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.y-t.position.y));if(2===e.length){const t=e[0],s=e[1];Zu(s,new ic(s.position.x,t.position.y+t.rectangle.height))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.y-(i.position.y+i.rectangle.height))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];Zu(n,new ic(n.position.x,i.position.y+i.rectangle.height+s))}}break}}this.drawScreen()}}truncateTextWithEllipsis(e,t=this.maxLineLength){return e.length>t?`${e.substring(0,t+1-"...".length)}...`:e}canvasCoordinateToModelCoordinate(e){return new ic((e.x-this.canvasCenter.x)/this.zoom-this.screenOffset.x+this.canvasCenter.x,(e.y-this.canvasCenter.y)/this.zoom-this.screenOffset.y+this.canvasCenter.y)}modelCoordinateToCanvasCoordinate(e){return new ic((e.x-this.canvasCenter.x+this.screenOffset.x)*this.zoom+this.canvasCenter.x,(e.y-this.canvasCenter.y+this.screenOffset.y)*this.zoom+this.canvasCenter.y)}eventCoordinateToCanvasCoordinate(e){return new ic(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new ic(e.x-this.div.scrollLeft+this.divPosition.x,e.y-this.div.scrollTop+this.divPosition.y)}hasPropertyView(e,t){return this.diagram.propertyViews.filter((s=>s.property.value===t&&s.from.classView.value===e)).length>0}get divPosition(){return(e=>{let t=0,s=0;for(;e.offsetParent;)t+=e.offsetLeft-e.scrollLeft+e.clientLeft,s+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent;return new ic(t,s)})(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=H(this.diagram.classViews[0]);let t=e.position.x,s=e.position.y,i=e.position.x+e.rectangle.width,n=e.position.y+e.rectangle.height;for(const e of this.diagram.classViews)t=Math.min(t,e.position.x),s=Math.min(s,e.position.y),i=Math.max(i,e.position.x+e.rectangle.width),n=Math.max(n,e.position.y+e.rectangle.height);const a=this.diagram.associationViews.concat(this.diagram.generalizationViews).concat(this.diagram.propertyViews);for(const e of a){const a=dc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof uc){const r=this.drawLinePropertyText(a[a.length-2],a[a.length-1],e.to.classView.value,e.property.value,!1);t=Math.min(t,r.position.x),s=Math.min(s,r.position.y),i=Math.max(i,Cc(r).x),n=Math.max(n,Cc(r).y)}for(const a of e.path)t=Math.min(t,a.x),s=Math.min(s,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y)}this.virtualScreen=new ac(new ic(t,s),new nc(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new ic(0,0),this.virtualScreen=new ac(new ic(this.canvasDimension.width/2,this.canvasDimension.height/2),new nc(0,0))}executeZoom(e,t){e=Math.max(e,ep);const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)),i=this.zoom;this.setZoomLevel(e),this.screenOffset=new ic(((s.x-this.canvasCenter.x)*(i-e)+this.screenOffset.x*i)/e,((s.y-this.canvasCenter.y)*(i-e)+this.screenOffset.y*i)/e),this.clearScreen(),this.drawAll()}zoomPoint(e,t){this.executeZoom(e,t)}zoomCenter(e){this.setZoomLevel(Math.max(e,ep)),this.clearScreen(),this.drawAll()}zoomToFit(){this.autoRecenter(),this.zoomCenter(Math.max(Math.min(this.canvas.width/(this.virtualScreen.rectangle.width+2*this.screenPadding+20),this.canvas.height/(this.virtualScreen.rectangle.height+2*this.screenPadding+20)),ep))}addClassView(e,t){if(!this.isReadOnly){const s=this.diagram.classViews.map((e=>e.id));let i=(0,a.Z)();for(;s.includes(i);)i=(0,a.Z)();const n=new rc(this.diagram,i,Ts.create(e));return Zu(n,t??this.canvasCoordinateToModelCoordinate(new ic(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),Ru(this.diagram,n),Xu(n),this.diagram.classViews.filter((t=>t.class.value!==e)).forEach((t=>{const s=t.class.value;e.generalizations.map((e=>e.value.rawType)).includes(s)&&Du(this.diagram,new pc(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&Du(this.diagram,new pc(this.diagram,t,n)),Zl(e).forEach((e=>{e.genericType.value.rawType===s&&Fu(this.diagram,new uc(this.diagram,Tu.create(e),n,t))})),Zl(s).forEach((s=>{s.genericType.value.rawType===e&&Fu(this.diagram,new uc(this.diagram,Tu.create(s),t,n))}))})),this.drawClassView(n),this.drawScreen(),n}}drawBoundingBox(){this.ctx.fillStyle=this.backgroundColor,this.ctx.lineWidth=1,this.ctx.fillRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom),this.ctx.strokeRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom)}drawDiagram(){this.diagram.associationViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.generalizationViews.forEach((e=>this.drawInheritance(e))),this.diagram.propertyViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.classViews.forEach((e=>this.drawClassView(e))),this.showCanvasGrid&&this.drawCanvasGrid(),this.showScreenGrid&&this.drawScreenGrid()}drawAll(){this.drawBoundingBox(),this.drawDiagram()}drawScreenGrid(){const e=(this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t=(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y,s=(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,i=(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom;this.ctx.beginPath(),this.ctx.fillStyle=this.screenGridLabelTextColor,this.ctx.strokeStyle=this.screenGridLineColor,this.ctx.lineWidth=this.screenGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`;let n=0;for(let a=e;a<e+s-2*this.screenPadding;a+=this.screenGridSpacingX*this.zoom)this.ctx.fillText(`${n}`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+n)}]`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding-this.lineHeight)*this.zoom),this.ctx.moveTo(a,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.lineTo(a,t+i-this.screenPadding*this.zoom),this.ctx.stroke(),n+=this.screenGridSpacingX;let a=0;for(let n=t;n<t+i-2*this.screenPadding;n+=this.screenGridSpacingY*this.zoom)this.ctx.fillText(`${a}`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+a)}]`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+(5+this.lineHeight)*this.zoom),this.ctx.moveTo(e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n),this.ctx.lineTo(e+s-this.screenPadding*this.zoom,n),this.ctx.stroke(),a+=this.screenGridSpacingY;this.showScreenBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.screenGuideLabelTextColor,this.ctx.strokeStyle=this.screenGuideLineColor,this.ctx.moveTo(e,t),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.lineTo(e,t),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.width/2)}`,e+s/2-(this.screenPadding-5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2)}]`,e+s/2-(this.screenPadding-5)*this.zoom,t+(5+this.lineHeight)*this.zoom),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.height/2)}`,e+5*this.zoom,t+i/2-(this.screenPadding-5)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}]`,e+5*this.zoom,t+i/2-(this.screenPadding-5-this.lineHeight)*this.zoom),this.ctx.lineTo(e,t+i/2-this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i/2-this.screenPadding*this.zoom),this.ctx.stroke()),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawCanvasGrid(){const e=-this.canvasCenter.x*this.zoom+this.canvasCenter.x,t=-this.canvasCenter.y*this.zoom+this.canvasCenter.y,s=this.canvasDimension.width,i=this.canvasDimension.height;this.ctx.setLineDash([5,5]),this.ctx.fillStyle=this.canvasGridLabelTextColor,this.ctx.strokeStyle=this.canvasGridLineColor,this.ctx.lineWidth=this.canvasGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,this.ctx.beginPath();let n=0;for(let t=e;t<s;t+=this.canvasGridSpacingX*this.zoom)0!==t&&this.ctx.fillText(`[${Math.round(n)}]`,t+5*this.zoom,5*this.zoom),this.ctx.moveTo(t,0),this.ctx.lineTo(t,i),this.ctx.stroke(),n+=this.canvasGridSpacingX;let a=0;for(let e=t;e<i;e+=this.canvasGridSpacingY*this.zoom)0!==e&&this.ctx.fillText(`[${Math.round(a)}]`,5*this.zoom,e+5*this.zoom),this.ctx.moveTo(0,e),this.ctx.lineTo(s,e),this.ctx.stroke(),a+=this.canvasGridSpacingY;if(this.showCanvasBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.canvasGuideLabelTextColor,this.ctx.strokeStyle=this.canvasGuideLineColor,this.ctx.fillText(`[${Math.round(s/2)}]`,s/2+5*this.zoom,5*this.zoom),this.ctx.moveTo(s/2,0),this.ctx.lineTo(s/2,i),this.ctx.stroke(),this.ctx.fillText(`[${Math.round(i/2)}]`,5*this.zoom,i/2+5*this.zoom),this.ctx.moveTo(0,i/2),this.ctx.lineTo(s,i/2),this.ctx.stroke()),this.showScreenOffsetGuide){const s=5,i=35;this.ctx.beginPath(),this.ctx.setLineDash([]),this.ctx.fillStyle=this.screenOffsetGuideLabelTextColor,this.ctx.strokeStyle=this.screenOffsetGuideLineColor,this.ctx.arc(e+this.screenOffset.x*this.zoom,t+this.screenOffset.y*this.zoom,s*this.zoom,0,2*Math.PI),this.ctx.moveTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x+2*s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y+2*s)*this.zoom),this.ctx.stroke(),this.ctx.setLineDash([5,5]),this.ctx.moveTo(e,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+0),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.stroke(),this.ctx.beginPath(),this.screenOffset.x>=i&&this.screenOffset.y>=i?(this.ctx.fillText(`[${Math.round(this.screenOffset.x)}]`,e+(this.screenOffset.x+5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.screenOffset.y)}]`,e+5*this.zoom,t+(this.screenOffset.y+5)*this.zoom)):this.screenOffset.x>=0&&this.screenOffset.y>=0?this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(this.screenOffset.x+s+5)*this.zoom,t+(this.screenOffset.y+s+5)*this.zoom):this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(s+5)*this.zoom,t+(s+5)*this.zoom)}this.ctx.setLineDash([]),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawClassViewProperty(e,t,s,i,n){this.ctx.font=this.mouseOverClassView===e&&this.mouseOverClassProperty===t?`bold ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`:`${n?"bold":""} ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const a=sp(t);let r=this.ctx.measureText(`${a} : `).width;n||(this.ctx.fillText(`${a} : `,s,i),this.ctx.fillText(t.genericType.value.rawType.name,s+r,i),t.genericType.value.rawType instanceof cs&&(this.ctx.beginPath(),this.ctx.moveTo(s+r,i+(this.fontSize-1)*this.zoom),this.ctx.lineTo(s+r+this.ctx.measureText(t.genericType.value.rawType.name).width,i+(this.fontSize-1)*this.zoom),this.ctx.stroke())),r+=this.ctx.measureText(t.genericType.value.rawType.name).width,this.ctx.font=`${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const o=Ve(t.multiplicity.lowerBound,t.multiplicity.upperBound);return n||this.ctx.fillText(`[${o}]`,s+r,i),r+=this.ctx.measureText(`[${o}]`).width,r}computeClassNameWidth(e){return this.ctx.font=`bold ${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top",this.ctx.measureText(this.truncateTextWithEllipsis(e.class.value.name)).width}ensureClassViewMeetMinDimensions(e){let t=this.computeClassNameWidth(e),s=this.lineHeight+2*this.classViewSpaceY;if(!e.hideStereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;for(const i of e.class.value.stereotypes){const e=`<< ${this.truncateTextWithEllipsis(i.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(!e.hideTaggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top";for(const i of e.class.value.taggedValues){const e=`{ ${this.truncateTextWithEllipsis(`${i.tag.value.value} = ${i.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(e.hideProperties||(Zl(e.class.value).forEach((i=>{if(!this.hasPropertyView(e,i)){const n=this.drawClassViewProperty(e,i,0,0,!0);t=Math.max(t,n),s+=this.lineHeight}})),s+=2*this.classViewSpaceY),t+=2*this.classViewSpaceX,!this.isReadOnly){const i=e.rectangle.width&&e.rectangle.width>t?e.rectangle.width:t,n=e.rectangle.height&&e.rectangle.height>s?e.rectangle.height:s;Ku(e,new nc(i,n))}}drawClassView(e){const t=this.computeClassNameWidth(e);this.ensureClassViewMeetMinDimensions(e),this.ctx.fillStyle=this.classViewFillColor;const s=this.modelCoordinateToCanvasCoordinate(e.position);this.ctx.fillRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom),this.ctx.lineWidth=0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(e)?2:1,this.ctx.strokeRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom);const i=e.position.x,n=e.position.y;this.ctx.lineWidth=1,this.ctx.fillStyle=this.classViewHeaderTextColor;let a=n;if(this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,!e.hideStereotypes)for(const t of e.class.value.stereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`<< ${this.truncateTextWithEllipsis(t.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}this.ctx.font=`bold ${this.fontSize*this.zoom}px ${this.fontFamily}`;const r=this.truncateTextWithEllipsis(e.class.value.name);if(this.ctx.fillText(r,(i+this.screenOffset.x+(e.rectangle.width-t)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight,!e.hideTaggedValues)for(const t of e.class.value.taggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`{ ${this.truncateTextWithEllipsis(`${t.tag.value.value} = ${t.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}if(a+=3*this.classViewSpaceY,!e.hideProperties){this.ctx.beginPath();const t=(n+this.screenOffset.y+this.lineHeight+(e.hideStereotypes?0:e.class.value.stereotypes.length*this.lineHeight)+(e.hideTaggedValues?0:e.class.value.taggedValues.length*this.lineHeight)+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.ctx.moveTo((i+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.lineTo((i+this.screenOffset.x+e.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.stroke();for(const t of Zl(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof uu?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof Cu?this.classViewPrimitivePropertyTextColor:this.classViewPropertyTextColor;const s=(i+this.screenOffset.x+this.classViewSpaceX-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,n=(a+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.drawClassViewProperty(e,t,s,n,!1),a+=this.lineHeight}}Xu(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=sp(e),o=Ve(e.multiplicity.lowerBound,e.multiplicity.upperBound),l=this.ctx.measureText(r).width,c=this.ctx.measureText(o).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`;const d=t(l),h=s(l),u=this.modelCoordinateToCanvasCoordinate(new ic(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),m=n(c),_=this.modelCoordinateToCanvasCoordinate(new ic(i(c),n(c)));a||this.ctx.fillText(o,_.x,_.y);const g=new ic(Math.min(d,p),Math.min(h,m));return new ac(g,new nc(Math.max(d,p)+Math.max(l,c)-g.x,Math.max(h,m)+this.lineHeight-g.y))}drawLinePropertyText(e,t,s,i,n){this.ctx.textBaseline="top",this.ctx.fillStyle=this.relationshipViewTextColor;const a=e.x,r=e.y,o=t.x,l=t.y,c=s.rectangle;if(r<l){const e=a+(o-a)/(l-r)*(s.position.y-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),n)}else{const e=a+(o-a)/(l-r)*(s.position.y+c.height-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),n)}if(a<o){const e=r+(l-r)/(o-a)*(s.position.x-a);if(e>s.position.y&&e<s.position.y+c.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}else{const e=r+(l-r)/(o-a)*(s.position.x+s.rectangle.width-a);if(e>s.position.y&&e<s.position.y+s.rectangle.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}return new ac(new ic(0,0),new nc(0,0))}drawPropertyOrAssociation(e){const t=dc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),s=e.property.value;if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,s,!1),this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedPropertyOrAssociation?2:1,t.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke(),this.ctx.lineWidth=1,s instanceof gu){const i=t[1],n=t[0],a=i.x,r=i.y,o=n.x,l=n.y,c=e.from;let d=0,h=0;if(l>r){const e=a+(o-a)/(l-r)*(c.classView.value.position.y-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=a+(o-a)/(l-r)*(c.classView.value.position.y+c.classView.value.rectangle.height-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y+c.classView.value.rectangle.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(o>a){const e=r+(l-r)/(o-a)*(c.classView.value.position.x-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=r+(l-r)/(o-a)*(c.classView.value.position.x+c.classView.value.rectangle.width-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x+c.classView.value.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(s.aggregation===du.COMPOSITE||s.aggregation===du.SHARED){let e=Math.atan((l-r)/(o-a));e=o>=a?e:e+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(d+(this.screenOffset.x+fc(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+Tc(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+fc(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+Tc(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+fc(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+Tc(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+fc(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+Tc(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+fc(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+Tc(this.diamond[0],e))*this.zoom),s.aggregation===du.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===du.COMPOSITE&&(this.ctx.fillStyle=this.propertyViewOwnedDiamondColor),this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}}}drawInheritance(e){const t=e.to.classView.value.rectangle,s=dc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),i=s[s.length-2].x,n=s[s.length-2].y,a=s[s.length-1].x,r=s[s.length-1].y;let o=0,l=0;if(r>n){const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y+t.height-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y+t.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(a>i){const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x+t.width-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x+t.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedInheritance?2:1,s.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke();let c=Math.atan((r-n)/(a-i));c=a>=i?c:c+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(o+(this.screenOffset.x+fc(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+Tc(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+fc(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+Tc(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+fc(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+Tc(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+fc(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+Tc(this.triangle[0],c))*this.zoom),this.ctx.fillStyle=this.generalizationViewInheritanceTriangeFillColor,this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}reorderDiagramDomain(e,t){const s=t.classViews.filter((t=>t!==e));return s.push(e),s}potentiallyShiftRelationships(e,t,s,i){e.forEach((e=>{-1!==t.indexOf(e.from.classView.value)&&-1!==t.indexOf(e.to.classView.value)&&Wu(e,e.path.map((e=>new ic(e.x-s,e.y-i))))}))}recenter(){if(0!==this.selectedClasses.length){const e=P(this.selectedClasses);e&&this.center(e.position.x+e.rectangle.width/2,e.position.y+e.rectangle.height/2)}else this.autoRecenter()}switchToZoomMode(){this.changeMode(this.interactionMode!==qu.ZOOM_IN?qu.ZOOM_IN:qu.ZOOM_OUT,Ju.NONE)}switchToViewMode(){this.changeMode(qu.LAYOUT,Ju.NONE)}switchToPanMode(){this.changeMode(qu.PAN,Ju.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(qu.ADD_RELATIONSHIP,Ju.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(qu.ADD_RELATIONSHIP,Ju.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(qu.ADD_CLASS,Ju.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof os&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new ic(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof os&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}keydown(e){var t;if(t=e,document.getElementById(vd)?.dispatchEvent(new KeyboardEvent(t.type,t)),"Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{Pu(this.diagram,e),wu(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),bu(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),ku(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof xu?Lu(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof uc&&ju(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&Mu(this.diagram,this.selectedInheritance),this.setSelectedClasses([]),this.drawScreen());else if("KeyE"===e.code)this.selectedClassProperty?(this.handleEditProperty(this.selectedClassProperty.property,this.selectedClassProperty.selectionPoint,void 0),e.preventDefault()):this.selectedPropertyOrAssociation?(this.handleEditProperty(this.selectedPropertyOrAssociation.property.value,this.selectedPoint??(this.selectedPropertyOrAssociation.path.length?this.selectedPropertyOrAssociation.path[0]:this.selectedPropertyOrAssociation.from.classView.value.center()),this.selectedPropertyOrAssociation),e.preventDefault()):1===this.selectedClasses.length&&this.handleEditClassView(this.selectedClasses[0]);else if(e.altKey&&"KeyP"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Uu(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Vu(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Gu(e,!e.hideTaggedValues)})),this.drawScreen());else if(e.altKey&&"ArrowDown"===e.code)this.isReadOnly||1!==this.selectedClasses.length||this.handleAddSimpleProperty(this.selectedClasses[0]);else if("ArrowUp"===e.code){const e=this.getSuperTypeLevels(this.selectedClasses,this.diagram,0,1),t=this.layoutTaxonomy(e,this.diagram,!1,!0);t[0].forEach((e=>Ru(this.diagram,e))),t[1].forEach((e=>Du(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,hu.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new rc(this.diagram,(0,a.Z)(),Ts.create(e)))))),(e=>e.class.value));if(e.length>0){e.forEach((e=>this.ensureClassViewMeetMinDimensions(e)));const t=this.layoutTaxonomy([e,this.selectedClasses],this.diagram,!1,!1);t[0].forEach((e=>Ru(this.diagram,e))),t[1].forEach((e=>Du(this.diagram,e)))}this.drawScreen()}}mouseup(e){if(!this.isReadOnly)switch(this.interactionMode){case qu.LAYOUT:this.diagram.generalizationViews.forEach((e=>Hu(e))),this.diagram.associationViews.forEach((e=>Hu(e))),this.diagram.propertyViews.forEach((e=>Hu(e)));break;case qu.ADD_CLASS:{const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)));this.onAddClassViewClick(t),this.changeMode(qu.LAYOUT,Ju.NONE);break}case qu.ZOOM_IN:{const t=Math.round(100*this.zoom);let s;s=t<=tp[0]-10?10*Math.floor(t/10)+10:t>=tp[tp.length-1]?100*Math.floor(t/100)+100:H(tp.find((e=>e>t))),this.zoomPoint(s/100,new ic(e.x,e.y));break}case qu.ZOOM_OUT:{const t=Math.round(100*this.zoom);let s;s=t<=tp[0]?10*Math.ceil(t/10)-10:t>=tp[tp.length-1]+100?100*Math.ceil(t/100)-100:H((0,Fl.Z)(tp,(e=>e<t))),this.zoomPoint(s/100,new ic(e.x,e.y));break}case qu.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)));for(let e=this.diagram.classViews.length-1;e>=0;e--){const s=this.diagram.classViews[e];if(s.contains(t.x,t.y)){const e=this.handleAddRelationship(this.startClassView,s);e&&($u(e.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),zu(e.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),$u(e.to,-(s.position.x+s.rectangle.width/2-t.x)),zu(e.to,-(s.position.y+s.rectangle.height/2-t.y)))}}this.changeMode(qu.LAYOUT,Ju.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){if([qu.ADD_RELATIONSHIP,qu.ADD_CLASS,qu.ZOOM_IN,qu.ZOOM_OUT].includes(this.interactionMode))return;const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)));if(this.mouseOverClassProperty&&this.onClassPropertyDoubleClick)return void this.onClassPropertyDoubleClick(this.mouseOverClassProperty,t,void 0);if(this.mouseOverClassName&&this.onClassNameDoubleClick)return void this.onClassNameDoubleClick(this.mouseOverClassName,t);const s=this.diagram.classViews.find((e=>e.contains(t.x,t.y)));s&&this.onClassViewDoubleClick?this.onClassViewDoubleClick(s,t):this.mouseOverPropertyHolderViewLabel&&this.onClassPropertyDoubleClick?this.onClassPropertyDoubleClick(this.mouseOverPropertyHolderViewLabel.property.value,t,this.mouseOverPropertyHolderViewLabel):this.onBackgroundDoubleClick&&this.onBackgroundDoubleClick(t)}mousedown(e){this.setSelectionStart(void 0),this.setSelectedClassCorner(void 0),this.setSelectedPropertyOrAssociation(void 0),this.setSelectedInheritance(void 0),this.selection=void 0,this.selectedClassProperty=void 0,this.selectedPoint=void 0,this.startClassView=void 0;const t=this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case qu.PAN:return void(this.positionBeforeLastMove=new ic(e.x,e.y));case qu.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(xc(t).contains(s.x,s.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||vu(this.diagram,this.reorderDiagramDomain(H(this.selectedClassCorner),this.diagram));break}}if(!this.selectedClassCorner)if(this.mouseOverClassProperty)this.selectedClassProperty={property:this.mouseOverClassProperty,selectionPoint:s},this.setSelectedClasses([]);else{let e=!1;for(let i=this.diagram.classViews.length-1;i>=0;i--){const n=this.diagram.classViews[i];if(n.contains(s.x,s.y)){0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(n)||this.setSelectedClasses([n]),this.isReadOnly||vu(this.diagram,this.reorderDiagramDomain(this.selectedClasses[0],this.diagram)),this.clickX=t.x/this.zoom-this.screenOffset.x,this.clickY=t.y/this.zoom-this.screenOffset.y,this._selectedClassesInitialPositions=this.selectedClasses.map((e=>({classView:e,oldPos:new ic(e.position.x,e.position.y)}))),e=!0;break}}if(e||this.setSelectedClasses([]),!this.selectedClasses.length){for(const e of this.diagram.generalizationViews){const t=Yu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedInheritance(e);break}}if(!this.selectedPoint)for(const e of this.diagram.associationViews){const t=Yu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}if(!this.selectedPoint)for(const e of this.diagram.propertyViews){const t=Yu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}this.selectedPoint||this.setSelectionStart(s)}}break;case qu.ADD_RELATIONSHIP:this.setSelectionStart(s),this.startClassView=void 0;for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];t.contains(s.x,s.y)&&(this.startClassView=t)}this.startClassView||this.changeMode(qu.LAYOUT,Ju.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=new ic(e.x,e.y));if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=new ic(e.x,e.y),void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,s),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){if(e.preventDefault(),e.stopImmediatePropagation(),Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;const t=this.zoom-e.deltaY/120*.05;this.executeZoom(t,new ic(e.x,e.y))}mousemove(e){if(this.cursorPosition=new ic(e.x,e.y),this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===qu.PAN)this.screenOffset=new ic(this.screenOffset.x+(e.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(e.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=new ic(e.x,e.y),this.clearScreen(),this.drawAll();else if(this.leftClick){const t=this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);switch(this.interactionMode){case qu.LAYOUT:if(this.selectedClassCorner&&(Ku(this.selectedClassCorner,new nc(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Xu(this.selectedClassCorner),this.drawClassView(this.selectedClassCorner),this.drawScreen()),!this.selectionStart&&this.selectedClasses.length&&!this.isReadOnly){let e=0,s=0;this.selectedClasses.forEach(((i,n)=>{const a=this._selectedClassesInitialPositions.length>n?this._selectedClassesInitialPositions[n]:void 0;if(a){const n=t.x/this.zoom-this.screenOffset.x-(this.clickX-a.oldPos.x),r=t.y/this.zoom-this.screenOffset.y-(this.clickY-a.oldPos.y);e=i.position.x-n,s=i.position.y-r,Zu(i,new ic(n,r)),Xu(i)}})),this.potentiallyShiftRelationships(this.diagram.associationViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.propertyViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.generalizationViews,this.selectedClasses,e,s),this.drawScreen()}if(this.selectedPoint&&(this.selectedPropertyOrAssociation?Bu(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&Bu(this.selectedInheritance,this.selectedPoint,s),this.selectedPoint=s,this.drawScreen()),this.selectionStart){this.clearScreen(),this.drawAll();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.fillStyle=this.selectionBoxBorderColor,this.ctx.fillRect(e.x,e.y,t.x-e.x,t.y-e.y),this.ctx.strokeRect(e.x,e.y,t.x-e.x,t.y-e.y);const s=(t.x-e.x)/this.zoom,i=(t.y-e.y)/this.zoom;this.selection=new ac(new ic(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new nc(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(Nc(this.selection,e)||Nc(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case qu.ADD_RELATIONSHIP:if(this.selectionStart&&this.startClassView){this.clearScreen(),this.drawBoundingBox();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(t.x,t.y),this.ctx.stroke(),this.drawDiagram()}}}else{this.drawScreen();const t=this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);this.setMouseOverClassView(void 0),this.setMouseOverClassName(void 0),this.setMouseOverClassCorner(void 0),this.setMouseOverClassProperty(void 0),this.setMouseOverPropertyHolderViewLabel(void 0);for(const e of this.diagram.classViews.slice().reverse())if(e.contains(s.x,s.y)){this.setMouseOverClassView(e),xc(e).contains(s.x,s.y)&&this.setMouseOverClassCorner(e);const i=e.class.value;let n=e.position.y+this.classViewSpaceY;n+=e.hideStereotypes?0:i.stereotypes.length*this.fontSize;const a=this.computeClassNameWidth(e);new ac(this.modelCoordinateToCanvasCoordinate(new ic(e.position.x+(e.rectangle.width-a)/2,n)),new nc(a,this.lineHeight)).contains(t.x,t.y)&&this.setMouseOverClassName(e),n+=this.lineHeight,n+=e.hideTaggedValues?0:i.taggedValues.length*this.fontSize,n+=this.classViewSpaceY;for(const s of Zl(i))this.hasPropertyView(e,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new ac(this.modelCoordinateToCanvasCoordinate(new ic(e.position.x+this.classViewSpaceX,n)),new nc(this.drawClassViewProperty(e,s,0,0,!0)*this.zoom,this.fontSize*this.zoom)).contains(t.x,t.y)&&this.setMouseOverClassProperty(s),n+=this.fontSize);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=dc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,e.property.value,!1).contains(s.x,s.y)){this.setMouseOverPropertyHolderViewLabel(e);break}}}}getSuperTypeLevels(e,t,s,i){if(e.length){const n=(0,hu.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new rc(t,(0,a.Z)(),Ts.create(Wl(e.value,os))))))),(e=>e.class.value));if(n.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),-1===i||s<i){const a=this.getSuperTypeLevels(n,t,s+1,i);return a.push(e),a}return[e]}return[]}layoutTaxonomy(e,t,s,i){return e.reverse(),[e.flatMap(((t,n)=>{let a=0,r=0,o=0,l=0;if(n>0){const t=e[n-1];if(t.length){const e=[...t].sort(((e,t)=>e.position.x-t.position.x));o=e[0].position.x,a=e[e.length-1].position.x+e[e.length-1].rectangle.width-e[0].position.x;const s=[...t].sort(((e,t)=>e.position.y-t.position.y));l=s[0].position.y,r=s[s.length-1].position.y+s[s.length-1].rectangle.height-s[0].position.y}}const c=Math.max(...t.map((e=>e.rectangle.height))),d=o+a/2-t.map((e=>e.rectangle.width)).reduce(((e,t)=>e+t+10))/2,h=i?l-c-30:l+r+30;return(s||n>0)&&(Zu(t[0],new ic(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];Zu(e,new ic(i.position.x+i.rectangle.width+10,h))}}))),t})),(i?e:e.slice().reverse()).slice(0,e.length-1).flatMap(((s,i)=>s.flatMap((s=>e[i+1].flatMap((e=>s.class.value.generalizations.map((e=>e.value.rawType)).includes(e.class.value)?new pc(t,s,e):[]))))))]}}class np{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return qt([Jt.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class ap extends Es{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Jt.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Xt).join(",")}}class rp extends ap{ownerReference;constructor(e){const t=Ts.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new rp(e)}}class op extends Es{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Jt.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Xt).join(",")}}class lp extends op{ownerReference;constructor(e){const t=Ts.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new lp(e)}}class cp extends as{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[Au(Nu(),Nu()),Au(Nu(),Nu())];t[0]._OWNER=this,t[1]._OWNER=this,this.properties=t}get _elementHashCode(){return qt([Jt.ASSOCIATION,this.path,qt(this.properties),qt(this.derivedProperties),qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class dp extends as{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return qt([Jt.MAPPING,this.path,qt(this.classMappings),qt(this.enumerationMappings),qt(this.associationMappings),qt(this.test),qt(this.includes),qt(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class hp extends as{p_stereotypes=[];p_tags=[];get _elementHashCode(){return qt([Jt.PROFILE,this.path,qt(this.p_stereotypes.map((e=>e.value))),qt(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class up extends as{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];postValidations=[];get patternParameters(){return(0,Xe.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return qt([Jt.SERVICE,qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues),this.path,this.pattern,qt(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",qt(this.tests),qt(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class pp extends as{functionName;constructor(e){super(e),this.functionName=e}}class mp extends pp{}class _p extends mp{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return qt([Jt.FUNCTION,this.path,qt(this.parameters),this.returnType.valueForSerialization??"",qt(this.taggedValues),qt(this.stereotypes.map((e=>e.pointerHashCode))),ts(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class gp extends as{includes=[]}class Ep extends gp{sections=[];get _elementHashCode(){return qt([Jt.FLAT_DATA,this.path,qt(this.includes.map((e=>e.valueForSerialization??""))),qt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class fp extends as{runtimeValue;get _elementHashCode(){return qt([Jt.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class Tp extends as{connectionValue;get _elementHashCode(){return qt([Jt.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class Cp extends as{}class xp extends Cp{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return qt([Jt.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",qt(this.scopeElements.map((e=>e instanceof fs?e.valueForSerialization??"":e))),qt(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class Np extends as{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return qt([Jt.GENERATION_TREE,this.path,qt(this.generationNodes),qt(this.fileGenerations.map((e=>ss(Le.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class Ap extends gp{schemas=[];joins=[];filters=[];get _elementHashCode(){return qt([Jt.DATABASE,this.path,qt(this.includes.map((e=>e.valueForSerialization??""))),qt(this.schemas),qt(this.joins),qt(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class Op{_class;index=new Map;constructor(e){this._class=e}getElementClass(){return this._class}get elements(){return Array.from(this.index.values())}getElement(e){return this.index.get(e)}setElement(e,t){this.index.set(e,t)}deleteElement(e){this.index.delete(e)}renameElement(e,t){const s=this.getElement(e);s&&(this.deleteElement(e),this.setElement(t,s))}}class Sp extends as{data;get hashCode(){return qt([Jt.DATA_ELEMENT,this.path,qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}const yp=new Set([as,rs,ls,Cu,os,cp,cs,_p,hp,hs,ds,class extends as{sections=[];get _elementHashCode(){return qt([Jt.SECTION_INDEX,this.path,qt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}},gp,dp,Tp,fp,up,Np,xp,Sp]);class Ip{root;extensions=[];elementSectionIndex=new Map;sectionIndicesIndex=new Map;profilesIndex=new Map;typesIndex=new Map;associationsIndex=new Map;functionsIndex=new Map;storesIndex=new Map;mappingsIndex=new Map;connectionsIndex=new Map;runtimesIndex=new Map;servicesIndex=new Map;generationSpecificationsIndex=new Map;fileGenerationsIndex=new Map;dataElementsIndex=new Map;constructor(e,t){this.root=new us(e),this.extensions=this.createGraphExtensions(t)}createGraphExtensions(e){return e.map((e=>{if(yp.has(e))throw new j("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new Op(e)}))}get ownSectionIndices(){return Array.from(this.sectionIndicesIndex.values())}get ownProfiles(){return Array.from(this.profilesIndex.values())}get ownEnumerations(){return Array.from(this.typesIndex.values()).filter(Y(cs))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(Y(hs))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(Y(os))}get ownTypes(){return Array.from(this.typesIndex.values())}get ownAssociations(){return Array.from(this.associationsIndex.values())}get ownFunctions(){return Array.from(this.functionsIndex.values())}get ownStores(){return Array.from(this.storesIndex.values())}get ownFlatDatas(){return Array.from(this.storesIndex.values()).filter(Y(Ep))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(Y(Ap))}get ownMappings(){return Array.from(this.mappingsIndex.values())}get ownServices(){return Array.from(this.servicesIndex.values())}get ownRuntimes(){return Array.from(this.runtimesIndex.values())}get ownConnections(){return Array.from(this.connectionsIndex.values())}get ownFileGenerations(){return Array.from(this.fileGenerationsIndex.values())}get ownDataElements(){return Array.from(this.dataElementsIndex.values())}get ownGenerationSpecifications(){return Array.from(this.generationSpecificationsIndex.values())}get ownTestables(){return[...this.ownServices,...this.ownMappings]}getExtensionElements(e){return this.getExtensionForElementClass(e).elements}getExtensionForElementClass(e){const t=this.extensions.filter((t=>t.getElementClass()===e));if(0===t.length)throw new U("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new j("Found multiple extensions for the specified element class");return t[0]}getOwnNullableSection=e=>this.elementSectionIndex.get(e);getOwnNullableSectionIndex=e=>this.sectionIndicesIndex.get(e);getOwnNullableProfile=e=>this.profilesIndex.get(e);getOwnNullableType=e=>this.typesIndex.get(e);getOwnNullableClass=e=>{const t=this.getOwnNullableType(e);return t instanceof os?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof cs?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof hs?t:void 0};getOwnNullableAssociation=e=>this.associationsIndex.get(e);getOwnNullableFunction=e=>this.functionsIndex.get(e);getOwnNullableStore=e=>this.storesIndex.get(e);getOwnNullableMapping=e=>this.mappingsIndex.get(e);getOwnNullableConnection=e=>this.connectionsIndex.get(e);getOwnNullableRuntime=e=>this.runtimesIndex.get(e);getOwnNullableService=e=>this.servicesIndex.get(e);getOwnNullableGenerationSpecification=e=>this.generationSpecificationsIndex.get(e);getOwnNullableFileGeneration=e=>this.fileGenerationsIndex.get(e);getOwnNullableDataElement=e=>this.dataElementsIndex.get(e);getOwnSectionIndex=e=>H(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>H(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>H(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>H(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>H(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>H(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>H(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>H(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>H(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>K(this.getOwnNullableStore(e),Ap,`Can't find database '${e}'`);getOwnFlatDataStore=e=>K(this.getOwnNullableStore(e),Ep,`Can't find flat-data store '${e}'`);getOwnMapping=e=>H(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>H(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>H(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>H(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>H(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>H(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>H(this.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getOwnNullableExtensionElement(e,t){return this.getExtensionForElementClass(t).getElement(e)}setOwnSection(e,t){this.elementSectionIndex.set(e,t)}setOwnSectionIndex(e,t){this.sectionIndicesIndex.set(e,t)}setOwnProfile(e,t){this.profilesIndex.set(e,t)}setOwnType(e,t){this.typesIndex.set(e,t)}setOwnAssociation(e,t){this.associationsIndex.set(e,t)}setOwnFunction(e,t){this.functionsIndex.set(e,t)}setOwnStore(e,t){this.storesIndex.set(e,t)}setOwnMapping(e,t){this.mappingsIndex.set(e,t)}setOwnConnection(e,t){this.connectionsIndex.set(e,t)}setOwnRuntime(e,t){this.runtimesIndex.set(e,t)}setOwnService(e,t){this.servicesIndex.set(e,t)}setOwnGenerationSpecification(e,t){this.generationSpecificationsIndex.set(e,t)}setOwnFileGeneration(e,t){this.fileGenerationsIndex.set(e,t)}setOwnDataElement(e,t){this.dataElementsIndex.set(e,t)}setOwnElementInExtension(e,t,s){this.getExtensionForElementClass(s).setElement(e,t)}get allOwnElements(){return[...this.ownProfiles,...this.ownEnumerations,...this.ownMeasures,...this.ownClasses,...this.ownAssociations,...this.ownFunctions,...this.ownStores,...this.ownMappings,...this.ownServices,...this.ownRuntimes,...this.ownConnections,...this.ownGenerationSpecifications,...this.ownFileGenerations,...this.ownDataElements,...this.extensions.flatMap((e=>e.elements))]}async dispose(){this.allOwnElements.length&&await Promise.all(this.allOwnElements.map((e=>L((()=>{e.dispose()})))))}getNullablePackage=e=>e?G((()=>Hl(this.root,e,!1,void 0))):this.root;getOwnNullableElement(e,t){let s=this.sectionIndicesIndex.get(e)??this.typesIndex.get(e)??this.profilesIndex.get(e)??this.associationsIndex.get(e)??this.functionsIndex.get(e)??this.storesIndex.get(e)??this.mappingsIndex.get(e)??this.servicesIndex.get(e)??this.runtimesIndex.get(e)??this.connectionsIndex.get(e)??this.fileGenerationsIndex.get(e)??this.dataElementsIndex.get(e)??this.generationSpecificationsIndex.get(e);if(!s)for(const t of this.extensions){const i=t.getElement(e);if(i){s=i;break}}return t&&!s?this.getNullablePackage(e):s}addOwnElement(e,t){$l(t?Yl(this,t,void 0):this.root,e),e instanceof dp?this.setOwnMapping(e.path,e):e instanceof gp?this.setOwnStore(e.path,e):e instanceof rs?this.setOwnType(e.path,e):e instanceof cp?this.setOwnAssociation(e.path,e):e instanceof hp?this.setOwnProfile(e.path,e):e instanceof _p?this.setOwnFunction(e.path,e):e instanceof up?this.setOwnService(e.path,e):e instanceof Tp?this.setOwnConnection(e.path,e):e instanceof fp?this.setOwnRuntime(e.path,e):e instanceof xp?this.setOwnFileGeneration(e.path,e):e instanceof Np?this.setOwnGenerationSpecification(e.path,e):e instanceof Sp?this.setOwnDataElement(e.path,e):e instanceof us||this.getExtensionForElementClass(v(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&zl(e.package,e),e instanceof dp?this.mappingsIndex.delete(e.path):e instanceof gp?this.storesIndex.delete(e.path):e instanceof rs?(this.typesIndex.delete(e.path),e instanceof hs&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof cp?this.associationsIndex.delete(e.path):e instanceof hp?this.profilesIndex.delete(e.path):e instanceof _p?this.functionsIndex.delete(e.path):e instanceof up?this.servicesIndex.delete(e.path):e instanceof fp?this.runtimesIndex.delete(e.path):e instanceof Tp?this.connectionsIndex.delete(e.path):e instanceof xp?this.fileGenerationsIndex.delete(e.path):e instanceof Np?this.generationSpecificationsIndex.delete(e.path):e instanceof Sp?this.dataElementsIndex.delete(e.path):e instanceof us?e.children.forEach((e=>this.deleteOwnElement(e))):this.getExtensionForElementClass(v(e)).deleteElement(e.path)}renameOwnElement(e,t,s){if(t===s)return;if(!s)throw new U(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof us&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof us)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new U(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new U(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=Vl(s);if(!(e instanceof us)){const t=this.getNullablePackage(i)??(""!==i?Yl(this,i,void 0):this.root);e.name=n,e instanceof _p&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Xl(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Xl(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&zl(e.package,e),$l(t,e))}var a,r;if(e instanceof dp)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof gp)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof rs)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof hs&&(e.canonicalUnit&&(this.typesIndex.delete(e.canonicalUnit.path),this.typesIndex.set(e.canonicalUnit.path.replace(t,s),e.canonicalUnit)),e.nonCanonicalUnits.forEach((e=>{this.typesIndex.delete(e.path),this.typesIndex.set(e.path.replace(t,s),e)})));else if(e instanceof cp)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof hp)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof _p)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof up)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof fp)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof Tp)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof xp)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof Sp)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof Np)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof us){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new j("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){zl(r,e);const t=""!==i?Yl(this,i,void 0):this.root;$l(t,e)}a.forEach(((e,i)=>{this.renameOwnElement(e,i,i.replace(t,s))}))}else this.getExtensionForElementClass(v(e)).renameElement(t,s)}TEMPORARY__deleteOwnSectionIndex(){this.sectionIndicesIndex.forEach((e=>{e.setIsDeleted(!0),this.sectionIndicesIndex.delete(e.path)})),this.sectionIndicesIndex=new Map,this.elementSectionIndex=new Map}}class vp extends Ip{constructor(e,t){super(t.name,e),this.root=t}}const Rp=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class Pp{roots=[];projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.keys()).forEach((e=>{const t=new us(e);this.roots.push(t),this.projectDependencyModelsIndex.set(e,new vp(this.extensionElementClasses,t))}))}get hasDependencies(){return Boolean(this.projectDependencyModelsIndex.size)}get dependencyGraphs(){return Array.from(this.projectDependencyModelsIndex.values())}get allOwnElements(){return this.dependencyGraphs.flatMap((e=>e.allOwnElements))}getOwnNullableSectionIndex=Rp(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=Rp(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=Rp(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=Rp(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=Rp(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=Rp(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=Rp(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=Rp(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=Rp(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=Rp(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=Rp(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=Rp(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=Rp(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=Rp(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=Rp(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=Rp(this,((e,t)=>e.getOwnNullableDataElement(t)));getOwnNullableExtensionElement(e,t){for(const s of this.dependencyGraphs){const i=s.getExtensionForElementClass(t).getElement(e);if(i)return i}}get sectionIndices(){return this.dependencyGraphs.flatMap((e=>e.ownSectionIndices))}get profiles(){return this.dependencyGraphs.flatMap((e=>e.ownProfiles))}get enumerations(){return this.dependencyGraphs.flatMap((e=>e.ownEnumerations))}get measures(){return this.dependencyGraphs.flatMap((e=>e.ownMeasures))}get classes(){return this.dependencyGraphs.flatMap((e=>e.ownClasses))}get types(){return this.dependencyGraphs.flatMap((e=>e.ownTypes))}get associations(){return this.dependencyGraphs.flatMap((e=>e.ownAssociations))}get functions(){return this.dependencyGraphs.flatMap((e=>e.ownFunctions))}get stores(){return this.dependencyGraphs.flatMap((e=>e.ownStores))}get databases(){return this.dependencyGraphs.flatMap((e=>e.ownDatabases))}get mappings(){return this.dependencyGraphs.flatMap((e=>e.ownMappings))}get services(){return this.dependencyGraphs.flatMap((e=>e.ownServices))}get runtimes(){return this.dependencyGraphs.flatMap((e=>e.ownRuntimes))}get connections(){return this.dependencyGraphs.flatMap((e=>e.ownConnections))}get dataElements(){return this.dependencyGraphs.flatMap((e=>e.ownDataElements))}get generationSpecifications(){return this.dependencyGraphs.flatMap((e=>e.ownGenerationSpecifications))}get fileGenerations(){return this.dependencyGraphs.flatMap((e=>e.ownFileGenerations))}getExtensionElements(e){return this.dependencyGraphs.flatMap((t=>t.getExtensionElements(e)))}getModel(e){return H(this.projectDependencyModelsIndex.get(e),`Can't find dependency model with project ID '${e}'`)}getNullableElement(e,t){return this.dependencyGraphs.find((s=>Boolean(s.getOwnNullableElement(e,t))))?.getOwnNullableElement(e,t)}}class wp extends gp{static NAME="ModelStore";static INSTANCE=new wp;constructor(){super(wp.NAME)}accept_PackageableElementVisitor(e){throw new U}}class Lp extends Ip{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(Ce.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(wp.NAME,wp.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[Cu.STRING,Cu.BOOLEAN,Cu.BINARY,Cu.NUMBER,Cu.INTEGER,Cu.FLOAT,Cu.DECIMAL,Cu.DATE,Cu.STRICTDATE,Cu.DATETIME,Cu.STRICTTIME,Cu.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class bp extends Ip{autoImports=[];constructor(e){super(Ce.SYSTEM,e)}initializeAutoImports(){this.autoImports=Se.map((e=>K(this.getOwnNullableElement(e,!0),us,`Can't find auto-import package '${e}'`)))}}class Dp extends Ip{constructor(e){super(Ce.MODEL_GENERATION,e)}}class Mp extends Ip{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(Ce.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new Dp(i),this.dependencyManager=new Pp(i)}get autoImports(){return this.systemModel.autoImports}get primitiveTypes(){return this.coreModel.primitiveTypes}get sectionIndices(){return[...this.coreModel.ownSectionIndices,...this.systemModel.ownSectionIndices,...this.dependencyManager.sectionIndices,...this.ownSectionIndices,...this.generationModel.ownSectionIndices]}get profiles(){return[...this.coreModel.ownProfiles,...this.systemModel.ownProfiles,...this.dependencyManager.profiles,...this.ownProfiles,...this.generationModel.ownProfiles]}get enumerations(){return[...this.coreModel.ownEnumerations,...this.systemModel.ownEnumerations,...this.dependencyManager.enumerations,...this.ownEnumerations,...this.generationModel.ownEnumerations]}get measures(){return[...this.coreModel.ownMeasures,...this.systemModel.ownMeasures,...this.dependencyManager.measures,...this.ownMeasures,...this.generationModel.ownMeasures]}get classes(){return[...this.coreModel.ownClasses,...this.systemModel.ownClasses,...this.dependencyManager.classes,...this.ownClasses,...this.generationModel.ownClasses]}get types(){return[...this.coreModel.ownTypes,...this.systemModel.ownTypes,...this.dependencyManager.types,...this.ownTypes,...this.generationModel.ownTypes]}get associations(){return[...this.coreModel.ownAssociations,...this.systemModel.ownAssociations,...this.dependencyManager.associations,...this.ownAssociations,...this.generationModel.ownAssociations]}get functions(){return[...this.coreModel.ownFunctions,...this.systemModel.ownFunctions,...this.dependencyManager.functions,...this.ownFunctions,...this.generationModel.ownFunctions]}get stores(){return[...this.coreModel.ownStores,...this.systemModel.ownStores,...this.dependencyManager.stores,...this.ownStores,...this.generationModel.ownStores]}get databases(){return[...this.coreModel.ownDatabases,...this.systemModel.ownDatabases,...this.dependencyManager.databases,...this.ownDatabases,...this.generationModel.ownDatabases]}get mappings(){return[...this.coreModel.ownMappings,...this.systemModel.ownMappings,...this.dependencyManager.mappings,...this.ownMappings,...this.generationModel.ownMappings]}get services(){return[...this.coreModel.ownServices,...this.systemModel.ownServices,...this.dependencyManager.services,...this.ownServices,...this.generationModel.ownServices]}get runtimes(){return[...this.coreModel.ownRuntimes,...this.systemModel.ownRuntimes,...this.dependencyManager.runtimes,...this.ownRuntimes,...this.generationModel.ownRuntimes]}get connections(){return[...this.coreModel.ownConnections,...this.systemModel.ownConnections,...this.dependencyManager.connections,...this.ownConnections,...this.generationModel.ownConnections]}get dataElements(){return[...this.coreModel.ownDataElements,...this.systemModel.ownDataElements,...this.dependencyManager.dataElements,...this.ownDataElements,...this.generationModel.ownDataElements]}get generationSpecifications(){return[...this.coreModel.ownGenerationSpecifications,...this.systemModel.ownGenerationSpecifications,...this.dependencyManager.generationSpecifications,...this.ownGenerationSpecifications,...this.generationModel.ownGenerationSpecifications]}get fileGenerations(){return[...this.coreModel.ownFileGenerations,...this.systemModel.ownFileGenerations,...this.dependencyManager.fileGenerations,...this.ownFileGenerations,...this.generationModel.ownFileGenerations]}get allElements(){return[...this.coreModel.allOwnElements,...this.systemModel.allOwnElements,...this.dependencyManager.allOwnElements,...this.allOwnElements,...this.generationModel.allOwnElements]}get allOwnTestables(){const e=this.graphPlugins.flatMap((e=>e.getExtraTestablesCollectors?.()??[])).map((e=>e(this)));return[...this.ownTestables].concat(...e)}getPrimitiveType=e=>H(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>H(this.getOwnNullableType(e)??this.generationModel.getOwnNullableType(e)??this.dependencyManager.getOwnNullableType(e)??this.systemModel.getOwnNullableType(e)??this.coreModel.getOwnNullableType(e),`Can't find type '${e}'`);getProfile=e=>H(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>K(this.getType(e),cs,`Can't find enumeration '${e}'`);getMeasure=e=>K(this.getType(e),hs,`Can't find measure '${e}'`);getUnit=e=>K(this.getType(e),ds,`Can't find unit '${e}'`);getClass=e=>K(this.getType(e),os,`Can't find class '${e}'`);getAssociation=e=>H(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>H(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??K(this.getType(e),os),`Can't find property owner '${e}'`);getFunction=e=>K(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),_p,`Can't find function '${e}'`);getStore=e=>H(this.getOwnNullableStore(e)??this.generationModel.getOwnNullableStore(e)??this.dependencyManager.getOwnNullableStore(e)??this.systemModel.getOwnNullableStore(e)??this.coreModel.getOwnNullableStore(e),`Can't find store '${e}'`);getFlatDataStore=e=>K(this.getStore(e),Ep,`Can't find flat-data store '${e}'`);getDatabase=e=>K(this.getStore(e),Ap,`Can't find database store '${e}'`);getMapping=e=>H(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>H(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>H(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>H(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>H(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>H(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>H(this.getOwnNullableDataElement(e)??this.generationModel.getOwnNullableDataElement(e)??this.dependencyManager.getOwnNullableDataElement(e)??this.systemModel.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getExtensionElement(e,t,s){return H(this.getOwnNullableExtensionElement(e,t)??this.generationModel.getOwnNullableExtensionElement(e,t)??this.dependencyManager.getOwnNullableExtensionElement(e,t)??this.systemModel.getOwnNullableExtensionElement(e,t),s??`Can't find element '${e}'`)}getElement=(e,t)=>H(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>G((()=>this.getClass(e)));getNullableMapping=e=>G((()=>this.getMapping(e)));getNullableService=e=>G((()=>this.getService(e)));getNullableRuntime=e=>G((()=>this.getRuntime(e)));getNullableFileGeneration=e=>G((()=>this.getFileGeneration(e)));getNullableElement(e,t){const s=super.getOwnNullableElement(e)??this.dependencyManager.getNullableElement(e)??this.generationModel.getOwnNullableElement(e)??this.systemModel.getOwnNullableElement(e)??this.coreModel.getOwnNullableElement(e);return t&&!s?this.getNullablePackage(e)??this.dependencyManager.getNullableElement(e,!0)??this.generationModel.getNullablePackage(e)??this.systemModel.getNullablePackage(e):s}getMultiplicity(e,t){let s;return 1===e&&1===t?s=Eu.ONE:0===e&&1===t?s=Eu.ZERO_ONE:0===e&&void 0===t?s=Eu.ZERO_MANY:1===e&&void 0===t?s=Eu.ONE_MANY:0===e&&0===t&&(s=Eu.ZERO),s??new Eu(e,t)}addElement(e,t){const s=Gl(t??"",e.name);if(this.getNullableElement(s,!1))throw new j(`Can't create element '${s}': another element with the same path already existed`);super.addOwnElement(e,t)}deleteElement(e){super.deleteOwnElement(e);const t=this.graphPlugins.flatMap((e=>e.getExtraDeadReferencesCleaners?.()??[]));for(const e of t)e(this)}renameElement(e,t){if(this.getNullableElement(t,!1))throw new j(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class kp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Fp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class jp{sourceId;line;column;startLine;startColumn;endLine;endColumn}(0,Be.yu)(jp,{column:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)(),line:(0,Be.Ru)(),sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)()});const Up=(0,Be.PG)((()=>Be.AM),(e=>(e.sourceId=e.source,(0,Be.vB)(jp,e))));class Vp{package;name;tags=[];stereotypes=[]}(0,Be.yu)(Vp,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ru)()),tags:(0,Be.pb)((0,Be.Ru)())});class Gp{profile;value}(0,Be.yu)(Gp,{profile:(0,Be.Ru)(),value:(0,Be.Ru)()});class $p{profile;value}(0,Be.yu)($p,{profile:(0,Be.Ru)(),value:(0,Be.Ru)()});class zp{tag;value}(0,Be.yu)(zp,{tag:(0,Be.Ry)($p),value:(0,Be.Ru)()});class Bp{rawType;typeParameter}(0,Be.yu)(Bp,{rawType:(0,Be.jt)((0,Be.Ru)()),typeParameter:(0,Be.jt)((0,Be.Ru)())});class Hp{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,Be.yu)(Hp,{aggregation:(0,Be.Ru)(),genericType:(0,Be.Ry)(Bp),multiplicity:(0,Be.Ru)(),name:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ry)(Gp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp))});class Yp{package;name;sourceInformation}(0,Be.yu)(Yp,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),sourceInformation:Up});class Wp{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,Be.yu)(Wp,{generalizations:(0,Be.pb)((0,Be.Ry)(Bp)),name:(0,Be.Ru)(),package:(0,Be.Ru)(),properties:(0,Be.pb)((0,Be.Ry)(Hp)),qualifiedProperties:(0,Be.pb)((0,Be.Ry)(Hp)),sourceInformation:Up,stereotypes:(0,Be.pb)((0,Be.Ry)(Gp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp))});class Kp{package;name;enumValues=[]}(0,Be.yu)(Kp,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),enumValues:(0,Be.pb)((0,Be.Ru)())});class Zp{x;y}(0,Be.yu)(Zp,{x:(0,Be.Ru)(),y:(0,Be.Ru)()});class Xp{height;width}(0,Be.yu)(Xp,{height:(0,Be.Ru)(),width:(0,Be.Ru)()});class qp{points=[]}(0,Be.yu)(qp,{points:(0,Be.pb)((0,Be.Ry)(Zp))});class Jp{id;source;target;geometry}(0,Be.yu)(Jp,{geometry:(0,Be.Ry)(qp),id:(0,Be.Ru)(),source:(0,Be.Ru)(),target:(0,Be.Ru)()});class Qp{name;owningType}(0,Be.yu)(Qp,{name:(0,Be.Ru)(),owningType:(0,Be.Ru)()});class em{id;source;target;property;geometry}(0,Be.yu)(em,{geometry:(0,Be.Ry)(qp),id:(0,Be.Ru)(),property:(0,Be.Ry)(Qp),source:(0,Be.Ru)(),target:(0,Be.Ru)()});class tm{id;type;position;rectangleGeometry}(0,Be.yu)(tm,{id:(0,Be.Ru)(),position:(0,Be.Ry)(Zp),rectangleGeometry:(0,Be.Ry)(Xp),type:(0,Be.Ru)()});class sm{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,Be.yu)(sm,{name:(0,Be.Ru)(),generalizationViews:(0,Be.pb)((0,Be.Ry)(Jp)),package:(0,Be.Ru)(),propertyViews:(0,Be.pb)((0,Be.Ry)(em)),sourceInformation:Up,stereotypes:(0,Be.pb)((0,Be.Ry)(Gp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp)),typeViews:(0,Be.pb)((0,Be.Ry)(tm))});class im{classes=[];enumerations=[];profiles=[]}(0,Be.yu)(im,{classes:(0,Be.pb)((0,Be.Ry)(Wp)),enumerations:(0,Be.pb)((0,Be.Ry)(Kp)),profiles:(0,Be.pb)((0,Be.Ry)(Vp))});class nm{name;diagram;domainInfo}(0,Be.yu)(nm,{diagram:(0,Be.Ry)(sm),name:(0,Be.Ru)(),domainInfo:(0,Be.jt)((0,Be.Ry)(im))});class am{class;enumerations=[];profiles=[];specializations=[]}(0,Be.yu)(am,{class:(0,Be.Ry)(Wp),enumerations:(0,Be.pb)((0,Be.Ry)(Kp)),profiles:(0,Be.pb)((0,Be.Ry)(Vp)),specializations:(0,Be.pb)((0,Be.Ry)(Yp))});const rm=e=>{const t=e.classViews.map((e=>` TypeView ${e.id}(\n type=${e.class.value.path},\n position=(${e.position.x.toFixed(5)}, ${e.position.y.toFixed(5)}),\n width=${e.rectangle.width.toFixed(5)},\n height=${e.rectangle.height.toFixed(5)},\n stereotypesVisible=true,\n attributesVisible=true,\n attributeStereotypesVisible=true,\n attributeTypesVisible=true,\n color=#FFFFCC,\n lineWidth=1.0)`)),s=e.generalizationViews.map(((e,t)=>` GeneralizationView gview_${t}(\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n color=#000000,\n lineWidth=-1.0,\n lineStyle=SIMPLE)`)),i=e.propertyViews.map(((e,t)=>` PropertyView pview_${t}(\n property=${e.property.value._OWNER.path}.${e.property.value.name},\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n propertyPosition=(0.0,0.0),\n multiplicityPosition=(0.0,0.0),\n color=#000000,\n lineWidth=-1.0,\n stereotypesVisible=true,\n nameVisible=true,\n lineStyle=SIMPLE)`));return`Diagram ${e.path}(width=0.0, height=0.0)\n{\n${[...t,...s,...i].join("\n\n")}\n}`},om=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=Vl(e),r=new os(a);return $l(Hl(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},lm=e=>{if("*"===e)return new Eu(0,void 0);{const t=e.split("..");if(1===t.length)return new Eu(parseInt(H(t[0]),10),parseInt(H(t[0]),10));if(2===t.length)return new Eu(parseInt(H(t[0]),10),"*"===t[1]?void 0:parseInt(H(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},cm=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;b(e.taggedValues,new np(rp.create((i=s.getProfile(t.tag.profile),n=t.tag.value,H(i.p_tags.find((e=>e.value===n)),`Can't find tag '${n}' in profile '${i.path}'`))),t.value))})),t.stereotypes.forEach((t=>{var i,n;b(e.stereotypes,lp.create((i=s.getProfile(t.profile),n=t.value,H(i.p_stereotypes.find((e=>e.value===n)),`Can't find stereotype '${n}' in profile '${i.path}'`))))})),t.generalizations.filter((e=>Boolean(e.rawType))).forEach((t=>{const n=om(H(t.rawType),s,i,void 0);b(e.generalizations,mu.create(new _u(n))),b(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const n=new gu(t.name,lm(t.multiplicity),mu.create(new _u(s.getOwnNullableEnumeration(H(t.genericType.rawType))??om(H(t.genericType.rawType),s,i,void 0))),e);n.aggregation="Composite"===t.aggregation?du.COMPOSITE:"Shared"===t.aggregation?du.SHARED:void 0,b(e.properties,n)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{b(e.derivedProperties,new uu(t.name,lm(t.multiplicity),mu.create(new _u(s.getOwnNullableEnumeration(H(t.genericType.rawType))??om(H(t.genericType.rawType),s,i,void 0))),e))}))},dm=e=>{const t=new Mp(new Lp([]),new bp([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new os(e.name);$l(Hl(t.root,e.package,!0,new Map),i),t.setOwnType(i.path,i),s.set(i.path,{sourceInformation:e.sourceInformation,isStubbed:!1})})),i.profiles.forEach((e=>{const s=new hp(e.name);$l(Hl(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new kp(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new Fp(s,e))))})),i.enumerations.forEach((e=>{const s=new cs(e.name);$l(Hl(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":Ee}${e.name}`,n=t.getClass(i);cm(n,e,t,s)}))}const i=e.diagram,n=new Xo(i.name);return $l(Hl(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new rc(n,e.id,Ts.create(t.getClass(e.type)));s.position=new ic(e.position.x,e.position.y),s.rectangle=new nc(e.rectangleGeometry.width,e.rectangleGeometry.height),b(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new uc(n,Tu.create((i=t.getClass(e.property.owningType),a=e.property.name,H(i instanceof os?Zl(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),H(n.classViews.find((t=>t.id===e.source))),H(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new ic(e.x,e.y))),Ec(s),b(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new pc(n,H(n.classViews.find((t=>t.id===e.source))),H(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new ic(e.x,e.y))),Ec(t),b(n.generalizationViews,t)})),[n,t,s]};class hm extends sh{diagramInfo;_renderer;diagram;diagramClasses;graph;diagramPath;filePath;fileLine;fileColumn;constructor(e,t,s,i,n,a){super(e),(0,x.rC)(this,{_renderer:x.LO,diagram:x.LO,diagramInfo:x.LO,diagramName:x.Fl,diagramCursorClass:x.Fl,addClassView:x.ls,rebuild:x.aD,setRenderer:x.aD}),this.diagramPath=s,this.filePath=i,this.fileLine=n,this.fileColumn=a,this.diagramInfo=t;const[r,o,l]=dm(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Yd(this.diagramPath)}get description(){return`Diagram: ${Yd(this.diagramPath)}`}get diagramName(){return jl(this.diagramPath)}match(e){return e instanceof hm&&this.diagramPath===e.diagramPath}get renderer(){return H(this._renderer,"Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)")}get isDiagramRendererInitialized(){return Boolean(this._renderer)}get diagramCursorClass(){if(!this.isDiagramRendererInitialized)return"";if(this.renderer.middleClick||this.renderer.rightClick)return"diagram-editor__cursor--grabbing";switch(this.renderer.interactionMode){case qu.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case qu.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case qu.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case qu.LAYOUT:return this.renderer.selectionStart?"diagram-editor__cursor--crosshair":this.renderer.mouseOverClassCorner||this.renderer.selectedClassCorner?"diagram-editor__cursor--resize":this.renderer.mouseOverClassView?"diagram-editor__cursor--pointer":"";default:return""}}rebuild(e){this.diagramInfo=e;const[t,s,i]=dm(e);this.diagram=t,this.graph=s,this.diagramClasses=i,this.fileLine=e.diagram.sourceInformation.line,this.fileColumn=e.diagram.sourceInformation.column}setupRenderer(){this.renderer.onClassViewDoubleClick=e=>{const t=this.diagramClasses.get(e.class.value.path)?.sourceInformation;if(t){const e=new Kd(t.sourceId,t.startLine,t.startColumn);(0,x.fl)(this.editorStore.executeNavigation(e)).catch(this.editorStore.applicationStore.alertUnhandledError)}}}setRenderer(e){this._renderer=e}*addClassView(e,t){const s=((e,t,s)=>{e.profiles.forEach((e=>{const s=`${e.package}${""===e.package?"":Ee}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new hp(e.name);$l(Hl(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new kp(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new Fp(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":Ee}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new cs(e.name);$l(Hl(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":Ee}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new os(i.name),$l(Hl(t.root,i.package,!0,new Map),a),t.setOwnType(a.path,a));const r=s.get(a.path)?.isStubbed??!0;return s.set(a.path,{sourceInformation:i.sourceInformation,isStubbed:!1}),e.specializations.forEach((e=>{const i=H(a),n=om(H(`${e.package}${""===e.package?"":Ee}${e.name}`),t,s,e.sourceInformation);b(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||b(n.generalizations,mu.create(new _u(i)))})),r&&cm(a,i,t,s),a})((0,Be.vB)(am,yield this.editorStore.client.getDiagramClassInfo(e)),this.graph,this.diagramClasses),i=this.renderer.addClassView(s,t);i&&(i.id=((e,t)=>{if(!t.match(/^[\w_-]+$/))throw new Error("Token must only contain digits, letters, or special characters _ and -");const s=e.map((e=>{const s=e.match(new RegExp(`^${t}_(?<count>\\d+)$`));return s?.groups?.count?parseInt(s.groups.count,10):0})).reduce(((e,t)=>Math.max(e,t)),0);return`${t}_${s+1}`})(this.diagram.classViews.map((e=>e.id)),"cview"))}registerCommands(){const e=()=>this.editorStore.tabManagerState.currentTab===this&&this.isDiagramRendererInitialized;this.editorStore.applicationStore.commandCenter.registerCommand({key:rh.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:rh.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:rh.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:rh.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[rh.RECENTER,rh.USE_ZOOM_TOOL,rh.USE_VIEW_TOOL,rh.USE_PAN_TOOL].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class um{text="";isCaseSensitive=!1;isRegExp=!1;constructor(){(0,x.rC)(this,{text:x.LO,isCaseSensitive:x.LO,isRegExp:x.LO,reset:x.aD,setText:x.aD,setCaseSensitive:x.aD,setRegExp:x.aD})}reset(){this.setText(""),this.setCaseSensitive(!1),this.setRegExp(!1)}setText(e){this.text=e}setCaseSensitive(e){this.isCaseSensitive=e}toggleCaseSensitive(){this.setCaseSensitive(!this.isCaseSensitive)}setRegExp(e){this.isRegExp=e}toggleRegExp(){this.setRegExp(!this.isRegExp)}}class pm extends k{}class mm{applicationStore;initState=ft.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=Fd.CONSOLE;auxPanelDisplayState=new cu({initial:0,default:300,snap:100});activeActivity=kd.CONCEPT;sideBarDisplayState=new cu({initial:300,default:300,snap:150});tabManagerState=new ih(this);executionState=ft.create();navigationStack=[];consoleText;fileSearchCommandLoadingState=ft.create();fileSearchCommandState=new um;openFileSearchCommand=!1;fileSearchCommandResults=[];textSearchCommandLoadingState=ft.create();textSearchCommandState=new um;openTextSearchCommand=!1;searchState;testRunState=ft.create();testRunnerState;constructor(e){(0,x.rC)(this,{isMaxAuxPanelSizeSet:x.LO,activeAuxPanelMode:x.LO,activeActivity:x.LO,consoleText:x.LO,navigationStack:x.LO,openFileSearchCommand:x.LO,fileSearchCommandResults:x.LO,fileSearchCommandState:x.LO,openTextSearchCommand:x.LO,textSearchCommandState:x.LO,searchState:x.LO,testRunnerState:x.LO,setOpenFileSearchCommand:x.aD,setOpenTextSearchCommand:x.aD,setActiveAuxPanelMode:x.aD,setActiveActivity:x.aD,setConsoleText:x.aD,setSearchState:x.aD,setTestRunnerState:x.aD,pullInitializationActivity:x.aD,pullExecutionStatus:x.aD,initialize:x.ls,checkIfSessionWakingUp:x.ls,loadDiagram:x.ls,loadFile:x.ls,execute:x.ls,executeGo:x.ls,manageExecuteGoResult:x.ls,executeTests:x.ls,executeFullTestSuite:x.ls,executeNavigation:x.ls,navigateBack:x.ls,fullReCompile:x.ls,command:x.ls,findUsages:x.ls,renameConcept:x.ls,movePackageableElements:x.ls,updateFileUsingSuggestionCandidate:x.ls,updateFile:x.ls,searchFile:x.ls,searchText:x.ls,createNewDirectory:x.ls,createNewFile:x.ls,renameFile:x.ls,deleteDirectoryOrFile:x.ls}),this.applicationStore=e,this.directoryTreeState=new xh(this),this.conceptTreeState=new Nh(this),this.client=new lu(new me({baseUrl:this.applicationStore.config.useDynamicPureServer?window.location.origin:this.applicationStore.config.pureUrl}))}setOpenFileSearchCommand(e){this.openFileSearchCommand=e}setOpenTextSearchCommand(e){this.openTextSearchCommand=e}setActiveAuxPanelMode(e){this.activeAuxPanelMode=e}setConsoleText(e){this.consoleText=e}setSearchState(e){this.searchState=e}setTestRunnerState(e){this.testRunnerState=e}cleanUp(){this.applicationStore.setBlockingAlert(void 0),this.applicationStore.setActionAlertInfo(void 0)}*initialize(e,t,s,i){if(this.initState.isInInitialState){this.client.mode=s,this.client.compilerMode=i,this.initState.inProgress();try{const s=this.client.initialize(!e);this.applicationStore.setBlockingAlert({message:"Loading Pure IDE...",prompt:"Please be patient as we are building the initial application state",showLoading:!0}),yield this.pullInitializationActivity(),this.applicationStore.setBlockingAlert(void 0);const i=(0,x.fl)(this.loadFile("/welcome.pure")),a=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(n=yield s).error?n.source?(0,Be.vB)(Sh,n):(0,Be.vB)(Oh,n):(0,Be.vB)(Ah,n);o.text&&(this.setConsoleText(o.text),this.setActiveAuxPanelMode(Fd.CONSOLE),this.auxPanelDisplayState.open()),o instanceof Oh?o.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof Sh&&(yield(0,x.fl)(this.loadFile(o.source,new Zd(o.source,o.line,o.column,new pm((o.text??"").split("\n").filter(Boolean)[0]))))):(t&&(yield t()),yield Promise.all([i,a,r]))}catch(e){return V(e),this.applicationStore.notifyError(e),this.initState.fail(),void this.applicationStore.setBlockingAlert({message:"Failed to initialize IDE",prompt:"Make sure the IDE server is working, otherwise try to restart it"})}var n;this.initState.pass()}else this.applicationStore.notifyIllegalState("Editor store is re-initialized")}*checkIfSessionWakingUp(e){this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",showLoading:!0}),yield this.pullInitializationActivity((t=>{t.text&&this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",prompt:t.text,showLoading:!0})})),this.applicationStore.setBlockingAlert(void 0)}async pullInitializationActivity(e){return(await this.client.getInitializationActivity()).initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullInitializationActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}registerCommands(){this.applicationStore.commandCenter.registerCommand({key:nh.SEARCH_FILE,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:nh.SEARCH_TEXT,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenTextSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:nh.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof uh&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,!0)}}),this.applicationStore.commandCenter.registerCommand({key:nh.TOGGLE_AUX_PANEL,trigger:()=>this.initState.hasSucceeded,action:()=>this.auxPanelDisplayState.toggle()}),this.applicationStore.commandCenter.registerCommand({key:nh.EXECUTE,action:()=>{(0,x.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:nh.FULL_RECOMPILE,action:()=>{(0,x.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:nh.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,x.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:nh.RUN_ALL_TESTS,action:()=>{(0,x.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:nh.RUN_RELAVANT_TESTS,action:()=>{(0,x.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[nh.SEARCH_FILE,nh.SEARCH_TEXT,nh.GO_TO_FILE,nh.TOGGLE_AUX_PANEL,nh.EXECUTE,nh.FULL_RECOMPILE,nh.FULL_RECOMPILE_WITH_FULL_INIT,nh.RUN_ALL_TESTS,nh.RUN_RELAVANT_TESTS].forEach((e=>this.applicationStore.commandCenter.deregisterCommand(e)))}setActiveActivity(e,t){this.sideBarDisplayState.isOpen?e!==this.activeActivity||t?.keepShowingIfMatchedCurrent||this.sideBarDisplayState.close():this.sideBarDisplayState.open(),this.activeActivity=e}*loadDiagram(e,t,s,i){let n=this.tabManagerState.tabs.find((e=>e instanceof hm&&e.diagramPath===t));n||(yield(0,x.fl)(this.checkIfSessionWakingUp()),n=new hm(this,(0,Be.vB)(nm,yield this.client.getDiagramInfo(t)),t,e,s,i)),this.tabManagerState.openTab(n)}*loadFile(e,t){let s=this.tabManagerState.tabs.find((t=>t instanceof uh&&t.filePath===e));s||(yield(0,x.fl)(this.checkIfSessionWakingUp()),s=new uh(this,(0,Be.vB)(Wd,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof Zd&&s.showError(t))}async reloadFile(e){const t=[];await Promise.all(this.tabManagerState.tabs.map((async s=>{if(s instanceof uh&&s.filePath===e)s.setFile((0,Be.vB)(Wd,await this.client.getFile(e)));else if(s instanceof hm&&s.filePath===e)try{s.rebuild((0,Be.vB)(nm,await this.client.getDiagramInfo(s.diagramPath)))}catch{t.push(s)}}))),t.forEach((e=>this.tabManagerState.closeTab(e)))}*execute(e,t,s,i,n){if(!this.initState.hasSucceeded)return void this.applicationStore.notifyWarning("Can't execute while initializing application");if(this.executionState.isInProgress)return void this.applicationStore.notifyWarning("Another execution is already in progress!");this.searchState instanceof zh||this.setSearchState(void 0),this.executionState.inProgress();const a=this.tabManagerState.tabs.filter(Y(uh)).map((e=>e.filePath));try{const o=this.tabManagerState.tabs.map((e=>e instanceof uh?{path:e.filePath,code:e.file.content}:e instanceof hm?{diagram:e.diagramPath,code:rm(e.diagram)}:void 0)).filter(z),l=this.client.execute(o,e,t),c=1e3;let d,h=!1;yield Promise.all([l.then((e=>{h=!0,d=e})),new Promise((e=>setTimeout((()=>{!h&&s&&(this.applicationStore.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),e(this.pullExecutionStatus())),e()}),c,!0)))]);const u=(r=H(d)).error?r.candidateName&&r.PureUnmatchedFunctionException?(0,Be.vB)(bh,r):r.candidateName&&r.candidates?(0,Be.vB)(Dh,r):(0,Be.vB)(vh,r):r.jumpTo?(0,Be.vB)(Ph,r):r.tests?(0,Be.vB)(Fh,r):(0,Be.vB)(Ih,r);this.applicationStore.setBlockingAlert(void 0),n?.avoidUpdatingConsoleText||this.setConsoleText(u.text),u instanceof vh?(this.applicationStore.notifyWarning("Execution failed"+(u.text?`: ${u.text}`:"")),u.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:u.sessionError}):yield(0,x.fl)(i(u,a))):u instanceof Ih?(this.applicationStore.notifySuccess("Execution succeeded!"),u.reinit?(this.applicationStore.setBlockingAlert({message:"Reinitializing...",prompt:"Please do not refresh the application",showLoading:!0}),this.initState.reset(),yield(0,x.fl)(this.initialize(!1,(()=>(0,x.fl)(this.execute(e,t,s,i))),this.client.mode,this.client.compilerMode))):yield(0,x.fl)(i(u,a))):yield(0,x.fl)(i(u,a))}finally{this.applicationStore.setBlockingAlert(void 0),this.executionState.reset()}var r}async pullExecutionStatus(){const e=await this.client.getExecutionActivity();return this.applicationStore.setBlockingAlert({message:"Executing...",prompt:e.text?e.text:"Please do not refresh the application",showLoading:!0}),e.executing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullExecutionStatus())}catch(e){t(e)}}),500))):(this.applicationStore.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),Promise.resolve())}*executeGo(){yield(0,x.fl)(this.execute("executeGo",{},!0,((e,t)=>(0,x.fl)(this.manageExecuteGoResult(e,t)))))}*manageExecuteGoResult(e,t){const s=this.refreshTrees();if(e instanceof vh)yield(0,x.fl)(this.loadFile(e.source,new Zd(e.source,e.line,e.column,new pm(e.text.split("\n").filter(Boolean)[0])))),e instanceof bh?(this.setSearchState(new Yh(this,e)),this.setActiveAuxPanelMode(Fd.SEARCH_RESULT),this.auxPanelDisplayState.open()):e instanceof Dh&&(this.setSearchState(new Wh(this,e)),this.setActiveAuxPanelMode(Fd.SEARCH_RESULT),this.auxPanelDisplayState.open()),this.resetChangeDetection(t);else if(e instanceof Ih){if(e.modifiedFiles.length)for(const t of e.modifiedFiles)yield this.reloadFile(t);this.resetChangeDetection(t.concat(e.modifiedFiles))}yield s}*executeTests(e,t){t?this.applicationStore.notifyUnsupportedFeature("Run relevant tests! (reason: VCS required)"):this.testRunState.isInProgress?this.applicationStore.notifyWarning("Test runner is working. Please try again later"):(this.testRunState.inProgress(),yield(0,x.fl)(this.execute("executeTests",{path:e,relevantTestsOnly:t},!1,(async(e,t)=>{const s=this.refreshTrees();if(e instanceof vh)await(0,x.fl)(this.loadFile(e.source,new Zd(e.source,e.line,e.column,new pm(e.text.split("\n").filter(Boolean)[0])))),this.setActiveAuxPanelMode(Fd.CONSOLE),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof Fh){this.setActiveAuxPanelMode(Fd.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new au(this,e);this.setTestRunnerState(t),await(0,x.fl)(t.buildTestTreeData()),t.refreshTree(),await(0,x.fl)(t.pollTestRunnerResult()),this.testRunState.pass()}this.resetChangeDetection(t),await s}))))}*executeFullTestSuite(e){yield(0,x.fl)(this.executeTests("::",e))}*executeNavigation(e){this.navigationStack.push(e),yield(0,x.fl)(this.execute("getConcept",{file:e.file,line:e.line,column:e.column},!1,(async(e,t)=>{e instanceof Ph&&await(0,x.fl)(this.loadFile(e.jumpTo.source,new Kd(e.jumpTo.source,e.jumpTo.line,e.jumpTo.column))),this.resetChangeDetection(t)}),{avoidUpdatingConsoleText:!0}))}*navigateBack(){if(0!==this.navigationStack.length){if(this.navigationStack.length>0){const e=this.navigationStack.pop();e&&(yield(0,x.fl)(this.loadFile(e.file,e)))}}else this.applicationStore.notifyWarning("Can't navigate back any further - navigation stack is empty")}*fullReCompile(e){this.applicationStore.setActionAlertInfo({message:"Are you sure you want to perform a full re-compile?",prompt:"This may take a long time to complete",type:Rt.CAUTION,actions:[{label:"Perform full re-compile",type:Pt.PROCEED_WITH_CAUTION,handler:()=>{(0,x.fl)(this.execute("executeSaveAndReset",{},!0,(async(t,s)=>{this.initState.reset(),await(0,x.fl)(this.initialize(e,void 0,this.client.mode,this.client.compilerMode)),this.resetChangeDetection(s),this.setActiveActivity(kd.CONCEPT,{keepShowingIfMatchedCurrent:!0})}))).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Pt.PROCEED,default:!0}]})}resetChangeDetection(e){this.tabManagerState.tabs.filter(Y(uh)).filter((t=>e.includes(t.filePath))).forEach((e=>e.resetChangeDetection()))}async refreshTrees(){await Promise.all([this.directoryTreeState.refreshTreeData(),this.conceptTreeState.refreshTreeData()])}async revealConceptInTree(e){let t;try{t=await this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning("Can't find concept info. Please make sure that the code compiles and that you are looking for references of non primitive types!")}if(t.path){this.applicationStore.setBlockingAlert({message:"Revealing concept in tree...",showLoading:!0});try{this.activeActivity!==kd.CONCEPT&&this.setActiveActivity(kd.CONCEPT);const e=t.path.split(Ee);let s=H(e[0]),i=H(this.conceptTreeState.getTreeData().nodes.get(s));for(let t=1;t<e.length;++t)s=`${s}${Ee}${e[t]}`,this.conceptTreeState.getTreeData().nodes.get(s)||await(0,x.fl)(this.conceptTreeState.expandNode(i)),i=H(this.conceptTreeState.getTreeData().nodes.get(s));this.conceptTreeState.setSelectedNode(i)}catch{this.applicationStore.notifyWarning("Error revealing concept. Please make sure that the code compiles and that you are looking for a valid concept")}finally{this.applicationStore.setBlockingAlert(void 0)}}}*command(e){try{const s=(t=yield e()).error?(0,Be.vB)(ou,t):new ru;return!(s instanceof ou&&(s.errorDialog?this.applicationStore.notifyWarning(`Error: ${s.text}`):this.setConsoleText(s.text),1))}catch(e){return V(e),this.applicationStore.notifyError(e),!1}var t}async getConceptInfo(e){try{return await this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning("Can't find concept info. Please make sure that the code compiles and that you are looking for references of non primitive types!")}}async findConceptUsages(e,t){return(await this.client.getUsages(e,t)).map((e=>(0,Be.vB)(Jd,e)))}*findUsages(e){const t=yield this.getConceptInfo(e);if(t)try{this.applicationStore.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${qd(t)}`,showLoading:!0});const e=yield this.findConceptUsages(t.pureType===Vd.ENUM_VALUE?Xd.ENUM:t.pureType===Vd.PROPERTY||t.pureType===Vd.QUALIFIED_PROPERTY?Xd.PROPERTY:Xd.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`)),s=(yield this.client.getTextSearchPreview(e.map((e=>(0,Be.qC)(Vh,new Vh(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn)))))).map((e=>(0,Be.vB)(Vh,e)));this.setSearchState(new Hh(this,t,e,s)),this.setActiveAuxPanelMode(Fd.SEARCH_RESULT),this.auxPanelDisplayState.open()}catch(e){V(e),this.applicationStore.notifyError(e)}finally{this.applicationStore.setBlockingAlert(void 0)}}*renameConcept(e,t,s,i){try{yield this.client.renameConcept({oldName:e,newName:t,pureType:s,sourceInformations:i.map((e=>({sourceId:e.source,line:e.line,column:e.column})))});const n=i.map((e=>e.source));for(const e of n)yield this.reloadFile(e);yield this.refreshTrees(),this.setConsoleText("Sucessfully renamed concept. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError(`Can't rename concept '${e}'`)}}*movePackageableElements(e){try{yield this.client.movePackageableElements(e.map((e=>({pureName:e.pureName,pureType:e.pureType,sourcePackage:e.sourcePackage,destinationPackage:e.destinationPackage,sourceInformations:e.usages.map((e=>({sourceId:e.source,line:e.line,column:e.column})))}))));const t=(0,Xe.Z)(e.flatMap((e=>e.usages.map((e=>e.source)))));for(const e of t)yield this.reloadFile(e);yield this.refreshTrees(),this.setConsoleText("Sucessfully moved packageble elements. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError("Can't move packageable elements")}}*updateFileUsingSuggestionCandidate(e){this.setSearchState(void 0),yield(0,x.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActiveAuxPanelMode(Fd.CONSOLE),this.auxPanelDisplayState.open()}*updateFile(e,t,s,i,n){try{const a=yield this.client.updateSource([{path:e,line:t,column:s,message:n,add:i}]);if(a.modifiedFiles.length)for(const e of a.modifiedFiles)yield this.reloadFile(e);this.setConsoleText("Sucessfully updated file. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError(`Can't update file: ${e}`)}}*searchFile(){this.fileSearchCommandLoadingState.isInProgress||(this.fileSearchCommandLoadingState.inProgress(),this.fileSearchCommandResults=yield this.client.findFiles(this.fileSearchCommandState.text,this.fileSearchCommandState.isRegExp),this.fileSearchCommandLoadingState.pass())}*searchText(){if(!this.textSearchCommandLoadingState.isInProgress){this.textSearchCommandLoadingState.inProgress(),this.setActiveAuxPanelMode(Fd.SEARCH_RESULT),this.auxPanelDisplayState.open();try{const e=(yield this.client.searchText(this.textSearchCommandState.text,this.textSearchCommandState.isCaseSensitive,this.textSearchCommandState.isRegExp)).map((e=>(e=>(0,Be.vB)(Gh,e))(e)));this.setSearchState(new Bh(this,e)),this.textSearchCommandLoadingState.pass()}catch(e){V(e),this.applicationStore.notifyError(e),this.textSearchCommandLoadingState.fail()}}}*createNewDirectory(e){try{yield(0,x.fl)(this.command((()=>this.client.createFolder(Yd(e))))),yield(0,x.fl)(this.directoryTreeState.refreshTreeData())}catch(e){V(e),this.applicationStore.notifyError(e)}}*createNewFile(e){try{const t=yield(0,x.fl)(this.command((()=>this.client.createFile(Yd(e)))));yield(0,x.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,x.fl)(this.loadFile(e)))}catch(e){V(e),this.applicationStore.notifyError(e)}}*renameFile(e,t){try{yield(0,x.fl)(this.command((()=>this.client.renameFile(e,t)))),yield(0,x.fl)(this.directoryTreeState.refreshTreeData());const s=this.tabManagerState.tabs.find((t=>t instanceof uh&&t.filePath===e));s&&this.tabManagerState.closeTab(s)}catch(e){V(e),this.applicationStore.notifyError(e)}}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,x.fl)(this.command((()=>this.client.deleteDirectoryOrFile(Yd(e))))),this.tabManagerState.tabs.filter((s=>s instanceof uh&&(t?s.filePath.startsWith(`${e}/`):s.filePath===e))).forEach((e=>this.tabManagerState.closeTab(e))),await(0,x.fl)(this.directoryTreeState.refreshTreeData())};this.applicationStore.setActionAlertInfo({message:`Are you sure you would like to delete this ${t?"directory":"file"}?`,prompt:s?"Beware! This directory is not empty, this action is not undo-able, you have to manually revert using VCS":"Beware! This action is not undo-able, you have to manually revert using VCS",type:Rt.CAUTION,actions:[{label:"Delete anyway",type:Pt.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Pt.PROCEED,default:!0}]})}}const _m=(0,at.createContext)(void 0),gm=({children:e})=>{const t=Ft(),s=(0,nt.fv)((()=>new mm(t)));return(0,T.jsx)(_m.Provider,{value:s,children:e})},Em=()=>H((0,at.useContext)(_m),"Can't find editor store in context"),fm=(0,nt.Pi)((()=>{const e=Em();return(0,T.jsxs)("div",{className:"console-panel",children:[e.consoleText&&(0,T.jsx)("pre",{className:"console-panel__content",children:e.consoleText.trim()}),!e.consoleText&&(0,T.jsx)(hd,{children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Execute to see output"}),(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F9"})})]})})})})]})})),Tm=(0,nt.Pi)((e=>{const{searchState:t,searchEntry:s}=e,i=Em(),n=Ft(),a=e=>()=>(0,x.fl)(i.loadFile(s.sourceId,new Kd(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,T.jsxs)("div",{className:"search-panel__entry",children:[(0,T.jsxs)("div",{className:"search-panel__entry__header",children:[(0,T.jsxs)("div",{className:"search-panel__entry__header__title",children:[(0,T.jsx)("div",{className:"search-panel__entry__header__title__label",children:(0,T.jsx)(Xc.QqN,{})}),(0,T.jsx)("div",{className:"search-panel__entry__header__title__content",children:Yd(s.sourceId)})]}),(0,T.jsxs)("div",{className:"search-panel__entry__header__actions",children:[(0,T.jsx)("div",{className:"search-panel__entry__header__action search-panel__entry__header__action--with-counter",children:(0,T.jsx)("div",{className:"search-panel__entry__header__action__counter",children:s.coordinates.length})}),(0,T.jsx)("button",{className:"search-panel__entry__header__action search-panel__entry__header__action--hidden",tabIndex:-1,title:"Dismiss",onClick:()=>t.dismissSearchEntry(s),children:(0,T.jsx)(Xc.q1B,{})})]})]}),(0,T.jsx)("div",{className:"search-panel__entry__content",children:s.coordinates.map((e=>(0,T.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"search-panel__entry__content__item__label search-panel__entry__content__item__label--full",title:"Go to Result",onClick:a(e),children:[e.preview&&(0,T.jsxs)("div",{className:"search-panel__entry__content__item__label__content",children:[(0,T.jsx)("div",{className:"search-panel__entry__content__item__label__coordinates",children:`[${e.startLine}:${e.startColumn}]`}),(0,T.jsxs)("div",{className:"search-panel__entry__content__item__label__preview",children:[(0,T.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text",children:e.preview.before}),(0,T.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text search-panel__entry__content__item__label__preview__text--found",children:e.preview.found.replaceAll(/\n/g,"↵")}),(0,T.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text",children:e.preview.after})]})]}),!e.preview&&(0,T.jsx)(T.Fragment,{children:`line: ${e.startLine} - column: ${e.startColumn}`})]}),(0,T.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"search-panel__entry__content__item__action search-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,T.jsx)(Xc.q1B,{})})})]},e.uuid)))})]})})),Cm=(0,nt.Pi)((e=>{const{searchState:t}=e,s=Em();return t.searchEntries.length?(0,T.jsxs)("div",{className:"search-panel__content",children:[(0,T.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} result(s) in ${t.numberOfFiles} files for '${s.textSearchCommandState.text}'`}),t.searchEntries.map((e=>(0,T.jsx)(Tm,{searchState:t,searchEntry:e},e.uuid)))]}):(0,T.jsx)(hd,{children:`No occurrences found for '${s.textSearchCommandState.text}'`})})),xm=(0,nt.Pi)((e=>{const{usageState:t}=e;return t.searchEntries.length?(0,T.jsxs)("div",{className:"search-panel__content",children:[(0,T.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} usages(s) in ${t.numberOfFiles} files for ${qd(t.usageConcept)}`}),t.searchEntries.map((e=>(0,T.jsx)(Tm,{searchState:t,searchEntry:e},e.uuid)))]}):(0,T.jsx)(hd,{children:`No usages found for ${qd(t.usageConcept)}`})})),Nm=(0,nt.Pi)((e=>{const{candidate:t}=e,s=Em(),i=Ft(),n=()=>{(0,x.fl)(s.loadFile(t.sourceID,new Kd(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)};return(0,T.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Go to Result",onClick:n,children:[(0,T.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,T.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${Yd(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,T.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:n,children:(0,T.jsx)(Xc.bK4,{})})})]})})),Am=(0,nt.Pi)((e=>{const{candidate:t}=e,s=Em(),i=Ft();return(0,T.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Add Suggested Import",onClick:()=>{(0,x.fl)(s.updateFileUsingSuggestionCandidate(t)).catch(i.alertUnhandledError)},children:[(0,T.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,T.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${Yd(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,T.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:()=>{(0,x.fl)(s.loadFile(t.sourceID,new Kd(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,T.jsx)(Xc.bK4,{})})})]})})),Om=(0,nt.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,T.jsxs)("div",{className:"search-panel__content",children:[!s.candidatesWithPackageImported.length&&(0,T.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages already imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageImported.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages already imported, would match the function '${s.candidateName}' if you changed the parameters`}),(0,T.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageImported.map((e=>(0,T.jsx)(Nm,{candidate:e},e.uuid)))})]}),!s.candidatesWithPackageNotImported.length&&(0,T.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages not imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageNotImported.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages not imported, match the function '${s.candidateName}'. Click on result to import the necessary package`}),(0,T.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageNotImported.map((e=>(0,T.jsx)(Am,{candidate:e},e.uuid)))})]})]})})),Sm=(0,nt.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,T.jsxs)("div",{className:"search-panel__content",children:[!s.candidates.length&&(0,T.jsx)("div",{className:"search-panel__content__header",children:`No possible matches found for '${s.candidateName}'`}),Boolean(s.candidates.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"search-panel__content__header",children:`Found possible matches for '${s.candidateName}'. Click on result to import the necessary package`}),(0,T.jsx)("div",{className:"search-panel__entry",children:s.candidates.map((e=>(0,T.jsx)(Am,{candidate:e},e.uuid)))})]})]})})),ym=(0,nt.Pi)((()=>{const e=Em();return(0,T.jsxs)("div",{className:"search-panel",children:[(0,T.jsx)(Kc,{isLoading:e.textSearchCommandLoadingState.isInProgress}),!e.searchState&&(0,T.jsx)(hd,{children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Search something"}),(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Xc.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Xc.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F"})]})]})})})}),e.searchState instanceof Hh&&(0,T.jsx)(xm,{usageState:e.searchState}),e.searchState instanceof Bh&&(0,T.jsx)(Cm,{searchState:e.searchState}),e.searchState instanceof Yh&&(0,T.jsx)(Om,{searchState:e.searchState}),e.searchState instanceof Wh&&(0,T.jsx)(Sm,{searchState:e.searchState})]})})),Im=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,T.jsxs)("div",{className:(0,jc.clsx)("tree-view__node__container",{[`${n}__tree-view__node__container`]:n}),onClick:()=>a?.(t),style:{paddingLeft:(s-1)*(i??1)+"rem",display:"flex"},children:[(0,T.jsx)("div",{className:(0,jc.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.XCv,{}))}),(0,T.jsx)("div",{className:(0,jc.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},vm=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:vm,TreeNodeContainer:Im},d=r?{...c,...r}:c;return(0,T.jsxs)("div",{className:(0,jc.clsx)("tree-view__node__block",{[`${a}__tree-view__node__block`]:a}),children:[(0,T.jsx)(d.TreeNodeContainer,{node:t,level:s+1,stepPaddingInRem:o,classPrefix:a,onNodeSelect:i,innerProps:l}),t.isOpen&&n(t).map((e=>(0,T.jsx)(d.TreeNodeView,{node:e,level:s+1,components:r,classPrefix:a,onNodeSelect:i,getChildNodes:n,innerProps:l},e.id)))]})},Rm=e=>{const{treeData:t,className:s,classPrefix:i,components:n,onNodeSelect:a,getChildNodes:r,getRootNodes:o,innerProps:l}=e,c=o?.(t)??t.rootIds.map((e=>t.nodes.get(e))).filter(z),d={TreeNodeView:vm,TreeNodeContainer:Im},h=n?{...d,...n}:d;return(0,T.jsx)("div",{className:(0,jc.clsx)("tree-view__node__root",s??"",{[`${i}__tree-view__node__root`]:i}),children:c.map((e=>(0,T.jsx)(h.TreeNodeView,{level:0,node:e,getChildNodes:r,components:h,onNodeSelect:a,classPrefix:i,innerProps:l},e.id)))})};var Pm=s(2546);const wm=Pm.gs,Lm="resizable-panel--collapsed",bm=(e,t)=>({collapsiblePanel:{className:(0,jc.clsx)(...t?.classes??[],{[Lm]:e}),onStartResize:e=>{e.domElement.classList.remove(Lm),t?.onStartResize?.(e)},onStopResize:e=>{const s=Number(e.domElement.style.flexGrow);s<=.01?e.domElement.style.flexGrow="0":s>=.99&&(e.domElement.style.flexGrow="1"),t?.onStopResize?.(e)},size:!e&&t?.size?t.size:0,flex:e?0:void 0},remainingPanel:{flex:e?1:void 0}}),Dm=Pm.jW,Mm=Pm.nN,km=e=>(0,T.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var Fm=s(48845);const jm=(0,nt.Pi)((e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,{testRunnerState:r,onNodeOpen:o,onNodeExpand:l,onNodeCompress:c,renderNodeLabel:d}=a,h=Em(),u=Ft(),p=r.testResultInfo,m=!t.data.type,_=t.id===r.selectedTestId;let g;switch(p?((e,t)=>{const s=e.id;return Boolean(e.data.type)?((e,t)=>t.passedTests.has(e)?Xh.PASSED:t.failedTests.has(e)?Xh.FAILED:t.testsWithError.has(e)?Xh.ERROR:Xh.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(`${s}_`)))||t.testWithErrorIds.some((e=>e.startsWith(`${s}_`)))?Xh.FAILED:t.notRunTestIds.some((e=>e.startsWith(`${s}_`)))?Xh.RUNNING:Xh.PASSED})(t,p):void 0){case Xh.PASSED:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--passed",children:(0,T.jsx)(Xc.rE2,{})});break;case Xh.FAILED:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--failed",children:(0,T.jsx)(Xc.$Ow,{})});break;case Xh.ERROR:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--error",children:(0,T.jsx)(Xc.xDH,{})});break;case Xh.RUNNING:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--running",children:(0,T.jsx)(Xc.VRP,{})});break;default:g=(0,T.jsx)(Xc.pTE,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,T.jsxs)("div",{className:(0,jc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected":_}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t),m?E():o(t)},onDoubleClick:()=>{m?E():(0,x.fl)(h.loadFile(t.data.li_attr.file,new Kd(t.data.li_attr.file,Number.parseInt(t.data.li_attr.line,10),Number.parseInt(t.data.li_attr.column,10)))).catch(u.alertUnhandledError)},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:E,children:m?t.isOpen?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.XCv,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:g})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:d?.(t)??t.label})]})})),Um=(0,nt.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=e=>t.setSelectedTestId(e.id),n=e=>{let t=e.id.split("__")[0];if(!t)return e.label;const s=t.split("_");return t=s.slice(1,s.length).join(Ee),(0,T.jsxs)("div",{className:"test-runner-list__item__label",children:[(0,T.jsx)("div",{className:"test-runner-list__item__label__name",children:e.label}),(0,T.jsx)("div",{className:"test-runner-list__item__label__path",children:t})]})};return(0,T.jsx)("div",{className:"explorer__content",children:Array.from(t.allTests.keys()).map((e=>s.nodes.get(e))).filter(z).map((e=>(0,T.jsx)(jm,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:n,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),Vm=(0,nt.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=0===s.nodes.size;return(0,T.jsxs)("div",{className:"explorer__content",children:[i&&(0,T.jsx)(hd,{children:"No tests found"}),!i&&(0,T.jsx)(Rm,{components:{TreeNodeContainer:jm},treeData:s,onNodeSelect:()=>{},getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter(z),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})),Gm=(0,nt.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=Em(),a=Ft(),r=i.results.get(s),o=H(t.allTests.get(s),`Can't find info for test with ID '${s}'`);return(0,T.jsxs)("div",{className:"panel",children:[(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__label",children:o.text})}),(0,T.jsx)("div",{className:"panel__header__actions",children:(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,title:"Open File",onClick:()=>{(0,x.fl)(n.loadFile(o.li_attr.file,new Kd(o.li_attr.file,Number.parseInt(o.li_attr.line,10),Number.parseInt(o.li_attr.column,10)))).catch(a.alertUnhandledError)},children:(0,T.jsx)(Xc.qdB,{})})})]}),(0,T.jsxs)("div",{className:"panel__content test-runner-panel__result",children:[!r&&(0,T.jsx)("div",{className:"test-runner-panel__result__content",children:"Running..."}),r instanceof Jh&&(0,T.jsx)("div",{className:"test-runner-panel__result__content",children:"Test passed!"}),r instanceof eu&&(0,T.jsx)("pre",{className:"test-runner-panel__result__content",children:r.error.text})]})]})})),$m=(0,nt.Pi)((e=>{const{testRunnerState:t}=e,s=Em(),i=Ft(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??Zh.NONE,o=a?.runPercentage??0;return(0,T.jsx)("div",{className:"test-runner-panel__content",children:(0,T.jsxs)(wm,{orientation:"vertical",children:[(0,T.jsx)(Dm,{minSize:400,children:(0,T.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,T.jsx)(Kc,{isLoading:t.treeBuildingState.isInProgress}),(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsxs)("div",{className:"panel__header__title__content test-runner-panel__explorer__report",children:[(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview",children:[(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--total",children:[n," total"]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--passed",children:[a?.passed??0," ",(0,T.jsx)(Xc.rE2,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--failed",children:[a?.failed??0," ",(0,T.jsx)(Xc.$Ow,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--error",children:[a?.error??0," ",(0,T.jsx)(Xc.xDH,{})]})]}),a&&(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__time",children:[a.time,"ms"]})]})}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.setViewAsList(!t.viewAsList),title:t.viewAsList?"View As Tree":"View As List",children:t.viewAsList?(0,T.jsx)(Xc.NEI,{className:"test-runner-panel__icon--tree-view"}):(0,T.jsx)(Xc.VjU,{className:"test-runner-panel__icon--list-view"})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.expandTree(),title:"Expand All",children:(0,T.jsx)(Xc.Qq,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,T.jsx)(Xc.jG4,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,disabled:!s.testRunState.isInProgress,onClick:()=>{(0,x.fl)(t.cancelTestRun()).catch(i.alertUnhandledError)},title:"Stop",children:(0,T.jsx)(Xc.SCS,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,x.fl)(t.rerunTestSuite()).catch(i.alertUnhandledError)},disabled:s.testRunState.isInProgress,title:"Run Suite",children:(0,T.jsx)(Xc.o1U,{})})]})]}),(0,T.jsx)("div",{className:"test-runner-panel__header__status",children:(0,T.jsx)(Fm.Z,{className:`test-runner-panel__progress-bar test-runner-panel__progress-bar--${r.toLowerCase()}`,classes:{bar:`test-runner-panel__progress-bar__bar test-runner-panel__progress-bar__bar--${r.toLowerCase()}`},variant:"determinate",value:o})}),(0,T.jsx)("div",{className:"panel__content",children:t.treeData&&(0,T.jsxs)(T.Fragment,{children:[!t.viewAsList&&(0,T.jsx)(Vm,{testRunnerState:t}),t.viewAsList&&(0,T.jsx)(Um,{testRunnerState:t})]})})]})}),(0,T.jsx)(Mm,{children:(0,T.jsx)(km,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsxs)(Dm,{minSize:400,children:[t.selectedTestId&&!a&&(0,T.jsx)("div",{}),t.selectedTestId&&a&&(0,T.jsx)(Gm,{testRunnerState:t,selectedTestId:t.selectedTestId,testResultInfo:a}),!t.selectedTestId&&(0,T.jsxs)("div",{className:"panel",children:[(0,T.jsx)("div",{className:"panel__header"}),(0,T.jsx)("div",{className:"panel__content",children:(0,T.jsx)(hd,{children:"No test selected"})})]}),(0,T.jsx)("div",{})]})]})})})),zm=(0,nt.Pi)((()=>{const e=Em().testRunnerState;return(0,T.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,T.jsx)(hd,{children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content",children:[(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run full test suite"}),(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run relevant tests only"}),(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Xc.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,T.jsx)($m,{testRunnerState:e})]})})),Bm=(0,nt.Pi)((()=>{const e=Em(),t={[Fd.CONSOLE]:{mode:Fd.CONSOLE,name:"CONSOLE",icon:void 0,isVisible:!0},[Fd.SEARCH_RESULT]:{mode:Fd.SEARCH_RESULT,name:"SEARCH",icon:(0,T.jsx)("div",{className:"auxiliary-panel__header__tab__icon--search",children:(0,T.jsx)(Xc.W1M,{})}),isVisible:!0},[Fd.TEST_RUNNER]:{mode:Fd.TEST_RUNNER,name:"TEST",icon:(0,T.jsx)("div",{className:"auxiliary-panel__header__tab__icon--test",children:(0,T.jsx)(Xc.Vzd,{})}),isVisible:!0}},s=Object.values(Fd).filter((e=>z(t[e])&&t[e].isVisible)),i=t=>e.activeAuxPanelMode===t&&s.includes(t);return(0,at.useEffect)((()=>{s.includes(e.activeAuxPanelMode)||e.setActiveAuxPanelMode(Fd.CONSOLE)}),[e,s,e.activeAuxPanelMode]),(0,T.jsxs)("div",{className:"panel auxiliary-panel",children:[(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"auxiliary-panel__header__tabs",children:s.map((e=>t[e])).filter(z).map((t=>{return(0,T.jsxs)("button",{tabIndex:-1,className:(0,jc.clsx)("auxiliary-panel__header__tab",{"auxiliary-panel__header__tab--active":e.activeAuxPanelMode===t.mode}),onClick:(s=t.mode,()=>e.setActiveAuxPanelMode(s)),children:[t.icon&&(0,T.jsx)("div",{className:"auxiliary-panel__header__tab__icon",children:t.icon}),(0,T.jsx)("div",{className:"auxiliary-panel__header__tab__title",children:t.name})]},t.mode);var s}))}),(0,T.jsxs)("div",{className:"auxiliary-panel__header__actions",children:[(0,T.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggleMaximize(),tabIndex:-1,title:"Toggle Expand/Collapse",children:e.auxPanelDisplayState.isMaximized?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.g8U,{})}),(0,T.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,T.jsx)(Xc.b0D,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content",children:[i(Fd.CONSOLE)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(fm,{})}),i(Fd.SEARCH_RESULT)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(ym,{})}),i(Fd.TEST_RUNNER)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(zm,{})})]})]})}));var Hm=s(42689);const Ym=()=>(0,T.jsx)("div",{className:"icon color--package",children:(0,T.jsx)(Xc.jtq,{})}),Wm=()=>(0,T.jsx)("div",{className:"icon color--class",children:"C"}),Km=()=>(0,T.jsx)("div",{className:"icon color--enumeration",children:"E"}),Zm=()=>(0,T.jsx)("div",{className:"icon color--measure",children:"M"}),Xm=()=>(0,T.jsx)("div",{className:"icon color--unit",children:"u"}),qm=()=>(0,T.jsx)("div",{className:"icon color--profile",children:"P"}),Jm=()=>(0,T.jsx)("div",{className:"icon icon--function color--function",children:(0,T.jsx)(Xc.eid,{})}),Qm=()=>(0,T.jsx)("div",{className:"icon color--mapping",children:(0,T.jsx)(Xc.Zlt,{})}),e_=()=>(0,T.jsx)("div",{children:(0,T.jsx)(Xc.UOT,{})}),t_=()=>(0,T.jsx)("div",{className:"icon icon--function color--native-function",children:(0,T.jsx)(Xc.eid,{})}),s_=()=>(0,T.jsx)("div",{className:"icon icon--property color--property",children:(0,T.jsx)(Xc.HXR,{})}),i_=()=>(0,T.jsx)("div",{className:"icon color--diagram",children:(0,T.jsx)(Xc.oF7,{})}),n_=()=>(0,T.jsx)("div",{className:"icon icon--database",children:(0,T.jsx)(Xc.VHe,{})}),a_=()=>(0,T.jsx)("div",{className:"icon color--association color--pure-association",children:"A"}),r_=e=>{switch(e){case Vd.PACKAGE:return(0,T.jsx)(Ym,{});case Vd.PROFILE:return(0,T.jsx)(qm,{});case Vd.CLASS:return(0,T.jsx)(Wm,{});case Vd.ASSOCIATION:return(0,T.jsx)(a_,{});case Vd.PROPERTY:case Vd.QUALIFIED_PROPERTY:return(0,T.jsx)(s_,{});case Vd.ENUMERATION:return(0,T.jsx)(Km,{});case Vd.MEASURE:return(0,T.jsx)(Zm,{});case Vd.UNIT:return(0,T.jsx)(Xm,{});case Vd.FUNCTION:return(0,T.jsx)(Jm,{});case Vd.NATIVE_FUNCTION:return(0,T.jsx)(t_,{});case Vd.DIAGRAM:return(0,T.jsx)(i_,{});case Vd.DATABASE:return(0,T.jsx)(n_,{});case Vd.MAPPING:return(0,T.jsx)(Qm,{});default:return(0,T.jsx)(e_,{})}},o_=/^[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,l_=/^(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,c_=(0,nt.Pi)((e=>{const{node:t}=e,s=Em(),i=Ft(),n=t.data.li_attr.pureName??t.data.li_attr.pureId,a=t.data.li_attr.pureType===Vd.PACKAGE,[r,o]=(0,at.useState)(a?jl(n):n),l=(0,at.useRef)(null),c=Boolean(r.match(a?l_:o_)),d=(a?jl(n):n)===r,h=c?void 0:"Invalid path",u=()=>s.conceptTreeState.setNodeForRenameConcept(void 0),p=e=>{e.preventDefault(),d||s.conceptTreeState.renameConcept(t,r).catch(i.alertUnhandledError).finally((()=>u()))};return(0,T.jsx)(Fc.Z,{open:!0,onClose:u,TransitionProps:{onEnter:()=>l.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename concept"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:p,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:l,className:"input input--dark",onChange:e=>o(e.target.value),value:r,spellCheck:!1}),h&&(0,T.jsx)("div",{className:"input-group__error-message",children:h})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(h),onClick:p,children:"Rename"})]})]})})})),d_=/^(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,h_=(0,nt.Pi)((e=>{const{node:t}=e,s=Em(),i=Ft(),n=Ul(t.data.li_attr.pureId)??"",[a,r]=(0,at.useState)(n),o=(0,at.useRef)(null),l=Boolean(a.match(d_)),c=n===a,d=l?void 0:"Invalid path",h=()=>s.conceptTreeState.setNodeForMoveElement(void 0),u=e=>{e.preventDefault(),c||s.conceptTreeState.movePackageableElements([K(t.data.li_attr,Bd)],a).catch(i.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(Fc.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Move element"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(d),onClick:u,children:"Move"})]})]})})})),u_=(0,nt.Pi)((0,at.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr,a=n.pureType,r=Em(),o=Ft();return(0,T.jsxs)(nd,{ref:t,children:[n.pureType!==Vd.PROPERTY&&n.pureType!==Vd.QUALIFIED_PROPERTY&&(0,T.jsx)(ad,{onClick:()=>{o.copyTextToClipboard(n.pureId).catch(o.alertUnhandledError)},children:"Copy Path"}),a===Vd.PACKAGE&&(0,T.jsx)(ad,{onClick:()=>{(0,x.fl)(r.executeTests(s.data.li_attr.pureId)).catch(o.alertUnhandledError)},children:"Run Tests"}),a===Vd.FUNCTION&&(0,T.jsx)(ad,{onClick:()=>{window.open(`${r.client.baseUrl}/execute?func=${n.pureId}&mode=${r.client.mode}`,"_blank")},children:"Service (JSON)"}),(n instanceof zd||n instanceof Bd)&&(0,T.jsx)(ad,{onClick:()=>{(n instanceof Bd||n instanceof zd)&&r.findUsages(new Kd(n.file,Number.parseInt(n.line,10),Number.parseInt(n.column,10)))},children:"Find Usages"}),a!==Vd.PACKAGE&&(0,T.jsx)(ad,{onClick:()=>i(s),children:"View Source"}),(0,T.jsx)(rd,{}),(0,T.jsx)(ad,{onClick:()=>r.conceptTreeState.setNodeForRenameConcept(s),children:"Rename"}),n instanceof Bd&&(0,T.jsx)(ad,{onClick:()=>r.conceptTreeState.setNodeForMoveElement(s),children:"Move"})]})})));var p_;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(p_=p_||(p_={}));const m_=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,at.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d,viewConceptSource:h}=a,u=t.parent&&t.data.li_attr instanceof zd&&t.data.li_attr.classPath!==t.parent.id,p=[Vd.PACKAGE,Vd.CLASS].includes(t.data.li_attr.pureType),m=t.data.li_attr.pureType===Vd.QUALIFIED_PROPERTY?(0,T.jsxs)(T.Fragment,{children:[t.label,(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:"(...)"})]}):u?(0,T.jsxs)(T.Fragment,{children:[t.label,(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:jl(K(t.data.li_attr,zd).classPath)})]}):t.label.includes("(")?(0,T.jsxs)(T.Fragment,{children:[t.label.substring(0,t.label.indexOf("(")),(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:t.label.substring(t.label.indexOf("("))})]}):t.label,_=()=>{t.isLoading||(t.isOpen?d(t):c(t))},[,g]=(0,Hm.c)((()=>({type:"Class"===t.data.li_attr.pureType?p_.CLASS:p_.UNSUPPORTED,item:t.data})),[t]);return(0,T.jsx)(id,{content:(0,T.jsx)(u_,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,jc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},ref:g,onDoubleClick:()=>{t.isLoading||(p&&_(),n?.(t),l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,T.jsx)(Xc.VRP,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:_,children:p?t.isOpen?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.XCv,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:(0,jc.clsx)("explorer__package-tree__node__icon__type",{"explorer__package-tree__node__icon__type--property-from-association":u}),children:r_(t.data.li_attr.pureType)})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:m})]})})},__=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(Rm,{components:{TreeNodeContainer:m_},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(z),innerProps:{onNodeOpen:e=>{(0,x.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,x.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()},viewConceptSource:t=>{const s=t.data.li_attr;(s instanceof Bd||s instanceof zd)&&e.directoryTreeState.revealPath(s.file,!0,new Kd(s.file,Number.parseInt(s.line,10),Number.parseInt(s.column,10)))}}}),s.nodeForRenameConcept&&(0,T.jsx)(c_,{node:s.nodeForRenameConcept}),s.nodeForMoveElement&&(0,T.jsx)(h_,{node:s.nodeForMoveElement})]})})),g_=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.conceptTreeState;return(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsx)("div",{className:"panel__header side-bar__header",children:(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"CONCEPTS"})})}),(0,T.jsx)("div",{className:"panel__content side-bar__content",children:(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsxs)("div",{className:"panel__header explorer__header",children:[(0,T.jsx)("div",{className:"panel__header__title"}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,x.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(Xc.DuK,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,T.jsx)(Xc.jG4,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(Kc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(__,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,T.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(hd,{children:"Failed to build concept tree"})]})]})})]})})),E_=/[a-zA-Z0-9_]+(?:.[a-zA-Z0-9_]+)*/,f_=(0,nt.Pi)((e=>{const{node:t}=e,s=Em(),i=Ft(),[n,a]=(0,at.useState)("untitled.pure"),r=(0,at.useRef)(null),o=Boolean(n.match(E_)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid file name",d=()=>s.directoryTreeState.setNodeForCreateNewFile(void 0),h=e=>{e.preventDefault(),d(),(0,x.fl)(s.createNewFile(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(Fc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Create a new file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Create"})]})]})})})),T_=/[a-zA-Z0-9_]+/,C_=(0,nt.Pi)((e=>{const{node:t}=e,s=Em(),i=Ft(),[n,a]=(0,at.useState)("untitled"),r=(0,at.useRef)(null),o=Boolean(n.match(T_)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid directory name",d=()=>s.directoryTreeState.setNodeForCreateNewDirectory(void 0),h=e=>{e.preventDefault(),d(),(0,x.fl)(s.createNewDirectory(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(Fc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Create a new directory"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Create"})]})]})})})),x_=/\/?(?:[a-zA-Z0-9_]\/)*[a-zA-Z0-9_]+(?:.[a-zA-Z0-9_]+)*/,N_=(0,nt.Pi)((e=>{const{node:t}=e,s=Em(),i=Ft(),[n,a]=(0,at.useState)(t.data.li_attr.path),r=(0,at.useRef)(null),o=Boolean(n.match(x_)),l=t.data.li_attr.path===n,c=o?void 0:"Invalid path",d=()=>s.directoryTreeState.setNodeForRenameFile(void 0),h=e=>{e.preventDefault(),l||(d(),(0,x.fl)(s.renameFile(t.data.li_attr.path,n)).catch(i.alertUnhandledError))};return(0,T.jsx)(Fc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Rename"})]})]})})})),A_=(0,nt.Pi)((0,at.forwardRef)((function(e,t){const{node:s}=e,i=Ft(),n=Em(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,T.jsxs)(nd,{ref:t,children:[(0,T.jsx)(ad,{onClick:()=>{i.copyTextToClipboard(s.data.li_attr.path).catch(i.alertUnhandledError)},children:"Copy Path"}),(0,T.jsx)(rd,{}),a&&(0,T.jsx)(ad,{onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,T.jsx)(ad,{onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Directory"}),!a&&(0,T.jsx)(ad,{onClick:()=>n.directoryTreeState.setNodeForRenameFile(s),children:"Rename"}),(0,T.jsx)(ad,{disabled:Boolean(s.data instanceof Eh&&s.data.children),onClick:()=>{(0,x.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"})]})}))),O_=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,at.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d}=a,h=t.data instanceof Eh&&"/platform"===t.data.li_attr.path,u=t.data instanceof Eh&&t.data.li_attr.path.startsWith("/platform"),p=t.data.isFolderNode,m=t.data instanceof Eh&&!t.data.children,_=h?(0,T.jsx)(Xc.R0,{className:"explorer__icon--platform"}):p?m?(0,T.jsx)(Xc.ROc,{className:(0,jc.clsx)({"explorer__icon--platform":u})}):t.isOpen?(0,T.jsx)(Xc.ry,{className:(0,jc.clsx)({"explorer__icon--platform":u})}):(0,T.jsx)(Xc.ROc,{className:(0,jc.clsx)({"explorer__icon--platform":u})}):(0,T.jsx)(Xc.QqN,{className:"explorer__icon--file"}),g=()=>{m||t.isLoading||(t.isOpen?d(t):c(t))};return(0,T.jsx)(id,{content:(0,T.jsx)(A_,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,jc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},onDoubleClick:()=>{t.isLoading||(p?g():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,T.jsx)(Xc.VRP,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:g,children:!p||m?(0,T.jsx)("div",{}):t.isOpen?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.XCv,{})}),(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:_})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:h?"platform":t.label})]})})},S_=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(Rm,{components:{TreeNodeContainer:O_},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(z),innerProps:{onNodeOpen:e=>{(0,x.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,x.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()}}}),s.nodeForCreateNewFile&&(0,T.jsx)(f_,{node:s.nodeForCreateNewFile}),s.nodeForCreateNewDirectory&&(0,T.jsx)(C_,{node:s.nodeForCreateNewDirectory}),s.nodeForRenameFile&&(0,T.jsx)(N_,{node:s.nodeForRenameFile})]})})),y_=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.directoryTreeState;return(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsx)("div",{className:"panel__header side-bar__header",children:(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"FILES"})})}),(0,T.jsx)("div",{className:"panel__content side-bar__content",children:(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsxs)("div",{className:"panel__header explorer__header",children:[(0,T.jsx)("div",{className:"panel__header__title"}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,x.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(Xc.DuK,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof uh&&(0,x.fl)(s.revealPath(i.filePath,!1)).catch(t.alertUnhandledError)},title:"Focus",children:(0,T.jsx)(Xc.cOE,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,T.jsx)(Xc.jG4,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(Kc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(S_,{}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(hd,{children:"Failed to build directory tree"})]})]})})]})})),I_=(0,nt.Pi)((()=>{const e=Em();return(0,T.jsx)("div",{className:"side-bar",children:(0,T.jsx)("div",{className:(0,jc.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case kd.CONCEPT:return(0,T.jsx)(g_,{});case kd.FILE:return(0,T.jsx)(y_,{});default:return null}})()},e.activeActivity)})})),v_=e=>{const{className:t}=e;return(0,T.jsx)("div",{className:(0,jc.clsx)("logo",t),children:(0,T.jsxs)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",width:"1em",height:"1em",viewBox:"0 0 215 215",xmlns:"https://www.w3.org/2000/svg",children:[(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M141.9,86.5L141.9,68.1C141.9,66.5 140.7,65.2 139.1,65.2L66.5,65.2C64.9,65.2 63.7,66.5 63.7,68.1L63.7,86.5C63.7,88.1 64.9,89.4 66.5,89.4L139.1,89.4C140.7,89.4 141.9,88.1 141.9,86.5Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M118.4,116.9L118.4,98.5C118.4,96.9 117.5,95.6 116.4,95.6L65.7,95.6C64.6,95.6 63.7,96.9 63.7,98.5L63.7,116.9C63.7,118.5 64.6,119.8 65.7,119.8L116.5,119.8C117.6,119.8 118.4,118.6 118.4,116.9Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M141.9,147.3L141.9,129C141.9,127.4 140.7,126.1 139.1,126.1L66.5,126.1C64.9,126.1 63.7,127.4 63.7,129L63.7,147.4C63.7,149 64.9,150.3 66.5,150.3L139.1,150.3C140.7,150.3 141.9,149 141.9,147.3Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M205,170.7L152.7,139.1C150,137.4 147.7,138.7 147.7,141.9L147.7,157.9L55.8,157.9L55.8,59.4L67.2,59.4C70.4,59.4 71.7,57.2 70,54.4L38.4,2.1C36.7,-0.6 34.1,-0.6 32.4,2.1L0.7,54.4C-1,57.1 0.3,59.4 3.5,59.4L15.6,59.4L15.6,185.5C15.6,188.5 18,190.9 21,190.9L147.7,190.9L147.7,205.7C147.7,208.9 149.9,210.1 152.7,208.5L205,176.9C207.7,175.1 207.7,172.4 205,170.7Z"})})]})})},R_=(0,nt.Pi)((()=>{const e=Em(),t=t=>()=>e.setActiveActivity(t),s=[{mode:kd.CONCEPT,title:"Concept Explorer",icon:(0,T.jsx)(Xc.DE2,{})},{mode:kd.FILE,title:"File Explorer",icon:(0,T.jsx)(Xc.QqN,{})}].filter((e=>Boolean(e)));return(0,T.jsxs)("div",{className:"activity-bar",children:[(0,T.jsx)("div",{className:"activity-bar__logo",children:(0,T.jsx)(v_,{})}),(0,T.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,T.jsx)("button",{className:(0,jc.clsx)("activity-bar__item",{"activity-bar__item--active":e.sideBarDisplayState.isOpen&&e.activeActivity===s.mode}),onClick:t(s.mode),tabIndex:-1,title:`${s.title}${s.info?` - ${s.info}`:""}`,children:s.icon},s.mode)))})]})})),P_=(0,nt.Pi)((e=>{const{fileEditorState:t}=e,s=t.textEditorState.cursorObserver,i=s?.selection?t.textEditorState.model.getValueInRange(s.selection).length:0;return(0,T.jsx)("div",{className:"file-editor__status-bar",children:s?.position&&(0,T.jsx)("button",{className:"editor__status-bar__action file-editor__status-bar__cursor-info",onClick:()=>t.setShowGoToLinePrompt(!0),tabIndex:-1,title:"Go to Line/Column",children:`Ln ${s.position.lineNumber}, Col ${s.position.column} ${i?` (${i} selected)`:""}`})})})),w_=(0,nt.Pi)((e=>{const{actionsDisabled:t}=e,s=Em(),i=Ft();return(0,T.jsxs)("div",{className:"editor__status-bar",children:[(0,T.jsx)("div",{className:"editor__status-bar__left",children:(0,T.jsx)("div",{className:"editor__status-bar__workspace"})}),(0,T.jsxs)("div",{className:"editor__status-bar__right",children:[s.tabManagerState.currentTab instanceof uh&&(0,T.jsx)(P_,{fileEditorState:s.tabManagerState.currentTab}),(0,T.jsx)("button",{className:(0,jc.clsx)("editor__status-bar__action editor__status-bar__compile-btn",{"editor__status-bar__compile-btn--wiggling":s.executionState.isInProgress}),disabled:t||s.executionState.isInProgress,onClick:()=>{(0,x.fl)(s.executeGo()).catch(i.alertUnhandledError)},tabIndex:-1,title:"Execute (F9)",children:(0,T.jsx)(Xc.pgN,{})}),(0,T.jsx)("button",{className:(0,jc.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":Boolean(s.auxPanelDisplayState.isOpen)}),onClick:()=>s.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Toggle auxiliary panel (Ctrl + `)",children:(0,T.jsx)(Xc.FxN,{})}),(0,T.jsx)("button",{className:(0,jc.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":!i.assistantService.isHidden}),onClick:()=>i.assistantService.toggleAssistant(),tabIndex:-1,title:"Toggle assistant",children:(0,T.jsx)(Xc.UHp,{})})]})]})})),L_=/[0-9]+(?::[0-9]+)?/,b_=(0,nt.Pi)((e=>{const{fileEditorState:t}=e,[s,i]=(0,at.useState)(""),n=(0,at.useRef)(null),a=Boolean(s.match(L_)),r=t.textEditorState.editor?.getPosition(),[o,l]=(e=>{const t=e.split(":");return t.length<1||t.length>2?[1,void 0]:[G((()=>parseInt(H(P(t)))))??1,G((()=>parseInt(H(w(t)))))]})(s),c=1<=o&&o<=t.textEditorState.model.getLineCount(),d=a?c?void 0:"Invalid line number":"Invalid value (format [line:column] - e.g. 123:45)",h=()=>t.setShowGoToLinePrompt(!1),u=e=>{e.preventDefault(),h(),t.textEditorState.setForcedCursorPosition({lineNumber:o,column:l??1})};return(0,T.jsx)(Fc.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>n.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Go to..."}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:n,className:"input input--dark",onChange:e=>i(e.target.value),placeholder:r?`Current Line: ${r.lineNumber}, Col: ${r.column}. Type a line between 1 and ${t.textEditorState.model.getLineCount()} to navigate to`:void 0,value:s,spellCheck:!1}),""!==s&&d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:""===s||Boolean(d),onClick:u,children:"Go"})]})]})})})),D_=(0,nt.Pi)((e=>{const{editorState:t}=e,s=Em(),i=Ft(),n=(0,at.useRef)(null),[a,r]=(0,at.useState)(),o=t.file.content,{ref:l,width:c,height:d}=(0,dd.NB)();return(0,at.useEffect)((()=>{if(!a&&n.current){const e=n.current,s=N.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,theme:O.LEGEND,wordWrap:t.textEditorState.wrapText?"on":"off"});s.onDidChangeModelContent((()=>{const e=s.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),s.onDidChangeCursorPosition((()=>{t.textEditorState.notifyCursorObserver()})),s.onDidChangeCursorSelection((()=>{t.textEditorState.notifyCursorObserver()})),s.setModel(t.textEditorState.model),t.textEditorState.viewState&&s.restoreViewState(t.textEditorState.viewState),s.focus(),t.textEditorState.setEditor(s),r(s)}}),[s,i,t,a]),a&&a.getValue()!==o&&a.setValue(o),(0,at.useEffect)((()=>{void 0!==c&&void 0!==d&&a?.layout({width:c,height:d})}),[a,c,d]),(0,at.useEffect)((()=>{a&&t.textEditorState.forcedCursorPosition&&(jd(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[a,t,t.textEditorState.forcedCursorPosition]),(0,at.useEffect)((()=>()=>{a&&(t.textEditorState.setViewState(a.saveViewState()??void 0),a.dispose())}),[t,a]),(0,T.jsxs)("div",{className:"panel edit-panel file-editor",children:[(0,T.jsx)("div",{className:"panel__header file-editor__header",children:(0,T.jsxs)("div",{className:"file-editor__header__actions",children:[(0,T.jsx)("button",{className:(0,jc.clsx)("file-editor__header__action",{"file-editor__header__action--active":t.textEditorState.wrapText}),tabIndex:-1,onClick:()=>t.textEditorState.setWrapText(!t.textEditorState.wrapText),title:"Toggle Text Wrap",children:(0,T.jsx)(Xc.NK0,{className:"file-editor__icon--text-wrap"})}),t.showGoToLinePrompt&&(0,T.jsx)(b_,{fileEditorState:t})]})}),(0,T.jsx)("div",{className:"panel__content file-editor__content",children:(0,T.jsx)("div",{ref:l,className:"text-editor__container",children:(0,T.jsx)("div",{className:"text-editor__body",ref:n})})})]})})),M_=(e,t,s=!1)=>{if(s)return t.map((e=>`${e}.pure`)).includes(e);const i=H(P(e.split(".")));return t.includes(i)},k_=e=>{(0,at.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])};class F_{pureType;pureId;pureName;text;requiredClassProperties=[]}(0,Be.yu)(F_,{pureType:(0,Be.Ru)(),pureId:(0,Be.Ru)(),pureName:(0,Be.Ru)(),text:(0,Be.Ru)(),requiredClassProperties:(0,Be.jt)((0,Be.pb)((0,Be.Ru)()))});class j_{pureType;pureName;owner;ownerPureType}(0,Be.yu)(j_,{pureType:(0,Be.Ru)(),pureName:(0,Be.Ru)(),owner:(0,Be.Ru)(),ownerPureType:(0,Be.Ru)()});class U_{pureId;pureName;requiredClassProperties=[]}(0,Be.yu)(U_,{pureId:(0,Be.Ru)(),pureName:(0,Be.Ru)(),requiredClassProperties:(0,Be.jt)((0,Be.pb)((0,Be.Ru)()))});class V_{name}(0,Be.yu)(V_,{name:(0,Be.Ru)()});const G_="Diagram",$_="Diagram",z_=e=>({label:{label:e.pureName,description:e.pureId},kind:N.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${e.pureName}(${e.requiredClassProperties.map(((e,t)=>`${e}=\${${t+1}:}`)).join(",")})`}),B_=(e,t)=>{const s=e.pureType,i=s===Vd.FUNCTION||s===Vd.NATIVE_FUNCTION?((e,t,s)=>{const i=jl(t),n=G((()=>i.substring(i.indexOf("_"),i.length-1)))?.split("__")??[];return n.pop(),s&&n.shift(),`${e}(${n.map(((e,t)=>`\${${t+1}:}`)).join(",")})`})(e.pureName,e.pureId,Boolean(t?.preferArrowFunctionForm)):e.pureName,n=s===Vd.PACKAGE?N.languages.CompletionItemKind.Folder:s===Vd.CLASS?N.languages.CompletionItemKind.Class:s===Vd.FUNCTION?N.languages.CompletionItemKind.Function:s===Vd.ENUMERATION?N.languages.CompletionItemKind.Enum:s===Vd.PROFILE?N.languages.CompletionItemKind.Module:s===Vd.ASSOCIATION?N.languages.CompletionItemKind.Interface:N.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:e.text},kind:n,filterText:e.pureName,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:i,sortText:s===Vd.PACKAGE?`zzzz_${e.text}`:e.text}},H_=/(?<incompletePath>(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*::)+$)/,Y_=/->\s*(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*::)+$/,W_=/\^\s*(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*::)+$/,K_=/^\s*import\s+(?:(?<importPath>(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*)::*)/,Z_=(e,t)=>{const s=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),i=`${fe}${Ue.PURE}\n${s}`.split("\n");return i.slice(i.map((e=>e.startsWith(fe))).lastIndexOf(!0)).map((e=>e.match(K_)?.groups?.importPath)).filter(z)},X_=/->\s*(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)?$/,q_=/\^\s*(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)?$/,J_=/^(?<owner>(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*)\s*.$/,Q_=(e,t)=>({label:e.name,kind:N.languages.CompletionItemKind.Variable,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,sortText:t?e.name:`zzzz_${e.name}`,insertText:e.name}),eg=/^[a-zA-Z0-9_][a-zA-Z0-9_$]*/,tg=(0,nt.Pi)((e=>{const{renameConceptState:t}=e,s=Ft(),i=t.fileEditorState,n=t.concept.pureName,[a,r]=(0,at.useState)(n),o=(0,at.useRef)(null),l=Boolean(a.match(eg)),c=n===a,d=l?void 0:"Invalid path",h=()=>{(0,x.fl)(i.setConceptToRenameState(void 0)).catch(s.alertUnhandledError)},u=e=>{e.preventDefault(),c||i.renameConcept(a).catch(s.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(Fc.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename concept"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(d),onClick:u,children:"Rename"})]})]})})})),sg=(0,nt.Pi)((e=>{const{editorState:t}=e,s=(0,at.useRef)(void 0),i=(0,at.useRef)(void 0),n=(0,at.useRef)(void 0),a=(0,at.useRef)(null),[r,o]=(0,at.useState)(),[l,c]=(0,at.useState)(!1),d=Em(),h=Ft(),{ref:u,width:p,height:m}=(0,dd.NB)();return(0,at.useEffect)((()=>{if(!r&&a.current){const e=a.current,s=N.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,language:S.PURE,theme:O.LEGEND,wordWrap:t.textEditorState.wrapText?"on":"off",contextmenu:!0,useShadowDOM:!1});s._codeEditorService.openCodeEditor=async()=>{const e=s.getPosition();e&&(0,x.fl)(d.executeNavigation(new Kd(t.filePath,e.lineNumber,e.column))).catch(h.alertUnhandledError)},s.updateOptions({gotoLocation:{multiple:"goto",multipleDefinitions:"goto",alternativeDefinitionCommand:"DUMMY"}}),s.onContextMenu((()=>c(!0))),s.addAction({id:lh.FIND_USAGES,label:"Find Usages",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Kd(t.filePath,s.lineNumber,s.column);t.findConceptUsages(e)}}}),s.addAction({id:lh.REVEAL_CONCEPT_IN_TREE,label:"Reveal Concept",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();s&&d.revealConceptInTree(new Kd(t.filePath,s.lineNumber,s.column)).catch(h.alertUnhandledError)}}),s.addAction({id:lh.RENAME_CONCEPT,label:"Rename",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){if(!t.textEditorState.model.getWordAtPosition(s))return;const e=new Kd(t.filePath,s.lineNumber,s.column);(0,x.fl)(t.setConceptToRenameState(e)).catch(d.applicationStore.alertUnhandledError)}}}),s.onDidChangeModelContent((()=>{const e=s.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),s.onDidChangeCursorPosition((()=>{t.textEditorState.notifyCursorObserver()})),s.onDidChangeCursorSelection((()=>{t.textEditorState.notifyCursorObserver()})),s.setModel(t.textEditorState.model),t.textEditorState.viewState&&s.restoreViewState(t.textEditorState.viewState),s.focus(),t.textEditorState.setEditor(s),o(s)}}),[d,h,t,r]),s.current?.dispose(),s.current=N.languages.registerDefinitionProvider(S.PURE,{provideDefinition:(e,s)=>{const i=N.editor.tokenize(e.getLineContent(s.lineNumber),S.PURE)[0];if(!i)return[];let n,a;for(let e=1;e<i.length;++e){const t=H(i[e]);if(t.offset+1>s.column){n=H(i[e-1]),a={startLineNumber:s.lineNumber,startColumn:n.offset+1,endLineNumber:s.lineNumber,endColumn:t.offset+1};break}}return n&&a&&M_(n.type,[Ge.TYPE,Ge.VARIABLE,Ge.PROPERTY,Ge.PARAMETER,Ge.IDENTIFIER])?[{uri:t.textEditorState.model.uri,range:a}]:[]}}),i.current?.dispose(),i.current=N.languages.registerCompletionItemProvider(S.PURE,{triggerCharacters:["#",":",">",".","@","^","$"],provideCompletionItems:async(e,s,i)=>{let n=[];if(i.triggerKind===N.languages.CompletionTriggerKind.TriggerCharacter)switch(i.triggerCharacter){case"#":n=n.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a={startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber,endColumn:n.endColumn};var r;return r=t.getValueInRange(a).trim(),Boolean(r.match(/\s/))||s.forEach((e=>{i.push({label:{label:`${fe}${e.text}`,description:e.description},kind:N.languages.CompletionItemKind.Keyword,insertText:`${fe}${e.insertText}\n`,range:a,documentation:e.documentation?e.documentation.markdownText?{value:e.documentation.markdownText.value}:e.documentation.text:void 0})})),i})(s,e,[{text:Ue.PURE,description:"(core Pure)",insertText:Ue.PURE},{text:Ue.MAPPING,description:"(dsl)",insertText:Ue.MAPPING},{text:Ue.CONNECTION,description:"(dsl)",insertText:Ue.CONNECTION},{text:Ue.RUNTIME,description:"(dsl)",insertText:Ue.RUNTIME},{text:Ue.RELATIONAL,description:"(external store)",insertText:Ue.RELATIONAL},{text:G_,description:"(dsl)",insertText:$_}]));break;case":":n=n.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(H_);if(i?.groups?.incompletePath){const n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Y_)),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(W_));let r=[];try{r=(await s.client.getSuggestionsForIncompletePath(i.groups.incompletePath.substring(0,i.groups.incompletePath.length-Ee.length),a?[Vd.CLASS]:n?[Vd.FUNCTION,Vd.NATIVE_FUNCTION]:[])).map((e=>(0,Be.vB)(F_,e)))}catch{}return r.map((e=>a?z_(e):B_(e,{preferArrowFunctionForm:n})))}return[]})(s,e,d));break;case">":n=n.concat(await(async(e,t,s)=>{const i=Z_(e,t);let n=[];try{n=(await s.client.getSuggestionsForIdentifier(i,[Vd.FUNCTION,Vd.NATIVE_FUNCTION])).map((e=>(0,Be.vB)(F_,e)))}catch{}return n.map((e=>B_(e,{preferArrowFunctionForm:!0})))})(s,e,d));break;case".":n=n.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(J_),n=Z_(e,t);if(i?.groups?.owner){let e=[];try{e=(await s.client.getSuggestionsForAttribute(n,i.groups.owner)).map((e=>(0,Be.vB)(j_,e)))}catch{}return e.map((e=>(e=>{const t=e.pureType,s=t===Vd.PROPERTY||t===Vd.QUALIFIED_PROPERTY?`${e.pureName}(\${1:})`:e.pureName,i=t===Vd.PROPERTY?N.languages.CompletionItemKind.Property:t===Vd.QUALIFIED_PROPERTY?N.languages.CompletionItemKind.Method:t===Vd.TAG?N.languages.CompletionItemKind.Constant:t===Vd.STEREOTYPE?N.languages.CompletionItemKind.Value:t===Vd.ENUM_VALUE?N.languages.CompletionItemKind.Enum:N.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:`${e.owner}.${e.pureName}`},kind:i,filterText:e.pureName,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:s}})(e)))}return[]})(s,e,d));break;case"^":n=n.concat(await(async(e,t,s)=>{const i=Z_(e,t);let n=[];try{n=(await s.client.getSuggestionsForClass(i)).map((e=>(0,Be.vB)(U_,e)))}catch{}return n.map((e=>z_(e)))})(s,e,d));break;case"@":n=n.concat(await(async(e,t,s)=>{const i=Z_(e,t);let n=[];try{n=(await s.client.getSuggestionsForClass(i)).map((e=>(0,Be.vB)(U_,e)))}catch{}return n.map((e=>(e=>({label:{label:e.pureName,description:e.pureId},kind:N.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:e.pureName}))(e)))})(s,e,d));break;case"$":n=n.concat(await(async(e,t,s,i)=>{let n=[];try{n=(await i.client.getSuggestionsForVariable(s,e.lineNumber,e.column)).map((e=>(0,Be.vB)(V_,e)))}catch{}const a=new Set;let r=!1;for(let s=e.lineNumber-1;s>Math.max(0,e.lineNumber-1-10)&&!r;--s){const i=t.getLineContent(s+1);(i.match(/^\s*function\s+/)||i.match(/^\s*###\w+/))&&(r=!0);const n=H(N.editor.tokenize(t.getLineContent(s+1),S.PURE)[0]);n.forEach(((i,r)=>{(s!==e.lineNumber-1||i.offset<e.column)&&M_(i.type,[Ge.VARIABLE,Ge.PARAMETER],!0)&&a.add(t.getValueInRange({startLineNumber:s+1,startColumn:i.offset+1,endLineNumber:s+1,endColumn:r===n.length-1?Number.MAX_SAFE_INTEGER:H(n[r+1]).offset+1}))}))}const o=n.map((e=>e.name));return n.map((e=>Q_(e,!0))).concat(Array.from(a).filter((e=>!o.includes(e))).map((e=>{const t=new V_;return t.name=e,t})).map((e=>Q_(e,!1))))})(s,e,t.filePath,d))}return{suggestions:n}}}),n.current?.dispose(),n.current=N.languages.registerCompletionItemProvider(S.PURE,{triggerCharacters:[],provideCompletionItems:async(e,t,s)=>{let i=[];return s.triggerKind===N.languages.CompletionTriggerKind.Invoke&&(i=i.concat((()=>{const e=[];return e.push({label:{label:"#copyright",description:"(copyright header)"},kind:N.languages.CompletionItemKind.Snippet,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:'// Copyright ${1:2020} Goldman Sachs\n//\n// Licensed under the Apache License, Version 2.0 (the "License");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an "AS IS" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n',range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1e3}}),e})()),i=i.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),r=`${fe}${Ue.PURE}\n${a}`.split("\n").filter((e=>e.startsWith(fe))),o=(e=>{if(e.startsWith(fe))return e.substring(fe.length).split(" ")[0]})(r[r.length-1]??"");return o&&s(o).forEach((t=>{i.push({label:{label:t.text,description:t.description},kind:N.languages.CompletionItemKind.Snippet,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${t.insertText}\n`,range:{startLineNumber:e.lineNumber,startColumn:n.startColumn,endLineNumber:e.lineNumber,endColumn:n.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})})),i})(t,e,(e=>(e=>{switch(e){case Ue.PURE:return[{text:Fe.CLASS,description:"(blank)",insertText:"Class ${1:model::NewClass}\n// example of a constraint\n// [\n// SomeConstraint: true\n// ]\n{\n ${2:// example of a standard property\n // prop1: String[1];\n\n // example of a derived property\n // derivation1() {''\\}: String[1];}\n}"},{text:Fe.CLASS,description:"with property",insertText:"Class ${1:model::NewClass}\n{\n ${2:prop1}: ${3:String[1]};\n}"},{text:Fe.CLASS,description:"with inheritance",insertText:"Class ${1:model::NewClass} extends ${2:model::ParentClass}\n{\n ${3:// class content}\n}"},{text:Fe.CLASS,description:"with constraint",insertText:"Class ${1:model::NewClass}\n[\n ${3:SomeConstraint: true}\n]\n{\n ${2:// class content}\n}"},{text:Fe.PROFILE,insertText:"Profile ${1:model::NewProfile}\n{\n stereotypes: [${2:}];\n tags: [${3:}];\n}"},{text:Fe.ENUMERATION,insertText:"Enum ${1:model::NewEnumeration}\n{\n ${2:VALUE_1,\n VALUE_2}\n}"},{text:Fe.ASSOCIATION,insertText:"Association ${1:model::NewAssociation}\n{\n ${2:prop1}: ${3:model::Type1[1]};\n ${4:prop2}: ${5:model::Type2[1]};\n}"},{text:Fe.FUNCTION,description:"(blank)",insertText:"function ${1:model::NewEnumeration}(${2:param1: String[1]}): ${3:String[1]}\n{\n ${4:''; // function content}\n}"},{text:Fe.FUNCTION,insertText:"function ${1:model::NewEnumeration}(): String[1]\n{\n ''\n}"}];case Ue.MAPPING:return[{text:Fe.MAPPING,description:"(blank)",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:// mapping content}\n)"},{text:Fe.MAPPING,description:"with model-to-model mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Pure\n {\n ~src ${3:model::SourceClass}\n // example of property mappings\n // prop1: $src.prop1\n }\n)"},{text:Fe.MAPPING,description:"with relational mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Relational {\n ~mainTable ${3:[model::SomeDatabase]SomeTable}\n // example of property mappings\n // prop1: [model::SomeDatabase]SomeTable.col1,\n }\n)"},{text:Fe.MAPPING,description:"with enumeration mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetEnumeration}: EnumerationMapping ${3:EnumerationMappingID}\n {\n // example of enum-value mapping\n // VAL_1: ['val1'],\n // VAL_2: ['val2', 'val_2']\n }\n)"}];case Ue.RELATIONAL:return[{text:Fe.DATABASE,description:"(blank)",insertText:"Database ${1:model::NewDatabase}\n(\n // example database schema\n // Schema SOME_SCHEMA\n // (\n // Table TABLE_1\n // (\n // COL_1 VARCHAR(200)\n // )\n // Table TABLE_2\n // (\n // COL_2 VARCHAR(200) PRIMARY_KEY\n // )\n // )\n\n // example database join\n // Join SomeJoin(SOME_SCHEMA.TABLE_1.COL_1 = SCHEMA1.TABLE_2.COL_2)\n\n ${2:// database content}\n)"}];case G_:return[{text:$_,description:"(blank)",insertText:"Diagram ${1:model::NewDiagram}(width=0.0, height=0.0)\n(\n // NOTE: it is recommended to use diagram visual editor\n // to edit diagram: double-click on the diagram in\n // the concept explorer tree to open the editor\n)"}];default:return[]}})(e)))),i=i.concat(((e,t,s=[])=>{const i=t.getWordUntilPosition(e);return[{text:"let",description:"new variable",insertText:"let ${1:} = ${2:};"},{text:"let",description:"new collection",insertText:"let ${1:} = [${2:}];"},{text:"cast",description:"type casting",insertText:"cast(@${1:model::SomeClass})"},{text:"if",description:"(conditional)",insertText:"if(${1:'true'}, | ${2:/* if true do this */}, | ${3:/* if false do this */})"},{text:"case",description:"(conditional)",insertText:"case(${1:}, ${2:'true'}, ${3:'false'})"},{text:"match",description:"(conditional)",insertText:"match([x:${1:String[1]}, ${2:''}])"},{text:"map",description:"(collection)",insertText:"map(x|${1:})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"fold",description:"(collection)",insertText:"fold({a, b| ${1:$a + $b}}, ${2:0})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"sort",description:"(collection)",insertText:"sort()"},{text:"in",description:"(collection)",insertText:"in()"},{text:"slice",description:"(collection)",insertText:"slice(${1:1},${2:2})"},{text:"removeDuplicates",description:"(collection)",insertText:"removeDuplicates()"},{text:"toOne",description:"(collection)",insertText:"toOne(${1:})"},{text:"toOneMany",description:"(collection)",insertText:"toOneMany(${1:})"},{text:"isEmpty",description:"(collection)",insertText:"isEmpty()"},{text:"endsWith",description:"(string)",insertText:"endsWith()"},{text:"startsWith",description:"(string)",insertText:"startsWith()"},...s].map((t=>({label:{label:t.text,description:t.description},kind:N.languages.CompletionItemKind.Snippet,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:t.insertText,range:{startLineNumber:e.lineNumber,startColumn:i.startColumn,endLineNumber:e.lineNumber,endColumn:i.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})))})(t,e,[{text:"print",description:"(io)",insertText:"print(${1:})"},{text:"println",description:"(io)",insertText:"println(${1:})"},{text:"NULL",description:"(nullish value)",insertText:"[]"}])),i=i.concat(await(async(e,t,s)=>{const i=Z_(e,t),n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(X_)),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(q_));let r=[];try{r=(await s.client.getSuggestionsForIdentifier(i,a?[Vd.CLASS]:n?[Vd.FUNCTION,Vd.NATIVE_FUNCTION]:[])).map((e=>(0,Be.vB)(F_,e)))}catch{}return r.map((e=>a?z_(e):B_(e,{preferArrowFunctionForm:n})))})(t,e,d))),{suggestions:i}}}),k_(t),(0,at.useEffect)((()=>{if(l){if(document.querySelector(".file-editor .monaco-menu")){const e=["Peek"];Array.from(document.querySelectorAll(".file-editor .monaco-menu .action-label")).filter((t=>e.includes(t.innerHTML))).forEach((e=>{const t=e.parentElement?.parentElement;t&&(t.classList.add("disabled"),t.style.opacity="0.3",t.style.pointerEvents="none")}))}c(!1)}}),[l]),(0,at.useEffect)((()=>{void 0!==p&&void 0!==m&&r?.layout({width:p,height:m})}),[r,p,m]),(0,at.useEffect)((()=>{r&&t.textEditorState.forcedCursorPosition&&(jd(r,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[r,t,t.textEditorState.forcedCursorPosition]),(0,at.useEffect)((()=>()=>{r&&(t.textEditorState.setViewState(r.saveViewState()??void 0),r.dispose()),s.current?.dispose(),i.current?.dispose(),n.current?.dispose()}),[t,r]),(0,T.jsxs)("div",{className:"panel edit-panel file-editor",children:[(0,T.jsx)("div",{className:"panel__header file-editor__header",children:(0,T.jsxs)("div",{className:"file-editor__header__actions",children:[(0,T.jsx)("button",{className:(0,jc.clsx)("file-editor__header__action",{"file-editor__header__action--active":t.textEditorState.wrapText}),tabIndex:-1,onClick:()=>t.textEditorState.setWrapText(!t.textEditorState.wrapText),title:"Toggle Text Wrap",children:(0,T.jsx)(Xc.NK0,{className:"file-editor__icon--text-wrap"})}),t.renameConceptState&&(0,T.jsx)(tg,{renameConceptState:t.renameConceptState}),t.showGoToLinePrompt&&(0,T.jsx)(b_,{fileEditorState:t})]})}),(0,T.jsx)("div",{className:"panel__content file-editor__content",children:(0,T.jsx)("div",{ref:u,className:"text-editor__container",children:(0,T.jsx)("div",{className:"text-editor__body",ref:a})})})]})}));var ig=s(8533);const ng=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,d=(0,at.useRef)(null),[h,u]=(0,at.useState)(null);return(0,at.useEffect)((()=>{void 0!==t&&(t&&!h&&d.current?u(d.current):!t&&h&&u(null))}),[h,t]),(0,T.jsxs)("button",{ref:d,className:s,disabled:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),o||(h?(l?.(),u(null)):d.current&&(c?.(),u(d.current)))},tabIndex:-1,title:r,children:[i,(0,T.jsx)(sd,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:h,open:(void 0===t||Boolean(t))&&Boolean(h),BackdropProps:{invisible:!0},elevation:0,marginThreshold:0,disableRestoreFocus:!0,...n,children:a})]})},ag=(0,nt.Pi)((0,at.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=Ft(),n=s.diagram,a=t,{width:r,height:o}=(0,dd.NB)({refreshMode:"debounce",refreshRate:50,targetRef:a});(0,at.useEffect)((()=>{if(a.current){const e=new ip(a.current,n);s.setRenderer(e),s.setupRenderer(),e.render(),e.autoRecenter()}}),[a,s,n]),(0,at.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,at.useCallback)(((e,t)=>{if(e instanceof Hd){const n=t.getClientOffset(),a=n?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new ic(n.x,n.y))):void 0;(0,x.fl)(s.addClassView(e.li_attr.pureId,a)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,ig.L)((()=>({accept:p_.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(a),(0,T.jsx)("div",{ref:a,className:(0,jc.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),rg=(0,nt.Pi)((e=>{const{diagramEditorState:t}=e,s=Em(),i=Ft(),n=e=>()=>{t.renderer.zoomCenter(e/100)},a=t.renderer.selectedClasses.length<2;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align left",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_LEFT),children:(0,T.jsx)(Xc.eRw,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align center",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_CENTER),children:(0,T.jsx)(Xc.UPo,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align right",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_RIGHT),children:(0,T.jsx)(Xc.B_D,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align top",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_TOP),children:(0,T.jsx)(Xc.Cti,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align middle",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_MIDDLE),children:(0,T.jsx)(Xc.w0Y,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align bottom",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_BOTTOM),children:(0,T.jsx)(Xc.HLb,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space horizontally",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.SPACE_HORIZONTALLY),children:(0,T.jsx)(Xc.ppk,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space vertically",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.SPACE_VERTICALLY),children:(0,T.jsx)(Xc.LyQ,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsxs)(ng,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,T.jsxs)(nd,{children:[(0,T.jsx)(ad,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,T.jsx)(rd,{}),tp.map((e=>(0,T.jsxs)(ad,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:n(e),children:[e,"%"]},e)))]}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:7},children:[(0,T.jsxs)("div",{className:"diagram-editor__header__dropdown__label diagram-editor__header__zoomer__dropdown__label",children:[Math.round(100*t.renderer.zoom),"%"]}),(0,T.jsx)("div",{className:"diagram-editor__header__dropdown__trigger diagram-editor__header__zoomer__dropdown__trigger",children:(0,T.jsx)(Xc.VAA,{})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__actions",children:(0,T.jsx)("button",{className:"diagram-editor__header__action",tabIndex:-1,onClick:()=>{(0,x.fl)(s.loadFile(t.filePath,new Kd(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,T.jsx)(Xc.qdB,{className:"diagram-editor__icon--go-to-file"})})})]})})),og=(0,nt.Pi)((e=>{const{diagramEditorState:t}=e,s=t.renderer,i=(e,t)=>()=>s.changeMode(e,t);return(0,T.jsxs)("div",{className:"diagram-editor__tools",children:[(0,T.jsx)("button",{className:(0,jc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===qu.LAYOUT}),tabIndex:-1,onClick:i(qu.LAYOUT,Ju.NONE),title:"View Tool (V)",children:(0,T.jsx)(Xc.Hrt,{className:"diagram-editor__icon--layout"})}),(0,T.jsx)("button",{className:(0,jc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===qu.PAN}),tabIndex:-1,onClick:i(qu.PAN,Ju.NONE),title:"Pan Tool (M)",children:(0,T.jsx)(Xc.tPC,{className:"diagram-editor__icon--pan"})}),(0,T.jsx)("button",{className:(0,jc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===qu.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(qu.ZOOM_IN,Ju.NONE),children:(0,T.jsx)(Xc.Sd5,{className:"diagram-editor__icon--zoom-in"})}),(0,T.jsx)("button",{className:(0,jc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===qu.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(qu.ZOOM_OUT,Ju.NONE),children:(0,T.jsx)(Xc.xLV,{className:"diagram-editor__icon--zoom-out"})})]})})),lg=(0,nt.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,at.useRef)(null);return k_(t),(0,T.jsxs)("div",{className:"diagram-editor",children:[(0,T.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,T.jsx)(rg,{diagramEditorState:t})}),(0,T.jsx)("div",{className:"diagram-editor__content",children:(0,T.jsxs)("div",{className:"diagram-editor__stage",children:[t.isDiagramRendererInitialized&&(0,T.jsx)(og,{diagramEditorState:t}),(0,T.jsx)(ag,{diagramEditorState:t,ref:s})]})})]})}));var cg=s(98533),dg=s(84153);const hg=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,T.jsx)("div",{className:(0,jc.clsx)(["dnd__entry-dropzone__placeholder",n]),children:(0,T.jsx)("div",{className:"dnd__entry-dropzone__placeholder__content",children:(0,T.jsx)("div",{className:"dnd__entry-dropzone__placeholder__label",children:s??""})})}):(0,T.jsx)(T.Fragment,{children:t})};function ug(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,cg.f)((e=>({itemType:e.getItemType(),item:e.getItem(),isDragging:e.isDragging(),initialOffset:e.getInitialSourceClientOffset(),currentPosition:e.getClientOffset()})));return a&&n&&i&&s.includes(i.toString())?(0,T.jsx)(bc.Z,{children:(0,T.jsx)("div",{className:"dnd__drag-preview-layer",children:(0,T.jsx)("div",{className:"dnd__drag-preview-layer__content",style:r?{transform:`translate(${r.x/10+2}rem, ${r.y/10+1}rem)`}:{display:"none"},children:t(n)})})}):null}const pg=e=>{if(Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;let t;e.stopPropagation(),t=0===e.deltaY?e.deltaY:e.deltaY<0?-Math.abs(e.deltaY):Math.abs(e.deltaY),e.currentTarget.scrollBy(t,0)},mg=(0,nt.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,T.jsxs)(nd,{children:[(0,T.jsx)(ad,{onClick:()=>s.closeTab(t),children:"Close"}),(0,T.jsx)(ad,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,T.jsx)(ad,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),_g=(0,nt.Pi)((e=>{const t=(0,at.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,at.useCallback)(((e,n)=>{const a=e.tab,r=i,o=s.tabs.findIndex((e=>e===a)),l=s.tabs.findIndex((e=>e===r)),c=t.current?.getBoundingClientRect(),d=((c?.left??0)-(c?.right??0))/2,h=(n.getClientOffset()?.x??0)-(c?.right??0);o<l&&h<d||o>l&&h>d||s.swapTabs(a,r)}),[s,i]),[{isBeingDraggedEditorPanel:r},o]=(0,ig.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,d]=(0,Hm.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,at.useEffect)((()=>{e((0,dg.r)())}),[e])})(d),(0,T.jsx)("div",{ref:t,className:(0,jc.clsx)("tab-manager__tab",{"tab-manager__tab--active":i===s.currentTab,"tab-manager__tab--dragged":l}),onMouseUp:(h=i,e=>{1===e.nativeEvent.button&&s.closeTab(h)}),children:(0,T.jsx)(hg,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,T.jsxs)(id,{content:(0,T.jsx)(mg,{tabState:i,managerTabState:s}),className:"tab-manager__tab__content",children:[(0,T.jsx)("button",{className:"tab-manager__tab__label",tabIndex:-1,onClick:()=>s.openTab(i),title:i.description,children:n?.(i)??i.label}),(0,T.jsx)("button",{className:"tab-manager__tab__close-btn",onClick:()=>s.closeTab(i),tabIndex:-1,title:"Close",children:(0,T.jsx)(Xc.q1B,{})})]})})});var h})),gg=(0,nt.Pi)((e=>{const{managerTabState:t}=e;return(0,T.jsx)(ng,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,T.jsx)(nd,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,T.jsxs)(ad,{className:(0,jc.clsx)("tab-manager__menu__item",{"tab-manager__menu__item--active":e===t.currentTab}),onClick:()=>t.openTab(e),children:[(0,T.jsx)("div",{className:"tab-manager__menu__item__label",children:e.label}),(0,T.jsx)("div",{className:"tab-manager__menu__item__close-btn",onClick:s=>{s.stopPropagation(),t.closeTab(e)},tabIndex:-1,title:"Close",children:(0,T.jsx)(Xc.q1B,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,T.jsx)(Xc.v4q,{})})})),Eg=(0,nt.Pi)((e=>{const{tabManagerState:t,tabRenderer:s}=e;return(0,T.jsxs)("div",{className:"tab-manager",children:[(0,T.jsxs)("div",{className:"tab-manager__content",onWheel:pg,children:[t.tabs.map((e=>(0,T.jsx)(_g,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,T.jsx)(ug,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,T.jsx)(gg,{managerTabState:t})]})})),fg=()=>{const[e,t]=(0,at.useState)(!1),{ref:s,width:i,height:n}=(0,dd.NB)();return(0,at.useEffect)((()=>{t((i??0)>300&&(n??0)>150)}),[i,n]),(0,T.jsx)("div",{ref:s,className:"edit-panel__splash-screen",children:(0,T.jsxs)("div",{className:(0,jc.clsx)("edit-panel__splash-screen__content",{"edit-panel__splash-screen__content--hidden":!e}),children:[(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Execute the 'go' function"}),(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F9"})})]}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Run the full test suite"}),(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Search for a file"}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Xc.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},Tg=(0,nt.Pi)((()=>{const e=Em(),t=e.tabManagerState.currentTab;return t?(0,T.jsxs)("div",{className:"panel edit-panel",children:[(0,T.jsxs)("div",{className:"panel__header edit-panel__header",children:[(0,T.jsx)("div",{className:"edit-panel__header__tabs",children:(0,T.jsx)(Eg,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof uh){const s=e.tabManagerState.tabs.filter((e=>e instanceof uh&&e.fileName===t.fileName)).length>1;return(0,T.jsxs)("div",{className:"edit-panel__header__tab",children:[(0,T.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,T.jsx)(Xc.QqN,{className:"edit-panel__header__tab__icon--file"})}),(0,T.jsx)("div",{className:"edit-panel__header__tab__label",children:t.fileName}),s&&(0,T.jsx)("div",{className:"edit-panel__header__tab__path",children:t.filePath})]})}if(t instanceof hm){const s=e.tabManagerState.tabs.filter((e=>e instanceof hm&&e.diagramName===t.diagramName)).length>1;return(0,T.jsxs)("div",{className:"edit-panel__header__tab",children:[(0,T.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,T.jsx)(i_,{})}),(0,T.jsx)("div",{className:"edit-panel__header__tab__label",children:t.diagramName}),s&&(0,T.jsx)("div",{className:"edit-panel__header__tab__path",children:t.diagramPath})]})}return t.label}})}),(0,T.jsx)("div",{className:"panel__header__actions"})]}),(0,T.jsx)("div",{className:"panel__content edit-panel__content",children:t instanceof uh?t.textEditorState.language===S.PURE?(0,T.jsx)(sg,{editorState:t}):(0,T.jsx)(D_,{editorState:t}):t instanceof hm?(0,T.jsx)(lg,{diagramEditorState:t}):null},t.uuid)]}):(0,T.jsx)(fg,{})}));var Cg=s(82663),xg=s(35247);const Ng=e=>{const t=3.5*parseInt(getComputedStyle(document.documentElement).fontSize,10),{options:s,children:i,getValue:n,selectProps:a}=e,[r]=n(),o=s.indexOf(r)*t,l=i.length?i.findIndex((e=>e.props.isFocused)):0,c=(0,at.useRef)(null);return(0,at.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,T.jsx)(Cg.t7,{className:a.darkMode?"scrollbar--light selector-menu--dark":"",ref:c,width:"100%",height:Math.min(i.length,6)*t,itemCount:i.length,itemSize:t,initialScrollOffset:o,children:({index:e,style:t})=>(0,T.jsx)("div",{style:t,children:i[e]})}):(0,T.jsx)("div",{className:"selector-menu--no-match "+(a.darkMode?"selector-menu--dark":""),children:a.noMatchMessage??"No match found"})},Ag="selector-input",Og="selector-input--dark",Sg=()=>(0,T.jsx)("div",{className:`${Ag}__indicator ${Ag}__loading-indicator ${Og}__loading-indicator`,children:(0,T.jsx)(Xc.VRP,{})}),yg=()=>(0,T.jsx)("div",{className:`${Ag}__indicator ${Ag}__dropdown-indicator`,children:(0,T.jsx)(Xc.VAA,{})}),Ig=e=>{const{innerProps:{ref:t,...s}}=e;return(0,T.jsx)("div",{...s,ref:t,children:(0,T.jsx)("div",{className:`${Ag}__indicator ${Ag}__clear-indicator`,children:(0,T.jsx)(Xc.q1B,{})})})},vg=e=>(0,T.jsx)(xg.baseComponents.Input,{...e,isHidden:!1}),Rg=(0,at.forwardRef)((function(e,t){const{option:s,allowCreating:i,noMatchMessage:n,disabled:a,components:r,className:o,darkMode:l,hasError:c,...d}=e,h=i?xg.CreatableSelect:xg.Select,u=l?Og:Ag;return(0,T.jsx)(h,{styles:{menuPortal:e=>({...e,zIndex:9999})},menuPortalTarget:document.body,ref:t,isDisabled:Boolean(a),className:`${u} ${o} ${c?"selector-input--has-error":""}`,classNamePrefix:u,components:{ClearIndicator:Ig,DropdownIndicator:yg,LoadingIndicator:Sg,MenuList:Ng,Input:vg,...r},...{...d,darkMode:l,noMatchMessage:n}})})),Pg=(e,t)=>e.label.localeCompare(t.label),wg=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.fileSearchCommandLoadingState,i=e.fileSearchCommandState,n=(0,at.useRef)(null),a=(0,at.useMemo)((()=>(0,md.Z)((()=>{(0,x.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,T.jsx)(Fc.Z,{open:e.openFileSearchCommand,onClose:r,TransitionProps:{onEnter:()=>{n.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Open file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)(Rg,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(Pg),onChange:s=>{s?.value&&(r(),i.reset(),(0,x.fl)(e.loadFile(s.value)).catch(t.alertUnhandledError))},onInputChange:e=>{i.setText(e),a.cancel(),a()},placeholder:"Enter file name or path",escapeClearsValue:!0,darkMode:!0,isLoading:s.isInProgress}),(0,T.jsx)("button",{className:(0,jc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":i.isRegExp}),title:`Use Regular Expression (${i.isRegExp?"on":"off"})`,onClick:()=>i.toggleRegExp(),children:(0,T.jsx)(Xc.x47,{})})]})]})})})),Lg=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.textSearchCommandState,i=(0,at.useRef)(null),n=()=>e.setOpenTextSearchCommand(!1),a=s=>{s.preventDefault(),n(),(0,x.fl)(e.searchText()).catch(t.alertUnhandledError)};return(0,T.jsx)(Fc.Z,{open:e.openTextSearchCommand,onClose:n,TransitionProps:{onEnter:()=>{i.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Search"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:a,children:(0,T.jsx)("input",{ref:i,className:"command-modal__content__input input--dark",onChange:e=>s.setText(e.target.value),value:s.text})}),(0,T.jsx)("button",{className:(0,jc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isCaseSensitive}),title:`Match Case (${s.isCaseSensitive?"on":"off"})`,onClick:()=>s.toggleCaseSensitive(),children:(0,T.jsx)(Xc.a2g,{})}),(0,T.jsx)("button",{className:(0,jc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isRegExp}),title:`Use Regular Expression (${s.isRegExp?"on":"off"})`,onClick:()=>s.toggleRegExp(),children:(0,T.jsx)(Xc.x47,{})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark btn--caution",onClick:a,children:"Search"})]})]})})})),bg=(Dg=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.initState.hasSucceeded,{ref:i,width:n,height:a}=(0,dd.NB)(),r=bm(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),o=bm(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),l=bm(e.auxPanelDisplayState.isMaximized);return(0,at.useEffect)((()=>{i.current&&e.auxPanelDisplayState.setMaxSize(i.current.offsetHeight)}),[e,i,a,n]),(0,at.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,at.useEffect)((()=>{const s=((e,t=!1)=>t?se.Z.parseUrl(e).query:se.Z.parse(e))(window.location.search);(0,x.fl)(e.initialize(!1,void 0,s.mode,s.fastCompile)).catch(t.alertUnhandledError)}),[e,t]),(0,at.useEffect)((()=>(t.navigator.blockNavigation([()=>!0],void 0,(()=>t.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigator.unblockNavigation()})),[e,t]),k_(e),(0,T.jsxs)("div",{className:"editor",children:[(0,T.jsxs)("div",{className:"editor__body",children:[(0,T.jsx)(R_,{}),(0,T.jsx)("div",{className:"editor__content-container",ref:i,children:(0,T.jsx)("div",{className:"editor__content",children:(0,T.jsxs)(wm,{orientation:"vertical",children:[(0,T.jsx)(Dm,{...r.collapsiblePanel,direction:1,children:(0,T.jsx)(I_,{})}),(0,T.jsx)(Mm,{}),(0,T.jsx)(Dm,{...r.remainingPanel,minSize:300,children:(0,T.jsxs)(wm,{orientation:"horizontal",children:[(0,T.jsx)(Dm,{...l.collapsiblePanel,...0===e.auxPanelDisplayState.size?o.remainingPanel:{},children:(0,T.jsx)(Tg,{})}),(0,T.jsx)(Mm,{children:(0,T.jsx)(km,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsx)(Dm,{...o.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?l.remainingPanel:{},direction:-1,children:(0,T.jsx)(Bm,{})})]})})]})})})]}),(0,T.jsx)(w_,{actionsDisabled:!s}),s&&(0,T.jsx)(wg,{}),s&&(0,T.jsx)(Lg,{})]})})),function(){return(0,T.jsx)(gm,{children:(0,T.jsx)(Dg,{})})});var Dg;const Mg=()=>(0,T.jsx)(Md,{children:(0,T.jsx)(Ld,{children:(0,T.jsx)(bg,{})})}),kg=JSON.parse('{"i8":"6.2.30","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class Fg extends o{}class jg extends Fg{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class Ug extends jg{static NAME=kg.Rw.p;constructor(){super(Ug.NAME,kg.i8)}getExtraKeyedCommandConfigEntries(){return[ah,ch,oh].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class Vg extends st{static create(){const e=new Vg(Gt.create());return e.withBasePlugins([new Ug]),e.withBasePresets([new Ic]),e}async configureApplication(e){return new Ut(e)}async loadApplication(){await(async(e,t)=>{(e=>{var t,s;N.editor.defineTheme(O.LEGEND,$e),N.editor.addKeybindingRules([{keybinding:N.KeyMod.WinCtrl|N.KeyCode.KeyG,command:null},{keybinding:N.KeyMod.WinCtrl|N.KeyCode.KeyB,command:null},{keybinding:N.KeyMod.WinCtrl|N.KeyCode.KeyO,command:null},{keybinding:N.KeyMod.WinCtrl|N.KeyCode.KeyP,command:null},{keybinding:N.KeyCode.F1,command:null},{keybinding:N.KeyCode.F8,command:null},{keybinding:N.KeyCode.F9,command:null},{keybinding:N.KeyMod.CtrlCmd|N.KeyCode.F2,command:null},{keybinding:N.KeyMod.Shift|N.KeyCode.F10,command:null},{keybinding:N.KeyMod.CtrlCmd|N.KeyCode.F12,command:null}]),N.languages.register({id:S.PURE}),N.languages.setLanguageConfiguration(S.PURE,ze),N.languages.setMonarchTokensProvider(S.PURE,(t=e.getPureGraphManagerPlugins().flatMap((e=>e.getExtraPureGrammarKeywords?.()??[])),s=e.getPureGraphManagerPlugins().flatMap((e=>e.getExtraPureGrammarParserNames?.()??[])),{defaultToken:"invalid",tokenPostfix:".pure",keywords:[...t,"Schema","Table","Join","View","primaryKey","groupBy","mainTable","let","extends","true","false","projects",Fe.CLASS,Fe.ASSOCIATION,Fe.ENUMERATION,Fe.MEASURE,Fe.PROFILE,Fe.FUNCTION,Fe.MAPPING,Fe.RUNTIME,Fe.CONNECTION,Fe.FILE_GENERATION,Fe.GENERATION_SPECIFICATION,Fe.DATA_ELEMENT,je.JSON_MODEL_CONNECTION,je.MODEL_CHAIN_CONNECTION,je.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",Fe.SERVICE,Fe.FLAT_DATA,Fe.DATABASE,je.FLAT_DATA_CONNECTION,je.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@","<<",">>"],languageStructs:["import","native"],parsers:[Ue.PURE,Ue.CONNECTION,Ue.RUNTIME,Ue.MAPPING,Ue.SERVICE,Ue.FLATDATA,Ue.RELATIONAL,Ue.GENERATION_SPECIFICATION,Ue.FILE_GENERATION_SPECIFICATION,Ue.DATA].concat(s).map((e=>`${fe}${e}`)),identifier:/[a-zA-Z_$][\w$]*/,symbols:/[=><!~?:&|+\-*/^%#@]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,multiplicity:/\[(?:[a-zA-Z0-9]+(?:\.\.(?:[a-zA-Z0-9]+|\*|))?|\*)\]/,package:/(?:[\w_]+::)+/,generics:/<.+>/,date:/%-?\d+(?:-\d+(?:-\d+(?:T(?:\d+(?::\d+(?::\d+(?:.\d+)?)?)?)(?:[+-][0-9]{4})?)))/,time:/%\d+(?::\d+(?::\d+(?:.\d+)?)?)?/,tokenizer:{root:[{include:"@pure"},{include:"@date"},{include:"@color"},[/^\s*###[\w]+/,{cases:{"@parsers":Ge.PARSER,"@default":Ge.INVALID}}],[/(@identifier)/,{cases:{"@languageStructs":Ge.LANGUAGE_STRUCT,"@keywords":`${Ge.KEYWORD}.$0`,"@default":Ge.IDENTIFIER}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":Ge.OPERATOR,"@default":Ge.IDENTIFIER}}],{include:"@number"},[/[;,.]/,Ge.DELIMITER],[/'([^'\\]|\\.)*$/,`${Ge.STRING}.invalid`],[/'/,Ge.STRING,"@string"],{include:"@characters"}],pure:[[/(@package\*)/,[Ge.PACKAGE]],[/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,[Ge.PACKAGE,Ge.TYPE,Ge.GENERICS,Ge.WHITESPACE,Ge.MULTIPLICITY]],[/(@package)(@identifier)(@generics?)/,[Ge.PACKAGE,Ge.TYPE,Ge.GENERICS]],[/([@^])(\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,[`${Ge.TYPE}.operator`,Ge.WHITESPACE,Ge.PACKAGE,Ge.TYPE,Ge.GENERICS,Ge.MULTIPLICITY]],[/(\.\s*)(@identifier)/,[Ge.DELIMITER,Ge.PROPERTY]],[/(@identifier)(\s*=)/,[Ge.PROPERTY,Ge.OPERATOR]],[/(@identifier)(\.)(@identifier)/,[Ge.TYPE,Ge.OPERATOR,Ge.PROPERTY]],[/(@identifier)(\s*:)/,[Ge.PARAMETER,Ge.OPERATOR]],[/(let)(\s+)(@identifier)(\s*=)/,[Ge.KEYWORD,Ge.WHITESPACE,Ge.VARIABLE,Ge.OPERATOR]],[/(\$@identifier)/,[`${Ge.VARIABLE}.reference`]]],date:[[/(%latest)/,[`${Ge.DATE}.latest`]],[/(@date)/,[Ge.DATE]],[/(@time)/,[`${Ge.DATE}.time`]]],color:[[/(#[0-9a-fA-F]{6})/,[Ge.COLOR]]],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,`${Ge.NUMBER}.float`],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,`${Ge.NUMBER}.float`],[/0[xX](@hexdigits)[Ll]?/,`${Ge.NUMBER}.hex`],[/0(@octaldigits)[Ll]?/,`${Ge.NUMBER}.octal`],[/0[bB](@binarydigits)[Ll]?/,`${Ge.NUMBER}.binary`],[/(@digits)[fFdD]/,`${Ge.NUMBER}.float`],[/(@digits)[lL]?/,Ge.NUMBER]],whitespace:[[/[ \t\r\n]+/,Ge.WHITESPACE],[/\/\*\*(?!\/)/,`${Ge.COMMENT}.doc`,"@doc"],[/\/\*/,Ge.COMMENT,"@comment"],[/\/\/.*$/,Ge.COMMENT]],comment:[[/[^/*]+/,Ge.COMMENT],[/\*\//,Ge.COMMENT,"@pop"],[/[/*]/,Ge.COMMENT]],doc:[[/[^/*]+/,`${Ge.COMMENT}.doc`],[/\/\*/,`${Ge.COMMENT}.doc.invalid`],[/\*\//,`${Ge.COMMENT}.doc`,"@pop"],[/[/*]/,`${Ge.COMMENT}.doc`]],string:[[/[^\\']+/,Ge.STRING],[/@escapes/,`${Ge.STRING}.escape`],[/\\./,`${Ge.STRING}.escape.invalid`],[/'/,Ge.STRING,"@pop"]],characters:[[/'[^\\']'/,Ge.STRING],[/(')(@escapes)(')/,[Ge.STRING,`${Ge.STRING}.escape`,Ge.STRING]],[/'/,`${Ge.STRING}.invalid`]]}}))})(e);const s=`Monospaced font '${A}' has not been loaded properly, text editor display problems might occur`;await document.fonts.load(`1em ${A}`).then((()=>{document.fonts.check(`1em ${A}`)?(N.editor.remeasureFonts(),t.info(h.create(ge.TEXT_EDITOR_FONT_LOADED),`Monospaced font '${A}' has been loaded`)):t.error(h.create(ge.APPLICATION_SETUP_FAILURE),s)})).catch((()=>t.error(h.create(ge.APPLICATION_SETUP_FAILURE),s))),(0,x.jQ)({enforceActions:"observed"})})(this.pluginManager,this.logger),(0,C.s)((()=>{let e=document.getElementsByTagName("root").length?document.getElementsByTagName("root")[0]:void 0;return e||(e=document.createElement("root"),document.body.appendChild(e)),e})()).render((0,T.jsx)(it.VK,{basename:this.baseUrl,children:(0,T.jsx)(ct,{children:(0,T.jsx)(kt,{config:this.config,pluginManager:this.pluginManager,children:(0,T.jsx)(Mg,{})})})}))}}class Gg{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){Vg.create().setup({baseUrl:e}).withPresets(Gg.getPresetCollection()).withPlugins(Gg.getPluginCollection()).start().catch((e=>{throw e}))}}Gg.run("/ide/")},94174:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Fuse=void 0;var n=s(71659);Object.defineProperty(t,"Fuse",{enumerable:!0,get:function(){return i(n).default}})},12889:(e,t,s)=>{t.J$M=t.DE2=t.W1M=t.oF7=t.bK4=t.o1U=t.Zlt=t.jG4=t.uMt=t.pTE=t.UOT=t.pgN=t.VAA=t.IEm=t.pOD=t.xDH=t.q1B=t.cOE=void 0,t.QqN=t.SCS=t.$Ow=t.ROc=t.ry=t.FxN=t.R0=t.Qq=t.VRP=t.nnZ=t.LPM=t.rE2=void 0,t.Two=t.qdB=t.NK0=t.UHp=t.VjU=t.NEI=t.DuK=t.ce8=t.dRK=t.VHe=t.DXi=t.jZm=t.Oag=t.kdY=void 0,t.xLV=t.Sd5=t.tPC=t.Hrt=t.jtq=t.HXR=t.LyQ=t.ppk=t.B_D=t.UPo=t.eRw=t.HLb=t.w0Y=t.Cti=t.POq=t.Vzd=t.b0D=t.XCv=t.g8U=t.v4q=t.a2g=t.x47=void 0,t.eid=void 0;var i=s(18978);Object.defineProperty(t,"cOE",{enumerable:!0,get:function(){return i.FaCrosshairs}}),Object.defineProperty(t,"q1B",{enumerable:!0,get:function(){return i.FaTimes}}),Object.defineProperty(t,"xDH",{enumerable:!0,get:function(){return i.FaTimesCircle}}),Object.defineProperty(t,"pOD",{enumerable:!0,get:function(){return i.FaPlus}}),Object.defineProperty(t,"IEm",{enumerable:!0,get:function(){return i.FaCog}}),Object.defineProperty(t,"VAA",{enumerable:!0,get:function(){return i.FaCaretDown}}),Object.defineProperty(t,"pgN",{enumerable:!0,get:function(){return i.FaHammer}}),Object.defineProperty(t,"UOT",{enumerable:!0,get:function(){return i.FaQuestion}}),Object.defineProperty(t,"pTE",{enumerable:!0,get:function(){return i.FaQuestionCircle}}),Object.defineProperty(t,"uMt",{enumerable:!0,get:function(){return i.FaInfoCircle}}),Object.defineProperty(t,"jG4",{enumerable:!0,get:function(){return i.FaCompress}}),Object.defineProperty(t,"Zlt",{enumerable:!0,get:function(){return i.FaMap}}),Object.defineProperty(t,"o1U",{enumerable:!0,get:function(){return i.FaPlay}}),Object.defineProperty(t,"bK4",{enumerable:!0,get:function(){return i.FaArrowAltCircleRight}}),Object.defineProperty(t,"oF7",{enumerable:!0,get:function(){return i.FaShapes}}),Object.defineProperty(t,"W1M",{enumerable:!0,get:function(){return i.FaSearch}}),Object.defineProperty(t,"DE2",{enumerable:!0,get:function(){return i.FaList}}),Object.defineProperty(t,"J$M",{enumerable:!0,get:function(){return i.FaCircle}}),Object.defineProperty(t,"rE2",{enumerable:!0,get:function(){return i.FaCheckCircle}}),Object.defineProperty(t,"LPM",{enumerable:!0,get:function(){return i.FaExclamationTriangle}}),Object.defineProperty(t,"nnZ",{enumerable:!0,get:function(){return i.FaBug}}),Object.defineProperty(t,"VRP",{enumerable:!0,get:function(){return i.FaCircleNotch}}),Object.defineProperty(t,"Qq",{enumerable:!0,get:function(){return i.FaExpand}}),Object.defineProperty(t,"R0",{enumerable:!0,get:function(){return i.FaWrench}}),Object.defineProperty(t,"FxN",{enumerable:!0,get:function(){return i.FaTerminal}}),Object.defineProperty(t,"ry",{enumerable:!0,get:function(){return i.FaFolderOpen}}),Object.defineProperty(t,"ROc",{enumerable:!0,get:function(){return i.FaFolder}}),Object.defineProperty(t,"$Ow",{enumerable:!0,get:function(){return i.FaExclamationCircle}}),Object.defineProperty(t,"SCS",{enumerable:!0,get:function(){return i.FaBan}}),Object.defineProperty(t,"QqN",{enumerable:!0,get:function(){return i.FaFileAlt}}),Object.defineProperty(t,"kdY",{enumerable:!0,get:function(){return i.FaMapMarkerAlt}}),Object.defineProperty(t,"Oag",{enumerable:!0,get:function(){return i.FaHatWizard}}),Object.defineProperty(t,"jZm",{enumerable:!0,get:function(){return i.FaRegLaughWink}}),Object.defineProperty(t,"DXi",{enumerable:!0,get:function(){return i.FaRegSadTear}}),Object.defineProperty(t,"VHe",{enumerable:!0,get:function(){return i.FaDatabase}});var n=s(1553);Object.defineProperty(t,"dRK",{enumerable:!0,get:function(){return n.GiBeard}}),Object.defineProperty(t,"ce8",{enumerable:!0,get:function(){return n.GiSunglasses}});var a=s(65186);Object.defineProperty(t,"DuK",{enumerable:!0,get:function(){return a.MdRefresh}}),Object.defineProperty(t,"NEI",{enumerable:!0,get:function(){return a.MdSubject}}),Object.defineProperty(t,"VjU",{enumerable:!0,get:function(){return a.MdViewHeadline}}),Object.defineProperty(t,"UHp",{enumerable:!0,get:function(){return a.MdAssistant}});var r=s(49385);Object.defineProperty(t,"NK0",{enumerable:!0,get:function(){return r.VscWordWrap}}),Object.defineProperty(t,"qdB",{enumerable:!0,get:function(){return r.VscGoToFile}}),Object.defineProperty(t,"Two",{enumerable:!0,get:function(){return r.VscClose}}),Object.defineProperty(t,"x47",{enumerable:!0,get:function(){return r.VscRegex}}),Object.defineProperty(t,"a2g",{enumerable:!0,get:function(){return r.VscCaseSensitive}});var o=s(70563);Object.defineProperty(t,"v4q",{enumerable:!0,get:function(){return o.GoChevronDown}}),Object.defineProperty(t,"g8U",{enumerable:!0,get:function(){return o.GoChevronUp}}),Object.defineProperty(t,"XCv",{enumerable:!0,get:function(){return o.GoChevronRight}}),Object.defineProperty(t,"b0D",{enumerable:!0,get:function(){return o.GoX}});s(16636);var l=s(91914);Object.defineProperty(t,"Vzd",{enumerable:!0,get:function(){return l.IoFlaskSharp}});var c=s(8799);Object.defineProperty(t,"POq",{enumerable:!0,get:function(){return c.BsGripVertical}}),Object.defineProperty(t,"Cti",{enumerable:!0,get:function(){return c.BsAlignTop}}),Object.defineProperty(t,"w0Y",{enumerable:!0,get:function(){return c.BsAlignMiddle}}),Object.defineProperty(t,"HLb",{enumerable:!0,get:function(){return c.BsAlignBottom}}),Object.defineProperty(t,"eRw",{enumerable:!0,get:function(){return c.BsAlignStart}}),Object.defineProperty(t,"UPo",{enumerable:!0,get:function(){return c.BsAlignCenter}}),Object.defineProperty(t,"B_D",{enumerable:!0,get:function(){return c.BsAlignEnd}}),Object.defineProperty(t,"ppk",{enumerable:!0,get:function(){return c.BsDistributeHorizontal}}),Object.defineProperty(t,"LyQ",{enumerable:!0,get:function(){return c.BsDistributeVertical}});var d=s(77245);Object.defineProperty(t,"HXR",{enumerable:!0,get:function(){return d.BiAtom}});s(30924);var h=s(34543);Object.defineProperty(t,"jtq",{enumerable:!0,get:function(){return h.FiPackage}}),Object.defineProperty(t,"Hrt",{enumerable:!0,get:function(){return h.FiMousePointer}}),Object.defineProperty(t,"tPC",{enumerable:!0,get:function(){return h.FiMove}}),Object.defineProperty(t,"Sd5",{enumerable:!0,get:function(){return h.FiZoomIn}}),Object.defineProperty(t,"xLV",{enumerable:!0,get:function(){return h.FiZoomOut}});s(75100);var u=s(58920);Object.defineProperty(t,"eid",{enumerable:!0,get:function(){return u.TbMathFunction}})},35247:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.baseComponents=t.createFilter=t.Select=t.CreatableSelect=void 0;var n=s(54319);Object.defineProperty(t,"CreatableSelect",{enumerable:!0,get:function(){return i(n).default}});var a=s(31776);Object.defineProperty(t,"Select",{enumerable:!0,get:function(){return i(a).default}}),Object.defineProperty(t,"createFilter",{enumerable:!0,get:function(){return a.createFilter}}),Object.defineProperty(t,"baseComponents",{enumerable:!0,get:function(){return a.components}})}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={id:e,loaded:!1,exports:{}};return a[e].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=a,o.amdO={},e=[],o.O=(t,s,i,n)=>{if(!s){var a=1/0;for(d=0;d<e.length;d++){for(var[s,i,n]=e[d],r=!0,l=0;l<s.length;l++)(!1&n||a>=n)&&Object.keys(o.O).every((e=>o.O[e](s[l])))?s.splice(l--,1):(r=!1,n<a&&(a=n));if(r){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[s,i,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,i){if(1&i&&(e=this(e)),8&i)return e;if("object"==typeof e&&e){if(4&i&&e.__esModule)return e;if(16&i&&"function"==typeof e.then)return e}var n=Object.create(null);o.r(n);var a={};t=t||[null,s({}),s([]),s(s)];for(var r=2&i&&e;"object"==typeof r&&!~t.indexOf(r);r=s(r))Object.getOwnPropertyNames(r).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,o.d(n,a),n},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,s)=>(o.f[s](e,t),t)),[])),o.u=e=>"static/"+e+"."+{14:"b63f5ea7",135:"3b62eae4",246:"55fd6716",309:"ca0f7cf5",399:"7ad47fd9",471:"bde04e4b",947:"50215a8f"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},n="@finos/legend-application-pure-ide-deployment:",o.l=(e,t,s,a)=>{if(i[e])i[e].push(t);else{var r,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var h=c[d];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==n+s){r=h;break}}r||(l=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,o.nc&&r.setAttribute("nonce",o.nc),r.setAttribute("data-webpack",n+s),r.src=e),i[e]=[t];var u=(t,s)=>{r.onerror=r.onload=null,clearTimeout(p);var n=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),n&&n.forEach((e=>e(s))),t)return t(s)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),l&&document.head.appendChild(r)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/ide/",(()=>{var e={826:0};o.f.j=(t,s)=>{var i=o.o(e,t)?e[t]:void 0;if(0!==i)if(i)s.push(i[2]);else{var n=new Promise(((s,n)=>i=e[t]=[s,n]));s.push(i[2]=n);var a=o.p+o.u(t),r=new Error;o.l(a,(s=>{if(o.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var n=s&&("load"===s.type?"missing":s.type),a=s&&s.target&&s.target.src;r.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",r.name="ChunkLoadError",r.type=n,r.request=a,i[1](r)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,s)=>{var i,n,[a,r,l]=s,c=0;if(a.some((t=>0!==e[t]))){for(i in r)o.o(r,i)&&(o.m[i]=r[i]);if(l)var d=l(o)}for(t&&t(s);c<a.length;c++)n=a[c],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(d)},s=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var l=o.O(void 0,[736],(()=>o(26067)));l=o.O(l)})();
|
2
|
-
//# sourceMappingURL=index.
|
1
|
+
(()=>{"use strict";var e,t,s,i,n,a={26067:(e,t,s)=>{const i=JSON.parse('{"i8":"6.2.15","Rw":{"k":"@finos/legend-logger-plugin-web-console"}}');var n,a=s(91004);class r{name;version;signature;uuid}class o{name;version;uuid=(0,a.Z)();constructor(e,t){this.name=e,this.version=t}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getInfo(){const e=new r;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e}configure(e){return this}}class l{name;version;signature;uuid;plugins=[]}class c{name;version;uuid=(0,a.Z)();plugins=[];constructor(e,t,s){this.name=e,this.version=t,this.plugins=s}getName(){return this.name}getVersion(){return this.version}getSignature(){return`${this.getName()}@${this.getVersion()}`}getUUID(){return this.uuid}getPlugins(){return[...this.plugins]}getInfo(){const e=new l;return e.name=this.getName(),e.version=this.getVersion(),e.signature=this.getSignature(),e.uuid=this.getUUID(),e.plugins=this.plugins.map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),e}configure(e){return this}install(e){this.plugins.forEach((t=>t.install(e)))}}class d{plugins=[];presets=[];usePlugins(e){return this.plugins=e,this}usePresets(e){return this.presets=e,this}configure(e){Object.keys(e).forEach((t=>{const s=e[t];this.presets.forEach((e=>{e.getName()===t&&e.configure(s)})),this.plugins.forEach((e=>{e.getName()===t&&e.configure(s)}))}))}install(){this.plugins.forEach((e=>e.install(this))),this.presets.forEach((e=>e.install(this)))}getInfo(){return{plugins:this.plugins.filter((e=>!this.getHiddenPluginNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name))),presets:this.presets.filter((e=>!this.getHiddenPresetNames().includes(e.getName()))).map((e=>e.getInfo())).sort(((e,t)=>e.name.localeCompare(t.name)))}}getHiddenPluginNames(){return[]}getHiddenPresetNames(){return[]}}!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(n=n||(n={}));class h{channel;name;timestamp=Date.now();static create(e){const t=new h;return t.name=e,t}}class u extends o{level=n.DEBUG;setLevel(e){this.level=e}install(e){e.registerLoggerPlugin(this)}debug(e,...t){this.level<=n.DEBUG&&this._debug(e,...t)}info(e,...t){this.level<=n.INFO&&this._info(e,...t)}warn(e,...t){this.level<=n.WARN&&this._warn(e,...t)}error(e,...t){this.level<=n.ERROR&&this._error(e,...t)}}class p{loggers=[];registerPlugins(e){this.loggers=e}debug(e,...t){this.loggers.forEach((s=>s.debug(e,...t)))}info(e,...t){this.loggers.forEach((s=>s.info(e,...t)))}warn(e,...t){this.loggers.forEach((s=>s.warn(e,...t)))}error(e,...t){this.loggers.forEach((s=>s.error(e,...t)))}}const{debug:m,info:_,warn:g,error:E}=console;class f extends u{constructor(){super(i.Rw.k,i.i8)}_debug(e,...t){m(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_info(e,...t){_(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_warn(e,...t){g(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}_error(e,...t){E(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}var T=s(52322),C=s(17029),x=s(80075),N=s(90361);const A="Roboto Mono";var O,S;!function(e){e.LEGEND="LEGEND",e.TEMPORARY__VSCODE_LIGHT="vs"}(O=O||(O={})),function(e){e.TEXT="text",e.PURE="pure",e.JSON="json",e.JAVA="java",e.MARKDOWN="markdown",e.SQL="sql",e.XML="xml",e.YAML="yaml",e.GRAPHQL="graphql"}(S=S||(S={}));var y=s(85928),I=s(21112);const v=e=>e.constructor,R=()=>()=>{},P=e=>e.length?e[0]:void 0,w=e=>e.length?e[e.length-1]:void 0,L=e=>new Promise(((t,s)=>setTimeout((()=>{try{t(e())}catch(e){s(e)}}),0))),b=(e,t,s=((e,t)=>e===t))=>!e.find((e=>s(e,t)))&&(e.push(t),!0),D=(e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t))),a=e.findIndex((e=>i(e,s)));return-1!==n&&-1!==a&&(e[n]=s,e[a]=t,!0)},M=(e,t,s=((e,t)=>e===t))=>{const i=e.findIndex((e=>s(e,t)));return-1!==i&&(e.splice(i,1),!0)};class k extends Error{uuid=(0,a.Z)();constructor(e){super(),this.message=void 0===e||""===e?"(no error message)":e}get detail(){return this.message}}class F extends Error{constructor(e,t,s){if(super(s||(t instanceof Error?t.message:t)),this.name=e,t instanceof Error){const e=(this.message.match(/\n/g)??[]).length+1;this.stack=`${(this.stack??"").split("\n").slice(0,e+1).join("\n")}\nCaused by: ${t.stack}`}else"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error(t).stack}}class j extends F{constructor(e){super("Illegal State Error [PLEASE NOTIFY DEVELOPER]",e)}}class U extends F{constructor(e,t){super("Unsupported Operation Error",e||t?`${e}${t?`\n${((e,t)=>{const s=(i={printFunctionName:!1,maxDepth:t?.deep?void 0:1},(0,y.Z)(i,(e=>void 0!==e)));var i;return(0,I.WU)(e,s).replace(/.*\s\{/g,"{").replace(/\[.*\]/g,(e=>["[Array]","[Function]"].includes(e)?e:"[Object]"))})(t)}`:""}`:void 0)}}function V(e){if(!(e instanceof Error))throw new j("Expected error to be thrown")}const G=e=>{try{return e()}catch{return}};class $ extends F{constructor(e,t){super("Assertion Error",e,t)}}const z=e=>null!=e;function B(e,t=""){if(null==e)throw new $(t||"Value is nullable")}const H=(e,t="")=>(B(e,t),e),Y=e=>t=>((e,t)=>e instanceof t)(t,e);function W(e,t,s=""){if(!(e instanceof t))throw new $(s||`Value is expected to be of type '${t.name}'`)}const K=(e,t,s="")=>(W(e,t,s),e);function Z(e,t=""){if(""===H(e,t))throw new $(t||"Expected string value to be non-empty")}function X(e,t=""){return Z(e,t),e}function q(e,t=""){if(!e)throw new $(t||"Expected predicate to be truthy")}const J=e=>"string"==typeof e,Q=e=>"object"==typeof e&&null!==e;var ee=s(39391),te=s(33654),se=s(18247);s(72659);const ie=ee.W,ne="charset=utf-8";var ae,re,oe;!function(e){e.CONTENT_TYPE="Content-Type",e.ACCEPT="Accept"}(ae=ae||(ae={})),function(e){e.APPLICATION_JSON="application/json",e.APPLICATION_XML="application/xml",e.APPLICATION_ZLIB="application/zlib",e.TEXT_PLAIN="text/plain",e.TEXT_CSV="text/csv",e.ALL="*/*"}(re=re||(re={})),function(e){e.GET="GET",e.PUT="PUT",e.POST="POST",e.DELETE="DELETE"}(oe=oe||(oe={}));const le={mode:"cors",credentials:"include",redirect:"manual"},ce=(e,t)=>{const s={};return e&&Object.entries(e).forEach((([e,t])=>{s[e]=t})),t&&Object.entries(t).forEach((([e,t])=>{s[e]=t})),s};class de extends Error{response;payload;constructor(e,t){super(),"function"==typeof Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.name="Network Client Error",this.response=e;const{status:s,statusText:i,url:n}=e,a=`Received response with status ${s} (${i}) for ${n}`;this.message=(t?(e=>{if(Q(e))return J(e.message)?e.message:JSON.stringify(e);let t;try{t=JSON.parse(e)}catch{}return t&&J(t.message)?t.message:e})(t).substring(0,5e3):"")||a,this.payload=t}}const he=async(e,t,s)=>{if(s?.preprocess?.(e),!e.ok){let t;try{t=await e.text(),t=JSON.parse(t)}catch{}return Promise.reject(new de(e,t))}if(s?.skipProcessing)return Promise.resolve(e);if(e.status===ie.NO_CONTENT)return Promise.resolve(void 0);const i=t.headers.Accept;switch(i){case re.APPLICATION_JSON:return e.json();case re.TEXT_PLAIN:return e.text();default:return Promise.reject(new de(e,`Can't process response for request with Content-Type '${i}'`))}},ue=async(e,t,s)=>s?.autoReAuthenticateUrl?(e=>new Promise((t=>{const s="AUTO_AUTHENTICATION_IFRAME";document.getElementById(s)?.remove();const i=document.createElement("iframe");i.id=s,i.src=e,i.style.display="none",i.addEventListener("load",(()=>{i.remove(),t()})),document.body.appendChild(i)})))(s.autoReAuthenticateUrl).then((()=>fetch(e,t))).then((e=>he(e,t,s))):fetch(e,t).then((e=>he(e,t,s))),pe=(e,t)=>{const s={};return s.Accept=re.APPLICATION_JSON,e!==oe.GET&&(s[ae.CONTENT_TYPE]=`${re.APPLICATION_JSON};${ne}`),ce(s,t)};class me{options={};baseUrl;constructor(e){this.baseUrl=e?.baseUrl,this.options={...le,...e?.options??{}}}async get(e,t={},s,i,n,a){return this.request(oe.GET,e,void 0,t,s,i,n,a)}async put(e,t={},s={},i,n,a,r){return this.request(oe.PUT,e,t,s,i,n,a,r)}async post(e,t={},s={},i,n,a,r){return this.request(oe.POST,e,t,s,i,n,a,r)}async delete(e,t={},s={},i,n,a,r){return this.request(oe.DELETE,e,t,s,i,n,a,r)}async request(e,t,s,i,n,a,r,o){const l=((e,t,s)=>{if(!e&&!G((()=>new URL(t))))throw new Error(`Can't build URL string: base URL is not specified and the provided URL '${t}' is not absolute`);const i=new URL(t,e);return s instanceof Object&&Object.entries(s).forEach((([e,t])=>{void 0!==t&&(Array.isArray(t)?t.filter(z).forEach((t=>i.searchParams.append(e,t.toString()))):i.searchParams.append(e,t.toString()))})),i.toString()})(this.baseUrl,t,a??{});let c;if((J(s)||Q(s))&&r?.enableCompression&&(q(e!==oe.GET," GET request should not have any request payload"),s=(e=>new Blob([(0,te.Wt)(Q(e)?JSON.stringify(e):e)]))(s),n=ce(n,{[ae.CONTENT_TYPE]:`${re.APPLICATION_ZLIB};${ne}`})),void 0!==s)if(J(s)||s instanceof Blob)c=s;else{if(!Q(s))throw new $("Request body can only be either a 'string' or an 'object'");c=JSON.stringify(s)}const d={...this.options,...i,method:e,body:c,headers:pe(e,n)};return fetch(l,d).then((e=>(e=>0===e.status||e.status===ie.UNAUTHORIZED)(e)?ue(l,d,o):he(e,d,o))).catch((e=>(e=>e instanceof TypeError&&"Failed to fetch"===e.message)(e)?ue(l,d,o):Promise.reject(e)))}}const _e=(e,t,s)=>{const i=new Blob([t],{type:s}),n=URL.createObjectURL(i),a=document.createElement("a");"string"==typeof a.download?(document.body.appendChild(a),a.download=e,a.href=n,a.click(),document.body.removeChild(a)):location.replace(n)};var ge;!function(e){e.TEXT_EDITOR_FONT_LOADED="application.load.font.success",e.APPLICATION_SETUP_FAILURE="application.setup.failure",e.ILLEGAL_APPLICATION_STATE_OCCURRED="application.error.illegal-state",e.APPLICATION_CONFIGURATION_FAILURE="application.configuration.failure",e.APPLICATION_DOCUMENTATION_FETCH_FAILURE="application.fetch.documentation.failure",e.APPLICATION_DOCUMENTATION_LOAD_SKIPPED="application.load.documentation.skipped",e.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK_FAILURE="application.load.documentation.requirement-check.failure",e.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE="application.load.keyboard-shortcuts.configuration-check.failure",e.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED="application.load.contextual-documentation.skipped",e.APPLICATION_COMMAND_CENTER_REGISTRATION_FAILURE="application.command-center.registration.failure",e.APPLICATION_LOADED="application.load.success",e.APPLICATION_LOAD_FAILURE="application.load.failure",e.DEVELOPMENT_ISSUE="development.issue",e.APPLICATION_CONTEXT_ACCESSED="application.context.accessed",e.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED="application.virtual-assistant.documentation-entry.accessed"}(ge=ge||(ge={}));const Ee="::",fe="###",Te=["$implicit"];var Ce,xe,Ne,Ae,Oe;(Oe=Ce=Ce||(Ce={})).CORE="CORE",Oe.MAIN="ROOT",Oe.MODEL_GENERATION="MODEL_GENERATION_ROOT",Oe.SYSTEM="SYSTEM_ROOT",Oe.PROJECT_DEPENDENCY_ROOT="PROJECT_DEPENDENCY_ROOT",(Ae=xe=xe||(xe={})).STRING="String",Ae.BOOLEAN="Boolean",Ae.BINARY="Binary",Ae.NUMBER="Number",Ae.INTEGER="Integer",Ae.FLOAT="Float",Ae.DECIMAL="Decimal",Ae.DATE="Date",Ae.STRICTDATE="StrictDate",Ae.DATETIME="DateTime",Ae.STRICTTIME="StrictTime",Ae.LATESTDATE="LatestDate",function(e){e.Service_Test="serviceTest",e.Mapping_Test="mappingTest"}(Ne=Ne||(Ne={}));const Se=["meta::pure::metamodel::type","meta::pure::functions::date","meta::pure::profiles"];var ye,Ie,ve,Re,Pe,we,Le,be,De,Me;(Ie=ye=ye||(ye={})).ANY="meta::pure::metamodel::type::Any",Ie.NIL="meta::pure::metamodel::type::Nil",Ie.PROFILE_DOC="meta::pure::profiles::doc",Ie.PROFILE_TEMPORAL="meta::pure::profiles::temporal",Ie.PROFILE="meta::pure::metamodel::extension::Profile",Ie.ENUMERATION="meta::pure::metamodel::type::Enumeration",Ie.MEASURE="meta::pure::metamodel::type::Measure",Ie.CLASS="meta::pure::metamodel::type::Class",Ie.ASSOCIATION="meta::pure::metamodel::relationship::Association",Ie.FUNCTION="meta::pure::metamodel::function::ConcreteFunctionDefinition",Ie.FLAT_DATA="meta::flatData::metamodel::FlatData",Ie.DATABASE="meta::relational::metamodel::Database",Ie.MAPPING="meta::pure::mapping::Mapping",Ie.SERVICE="meta::legend::service::metamodel::Service",Ie.CONNECTION="meta::pure::runtime::PackageableConnection",Ie.RUNTIME="meta::pure::runtime::PackageableRuntime",Ie.FILE_GENERATION="meta::pure::generation::metamodel::GenerationConfiguration",Ie.GENERATION_SPECIFICATION="meta::pure::generation::metamodel::GenerationSpecification",Ie.SECTION_INDEX="meta::pure::metamodel::section::SectionIndex",Ie.DATA_ELEMENT="meta::pure::data::DataElement",Ie.TDS_ROW="meta::pure::tds::TDSRow",(we=ve=ve||(ve={})).BUSINESS_TEMPORAL="businesstemporal",we.PROCESSING_TEMPORAL="processingtemporal",we.BITEMPORAL="bitemporal",(Pe=Re=Re||(Re={})).ALL_VERSIONS="AllVersions",Pe.ALL_VERSIONS_IN_RANGE="AllVersionsInRange",(be=Le=Le||(Le={})).STORE="STORE",be.MAPPING="MAPPING",be.RUNTIME="RUNTIME",be.FILE_GENERATION="FILE_GENERATION",be.SERVICE="SERVICE",(Me=De=De||(De={})).TODAY="meta::pure::functions::date::today",Me.NOW="meta::pure::functions::date::now",Me.FIRST_DAY_OF_WEEK="meta::pure::functions::date::firstDayOfThisWeek",Me.FIRST_DAY_OF_MONTH="meta::pure::functions::date::firstDayOfThisMonth",Me.FIRST_DAY_OF_QUARTER="meta::pure::functions::date::firstDayOfThisQuarter",Me.FIRST_DAY_OF_YEAR="meta::pure::functions::date::firstDayOfThisYear",Me.PREVIOUS_DAY_OF_WEEK="meta::pure::functions::date::previousDayOfWeek",Me.IS_ON_DAY="meta::pure::functions::date::isOnDay",Me.IS_ON_OR_AFTER_DAY="meta::pure::functions::date::isOnOrAfterDay",Me.IS_AFTER_DAY="meta::pure::functions::date::isAfterDay",Me.IS_ON_OR_BEFORE_DAY="meta::pure::functions::date::isOnOrBeforeDay",Me.IS_BEFORE_DAY="meta::pure::functions::date::isBeforeDay",Me.MINUS="meta::pure::functions::math::minus",Me.ADJUST="meta::pure::functions::date::adjust",Me.LET="meta::pure::functions::lang::letFunction";const ke="yyyy-MM-dd'T'HH:mm:ssxxxx";var Fe,je,Ue;!function(e){e.PROFILE="Profile",e.CLASS="Class",e.ENUMERATION="Enum",e.MEASURE="Measure",e.ASSOCIATION="Association",e.FUNCTION="function",e.MAPPING="Mapping",e.FLAT_DATA="FlatData",e.DATABASE="Database",e.SERVICE="Service",e.RUNTIME="Runtime",e.CONNECTION="Connection",e.FILE_GENERATION="FileGeneration",e.GENERATION_SPECIFICATION="GenerationSpecification",e.DATA_ELEMENT="Data"}(Fe=Fe||(Fe={})),function(e){e.JSON_MODEL_CONNECTION="JsonModelConnection",e.XML_MODEL_CONNECTION="XmlModelConnection",e.MODEL_CHAIN_CONNECTION="ModelChainConnection",e.RELATIONAL_DATABASE_CONNECTION="RelationalDatabaseConnection",e.FLAT_DATA_CONNECTION="FlatDataConnection"}(je=je||(je={})),function(e){e.PURE="Pure",e.CONNECTION="Connection",e.RUNTIME="Runtime",e.MAPPING="Mapping",e.SERVICE="Service",e.FLATDATA="FlatData",e.RELATIONAL="Relational",e.GENERATION_SPECIFICATION="GenerationSpecification",e.FILE_GENERATION_SPECIFICATION="FileGeneration",e.DATA="Data"}(Ue=Ue||(Ue={}));const Ve=(e,t)=>e===t?e.toString():0===e&&void 0===t?"*":`${e}..${t??"*"}`;var Ge;!function(e){e.WHITESPACE="",e.KEYWORD="keyword",e.IDENTIFIER="identifier",e.OPERATOR="operator",e.DELIMITER="delimiter",e.PARSER="parser",e.NUMBER="number",e.DATE="date",e.COLOR="color",e.PACKAGE="package",e.STRING="string",e.COMMENT="comment",e.LANGUAGE_STRUCT="language-struct",e.MULTIPLICITY="multiplicity",e.GENERICS="generics",e.PROPERTY="property",e.PARAMETER="property",e.VARIABLE="variable",e.TYPE="type",e.INVALID="invalid"}(Ge=Ge||(Ge={}));const $e={base:"vs-dark",inherit:!0,colors:{},rules:[{token:Ge.IDENTIFIER,foreground:"dcdcaa"},{token:Ge.NUMBER,foreground:"b5cea8"},{token:Ge.DATE,foreground:"b5cea8"},{token:Ge.COLOR,foreground:"b5cea8"},{token:Ge.PACKAGE,foreground:"808080"},{token:Ge.PARSER,foreground:"c586c0"},{token:Ge.LANGUAGE_STRUCT,foreground:"c586c0"},{token:Ge.MULTIPLICITY,foreground:"2d796b"},{token:Ge.GENERICS,foreground:"2d796b"},{token:Ge.PROPERTY,foreground:"9cdcfe"},{token:Ge.PARAMETER,foreground:"9cdcfe"},{token:Ge.VARIABLE,foreground:"4fc1ff"},{token:Ge.TYPE,foreground:"3dc9b0"}]},ze={comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"},{open:"<<",close:">>"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}};var Be=s(79013);class He{schema;deserializeNullAsUndefined;constructor(e,t){this.schema=e,this.deserializeNullAsUndefined=Boolean(t?.deserializeNullAsUndefined)}toJson(e){return(0,Be.qC)(this.schema,e)}fromJson(e){return(0,Be.vB)(this.schema,this.deserializeNullAsUndefined?(t=e,(0,y.Z)(t,(e=>null!==e))):e);var t}}const Ye=e=>(0,Be.PG)((t=>void 0===t?Be.AM:(0,Be.qC)(e,t)),(t=>(0,Be.vB)(e,t))),We=(e,t,s)=>Array.isArray(e)?e.map(t):s?.skipIfEmpty?Be.AM:[],Ke=(e,t,s)=>Array.isArray(e)?e.length?e.map((e=>t(e))):s?.skipIfEmpty?Be.AM:[]:Be.AM,Ze=e=>(0,Be.PG)((()=>e),(()=>e));var Xe=s(4e4);class qe{_documentationKey;markdownText;title;text;url;related;static serialization=new He((0,Be.yu)(qe,{markdownText:(0,Be.PG)((e=>e),(e=>e.value?e:void 0)),related:(0,Be.jt)((0,Be.pb)((0,Be.Ru)())),title:(0,Be.jt)((0,Be.Ru)()),text:(0,Be.jt)((0,Be.Ru)()),url:(0,Be.jt)((0,Be.Ru)())}));static create(e,t){const s=qe.serialization.fromJson(e);return s._documentationKey=t,s}}const Je=e=>Object.entries(e).map((e=>({key:e[0],content:qe.create(e[1],e[0])})));class Qe{url;docRegistry=new Map;contextualDocIndex=new Map;constructor(e){this.url=e.config.documentationUrl,e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedDocumentationEntries?.()??[])).forEach((t=>{this.hasDocEntry(t.key)?e.log.warn(h.create(ge.APPLICATION_DOCUMENTATION_LOAD_SKIPPED),t.key):this.docRegistry.set(t.key,t.content)})),e.config.keyedDocumentationEntries.forEach((e=>this.docRegistry.set(e.key,e.content)));const t=e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraContextualDocumentationEntries?.()??[])),s=[];(0,Xe.Z)(e.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraRequiredDocumentationKeys?.()??[])).concat(t.map((e=>e.documentationKey)))).forEach((e=>{this.docRegistry.has(e)||s.push(e)})),s.length&&e.log.warn(h.create(ge.APPLICATION_DOCUMENTATION_REQUIREMENT_CHECK_FAILURE),`Can't find corresponding documentation entry for keys:\n${s.map((e=>`- ${e}`)).join("\n")}`),t.forEach((t=>{if(this.hasContextualDocEntry(t.context))e.log.warn(h.create(ge.APPLICATION_CONTEXTUAL_DOCUMENTATION_LOAD_SKIPPED),t.context);else{const e=this.getDocEntry(t.documentationKey);e&&this.contextualDocIndex.set(t.context,e)}})),e.config.contextualDocEntries.forEach((e=>{const t=this.getDocEntry(e.documentationKey);t&&this.contextualDocIndex.set(e.context,t)}))}getDocEntry(e){return this.docRegistry.get(e)}hasDocEntry(e){return this.docRegistry.has(e)}getContextualDocEntry(e){return this.contextualDocIndex.get(e)}hasContextualDocEntry(e){return this.contextualDocIndex.has(e)}getAllDocEntries(){return Array.from(this.docRegistry.values())}publishDocRegistry(){const e={};return this.docRegistry.forEach(((t,s)=>{e[s]=qe.serialization.toJson(t)})),e}publishContextualDocIndex(){const e={};return this.contextualDocIndex.forEach(((t,s)=>{e[s]=t._documentationKey})),e}}class et{}class tt extends et{debug(e,...t){console.debug(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}info(e,...t){console.info(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}warn(e,...t){console.warn(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}error(e,...t){console.error(`[${e.timestamp}] ${e.name} ${t.length?":":""}`,...t)}}class st{config;logger;pluginManager;basePresets=[];basePlugins=[];baseUrl;pluginRegister;_isConfigured=!1;constructor(e){this.pluginManager=e,this.logger=new tt}setup(e){return this.baseUrl=X(e.baseUrl,"Can't setup application: 'baseUrl' is missing or empty"),this.pluginRegister=e.pluginRegister,this._isConfigured=!0,this}withBasePresets(e){return this.basePresets=e,this.withPresets([])}withBasePlugins(e){return this.basePlugins=e,this.withPlugins([])}withPresets(e){return this.pluginManager.usePresets([...this.basePresets,...e]),this}withPlugins(e){return this.pluginManager.usePlugins([...this.basePlugins,...e]),this}async fetchApplicationConfiguration(e){const t=new me;let s,i;try{s=await t.get(`${window.location.origin}${e}config.json`)}catch(e){V(e),this.logger.error(h.create(ge.APPLICATION_CONFIGURATION_FAILURE),e)}B(s,"Can't fetch Legend application configuration");try{i=await t.get(`${window.location.origin}${e}version.json`)}catch(e){V(e),this.logger.error(h.create(ge.APPLICATION_CONFIGURATION_FAILURE),e)}return B(i,"Can't fetch Legend application version"),[await this.configureApplication({configData:s,versionData:i,baseUrl:e}),s.extensions??{}]}async loadDocumentationRegistryData(e){const t={};await Promise.all([...e.documentationRegistryEntries,...this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraDocumentationRegistryEntries?.()??[]))].map((async e=>{try{const s=new me(e.simple?{options:{credentials:"omit"}}:{}),i=await s.get(X(e.url,"Can't load documentation registry: 'url' field is missing or empty"));B(i.entries,"Can't load documentation registry data: 'entries' field is missing");const n=e.includes?.map((e=>new RegExp(`^${e.trim().replace(/[\^$\\.+?()[\]{}|]/g,"\\$&").replace(/\*/g,".*")}$`)));Object.entries(i.entries).forEach((([e,s])=>{n&&!n.some((t=>t.test(e)))||t[e]||(t[e]=s)}))}catch(e){V(e),this.logger.warn(h.create(ge.APPLICATION_DOCUMENTATION_FETCH_FAILURE),e)}}))),e.keyedDocumentationEntries=[...Je(t),...e.keyedDocumentationEntries]}async start(){B(this._isConfigured,"Legend application has not been configured properly. Make sure to run setup() before start()");try{const[e,t]=await this.fetchApplicationConfiguration(this.baseUrl);this.config=e,this.pluginRegister?.(this.pluginManager,this.config),this.pluginManager.configure(t),this.pluginManager.install(),await Promise.all([this.loadDocumentationRegistryData(e)]),await this.loadApplication(),await Promise.all(this.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraApplicationSetups?.()??[])).map((e=>e(this.pluginManager)))),this.logger.info(h.create(ge.APPLICATION_LOADED),"Legend application loaded")}catch(e){throw V(e),this.logger.error(h.create(ge.APPLICATION_LOAD_FAILURE),"Failed to load Legend application"),e}}}var it=s(8354),nt=s(69038),at=s(2784);class rt{historyAPI;_isNavigationBlocked=!1;_forceBypassNavigationBlocking=!1;_blockCheckers=[];_beforeUnloadListener=e=>{this._forceBypassNavigationBlocking||this._blockCheckers.some((e=>e()))&&(e.returnValue="")};onBlock;onNativePlatformNavigationBlock;constructor(e){(0,x.rC)(this,{_isNavigationBlocked:x.LO,isNavigationBlocked:x.Fl,blockNavigation:x.aD,unblockNavigation:x.aD}),this.historyAPI=e}get window(){return H(window,"Window object is not available in non-web environment")}goToLocation(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=this.generateAddress(e)};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}reload(e){e?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const t=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.reload()};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(t):t()}goToAddress(e,t){t?.ignoreBlocking&&(this._forceBypassNavigationBlocking=!0);const s=()=>{this._forceBypassNavigationBlocking=!0,this.window.location.href=e};!this._forceBypassNavigationBlocking&&this._blockCheckers.some((e=>e()))?this.onBlock?.(s):s()}visitAddress(e){this.window.open(e,"_blank")}updateCurrentLocation(e){this.historyAPI.push(e)}getCurrentAddress(){return this.window.location.href}getCurrentLocation(){return this.historyAPI.location.pathname}generateAddress(e){return this.window.location.origin+this.historyAPI.createHref({pathname:e})}blockNavigation(e,t,s){this._isNavigationBlocked=!0,this.onBlock=t,this.onNativePlatformNavigationBlock=s,this.window.history.pushState(null,"",this.getCurrentAddress()),this.window.onpopstate=()=>{window.history.forward(),this.onNativePlatformNavigationBlock?.()},this._blockCheckers=e,this.window.removeEventListener("beforeunload",this._beforeUnloadListener),this.window.addEventListener("beforeunload",this._beforeUnloadListener)}unblockNavigation(){this._isNavigationBlocked=!1,this.onBlock=void 0,this.window.onpopstate=null,this._blockCheckers=[],this.window.removeEventListener("beforeunload",this._beforeUnloadListener)}get isNavigationBlocked(){return this._isNavigationBlocked}}var ot=s(76237);const lt=(0,at.createContext)(void 0),ct=({children:e})=>{const t=(0,ot.k6)(),s=(0,nt.fv)((()=>new rt(t)));return(0,T.jsx)(lt.Provider,{value:s,children:e})};class dt{plugins=[];registerPlugins(e){this.plugins=e}setUserId(e){this.plugins.forEach((t=>t.setUserId(e)))}logEvent(e,t){this.plugins.forEach((s=>s.logEvent(e,t)))}}var ht;!function(e){e.USER="user",e.ENV="env",e.RESULT="result",e.ERROR="error",e.HTTP_STATUS="status",e.HTTP_REQUEST_METHOD="method",e.HTTP_REQUEST_URL="url"}(ht=ht||(ht={}));class ut{traceEntries=[];setup(e){this.traceEntries=e}bootstrap(e){this.traceEntries.forEach((t=>{t.plugin.bootstrap(t.clientSpan,e)}))}reportSuccess(){this.traceEntries.forEach((e=>{e.plugin.concludeClientSpan(e.clientSpan,void 0)}))}reportError(e){this.traceEntries.forEach((t=>{t.plugin.concludeClientSpan(t.clientSpan,e)}))}close(){this.traceEntries.forEach((e=>{e.plugin.concludeServerSpan(e.serverSpan)}))}}class pt{plugins=[];registerPlugins(e){this.plugins=e}createTrace(e,t,s,i){const n=new ut;return e&&n.setup(this.plugins.map((n=>{const a=n.createClientSpan(e);return{clientSpan:a,serverSpan:n.createServerSpan(a,t,s,i),plugin:n}}))),n}}var mt,_t,gt,Et=s(94174);!function(e){e.INITIAL="INITIAL",e.IN_PROGRESS="IN_PROGRESS",e.SUCCEEDED="SUCEEDED",e.FAILED="FAILED"}(mt||(mt={}));class ft{state;_message;_messageFormatter;constructor(){this.state=mt.INITIAL}setMessage(e){this._message=e}setMessageFormatter(e){this._messageFormatter=e}reset(){return this.state=mt.INITIAL,this}inProgress(){return this.state=mt.IN_PROGRESS,this}fail(){return this.state=mt.FAILED,this}pass(){return this.state=mt.SUCCEEDED,this}complete(e=!0){return e?this.pass():this.fail(),this}get isInInitialState(){return this.state===mt.INITIAL}get isInProgress(){return this.state===mt.IN_PROGRESS}get hasFailed(){return this.state===mt.FAILED}get hasSucceeded(){return this.state===mt.SUCCEEDED}get message(){return this._message?this._messageFormatter?this._messageFormatter(this._message):this._message:void 0}get hasCompleted(){return this.hasFailed||this.hasSucceeded}static create(){return(0,x.rC)(new ft,{state:x.LO,_message:x.LO,reset:x.aD,inProgress:x.aD,pass:x.aD,fail:x.aD,complete:x.aD,setMessage:x.aD,isInInitialState:x.Fl,isInProgress:x.Fl,hasFailed:x.Fl,hasSucceeded:x.Fl,hasCompleted:x.Fl,message:x.Fl})}}!function(e){e.STANDARD="standard",e.INCLUDE="include match",e.EXACT="exact match",e.INVERSE="excludes exact match"}(_t=_t||(_t={}));class Tt{currentMode=_t.STANDARD;onSearchModeChange;constructor(e){(0,x.rC)(this,{currentMode:x.LO,isAdvancedSearchActive:x.Fl,setCurrentMode:x.aD}),this.onSearchModeChange=e}get isAdvancedSearchActive(){return this.currentMode!==_t.STANDARD}generateSearchText(e){switch(this.currentMode){case _t.INCLUDE:return`'"${e}"`;case _t.EXACT:return`="${e}"`;case _t.INVERSE:return`!"${e}"`;default:return e}}setCurrentMode(e){this.currentMode=e,this.onSearchModeChange()}}!function(e){e.SEARCH="SEARCH",e.CONTEXTUAL_SUPPORT="CONTEXTUAL_SUPPORT"}(gt=gt||(gt={}));class Ct{uuid=(0,a.Z)();documentationKey;title;content;url;isOpen=!1;constructor(e){(0,x.rC)(this,{isOpen:x.LO,setIsOpen:x.aD}),this.documentationKey=e._documentationKey,this.title=X(e.title),this.content=e.markdownText??e.text,this.url=e.url}setIsOpen(e){this.isOpen=e}}class xt{uuid=(0,a.Z)();context;title;content;url;related;constructor(e,t,s){this.context=e,this.title=t.title,this.content=t.markdownText??t.text,this.url=t.url,this.related=s}}const Nt=e=>Boolean(e.title&&(e.url??e.text??e.markdownText));class At{applicationStore;panelRenderingKey=(0,a.Z)();isHidden=!1;isOpen=!1;selectedTab=gt.SEARCH;currentDocumentationEntry;searchEngine;searchConfigurationState;searchState=ft.create();searchText="";searchResults=[];showSearchConfigurationMenu=!1;isOverSearchLimit=!1;constructor(e){(0,x.rC)(this,{isHidden:x.LO,isOpen:x.LO,panelRenderingKey:x.LO,isOverSearchLimit:x.LO,selectedTab:x.LO,searchText:x.LO,searchResults:x.LO,currentDocumentationEntry:x.LO,showSearchConfigurationMenu:x.LO,currentContextualDocumentationEntry:x.Fl,setIsHidden:x.aD,setIsOpen:x.aD,setSelectedTab:x.aD,setSearchText:x.aD,resetSearch:x.aD,search:x.aD,openDocumentationEntry:x.aD,refreshPanelRendering:x.aD,setShowSearchConfigurationMenu:x.aD}),this.applicationStore=e,this.searchEngine=new Et.Fuse(this.applicationStore.documentationService.getAllDocEntries().filter(Nt),{includeScore:!0,shouldSort:!0,ignoreLocation:!0,threshold:.2,keys:[{name:"title",weight:4},{name:"text",weight:1},{name:"markdownText.value",weight:1}],useExtendedSearch:!0}),this.searchConfigurationState=new Tt((()=>{this.search()}))}get currentContextualDocumentationEntry(){if(!this.applicationStore.navigationContextService.currentContext)return;const e=this.applicationStore.navigationContextService.currentContext.key,t=this.applicationStore.documentationService.getContextualDocEntry(e);return t?new xt(e,t,(t.related??[]).map((e=>this.applicationStore.documentationService.getDocEntry(e))).filter(z).filter(Nt).map((e=>new Ct(e)))):void 0}openDocumentationEntry(e){const t=this.applicationStore.documentationService.getAllDocEntries().find((t=>t._documentationKey===e));t&&(this.setIsOpen(!0),this.setIsHidden(!1),this.currentDocumentationEntry=new Ct(t),this.currentDocumentationEntry.setIsOpen(!0),this.resetSearch())}setIsHidden(e){this.isHidden=e}hideAssistant(){this.setIsHidden(!0),this.setIsOpen(!1)}toggleAssistant(){this.isHidden?this.setIsHidden(!1):this.hideAssistant()}setIsOpen(e){this.isOpen=e}setSelectedTab(e){this.selectedTab=e}refreshPanelRendering(){this.panelRenderingKey=(0,a.Z)()}setSearchText(e){this.searchText=e}resetSearch(){this.searchText="",this.searchResults=[],this.searchState.complete()}search(){this.searchText?(this.currentDocumentationEntry=void 0,this.searchState.inProgress(),this.searchResults=Array.from(this.searchEngine.search(this.searchConfigurationState.generateSearchText(this.searchText),{limit:101}).values()).map((e=>new Ct(e.item))),this.searchResults.length>100?(this.isOverSearchLimit=!0,this.searchResults=this.searchResults.slice(0,100)):this.isOverSearchLimit=!1,this.searchState.complete()):this.searchResults=[]}setShowSearchConfigurationMenu(e){this.showSearchConfigurationMenu=e}}class Ot{notifierPlugins=[];registerEventNotifierPlugins(e){this.notifierPlugins=e}notify(e,t){this.notifierPlugins.forEach((s=>s.notify(e,t)))}}class St{static logEvent_ApplicationInitialized(e,t){e.logEvent(ge.APPLICATION_LOADED,t)}static logEvent_ApplicationContextAccessed(e,t){e.logEvent(ge.APPLICATION_CONTEXT_ACCESSED,t)}static logEvent_VirtualAssistantDocumentationEntryAccessed(e,t){e.logEvent(ge.VIRTUAL_ASSISTANT_DOCUMENTATION_ENTRY_ACCESSED,t)}}class yt{applicationStore;contextStack=[];constructor(e){(0,x.rC)(this,{contextStack:x.LO,currentContext:x.Fl,push:x.aD,pop:x.aD}),this.applicationStore=e}get currentContext(){return this.contextStack.length?this.contextStack[this.contextStack.length-1]:void 0}push(e){const t=this.contextStack.filter((e=>!e.isTransient));if(t.find((t=>t.key===e.key)))throw new j(`Found multiple context '${e.key}' in application navigation context stack`);t.push(e),this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraAccessEventLoggingApplicationContextKeys?.()??[])).includes(e.key)&&St.logEvent_ApplicationContextAccessed(this.applicationStore.telemetryService,{key:e.key}),this.contextStack=t}pop(e){const t=this.contextStack.find((t=>t.key===e.key));if(!t)return;const s=this.contextStack.indexOf(t);-1!==s&&(this.contextStack=this.contextStack.slice(0,s).filter((e=>!e.isTransient)))}}class It{applicationStore;commandRegistry=new Map;constructor(e){(0,x.rC)(this,{commandRegistry:x.LO,registerCommand:x.aD,deregisterCommand:x.aD}),this.applicationStore=e}registerCommand(e){const t=e.key;this.commandRegistry.has(t)?this.applicationStore.log.warn(h.create(ge.APPLICATION_COMMAND_CENTER_REGISTRATION_FAILURE),"Can't register command: command is already registered"):this.commandRegistry.set(t,e)}deregisterCommand(e){this.commandRegistry.delete(e)}runCommand(e,t){const s=this.commandRegistry.get(e);return!(!s||s.trigger&&!s.trigger()||(s.action?.(t),0))}}class vt{applicationStore;keyMap=new Map;commandKeyMap=new Map;isHotkeysBlocked=!1;constructor(e){(0,x.rC)(this,{keyMap:x.LO,commandKeyMap:x.LO,isHotkeysBlocked:x.LO,updateHotkey:x.aD,blockGlobalHotkeys:x.aD,unblockGlobalHotkeys:x.aD}),this.applicationStore=e;const t=[];this.applicationStore.pluginManager.getApplicationPlugins().flatMap((e=>e.getExtraKeyedCommandConfigEntries?.()??[])).forEach((e=>{e.content.defaultKeyboardShortcut&&this.commandKeyMap.get(e.key)&&b(t,e.key),this.updateHotkey(e.key,e.content.defaultKeyboardShortcut)})),t.length&&this.applicationStore.log.warn(h.create(ge.APPLICATION_KEYBOARD_SHORTCUTS_CONFIGURATION_CHECK_FAILURE),`Found multiple key bindings in configuration for commands:\n${t.map((e=>`- ${e}`)).join("\n")}`)}blockGlobalHotkeys(){this.isHotkeysBlocked=!0}unblockGlobalHotkeys(){this.isHotkeysBlocked=!1}updateHotkey(e,t){const s=this.commandKeyMap.get(e);this.commandKeyMap.set(e,t),s&&this.keyMap.set(s,(this.keyMap.get(s)??[]).filter((t=>t===e))),t&&this.keyMap.set(t,[...(this.keyMap.get(t)??[]).filter((t=>t!==e)),e])}dispatch(e){if(this.isHotkeysBlocked)return;const t=this.keyMap.get(e)??[];for(const e of t)if(this.applicationStore.commandCenter.runCommand(e))return}}var Rt,Pt;!function(e){e.STANDARD="STANDARD",e.CAUTION="CAUTION"}(Rt=Rt||(Rt={})),function(e){e.STANDARD="STANDARD",e.PROCEED_WITH_CAUTION="PROCEED_WITH_CAUTION",e.PROCEED="PROCEED"}(Pt=Pt||(Pt={}));const wt=6e3;var Lt;!function(e){e.ILEGAL_STATE="ILEGAL_STATE",e.ERROR="ERROR",e.WARNING="WARNING",e.SUCCESS="SUCCESS",e.INFO="INFO"}(Lt=Lt||(Lt={}));class bt{severity;message;actions;autoHideDuration;constructor(e,t,s,i){this.severity=e,this.message=t,this.actions=s,this.autoHideDuration=i}}class Dt{config;pluginManager;navigator;navigationContextService;notification;blockingAlertInfo;actionAlertInfo;log=new p;documentationService;assistantService;eventService=new Ot;telemetryService=new dt;tracerService=new pt;commandCenter;keyboardShortcutsService;backdropContainerElementID;showBackdrop=!1;TEMPORARY__isLightThemeEnabled=!1;constructor(e,t,s){(0,x.rC)(this,{notification:x.LO,blockingAlertInfo:x.LO,actionAlertInfo:x.LO,TEMPORARY__isLightThemeEnabled:x.LO,backdropContainerElementID:x.LO,showBackdrop:x.LO,setBackdropContainerElementID:x.aD,setShowBackdrop:x.aD,setBlockingAlert:x.aD,setActionAlertInfo:x.aD,setNotification:x.aD,notify:x.aD,notifySuccess:x.aD,notifyWarning:x.aD,notifyIllegalState:x.aD,notifyError:x.aD,TEMPORARY__setIsLightThemeEnabled:x.aD}),this.config=e,this.navigator=t,this.pluginManager=s,this.log.registerPlugins(s.getLoggerPlugins()),this.navigationContextService=new yt(this),this.documentationService=new Qe(this),this.assistantService=new At(this),this.telemetryService.registerPlugins(s.getTelemetryServicePlugins()),this.commandCenter=new It(this),this.keyboardShortcutsService=new vt(this),this.tracerService.registerPlugins(s.getTracerServicePlugins()),this.eventService.registerEventNotifierPlugins(s.getEventNotifierPlugins())}TEMPORARY__setIsLightThemeEnabled(e){this.TEMPORARY__isLightThemeEnabled=e}setBackdropContainerElementID(e){this.backdropContainerElementID=e}setShowBackdrop(e){this.showBackdrop=e}setBlockingAlert(e){e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.blockingAlertInfo=e}setActionAlertInfo(e){this.actionAlertInfo&&e&&this.notifyIllegalState("Action alert is stacked: new alert is invoked while another one is being displayed"),e?this.keyboardShortcutsService.blockGlobalHotkeys():this.keyboardShortcutsService.unblockGlobalHotkeys(),this.actionAlertInfo=e}setNotification(e){this.notification=e}notify(e,t,s){this.setNotification(new bt(Lt.INFO,e,t??[],null===s?void 0:s??wt))}notifySuccess(e,t,s){this.setNotification(new bt(Lt.SUCCESS,e,t??[],null===s?void 0:s??wt))}notifyWarning(e,t,s){this.setNotification(new bt(Lt.WARNING,e instanceof Error?e.message:e,t??[],null===s?void 0:s??wt))}notifyIllegalState(e,t,s){this.setNotification(new bt(Lt.ILEGAL_STATE,J(e)?`[PLEASE NOTIFY DEVELOPER] ${e}`:e,t??[],null===s?void 0:s??wt))}notifyError(e,t){let s;e instanceof k?s=e.detail:e instanceof Error?s=e.message:(q(J(e),"Can't display error"),s=e),s&&this.setNotification(new bt(Lt.ERROR,s,t??[],void 0))}notifyAndReturnAlternativeOnError=(e,t)=>{try{return e()}catch(e){return V(e),this.notifyIllegalState(e.message),t}};alertUnhandledError=e=>{this.log.error(h.create(ge.ILLEGAL_APPLICATION_STATE_OCCURRED),"Encountered unhandled error in component tree",e),this.notifyIllegalState(e.message)};guardUnhandledError=e=>()=>{e().catch(this.alertUnhandledError)};async copyTextToClipboard(e){await navigator.clipboard.writeText(e).catch((e=>{this.notifyError(e)}))}notifyUnsupportedFeature(e){this.notifyWarning(`Unsupported feature: ${e}`)}}const Mt=(0,at.createContext)(void 0),kt=({children:e,config:t,pluginManager:s})=>{const i=H((0,at.useContext)(lt),"Can't find web application navigator in context"),n=(0,nt.fv)((()=>new Dt(t,i,s)));return(0,T.jsx)(Mt.Provider,{value:n,children:e})},Ft=()=>H((0,at.useContext)(Mt),"Can't find application store in context");class jt{appName;baseUrl;env;documentationUrl;documentationRegistryEntries=[];keyedDocumentationEntries=[];contextualDocEntries=[];appVersion;appVersionBuildTime;appVersionCommitId;constructor(e){var t;this.baseUrl=e.baseUrl,this.appName=X(e.configData.appName,"Can't configure application: 'appName' field is missing or empty"),this.env=X(e.configData.env,"Can't configure application: 'env' field is missing or empty"),this.documentationUrl=e.configData.documentation?.url,this.documentationRegistryEntries=e.configData.documentation?.registry??[],this.keyedDocumentationEntries=Je(e.configData.documentation?.entries??{}),this.contextualDocEntries=(t=e.configData.documentation?.contextualEntries??{},Object.entries(t).map((e=>({context:e[0],documentationKey:e[1]})))),this.appVersion=H(e.versionData.version,"Can't collect application version: 'version' field is missing"),this.appVersionBuildTime=H(e.versionData.buildTime,"Can't collect application version: 'buildTime' field is missing"),this.appVersionCommitId=H(e.versionData.commitSHA,"Can't collect application version: 'commitSHA' field is missing")}}class Ut extends jt{pureUrl;useDynamicPureServer=!1;constructor(e){super(e),B(e.configData.pure,"Can't configure application: 'pure' field is missing"),this.pureUrl=X(e.configData.pure.url,"Can't configure application: 'pure.url' field is missing or empty"),void 0!==e.configData.pure.dynamic&&(this.useDynamicPureServer=Boolean(e.configData.pure.dynamic))}}class Vt extends d{loggerPlugins=[];telemetryServicePlugins=[];tracerServicePlugins=[];eventNotifierPlugins=[];applicationPlugins=[];registerLoggerPlugin(e){this.loggerPlugins.push(e)}registerTelemetryServicePlugin(e){this.telemetryServicePlugins.push(e)}registerTracerServicePlugin(e){this.tracerServicePlugins.push(e)}registerEventNotifierPlugin(e){this.eventNotifierPlugins.push(e)}registerApplicationPlugin(e){this.applicationPlugins.push(e)}getLoggerPlugins(){return[...this.loggerPlugins]}getTelemetryServicePlugins(){return[...this.telemetryServicePlugins]}getTracerServicePlugins(){return[...this.tracerServicePlugins]}getEventNotifierPlugins(){return[...this.eventNotifierPlugins]}getApplicationPlugins(){return[...this.applicationPlugins]}}class Gt extends Vt{pureProtocolProcessorPlugins=[];pureGraphManagerPlugins=[];pureGraphPlugins=[];constructor(){super()}static create(){return new Gt}registerPureProtocolProcessorPlugin(e){this.pureProtocolProcessorPlugins.push(e)}registerPureGraphManagerPlugin(e){this.pureGraphManagerPlugins.push(e)}registerPureGraphPlugin(e){this.pureGraphPlugins.push(e)}getPureGraphManagerPlugins(){return[...this.pureGraphManagerPlugins]}getPureProtocolProcessorPlugins(){return[...this.pureProtocolProcessorPlugins]}getPureGraphPlugins(){return[...this.pureGraphPlugins]}}const $t=JSON.parse('{"i8":"7.1.25","Rw":{"NA":"@finos/legend-graph-manager-preset-dsl-diagram","zE":"@finos/legend-pure-protocol-processor-plugin-dsl-diagram","LW":"@finos/legend-pure-graph-manager-plugin-dsl-diagram","f1":"@finos/legend-pure-graph-plugin-dsl-diagram"}}');class zt extends o{_$nominalTypeBrand;install(e){e.registerPureGraphManagerPlugin(this)}}const Bt=e=>t=>(0,x.bi)(t)?t:e(t),Ht=e=>(t,s)=>(0,x.bi)(t)?t:e(t,s),Yt=e=>{(0,x.rC)(e,{_isDeleted:x.LO,_isDisposed:x.LO,name:x.LO,package:x.LO,isDeleted:x.Fl,path:x.Fl,_elementHashCode:x.Fl,hashCode:x.Fl,setIsDeleted:x.aD,dispose:x.aD})},Wt=Bt((e=>(0,x.rC)(e,{value:x.LO,valueForSerialization:x.Fl})));var Kt=s(34485),Zt=s(3096);const Xt=e=>Kt.sha1().update(e).digest("hex"),qt=e=>Xt(e.map((e=>"string"==typeof e||"boolean"==typeof e||"number"==typeof e?Xt(e):e.hashCode)).join(","));var Jt,Qt;(Qt=Jt=Jt||(Jt={})).PACKAGE="PACKAGE",Qt.PACKAGEABLE_ELEMENT="PACKAGEABLE_ELEMENT",Qt.PACKAGEABLE_ELEMENT_POINTER="PACKAGEABLE_ELEMENT_POINTER",Qt.PROFILE="PROFILE",Qt.TAG_POINTER="TAG_POINTER",Qt.STEREOTYPE_POINTER="STEREOTYPE_POINTER",Qt.TAGGED_VALUE="TAGGED_VALUE",Qt.ENUMERATION="ENUMERATION",Qt.ENUM_VALUE="ENUM_VALUE",Qt.CLASS="CLASS",Qt.PROPERTY="PROPERTY",Qt.PROPERTY_POINTER="PROPERTY_POINTER",Qt.MULTIPLICITY="MULTIPLICITY",Qt.CONSTRAINT="CONSTRAINT",Qt.DERIVED_PROPERTY="DERIVED_PROPERTY",Qt.ASSOCIATION="ASSOCIATION",Qt.FUNCTION="FUNCTION",Qt.MEASURE="MEASURE",Qt.UNIT="UNIT",Qt.RUNTIME="RUNTIME",Qt.PACKAGEABLE_RUNTIME="PACKAGEABLE_RUNTIME",Qt.ENGINE_RUNTIME="ENGINE_RUNTIME",Qt.LEGACY_RUNTIME="LEGACY_RUNTIME",Qt.RUNTIME_POINTER="RUNTIME_POINTER",Qt.STORE_CONNECTIONS="STORE_CONNECTIONS",Qt.IDENTIFIED_CONNECTION="IDENTIFIED_CONNECTION",Qt.PACKAGEABLE_CONNECTION="PACKAGEABLE_CONNECTION",Qt.CONNECTION_POINTER="CONNECTION_POINTER",Qt.XML_MODEL_CONNECTION="XML_MODEL_CONNECTION",Qt.JSON_MODEL_CONNECTION="JSON_MODEL_CONNECTION",Qt.MODEL_CHAIN_CONNECTION="MODEL_CHAIN_CONNECTION",Qt.FLAT_DATA_CONNECTION="FLAT_DATA_CONNECTION",Qt.RELATIONAL_DATABASE_CONNECTION="RELATIONAL_DATABASE_CONNECTION",Qt.FLAT_DATA="FLAT_DATA",Qt.FLAT_DATA_SECTION="FLAT_DATA_SECTION",Qt.FLAT_DATA_PROPERTY="FLAT_DATA_PROPERTY",Qt.FLAT_DATA_ROOT_RECORD_TYPE="FLAT_DATA_ROOT_RECORD_TYPE",Qt.FLAT_DATA_RECORD_TYPE="FLAT_DATA_RECORD_TYPE",Qt.FLAT_DATA_RECORD_FIELD="FLAT_DATA_RECORD_FIELD",Qt.FLAT_DATA_STRING="FLAT_DATA_STRING",Qt.FLAT_DATA_BOOLEAN="FLAT_DATA_BOOLEAN",Qt.FLAT_DATA_NUMBER="FLAT_DATA_NUMBER",Qt.FLAT_DATA_INTEGER="FLAT_DATA_INTEGER",Qt.FLAT_DATA_FLOAT="FLAT_DATA_FLOAT",Qt.FLAT_DATA_DECIMAL="FLAT_DATA_DECIMAL",Qt.FLAT_DATA_DATE="FLAT_DATA_DATE",Qt.FLAT_DATA_DATE_TIME="FLAT_DATA_DATE_TIME",Qt.FLAT_DATA_STRICT_DATE="FLAT_DATA_STRICT_DATE",Qt.FLAT_DATA_INSTANCE_SET_IMPLEMENTATION="FLAT_DATA_INSTANCE_SET_IMPLEMENTATION",Qt.FLAT_DATA_PROPERTY_MAPPING="FLAT_DATA_PROPERTY_MAPPING",Qt.FLAT_DATA_ASSOCIATION_IMPLEMENTATION="FLAT_DATA_ASSOCIATION_IMPLEMENTATION",Qt.FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING="FLAT_DATA_ASSOCIATION_PROPERTY_MAPPING",Qt.EMBEDDED_FLAT_DATA_PROPERTY_MAPPING="EMBEDDED_FLAT_DATA_PROPERTY_MAPPING",Qt.FLAT_DATA_SECTION_POINTER="FLAT_DATA_SECTION_POINTER",Qt.DATABASE="DATABASE",Qt.DATABASE_SCHEMA="DATABASE_SCHEMA",Qt.DATABASE_JOIN="DATABASE_JOIN",Qt.DATABASE_FILTER="DATABASE_FILTER",Qt.DATBASE_VIEW="DATBASE_VIEW",Qt.DATABASE_SCHEMA_TABLE="DATABASE_SCHEMA_TABLE",Qt.DATABASE_TABLE_COLUMN="DATABASE_TABLE_COLUMN",Qt.RELATIONAL="RELATIONAL",Qt.RELATIONAL_OPERATION_DYNA_FUNC="RELATIONAL_OPERATION_DYNA_FUNC",Qt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS="RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS",Qt.RELATIONAL_OPERATION_LITERAL="RELATIONAL_OPERATION_LITERAL",Qt.RELATIONAL_OPERATION_LITERAL_LIST="RELATIONAL_OPERATION_LITERAL_LIST",Qt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN="RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN",Qt.RELATIONAL_OPERATION_TABLE_POINTER="RELATIONAL_OPERATION_TABLE_POINTER",Qt.RELATIONAL_OPERATION_JOIN_POINTER="RELATIONAL_OPERATION_JOIN_POINTER",Qt.RELATIONAL_DATATYPE_VARCHAR="RELATIONAL_DATATYPE_VARCHAR",Qt.RELATIONAL_DATATYPE_CHAR="RELATIONAL_DATATYPE_CHAR",Qt.RELATIONAL_DATATYPE_VARBINARY="RELATIONAL_DATATYPE_VARBINARY",Qt.RELATIONAL_DATATYPE_BINARY="RELATIONAL_DATATYPE_BINARY",Qt.RELATIONAL_DATATYPE_BIT="RELATIONAL_DATATYPE_BIT",Qt.RELATIONAL_DATATYPE_INTEGER="RELATIONAL_DATATYPE_INTEGER",Qt.RELATIONAL_DATATYPE_BIGINT="RELATIONAL_DATATYPE_BIGINT",Qt.RELATIONAL_DATATYPE_SMALLINT="RELATIONAL_DATATYPE_SMALLINT",Qt.RELATIONAL_DATATYPE_TINYINT="RELATIONAL_DATATYPE_TINYINT",Qt.RELATIONAL_DATATYPE_NUMERIC="RELATIONAL_DATATYPE_NUMERIC",Qt.RELATIONAL_DATATYPE_DECIMAL="RELATIONAL_DATATYPE_DECIMAL",Qt.RELATIONAL_DATATYPE_DOUBLE="RELATIONAL_DATATYPE_DOUBLE",Qt.RELATIONAL_DATATYPE_FLOAT="RELATIONAL_DATATYPE_FLOAT",Qt.RELATIONAL_DATATYPE_REAL="RELATIONAL_DATATYPE_REAL",Qt.RELATIONAL_DATATYPE_DATE="RELATIONAL_DATATYPE_DATE",Qt.RELATIONAL_DATATYPE_TIMESTAMP="RELATIONAL_DATATYPE_TIMESTAMP",Qt.RELATIONAL_DATATYPE_OTHER="RELATIONAL_DATATYPE_OTHER",Qt.RELATIONAL_DATATYPE_SEMISTRUCTURED="RELATIONAL_DATATYPE_SEMISTRUCTURED",Qt.ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION="ROOT_RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Qt.RELATIONAL_INSTANCE_SET_IMPLEMENTATION="RELATIONAL_INSTANCE_SET_IMPLEMENTATION",Qt.REALTIONAL_PROPERTY_MAPPING="REALTIONAL_PROPERTY_MAPPING",Qt.EMBEDDED_REALTIONAL_PROPERTY_MAPPING="EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Qt.INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="INLINE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Qt.OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING="OTHERWISE_EMBEDDED_REALTIONAL_PROPERTY_MAPPING",Qt.AGGREGATION_AWARE_MAPPING="AGGREGATION_AWARE_MAPPING",Qt.AGGREGATION_AWARE_SPECIFICATION="AGGREGATION_AWARE_SPECIFICATION",Qt.AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER="AGGREGATION_AWARE_SET_IMPLEMENTATION_CONTAINER",Qt.AGGREGATE_FUNCTION="AGGREGATE_FUNCTION",Qt.GROUP_BY_FUNCTION="GROUP_BY_FUNCTION",Qt.BUSINESS_MILESTONING="BUSINESS_MILESTONING",Qt.BUSINESS_SNAPSHOT_MILESTONING="BUSINESS_SNAPSHOT_MILESTONING",Qt.PROCESSING_MILESTONING="PROCESSING_MILESTONING",Qt.STATIC_DATASOURCE_SPECIFICATION="STATIC_DATASOURCE_SPECIFICATION",Qt.LOCAL_H2_DATASOURCE_SPECIFICATION="LOCAL_H2_DATASOURCE_SPECIFICATION",Qt.EMBEDDED_H2_DATASOURCE_SPECIFICATION="EMBEDDED_H2_DATASOURCE_SPECIFICATION",Qt.SNOWFLAKE_DATASOURCE_SPECIFICATION="SNOWFLAKE_DATASOURCE_SPECIFICATION",Qt.REDSHIFT_DATASOURCE_SPECIFICATION="REDSHIFT_DATASOURCE_SPECIFICATION",Qt.BIGQUERY_DATASOURCE_SPECIFICATION="BIGQUERY_DATASOURCE_SPECIFICATION",Qt.DATABRICKS_DATASOURCE_SPECIFICATION="DATABRICKS_DATASOURCE_SPECIFICATION",Qt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY="DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY",Qt.DEFAULT_H2_AUTHENTICATION_STRATEGY="DEFAULT_H2_AUTHENTICATION_STRATEGY",Qt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY="SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY",Qt.API_TOKEN_AUTHENTICATION_STRATEGY="API_TOKEN_AUTHENTICATION_STRATEGY",Qt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY="GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY",Qt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Qt.OAUTH_AUTHENTICATION_STRATEGY="OAUTH_AUTHENTICATION_STRATEGY",Qt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY="GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY",Qt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY="MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY",Qt.MAPPER_POST_PROCESSOR="MAPPER_POST_PROCESSOR",Qt.SCHEMA_MAPPER="SCHEMA_MAPPER",Qt.TABLE_MAPPER="TABLE_MAPPER",Qt.MAPPING="MAPPING",Qt.MAPPING_INCLUDE="MAPPING_INCLUDE",Qt.ASSOCIATION_IMPLEMENTATION="ASSOCIATION_IMPLEMENTATION",Qt.RELATIONAL_ASSOCIATION_IMPLEMENTATION="RELATIONAL_ASSOCIATION_IMPLEMENTATION",Qt.XSTORE_ASSOCIATION_IMPLEMENTATION="XSTORE_ASSOCIATION_IMPLEMENTATION",Qt.ENUMERATION_MAPPING="ENUMERATION_MAPPING",Qt.ENUM_VALUE_MAPPING="ENUM_VALUE_MAPPING",Qt.SET_IMPLEMENTATION="SET_IMPLEMENTATION",Qt.OPERATION_SET_IMPLEMENTATION="OPERATION_SET_IMPLEMENTATION",Qt.PURE_INSTANCE_SET_IMPLEMENTATION="PURE_INSTANCE_SET_IMPLEMENTATION",Qt.PROPERTY_MAPPING="PROPERTY_MAPPING",Qt.LOCAL_MAPPING_PROPERTY="LOCAL_MAPPING_PROPERTY",Qt.PURE_PROPERTY_MAPPING="PURE_PROPERTY_MAPPING",Qt.XSTORE_PROPERTY_MAPPING="XSTORE_PROPERTY_MAPPING",Qt.MAPPING_TEST_LEGACY="MAPPING_TEST_LEGACY",Qt.MAPPING_TEST_SUITE="MAPPING_TEST_SUITE",Qt.MAPPING_TEST="MAPPING_TEST",Qt.STORE_TEST_DATA="STORE_TEST_DATA",Qt.INPUT_DATA="INPUT_DATA",Qt.FLAT_DATA_INPUT_DATA="FLAT_DATA_INPUT_DATA",Qt.RELATIONAL_INPUT_DATA="RELATIONAL_INPUT_DATA",Qt.OBJECT_INPUT_DATA="OBJECT_INPUT_DATA",Qt.MAPPING_TEST_ASSERT="MAPPING_TEST_ASSERT",Qt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT="EXPECTED_OUTPUT_MAPPING_TEST_ASSERT",Qt.FILTER_MAPPING="FILTER_MAPPING",Qt.COLUMN_MAPPING="COLUMN_MAPPING",Qt.GROUP_BY_MAPPING="GROUP_BY_MAPPING",Qt.SERVICE="SERVICE",Qt.SERVICE_PURE_EXECUTION="SERVICE_PURE_EXECUTION",Qt.SERVICE_PURE_SINGLE_EXECUTION="SERVICE_PURE_SINGLE_EXECUTION",Qt.SERVICE_KEYED_EXECUTION_PARAMETER="SERVICE_KEYED_EXECUTION_PARAMETER",Qt.SERVICE_PURE_MULTI_EXECUTION="SERVICE_PURE_MULTI_EXECUTION",Qt.SERVICE_TEST_CONTAINER="SERVICE_TEST_CONTAINER",Qt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_SINGLE_EXECUTION_TEST",Qt.SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST="SERVICE_LEGACY_KEYED_SINGLE_EXECUTION_TEST",Qt.SERVICE_LEGACY_MULTI_EXECUTION_TEST="SERVICE_LEGACY_MULTI_EXECUTION_TEST",Qt.SERVICE_CONNECTION_TEST_DATA="SERVICE_CONNECTION_TEST_DATA",Qt.SERVICE_TEST_DATA="SERVICE_TEST_DATA",Qt.SERVICE_TEST_SUITE="SERVICE_TEST_SUITE",Qt.SERVICE_TEST="SERVICE_TEST",Qt.SERVICE_PARAMETER_VALUE="SERVICE_PARAMETER_VALUE",Qt.SERVICE_POST_VALIDATION="SERVICE_POST_VALIDATION",Qt.SERVICE_POST_VALIDATION_ASSERTION="SERVICE_POST_VALIDATION_ASSERTION",Qt.GENERATION_TREE="GENERATION_TREE",Qt.GENERATION_TREE_NODE="GENERATION_TREE_NODE",Qt.FILE_GENERATION="FILE_GENERATION",Qt.CONFIGURATION_PROPERTY="CONFIGURATION_PROPERTY",Qt.SECTION_INDEX="SECTION_INDEX",Qt.SECTION="SECTION",Qt.IMPORT_AWARE_CODE_SECTION="IMPORT_AWARE_CODE_SECTION",Qt.DEFAULT_CODE_SECTION="DEFAULT_CODE_SECTION",Qt.RAW_LAMBDA="RAW_LAMBDA",Qt.RAW_VARIABLE="RAW_VARIABLE",Qt.RAW_INSTANCE_VALUE="RAW_INSTANCE_VALUE",Qt.BINDING_TRANSFORMER="BINDING_TRANSFORMER",Qt.ASSERT_FAIL="ASSERT_FAIL",Qt.ASSERT_PASS="ASSERT_PASS",Qt.EQUAL_TO_JSON_ASSERT_FAIL="EQUAL_TO_JSON_ASSERT_FAIL",Qt.EQUAL_TO="EQUAL_TO",Qt.EQUAL_TO_JSON="EQUAL_TO_JSON",Qt.EQUAL_TO_TDS="EQUAL_TO_TDS",Qt.TEST_RESULT="TEST_RESULT",Qt.TEST_ERROR="TEST_ERROR",Qt.TEST_FAILED="TEST_FAILED",Qt.TEST_PASSED="TEST_PASSED",Qt.ATOMIC_TEST_ID="ATOMIC_TEST_ID",Qt.EXTERNAL_FORMAT_DATA="EXTERNAL_FORMAT_DATA",Qt.MODEL_STORE_DATA="MODEL_STORE_DATA",Qt.DATA_ELEMENT_REFERENCE="DATA_ELEMENT_REFERENCE",Qt.DATA_ELEMENT="DATA_ELEMENT",Qt.RELATIONAL_CSV_DATA="RELATIONAL_CSV_DATA",Qt.RELATIONAL_TDS="RELATIONAL_TDS",Qt.RELATIONAL_CSV_DATA_TABLE="RELATIONAL_CSV_DATA_TABLE",Qt.INTERNAL_UNKNOWN_VALUE_SPECIFICATION="INTERNAL_UNKNOWN_VALUE_SPECIFICATION",Qt.VARIABLE_EXPRESSION="VARIABLE_EXPRESSION",Qt.EXPRESSION="EXPRESSION",Qt.FUNCTION_EXPRESSION="FUNCTION_EXPRESSION",Qt.SIMPLE_FUNCTION_EXPRESSION="SIMPLE_FUNCTION_EXPRESSION",Qt.ABSTRACT_PROPERTY_EXPRESSION="ABSTRACT_PROPERTY_EXPRESSION",Qt.INSTANCE_VALUE="INSTANCE_VALUE",Qt.PRIMITIVE_INSTANCE_VALUE="PRIMITIVE_INSTANCE_VALUE",Qt.ENUM_INSTANCE_VALUE="ENUM_INSTANCE_VALUE",Qt.RUNTIME_INSTANCE_VALUE="RUNTIME_INSTANCE_VALUE",Qt.PAIR_INSTANCE_VALUE="PAIR_INSTANCE_VALUE",Qt.MAPPING_INSTANCE_VALUE="MAPPING_INSTANCE_VALUE",Qt.PURE_LIST_INSTANCE_VALUE="PURE_LIST_INSTANCE_VALUE",Qt.COLLECTION_INSTANCE_VALUE="COLLECTION_INSTANCE_VALUE",Qt.LAMBDA_FUNCTION_INSTANCE_VALUE="LAMBDA_FUNCTION_INSTANCE_VALUE",Qt.FUNCTION_TYPE="FUNCTION_TYPE",Qt.LAMBDA_FUNCTION="LAMBDA_FUNCTION",Qt.ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE="ALLOY_SERIALIZATION_CONFIG_INSTANCE_VALUE",Qt.ALLOY_SERIALIZATION_CONFIG="ALLOY_SERIALIZATION_CONFIG",Qt.ROOT_GRAPH_FETCH_TREE="ROOT_GRAPH_FETCH_TREE",Qt.PROPERTY_GRAPH_FETCH_TREE="PROPERTY_GRAPH_FETCH_TREE",Qt.PROPERTY_GRAPH_FETCH_TREE_INSTANCE_VALUE="PROEPRTY_GRAPH_FETCH_TREE_INSTANCE_VALUE",Qt.ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE="ROOT_GRAPH_FETCH_TREE_INSTANCE_VALUE",Qt.INTERNAL_PROPAGATED_VALUE="INTERNAL_PROPAGATED_VALUE";const es=e=>{return s={excludeKeys:e=>e.toLowerCase().endsWith("sourceInformation".toLowerCase())},q(Q(t=e),"Can't hash non-object value"),Zt(t,s);var t,s},ts=(e,t)=>qt([e?es(e):"",t?es(t):""]),ss=(e,t)=>[Jt.PACKAGEABLE_ELEMENT_POINTER,e,t].map(Xt).join(",");class is{stereotypes=[];taggedValues=[]}class ns extends is{name}class as extends ns{_UUID=(0,a.Z)();_isDeleted=!1;_isDisposed=!1;package;constructor(e){super(),this.name=e}get isDeleted(){return this._isDeleted}setIsDeleted(e){this._isDeleted=e}get path(){if(!this.package)return this.name;const e=this.package.path;return e?`${e}${Ee}${this.name}`:this.name}dispose(){this._isDisposed=!0;try{this.hashCode}catch{}}get _elementHashCode(){return qt([Jt.PACKAGEABLE_ELEMENT,this.path])}get hashCode(){if(this._isDisposed)throw new j(`Element '${this.path}' is already disposed`);return this._elementHashCode}}class rs extends as{}class os extends rs{_subclasses=[];_generatedMilestonedProperties=[];properties=[];propertiesFromAssociations=[];derivedProperties=[];generalizations=[];constraints=[];dispose(){super.dispose(),this._subclasses=[],this.generalizations.forEach((e=>{const t=e.value.rawType;t._isDisposed||(t._subclasses=t._subclasses.filter((e=>!e._isDisposed)))}))}get _elementHashCode(){return qt([Jt.CLASS,this.path,qt(this.properties),qt(this.derivedProperties),qt(this.generalizations.map((e=>e.ownerReference.valueForSerialization??""))),qt(this.constraints),qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}}class ls extends rs{}class cs extends ls{values=[];get _elementHashCode(){return qt([Jt.ENUMERATION,this.path,qt(this.values),qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}}class ds extends ls{measure;conversionFunction;constructor(e,t,s){super(e),this.measure=t,this.conversionFunction=s}get hashCode(){return qt([Jt.UNIT,this.measure.path,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new U}}class hs extends rs{canonicalUnit;nonCanonicalUnits=[];get _elementHashCode(){return qt([Jt.MEASURE,this.path,this.canonicalUnit??"",qt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}}class us extends as{children=[];get path(){return this.package?super.path:""}get hashCode(){return""}accept_PackageableElementVisitor(e){return e.visit_Package(this)}}class ps{_OWNER;parserName;elements=[];constructor(e,t){this.parserName=e,this._OWNER=t}get hashCode(){return qt([Jt.SECTION,this.parserName,qt(this.elements.map((e=>e.valueForSerialization??"")))])}}class ms extends ps{imports=[];get hashCode(){return qt([Jt.IMPORT_AWARE_CODE_SECTION,super.hashCode,qt(this.imports.map((e=>e.valueForSerialization??"")))])}}class _s extends ps{get hashCode(){return qt([Jt.DEFAULT_CODE_SECTION,super.hashCode])}}class gs{_UUID=(0,a.Z)()}class Es extends gs{ownerReference;constructor(e){super(),this.ownerReference=e}}class fs extends gs{value;constructor(e){super(),this.value=e}}class Ts extends fs{constructor(e){super(e)}static create(e){return new Ts(e)}get valueForSerialization(){return this.value.path}}const Cs=Bt((e=>(0,x.rC)(e,{name:x.LO,value:x.LO.ref,hashCode:x.Fl}))),xs=Bt((e=>(Yt(e),(0,x.rC)(e,{type:x.LO,generationOutputPath:x.LO,scopeElements:x.LO,configurationProperties:x.LO,_elementHashCode:x.KG}),e.scopeElements.forEach((e=>{e instanceof fs&&Wt(e)})),e.configurationProperties.forEach(Cs),e))),Ns=Bt((e=>((0,x.rC)(e,{id:x.LO,hashCode:x.Fl}),Wt(e.generationElement),e))),As=Bt((e=>(Yt(e),(0,x.rC)(e,{generationNodes:x.LO,fileGenerations:x.LO,_elementHashCode:x.KG}),e.generationNodes.forEach(Ns),e.fileGenerations.forEach(Wt),e)));var Os=s(67295),Ss=s(72531);s(90286);const ys=e=>e.length>=1?`${e[0].toUpperCase()}${e.substring(1,e.length)}`:e,Is=["a","an","the","but","by","nor","and","or","so","as","yet","for","in","nor","of","on","at","out","to","up"],vs=e=>{try{return((e,t=2)=>{try{return((e,t,s)=>{const i=(0,Os.P)(e,void 0,s);return B(i,"Can't stringify lossless JSON value"),i})((0,Ss.Qc)(e),0,t)}catch{return e}})(e,0)}catch{return e.replace(/\n\s*/g,"")}};class Rs{}class Ps extends Rs{expectedOutput;constructor(e){super(),this.expectedOutput=vs(e)}get hashCode(){return qt([Jt.EXPECTED_OUTPUT_MAPPING_TEST_ASSERT,this.expectedOutput])}}class ws{}class Ls extends ws{mappings=[];connections=[];get hashCode(){return qt([Jt.ENGINE_RUNTIME,qt(this.mappings.map((e=>ss(Le.MAPPING,e.valueForSerialization??"")))),qt(this.connections.filter((e=>e.storeConnections.length)))])}}class bs extends ws{packageableRuntime;constructor(e){super(),this.packageableRuntime=e}get hashCode(){return qt([Jt.RUNTIME_POINTER,this.packageableRuntime.valueForSerialization??""])}}class Ds{}class Ms extends Ds{sourceFlatData;data;constructor(e,t){super(),this.sourceFlatData=e,this.data=t}get hashCode(){return qt([Jt.FLAT_DATA_INPUT_DATA,ss(Le.STORE,this.sourceFlatData.valueForSerialization??""),this.data])}}var ks,Fs,js;(js=ks=ks||(ks={})).JSON="JSON",js.XML="XML";class Us extends Ds{sourceClass;inputType;data;constructor(e,t,s){super(),this.sourceClass=e,this.inputType=t,this.data=t===ks.JSON?vs(s):s}get hashCode(){return qt([Jt.OBJECT_INPUT_DATA,this.sourceClass.valueForSerialization??"",this.inputType,this.data])}}!function(e){e.SQL="SQL",e.CSV="CSV"}(Fs=Fs||(Fs={}));class Vs extends Ds{database;data;inputType;constructor(e,t,s){super(),this.database=e,this.data=t,this.inputType=s}get hashCode(){return qt([Jt.RELATIONAL_INPUT_DATA,this.database.valueForSerialization??"",this.data,this.inputType])}}const Gs=Bt((e=>((0,x.rC)(e,{value:x.LO,hashCode:x.Fl}),Wt(e.type),e))),$s=Bt((e=>(0,x.rC)(e,{body:x.LO.ref,parameters:x.LO.ref,hashCode:x.Fl}))),zs=Bt((e=>((0,x.rC)(e,{name:x.LO,multiplicity:x.LO,hashCode:x.Fl}),Wt(e.type),e)));class Bs{observerContext;constructor(e){this.observerContext=e}visit_RawLambda(e){$s(e)}visit_RawVariableExpression(e){zs(e)}visit_RawPrimitiveInstanceValue(e){Gs(e)}}Ht(((e,t)=>(e.accept_RawValueSpecificationVisitor(new Bs(t)),e)));class Hs{_correspondingPrimitiveType;constructor(e){this._correspondingPrimitiveType=e}}class Ys extends Hs{trueString;falseString;get hashCode(){return qt([Jt.FLAT_DATA_BOOLEAN,this.trueString??"",this.falseString??""])}}class Ws extends Hs{get hashCode(){return qt([Jt.FLAT_DATA_STRING])}}class Ks extends Hs{get hashCode(){return qt([Jt.FLAT_DATA_NUMBER])}}class Zs extends Hs{dateFormat;timeZone;get hashCode(){return qt([Jt.FLAT_DATA_DATE,this.dateFormat?qt(this.dateFormat):"",this.timeZone??""])}}class Xs extends Hs{fields=[];get hashCode(){return qt([Jt.FLAT_DATA_RECORD_TYPE,qt(this.fields)])}}const qs=Ht(((e,t)=>(Ir(e,t),(0,x.rC)(e,{flatData:x.LO,sectionName:x.LO,hashCode:x.Fl}),e))),Js=Bt((e=>((0,x.rC)(e,{label:x.LO,flatDataDataType:x.LO,optional:x.LO,address:x.LO,hashCode:x.Fl}),(e=>{e instanceof Ys?(0,x.rC)(e,{trueString:x.LO,falseString:x.LO,hashCode:x.Fl}):e instanceof Ws||e instanceof Ks?(0,x.rC)(e,{hashCode:x.Fl}):e instanceof Zs?(0,x.rC)(e,{dateFormat:x.LO,timeZone:x.LO,hashCode:x.Fl}):e instanceof Xs&&Bt(Qs)(e)})(e.flatDataDataType),e)));function Qs(e){return(0,x.rC)(e,{fields:x.LO,hashCode:x.Fl}),e.fields.forEach(Js),e}Bt(Qs);const ei=Bt(Qs),ti=Bt((e=>((0,x.rC)(e,{name:x.LO,value:x.LO,hashCode:x.Fl}),e))),si=Bt((e=>((0,x.rC)(e,{driverId:x.LO,name:x.LO,sectionProperties:x.LO,recordType:x.LO,hashCode:x.Fl}),e.sectionProperties.forEach(ti),e.recordType&&ei(e.recordType),e))),ii=(Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),Wt(e.ownerReference),e))),Bt((e=>(Yt(e),(0,x.rC)(e,{sections:x.LO,_elementHashCode:x.KG}),e.sections.forEach(si),e)))),ni=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),ai=Ht(((e,t)=>(Mr(e,t),(0,x.rC)(e,{filter:x.LO,hashCode:x.Fl}),ni(e.sourceRootRecordType),e.filter&&$s(e.filter),e))),ri=Ht(((e,t)=>(Ir(e,t),Mr(e,t),(0,x.rC)(e,{rootInstanceSetImplementation:x.LO,hashCode:x.Fl}),e))),oi=Ht(((e,t)=>(Ir(e,t),(0,x.rC)(e,{transformer:x.LO,transform:x.LO,hashCode:x.Fl}),$s(e.transform),e))),li=Bt((e=>((0,x.rC)(e,{data:x.LO,hashCode:x.Fl}),Wt(e.sourceFlatData),e))),ci=Bt((e=>((0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),e)));class di{}class hi extends di{serverPrincipal;get hashCode(){return qt([Jt.DELEGRATED_KEREBEROS_AUTHENTICATION_STRATEGY,this.serverPrincipal?.toString()??""])}}class ui extends di{get hashCode(){return qt([Jt.DEFAULT_H2_AUTHENTICATION_STRATEGY])}}class pi extends di{apiToken;constructor(e){super(),this.apiToken=e}get hashCode(){return qt([Jt.API_TOKEN_AUTHENTICATION_STRATEGY,this.apiToken])}}class mi extends di{oauthKey;scopeName;constructor(e,t){super(),this.oauthKey=e,this.scopeName=t}get hashCode(){return qt([Jt.OAUTH_AUTHENTICATION_STRATEGY,this.oauthKey,this.scopeName])}}class _i extends di{privateKeyVaultReference;passPhraseVaultReference;publicUserName;constructor(e,t,s){super(),this.privateKeyVaultReference=e,this.passPhraseVaultReference=t,this.publicUserName=s}get hashCode(){return qt([Jt.SNOWFLAKE_PUBLIC_AUTHENTICATION_STRATEGY,this.privateKeyVaultReference,this.passPhraseVaultReference,this.publicUserName])}}class gi extends di{get hashCode(){return qt([Jt.GCP_APPLICATION_DEFAULT_CREDENTIALS_AUTHENTICATION_STRATEGY])}}class Ei extends di{serviceAccountEmail;additionalGcpScopes=[];constructor(e,t=[]){super(),this.serviceAccountEmail=e,this.additionalGcpScopes=t}get hashCode(){return qt([Jt.GCP_WORKLOAD_IDENTITY_FEDERATION_AUTHENTICATION_STRATEGY,this.serviceAccountEmail,qt(this.additionalGcpScopes)])}}class fi extends di{baseVaultReference;userNameVaultReference;passwordVaultReference;constructor(e,t){super(),this.userNameVaultReference=e,this.passwordVaultReference=t}get hashCode(){return qt([Jt.USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.baseVaultReference?.toString()??"",this.userNameVaultReference,this.passwordVaultReference])}}class Ti extends di{vaultReference;constructor(e){super(),this.vaultReference=e}get hashCode(){return qt([Jt.MIDDLE_TIER_USERNAME_PASSWORD_AUTHENTICATION_STRATEGY,this.vaultReference])}}class Ci{}class xi extends Ci{host;port;databaseName;constructor(e,t,s){super(),this.host=e,this.port=t,this.databaseName=s}get hashCode(){return qt([Jt.STATIC_DATASOURCE_SPECIFICATION,this.host,this.port.toString(),this.databaseName])}}class Ni extends Ci{hostname;port;protocol;httpPath;constructor(e,t,s,i){super(),this.hostname=e,this.port=t,this.protocol=s,this.httpPath=i}get hashCode(){return qt([Jt.DATABRICKS_DATASOURCE_SPECIFICATION,this.hostname,this.port,this.protocol,this.httpPath])}}class Ai extends Ci{databaseName;directory;autoServerMode;constructor(e,t,s){super(),this.databaseName=e,this.directory=t,this.autoServerMode=s}get hashCode(){return qt([Jt.EMBEDDED_H2_DATASOURCE_SPECIFICATION,this.databaseName,this.directory,this.autoServerMode.toString()])}}class Oi extends Ci{testDataSetupCsv;testDataSetupSqls=[];get hashCode(){return qt([Jt.LOCAL_H2_DATASOURCE_SPECIFICATION,this.testDataSetupCsv??"",qt(this.testDataSetupSqls)])}}class Si extends Ci{accountName;region;warehouseName;databaseName;cloudType;quotedIdentifiersIgnoreCase;proxyHost;proxyPort;nonProxyHosts;organization;accountType;role;constructor(e,t,s,i){super(),this.region=t,this.warehouseName=s,this.databaseName=i,this.accountName=e}get hashCode(){return qt([Jt.SNOWFLAKE_DATASOURCE_SPECIFICATION,this.accountName,this.region,this.warehouseName,this.databaseName,this.cloudType??"",this.proxyHost??"",this.proxyPort??"",this.nonProxyHosts??"",this.organization??"",this.accountType??"",this.role??"",this.quotedIdentifiersIgnoreCase?.toString()??""])}}class yi extends Ci{clusterID;databaseName;host;port;region;endpointURL;constructor(e,t,s,i,n,a){super(),this.clusterID=n,this.region=a,this.host=i,this.databaseName=e,this.endpointURL=t,this.port=s}get hashCode(){return qt([Jt.REDSHIFT_DATASOURCE_SPECIFICATION,this.databaseName,this.endpointURL,this.port.toString(),this.clusterID,this.host,this.region])}}class Ii extends Ci{projectId;defaultDataset;proxyHost;proxyPort;constructor(e,t){super(),this.projectId=e,this.defaultDataset=t}get hashCode(){return qt([Jt.BIGQUERY_DATASOURCE_SPECIFICATION,this.projectId,this.defaultDataset,this.proxyHost??"",this.proxyPort??""])}}class vi{_UUID=(0,a.Z)()}class Ri extends vi{mappers=[];get hashCode(){return qt([Jt.MAPPER_POST_PROCESSOR,qt(this.mappers)])}}const Pi="{target}",wi="default";class Li{}class bi extends Li{}class Di extends bi{}class Mi extends Di{name;parameters=[];constructor(e){super(),this.name=e}get hashCode(){return qt([Jt.RELATIONAL_OPERATION_DYNA_FUNC,this.name,qt(this.parameters)])}}var ki;!function(e){e.INNER="INNER",e.LEFT_OUTER="LEFT_OUTER",e.RIGHT_OUTER="RIGHT_OUTER",e.OUTER="OUTER"}(ki=ki||(ki={}));const Fi=e=>[e].concat(e.children.length?Fi(e.children[0]):[]);class ji extends Li{relationalOperationElement;joinTreeNode;get hashCode(){return qt([Jt.RELATIONAL_OPERATION_ELEMENTS_WITH_JOINS,qt(this.joinTreeNode?Fi(this.joinTreeNode):[]),this.relationalOperationElement??""])}}class Ui extends Li{relation;name;database;isSelfJoinTarget=!1;get hashCode(){throw new U}}class Vi extends Li{alias;column;columnName;get hashCode(){return qt([Jt.RELATIONAL_OPERATION_TABLE_ALIAS_COLUMN,this.alias.isSelfJoinTarget?this.alias.relation.selfJoinPointerHashCode:this.alias.relation.pointerHashCode,this.alias.isSelfJoinTarget?Pi:this.alias.name,this.column.value.name])}}class Gi extends Li{value;constructor(e){super(),this.value=e}get hashCode(){return qt([Jt.RELATIONAL_OPERATION_LITERAL,"number"==typeof this.value?this.value.toString():this.value])}}class $i extends Li{values=[];get hashCode(){return qt([Jt.RELATIONAL_OPERATION_LITERAL_LIST,qt(this.values)])}}class zi extends Li{owner;name;type;nullable;get hashCode(){return qt([Jt.DATABASE_TABLE_COLUMN,this.name,this.nullable?.toString()??"",this.type])}}class Bi{}class Hi extends Bi{infinityDate}class Yi{}class Wi extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_BIGINT])}}class Ki extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_SMALLINT])}}class Zi extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_TINYINT])}}class Xi extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_INTEGER])}}class qi extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_FLOAT])}}class Ji extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_DOUBLE])}}class Qi extends Yi{size;constructor(e){super(),this.size=e}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_VARCHAR,this.size.toString()])}}class en extends Yi{size;constructor(e){super(),this.size=e}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_CHAR,this.size.toString()])}}class tn extends Yi{size;constructor(e){super(),this.size=e}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_VARBINARY,this.size.toString()])}}class sn extends Yi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_DECIMAL,this.precision.toString(),this.scale.toString()])}}class nn extends Yi{precision;scale;constructor(e,t){super(),this.precision=e,this.scale=t}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_NUMERIC,this.precision.toString(),this.scale.toString()])}}class an extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_TIMESTAMP])}}class rn extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_VARCHAR])}}class on extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_BIT])}}class ln extends Yi{size;constructor(e){super(),this.size=e}get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_BINARY,this.size.toString()])}}class cn extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_REAL])}}class dn extends Yi{get hashCode(){return qt([Jt.RELATIONAL_DATATYPE_SEMISTRUCTURED])}}class hn extends Es{ownerReference;constructor(e){super(e),this.ownerReference=e}}class un extends hn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Jt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Xt).join(",")}get selfJoinPointerHashCode(){return[Jt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",wi,Pi].map(Xt).join(",")}}class pn extends hn{value;constructor(e,t){super(e),this.value=t}get pointerHashCode(){return[Jt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",this.value.schema.name,this.value.name].map(Xt).join(",")}get selfJoinPointerHashCode(){return[Jt.RELATIONAL_OPERATION_TABLE_POINTER,this.ownerReference.valueForSerialization??"",wi,Pi].map(Xt).join(",")}}class mn{}class _n extends mn{_UUID=(0,a.Z)();from;to;constructor(e,t){super(),this.from=e,this.to=t}get hashCode(){return qt([this.from,this.to])}}class gn extends _n{get hashCode(){return qt([super.hashCode,Jt.SCHEMA_MAPPER])}}class En extends _n{schema;constructor(e,t,s){super(e,t),this.schema=s}get hashCode(){return qt([super.hashCode,Jt.TABLE_MAPPER,this.schema])}}const fn=Bt((e=>((0,x.rC)(e,{packageableElementIncludes:x.LO,packageableElementExcludes:x.LO,hashCode:x.Fl}),e.packageableElementIncludes.forEach(Wt),e.packageableElementExcludes.forEach(Wt),e))),Tn=(Bt((e=>(Cr(e),(0,x.rC)(e,{schemaSet:x.LO,schemaId:x.LO,contentType:x.LO,modelUnit:x.LO,_elementHashCode:x.KG}),e.schemaSet&&Wt(e.schemaSet),fn(e.modelUnit),e))),Bt((e=>((0,x.rC)(e,{binding:x.LO,hashCode:x.Fl}),Wt(e.binding),e)))),Cn=Bt((e=>((0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),e))),xn=(Bt((e=>(Qr(e),(0,x.rC)(e,{externalSource:x.LO,hashCode:x.Fl}),Cn(e.externalSource),e))),Bt((e=>(0,x.rC)(e,{id:x.LO,location:x.LO,content:x.LO,hashCode:x.Fl})))),Nn=(Bt((e=>(Yt(e),(0,x.rC)(e,{format:x.LO,schemas:x.LO,_elementHashCode:x.KG}),e.schemas.forEach(xn),e))),Bt((e=>e instanceof Wi||e instanceof Ki||e instanceof Zi||e instanceof Xi||e instanceof qi||e instanceof Ji||e instanceof an||e instanceof Date||e instanceof rn||e instanceof on||e instanceof cn||e instanceof dn?(0,x.rC)(e,{hashCode:x.Fl}):e instanceof Qi||e instanceof en||e instanceof tn||e instanceof ln?(0,x.rC)(e,{size:x.LO,hashCode:x.Fl}):e instanceof sn||e instanceof nn?(0,x.rC)(e,{precision:x.LO,scale:x.LO,hashCode:x.Fl}):e))),An=Bt((e=>((0,x.rC)(e,{name:x.LO,type:x.LO,nullable:x.LO,hashCode:x.Fl}),Nn(e.type),e))),On=Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl,selfJoinPointerHashCode:x.Fl}),Wt(e.ownerReference),e))),Sn=Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl,selfJoinPointerHashCode:x.Fl}),Wt(e.ownerReference),e))),yn=Bt((e=>((0,x.rC)(e,{relation:x.LO,name:x.LO,database:x.LO,isSelfJoinTarget:x.LO}),(e=>{e instanceof pn?Sn(e):e instanceof un&&On(e)})(e.relation),e))),In=Bt((e=>((0,x.rC)(e,{name:x.LO,parameters:x.LO,hashCode:x.Fl}),e.parameters.forEach(Mn),e))),vn=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),Rn=Bt((e=>((0,x.rC)(e,{alias:x.LO,column:x.LO,columnName:x.LO,hashCode:x.Fl}),yn(e.alias),vn(e.column),e))),Pn=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),wn=Bt((e=>((0,x.rC)(e,{alias:x.LO,children:x.LO,joinType:x.LO,hashCode:x.Fl}),e.alias&&yn(e.alias),e.children.forEach(wn),Pn(e.join),e))),Ln=Bt((e=>((0,x.rC)(e,{relationalOperationElement:x.LO,joinTreeNode:x.LO,hashCode:x.Fl}),e.relationalOperationElement&&Mn(e.relationalOperationElement),e.joinTreeNode&&wn(e.joinTreeNode),e))),bn=Bt((e=>((0,x.rC)(e,{value:x.LO,hashCode:x.Fl}),e.value instanceof Li&&Mn(e.value),e))),Dn=Bt((e=>((0,x.rC)(e,{values:x.LO,hashCode:x.Fl}),e.values.forEach(bn),e)));function Mn(e){return e instanceof Mi?In(e):e instanceof Ui?yn(e):e instanceof Vi?Rn(e):e instanceof zi?An(e):e instanceof Gi?bn(e):e instanceof $i?Dn(e):e instanceof ji?Ln(e):e}const kn=Bt((e=>e)),Fn=Ht(((e,t)=>{if(e instanceof Hi)return kn(e);const s=t.plugins.flatMap((e=>e.getExtraMilestoningObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})),jn=Bt((e=>((0,x.rC)(e,{columnName:x.LO,relationalOperationElement:x.LO,hashCode:x.Fl}),Mn(e.relationalOperationElement),e))),Un=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),Vn=Bt((e=>((0,x.rC)(e,{joinTreeNode:x.LO,database:x.LO,filterName:x.LO,hashCode:x.Fl}),e.joinTreeNode&&wn(e.joinTreeNode),Un(e.filter),e))),Gn=Bt((e=>((0,x.rC)(e,{columns:x.LO}),e.columns.forEach(Mn),e))),$n=e=>{(0,x.rC)(e,{columns:x.LO,name:x.LO})},zn=Ht(((e,t)=>($n(e),(0,x.rC)(e,{primaryKey:x.LO,hashCode:x.Fl}),e.primaryKey.forEach(An),e.milestoning.forEach((e=>Fn(e,t))),e))),Bn=Ht(((e,t)=>($n(e),(0,x.rC)(e,{primaryKey:x.LO,columnMappings:x.LO,filter:x.LO,distinct:x.LO,groupBy:x.LO,hashCode:x.Fl}),e.primaryKey.forEach(An),e.columnMappings.forEach(jn),e.filter&&Vn(e.filter),e.groupBy&&Gn(e.groupBy),e))),Hn=Ht(((e,t)=>((0,x.rC)(e,{name:x.LO,tables:x.LO,views:x.LO,hashCode:x.Fl}),e.tables.forEach((e=>zn(e,t))),e.views.forEach((e=>Bn(e,t))),e))),Yn=Bt((e=>((0,x.rC)(e,{name:x.LO,operation:x.LO,hashCode:x.Fl}),Mn(e.operation),e))),Wn=Bt((e=>((0,x.rC)(e,{name:x.LO,target:x.LO,aliases:x.LO,operation:x.LO,hashCode:x.Fl}),e.target&&yn(e.target),Mn(e.operation),e))),Kn=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{schemas:x.LO,joins:x.LO,filters:x.LO,_elementHashCode:x.KG}),e.schemas.forEach((e=>Hn(e,t))),e.joins.forEach(Wn),e.filters.forEach(Yn),e))),Zn=Ht(((e,t)=>(Ir(e,t),(0,x.rC)(e,{transformer:x.LO,relationalOperation:x.LO.ref,bindingTransformer:x.LO,hashCode:x.Fl}),e.bindingTransformer&&Tn(e.bindingTransformer),e))),Xn=(e,t)=>(Mr(e,t),Ir(e,t),(0,x.rC)(e,{id:x.LO,rootInstanceSetImplementation:x.LO,primaryKey:x.LO}),e.primaryKey.forEach(Mn),e),qn=Ht(Xn),Jn=Ht(((e,t)=>(Xn(e,t),(0,x.rC)(e,{inlineSetImplementation:x.LO}),$r(e.inlineSetImplementation,t),e))),Qn=Ht(((e,t)=>(Xn(e,t),(0,x.rC)(e,{otherwisePropertyMapping:x.LO,hashCode:x.Fl}),Pr(e.otherwisePropertyMapping,t),e))),ea=Ht(((e,t)=>(Mr(e,t),(0,x.rC)(e,{primaryKey:x.LO}),e.primaryKey.forEach(Mn),e))),ta=Ht(((e,t)=>(Mr(e,t),(0,x.rC)(e,{columnMappings:x.LO,filter:x.LO,distinct:x.LO,groupBy:x.LO,mainTableAlias:x.LO,superSetImplementationId:x.LO,hashCode:x.Fl}),e.columnMappings.forEach(jn),e.filter&&Vn(e.filter),e.groupBy&&Gn(e.groupBy),e.mainTableAlias&&yn(e.mainTableAlias),e))),sa=Bt((e=>((0,x.rC)(e,{data:x.LO,inputType:x.LO,hashCode:x.Fl}),Wt(e.database),e))),ia=Bt((e=>(0,x.rC)(e,{host:x.LO,port:x.LO,databaseName:x.LO,hashCode:x.Fl}))),na=Bt((e=>(0,x.rC)(e,{hostname:x.LO,port:x.LO,protocol:x.LO,httpPath:x.LO,hashCode:x.Fl}))),aa=Bt((e=>(0,x.rC)(e,{databaseName:x.LO,directory:x.LO,autoServerMode:x.LO,hashCode:x.Fl}))),ra=Bt((e=>(0,x.rC)(e,{testDataSetupCsv:x.LO,testDataSetupSqls:x.LO,hashCode:x.Fl}))),oa=Bt((e=>(0,x.rC)(e,{accountName:x.LO,region:x.LO,warehouseName:x.LO,databaseName:x.LO,cloudType:x.LO,quotedIdentifiersIgnoreCase:x.LO,proxyHost:x.LO,proxyPort:x.LO,nonProxyHosts:x.LO,organization:x.LO,accountType:x.LO,role:x.LO,hashCode:x.Fl}))),la=Bt((e=>(0,x.rC)(e,{databaseName:x.LO,endpointURL:x.LO,port:x.LO,region:x.LO,clusterID:x.LO,host:x.LO,hashCode:x.Fl}))),ca=Bt((e=>(0,x.rC)(e,{projectId:x.LO,defaultDataset:x.LO,proxyHost:x.LO,proxyPort:x.LO,hashCode:x.Fl}))),da=Bt((e=>(0,x.rC)(e,{serverPrincipal:x.LO,hashCode:x.Fl}))),ha=Bt((e=>(0,x.rC)(e,{hashCode:x.Fl}))),ua=Bt((e=>(0,x.rC)(e,{apiToken:x.LO,hashCode:x.Fl}))),pa=Bt((e=>(0,x.rC)(e,{oauthKey:x.LO,scopeName:x.LO,hashCode:x.Fl}))),ma=Bt((e=>(0,x.rC)(e,{privateKeyVaultReference:x.LO,passPhraseVaultReference:x.LO,publicUserName:x.LO,hashCode:x.Fl}))),_a=Bt((e=>(0,x.rC)(e,{hashCode:x.Fl}))),ga=Bt((e=>(0,x.rC)(e,{hashCode:x.Fl,userNameVaultReference:x.LO,passwordVaultReference:x.LO,baseVaultReference:x.LO}))),Ea=Bt((e=>(0,x.rC)(e,{hashCode:x.Fl,serviceAccountEmail:x.LO,additionalGcpScopes:x.LO}))),fa=Bt((e=>(0,x.rC)(e,{hashCode:x.Fl,vaultReference:x.LO}))),Ta=e=>{(0,x.rC)(e,{from:x.LO,to:x.LO,hashCode:x.Fl})},Ca=Bt((e=>(Ta(e),e))),xa=Bt((e=>(Ta(e),(0,x.rC)(e,{schema:x.LO}),Ca(e.schema),e))),Na=Ht(((e,t)=>((e=>{Qr(e),(0,x.rC)(e,{type:x.LO,timeZone:x.LO,quoteIdentifiers:x.LO})})(e),(0,x.rC)(e,{datasourceSpecification:x.LO,authenticationStrategy:x.LO,postProcessors:x.LO,hashCode:x.Fl}),((e,t)=>{if(e instanceof xi)return ia(e);if(e instanceof Ni)return na(e);if(e instanceof Ai)return aa(e);if(e instanceof Oi)return ra(e);if(e instanceof Si)return oa(e);if(e instanceof yi)return la(e);if(e instanceof Ii)return ca(e);const s=t.plugins.flatMap((e=>e.getExtraDatasourceSpecificationObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.datasourceSpecification,t),((e,t)=>{if(e instanceof hi)return da(e);if(e instanceof ui)return ha(e);if(e instanceof pi)return ua(e);if(e instanceof mi)return pa(e);if(e instanceof _i)return ma(e);if(e instanceof gi)return _a(e);if(e instanceof fi)return ga(e);if(e instanceof Ei)return Ea(e);if(e instanceof Ti)return fa(e);const s=t.plugins.flatMap((e=>e.getExtraAuthenticationStrategyObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e.authenticationStrategy,t),e.postProcessors.forEach((e=>{((e,t)=>{if(e instanceof Ri)return(e=>((e=>{(0,x.rC)(e,{hashCode:x.Fl})})(e),(0,x.rC)(e,{mappers:x.LO}),e.mappers.forEach((e=>{(e=>{e instanceof gn?Ca(e):e instanceof En&&xa(e)})(e)})),e))(e);const s=t.plugins.flatMap((e=>e.getExtraPostProcessorObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}})(e,t)})),e)));class Aa{id}class Oa extends Aa{__parent;assertions=[]}class Sa extends Aa{__parent;tests=[]}class ya extends Oa{serializationFormat;parameters=[];keys=[];get hashCode(){return qt([Jt.SERVICE_TEST,this.id,qt(this.assertions),qt(this.parameters),qt(this.keys),this.serializationFormat??""])}}class Ia extends Oa{query;get hashCode(){return qt([Jt.MAPPING_TEST,this.query,this.id,qt(this.assertions)])}}class va extends Sa{storeTestDatas=[];get hashCode(){return qt([Jt.MAPPING_TEST_SUITE,qt(this.storeTestDatas),this.id,qt(this.tests)])}}class Ra extends Sa{testData;get hashCode(){return qt([Jt.SERVICE_TEST_SUITE,this.id,qt(this.tests),this.testData])}}class Pa{id;parentTest}class wa extends Pa{expected;get hashCode(){return qt([Jt.EQUAL_TO,this.id,es(this.expected)])}accept_TestAssertionVisitor(e){return e.visit_EqualTo(this)}}class La extends Pa{expected;get hashCode(){return qt([Jt.EQUAL_TO_JSON,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToJSON(this)}}class ba extends Pa{expected;get hashCode(){return qt([Jt.EQUAL_TO_TDS,this.id,this.expected])}accept_TestAssertionVisitor(e){return e.visit_EqualToTDS(this)}}class Da{}class Ma extends Da{dataElement;get hashCode(){return qt([Jt.DATA_ELEMENT_REFERENCE,this.dataElement.valueForSerialization??""])}accept_EmbeddedDataVisitor(e){return e.visit_DataElementReference(this)}}class ka extends Da{contentType;data;get hashCode(){return qt([Jt.EXTERNAL_FORMAT_DATA,this.contentType,this.data])}accept_EmbeddedDataVisitor(e){return e.visit_ExternalFormatData(this)}}class Fa extends Da{instances;get hashCode(){return qt([Jt.MODEL_STORE_DATA,qt(Array.from(this.instances.keys()).map((e=>e.path))),es(Array.from(this.instances.values()))])}accept_EmbeddedDataVisitor(e){return e.visit_ModelStoreData(this)}}class ja extends Da{tables=[];accept_EmbeddedDataVisitor(e){return e.visit_RelationalCSVData(this)}get hashCode(){return qt([Jt.RELATIONAL_CSV_DATA_TABLE,qt(this.tables)])}}const Ua=Bt((e=>((0,x.rC)(e,{contentType:x.LO,data:x.LO,hashCode:x.Fl}),e))),Va=Bt((e=>((0,x.rC)(e,{dataElement:x.LO,hashCode:x.Fl}),e))),Ga=Bt((e=>((0,x.rC)(e,{instances:x.LO,hashCode:x.Fl}),e))),$a=Bt((e=>((0,x.rC)(e,{values:x.LO,table:x.LO,schema:x.LO,hashCode:x.Fl}),e))),za=Bt((e=>((0,x.rC)(e,{tables:x.LO,hashCode:x.Fl}),e.tables.forEach($a),e)));function Ba(e,t){if(e instanceof Ma)return Va(e);if(e instanceof ka)return Ua(e);if(e instanceof Fa)return Ga(e);if(e instanceof ja)return za(e);const s=t.plugins.flatMap((e=>e.getExtraEmbeddedDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}const Ha=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{stereotypes:x.LO,taggedValues:x.LO,data:x.LO,_elementHashCode:x.KG}),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),Ba(e.data,t),e)));class Ya{}class Wa extends Ya{_OWNER;func;constructor(e,t){super(),this.func=e,this._OWNER=t}get hashCode(){return qt([Jt.SERVICE_PURE_EXECUTION,this.func])}}class Ka extends Wa{mapping;runtime;constructor(e,t,s,i){super(e,t),this.mapping=s,this.runtime=i}get hashCode(){return qt([Jt.SERVICE_PURE_SINGLE_EXECUTION,super.hashCode,this.mapping?.valueForSerialization??"",this.runtime??""])}}class Za extends Wa{executionKey;executionParameters=[];constructor(e,t,s){super(t,s),this.executionKey=e}get hashCode(){return qt([Jt.SERVICE_PURE_MULTI_EXECUTION,super.hashCode,this.executionKey,qt(this.executionParameters)])}}class Xa{_OWNER;constructor(e){this._OWNER=e}}class qa extends Xa{data;asserts=[];constructor(e,t){super(e),this.data=t}get hashCode(){return qt([Jt.SERVICE_LEGACY_SINGLE_EXECUTION_TEST,this.data,qt(this.asserts)])}}class Ja extends Xa{tests=[];get hashCode(){return qt([Jt.SERVICE_LEGACY_MULTI_EXECUTION_TEST,qt(this.tests)])}}const Qa=Ht(((e,t)=>((0,x.rC)(e,{connectionId:x.LO,testData:x.LO,hashCode:x.Fl}),Ba(e.testData,t),e))),er=Bt((e=>((0,x.rC)(e,{name:x.LO,value:x.LO.ref,hashCode:x.Fl}),e))),tr=Bt((e=>((0,x.rC)(e,{assertion:x.LO,hashCode:x.Fl,id:x.LO}),$s(e.assertion),e))),sr=Bt((e=>((0,x.rC)(e,{assertions:x.LO,description:x.LO,parameters:x.LO,hashCode:x.Fl}),e.assertions.forEach(tr),e.parameters.forEach($s),e))),ir=Ht(((e,t)=>((0,x.rC)(e,{connectionsTestData:x.LO,hashCode:x.Fl}),e.connectionsTestData.forEach((e=>Qa(e,t))),e))),nr=Bt((e=>((0,x.rC)(e,{id:x.LO,serializationFormat:x.LO,assertions:x.LO,parameters:x.LO,keys:x.LO,hashCode:x.Fl}),e.parameters.forEach(er),e.assertions.forEach(Tr),e))),ar=Ht(((e,t)=>((0,x.rC)(e,{id:x.LO,tests:x.LO,testData:x.LO,hashCode:x.Fl}),e.tests.forEach((e=>fr(e,t))),ir(e.testData,t),e))),rr=Bt((e=>((0,x.rC)(e,{parametersValues:x.LO,assert:x.LO,singleExecutionTestParent:x.LO,hashCode:x.Fl}),$s(e.assert),e))),or=Bt((e=>((0,x.rC)(e,{data:x.LO,asserts:x.LO,hashCode:x.Fl}),e.asserts.forEach(rr),e))),lr=Bt((e=>(or(e),(0,x.rC)(e,{key:x.LO}),e))),cr=Bt((e=>((0,x.rC)(e,{tests:x.LO,hashCode:x.Fl}),e.tests.forEach(lr),e))),dr=e=>{(0,x.rC)(e,{func:x.LO}),$s(e.func)},hr=Ht(((e,t)=>(dr(e),(0,x.rC)(e,{runtime:x.LO,hashCode:x.Fl}),e.mapping&&Wt(e.mapping),e.runtime&&uo(e.runtime,t),e))),ur=Ht(((e,t)=>((0,x.rC)(e,{key:x.LO,runtime:x.LO,hashCode:x.Fl}),Wt(e.mapping),uo(e.runtime,t),e))),pr=Ht(((e,t)=>(dr(e),(0,x.rC)(e,{executionKey:x.LO,executionParameters:x.LO,hashCode:x.Fl}),e.executionParameters.forEach((e=>ur(e,t))),e))),mr=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{pattern:x.LO,owners:x.LO,documentation:x.LO,autoActivateUpdates:x.LO,execution:x.LO,test:x.LO,tests:x.LO,postValidations:x.LO,patternParameters:x.Fl,_elementHashCode:x.KG}),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),((e,t)=>{e instanceof Ka?hr(e,t):e instanceof Za&&pr(e,t)})(e.execution,t),e.test&&(e=>{e instanceof qa?or(e):e instanceof Ja&&cr(e)})(e.test),e.tests.forEach((e=>ar(e,t))),e.postValidations.forEach((e=>sr(e))),e))),_r=Bt((e=>((0,x.rC)(e,{id:x.LO,expected:x.LO,hashCode:x.Fl}),e))),gr=Bt((e=>((0,x.rC)(e,{id:x.LO,expected:x.LO,hashCode:x.Fl}),Ua(e.expected),e))),Er=Bt((e=>((0,x.rC)(e,{id:x.LO,expected:x.LO,hashCode:x.Fl}),Ua(e.expected),e)));function fr(e,t){if(e instanceof ya)return nr(e);if(e instanceof Ia)return Nr(e);const s=t.plugins.flatMap((e=>e.getExtraAtomicTestObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e}function Tr(e){return e instanceof wa?_r(e):e instanceof La?Er(e):e instanceof ba?gr(e):e}const Cr=e=>{Yt(e),(0,x.rC)(e,{includes:x.LO}),e.includes.forEach(Wt)},xr=Ht(((e,t)=>((0,x.rC)(e,{store:x.LO,data:x.LO,hashCode:x.Fl}),Ba(e.data,t),e))),Nr=Bt((e=>((0,x.rC)(e,{id:x.LO,query:x.LO,assertions:x.LO,hashCode:x.Fl}),e.assertions.forEach(Tr),e))),Ar=Ht(((e,t)=>((0,x.rC)(e,{id:x.LO,tests:x.LO,storeTestDatas:x.LO,hashCode:x.Fl}),e.tests.forEach((e=>fr(e,t))),e.storeTestDatas.forEach((e=>xr(e,t))),e))),Or=Bt((e=>((0,x.rC)(e,{value:x.LO,valueForSerialization:x.Fl}),Wt(e.ownerReference),e))),Sr=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),yr=Bt((e=>((0,x.rC)(e,{localMappingProperty:x.LO,localMappingPropertyType:x.LO,localMappingPropertyMultiplicity:x.LO,hashCode:x.Fl}),Wt(e.localMappingPropertyType),e))),Ir=(e,t)=>{(0,x.rC)(e,{sourceSetImplementation:x.LO,targetSetImplementation:x.LO}),Do(e.property),Sr(e.sourceSetImplementation),e.targetSetImplementation&&Sr(e.targetSetImplementation),e.localMappingProperty&&yr(e.localMappingProperty)},vr=Ht(((e,t)=>(Ir(e,t),(0,x.rC)(e,{transformer:x.LO,transform:x.LO,explodeProperty:x.LO,hashCode:x.Fl}),e.transformer&&Or(e.transformer),$s(e.transform),e)));class Rr{observerContext;constructor(e){this.observerContext=e}visit_PropertyMapping(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraPropertyMappingObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_PurePropertyMapping(e){vr(e,this.observerContext)}visit_FlatDataPropertyMapping(e){oi(e,this.observerContext)}visit_EmbeddedFlatDataPropertyMapping(e){ri(e,this.observerContext)}visit_RelationalPropertyMapping(e){Zn(e,this.observerContext)}visit_FlatDataAssociationPropertyMapping(e){qs(e,this.observerContext)}visit_EmbeddedRelationalPropertyMapping(e){qn(e,this.observerContext)}visit_InlineEmbeddedRelationalPropertyMapping(e){Jn(e,this.observerContext)}visit_OtherwiseEmbeddedRelationalPropertyMapping(e){Qn(e,this.observerContext)}visit_AggregationAwarePropertyMapping(e){}visit_XStorePropertyMapping(e){}}const Pr=(e,t)=>(e.accept_PropertyMappingVisitor(new Rr(t)),e),wr=Bt((e=>(0,x.rC)(e,{isDefault:x.Fl,valueForSerialization:x.Fl}))),Lr=Bt((e=>(0,x.rC)(e,{valueForSerialization:x.Fl}))),br=e=>{(0,x.rC)(e,{root:x.LO}),Wt(e.class),wr(e.id),Lr(e.root)},Dr=Bt((e=>((0,x.rC)(e,{setImplementation:x.LO,class:x.LO,properties:x.LO}),e))),Mr=(e,t)=>{br(e),(0,x.rC)(e,{mappingClass:x.LO,propertyMappings:x.LO}),e.mappingClass&&Dr(e.mappingClass),e.propertyMappings.forEach((e=>Pr(e,t)))},kr=Bt((e=>((0,x.rC)(e,{}),Sr(e.setImplementation),e))),Fr=e=>{br(e),(0,x.rC)(e,{parameters:x.LO,operation:x.LO,hashCode:x.Fl}),e.parameters.forEach(kr)},jr=Bt((e=>(Fr(e),e))),Ur=Bt((e=>(Fr(e),(0,x.rC)(e,{validationFunction:x.LO}),$s(e.validationFunction),e))),Vr=Ht(((e,t)=>(Mr(e,t),(0,x.rC)(e,{filter:x.LO,hashCode:x.Fl}),e.srcClass&&Wt(e.srcClass),e.filter&&$s(e.filter),e)));class Gr{observerContext;constructor(e){this.observerContext=e}visit_SetImplementation(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraSetImplementationObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_MergeOperationSetImplementation(e){Ur(e)}visit_OperationSetImplementation(e){jr(e)}visit_PureInstanceSetImplementation(e){Vr(e,this.observerContext)}visit_FlatDataInstanceSetImplementation(e){ai(e,this.observerContext)}visit_EmbeddedFlatDataSetImplementation(e){}visit_RelationalInstanceSetImplementation(e){ea(e,this.observerContext)}visit_RootRelationalInstanceSetImplementation(e){ta(e,this.observerContext)}visit_AggregationAwareSetImplementation(e){}visit_TEMPORARY__UnresolvedSetImplementation(e){}}const $r=(e,t)=>(e.accept_SetImplementationVisitor(new Gr(t)),e),zr=Bt((e=>((0,x.rC)(e,{original:x.LO,substitute:x.LO}),Wt(e.original),Wt(e.substitute),e))),Br=Bt((e=>((0,x.rC)(e,{included:x.LO,storeSubstitutions:x.LO}),Wt(e.included),e.storeSubstitutions.forEach(zr),e))),Hr=Bt((e=>(0,x.rC)(e,{value:x.LO}))),Yr=Bt((e=>((0,x.rC)(e,{sourceValues:x.LO,hashCode:x.Fl}),vo(e.enum),e.sourceValues.forEach(Hr),e))),Wr=Bt((e=>((0,x.rC)(e,{sourceType:x.LO,enumValueMappings:x.LO,hashCode:x.Fl}),Wt(e.enumeration),wr(e.id),e.sourceType&&Wt(e.sourceType),e.enumValueMappings.forEach(Yr),e))),Kr=Ht(((e,t)=>((0,x.rC)(e,{id:x.LO,stores:x.LO,propertyMappings:x.LO,hashCode:x.Fl}),Wt(e.association),wr(e.id),e.stores.forEach(Wt),e.propertyMappings.forEach((e=>Pr(e,t))),e))),Zr=Bt((e=>((0,x.rC)(e,{inputType:x.LO,data:x.LO,hashCode:x.Fl}),Wt(e.sourceClass),e))),Xr=Bt((e=>(0,x.rC)(e,{expectedOutput:x.LO,hashCode:x.Fl}))),qr=Ht(((e,t)=>((0,x.rC)(e,{name:x.LO,query:x.LO,inputData:x.LO,assert:x.LO,hashCode:x.Fl}),$s(e.query),e.inputData.forEach((e=>((e,t)=>{if(e instanceof Us)return Zr(e);if(e instanceof Ms)return li(e);if(e instanceof Vs)return sa(e);const s=t.plugins.flatMap((e=>e.getExtraMappingTestInputDataObservers?.()??[]));for(const i of s){const s=i(e,t);if(s)return s}return e})(e,t))),((e,t)=>{e instanceof Ps&&Xr(e)})(e.assert),e))),Jr=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{includes:x.LO,classMappings:x.LO,enumerationMappings:x.LO,associationMappings:x.LO,test:x.LO,tests:x.LO,_elementHashCode:x.KG}),e.includes.forEach(Br),e.classMappings.forEach((e=>$r(e,t))),e.enumerationMappings.forEach(Wr),e.associationMappings.forEach((e=>Kr(e,t))),e.test.forEach((e=>qr(e,t))),e.tests.forEach((e=>function(e,t){return e instanceof Ra?ar(e,t):e instanceof va?Ar(e,t):e}(e,t))),e))),Qr=e=>{(0,x.rC)(e,{store:x.LO}),Wt(e.store)},eo=Bt((e=>(Qr(e),(0,x.rC)(e,{hashCode:x.Fl}),e))),to=Bt((e=>(Qr(e),(0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),Wt(e.class),e))),so=Bt((e=>(Qr(e),(0,x.rC)(e,{url:x.LO,hashCode:x.Fl}),Wt(e.class),e))),io=Bt((e=>(Qr(e),(0,x.rC)(e,{mappings:x.LO,hashCode:x.Fl}),e.mappings.forEach(Wt),e)));class no{observerContext;constructor(e){this.observerContext=e}visit_Connection(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraConnectionObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_ConnectionPointer(e){eo(e)}visit_ModelChainConnection(e){io(e)}visit_JsonModelConnection(e){to(e)}visit_XmlModelConnection(e){so(e)}visit_FlatDataConnection(e){ci(e)}visit_RelationalDatabaseConnection(e){Na(e,this.observerContext)}}const ao=(e,t)=>(e.accept_ConnectionVisitor(new no(t)),e),ro=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{connectionValue:x.LO,_elementHashCode:x.KG}),ao(e.connectionValue,t),e))),oo=Ht(((e,t)=>((0,x.rC)(e,{id:x.LO,connection:x.LO,hashCode:x.Fl}),ao(e.connection,t),e))),lo=Ht(((e,t)=>((0,x.rC)(e,{storeConnections:x.LO,hashCode:x.Fl}),Wt(e.store),e.storeConnections.forEach((e=>oo(e,t))),e))),co=Ht(((e,t)=>((0,x.rC)(e,{mappings:x.LO,connections:x.LO,hashCode:x.Fl}),e.mappings.forEach(Wt),e.connections.forEach((e=>lo(e,t))),e))),ho=Bt((e=>((0,x.rC)(e,{hashCode:x.Fl}),Wt(e.packageableRuntime),e))),uo=(e,t)=>e instanceof bs?ho(e):e instanceof Ls?co(e,t):e,po=Ht(((e,t)=>(Yt(e),(0,x.rC)(e,{runtimeValue:x.LO,_elementHashCode:x.KG}),co(e.runtimeValue,t),e)));class mo{observerContext;constructor(e){this.observerContext=e}visit_PackageableElement(e){const t=this.observerContext.plugins.flatMap((e=>e.getExtraElementObservers?.()??[]));for(const s of t)if(s(e,this.observerContext))return}visit_Package(e){go(e,this.observerContext)}visit_SectionIndex(e){Ao(e)}visit_PrimitiveType(e){}visit_Profile(e){yo(e)}visit_Enumeration(e){Ro(e)}visit_Measure(e){wo(e)}visit_Class(e){ko(e)}visit_Association(e){Fo(e)}visit_ConcreteFunctionDefinition(e){jo(e)}visit_FlatData(e){ii(e)}visit_Database(e){Kn(e,this.observerContext)}visit_Mapping(e){Jr(e,this.observerContext)}visit_Service(e){mr(e,this.observerContext)}visit_PackageableRuntime(e){po(e,this.observerContext)}visit_PackageableConnection(e){ro(e,this.observerContext)}visit_FileGenerationSpecification(e){xs(e)}visit_GenerationSpecification(e){As(e)}visit_DataElement(e){Ha(e,this.observerContext)}}const _o=Ht(((e,t)=>(e.accept_PackageableElementVisitor(new mo(t)),e))),go=Ht(((e,t)=>((e=>{Yt(e),(0,x.rC)(e,{children:x.LO,hashCode:x.KG})})(e),e.children.forEach((e=>{e instanceof us?go(e,t):_o(e,t)})),e))),Eo=Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),Wt(e.ownerReference),e))),fo=Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),e))),To=Bt((e=>((0,x.rC)(e,{value:x.LO,hashCode:x.Fl}),fo(e.tag),e))),Co=Bt((e=>(0,x.rC)(e,{rawType:x.LO}))),xo=Bt((e=>((0,x.rC)(e,{value:x.LO}),Co(e.value),Wt(e.ownerReference),e))),No=Bt((e=>((0,x.rC)(e,{parserName:x.LO,elements:x.LO}),e instanceof ms?(0,x.rC)(e,{imports:x.LO,hashCode:x.Fl}):e instanceof _s&&(0,x.rC)(e,{hashCode:x.Fl}),e))),Ao=Bt((e=>(Yt(e),(0,x.rC)(e,{sections:x.LO,_elementHashCode:x.KG}),e.sections.forEach(No),e))),Oo=Bt((e=>(0,x.rC)(e,{value:x.LO}))),So=Bt((e=>(0,x.rC)(e,{value:x.LO}))),yo=Bt((e=>(Yt(e),(0,x.rC)(e,{p_stereotypes:x.LO,p_tags:x.LO,_elementHashCode:x.KG}),e.p_stereotypes.forEach(Oo),e.p_tags.forEach(So),e))),Io=Bt((e=>((0,x.rC)(e,{name:x.LO,stereotypes:x.LO,taggedValues:x.LO,hashCode:x.Fl}),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),vo=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),Ro=Bt((e=>(Yt(e),(0,x.rC)(e,{values:x.LO,stereotypes:x.LO,taggedValues:x.LO,_elementHashCode:x.KG}),e.values.forEach(Io),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),Po=Bt((e=>((0,x.rC)(e,{measure:x.LO,conversionFunction:x.LO,hashCode:x.Fl}),e.conversionFunction&&$s(e.conversionFunction),e))),wo=Bt((e=>(Yt(e),(0,x.rC)(e,{canonicalUnit:x.LO,nonCanonicalUnits:x.LO,_elementHashCode:x.KG}),e.canonicalUnit&&Po(e.canonicalUnit),e.nonCanonicalUnits.forEach(Po),e))),Lo=Bt((e=>((0,x.rC)(e,{name:x.LO,multiplicity:x.LO,stereotypes:x.LO,taggedValues:x.LO,hashCode:x.Fl}),xo(e.genericType),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),bo=Bt((e=>((0,x.rC)(e,{name:x.LO,multiplicity:x.LO,stereotypes:x.LO,taggedValues:x.LO,body:x.LO.ref,parameters:x.LO.ref,hashCode:x.Fl}),xo(e.genericType),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),Do=Bt((e=>((0,x.rC)(e,{value:x.LO,pointerHashCode:x.Fl}),Wt(e.ownerReference),e))),Mo=Bt((e=>((0,x.rC)(e,{name:x.LO,functionDefinition:x.LO,externalId:x.LO,enforcementLevel:x.LO,messageFunction:x.LO,hashCode:x.Fl}),$s(e.functionDefinition),e.messageFunction&&$s(e.messageFunction),e))),ko=Bt((e=>(Yt(e),(0,x.rC)(e,{_subclasses:x.LO,properties:x.LO,propertiesFromAssociations:x.LO,derivedProperties:x.LO,generalizations:x.LO,constraints:x.LO,stereotypes:x.LO,taggedValues:x.LO,dispose:x.KG,_elementHashCode:x.KG}),e.properties.forEach(Lo),e.propertiesFromAssociations.forEach(Lo),e.derivedProperties.forEach(bo),e.generalizations.forEach(xo),e.constraints.forEach(Mo),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),Fo=Bt((e=>(Yt(e),(0,x.rC)(e,{properties:x.LO,stereotypes:x.LO,taggedValues:x.LO,derivedProperties:x.LO,_elementHashCode:x.KG}),e.properties.forEach(Lo),e.derivedProperties.forEach(bo),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),jo=Bt((e=>(Yt(e),(0,x.rC)(e,{functionName:x.LO,returnMultiplicity:x.LO,parameters:x.LO.shallow,expressionSequence:x.LO.ref,stereotypes:x.LO,taggedValues:x.LO,_elementHashCode:x.KG}),e.parameters.forEach(zs),Wt(e.returnType),e.stereotypes.forEach(Eo),e.taggedValues.forEach(To),e))),Uo=Bt((e=>e instanceof cs?Ro(e):e instanceof ds?Po(e):e instanceof os?ko(e):e instanceof hs?wo(e):e)),Vo=(Bt((e=>e instanceof cs?Ro(e):e instanceof ds?Po(e):e)),Bt((e=>(0,x.rC)(e,{_dummyObservable:x.LO})))),Go=Bt((e=>((0,x.rC)(e,{value:x.LO}),Wt(e.ownerReference),e))),$o=Bt((e=>(Vo(e),(0,x.rC)(e,{id:x.LO,hideProperties:x.LO,hideTaggedValues:x.LO,hideStereotypes:x.LO,hashCode:x.Fl}),Wt(e.class),e))),zo=Bt((e=>(Go(e.classView),e))),Bo=Bt((e=>((0,x.rC)(e,{path:x.LO,pathForSerialization:x.Fl}),zo(e.from),zo(e.to),e))),Ho=Bt((e=>(Bo(e),(0,x.rC)(e,{hashCode:x.Fl}),e))),Yo=Bt((e=>(Bo(e),(0,x.rC)(e,{hashCode:x.Fl}),Do(e.property),Wt(e.association),e))),Wo=Bt((e=>(Bo(e),(0,x.rC)(e,{hashCode:x.Fl}),Do(e.property),e))),Ko=Bt((e=>(Yt(e),(0,x.rC)(e,{classViews:x.LO,associationViews:x.LO,generalizationViews:x.LO,propertyViews:x.LO,_elementHashCode:x.KG}),e.classViews.forEach($o),e.associationViews.forEach(Yo),e.generalizationViews.forEach(Ho),e.propertyViews.forEach(Wo),e)));var Zo;!function(e){e.DIAGRAM="DIAGRAM",e.CLASS_VIEW="CLASS_VIEW",e.PROPERTY_VIEW="PROPERTY_VIEW",e.ASSOCIATION_VIEW="ASSOCIATION_VIEW",e.PROPERTY_HOLDER_VIEW="PROPERTY_HOLDER_VIEW",e.GENERALIZATION_VIEW="GENERALIZATION_VIEW",e.RELATIONSHIP_VIEW="RELATIONSHIP_VIEW",e.POINT="POINT",e.RECTANGLE="RECTANGLE",e.POSITIONED_RECTANGLE="POSITIONED_RECTANGLE"}(Zo=Zo||(Zo={}));class Xo extends as{classViews=[];associationViews=[];generalizationViews=[];propertyViews=[];get _elementHashCode(){return qt([Zo.DIAGRAM,this.path,qt(this.classViews),qt(this.generalizationViews),qt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}const qo="Diagram";class Jo extends zt{constructor(){super($t.Rw.LW,$t.i8)}getExtraPureGrammarParserNames(){return["Diagram"]}getExtraPureGrammarKeywords(){return[qo]}getExtraPureGrammarElementLabelers(){return[e=>{if(e instanceof Xo)return qo}]}getExtraElementObservers(){return[(e,t)=>{if(e instanceof Xo)return Ko(e)}]}}class Qo{package;name;get path(){return`${this.package}${Ee}${this.name}`}get hashCode(){return qt([Jt.PACKAGEABLE_ELEMENT,this.path])}}class el extends Qo{classViews=[];propertyViews=[];generalizationViews=[];get hashCode(){return qt([Zo.DIAGRAM,this.path,qt(this.classViews),qt(this.generalizationViews),qt(this.propertyViews)])}accept_PackageableElementVisitor(e){return e.visit_PackageableElement(this)}}class tl{rectangle;position;get hashCode(){return qt([Zo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class sl extends tl{id;class;hideProperties;hideTaggedValues;hideStereotypes;get hashCode(){return qt([Zo.CLASS_VIEW,super.hashCode,this.id,this.class,this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class il{x;y;get hashCode(){return qt([Zo.POINT,this.x.toString(),this.y.toString()])}}class nl{width;height;get hashCode(){return qt([Zo.RECTANGLE,this.width.toString(),this.height.toString()])}}class al{points=[]}class rl{sourceView;targetView;line;get hashCode(){return qt([Zo.RELATIONSHIP_VIEW,this.sourceView,this.targetView,qt(this.line.points)])}}class ol extends rl{property;get hashCode(){return qt([Zo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property])}}class ll extends ol{get hashCode(){return qt([Zo.PROPERTY_VIEW,super.hashCode])}}class cl extends rl{get hashCode(){return qt([Zo.GENERALIZATION_VIEW,super.hashCode])}}class dl{lowerBound=0;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return qt([Jt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new dl(0,0);static ZERO_ONE=new dl(0,1);static ZERO_MANY=new dl(0,void 0);static ONE=new dl(1,1);static ONE_MANY=new dl(1,void 0)}new He((0,Be.yu)(class{sourceId;startLine;startColumn;endLine;endColumn},{sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)()})),(0,Be.yu)(class{type;path;constructor(e,t){this.type=e,this.path=t}get hashCode(){return qt([Jt.PACKAGEABLE_ELEMENT_POINTER,this.type,this.path])}},{path:(0,Be.Ru)(),type:(0,Be.Ru)()});const hl=(0,Be.yu)(dl,{lowerBound:(0,Be.Ru)(),upperBound:(0,Be.jt)((0,Be.Ru)())});class ul{class;property;get hashCode(){return qt([Jt.PROPERTY_POINTER,this.property,this.class??""])}}class pl{}class ml{queryTimeOutInSeconds=null;enableConstraints=!0}var _l,gl;!function(e){e.BASE_EXECUTION_CONTEXT="BaseExecutionContext"}(_l||(_l={})),function(e){e.LAMBDA="lambda",e.VARIABLE="var",e.CINTEGER="integer",e.CDECIMAL="decimal",e.CSTRING="string",e.CBOOLEAN="boolean",e.CFLOAT="float",e.CDATETIME="dateTime",e.CSTRICTDATE="strictDate",e.CSTRICTTIME="strictTime",e.CLATESTDATE="latestDate"}(gl=gl||(gl={})),(0,Be.yu)(class extends ml{},{_type:Ze(_l.BASE_EXECUTION_CONTEXT),queryTimeOutInSeconds:(0,Be.Ru)(),enableConstraints:(0,Be.Ru)()});const El=(0,Be.yu)(class extends pl{body;parameters;get hashCode(){return qt([Jt.RAW_LAMBDA,ts(this.parameters,this.body)])}accept_RawValueSpecificationVisitor(e){return e.visit_Lambda(this)}},{_type:Ze(gl.LAMBDA),body:(0,Be.LZ)(),parameters:(0,Be.LZ)()}),fl=(0,Be.yu)(class extends pl{class;name;multiplicity;get hashCode(){return qt([Jt.RAW_VARIABLE,this.class,this.name,this.multiplicity])}accept_RawValueSpecificationVisitor(e){return e.visit_Variable(this)}},{_type:Ze(gl.VARIABLE),class:(0,Be.Ru)(),multiplicity:Ye(hl),name:(0,Be.Ru)()});(0,Be.yu)(class extends pl{multiplicity=dl.ONE;type;value;get hashCode(){return qt([Jt.RAW_INSTANCE_VALUE,this.type,this.multiplicity,this.value??""])}accept_RawValueSpecificationVisitor(e){return e.visit_PrimitiveInstanceValue(this)}},{type:(0,Be.bm)("_type",(0,Be.PG)((e=>{switch(e){case xe.INTEGER:return gl.CINTEGER;case xe.DECIMAL:return gl.CDECIMAL;case xe.STRING:return gl.CSTRING;case xe.BOOLEAN:return gl.CBOOLEAN;case xe.FLOAT:return gl.CFLOAT;case xe.DATETIME:return gl.CDATETIME;case xe.STRICTDATE:return gl.CSTRICTDATE;case xe.STRICTTIME:return gl.CSTRICTTIME;case xe.LATESTDATE:return gl.CLATESTDATE;default:throw new U(`Can't serialize raw instance value type '${e}'`)}}),(e=>{switch(e){case gl.CINTEGER:return xe.INTEGER;case gl.CDECIMAL:return xe.DECIMAL;case gl.CSTRING:return xe.STRING;case gl.CBOOLEAN:return xe.BOOLEAN;case gl.CFLOAT:return xe.FLOAT;case gl.CDATETIME:return xe.DATETIME;case gl.CSTRICTDATE:return xe.STRICTDATE;case gl.CSTRICTTIME:return xe.STRICTTIME;case gl.CLATESTDATE:return xe.LATESTDATE;default:throw new U(`Can't deserialize raw value instance value type '${e}'`)}}))),value:(0,Be.jt)((0,Be.Ru)())});const Tl=(0,Be.yu)(ul,{class:(0,Be.jt)((0,Be.Ru)()),property:(0,Be.Ru)()}),Cl=(0,Be.yu)(class{profile;value;get hashCode(){return qt([Jt.STEREOTYPE_POINTER,this.value,this.profile])}},{profile:(0,Be.Ru)(),value:(0,Be.Ru)()}),xl=(0,Be.yu)(class{profile;value;get hashCode(){return qt([Jt.TAG_POINTER,this.value,this.profile])}},{profile:(0,Be.Ru)(),value:(0,Be.Ru)()}),Nl=(0,Be.yu)(class{tag;value;get hashCode(){return qt([Jt.TAGGED_VALUE,this.tag,this.value])}},{tag:Ye(xl),value:(0,Be.Ru)()}),Al=((0,Be.yu)(class extends Qo{stereotypes=[];tags=[];get hashCode(){return qt([Jt.PROFILE,this.path,qt(this.stereotypes),qt(this.tags)])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}},{_type:Ze("profile"),name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ru)()),tags:(0,Be.pb)((0,Be.Ru)())}),(0,Be.yu)(class{value;stereotypes=[];taggedValues=[];get hashCode(){return qt([Jt.ENUM_VALUE,this.value,qt(this.stereotypes),qt(this.taggedValues)])}},{stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1}))),value:(0,Be.Ru)()})),Ol=((0,Be.yu)(class extends Qo{values=[];stereotypes=[];taggedValues=[];get hashCode(){return qt([Jt.ENUMERATION,this.path,qt(this.values),qt(this.stereotypes),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Enumeration(this)}},{_type:Ze("Enumeration"),name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1}))),values:(0,Be.pb)(Ye(Al))}),(0,Be.yu)(class extends Qo{measure;conversionFunction;get hashCode(){return qt([Jt.UNIT,this.measure,this.conversionFunction??""])}accept_PackageableElementVisitor(e){throw new U}},{_type:Ze("unit"),conversionFunction:(0,Be.jt)(Ye(El)),measure:(0,Be.Ru)(),name:(0,Be.Ru)(),package:(0,Be.Ru)()})),Sl=((0,Be.yu)(class extends Qo{canonicalUnit;nonCanonicalUnits=[];get hashCode(){return qt([Jt.MEASURE,this.path,this.canonicalUnit??"",qt(this.nonCanonicalUnits)])}accept_PackageableElementVisitor(e){return e.visit_Measure(this)}},{_type:Ze("measure"),canonicalUnit:(0,Be.jt)(Ye(Ol)),name:(0,Be.Ru)(),nonCanonicalUnits:(0,Be.pb)(Ye(Ol)),package:(0,Be.Ru)()}),(0,Be.yu)(class{name;type;multiplicity;aggregation;stereotypes=[];taggedValues=[];get hashCode(){return qt([Jt.PROPERTY,this.name,this.multiplicity,this.type,this.aggregation??"",qt(this.stereotypes),qt(this.taggedValues)])}},{aggregation:(0,Be.jt)((0,Be.Ru)()),multiplicity:Ye(hl),name:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1}))),type:(0,Be.Ru)()})),yl=(0,Be.yu)(class{name;returnType;returnMultiplicity;stereotypes=[];taggedValues=[];body;parameters;get hashCode(){return qt([Jt.DERIVED_PROPERTY,this.name,this.returnMultiplicity,this.returnType,qt(this.stereotypes),qt(this.taggedValues),ts(this.parameters,this.body)])}},{body:(0,Be.LZ)(),name:(0,Be.Ru)(),parameters:(0,Be.LZ)(),returnMultiplicity:Ye(hl),returnType:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1})))}),Il=(0,Be.yu)(class{name;functionDefinition;externalId;enforcementLevel;messageFunction;get hashCode(){return qt([Jt.CONSTRAINT,this.name,this.functionDefinition,this.externalId??"",this.enforcementLevel??"",this.messageFunction??""])}},{enforcementLevel:(0,Be.jt)((0,Be.Ru)()),externalId:(0,Be.jt)((0,Be.Ru)()),functionDefinition:Ye(El),messageFunction:(0,Be.jt)(Ye(El)),name:(0,Be.Ru)()}),vl=((0,Be.yu)(class extends Qo{superTypes=[];properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];constraints=[];get hashCode(){return qt([Jt.CLASS,this.path,qt(this.properties),qt(this.derivedProperties),qt(this.superTypes),qt(this.constraints),qt(this.stereotypes),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Class(this)}},{_type:Ze("class"),constraints:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Il,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Il,e)),{skipIfEmpty:!1}))),name:(0,Be.Ru)(),originalMilestonedProperties:(0,Be.PG)((e=>Ke(e,(e=>Be.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>Be.AM),{skipIfEmpty:!1}))),package:(0,Be.Ru)(),properties:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Sl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Sl,e)),{skipIfEmpty:!1}))),derivedProperties:(0,Be.bm)("qualifiedProperties",(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(yl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(yl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),superTypes:(0,Be.PG)((e=>Ke(e,(e=>e),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>e),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1})))}),(0,Be.yu)(class extends Qo{properties=[];derivedProperties=[];stereotypes=[];taggedValues=[];get hashCode(){return qt([Jt.ASSOCIATION,this.path,qt(this.properties),qt(this.derivedProperties),qt(this.stereotypes),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}},{_type:Ze("association"),name:(0,Be.Ru)(),originalMilestonedProperties:(0,Be.PG)((e=>Ke(e,(e=>Be.AM),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>Be.AM),{skipIfEmpty:!1}))),package:(0,Be.Ru)(),properties:(0,Be.pb)(Ye(Sl)),derivedProperties:(0,Be.bm)("qualifiedProperties",(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(yl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(yl,e)),{skipIfEmpty:!1})))),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1})))}),(0,Be.yu)(class extends Qo{parameters=[];body=[];preConstraints=[];postConstraints=[];returnType;returnMultiplicity;taggedValues=[];stereotypes=[];get hashCode(){return qt([Jt.FUNCTION,this.path,qt(this.parameters),this.returnType,qt(this.taggedValues),qt(this.stereotypes),ts(void 0,this.body)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}},{_type:Ze("function"),body:(0,Be.pb)((0,Be.LZ)()),name:(0,Be.Ru)(),package:(0,Be.Ru)(),parameters:(0,Be.pb)(Ye(fl)),postConstraints:(0,Be.pb)((0,Be.Ru)()),preConstraints:(0,Be.pb)((0,Be.Ru)()),returnMultiplicity:Ye(hl),returnType:(0,Be.Ru)(),stereotypes:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Cl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Cl,e)),{skipIfEmpty:!1}))),taggedValues:(0,Be.PG)((e=>Ke(e,(e=>(0,Be.qC)(Nl,e)),{skipIfEmpty:!0,INTERNAL__forceReturnEmptyInTest:!0})),(e=>We(e,(e=>(0,Be.vB)(Nl,e)),{skipIfEmpty:!1})))}),"diagram"),Rl=(0,Be.yu)(il,{x:(0,Be.Ru)(),y:(0,Be.Ru)()}),Pl=(0,Be.yu)(nl,{height:(0,Be.Ru)(),width:(0,Be.Ru)()}),wl=(0,Be.yu)(al,{points:(0,Be.pb)(Ye(Rl))}),Ll=(0,Be.yu)(sl,{class:(0,Be.Ru)(),hideProperties:(0,Be.jt)((0,Be.Ru)()),hideStereotypes:(0,Be.jt)((0,Be.Ru)()),hideTaggedValues:(0,Be.jt)((0,Be.Ru)()),id:(0,Be.Ru)(),position:Ye(Rl),rectangle:Ye(Pl)}),bl=(0,Be.yu)(ll,{line:Ye(wl),property:Ye(Tl),sourceView:(0,Be.Ru)(),targetView:(0,Be.Ru)()}),Dl=(0,Be.yu)(cl,{line:Ye(wl),sourceView:(0,Be.Ru)(),targetView:(0,Be.Ru)()}),Ml=(0,Be.yu)(el,{_type:Ze(vl),classViews:(0,Be.pb)(Ye(Ll)),generalizationViews:(0,Be.pb)(Ye(Dl)),name:(0,Be.Ru)(),package:(0,Be.Ru)(),propertyViews:(0,Be.pb)(Ye(bl))});class kl extends o{_$nominalTypeBrand;install(e){e.registerPureProtocolProcessorPlugin(this)}}var Fl=s(95903);const jl=e=>H((0,Fl.Z)(e.split(Ee))),Ul=e=>{const t=e.lastIndexOf(Ee);return-1===t?void 0:e.substring(0,t)},Vl=(e,t)=>{const s=e.lastIndexOf(Ee);return-1===s?[t??"",e]:[e.substring(0,s),e.substring(s+Ee.length,e.length)]},Gl=(e,t)=>`${e?`${e}${Ee}`:""}${t}`,$l=(e,t)=>{e.children.push(t),t.package=e},zl=(e,t)=>{e.children=e.children.filter((e=>e!==t))},Bl=(e,t,s,i)=>{const n=t.indexOf(Ee),a=-1===n?t:t.substring(0,n);let r;if(r=e.children.find((e=>e instanceof us&&e.name===a)),!r){if(!s)throw new $(`Can't find child package '${a}' in package '${e.path}'`);q(!Te.includes(a),`Can't create package with reserved name '${a}'`),r=new us(a),r.package=e,e.children.push(r)}return i&&i.set(Gl(e.path,a),r),-1!==n?Bl(r,t.substring(n+Ee.length),s,i):r},Hl=(e,t,s,i)=>{if(i){const n=i.get(Gl(e.path,t));if(n)return n;let a=t;for(;""!==a;){const n=Gl(e.path,a),r=i.get(n);if(r)return Bl(r,t.substring(a.length+Ee.length,t.length),s,i);const o=a.lastIndexOf(Ee);a=-1!==o?a.substring(0,o):""}}return Bl(e,t,s,i)},Yl=(e,t,s)=>(Z(t,"Package path is required"),Hl(e.root,t,!0,s)),Wl=(e,t)=>K(e.rawType,t),Kl=e=>{const t=new Set;t.add(e);const s=e=>{e.generalizations.forEach((e=>{const i=Wl(e.value,os);t.has(i)||(t.add(i),s(i))}))};return s(e),t.delete(e),Array.from(t)},Zl=e=>e.properties.concat(e.propertiesFromAssociations).concat(e.derivedProperties),Xl=(e,t)=>e===t?e.toString():0===e&&void 0===t?"MANY":`$${e}_${t??"MANY"}$`,ql=(e,t)=>`${H(e,"Package path is required")}${Ee}${H(t,"Name is required")}`;class Jl{elementClassName;_class;prerequisites=[];firstPass;secondPass;thirdPass;fourthPass;fifthPass;constructor(e){this.elementClassName=e.elementClassName,this._class=e._class,this.prerequisites=e.prerequisites??[],this.firstPass=e.firstPass,this.secondPass=e.secondPass,this.thirdPass=e.thirdPass,this.fourthPass=e.fourthPass,this.fifthPass=e.fifthPass}getElementProtocolClass(){return this._class}getPrerequisiteElementProtocolClasses(){return this.prerequisites}runFirstPass(e,t,s,i){Z(e.package,"Element 'package' field is missing or empty"),Z(e.name,"Element 'name' field is missing or empty"),((e,t,s)=>{if(s){if(s.has(e))throw new $(`Element '${e}' already exists`);s.add(e)}else q(!t.graph.getNullableElement(e),`Element '${e}' already exists`)})(ql(e.package,e.name),t,i);const n=this.firstPass(e,t);return $l(Yl(t.currentSubGraph,e.package,s),n),n}runSecondPass(e,t){this.secondPass?.(e,t)}runThirdPass(e,t){this.thirdPass?.(e,t)}runFourthPass(e,t){this.fourthPass?.(e,t)}runFifthPass(e,t){this.fifthPass?.(e,t)}}const Ql=e=>e.classView.value.id,ec=e=>{const t=new ll,s=new al;return s.points=e.pathForSerialization,t.line=s,t.property=((e,t)=>{const s=new ul;return s.class=t?.isTransformingEmbeddedPropertyMapping||t?.isTransformingLocalPropertyMapping?void 0:e.ownerReference.valueForSerialization??"",s.property=e.value.name,s})(e.property),t.sourceView=Ql(e.from),t.targetView=Ql(e.to),t},tc=e=>{const t=new cl,s=new al;return s.points=e.pathForSerialization,t.line=s,t.sourceView=Ql(e.from),t.targetView=Ql(e.to),t},sc=e=>{const t=new sl;return t.class=e.class.valueForSerialization??"",t.hideProperties=e.hideProperties,t.hideStereotypes=e.hideStereotypes,t.hideTaggedValues=e.hideTaggedValues,t.id=e.id,t.position=((e,t)=>{const s=new il;return s.x=e,s.y=t,s})(e.position.x,e.position.y),t.rectangle=((e,t)=>{const s=new nl;return s.height=e,s.width=t,s})(e.rectangle.height,e.rectangle.width),t};class ic{x;y;constructor(e,t){this.x=e,this.y=t}get hashCode(){return qt([Zo.POINT,this.x.toString(),this.y.toString()])}}class nc{width;height;constructor(e,t){this.width=e,this.height=t}get hashCode(){return qt([Zo.RECTANGLE,this.width.toString(),this.height.toString()])}}class ac{_dummyObservable={};position;rectangle;constructor(e,t){this.position=e,this.rectangle=t}center=()=>new ic(this.position.x+this.rectangle.width/2,this.position.y+this.rectangle.height/2);contains(e,t){const s=this.normalizeBox(this);return e>s.position.x&&e<s.position.x+s.rectangle.width&&t>s.position.y&&t<s.position.y+s.rectangle.height}normalizeBox(e){let t=e;return e.rectangle.width<0&&(t=new ac(new ic(e.position.x+e.rectangle.width,e.position.y),new nc(-e.rectangle.width,e.rectangle.height))),e.rectangle.height<0&&(t=new ac(new ic(e.position.x,e.position.y+e.rectangle.height),new nc(e.rectangle.width,-e.rectangle.height))),t}get hashCode(){return this._dummyObservable,qt([Zo.POSITIONED_RECTANGLE,this.position,this.rectangle])}}class rc extends ac{_OWNER;class;id;hideProperties;hideTaggedValues;hideStereotypes;constructor(e,t,s){super(new ic(0,0),new nc(0,0)),this._OWNER=e,this.id=t,this.class=s}get hashCode(){return qt([Zo.CLASS_VIEW,super.hashCode,this.id,this.class.valueForSerialization??"",this.hideProperties?.toString()??"",this.hideTaggedValues?.toString()??"",this.hideStereotypes?.toString()??""])}}class oc{_offsetX;_offsetY;classView;constructor(e){this.classView=e}}class lc extends Es{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class cc extends lc{ownerReference;constructor(e){const t=Ts.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new cc(e)}}class dc{_OWNER;from;to;path=[];constructor(e,t,s){this._OWNER=e,this.from=new oc(cc.create(t)),this.to=new oc(cc.create(s))}computeEdgeEndpoint(e,t=!0){const s=e.classView.value,i=e.classView.value.center(),n=i.x+(e._offsetX??0),a=i.y+(e._offsetY??0);return s.contains(n,a)?new ic(n,a):(t&&(e._offsetX=0,e._offsetY=0),new ic(i.x,i.y))}buildFullPath(e=!0){return[this.computeEdgeEndpoint(this.from,e),...this.path,this.computeEdgeEndpoint(this.to,e)]}static pruneUnnecessaryInsidePoints=(e,t,s)=>{if(!e.length)return[];let i=0,n=e[i];for(;i<e.length-1&&t.contains(n.x,n.y);)i++,n=e[i];let a=e.length-1,r=e[a];for(;a>0&&s.contains(r.x,r.y);)a--,r=e[a];return e.slice(i-1,a+2)};get pathForSerialization(){return dc.pruneUnnecessaryInsidePoints(this.buildFullPath(),this.from.classView.value,this.to.classView.value)}get hashCode(){return qt([Zo.RELATIONSHIP_VIEW,this.from.classView.value.id,this.to.classView.value.id,qt(this.pathForSerialization)])}}class hc extends dc{property;constructor(e,t,s,i){super(e,s,i),this.property=t}get hashCode(){return qt([Zo.PROPERTY_HOLDER_VIEW,super.hashCode,this.property.pointerHashCode])}}class uc extends hc{get hashCode(){return qt([Zo.PROPERTY_VIEW,super.hashCode])}}class pc extends dc{get hashCode(){return qt([Zo.GENERALIZATION_VIEW,super.hashCode])}}class mc{x;y;constructor(e,t){this.x=e,this.y=t}static fromPoints(e,t){return new mc(t.x-e.x,t.y-e.y)}unit(){const e=Math.sqrt(this.x*this.x+this.y*this.y);return new mc(this.x/e,this.y/e)}normal(e){return new mc(e.y-this.y,-(e.x-this.x))}dotProduct(e){return this.x*e.x+this.y*e.y}}const _c=(e,t)=>e.classViews.find((e=>e.id===t)),gc=(e,t)=>{e.path=t},Ec=e=>{const t=e.buildFullPath(),s=dc.pruneUnnecessaryInsidePoints(t,e.from.classView.value,e.to.classView.value);if(s[0]!==t[0]){const t=e.from.classView.value.center();e.from._offsetX=s[0].x-t.x,e.from._offsetY=s[0].y-t.y}if(s[s.length-1]!==t[t.length-1]){const t=e.to.classView.value.center();e.to._offsetX=s[s.length-1].x-t.x,e.to._offsetY=s[s.length-1].y-t.y}const i=[];for(let e=0;e<s.length-2;e++){const t=mc.fromPoints(s[e+1],s[e]).unit(),n=mc.fromPoints(s[e+1],s[e+2]).unit(),a=t.dotProduct(n),r=180*Math.acos(a)/Math.PI;Math.abs(r-180)>5&&i.push(s[e+1])}gc(e,i)},fc=(e,t)=>e.x*Math.cos(t)-e.y*Math.sin(t),Tc=(e,t)=>e.x*Math.sin(t)+e.y*Math.cos(t),Cc=e=>new ic(e.position.x+e.rectangle.width,e.position.y+e.rectangle.height),xc=e=>{const t=Cc(e);return new ac(new ic(t.x-5,t.y-5),new nc(10,10))},Nc=(e,t)=>(t=e.normalizeBox(t),e.contains(t.position.x,t.position.y)||e.contains(t.position.x+t.rectangle.width,t.position.y)||e.contains(t.position.x,t.position.y+t.rectangle.height)||e.contains(t.position.x+t.rectangle.width,t.position.y+t.rectangle.height)),Ac=e=>{const t=H(e.x,"Point 'x' coordinate is missing"),s=H(e.y,"Point 'y' coordinate is missing");return new ic(t,s)};class Oc extends kl{constructor(){super($t.Rw.zE,$t.i8)}V1_getExtraElementBuilders(){return[new Jl({elementClassName:"Diagram",_class:el,firstPass:(e,t)=>{W(e,el);const s=new Xo(e.name),i=ql(e.package,e.name);return t.currentSubGraph.setOwnElementInExtension(i,s,Xo),s},secondPass:(e,t)=>{W(e,el);const s=(i=ql(e.package,e.name),n=t.currentSubGraph,H(n.getOwnNullableExtensionElement(i,Xo),`Can't find diagram '${i}'`));var i,n;s.classViews=e.classViews.map((e=>((e,t,s)=>{Z(e.class,"Class view 'class' field is missing or empty"),Z(e.id,"Class view 'id' field is missing or empty"),B(e.rectangle,"Class view 'rectangle' field is missing"),B(e.position,"Class view 'position' field is missing");const i=new rc(s,e.id,t.resolveClass(e.class));return i.hideProperties=e.hideProperties,i.hideTaggedValues=e.hideTaggedValues,i.hideStereotypes=e.hideStereotypes,i.rectangle=(e=>{const t=H(e.width,"Rectangle 'width' is missing"),s=H(e.height,"Rectangle 'height' is missing");return new nc(t,s)})(e.rectangle),i.position=Ac(e.position),i})(e,t,s))),s.propertyViews=e.propertyViews.map((e=>((e,t,s)=>{B(e.property,"Property view 'property' field is missing"),B(e.line,"Property view 'line' field is missing");const i=H(_c(s,H(e.sourceView)),"Property view 'sourceView' field is missing"),n=H(_c(s,H(e.targetView)),"Property view 'targetView' field is missing"),a=t.resolveOwnProperty(e.property),r=new uc(s,a,i,n);return r.path=e.line.points.map((e=>Ac(e))),Ec(r),r})(e,t,s))),s.generalizationViews=e.generalizationViews.map((e=>((e,t)=>{B(e.line,"Generalization view 'line' field is missing");const s=H(_c(t,H(e.sourceView)),"Generalization view 'sourceView' field is missing"),i=H(_c(t,H(e.targetView)),"Generalization view 'targetView' field is missing"),n=new pc(t,s,i);return n.path=e.line.points.map((e=>Ac(e))),Ec(n),n})(e,s)))}})]}V1_getExtraElementClassifierPathGetters(){return[e=>{if(e instanceof el)return"meta::pure::metamodel::diagram::Diagram"}]}V1_getExtraElementProtocolSerializers(){return[(e,t)=>{if(e instanceof el)return(0,Be.qC)(Ml,e)}]}V1_getExtraElementProtocolDeserializers(){return[(e,t)=>{if(e._type===vl)return(0,Be.vB)(Ml,e)}]}V1_getExtraElementTransformers(){return[(e,t)=>{if(e instanceof Xo)return(e=>{const t=new el;return((e,t)=>{e.name=t.name,e.package=t.package?.path??""})(t,e),t.classViews=e.classViews.map(sc),t.generalizationViews=e.generalizationViews.map(tc),t.propertyViews=e.propertyViews.map(ec),t})(e)}]}}class Sc extends o{_$nominalTypeBrand;install(e){e.registerPureGraphPlugin(this)}}class yc extends Sc{constructor(){super($t.Rw.f1,$t.i8)}getExtraPureGraphExtensionClasses(){return[Xo]}getExtraDeadReferencesCleaners(){return[e=>{e.getExtensionForElementClass(Xo).elements.forEach((t=>((e,t)=>{e.propertyViews.filter((e=>!(e.property.ownerReference.value instanceof os?Zl(e.property.ownerReference.value):e.property.ownerReference.value.properties).map((e=>e.name)).includes(e.property.value.name))).forEach((t=>M(e.propertyViews,t))),e.classViews.filter((e=>!t.getNullableClass(e.class.value.path))).forEach((t=>M(e.classViews,t))),e.generalizationViews.filter((e=>{const s=e.from.classView.value.class.value,i=e.to.classView.value.class.value;return!t.getNullableClass(s.path)||!t.getNullableClass(i.path)||0===s.generalizations.filter((e=>e.value.rawType===i)).length})).forEach((t=>M(e.generalizationViews,t)))})(t,e)))}]}}class Ic extends c{constructor(){super($t.Rw.NA,$t.i8,[new yc,new Jo,new Oc])}}var vc=s(4707),Rc=s(3493),Pc=s(82127);const wc=(0,vc.Z)({transitions:{create:()=>"none"}}),Lc=e=>{const{children:t}=e;return(0,T.jsx)(Rc.Z,{injectFirst:!0,children:(0,T.jsx)(Pc.Z,{theme:wc,children:t})})};var bc=s(83820),Dc=s(96242),Mc=s(12238),kc=s(78683),Fc=s(81934),jc=s(6277);const Uc=(e,t)=>{const s=e=>{const{children:s,className:i}=e;return(0,T.jsx)("div",{className:(0,jc.clsx)(t,i),children:s})};return s.displayName=e,s},Vc=e=>{const{children:t,darkMode:s,className:i}=e;return(0,T.jsx)("div",{className:(0,jc.clsx)("modal",{"modal--dark":s},i),children:t})},Gc=e=>{const{title:t,icon:s,className:i}=e;return(0,T.jsxs)("div",{className:(0,jc.clsx)("modal__title",i),children:[s&&(0,T.jsx)("div",{className:"modal__title__icon",children:s}),(0,T.jsx)("div",{className:"modal__title__label",children:(n=t,(n??"").trim().replace(/\b(?:\w+)\b/gu,(e=>Is.includes(e.toLowerCase())?e.toLowerCase():ys(e))).replace(/^(?:\w+)\b/u,(e=>ys(e))).replace(/\b(?:\w+)$/u,(e=>ys(e))))})]});var n},$c=e=>{const{title:t,children:s,className:i}=e;return!s&&t?(0,T.jsx)("div",{className:(0,jc.clsx)("modal__header",i),children:(0,T.jsx)(Gc,{title:t})}):(0,T.jsx)("div",{className:(0,jc.clsx)("modal__header",i),children:s})},zc=(Uc("ModalHeaderActions","modal__header__actions"),Uc("ModalBody","modal__body")),Bc=Uc("ModalFooter","modal__footer"),Hc=e=>{switch(e){case Pt.PROCEED_WITH_CAUTION:return"btn--caution";case Pt.PROCEED:case Pt.STANDARD:default:return"btn--dark"}},Yc=(0,nt.Pi)((e=>{const{info:t}=e,s=Ft(),{title:i,message:n,prompt:a,type:r,onClose:o,onEnter:l,actions:c}=t,d=()=>{o?.(),s.setActionAlertInfo(void 0)};return(0,T.jsx)(Fc.Z,{open:Boolean(s.actionAlertInfo),onClose:R,TransitionProps:{onEnter:()=>l?.()},children:(0,T.jsxs)("form",{onSubmit:e=>{e.preventDefault(),c.find((e=>e.default))?.handler?.(),d()},className:`modal search-modal modal--dark blocking-alert blocking-alert--${(r??Rt.STANDARD).toLowerCase()}`,children:[i&&(0,T.jsx)($c,{title:i}),(0,T.jsxs)(zc,{children:[(0,T.jsx)("div",{className:"blocking-alert__summary-text",children:n}),(0,T.jsx)("div",{className:"blocking-alert__prompt-text",children:a})]}),(0,T.jsxs)(Bc,{children:[c.map((e=>(0,T.jsx)("button",{type:e.default?"submit":"button",className:`btn btn--dark ${Hc(e.type??Pt.STANDARD)}`,onClick:t=>{t.preventDefault(),e.handler?.(),d()},autoFocus:Boolean(e.default),children:e.label},e.label))),!c.length&&(0,T.jsx)("button",{type:"button",className:"btn btn--dark blocking-alert__action--standard",onClick:d,children:"Cancel"})]})]})})})),Wc=(0,nt.Pi)((()=>{const e=Ft().actionAlertInfo;return e?(0,T.jsx)(Yc,{info:e}):null})),Kc=e=>{const{isLoading:t}=e,s=(0,at.useRef)(null);return(0,at.useEffect)((()=>{s.current&&(t?s.current.parentElement?.classList.add("panel-loading-indicator__container"):s.current.parentElement?.classList.remove("panel-loading-indicator__container"))}),[t]),(0,T.jsx)("div",{ref:s,className:"panel-loading-indicator"+(t?"":"--disabled")})},Zc=(0,nt.Pi)((()=>{const e=Ft().blockingAlertInfo;return e?(0,T.jsx)(Fc.Z,{open:Boolean(e),onClose:R,classes:{root:"blocking-alert__root-container",container:"blocking-alert__container"},children:(0,T.jsxs)(Vc,{darkMode:!0,className:"blocking-alert",children:[(0,T.jsx)(Kc,{isLoading:Boolean(e.showLoading)}),(0,T.jsxs)(zc,{children:[(0,T.jsx)("div",{className:"blocking-alert__message",children:e.message}),e.prompt&&(0,T.jsx)("div",{className:"blocking-alert__message__prompt",children:e.prompt})]})]})}):null}));var Xc=s(12889),qc=s(9415),Jc=s(53083);const Qc=(0,nt.Pi)((()=>{const e=Ft(),t=e.notification,s=Boolean(t),i=t?.message??"",n=t?.severity??Lt.INFO,[a,r]=(0,at.useState)(!1);let o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--info",children:(0,T.jsx)(Xc.uMt,{})});switch(n){case Lt.ILEGAL_STATE:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Xc.nnZ,{})});break;case Lt.ERROR:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--error",children:(0,T.jsx)(Xc.xDH,{})});break;case Lt.WARNING:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--warning",children:(0,T.jsx)(Xc.LPM,{})});break;case Lt.SUCCESS:o=(0,T.jsx)("div",{className:"notification__message__content__icon notification__message__content__icon--success",children:(0,T.jsx)(Xc.rE2,{})})}const l=()=>{e.setNotification(void 0),r(!1)},c=e.guardUnhandledError((()=>e.copyTextToClipboard(i)));return(0,T.jsx)(qc.Z,{classes:{root:"notification",anchorOriginBottomRight:"notification__position"},anchorOrigin:{vertical:"bottom",horizontal:"right"},open:s,autoHideDuration:e.notification?e.notification.autoHideDuration??null:wt,onClose:(e,t)=>{"timeout"===t&&l()},children:(0,T.jsx)(Jc.Z,{classes:{root:"notification__content",message:"notification__message",action:"notification__actions"},message:(0,T.jsxs)("div",{className:"notification__message__content",children:[o,(0,T.jsx)("div",{className:(0,jc.clsx)("notification__message__content__text",{"notification__message__content__text--expanded":a}),onClick:c,title:"Click to Copy",children:i})]}),action:[(0,T.jsx)("button",{className:"notification__action",id:"expand_button",onClick:()=>r(!a),tabIndex:-1,title:a?"Collapse":"Expand",children:a?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.g8U,{})},"expand"),(0,T.jsx)("button",{className:"notification__action",onClick:l,tabIndex:-1,title:"Dismiss",children:(0,T.jsx)(Xc.q1B,{})},"close")]})},"string"==typeof i||"number"==typeof i?i:"")}));var ed;!function(e){e.TAB="Tab",e.CAPSLOCK="CapsLock",e.SHIFT="Shift",e.META="Meta",e.ALT="Alt",e.CONTROL="Control",e.SPACE="Space",e.ESC="Escape",e.LEFT="ArrowLeft",e.RIGHT="ArrowRight",e.UP="ArrowUp",e.DOWN="ArrowDown",e.ENTER="Enter",e.DELETE="Delete",e.BACKSPACE="Backspace"}(ed=ed||(ed={}));var td=s(17954);const sd=e=>{const{children:t,classes:s,...i}=e;return(0,T.jsx)(td.Z,{classes:{...s??{},paper:"mui-menu__paper",list:"mui-menu__list"},transitionDuration:0,...i,children:e.children})},id=e=>{const{className:t,children:s,menuProps:i,content:n,disabled:a,onClose:r,onOpen:o}=e,l=(0,at.useRef)(null),[c,d]=(0,at.useState)(!1),[h,u]=(0,at.useState)(),[p,m]=(0,at.useState)(0),[_,g]=(0,at.useState)(0),E=()=>{u(void 0),d(!1),g(0),m(0)},f=e=>{e.stopPropagation(),e.preventDefault(),E(),r?.()},C=e=>{if(e.stopPropagation(),e.preventDefault(),!a&&(o?.(),l.current)){const t=l.current.getBoundingClientRect(),s=t.left+(window.scrollX||document.documentElement.scrollLeft),i=t.top+(window.scrollY||document.documentElement.scrollTop),{clientX:n,clientY:a,target:o}=e,c=o;if(h!==c&&!(document.elementsFromPoint(n,a).some((e=>e===c))&&s<=n&&n<=s+t.width&&i<=a&&a<=i+t.height))return E(),void r?.();u(c),d(!0),g(a),m(n)}};return(0,T.jsxs)("div",{ref:l,className:t,onContextMenu:C,children:[s,(0,T.jsx)(sd,{open:c,anchorPosition:{left:p,top:_},onClose:f,anchorReference:"anchorPosition",BackdropProps:{invisible:!0,onContextMenu:C},disableRestoreFocus:!0,transitionDuration:0,onClick:f,...i,children:n},`${p}, ${_}`)]})},nd=(0,at.forwardRef)((function(e,t){const{className:s,children:i,...n}=e;return(0,T.jsx)("div",{ref:t,className:(0,jc.clsx)("menu",s),...n,children:i})})),ad=e=>{const{className:t,onClick:s,disabled:i,children:n,...a}=e;return(0,T.jsx)("button",{className:(0,jc.clsx)("menu__item",t),disabled:Boolean(i),onClick:s,...a,children:n})},rd=Uc("MenuContentDivider","menu__divider");Uc("MenuContentItemIcon","menu__item__icon"),Uc("MenuContentItemLabel","menu__item__label");var od=s(68824),ld=s(71215);const cd=e=>(0,T.jsx)(od.D,{className:(0,jc.clsx)("markdown-content",e.className),remarkPlugins:[ld.Z],children:e.value.value});var dd=s(62515);const hd=e=>{const{children:t}=e,{ref:s,width:i,height:n}=(0,dd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}}),[a,r]=(0,at.useState)(!1),{ref:o,width:l,height:c}=(0,dd.NB)({refreshMode:"throttle",refreshRate:50,refreshOptions:{trailing:!0}});return(0,at.useEffect)((()=>{r((l??0)>(i??0)+40&&(c??0)>(n??0)+40)}),[l,c,i,n]),(0,T.jsx)("div",{ref:o,className:"panel__content__blank",children:(0,T.jsx)("div",{ref:s,className:(0,jc.clsx)("panel__content__blank__content",{"panel__content__blank__content--hide":!a}),children:t})})};var ud=s(33207);const pd=e=>{const{children:t,...s}=e;return(0,T.jsx)(ud.ZP,{classes:{paper:"mui-popover__paper"},transitionDuration:0,...s,children:e.children})};var md=s(13474),_d=s(65068),gd=s(41327),Ed=s(85688),fd=s(28019),Td=s(78785);const Cd=e=>{const{children:t,options:s,size:i,className:n,...a}=e,r=((e,t)=>{const s=[];for(let i=0;i<e.length;i+=t)s.push(e.slice(i,i+t));return s})(s,i);return(0,T.jsxs)("div",{className:(0,jc.clsx)("mui-radio-group",n),children:[r.map(((e,t)=>(0,T.jsx)("div",{children:(0,T.jsx)(Ed.Z,{className:"mui-radio-group__group",...a,children:e.map((e=>(0,T.jsx)(fd.Z,{className:"mui-radio-group__group__column",style:{width:100/i+"%"},value:e,control:(0,T.jsx)(Td.Z,{className:"mui-radio-group__group__item__radio-btn"}),label:(0,T.jsx)("div",{className:"mui-radio-group__group__item__label",children:e})},e)))})},t))),t]})};var xd;!function(e){e.TUTORIAL_QUERY_BUILDER="tutorial.query.builder",e.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX="question.how-to-use-advanced-search-syntax",e.QUESTION_WHEN_TO_CONFIGURE_PLATFORM_VERSIONS="question.when-to-configure-project-platform-dependencies-versions",e.QUESTION_HOW_TO_WRITE_A_SERVICE_TEST="question.how-to-write-a-service-test",e.QUESTION_HOW_TO_ADD_PARAMETERS_TO_QUERY="question.how-to-add-parameters-to-query",e.QUESTION_HOW_TO_ADD_CONSTANTS_TO_QUERY="question.how-to-add-constants-to-query",e.QUESTION_HOW_TO_WRITE_SERVICE_CONNECTION_TEST_DATA="question.how-to-write-service-connection-test-data",e.QUESTION_HOW_TO_CREATE_A_DATA_ELEMENT="question.how-to-create-a-data-element"}(xd=xd||(xd={}));const Nd=(0,nt.Pi)((e=>{const{configState:t}=e,s=Ft();return(0,T.jsxs)("div",{className:"text-search-advanced-config__panel",children:[(0,T.jsxs)("div",{className:"text-search-advanced-config__panel__header__label",children:["search config",(0,T.jsx)("button",{className:"text-search-advanced-config__panel__header__hint",tabIndex:-1,onClick:()=>s.assistantService.openDocumentationEntry(xd.QUESTION_HOW_TO_USE_ADVANCED_SEARCH_SYNTAX),title:"Click to see more details on advanced search",children:(0,T.jsx)(Xc.uMt,{})})]}),(0,T.jsx)("div",{children:(0,T.jsx)(Cd,{className:"text-search-advanced-config__options",value:t.currentMode,onChange:e=>{const s=e.target.value;t.setCurrentMode(s)},row:!1,options:[_t.STANDARD,_t.INCLUDE,_t.EXACT,_t.INVERSE],size:1})})]})})),Ad=(0,nt.Pi)((e=>{const{entry:t}=e,s=Ft(),i=()=>{t.isOpen||St.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey}),t.setIsOpen(!t.isOpen)},n=s.guardUnhandledError((()=>s.copyTextToClipboard(t.documentationKey)));return(0,T.jsx)(id,{className:"virtual-assistant__doc-entry",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsx)(nd,{children:(0,T.jsx)(ad,{onClick:n,children:"Copy Documentation Key"})}),children:(0,T.jsxs)("div",{className:"virtual-assistant__doc-entry",children:[(0,T.jsxs)("div",{className:"virtual-assistant__doc-entry__header",children:[(0,T.jsx)("button",{className:(0,jc.clsx)("virtual-assistant__doc-entry__expand-icon",{"virtual-assistant__doc-entry__expand-icon--disabled":!t.content}),disabled:!t.content,tabIndex:-1,onClick:i,children:t.isOpen?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.XCv,{})}),t.url?(0,T.jsx)("a",{className:"virtual-assistant__doc-entry__title virtual-assistant__doc-entry__title--link",rel:"noopener noreferrer",target:"_blank",href:t.url,onClick:()=>{St.logEvent_VirtualAssistantDocumentationEntryAccessed(s.telemetryService,{key:t.documentationKey})},title:"Click to see external documentation",children:t.title}):(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__title",onClick:i,children:t.title})]}),t.isOpen&&t.content&&(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__content",children:J(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__doc-entry__content__text",children:t.content}):(0,T.jsx)(cd,{className:"virtual-assistant__doc-entry__content__markdown-text",value:t.content})})]})})})),Od=(0,nt.Pi)((()=>{const e=Ft(),t=e.assistantService.currentContextualDocumentationEntry,s=e.guardUnhandledError((()=>e.copyTextToClipboard(t?.context??""))),i=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.currentContext?.key??""))),n=e.guardUnhandledError((()=>e.copyTextToClipboard(e.navigationContextService.contextStack.map((e=>e.key)).join(" > "))));return(0,T.jsxs)(id,{className:"virtual-assistant__contextual-support",disabled:!t,menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(nd,{children:[(0,T.jsx)(ad,{onClick:s,children:"Copy Context ID"}),(0,T.jsx)(ad,{onClick:i,children:"Copy Current Context ID"}),(0,T.jsx)(ad,{onClick:n,children:"Copy Context Stack"})]}),children:[t&&(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__content",children:[t.title&&(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__title",children:t.title}),t.content&&(0,T.jsx)(T.Fragment,{children:J(t.content)?(0,T.jsx)("div",{className:"virtual-assistant__contextual-support__text",children:t.content}):(0,T.jsx)(cd,{className:"virtual-assistant__contextual-support__markdown-text",value:t.content})}),t.related.length&&(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries",children:[(0,T.jsxs)("div",{className:"virtual-assistant__contextual-support__relevant-entries__title",children:["Related entries (",t.related.length,")"]}),t.related.map((e=>(0,T.jsx)(Ad,{entry:e},e.uuid)))]})]}),!t&&(0,T.jsx)(hd,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(Xc.jZm,{className:"virtual-assistant__panel__placeholder__icon"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No contextual documentation found!"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__instruction",children:"Keep using the app. When contextual help is available, we will let you know!"})]})})]})})),Sd=(0,nt.Pi)((()=>{const e=Ft(),t=(0,at.useRef)(null),s=(0,at.useRef)(null),i=e.assistantService,n=i.searchText,a=(0,at.useMemo)((()=>(0,md.Z)((()=>i.search()),100)),[i]);return(0,at.useEffect)((()=>{t.current?.focus()}),[]),(0,T.jsxs)("div",{className:"virtual-assistant__search",children:[(0,T.jsxs)("div",{className:"virtual-assistant__search__header",children:[(0,T.jsx)("input",{ref:t,onClick:()=>{document.querySelectorAll('[role="dialog"]').length&&t.current!==document.activeElement&&i.refreshPanelRendering()},className:(0,jc.clsx)("virtual-assistant__search__input input--dark",{"virtual-assistant__search__input--searching":n}),spellCheck:!1,onChange:e=>{i.setSearchText(e.target.value),a()},value:n,placeholder:"Ask me a question"}),n&&(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__count",children:i.searchResults.length+(i.isOverSearchLimit?"+":"")}),(0,T.jsx)("button",{ref:s,className:(0,jc.clsx)("virtual-assistant__search__input__config__trigger",{"virtual-assistant__search__input__config__trigger--toggled":i.showSearchConfigurationMenu,"virtual-assistant__search__input__config__trigger--active":i.searchConfigurationState.isAdvancedSearchActive}),tabIndex:-1,onClick:()=>i.setShowSearchConfigurationMenu(!i.showSearchConfigurationMenu),title:(i.searchConfigurationState.isAdvancedSearchActive?"Advanced search is currently active\n":"")+"Click to toggle search config menu",children:(0,T.jsx)(Xc.IEm,{})}),n?(0,T.jsx)("button",{className:"virtual-assistant__search__input__clear-btn",tabIndex:-1,onClick:()=>{i.resetSearch(),i.currentDocumentationEntry=void 0,t.current?.focus()},title:"Clear",children:(0,T.jsx)(Xc.q1B,{})}):(0,T.jsx)("div",{className:"virtual-assistant__search__input__search__icon",children:(0,T.jsx)(Xc.W1M,{})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__search__content",children:[(0,T.jsx)(Kc,{isLoading:i.searchState.isInProgress}),(0,T.jsx)("div",{className:(0,jc.clsx)("virtual-assistant__search__input__config__panel",{"virtual-assistant__search__input__config__panel--toggled":i.showSearchConfigurationMenu}),children:(0,T.jsx)(Nd,{configState:i.searchConfigurationState})}),i.currentDocumentationEntry&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:(0,T.jsx)(Ad,{entry:i.currentDocumentationEntry},i.currentDocumentationEntry.uuid)}),!i.currentDocumentationEntry&&(0,T.jsxs)(T.Fragment,{children:[Boolean(i.searchResults.length)&&(0,T.jsx)("div",{className:"virtual-assistant__search__results",children:i.searchResults.map((e=>(0,T.jsx)(Ad,{entry:e},e.uuid)))}),n&&!i.searchResults.length&&(0,T.jsx)(hd,{children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__placeholder",children:[(0,T.jsx)(Xc.DXi,{className:"virtual-assistant__panel__placeholder__icon"}),(0,T.jsx)("div",{className:"virtual-assistant__panel__placeholder__message",children:"No result..."})]})}),!n&&!i.searchResults.length&&(0,T.jsx)(id,{className:"virtual-assistant__character__container",menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(nd,{children:[(0,T.jsx)(ad,{onClick:()=>{_e(`documentation-registry_${(0,_d.Z)(new Date(Date.now()),ke)}.json`,JSON.stringify(e.documentationService.publishDocRegistry(),void 0,2),re.APPLICATION_JSON)},children:"Download documentation registry"}),(0,T.jsx)(ad,{onClick:()=>{_e(`documentation-registry_${(0,_d.Z)(new Date(Date.now()),ke)}.json`,JSON.stringify(e.documentationService.publishContextualDocIndex(),void 0,2),re.APPLICATION_JSON)},children:"Download contextual documentation mapping"})]}),children:(0,T.jsxs)("div",{className:"virtual-assistant__character",children:[(0,T.jsxs)("div",{className:"virtual-assistant__character__figure",children:[(0,T.jsx)(Xc.Oag,{className:"virtual-assistant__character__hat"}),(0,T.jsx)(Xc.ce8,{className:"virtual-assistant__character__glasses"}),(0,T.jsx)(Xc.dRK,{className:"virtual-assistant__character__beard"})]}),(0,T.jsx)("div",{className:"virtual-assistant__character__greeting",children:"Bonjour, It's Pierre!"}),(0,T.jsx)("div",{className:"virtual-assistant__character__question",children:"How can I help today?"})]})})]})]})]})})),yd=(0,nt.Pi)((e=>{const{triggerElement:t}=e,s=Ft().assistantService,i=s.currentContextualDocumentationEntry,n=s.selectedTab;return(0,T.jsx)(pd,{open:s.isOpen,className:"virtual-assistant__panel__container",anchorEl:t,hideBackdrop:!0,PaperProps:{classes:{root:"virtual-assistant__panel__container__root"}},disableEnforceFocus:!0,anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"bottom",horizontal:"right"},children:(0,T.jsxs)("div",{className:"virtual-assistant__panel",tabIndex:0,onKeyDown:e=>{"Tab"===e.key&&(e.preventDefault(),e.stopPropagation())},children:[(0,T.jsxs)("div",{className:"virtual-assistant__panel__header",children:[(0,T.jsxs)("div",{className:"virtual-assistant__panel__header__tabs",children:[(0,T.jsx)("div",{className:(0,jc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===gt.SEARCH}),onClick:()=>s.setSelectedTab(gt.SEARCH),title:"Search",children:(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__content",children:(0,T.jsx)(Xc.W1M,{})})}),(0,T.jsx)("div",{className:(0,jc.clsx)("virtual-assistant__panel__header__tab",{"virtual-assistant__panel__header__tab--active":n===gt.CONTEXTUAL_SUPPORT}),onClick:()=>s.setSelectedTab(gt.CONTEXTUAL_SUPPORT),title:"Contextual Support",children:(0,T.jsxs)("div",{className:"virtual-assistant__panel__header__tab__content",children:[(0,T.jsx)(Xc.kdY,{}),i&&(0,T.jsx)("div",{className:"virtual-assistant__panel__header__tab__indicator",title:"Contextual support available"})]})})]}),(0,T.jsx)("div",{className:"virtual-assistant__panel__header__actions",children:(0,T.jsx)("button",{className:"virtual-assistant__panel__header__action",tabIndex:-1,onClick:()=>s.setIsOpen(!1),title:"Close panel",children:(0,T.jsx)(Xc.Two,{className:"virtual-assistant__panel__icon__close"})})})]}),(0,T.jsxs)("div",{className:"virtual-assistant__panel__content",children:[n===gt.SEARCH&&(0,T.jsx)(Sd,{}),n===gt.CONTEXTUAL_SUPPORT&&(0,T.jsx)(Od,{})]})]})},s.panelRenderingKey)})),Id=(0,nt.Pi)((()=>{const[e,t]=(0,at.useState)(!1),[s,i]=(0,at.useState)((0,a.Z)()),n=Ft(),r=(0,at.useRef)(null),o=n.assistantService,l=o.currentContextualDocumentationEntry;return(0,at.useEffect)((()=>{o.isHidden&&i((0,a.Z)())}),[o.isHidden]),(0,T.jsx)(gd,{bounds:"parent",onStart:()=>t(!0),onStop:()=>t(!1),handle:".virtual-assistant__station__drag-handle",children:(0,T.jsxs)("div",{className:"virtual-assistant",ref:r,children:[(0,T.jsxs)("div",{className:(0,jc.clsx)("virtual-assistant__station",{"virtual-assistant__station--hidden":o.isHidden,"virtual-assistant__station--active":Boolean(l)}),children:[(0,T.jsx)("button",{className:"virtual-assistant__station__trigger",tabIndex:-1,onClick:()=>{!o.isOpen&&l&&o.setSelectedTab(gt.CONTEXTUAL_SUPPORT),o.setIsOpen(!o.isOpen)},title:o.isOpen?"Click to close assistant panel":(l?"Contextual support available.\n":"")+"Click to open assistant panel...",children:o.isOpen?(0,T.jsx)(Xc.Two,{className:"virtual-assistant__station__trigger__close"}):l?(0,T.jsx)(Xc.J$M,{className:"virtual-assistant__station__trigger__circle"}):null}),(0,T.jsx)(id,{className:(0,jc.clsx)("virtual-assistant__station__drag-handle",{"virtual-assistant__station__drag-handle--dragging":e}),menuProps:{elevation:7,classes:{root:"virtual-assistant__context-menu"}},content:(0,T.jsxs)(nd,{children:[(0,T.jsx)(ad,{onClick:()=>{o.setIsOpen(!1),i((0,a.Z)())},children:"Reset Position"}),(0,T.jsx)(ad,{onClick:()=>n.assistantService.hideAssistant(),children:"Hide Assistant"})]}),children:(0,T.jsx)("div",{className:"virtual-assistant__station__drag-handle__content",title:e?void 0:"Grab to drag assistant",children:(0,T.jsx)(Xc.POq,{})})})]},l?.uuid??""),!e&&o.isOpen&&!o.isHidden&&r.current&&(0,T.jsx)(yd,{triggerElement:r.current})]})},s)})),vd="app.container",Rd="app.backdrop-container",Pd=["Meta+KeyP","Control+KeyP","Meta+KeyS","Control+KeyS","F8","F10","F11","Meta+Shift+KeyP","Control+Shift+KeyP","Meta+KeyB","Control+KeyB","F7","Alt+F7","Control+Shift+KeyB"],wd=e=>(0,T.jsx)("div",{className:"backdrop__container",id:e.elementID}),Ld=(0,nt.Pi)((e=>{const{children:t}=e,s=Ft(),i=s.backdropContainerElementID?document.getElementById(s.backdropContainerElementID)??document.getElementById(Rd):document.getElementById(Rd),n=((e,t)=>{const s={};return e.forEach(((e,i)=>{e&&(s[i]={combinations:[e],handler:t(e)})})),s.INTERNAL__PLATFORM_NATIVE_KEYBOARD_COMMAND={combinations:Pd,handler:e=>{e?.preventDefault()}},s})(s.keyboardShortcutsService.commandKeyMap,(e=>t=>{Pd.includes(e)&&t?.preventDefault(),s.keyboardShortcutsService.dispatch(e)}));return(0,at.useEffect)((()=>{const e=function(e){const t=new Map;let s=null;return i=>{i instanceof KeyboardEvent&&(Object.values(e).flatMap((e=>e.combinations.map((t=>({combination:t,handler:e.handler}))))).filter((e=>e.combination.length)).forEach((e=>{const s=e.combination,n=e.combination.trim().split(" ").map((e=>{const t=e.split(/\b\+/),s=H(t.pop(),"Can't parse key binding: last part must be a non-modifier key");return{modifiers:t,key:s}}));if(!n.length)return;const a=t.get(s)??n,r=H(a[0]),o=((e,t)=>t.key===e.code&&t.modifiers.every((t=>e.getModifierState(t)))&&![ed.SHIFT,ed.META,ed.ALT,ed.CONTROL].find((s=>t.key!==s&&e.getModifierState(s)&&!t.modifiers.includes(s))))(i,r);o?a.length>1?t.set(s,a.slice(1)):(t.delete(s),e.handler(i)):i.getModifierState(i.key)||t.delete(s)})),s&&clearTimeout(s),s=setTimeout(t.clear.bind(t),1e3))}}(n);return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n]),(0,T.jsxs)(Lc,{children:[(0,T.jsx)(Zc,{}),(0,T.jsx)(Wc,{}),(0,T.jsx)(Qc,{}),s.showBackdrop&&(0,T.jsx)(bc.Z,{container:i,children:(0,T.jsx)(Dc.Z,{className:"backdrop",open:s.showBackdrop})}),(0,T.jsx)(Mc.W,{backend:kc.PD,children:(0,T.jsxs)("div",{className:"app__container",id:vd,onContextMenu:e=>{e.stopPropagation(),e.preventDefault()},children:[(0,T.jsx)(wd,{elementID:Rd}),(0,T.jsx)(Id,{}),t]})})]})}));class bd{applicationStore;pluginManager;constructor(e){this.applicationStore=e,this.pluginManager=e.pluginManager,this.applicationStore.assistantService.hideAssistant()}}const Dd=(0,at.createContext)(void 0),Md=({children:e})=>{const t=Ft(),s=(0,nt.fv)((()=>new bd(t)));return(0,T.jsx)(Dd.Provider,{value:s,children:e})};var kd,Fd;!function(e){e.CONCEPT="CONCEPT",e.FILE="FILE"}(kd=kd||(kd={})),function(e){e.CONSOLE="CONSOLE",e.SEARCH_RESULT="SEARCH_RESULT",e.TEST_RUNNER="TEST_RUNNER"}(Fd=Fd||(Fd={}));const jd=(e,t)=>{e.hasTextFocus()||e.focus(),e.revealPositionInCenter(t,0),e.setPosition(t)},Ud="dummy_problem_marker_owner";var Vd;!function(e){e.PACKAGE="Package",e.PROFILE="Profile",e.TAG="Tag",e.STEREOTYPE="Stereotype",e.CLASS="Class",e.ASSOCIATION="Association",e.PROPERTY="Property",e.QUALIFIED_PROPERTY="QualifiedProperty",e.ENUMERATION="Enumeration",e.ENUM_VALUE="Enum",e.MEASURE="Measure",e.UNIT="Unit",e.FUNCTION="ConcreteFunctionDefinition",e.NATIVE_FUNCTION="NativeFunction",e.DIAGRAM="Diagram",e.DATABASE="Database",e.MAPPING="Mapping"}(Vd=Vd||(Vd={}));class Gd{pureId;pureType;pureName;get id(){return this.pureId}}class $d extends Gd{deprecated}(0,Be.yu)($d,{pureId:(0,Be.Ru)(),pureType:(0,Be.Ru)(),deprecated:(0,Be.Ru)()});class zd extends Gd{RO;classPath;file;line;column;get id(){return`${this.classPath}.${this.pureId}`}}(0,Be.yu)(zd,{pureId:(0,Be.Ru)(),pureName:(0,Be.Ru)(),pureType:(0,Be.Ru)(),RO:(0,Be.Ru)(),classPath:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class Bd extends Gd{RO;notpublic;user;file;line;column}(0,Be.yu)(Bd,{pureId:(0,Be.Ru)(),pureName:(0,Be.jt)((0,Be.Ru)()),pureType:(0,Be.Ru)(),RO:(0,Be.Ru)(),notpublic:(0,Be.Ru)(),user:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class Hd{li_attr;id;text;icon;children;state;getNodeAttribute(e){return K(this.li_attr,e,`Expected concept node attribute to be of type '${e.name}'`)}}(0,Be.yu)(Hd,{li_attr:(0,Be.PG)((()=>Be.AM),(e=>e.classPath?(0,Be.vB)(zd,e):e.file?(0,Be.vB)(Bd,e):(0,Be.vB)($d,e))),id:(0,Be.Ru)(),text:(0,Be.Ru)(),icon:(0,Be.Ru)(),children:(0,Be.Ru)(),state:(0,Be.Ru)()});const Yd=e=>e.startsWith("/")?e.substring(1,e.length):e;class Wd{content;constructor(){(0,x.rC)(this,{content:x.LO,hashCode:x.Fl,setContent:x.aD})}setContent(e){this.content=e}get hashCode(){return Xt(this.content)}}(0,Be.yu)(Wd,{content:(0,Be.Ru)()});class Kd{file;line;column;constructor(e,t,s){this.file=e,this.line=t,this.column=s}}class Zd extends Kd{error;constructor(e,t,s,i){super(e,t,s),this.error=i}}var Xd;!function(e){e.ENUM="meta::pure::ide::findusages::findUsagesForEnum_String_1__String_1__SourceInformation_MANY_",e.PROPERTY="meta::pure::ide::findusages::findUsagesForProperty_String_1__String_1__SourceInformation_MANY_",e.ELEMENT="meta::pure::ide::findusages::findUsagesForPath_String_1__SourceInformation_MANY_",e.MULTIPLE_PATHS="meta::pure::ide::findusages::findUsagesForMultiplePaths_String_1__Pair_MANY_"}(Xd=Xd||(Xd={}));const qd=e=>`'${e.path}'${e.owner?` of '${e.owner}'`:""}`;class Jd{source;line;column;startLine;startColumn;endLine;endColumn}(0,Be.yu)(Jd,{source:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)()});class Qd{first;second}(0,Be.yu)(Qd,{first:(0,Be.Ru)(),second:(0,Be.pb)((0,Be.Ry)(Jd))});class eh{uuid=(0,a.Z)();get description(){}match(e){return this===e}onOpen(){}onClose(){}}class th{currentTab;tabs=[];constructor(){(0,x.rC)(this,{currentTab:x.LO,tabs:x.LO,setCurrentTab:x.aD,closeTab:x.aD,closeAllTabs:x.aD,closeAllOtherTabs:x.aD,openTab:x.aD,swapTabs:x.aD})}setCurrentTab(e){this.currentTab=e}closeAllOtherTabs(e){B(this.tabs.find((t=>t===e)),"Specified tab should be currently opened"),this.setCurrentTab(e),this.tabs=[e]}closeAllTabs(){this.setCurrentTab(void 0),this.tabs=[]}swapTabs(e,t){D(this.tabs,e,t)}openTab(e){if(!this.tabs.find((t=>t.match(e))))if(this.currentTab){const t=this.tabs.findIndex((e=>e===this.currentTab));this.tabs.splice(t+1,0,e)}else this.tabs.push(e);this.setCurrentTab(e),e.onOpen()}closeTab(e){const t=this.tabs.findIndex((t=>t.match(e)));if(q(-1!==t,"Can't close a tab which is not opened"),this.tabs.splice(t,1),this.currentTab===e)if(this.tabs.length){const e=t-1;this.setCurrentTab(e>=0?this.tabs[e]:this.tabs[0])}else this.setCurrentTab(void 0);e.onClose()}}class sh extends eh{editorStore;constructor(e){super(),this.editorStore=e}}class ih extends th{editorStore;constructor(e){super(),this.editorStore=e}get dndType(){return"editor.tab-manager.tab"}closeTab(e){e instanceof uh&&e.hasChanged?this.editorStore.applicationStore.setActionAlertInfo({message:"Unsaved changes will be lost if you continue. Do you still want to proceed?",prompt:"To save changes, abort and compile",type:Rt.CAUTION,actions:[{label:"Proceed",type:Pt.PROCEED_WITH_CAUTION,handler:()=>super.closeTab(e)},{label:"Save changes",type:Pt.PROCEED_WITH_CAUTION,handler:()=>{(0,x.fl)(this.editorStore.executeGo()).then((()=>{super.closeTab(e)})).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Pt.PROCEED,default:!0}]}):super.closeTab(e)}}var nh;!function(e){e.SEARCH_FILE="editor.search.file",e.SEARCH_TEXT="editor.search.text",e.GO_TO_FILE="editor.go-to-file",e.TOGGLE_AUX_PANEL="editor.toggle-auxiliary-panel",e.EXECUTE="editor.execute",e.FULL_RECOMPILE="editor.full-compile",e.FULL_RECOMPILE_WITH_FULL_INIT="editor.full-compile.with-init",e.RUN_ALL_TESTS="editor.run-all-tests",e.RUN_RELAVANT_TESTS="editor.run-relavant-tests"}(nh=nh||(nh={}));const ah={[nh.SEARCH_FILE]:{title:"Search for file",defaultKeyboardShortcut:"Control+Shift+KeyN"},[nh.SEARCH_TEXT]:{title:"Search text",defaultKeyboardShortcut:"Control+Shift+KeyF"},[nh.GO_TO_FILE]:{title:"Go to file",defaultKeyboardShortcut:"Control+F1"},[nh.TOGGLE_AUX_PANEL]:{title:"Toggle auxiliary panel",defaultKeyboardShortcut:"Control+Backquote"},[nh.EXECUTE]:{title:"Execute",defaultKeyboardShortcut:"F9"},[nh.FULL_RECOMPILE]:{title:"Run full re-compilation",defaultKeyboardShortcut:"F11"},[nh.FULL_RECOMPILE_WITH_FULL_INIT]:{title:"Run full re-compilation",defaultKeyboardShortcut:"Shift+F11"},[nh.RUN_ALL_TESTS]:{title:"Run all tests",defaultKeyboardShortcut:"F10"},[nh.RUN_RELAVANT_TESTS]:{title:"Run relavant tests",defaultKeyboardShortcut:"Shift+F10"}};var rh;!function(e){e.RECENTER="editor.diagram-editor.recenter",e.USE_ZOOM_TOOL="editor.diagram-editor.use-zoom-tool",e.USE_VIEW_TOOL="editor.diagram-editor.use-view-tool",e.USE_PAN_TOOL="editor.diagram-editor.use-pan-tool"}(rh=rh||(rh={}));const oh={[rh.RECENTER]:{title:"Diagram Editor: Recenter",defaultKeyboardShortcut:"KeyR"},[rh.USE_ZOOM_TOOL]:{title:"Diagram Editor: Use zoom tool",defaultKeyboardShortcut:"KeyZ"},[rh.USE_VIEW_TOOL]:{title:"Diagram Editor: Use view tool",defaultKeyboardShortcut:"KeyV"},[rh.USE_PAN_TOOL]:{title:"Diagram Editor: Use pan tool",defaultKeyboardShortcut:"KeyM"}};var lh;!function(e){e.REVEAL_CONCEPT_IN_TREE="editor.file-editor.reveal-concept-in-tree",e.GO_TO_DEFINITION="editor.file-editor.go-to-definition",e.GO_BACK="editor.file-editor.go-back",e.FIND_USAGES="editor.file-editor.find-usage",e.RENAME_CONCEPT="editor.file-editor.rename-concept",e.GO_TO_LINE="editor.file-editor.go-to-line"}(lh=lh||(lh={}));const ch={[lh.REVEAL_CONCEPT_IN_TREE]:{title:"Reveal concept in tree (File)",defaultKeyboardShortcut:"Control+Shift+KeyB"},[lh.GO_TO_DEFINITION]:{title:"Go to definition (File)",defaultKeyboardShortcut:"Control+KeyB"},[lh.GO_BACK]:{title:"Go back (File)",defaultKeyboardShortcut:"Control+Alt+KeyB"},[lh.FIND_USAGES]:{title:"Find Usages (File)",defaultKeyboardShortcut:"Alt+F7"},[lh.RENAME_CONCEPT]:{title:"Rename Concept (File)",defaultKeyboardShortcut:"F2"},[lh.GO_TO_LINE]:{title:"Go to Line (File)",defaultKeyboardShortcut:"Control+KeyG"}};class dh{model;editor;_dummyCursorObservable={};language;viewState;forcedCursorPosition;wrapText=!1;constructor(e){(0,x.rC)(this,{viewState:x.LO.ref,editor:x.LO.ref,_dummyCursorObservable:x.LO.ref,forcedCursorPosition:x.LO.ref,wrapText:x.LO,cursorObserver:x.Fl,notifyCursorObserver:x.aD,setViewState:x.aD,setEditor:x.aD,setForcedCursorPosition:x.aD,setWrapText:x.aD}),this.language=(e=>{switch(w(e.split("."))){case"pure":return S.PURE;case"java":return S.JAVA;case"md":case"xml":return S.MARKDOWN;case"sql":return S.SQL;case"json":return S.JSON;case"yml":case"yaml":return S.YAML;case"graphql":return S.GRAPHQL;default:return S.TEXT}})(e.filePath),this.model=N.editor.createModel(e.uuid,this.language),this.model.setValue(e.file.content)}notifyCursorObserver(){this._dummyCursorObservable={}}get cursorObserver(){return this._dummyCursorObservable,this.editor?{position:this.editor.getPosition()??void 0,selection:this.editor.getSelection()??void 0}:void 0}setViewState(e){this.viewState=e}setEditor(e){this.editor=e}setForcedCursorPosition(e){this.forcedCursorPosition=e}setWrapText(e){const t=this.wrapText;this.wrapText=e,t!==e&&this.editor&&(this.editor.updateOptions({wordWrap:e?"on":"off"}),this.editor.focus())}}class hh{fileEditorState;concept;coordinate;constructor(e,t,s){this.fileEditorState=e,this.concept=t,this.coordinate=s}}class uh extends sh{filePath;textEditorState;_currentHashCode;file;renameConceptState;showGoToLinePrompt=!1;constructor(e,t,s){super(e),(0,x.rC)(this,{_currentHashCode:x.LO,file:x.LO,renameConceptState:x.LO,showGoToLinePrompt:x.LO,hasChanged:x.Fl,resetChangeDetection:x.aD,setFile:x.aD,setShowGoToLinePrompt:x.aD,setConceptToRenameState:x.ls}),this.file=t,this._currentHashCode=t.hashCode,this.filePath=s,this.textEditorState=new dh(this)}get label(){return Yd(this.filePath)}get description(){return`File: ${Yd(this.filePath)}`}get fileName(){return H(w(this.filePath.split("/")))}match(e){return e instanceof uh&&this.filePath===e.filePath}onClose(){this.textEditorState.model.dispose()}get hasChanged(){return this._currentHashCode!==this.file.hashCode}resetChangeDetection(){this._currentHashCode=this.file.hashCode}setFile(e){this.file=e,this.textEditorState.model.setValue(e.content),this.resetChangeDetection()}setShowGoToLinePrompt(e){this.showGoToLinePrompt=e}*setConceptToRenameState(e){if(!e)return void(this.renameConceptState=void 0);if(this.hasChanged)return void this.editorStore.applicationStore.notifyWarning("Can't rename concept: source is not compiled");const t=yield this.editorStore.getConceptInfo(e);this.renameConceptState=t?new hh(this,t,e):void 0}showError(e){var t,s,i;t=this.textEditorState.model,s=[{message:e.error.message,startLineNumber:e.line,startColumn:e.column,endLineNumber:e.line,endColumn:e.column}],i=this.uuid,N.editor.setModelMarkers(t,i??Ud,s.map((e=>({startLineNumber:e.startLineNumber,startColumn:e.startColumn,endLineNumber:e.endLineNumber,endColumn:e.endColumn+1,message:""===e.message?"(no error message)":e.message,severity:N.MarkerSeverity.Error}))))}clearError(){var e;e=this.uuid,N.editor.removeAllMarkers(e??Ud)}registerCommands(){if(this.textEditorState.language!==S.PURE)throw new j("File editor commands should only be used for Pure files");this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.GO_TO_DEFINITION,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&(0,x.fl)(this.editorStore.executeNavigation(new Kd(this.filePath,e.lineNumber,e.column))).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.GO_BACK,action:()=>{(0,x.fl)(this.editorStore.navigateBack()).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.REVEAL_CONCEPT_IN_TREE,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();e&&this.editorStore.revealConceptInTree(new Kd(this.filePath,e.lineNumber,e.column)).catch(this.editorStore.applicationStore.alertUnhandledError)}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.FIND_USAGES,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){const t=new Kd(this.filePath,e.lineNumber,e.column);this.findConceptUsages(t)}}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.RENAME_CONCEPT,trigger:()=>this.editorStore.tabManagerState.currentTab===this&&Boolean(this.textEditorState.editor?.hasTextFocus()),action:()=>{const e=this.textEditorState.editor?.getPosition();if(e){if(!this.textEditorState.model.getWordAtPosition(e))return;const t=new Kd(this.filePath,e.lineNumber,e.column);(0,x.fl)(this.setConceptToRenameState(t)).catch(this.editorStore.applicationStore.alertUnhandledError)}}}),this.editorStore.applicationStore.commandCenter.registerCommand({key:lh.GO_TO_LINE,trigger:()=>this.editorStore.tabManagerState.currentTab===this,action:()=>{this.setShowGoToLinePrompt(!0)}})}findConceptUsages(e){const t=()=>{(0,x.fl)(this.editorStore.findUsages(e)).catch(this.editorStore.applicationStore.alertUnhandledError)};this.hasChanged?this.editorStore.applicationStore.setActionAlertInfo({message:"Source is not compiled, finding concept usages might be inaccurate. Do you want compile to proceed?",type:Rt.CAUTION,actions:[{label:"Compile and Proceed",type:Pt.PROCEED_WITH_CAUTION,handler:()=>{(0,x.fl)(this.editorStore.executeGo()).then(t).catch(this.editorStore.applicationStore.alertUnhandledError)}},{label:"Abort",type:Pt.PROCEED,default:!0}]}):t()}async renameConcept(e){if(!this.renameConceptState)return;const t=this.renameConceptState.concept;try{this.editorStore.applicationStore.setBlockingAlert({message:"Finding concept usages...",showLoading:!0});const s=await this.editorStore.findConceptUsages(t.pureType===Vd.ENUM_VALUE?Xd.ENUM:t.pureType===Vd.PROPERTY||t.pureType===Vd.QUALIFIED_PROPERTY?Xd.PROPERTY:Xd.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`));await(0,x.fl)(this.editorStore.renameConcept(t.pureName,e,t.pureType,s)),this.textEditorState.setForcedCursorPosition({lineNumber:this.renameConceptState.coordinate.line,column:this.renameConceptState.coordinate.column})}catch(e){V(e),this.editorStore.applicationStore.notifyError(e)}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}}deregisterCommands(){if(this.textEditorState.language!==S.PURE)throw new j("File editor commands should only be used for Pure files");[lh.GO_TO_DEFINITION,lh.GO_BACK,lh.REVEAL_CONCEPT_IN_TREE,lh.FIND_USAGES,lh.RENAME_CONCEPT,lh.GO_TO_LINE].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class ph{editorStore;treeData;selectedNode;loadInitialDataState=ft.create();refreshDataState=ft.create();constructor(e){(0,x.rC)(this,{treeData:x.LO.ref,loadInitialDataState:x.LO,refreshDataState:x.LO,initialize:x.ls,expandNode:x.ls,openNode:x.ls,refreshTreeData:x.ls,setTreeData:x.aD,setSelectedNode:x.aD}),this.editorStore=e}getTreeData(){return H(this.treeData,"Tree data has not been initialized")}*initialize(){if(this.loadInitialDataState.isInProgress)this.editorStore.applicationStore.notifyWarning("Tree state initialization is in progress");else{this.loadInitialDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes()),this.loadInitialDataState.pass()}catch(e){V(e),this.editorStore.applicationStore.notifyError(e),this.loadInitialDataState.fail()}}}setSelectedNode(e){e!==this.selectedNode&&(this.selectedNode&&(this.selectedNode.isSelected=!1),e&&(e.isSelected=!0),this.selectedNode=e,this.refreshTree())}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...H(this.treeData)})}*expandNode(e){if(!e.isLoading)if(this.getTreeData().nodes.has(e.id)&&e.childrenIds)e.isLoading=!1,e.isOpen=!0,this.refreshTree();else{e.isLoading=!0;try{const t=yield this.getChildNodes(e);this.processChildNodes(e,t),e.isOpen=!0,this.refreshTree()}catch(e){V(e),this.editorStore.applicationStore.notifyError(e)}finally{e.isLoading=!1}}}*refreshTreeData(){const e=new Set(Array.from(this.getTreeData().nodes.values()).filter((e=>e.isOpen)).map((e=>e.id))),t=this.selectedNode?.id;this.refreshDataState.inProgress();try{this.treeData=this.buildTreeData(yield this.getRootNodes())}catch(e){return V(e),this.editorStore.applicationStore.notifyError(e),void this.refreshDataState.fail()}const s=this.getTreeData().rootIds.map((e=>H(this.getTreeData().nodes.get(e)))).filter((t=>e.has(t.id)));yield this.refreshOpenNodes(s,e),t&&this.getTreeData().nodes.has(t)&&this.setSelectedNode(H(this.getTreeData().nodes.get(t)))}async refreshOpenNodes(e,t){return await Promise.all(e.map((e=>(t.delete(e.id),(0,x.fl)(this.expandNode(e)).catch((()=>{})))))),(e=e.flatMap((e=>e.childrenIds??[])).map((e=>H(this.getTreeData().nodes.get(e)))).filter((e=>t.has(e.id)))).length?this.refreshOpenNodes(e,t):Promise.resolve()}}class mh{id;path}class _h extends mh{file;statusType}(0,Be.yu)(_h,{id:(0,Be.Ru)(),path:(0,Be.Ru)(),file:(0,Be.Ru)(),statusType:(0,Be.Ru)()});class gh extends mh{repo}(0,Be.yu)(gh,{id:(0,Be.Ru)(),path:(0,Be.Ru)(),repo:(0,Be.Ru)()});class Eh{li_attr;text;icon;children;state;get isFolderNode(){return this.li_attr instanceof gh}get isFileNode(){return this.li_attr instanceof _h}getNodeAttribute(e){return K(this.li_attr,e,`Expected directory node attribute to be of type '${e.name}'`)}}(0,Be.yu)(Eh,{li_attr:(0,Be.PG)((()=>Be.AM),(e=>e.file&&"true"===e.file?(0,Be.vB)(_h,e):(0,Be.vB)(gh,e))),text:(0,Be.Ru)(),icon:(0,Be.Ru)(),children:(0,Be.Ru)(),state:(0,Be.Ru)()});const fh=e=>{const t=e.trim(),s=t.lastIndexOf("/");if(!(s<=0))return t.substring(0,s)},Th=e=>e.endsWith(".pure"),Ch=e=>`file_${e}`;class xh extends ph{nodeForCreateNewFile;nodeForCreateNewDirectory;nodeForRenameFile;constructor(e){super(e),(0,x.rC)(this,{nodeForCreateNewFile:x.LO,nodeForCreateNewDirectory:x.LO,nodeForRenameFile:x.LO,setNodeForCreateNewFile:x.aD,setNodeForCreateNewDirectory:x.aD,setNodeForRenameFile:x.aD,revealPath:x.ls})}setNodeForCreateNewFile=e=>{q(!e||e.data.isFolderNode,"Node selected for creating a new file from must be a directory"),this.nodeForCreateNewFile=e};setNodeForCreateNewDirectory=e=>{q(!e||e.data.isFolderNode,"Node selected for creating a new directory from must be a directory"),this.nodeForCreateNewDirectory=e};setNodeForRenameFile=e=>{q(!e||e.data.isFileNode,"Node selected for renaming must be a file"),this.nodeForRenameFile=e};async getRootNodes(){return(await this.editorStore.client.getDirectoryChildren()).map((e=>(0,Be.vB)(Eh,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.editorStore.client.getDirectoryChildren(e.data.li_attr.path)).map((e=>(0,Be.vB)(Eh,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((e=>{const t=e.li_attr.id;i.push(t),s.nodes.set(t,{data:e,id:t,label:e.text,isLoading:!1})})),e.childrenIds=i}*openNode(e){e.data.isFileNode&&(yield(0,x.fl)(this.editorStore.loadFile(e.data.li_attr.path)))}*revealPath(e,t,s){t&&this.editorStore.setActiveActivity(kd.FILE,{keepShowingIfMatchedCurrent:!0});const i=[];let n=e;for(;n;)i.unshift(n),n=fh(n);for(const e of i)if(Th(e))yield(0,x.fl)(this.editorStore.loadFile(e,s));else{const t=H(this.getTreeData().nodes.get(Ch(e)),`Can't find directory node with path '${e}'`);yield(0,x.fl)(this.expandNode(t))}const a=H(this.getTreeData().nodes.get(Ch(e)),`Can't find file node with path '${e}'`);this.setSelectedNode(a)}}class Nh extends ph{loadConceptActivity=ft.create();statusText;nodeForRenameConcept;nodeForMoveElement;constructor(e){super(e),(0,x.rC)(this,{statusText:x.LO,nodeForRenameConcept:x.LO,nodeForMoveElement:x.LO,setStatusText:x.aD,setNodeForRenameConcept:x.aD,setNodeForMoveElement:x.aD,pullConceptsActivity:x.aD,pollConceptsActivity:x.ls})}setStatusText(e){this.statusText=e}setNodeForRenameConcept(e){this.nodeForRenameConcept=e}setNodeForMoveElement(e){this.nodeForMoveElement=e}async getRootNodes(){return await(0,x.fl)(this.pollConceptsActivity()),(await this.editorStore.client.getConceptChildren()).map((e=>(0,Be.vB)(Hd,e)))}buildTreeData(e){const t=[],s=new Map;return e.forEach((e=>{const i=e.li_attr.id;t.push(i),s.set(i,{data:e,id:i,label:e.text,isLoading:!1})})),{rootIds:t,nodes:s}}async getChildNodes(e){return(await this.editorStore.client.getConceptChildren(e.data.li_attr.pureId)).map((e=>(0,Be.vB)(Hd,e)))}processChildNodes(e,t){const s=this.getTreeData(),i=[];t.forEach((t=>{const n=t.li_attr.id;i.push(n),s.nodes.set(n,{data:t,id:n,label:t.text,isLoading:!1,parent:e})})),e.childrenIds=i}*openNode(e){(e.data.li_attr instanceof zd||e.data.li_attr instanceof Bd)&&("Diagram"===e.data.li_attr.pureType?yield(0,x.fl)(this.editorStore.loadDiagram(e.data.li_attr.file,e.data.li_attr.pureId,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10))):yield(0,x.fl)(this.editorStore.loadFile(e.data.li_attr.file,new Kd(e.data.li_attr.file,Number.parseInt(e.data.li_attr.line,10),Number.parseInt(e.data.li_attr.column,10)))))}*pollConceptsActivity(){if(this.loadConceptActivity.isInInitialState){this.loadConceptActivity.inProgress(),this.setStatusText("Loading concepts activity...");try{yield this.pullConceptsActivity()}finally{this.setStatusText(void 0),this.loadConceptActivity.reset()}}}async pullConceptsActivity(){const e=await this.editorStore.client.getConceptActivity();return e.text&&this.setStatusText(`Preparing - ${e.text}`),e.initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullConceptsActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}async movePackageableElements(e,t){let s=[];try{s=(await this.editorStore.client.getPackageableElementsUsage(e.map((e=>e.pureId)))).map((e=>(0,Be.vB)(Qd,e)))}catch{return void this.editorStore.applicationStore.notifyError("Can't find usage for child packageable elements")}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}const i=[];q(s.length===e.length,"Can't find matching usages for packageable elements");for(let n=0;n<s.length;++n){const a=H(e[n]);i.push({pureName:a.pureName,pureType:a.pureType,sourcePackage:H(Ul(a.pureId)),destinationPackage:t,usages:H(s[n]).second})}await(0,x.fl)(this.editorStore.movePackageableElements(i))}async renameConcept(e,t){const s=e.data.li_attr,i=s.pureName??s.pureId;let n=[];try{switch(this.editorStore.applicationStore.setBlockingAlert({message:"Finding concept usages...",showLoading:!0}),s.pureType){case Vd.PROPERTY:case Vd.QUALIFIED_PROPERTY:W(s,zd),n=await this.editorStore.findConceptUsages(Xd.PROPERTY,[`'${s.classPath}'`,`'${s.pureId}'`]);break;case Vd.PACKAGE:{let e=[],s=[];try{s=await this.editorStore.client.getChildPackageableElements(i),e=(await this.editorStore.client.getPackageableElementsUsage(s.map((e=>e.pureId)))).map((e=>(0,Be.vB)(Qd,e)))}catch{return void this.editorStore.applicationStore.notifyError("Can't find usage for child packageable elements")}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}const n=[];q(e.length===s.length,"Can't find matching usages for child packageable elements");const a=Ul(i)?.concat(Ee).concat(t)??t;for(let t=0;t<e.length;++t){const r=H(s[t]),o=H(Ul(r.pureId)),l=a.concat(o.substring(o.indexOf(i)+i.length));n.push({pureName:r.pureName,pureType:r.pureType,sourcePackage:o,destinationPackage:l,usages:H(e[t]).second})}return void await(0,x.fl)(this.editorStore.movePackageableElements(n))}default:n=await this.editorStore.findConceptUsages(Xd.ELEMENT,[`'${s.pureId}'`])}}catch(e){return V(e),void this.editorStore.applicationStore.notifyError(e)}finally{this.editorStore.applicationStore.setBlockingAlert(void 0)}await(0,x.fl)(this.editorStore.renameConcept(i,t,s.pureType,n))}}class Ah{cached;datamarts;text}(0,Be.yu)(Ah,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)()});class Oh extends Ah{error;sessionError}(0,Be.yu)(Oh,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class Sh extends Oh{RO;line;column;source}(0,Be.yu)(Sh,{cached:(0,Be.Ru)(),datamarts:(0,Be.pb)((0,Be.Ru)()),text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class yh{text;reinit}class Ih extends yh{cache;modifiedFiles=[]}(0,Be.yu)(Ih,{text:(0,Be.Ru)(),cache:(0,Be.Ru)(),modifiedFiles:(0,Be.pb)((0,Be.Ru)()),reinit:(0,Be.Ru)()});class vh extends yh{RO;line;column;source;error;sessionError}(0,Be.yu)(vh,{text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)(),sessionError:(0,Be.Ru)()});class Rh{RO;line;column;source}(0,Be.yu)(Rh,{RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)()});class Ph extends yh{jumpTo}(0,Be.yu)(Ph,{text:(0,Be.Ru)(),jumpTo:(0,Be.Ry)(Rh)});class wh{uuid=(0,a.Z)();sourceID;line;column;foundName}(0,Be.yu)(wh,{sourceID:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),foundName:(0,Be.Ru)()});class Lh{uuid=(0,a.Z)();sourceID;line;column;foundName;add;messageToBeModified;fileToBeModified;lineToBeModified;columnToBeModified}(0,Be.yu)(Lh,{sourceID:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),foundName:(0,Be.Ru)(),add:(0,Be.Ru)(),messageToBeModified:(0,Be.Ru)(),fileToBeModified:(0,Be.Ru)(),lineToBeModified:(0,Be.Ru)(),columnToBeModified:(0,Be.Ru)()});class bh extends vh{candidateName;candidatesWithPackageImported=[];candidatesWithPackageNotImported=[]}(0,Be.yu)(bh,{candidateName:(0,Be.Ru)(),candidatesWithPackageImported:(0,Be.pb)((0,Be.Ry)(wh)),candidatesWithPackageNotImported:(0,Be.pb)((0,Be.Ry)(Lh))});class Dh extends vh{candidateName;candidates=[]}(0,Be.yu)(Dh,{candidateName:(0,Be.Ru)(),candidates:(0,Be.pb)((0,Be.Ry)(Lh))});class Mh{id;parentId;file;line;column}(0,Be.yu)(Mh,{id:(0,Be.Ru)(),parentId:(0,Be.Ru)(),file:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)()});class kh{children=[];li_attr;text;type}(0,Be.yu)(kh,{children:(0,Be.pb)((0,Be.Ry)(kh)),li_attr:(0,Be.Ry)(Mh),text:(0,Be.Ru)(),type:(0,Be.Ru)()});class Fh extends yh{count;filterPaths=[];path;relevantTestsOnly;runnerId;tests=[]}(0,Be.yu)(Fh,{count:(0,Be.Ru)(),filterPaths:(0,Be.pb)((0,Be.Ru)()),path:(0,Be.Ru)(),relevantTestsOnly:(0,Be.Ru)(),runnerId:(0,Be.Ru)(),tests:(0,Be.pb)((0,Be.Ry)(kh))});class jh{uuid=(0,a.Z)()}class Uh{before;found;after}(0,Be.yu)(Uh,{after:(0,Be.Ru)(),before:(0,Be.Ru)(),found:(0,Be.Ru)()});class Vh{uuid=(0,a.Z)();sourceId;startLine;startColumn;endLine;endColumn;preview;constructor(e,t,s,i,n){this.sourceId=e,this.startLine=t,this.startColumn=s,this.endLine=i,this.endColumn=n}}(0,Be.yu)(Vh,{sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)(),preview:(0,Be.jt)((0,Be.Ry)(Uh))});class Gh extends jh{sourceId;coordinates=[];constructor(){super(),(0,x.rC)(this,{coordinates:x.LO,dismissCoordinate:x.aD})}setCoordinates(e){this.coordinates=e}dismissCoordinate(e){M(this.coordinates,e)}}(0,Be.yu)(Gh,{sourceId:(0,Be.Ru)(),coordinates:(0,Be.pb)((0,Be.Ry)(Vh))});class $h{editorStore;constructor(e){this.editorStore=e}}class zh extends $h{searchEntries=[];constructor(e,t){super(e),(0,x.rC)(this,{searchEntries:x.LO,numberOfFiles:x.Fl,numberOfResults:x.Fl}),this.searchEntries=t}dismissSearchEntry(e){M(this.searchEntries,e),this.searchEntries.length||this.editorStore.setSearchState(void 0)}get numberOfFiles(){return this.searchEntries.length}get numberOfResults(){return this.searchEntries.flatMap((e=>e.coordinates)).length}}class Bh extends zh{}class Hh extends zh{usageConcept;constructor(e,t,s,i){const n=new Map;s.forEach(((e,t)=>{let s;n.has(e.source)?s=H(n.get(e.source)):(s=new Gh,s.sourceId=e.source,n.set(e.source,s));const a=new Vh(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn);a.preview=i.find((t=>t.sourceId===e.source&&t.startLine===e.startLine&&t.startColumn===e.startColumn&&t.endLine===e.endLine&&t.endColumn===e.endColumn))?.preview,s.coordinates.push(a)})),super(e,Array.from(n.keys()).sort(((e,t)=>e.localeCompare(t))).map((e=>{const t=H(n.get(e));return t.setCoordinates(t.coordinates.sort(((e,t)=>e.startColumn-t.startColumn)).sort(((e,t)=>e.startLine-t.startLine))),t}))),this.usageConcept=t}}class Yh extends $h{result;constructor(e,t){super(e),this.result=t}}class Wh extends $h{result;constructor(e,t){super(e),this.result=t}}var Kh,Zh,Xh;!function(e){e.PASSED="Success",e.FAILED="AssertFail",e.ERROR="Error",e.NOT_RUN="notRan"}(Kh=Kh||(Kh={}));class qh{status;test}class Jh extends qh{test=[]}(0,Be.yu)(Jh,{status:(0,Be.Ru)(),test:(0,Be.pb)((0,Be.Ru)())});class Qh{text;RO;line;column;source;error}(0,Be.yu)(Qh,{text:(0,Be.Ru)(),RO:(0,Be.Ru)(),line:(0,Be.Ru)(),column:(0,Be.Ru)(),source:(0,Be.Ru)(),error:(0,Be.Ru)()});class eu extends qh{test=[];error}(0,Be.yu)(eu,{status:(0,Be.Ru)(),test:(0,Be.pb)((0,Be.Ru)()),error:(0,Be.Ry)(Qh)});class tu{}class su extends tu{finished;tests=[]}(0,Be.yu)(su,{finished:(0,Be.Ru)(),tests:(0,Be.pb)((0,Be.PG)((()=>Be.AM),(e=>e.error?(0,Be.vB)(eu,e):(0,Be.vB)(Jh,e))))});class iu extends tu{error;text}(0,Be.yu)(iu,{error:(0,Be.Ru)(),text:(0,Be.Ru)()}),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.NONE="NONE"}(Zh=Zh||(Zh={})),function(e){e.PASSED="PASSED",e.FAILED="FAILED",e.ERROR="ERROR",e.RUNNING="RUNNING"}(Xh=Xh||(Xh={}));class nu{_START_TIME;total;time=0;passedTests=new Set;failedTests=new Map;testsWithError=new Map;notRunTests;results=new Map;constructor(e){(0,x.rC)(this,{total:x.LO,time:x.LO,passedTests:x.LO,failedTests:x.LO,testsWithError:x.LO,notRunTests:x.LO,results:x.LO,passed:x.Fl,error:x.Fl,failed:x.Fl,passedTestIds:x.Fl,failedTestIds:x.Fl,testWithErrorIds:x.Fl,notRunTestIds:x.Fl,numberOfTestsRun:x.Fl,runPercentage:x.Fl,suiteStatus:x.Fl,setTime:x.aD,addResult:x.aD}),this._START_TIME=Date.now(),this.total=e.size,this.notRunTests=new Set(e)}get passed(){return this.passedTests.size}get error(){return this.testsWithError.size}get failed(){return this.failedTests.size}get passedTestIds(){return Array.from(this.passedTests.values())}get failedTestIds(){return Array.from(this.failedTests.keys())}get testWithErrorIds(){return Array.from(this.testsWithError.keys())}get notRunTestIds(){return Array.from(this.notRunTests.values())}get numberOfTestsRun(){return this.passed+this.error+this.failed}get runPercentage(){return Math.floor(100*this.numberOfTestsRun/this.total)}get suiteStatus(){return this.failed+this.error?Zh.FAILED:this.passed?Zh.PASSED:Zh.NONE}setTime(e){this.time=e}addResult(e,t){switch(this.results.set(t,e),this.notRunTests.delete(t),e.status){case Kh.PASSED:this.passedTests.add(t);break;case Kh.FAILED:this.failedTests.set(t,K(e,eu));break;case Kh.ERROR:this.testsWithError.set(t,K(e,eu));break;default:throw new U(`Unsupported test result status '${e.status}'`)}this.time=Date.now()-this._START_TIME}}class au{editorStore;testExecutionResult;checkTestRunnerState=ft.create();testResultInfo;allTests=new Map;selectedTestId;treeBuildingState=ft.create();treeData;viewAsList=!1;constructor(e,t){(0,x.rC)(this,{testResultInfo:x.LO.ref,allTests:x.LO,selectedTestId:x.LO,treeData:x.LO.ref,viewAsList:x.LO,setViewAsList:x.aD,setSelectedTestId:x.aD,setTestResultInfo:x.aD,setTreeData:x.aD,refreshTree:x.aD,collapseTree:x.aD,expandTree:x.aD,buildTreeDataByLayer:x.aD,pullTestRunnerResult:x.aD,buildTestTreeData:x.ls,pollTestRunnerResult:x.ls,rerunTestSuite:x.ls,cancelTestRun:x.ls}),this.editorStore=e,this.testExecutionResult=t}getTreeData(){return H(this.treeData,"Test tree data has not been initialized")}setViewAsList(e){this.viewAsList=e}setSelectedTestId(e){this.selectedTestId=e}setTestResultInfo(e){this.testResultInfo=e}setTreeData(e){this.treeData=e}refreshTree(){this.setTreeData({...H(this.treeData)})}*buildTestTreeData(){if(this.treeBuildingState.isInProgress)return;this.treeBuildingState.inProgress();const e=this.testExecutionResult.tests.map((e=>{const t=e.li_attr.id;return e.type&&this.allTests.set(t,e),t})),t=new Map;this.treeData={rootIds:e,nodes:t},yield this.buildTreeDataByLayer(this.testExecutionResult.tests),this.treeBuildingState.reset()}collapseTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),this.refreshTree()}expandTree(){this.getTreeData().nodes.forEach((e=>{e.isOpen=!0})),this.refreshTree()}async buildTreeDataByLayer(e){const t=this.getTreeData(),s=[];return await Promise.all(e.map((e=>new Promise(((i,n)=>setTimeout((()=>{const a=e.li_attr.id,r={id:a,label:e.text,data:e,childrenIds:e.type?void 0:[],isLoading:!1};if(e.type&&this.allTests.set(a,e),t.nodes.set(a,r),"Root"!==e.li_attr.parentId)try{const s=H(t.nodes.get((o=e,`test${this.testExecutionResult.runnerId}_${o.li_attr.parentId}`)),`Can't find parent test node with ID '${e.li_attr.parentId}'`);s.childrenIds?b(s.childrenIds,a):s.childrenIds=[a]}catch(e){return void n(e)}var o;s.push(...e.children),i()}),0)))))),s.length?this.buildTreeDataByLayer(s):Promise.resolve()}*pollTestRunnerResult(){if(this.checkTestRunnerState.isInInitialState){this.checkTestRunnerState.inProgress();try{q(this.allTests.size===this.testExecutionResult.count,`Number of tests scanned in tree (${this.allTests.size}) does not match the number of total reported tests (${this.testExecutionResult.count})`);const e=new nu(new Set(this.allTests.keys()));this.testResultInfo=e,yield this.pullTestRunnerResult(e)}finally{this.checkTestRunnerState.reset()}}}async pullTestRunnerResult(e){const t=(s=await this.editorStore.client.checkTestRunner(this.testExecutionResult.runnerId)).error?(0,Be.vB)(iu,s):(0,Be.vB)(su,s);var s;return t instanceof su?(await Promise.all(t.tests.map((t=>L((()=>{return e.addResult(t,(s=t,`test${this.testExecutionResult.runnerId}_${s.test.join("_")}`));var s}))))),t.finished?Promise.resolve():new Promise(((t,s)=>setTimeout((()=>{try{t(this.pullTestRunnerResult(e))}catch(e){V(e),this.editorStore.applicationStore.notifyWarning("Failed to run test"+(e.message?`: ${e.message}`:"")),s(e)}}),1e3)))):(this.setTestResultInfo(void 0),Promise.resolve())}*rerunTestSuite(){this.editorStore.testRunState.isInProgress||(yield(0,x.fl)(this.editorStore.executeTests(this.testExecutionResult.path,this.testExecutionResult.relevantTestsOnly)))}*cancelTestRun(){this.editorStore.testRunState.isInProgress&&(yield this.editorStore.client.cancelTestRunner(this.testExecutionResult.runnerId),this.editorStore.applicationStore.notifyWarning(`Stopped running test (id: ${this.testExecutionResult.runnerId}) successfully!`))}}class ru{}class ou extends ru{error;errorDialog;text}(0,Be.yu)(ou,{error:(0,Be.Ru)(),errorDialog:(0,Be.Ru)(),text:(0,Be.Ru)()});class lu{networkClient;userId="localuser";sessionId=`${this.userId}@${Date.now()}@abcd`;compilerMode;mode;constructor(e){this.networkClient=e}get baseUrl(){return H(this.networkClient.baseUrl,"Pure client has not been configured properly")}initialize=e=>this.networkClient.get(`${this.baseUrl}/initialize`,void 0,void 0,{requestCache:e,sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getInitializationActivity=()=>this.networkClient.get(`${this.baseUrl}/initializationActivity`,void 0,void 0,{sessionId:this.sessionId});getConceptActivity=()=>this.networkClient.get(`${this.baseUrl}/conceptsActivity`,void 0,void 0,{sessionId:this.sessionId});execute=(e,t,s)=>this.networkClient.post(`${this.baseUrl}/${t}`,{extraParams:s,openFiles:e},void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getExecutionActivity=()=>this.networkClient.get(`${this.baseUrl}/executionActivity`,void 0,void 0,{sessionId:this.sessionId});findFiles=(e,t)=>this.networkClient.get(`${this.baseUrl}/findPureFiles`,void 0,void 0,{file:e,regex:t});searchText=(e,t,s,i=2e3)=>this.networkClient.get(`${this.baseUrl}/findInSources`,void 0,void 0,{string:e,caseSensitive:t,regex:s,limit:i});getTextSearchPreview=e=>this.networkClient.post(`${this.baseUrl}/getTextSearchPreview`,e);checkTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCheck`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});cancelTestRunner=e=>this.networkClient.get(`${this.baseUrl}/testRunnerCancel`,void 0,void 0,{sessionId:this.sessionId,testRunnerId:e});getConceptChildren=e=>this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::display_ide(String[1]):String[1]",param:e?`'${e}'`:"'::'",format:"raw",mode:this.mode,sessionId:this.sessionId});getConceptInfo=async(e,t,s)=>{const i=await this.networkClient.get(`${this.baseUrl}/getConceptInfo`,void 0,void 0,{file:e,line:t,column:s});if(i.error)throw new Error(i.text);return i};getUsages=async(e,t)=>{const s=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:e,param:t});return Array.isArray(s)?s:[s]};renameConcept=e=>this.networkClient.put(`${this.baseUrl}/renameConcept`,e);movePackageableElements=e=>this.networkClient.put(`${this.baseUrl}/movePackageableElements`,e);getPackageableElementsUsage=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:Xd.MULTIPLE_PATHS,param:[`'${e.join(",")}'`]});return Array.isArray(t)?t:[t]};getChildPackageableElements=async e=>{const t=await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::getChildPackageableElements_String_1__String_MANY_",param:[`'${e}'`]});return(Array.isArray(t)?t:[t]).map((e=>JSON.parse(e)))};getFile=e=>this.networkClient.get(`${this.baseUrl}/fileAsJson/${e}`,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});getDirectoryChildren=e=>this.networkClient.get(`${this.baseUrl}/dir`,void 0,void 0,{parameters:e??"/",mode:this.mode,sessionId:this.sessionId});updateSource=e=>this.networkClient.put(`${this.baseUrl}/updateSource`,e);createFile=e=>this.networkClient.post(`${this.baseUrl}/newFile/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});createFolder=e=>this.networkClient.post(`${this.baseUrl}/newFolder/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId,mode:this.mode,fastCompile:this.compilerMode});renameFile=(e,t)=>this.networkClient.put(`${this.baseUrl}/renameFile`,{oldPath:e,newPath:t},void 0);deleteDirectoryOrFile=e=>this.networkClient.delete(`${this.baseUrl}/deleteFile/${e}`,void 0,void 0,void 0,{sessionId:this.sessionId});getDiagramInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramInfo_String_1__String_1_",param:[`'${e}'`]}));getDiagramClassInfo=async e=>JSON.parse(await this.networkClient.get(`${this.baseUrl}/execute`,void 0,void 0,{func:"meta::pure::ide::diagram::getDiagramClassInfo_String_1__String_1_",param:[`'${e}'`]}));getSuggestionsForIncompletePath=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/incompletePath`,{path:e,types:t});getSuggestionsForIdentifier=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/identifier`,{importPaths:e,types:t});getSuggestionsForAttribute=(e,t)=>this.networkClient.post(`${this.baseUrl}/suggestion/attribute`,{importPaths:e,path:t});getSuggestionsForClass=e=>this.networkClient.post(`${this.baseUrl}/suggestion/class`,{importPaths:e});getSuggestionsForVariable=(e,t,s)=>this.networkClient.post(`${this.baseUrl}/suggestion/variable`,{sourceId:e,line:t,column:s})}class cu{_initialDefaultSize;_tempSize;size;defaultSize;snapSize;maxSize;constructor(e){this.size=e.initial,this._tempSize=e.default,this.defaultSize=e.default,this._initialDefaultSize=e.default,this.snapSize=e.snap,(0,x.rC)(this,{_tempSize:x.LO,size:x.LO,defaultSize:x.LO,snapSize:x.LO,maxSize:x.LO,isOpen:x.Fl,isMaximizable:x.Fl,isMaximized:x.Fl,setSize:x.aD,open:x.aD,close:x.aD,toggle:x.aD,setMaxSize:x.aD,maximize:x.aD,minimize:x.aD,toggleMaximize:x.aD})}get isOpen(){return 0!==this.size}get isMaximizable(){return void 0!==this.maxSize}get isMaximized(){return void 0!==this.maxSize&&this.size===this.maxSize}setSize(e){e=Math.max(e,0),this.maxSize&&(e=Math.min(e,this.maxSize)),this.size!==e&&(void 0!==this.snapSize?e>this.size?this.maxSize&&e>this.maxSize-this.snapSize?this.size=this.maxSize:this.size=e<this.snapSize?this.defaultSize:e:this.size=e<this.snapSize?0:e:this.size=e)}open(){0===this.size&&(this.size=this._tempSize)}close(){0!==this.size&&(this._tempSize=this.size||this.defaultSize,this.size=0)}toggle(){0===this.size?this.open():this.close()}setMaxSize(e){this._tempSize=Math.min(this._tempSize,e),this.size=Math.min(this.size,e),this.defaultSize=Math.min(this._initialDefaultSize,e),this.maxSize=e}maximize(){void 0!==this.maxSize&&this.size!==this.maxSize&&(this._tempSize=this.size,this.size=this.maxSize)}minimize(){void 0!==this.maxSize&&this.size===this.maxSize&&(this.size=this._tempSize===this.maxSize?this.defaultSize:this._tempSize)}toggleMaximize(){void 0!==this.maxSize&&(this.size===this.maxSize?this.minimize():this.maximize())}}var du,hu=s(1367);class uu{_UUID=(0,a.Z)();_OWNER;name;genericType;multiplicity;stereotypes=[];taggedValues=[];body;parameters;constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return qt([Jt.DERIVED_PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues),ts(this.parameters,this.body)])}}class pu extends Es{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}}class mu extends pu{ownerReference;constructor(e){const t=Ts.create(e.rawType);super(t,e),this.ownerReference=t}static create(e){return new mu(e)}}class _u{_UUID=(0,a.Z)();rawType;constructor(e){this.rawType=e}}class gu{_UUID=(0,a.Z)();_OWNER;name;multiplicity;genericType;aggregation;stereotypes=[];taggedValues=[];constructor(e,t,s,i){this.name=e,this.multiplicity=t,this.genericType=s,this._OWNER=i}get hashCode(){return qt([Jt.PROPERTY,this.name,this.multiplicity,this.genericType.ownerReference.valueForSerialization??"",this.aggregation??"",qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues)])}}class Eu{lowerBound;upperBound;constructor(e,t){this.lowerBound=e,this.upperBound=t}get hashCode(){return qt([Jt.MULTIPLICITY,this.lowerBound.toString(),this.upperBound?.toString()??""])}static ZERO=new Eu(0,0);static ZERO_ONE=new Eu(0,1);static ZERO_MANY=new Eu(0,void 0);static ONE=new Eu(1,1);static ONE_MANY=new Eu(1,void 0)}class fu extends Es{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Jt.PROPERTY_POINTER,this.value.name,this.ownerReference.valueForSerialization??""].map(Xt).join(",")}}class Tu extends fu{ownerReference;constructor(e){const t=Ts.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new Tu(e)}}class Cu extends ls{accept_PackageableElementVisitor(e){return e.visit_PrimitiveType(this)}static STRING=new Cu(xe.STRING);static BOOLEAN=new Cu(xe.BOOLEAN);static BINARY=new Cu(xe.BINARY);static NUMBER=new Cu(xe.NUMBER);static INTEGER=new Cu(xe.INTEGER);static FLOAT=new Cu(xe.FLOAT);static DECIMAL=new Cu(xe.DECIMAL);static DATE=new Cu(xe.DATE);static STRICTDATE=new Cu(xe.STRICTDATE);static DATETIME=new Cu(xe.DATETIME);static STRICTTIME=new Cu(xe.STRICTTIME);static LATESTDATE=new Cu(xe.LATESTDATE)}!function(e){e.NONE="NONE",e.SHARED="SHARED",e.COMPOSITE="COMPOSITE"}(du=du||(du={}));class xu extends hc{association;constructor(e,t,s,i,n){super(e,s,i,n),this.association=t}get hashCode(){return qt([Zo.ASSOCIATION_VIEW,super.hashCode,this.association.valueForSerialization??""])}}const Nu=()=>new os(""),Au=(e,t)=>new gu("",Eu.ONE,mu.create(new _u(e)),t),Ou=(0,x.aD)(((e,t)=>{e.value=t})),Su=((0,x.aD)(((e,t)=>{M(e.properties,t)})),(0,x.aD)(((e,t)=>{b(e.properties,Lo(t))}))),yu=((0,x.aD)(((e,t,s)=>{D(e.properties,t,s)})),(0,x.aD)(((e,t)=>{M(e.derivedProperties,t)})),(0,x.aD)(((e,t)=>{b(e.derivedProperties,bo(t))})),(0,x.aD)(((e,t,s)=>{D(e.derivedProperties,t,s)})),(0,x.aD)(((e,t)=>{b(e.constraints,Mo(t))})),(0,x.aD)(((e,t)=>{M(e.constraints,t)})),(0,x.aD)(((e,t,s)=>{D(e.constraints,t,s)})),(0,x.aD)(((e,t)=>{b(e.generalizations,xo(t))}))),Iu=((0,x.aD)(((e,t)=>{M(e.generalizations,t)})),(0,x.aD)(((e,t,s)=>{D(e.generalizations,t,s)})),(0,x.aD)(((e,t)=>{b(e._subclasses,t)})),(0,x.aD)(((e,t)=>{M(e._subclasses,t)})),(0,x.aD)(((e,t)=>{xo(e),Co(t),e.value=t,e.ownerReference.value=t.rawType}))),vu=((0,x.aD)(((e,t)=>{e.name=t})),(0,x.aD)(((e,t)=>{Iu(e.genericType,Co(t))})),(0,x.aD)(((e,t)=>{e.multiplicity=t})),(0,x.aD)(((e,t)=>{e.aggregation=t})),(0,x.aD)(((e,t)=>{e.value=Oo(t),Ou(e.ownerReference,t._OWNER)})),(0,x.aD)(((e,t)=>{b(e.taggedValues,To(t))})),(0,x.aD)(((e,t)=>{M(e.taggedValues,t)})),(0,x.aD)(((e,t)=>{b(e.stereotypes,Eo(t))})),(0,x.aD)(((e,t)=>{M(e.stereotypes,t)})),(0,x.aD)(((e,t)=>{e.tag.value=So(t),e.tag.ownerReference.value=t._OWNER})),(0,x.aD)(((e,t)=>{e.value=t})),(0,x.aD)(((e,t)=>{e.value=t})),(0,x.aD)(((e,t,s)=>{D(e.taggedValues,t,s)})),(0,x.aD)(((e,t,s)=>{D(e.stereotypes,t,s)})),(0,x.aD)(((e,t)=>{e.name=t})),(0,x.aD)(((e,t)=>{e.functionDefinition=$s(t)})),(0,x.aD)(((e,t)=>{b(e.p_tags,So(t))})),(0,x.aD)(((e,t)=>{M(e.p_tags,t)})),(0,x.aD)(((e,t)=>{b(e.p_stereotypes,Oo(t))})),(0,x.aD)(((e,t)=>{M(e.p_stereotypes,t)})),(0,x.aD)(((e,t,s)=>{D(e.p_tags,t,s)})),(0,x.aD)(((e,t,s)=>{D(e.p_stereotypes,t,s)})),(0,x.aD)(((e,t)=>{M(e.parameters,t)})),(0,x.aD)(((e,t)=>{b(e.parameters,zs(t))})),(0,x.aD)(((e,t)=>{Ou(e.returnType,Uo(t))})),(0,x.aD)(((e,t)=>{e.returnMultiplicity=t})),(0,x.aD)(((e,t,s)=>{D(e.parameters,t,s)})),(0,x.aD)(((e,t)=>{e.name=t})),(0,x.aD)(((e,t)=>{b(e.values,Io(t))})),(0,x.aD)(((e,t)=>{M(e.values,t)})),(0,x.aD)(((e,t,s)=>{D(e.values,t,s)})),(0,x.aD)(((e,t)=>{e.value=Io(t),Ou(e.ownerReference,t._OWNER)})),(0,x.aD)(((e,t,s)=>{const i=((e,t)=>{const s=e.properties.findIndex((e=>e===t));return q(-1!==s,`Can't find property '${t.name}' in association '${e.path}'`),H(e.properties[(s+1)%2])})(e,t),n=K(t.genericType.ownerReference.value,os,`Association property '${t.name}' must be of type 'class'`);var a;((a=n).package||a.name)&&q(M(n.propertiesFromAssociations,i),`Can't find property '${i.name}' from association '${e.path}' in associated class '${n.path}'`),b(s.propertiesFromAssociations,i);const r=new _u(s);t.genericType.value=r,t.genericType.ownerReference.value=r.rawType})),(0,x.aD)(((e,t)=>{e.canonicalUnit=Po(t)})),(0,x.aD)(((e,t)=>{e.conversionFunction=$s(t)})),(0,x.aD)(((e,t)=>{e.classViews=t.map($o)}))),Ru=(0,x.aD)(((e,t)=>{b(e.classViews,$o(t))})),Pu=(0,x.aD)(((e,t)=>{M(e.classViews,t)})),wu=(0,x.aD)(((e,t)=>{e.associationViews=t.map(Yo)})),Lu=(0,x.aD)(((e,t)=>{M(e.associationViews,t)})),bu=(0,x.aD)(((e,t)=>{e.generalizationViews=t.map(Ho)})),Du=(0,x.aD)(((e,t)=>{b(e.generalizationViews,Ho(t))})),Mu=(0,x.aD)(((e,t)=>{M(e.generalizationViews,t)})),ku=(0,x.aD)(((e,t)=>{e.propertyViews=t.map(Wo)})),Fu=(0,x.aD)(((e,t)=>{b(e.propertyViews,Wo(t))})),ju=(0,x.aD)(((e,t)=>{M(e.propertyViews,t)})),Uu=(0,x.aD)(((e,t)=>{e.hideProperties=t})),Vu=(0,x.aD)(((e,t)=>{e.hideStereotypes=t})),Gu=(0,x.aD)(((e,t)=>{e.hideTaggedValues=t})),$u=(0,x.aD)(((e,t)=>{e._offsetX=t})),zu=(0,x.aD)(((e,t)=>{e._offsetY=t})),Bu=(0,x.aD)(((e,t,s)=>{((e,t,s,i=((e,t)=>e===t))=>{const n=e.findIndex((e=>i(e,t)));-1!==n&&(e[n]=s)})(e.path,t,s)})),Hu=(0,x.aD)(Ec),Yu=(0,x.aD)(((e,t,s,i,n)=>{for(const n of e.path)if(Math.sqrt((t-n.x)*(t-n.x)+(s-n.y)*(s-n.y))<10/i)return n;const a=e.buildFullPath(n),r=[];let o;for(let e=0;e<a.length-1;e++){const n=a[e],l=a[e+1],c=new mc(n.x,n.y).normal(new mc(l.x,l.y)).unit(),d=mc.fromPoints(n,new ic(t,s));if(Math.abs(c.dotProduct(d))<5/i){const e=(n.x<l.x?n.x:l.x)-5/i,a=(n.x<l.x?l.x:n.x)+5/i,c=(n.y<l.y?n.y:l.y)-5/i,d=(n.y<l.y?l.y:n.y)+5/i;e<=t&&t<=a&&c<=s&&s<=d&&(o=new ic(t,s),r.push(o))}e<a.length-2&&r.push(a[e+1])}return o&&n&&gc(e,r),o})),Wu=(0,x.aD)(gc),Ku=(0,x.aD)(((e,t)=>{e.rectangle=t})),Zu=(0,x.aD)(((e,t)=>{e.position=t})),Xu=(0,x.aD)((e=>{e._dummyObservable={}}));var qu,Ju,Qu;!function(e){e[e.LAYOUT=0]="LAYOUT",e[e.PAN=1]="PAN",e[e.ZOOM_IN=2]="ZOOM_IN",e[e.ZOOM_OUT=3]="ZOOM_OUT",e[e.ADD_RELATIONSHIP=4]="ADD_RELATIONSHIP",e[e.ADD_CLASS=5]="ADD_CLASS"}(qu=qu||(qu={})),function(e){e[e.PROPERTY=0]="PROPERTY",e[e.INHERITANCE=1]="INHERITANCE",e[e.NONE=2]="NONE"}(Ju=Ju||(Ju={})),function(e){e[e.ALIGN_LEFT=0]="ALIGN_LEFT",e[e.ALIGN_CENTER=1]="ALIGN_CENTER",e[e.ALIGN_RIGHT=2]="ALIGN_RIGHT",e[e.ALIGN_TOP=3]="ALIGN_TOP",e[e.ALIGN_MIDDLE=4]="ALIGN_MIDDLE",e[e.ALIGN_BOTTOM=5]="ALIGN_BOTTOM",e[e.SPACE_HORIZONTALLY=6]="SPACE_HORIZONTALLY",e[e.SPACE_VERTICALLY=7]="SPACE_VERTICALLY"}(Qu=Qu||(Qu={}));const ep=.05,tp=[50,75,90,100,110,125,150,200,250,300,400],sp=e=>(e instanceof uu?"/ ":"")+e.name;class ip{diagram;isReadOnly;div;canvas;ctx;canvasDimension;canvasCenter;virtualScreen;screenOffset;zoom;interactionMode;relationshipMode;triangle;diamond;fontFamily;fontSize;lineHeight;truncateText;maxLineLength;screenPadding;classViewSpaceX;classViewSpaceY;propertySpacing;showScreenGrid;showScreenBoxGuide;screenGridAxisTickLength;screenGridSpacingX;screenGridSpacingY;screenGridLineWidth;screenGridLineColor;screenGridLabelTextColor;screenGuideLineColor;screenGuideLabelTextColor;showCanvasGrid;showCanvasBoxGuide;showScreenOffsetGuide;canvasGridAxisTickLength;canvasGridSpacingX;canvasGridSpacingY;canvasGridLineWidth;canvasGridLineColor;canvasGridLabelTextColor;canvasGuideLineColor;canvasGuideLabelTextColor;screenOffsetGuideLineColor;screenOffsetGuideLabelTextColor;defaultLineWidth;defaultLineColor;canvasColor;backgroundColor;classViewFillColor;classViewHeaderTextColor;classViewPropertyTextColor;classViewPrimitivePropertyTextColor;classViewDerivedPropertyTextColor;relationshipViewTextColor;propertyViewOwnedDiamondColor;propertyViewSharedDiamondColor;generalizationViewInheritanceTriangeFillColor;selectionBoxBorderColor;selection;selectionStart;selectedClassCorner;selectedClassProperty;selectedClasses;selectedPropertyOrAssociation;selectedInheritance;selectedPoint;_selectedClassesInitialPositions;startClassView;handleAddRelationship;mouseOverClassCorner;mouseOverClassName;mouseOverClassView;mouseOverClassProperty;mouseOverPropertyHolderViewLabel;cursorPosition;leftClick;middleClick;rightClick;clickX;clickY;positionBeforeLastMove;onAddClassViewClick=()=>{};onClassViewRightClick=()=>{};onBackgroundDoubleClick;onClassViewDoubleClick;onClassNameDoubleClick;onClassPropertyDoubleClick;handleEditClassView=()=>{};handleEditProperty=()=>{};handleAddSimpleProperty=()=>{};constructor(e,t){(0,x.rC)(this,{isReadOnly:x.LO,interactionMode:x.LO,relationshipMode:x.LO,zoom:x.LO,mouseOverClassView:x.LO,mouseOverClassName:x.LO,mouseOverClassCorner:x.LO,mouseOverClassProperty:x.LO,mouseOverPropertyHolderViewLabel:x.LO,selectionStart:x.LO,selectedClassCorner:x.LO,selectedClasses:x.LO,selectedPropertyOrAssociation:x.LO,selectedInheritance:x.LO,leftClick:x.LO,middleClick:x.LO,rightClick:x.LO,changeMode:x.aD,setIsReadOnly:x.aD,setMouseOverClassView:x.aD,setMouseOverClassName:x.aD,setMouseOverClassCorner:x.aD,setMouseOverClassProperty:x.aD,setMouseOverPropertyHolderViewLabel:x.aD,setSelectionStart:x.aD,setSelectedClassCorner:x.aD,setSelectedClasses:x.aD,setSelectedPropertyOrAssociation:x.aD,setSelectedInheritance:x.aD,setLeftClick:x.aD,setMiddleClick:x.aD,setRightClick:x.aD,setZoomLevel:x.aD,align:x.aD}),this.diagram=t,this.div=e,this.div.childNodes.forEach((e=>this.div.removeChild(e))),this.canvas=document.createElement("canvas"),this.canvasDimension=new nc(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new ic(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height,this.canvas.style.position="absolute",this.canvas.style.left="0",this.canvas.style.top="0",this.div.appendChild(this.canvas),this.ctx=this.canvas.getContext("2d"),this.screenOffset=new ic(0,0),this.virtualScreen=new ac(new ic(0,0),new nc(0,0)),this.zoom=1,this.triangle=[new ic(0,0),new ic(-15,-10),new ic(-15,10)],this.diamond=[new ic(0,0),new ic(-10,-5),new ic(-20,0),new ic(-10,5)],this.fontFamily="Arial",this.fontSize=12,this.lineHeight=14,this.truncateText=!0,this.maxLineLength=40,this.showScreenGrid=!1,this.showScreenBoxGuide=!0,this.screenGridAxisTickLength=50,this.screenGridSpacingX=100,this.screenGridSpacingY=100,this.screenGridLineWidth=.5,this.showCanvasGrid=!1,this.showCanvasBoxGuide=!0,this.showScreenOffsetGuide=!0,this.canvasGridAxisTickLength=50,this.canvasGridSpacingX=100,this.canvasGridSpacingY=100,this.canvasGridLineWidth=.5,this.defaultLineWidth=1,this.screenGridLineColor="rgba(61,126,154,0.56)",this.screenGridLabelTextColor="rgba(61,126,154,0.56)",this.screenGuideLineColor="red",this.screenGuideLabelTextColor="red",this.canvasGridLineColor="green",this.canvasGridLabelTextColor="green",this.canvasGuideLineColor="orange",this.canvasGuideLabelTextColor="orange",this.screenOffsetGuideLineColor="purple",this.screenOffsetGuideLabelTextColor="purple",this.defaultLineColor="rgb(0,0,0)",this.canvasColor="rgb(220,220,220)",this.backgroundColor="rgb(255,255,255)",this.classViewFillColor="rgb(185,185,185)",this.classViewHeaderTextColor="rgb(0,0,0)",this.classViewPropertyTextColor="rgb(0,0,0)",this.classViewPrimitivePropertyTextColor="rgb(255,255,255)",this.classViewDerivedPropertyTextColor="rgb(100,100,100)",this.relationshipViewTextColor="rgb(0,0,0)",this.propertyViewSharedDiamondColor="rgb(255,255,255)",this.propertyViewOwnedDiamondColor="rgb(0,0,0)",this.generalizationViewInheritanceTriangeFillColor="rgb(255,255,255)",this.selectionBoxBorderColor="rgba(0,0,0, 0.02)",this.interactionMode=qu.LAYOUT,this.relationshipMode=Ju.NONE,this.isReadOnly=!1,this.screenPadding=20,this.classViewSpaceX=10,this.classViewSpaceY=4,this.propertySpacing=10,this.selectionStart=void 0,this.selection=void 0,this.selectedClasses=[],this._selectedClassesInitialPositions=[],this.cursorPosition=new ic(0,0),this.leftClick=!1,this.middleClick=!1,this.rightClick=!1,this.clickX=0,this.clickY=0,this.positionBeforeLastMove=new ic(0,0),this.div.onwheel=this.mousewheel.bind(this),this.div.onmousedown=this.mousedown.bind(this),this.div.onkeydown=this.keydown.bind(this),this.div.ondblclick=this.mousedblclick.bind(this),this.div.onmouseup=this.mouseup.bind(this),this.div.onmousemove=this.mousemove.bind(this)}setIsReadOnly(e){this.isReadOnly=e}setMouseOverClassView(e){this.mouseOverClassView=e}setMouseOverClassName(e){this.mouseOverClassName=e}setMouseOverClassCorner(e){this.mouseOverClassCorner=e}setMouseOverClassProperty(e){this.mouseOverClassProperty=e}setMouseOverPropertyHolderViewLabel(e){this.mouseOverPropertyHolderViewLabel=e}setSelectionStart(e){this.selectionStart=e}setSelectedClassCorner(e){this.selectedClassCorner=e}setSelectedClasses(e){this.selectedClasses=e}setSelectedPropertyOrAssociation(e){this.selectedPropertyOrAssociation=e}setSelectedInheritance(e){this.selectedInheritance=e}setLeftClick(e){this.leftClick=e}setMiddleClick(e){this.middleClick=e}setRightClick(e){this.rightClick=e}setZoomLevel(e){this.zoom=e}render(){this.diagram.classViews.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),this.refresh()}refresh(){this.refreshCanvas(),this.drawScreen()}refreshCanvas(){this.canvasDimension=new nc(this.div.offsetWidth,this.div.offsetHeight),this.canvasCenter=new ic(this.canvasDimension.width/2,this.canvasDimension.height/2),this.canvas.width=this.canvasDimension.width,this.canvas.height=this.canvasDimension.height}clearScreen(){this.ctx.fillStyle=this.canvasColor,this.ctx.fillRect(0,0,this.canvasDimension.width,this.canvasDimension.height)}drawScreen(){this.manageVirtualScreen(),this.clearScreen(),this.drawAll()}autoRecenter(){this.center(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}center(e,t){this.screenOffset=new ic(-e+this.canvasCenter.x,-t+this.canvasCenter.y),this.refresh()}changeMode(e,t){switch(e){case qu.LAYOUT:case qu.PAN:case qu.ZOOM_IN:case qu.ZOOM_OUT:case qu.ADD_CLASS:if(t!==Ju.NONE)throw new j(`Can't change to '${e}' mode: relationship mode should not be specified in layout mode`);break;case qu.ADD_RELATIONSHIP:if(t===Ju.NONE)throw new j("Can't switch to relationship mode: relationship mode is not specified");break;default:throw new U(`Can't switch to mode '${e}': unsupported mode`)}if(this.interactionMode=e,this.relationshipMode=t,e===qu.ADD_RELATIONSHIP)switch(t){case Ju.INHERITANCE:this.handleAddRelationship=(e,t)=>{if(e.class.value===t.class.value||Kl(e.class.value).includes(t.class.value)||Kl(t.class.value).includes(e.class.value)||yu(e.class.value,mu.create(new _u(t.class.value))),e.class.value.generalizations.find((e=>e.value.rawType===t.class.value))){const s=new pc(this.diagram,e,t);return Du(this.diagram,s),s}};break;case Ju.PROPERTY:this.handleAddRelationship=(e,t)=>{const s=new gu(`property_${e.class.value.properties.length+1}`,Eu.ONE,mu.create(new _u(t.class.value)),e.class.value);if(Su(e.class.value,s),e!==t){const i=new uc(this.diagram,Tu.create(s),e,t);return Fu(this.diagram,i),i}};break;default:throw new U(`Can't switch to relationship mode '${t}': unsupported mode`)}}align(e){if(!(this.selectedClasses.length<2)){switch(e){case Qu.ALIGN_LEFT:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.x)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Zu(t,new ic(e,t.position.y))));break}case Qu.ALIGN_CENTER:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.x+t.rectangle.width/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>Zu(t,new ic(e-t.rectangle.width/2,t.position.y))));break}case Qu.ALIGN_RIGHT:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.x+t.rectangle.width)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Zu(t,new ic(e-t.rectangle.width,t.position.y))));break}case Qu.ALIGN_TOP:{const e=this.selectedClasses.reduce(((e,t)=>Math.min(e,t.position.y)),Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Zu(t,new ic(t.position.x,e))));break}case Qu.ALIGN_MIDDLE:{const e=this.selectedClasses.reduce(((e,t)=>e+t.position.y+t.rectangle.height/2),0)/this.selectedClasses.length;this.selectedClasses.forEach((t=>Zu(t,new ic(t.position.x,e-t.rectangle.height/2))));break}case Qu.ALIGN_BOTTOM:{const e=this.selectedClasses.reduce(((e,t)=>Math.max(e,t.position.y+t.rectangle.height)),-Number.MAX_SAFE_INTEGER);this.selectedClasses.forEach((t=>Zu(t,new ic(t.position.x,e-t.rectangle.height))));break}case Qu.SPACE_HORIZONTALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.x-t.position.x));if(2===e.length){const t=e[0],s=e[1];Zu(s,new ic(t.position.x+t.rectangle.width,s.position.y))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.x-(i.position.x+i.rectangle.width))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];Zu(n,new ic(i.position.x+i.rectangle.width+s,n.position.y))}}break}case Qu.SPACE_VERTICALLY:{const e=this.selectedClasses.slice().sort(((e,t)=>e.position.y-t.position.y));if(2===e.length){const t=e[0],s=e[1];Zu(s,new ic(s.position.x,t.position.y+t.rectangle.height))}else{const t=[];for(let s=1;s<e.length;s++){const i=e[s-1],n=e[s];t.push(n.position.y-(i.position.y+i.rectangle.height))}const s=t.reduce(((e,t)=>e+t),0)/t.length;for(let t=1;t<e.length;t++){const i=e[t-1],n=e[t];Zu(n,new ic(n.position.x,i.position.y+i.rectangle.height+s))}}break}}this.drawScreen()}}truncateTextWithEllipsis(e,t=this.maxLineLength){return e.length>t?`${e.substring(0,t+1-"...".length)}...`:e}canvasCoordinateToModelCoordinate(e){return new ic((e.x-this.canvasCenter.x)/this.zoom-this.screenOffset.x+this.canvasCenter.x,(e.y-this.canvasCenter.y)/this.zoom-this.screenOffset.y+this.canvasCenter.y)}modelCoordinateToCanvasCoordinate(e){return new ic((e.x-this.canvasCenter.x+this.screenOffset.x)*this.zoom+this.canvasCenter.x,(e.y-this.canvasCenter.y+this.screenOffset.y)*this.zoom+this.canvasCenter.y)}eventCoordinateToCanvasCoordinate(e){return new ic(e.x-this.divPosition.x+this.div.scrollLeft,e.y-this.divPosition.y+this.div.scrollTop)}canvasCoordinateToEventCoordinate(e){return new ic(e.x-this.div.scrollLeft+this.divPosition.x,e.y-this.div.scrollTop+this.divPosition.y)}hasPropertyView(e,t){return this.diagram.propertyViews.filter((s=>s.property.value===t&&s.from.classView.value===e)).length>0}get divPosition(){return(e=>{let t=0,s=0;for(;e.offsetParent;)t+=e.offsetLeft-e.scrollLeft+e.clientLeft,s+=e.offsetTop-e.scrollTop+e.clientTop,e=e.offsetParent;return new ic(t,s)})(this.div)}manageVirtualScreen(){if(this.diagram.classViews.length){const e=H(this.diagram.classViews[0]);let t=e.position.x,s=e.position.y,i=e.position.x+e.rectangle.width,n=e.position.y+e.rectangle.height;for(const e of this.diagram.classViews)t=Math.min(t,e.position.x),s=Math.min(s,e.position.y),i=Math.max(i,e.position.x+e.rectangle.width),n=Math.max(n,e.position.y+e.rectangle.height);const a=this.diagram.associationViews.concat(this.diagram.generalizationViews).concat(this.diagram.propertyViews);for(const e of a){const a=dc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(e instanceof uc){const r=this.drawLinePropertyText(a[a.length-2],a[a.length-1],e.to.classView.value,e.property.value,!1);t=Math.min(t,r.position.x),s=Math.min(s,r.position.y),i=Math.max(i,Cc(r).x),n=Math.max(n,Cc(r).y)}for(const a of e.path)t=Math.min(t,a.x),s=Math.min(s,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y)}this.virtualScreen=new ac(new ic(t,s),new nc(i-t,n-s))}else this.setZoomLevel(1),this.screenOffset=new ic(0,0),this.virtualScreen=new ac(new ic(this.canvasDimension.width/2,this.canvasDimension.height/2),new nc(0,0))}executeZoom(e,t){e=Math.max(e,ep);const s=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(t)),i=this.zoom;this.setZoomLevel(e),this.screenOffset=new ic(((s.x-this.canvasCenter.x)*(i-e)+this.screenOffset.x*i)/e,((s.y-this.canvasCenter.y)*(i-e)+this.screenOffset.y*i)/e),this.clearScreen(),this.drawAll()}zoomPoint(e,t){this.executeZoom(e,t)}zoomCenter(e){this.setZoomLevel(Math.max(e,ep)),this.clearScreen(),this.drawAll()}zoomToFit(){this.autoRecenter(),this.zoomCenter(Math.max(Math.min(this.canvas.width/(this.virtualScreen.rectangle.width+2*this.screenPadding+20),this.canvas.height/(this.virtualScreen.rectangle.height+2*this.screenPadding+20)),ep))}addClassView(e,t){if(!this.isReadOnly){const s=this.diagram.classViews.map((e=>e.id));let i=(0,a.Z)();for(;s.includes(i);)i=(0,a.Z)();const n=new rc(this.diagram,i,Ts.create(e));return Zu(n,t??this.canvasCoordinateToModelCoordinate(new ic(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2,this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2))),Ru(this.diagram,n),Xu(n),this.diagram.classViews.filter((t=>t.class.value!==e)).forEach((t=>{const s=t.class.value;e.generalizations.map((e=>e.value.rawType)).includes(s)&&Du(this.diagram,new pc(this.diagram,n,t)),s.generalizations.map((e=>e.value.rawType)).includes(e)&&Du(this.diagram,new pc(this.diagram,t,n)),Zl(e).forEach((e=>{e.genericType.value.rawType===s&&Fu(this.diagram,new uc(this.diagram,Tu.create(e),n,t))})),Zl(s).forEach((s=>{s.genericType.value.rawType===e&&Fu(this.diagram,new uc(this.diagram,Tu.create(s),t,n))}))})),this.drawClassView(n),this.drawScreen(),n}}drawBoundingBox(){this.ctx.fillStyle=this.backgroundColor,this.ctx.lineWidth=1,this.ctx.fillRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom),this.ctx.strokeRect((this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x-this.screenPadding)*this.zoom+this.canvasCenter.x,(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y-this.screenPadding)*this.zoom+this.canvasCenter.y,(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom)}drawDiagram(){this.diagram.associationViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.generalizationViews.forEach((e=>this.drawInheritance(e))),this.diagram.propertyViews.forEach((e=>this.drawPropertyOrAssociation(e))),this.diagram.classViews.forEach((e=>this.drawClassView(e))),this.showCanvasGrid&&this.drawCanvasGrid(),this.showScreenGrid&&this.drawScreenGrid()}drawAll(){this.drawBoundingBox(),this.drawDiagram()}drawScreenGrid(){const e=(this.virtualScreen.position.x+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t=(this.virtualScreen.position.y+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y,s=(this.virtualScreen.rectangle.width+2*this.screenPadding)*this.zoom,i=(this.virtualScreen.rectangle.height+2*this.screenPadding)*this.zoom;this.ctx.beginPath(),this.ctx.fillStyle=this.screenGridLabelTextColor,this.ctx.strokeStyle=this.screenGridLineColor,this.ctx.lineWidth=this.screenGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`;let n=0;for(let a=e;a<e+s-2*this.screenPadding;a+=this.screenGridSpacingX*this.zoom)this.ctx.fillText(`${n}`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+n)}]`,a+5*this.zoom,t-(this.screenGridAxisTickLength+this.screenPadding-this.lineHeight)*this.zoom),this.ctx.moveTo(a,t-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom),this.ctx.lineTo(a,t+i-this.screenPadding*this.zoom),this.ctx.stroke(),n+=this.screenGridSpacingX;let a=0;for(let n=t;n<t+i-2*this.screenPadding;n+=this.screenGridSpacingY*this.zoom)this.ctx.fillText(`${a}`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+a)}]`,e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n+(5+this.lineHeight)*this.zoom),this.ctx.moveTo(e-(this.screenGridAxisTickLength+this.screenPadding)*this.zoom,n),this.ctx.lineTo(e+s-this.screenPadding*this.zoom,n),this.ctx.stroke(),a+=this.screenGridSpacingY;this.showScreenBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.screenGuideLabelTextColor,this.ctx.strokeStyle=this.screenGuideLineColor,this.ctx.moveTo(e,t),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.stroke(),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t),this.ctx.lineTo(e,t),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.width/2)}`,e+s/2-(this.screenPadding-5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.x+this.virtualScreen.rectangle.width/2)}]`,e+s/2-(this.screenPadding-5)*this.zoom,t+(5+this.lineHeight)*this.zoom),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t),this.ctx.lineTo(e+s/2-this.screenPadding*this.zoom,t+i-2*this.screenPadding*this.zoom),this.ctx.stroke(),this.ctx.fillText(`${Math.round(this.virtualScreen.rectangle.height/2)}`,e+5*this.zoom,t+i/2-(this.screenPadding-5)*this.zoom),this.ctx.fillText(`[${Math.round(this.virtualScreen.position.y+this.virtualScreen.rectangle.height/2)}]`,e+5*this.zoom,t+i/2-(this.screenPadding-5-this.lineHeight)*this.zoom),this.ctx.lineTo(e,t+i/2-this.screenPadding*this.zoom),this.ctx.lineTo(e+s-2*this.screenPadding*this.zoom,t+i/2-this.screenPadding*this.zoom),this.ctx.stroke()),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawCanvasGrid(){const e=-this.canvasCenter.x*this.zoom+this.canvasCenter.x,t=-this.canvasCenter.y*this.zoom+this.canvasCenter.y,s=this.canvasDimension.width,i=this.canvasDimension.height;this.ctx.setLineDash([5,5]),this.ctx.fillStyle=this.canvasGridLabelTextColor,this.ctx.strokeStyle=this.canvasGridLineColor,this.ctx.lineWidth=this.canvasGridLineWidth,this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,this.ctx.beginPath();let n=0;for(let t=e;t<s;t+=this.canvasGridSpacingX*this.zoom)0!==t&&this.ctx.fillText(`[${Math.round(n)}]`,t+5*this.zoom,5*this.zoom),this.ctx.moveTo(t,0),this.ctx.lineTo(t,i),this.ctx.stroke(),n+=this.canvasGridSpacingX;let a=0;for(let e=t;e<i;e+=this.canvasGridSpacingY*this.zoom)0!==e&&this.ctx.fillText(`[${Math.round(a)}]`,5*this.zoom,e+5*this.zoom),this.ctx.moveTo(0,e),this.ctx.lineTo(s,e),this.ctx.stroke(),a+=this.canvasGridSpacingY;if(this.showCanvasBoxGuide&&(this.ctx.beginPath(),this.ctx.fillStyle=this.canvasGuideLabelTextColor,this.ctx.strokeStyle=this.canvasGuideLineColor,this.ctx.fillText(`[${Math.round(s/2)}]`,s/2+5*this.zoom,5*this.zoom),this.ctx.moveTo(s/2,0),this.ctx.lineTo(s/2,i),this.ctx.stroke(),this.ctx.fillText(`[${Math.round(i/2)}]`,5*this.zoom,i/2+5*this.zoom),this.ctx.moveTo(0,i/2),this.ctx.lineTo(s,i/2),this.ctx.stroke()),this.showScreenOffsetGuide){const s=5,i=35;this.ctx.beginPath(),this.ctx.setLineDash([]),this.ctx.fillStyle=this.screenOffsetGuideLabelTextColor,this.ctx.strokeStyle=this.screenOffsetGuideLineColor,this.ctx.arc(e+this.screenOffset.x*this.zoom,t+this.screenOffset.y*this.zoom,s*this.zoom,0,2*Math.PI),this.ctx.moveTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x+2*s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y+2*s)*this.zoom),this.ctx.stroke(),this.ctx.setLineDash([5,5]),this.ctx.moveTo(e,t+this.screenOffset.y*this.zoom),this.ctx.lineTo(e+(this.screenOffset.x-s)*this.zoom,t+this.screenOffset.y*this.zoom),this.ctx.moveTo(e+this.screenOffset.x*this.zoom,t+0),this.ctx.lineTo(e+this.screenOffset.x*this.zoom,t+(this.screenOffset.y-s)*this.zoom),this.ctx.stroke(),this.ctx.beginPath(),this.screenOffset.x>=i&&this.screenOffset.y>=i?(this.ctx.fillText(`[${Math.round(this.screenOffset.x)}]`,e+(this.screenOffset.x+5)*this.zoom,t+5*this.zoom),this.ctx.fillText(`[${Math.round(this.screenOffset.y)}]`,e+5*this.zoom,t+(this.screenOffset.y+5)*this.zoom)):this.screenOffset.x>=0&&this.screenOffset.y>=0?this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(this.screenOffset.x+s+5)*this.zoom,t+(this.screenOffset.y+s+5)*this.zoom):this.ctx.fillText(`Δ [${Math.round(this.screenOffset.x)},${Math.round(this.screenOffset.y)}]`,e+(s+5)*this.zoom,t+(s+5)*this.zoom)}this.ctx.setLineDash([]),this.ctx.strokeStyle=this.defaultLineColor,this.ctx.lineWidth=this.defaultLineWidth}drawClassViewProperty(e,t,s,i,n){this.ctx.font=this.mouseOverClassView===e&&this.mouseOverClassProperty===t?`bold ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`:`${n?"bold":""} ${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const a=sp(t);let r=this.ctx.measureText(`${a} : `).width;n||(this.ctx.fillText(`${a} : `,s,i),this.ctx.fillText(t.genericType.value.rawType.name,s+r,i),t.genericType.value.rawType instanceof cs&&(this.ctx.beginPath(),this.ctx.moveTo(s+r,i+(this.fontSize-1)*this.zoom),this.ctx.lineTo(s+r+this.ctx.measureText(t.genericType.value.rawType.name).width,i+(this.fontSize-1)*this.zoom),this.ctx.stroke())),r+=this.ctx.measureText(t.genericType.value.rawType.name).width,this.ctx.font=`${(this.fontSize-1)*(n?1:this.zoom)}px ${this.fontFamily}`;const o=Ve(t.multiplicity.lowerBound,t.multiplicity.upperBound);return n||this.ctx.fillText(`[${o}]`,s+r,i),r+=this.ctx.measureText(`[${o}]`).width,r}computeClassNameWidth(e){return this.ctx.font=`bold ${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top",this.ctx.measureText(this.truncateTextWithEllipsis(e.class.value.name)).width}ensureClassViewMeetMinDimensions(e){let t=this.computeClassNameWidth(e),s=this.lineHeight+2*this.classViewSpaceY;if(!e.hideStereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;for(const i of e.class.value.stereotypes){const e=`<< ${this.truncateTextWithEllipsis(i.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(!e.hideTaggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`,this.ctx.textBaseline="top";for(const i of e.class.value.taggedValues){const e=`{ ${this.truncateTextWithEllipsis(`${i.tag.value.value} = ${i.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(e).width;t=Math.max(t,n),s+=this.lineHeight}}if(e.hideProperties||(Zl(e.class.value).forEach((i=>{if(!this.hasPropertyView(e,i)){const n=this.drawClassViewProperty(e,i,0,0,!0);t=Math.max(t,n),s+=this.lineHeight}})),s+=2*this.classViewSpaceY),t+=2*this.classViewSpaceX,!this.isReadOnly){const i=e.rectangle.width&&e.rectangle.width>t?e.rectangle.width:t,n=e.rectangle.height&&e.rectangle.height>s?e.rectangle.height:s;Ku(e,new nc(i,n))}}drawClassView(e){const t=this.computeClassNameWidth(e);this.ensureClassViewMeetMinDimensions(e),this.ctx.fillStyle=this.classViewFillColor;const s=this.modelCoordinateToCanvasCoordinate(e.position);this.ctx.fillRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom),this.ctx.lineWidth=0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(e)?2:1,this.ctx.strokeRect(s.x,s.y,e.rectangle.width*this.zoom,e.rectangle.height*this.zoom);const i=e.position.x,n=e.position.y;this.ctx.lineWidth=1,this.ctx.fillStyle=this.classViewHeaderTextColor;let a=n;if(this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,!e.hideStereotypes)for(const t of e.class.value.stereotypes){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`<< ${this.truncateTextWithEllipsis(t.value.value,this.maxLineLength-6)} >>`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}this.ctx.font=`bold ${this.fontSize*this.zoom}px ${this.fontFamily}`;const r=this.truncateTextWithEllipsis(e.class.value.name);if(this.ctx.fillText(r,(i+this.screenOffset.x+(e.rectangle.width-t)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight,!e.hideTaggedValues)for(const t of e.class.value.taggedValues){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const s=`{ ${this.truncateTextWithEllipsis(`${t.tag.value.value} = ${t.value}`,this.maxLineLength-4)} }`,n=this.ctx.measureText(s).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`,this.ctx.fillText(s,(i+this.screenOffset.x+(e.rectangle.width-n)/2-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,(a+this.screenOffset.y+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y),a+=this.lineHeight}if(a+=3*this.classViewSpaceY,!e.hideProperties){this.ctx.beginPath();const t=(n+this.screenOffset.y+this.lineHeight+(e.hideStereotypes?0:e.class.value.stereotypes.length*this.lineHeight)+(e.hideTaggedValues?0:e.class.value.taggedValues.length*this.lineHeight)+this.classViewSpaceY-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.ctx.moveTo((i+this.screenOffset.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.lineTo((i+this.screenOffset.x+e.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,t),this.ctx.stroke();for(const t of Zl(e.class.value))if(!this.hasPropertyView(e,t)){this.ctx.fillStyle=t instanceof uu?this.classViewDerivedPropertyTextColor:t.genericType.value.rawType instanceof Cu?this.classViewPrimitivePropertyTextColor:this.classViewPropertyTextColor;const s=(i+this.screenOffset.x+this.classViewSpaceX-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,n=(a+this.screenOffset.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y;this.drawClassViewProperty(e,t,s,n,!1),a+=this.lineHeight}}Xu(e)}drawLinePropertyNameAndMultiplicity(e,t,s,i,n,a){this.ctx.font=`${this.fontSize}px ${this.fontFamily}`;const r=sp(e),o=Ve(e.multiplicity.lowerBound,e.multiplicity.upperBound),l=this.ctx.measureText(r).width,c=this.ctx.measureText(o).width;this.ctx.font=`${this.fontSize*this.zoom}px ${this.fontFamily}`;const d=t(l),h=s(l),u=this.modelCoordinateToCanvasCoordinate(new ic(t(l),s(l)));a||this.ctx.fillText(r,u.x,u.y);const p=i(c),m=n(c),_=this.modelCoordinateToCanvasCoordinate(new ic(i(c),n(c)));a||this.ctx.fillText(o,_.x,_.y);const g=new ic(Math.min(d,p),Math.min(h,m));return new ac(g,new nc(Math.max(d,p)+Math.max(l,c)-g.x,Math.max(h,m)+this.lineHeight-g.y))}drawLinePropertyText(e,t,s,i,n){this.ctx.textBaseline="top",this.ctx.fillStyle=this.relationshipViewTextColor;const a=e.x,r=e.y,o=t.x,l=t.y,c=s.rectangle;if(r<l){const e=a+(o-a)/(l-r)*(s.position.y-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y-this.lineHeight-this.propertySpacing),n)}else{const e=a+(o-a)/(l-r)*(s.position.y+c.height-r);if(e>s.position.x&&e<s.position.x+c.width)return this.drawLinePropertyNameAndMultiplicity(i,(t=>e<s.position.x+c.width/2?e+this.propertySpacing:e-t-this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),(t=>e<s.position.x+c.width/2?e-t-this.propertySpacing:e+this.propertySpacing),(e=>s.position.y+c.height+this.propertySpacing),n)}if(a<o){const e=r+(l-r)/(o-a)*(s.position.x-a);if(e>s.position.y&&e<s.position.y+c.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x-e-this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}else{const e=r+(l-r)/(o-a)*(s.position.x+s.rectangle.width-a);if(e>s.position.y&&e<s.position.y+s.rectangle.height)return this.drawLinePropertyNameAndMultiplicity(i,(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e+this.propertySpacing:e-this.lineHeight-this.propertySpacing),(e=>s.position.x+s.rectangle.width+this.propertySpacing),(t=>e<s.position.y+s.rectangle.height/2?e-this.lineHeight-this.propertySpacing:e+this.propertySpacing),n)}return new ac(new ic(0,0),new nc(0,0))}drawPropertyOrAssociation(e){const t=dc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),s=e.property.value;if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,s,!1),this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedPropertyOrAssociation?2:1,t.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke(),this.ctx.lineWidth=1,s instanceof gu){const i=t[1],n=t[0],a=i.x,r=i.y,o=n.x,l=n.y,c=e.from;let d=0,h=0;if(l>r){const e=a+(o-a)/(l-r)*(c.classView.value.position.y-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=a+(o-a)/(l-r)*(c.classView.value.position.y+c.classView.value.rectangle.height-r);e>c.classView.value.position.x&&e<c.classView.value.position.x+c.classView.value.rectangle.width&&(d=(e-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(c.classView.value.position.y+c.classView.value.rectangle.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(o>a){const e=r+(l-r)/(o-a)*(c.classView.value.position.x-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const e=r+(l-r)/(o-a)*(c.classView.value.position.x+c.classView.value.rectangle.width-a);e>c.classView.value.position.y&&e<c.classView.value.position.y+c.classView.value.rectangle.height&&(d=(c.classView.value.position.x+c.classView.value.rectangle.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,h=(e-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(s.aggregation===du.COMPOSITE||s.aggregation===du.SHARED){let e=Math.atan((l-r)/(o-a));e=o>=a?e:e+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(d+(this.screenOffset.x+fc(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+Tc(this.diamond[0],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+fc(this.diamond[1],e))*this.zoom,h+(this.screenOffset.y+Tc(this.diamond[1],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+fc(this.diamond[2],e))*this.zoom,h+(this.screenOffset.y+Tc(this.diamond[2],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+fc(this.diamond[3],e))*this.zoom,h+(this.screenOffset.y+Tc(this.diamond[3],e))*this.zoom),this.ctx.lineTo(d+(this.screenOffset.x+fc(this.diamond[0],e))*this.zoom,h+(this.screenOffset.y+Tc(this.diamond[0],e))*this.zoom),s.aggregation===du.SHARED&&(this.ctx.fillStyle=this.propertyViewSharedDiamondColor),s.aggregation===du.COMPOSITE&&(this.ctx.fillStyle=this.propertyViewOwnedDiamondColor),this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}}}drawInheritance(e){const t=e.to.classView.value.rectangle,s=dc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value),i=s[s.length-2].x,n=s[s.length-2].y,a=s[s.length-1].x,r=s[s.length-1].y;let o=0,l=0;if(r>n){const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=i+(a-i)/(r-n)*(e.to.classView.value.position.y+t.height-n);s>e.to.classView.value.position.x&&s<e.to.classView.value.position.x+t.width&&(o=(s-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(e.to.classView.value.position.y+t.height-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}if(a>i){const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}else{const s=n+(r-n)/(a-i)*(e.to.classView.value.position.x+t.width-i);s>e.to.classView.value.position.y&&s<e.to.classView.value.position.y+t.height&&(o=(e.to.classView.value.position.x+t.width-this.canvasCenter.x)*this.zoom+this.canvasCenter.x,l=(s-this.canvasCenter.y)*this.zoom+this.canvasCenter.y)}this.ctx.beginPath(),this.ctx.lineWidth=e===this.selectedInheritance?2:1,s.forEach(((e,t)=>{const s=this.modelCoordinateToCanvasCoordinate(e);0===t?this.ctx.moveTo(s.x,s.y):this.ctx.lineTo(s.x,s.y)})),this.ctx.stroke();let c=Math.atan((r-n)/(a-i));c=a>=i?c:c+Math.PI,this.ctx.beginPath(),this.ctx.moveTo(o+(this.screenOffset.x+fc(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+Tc(this.triangle[0],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+fc(this.triangle[1],c))*this.zoom,l+(this.screenOffset.y+Tc(this.triangle[1],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+fc(this.triangle[2],c))*this.zoom,l+(this.screenOffset.y+Tc(this.triangle[2],c))*this.zoom),this.ctx.lineTo(o+(this.screenOffset.x+fc(this.triangle[0],c))*this.zoom,l+(this.screenOffset.y+Tc(this.triangle[0],c))*this.zoom),this.ctx.fillStyle=this.generalizationViewInheritanceTriangeFillColor,this.ctx.fill(),this.ctx.stroke(),this.ctx.lineWidth=1}reorderDiagramDomain(e,t){const s=t.classViews.filter((t=>t!==e));return s.push(e),s}potentiallyShiftRelationships(e,t,s,i){e.forEach((e=>{-1!==t.indexOf(e.from.classView.value)&&-1!==t.indexOf(e.to.classView.value)&&Wu(e,e.path.map((e=>new ic(e.x-s,e.y-i))))}))}recenter(){if(0!==this.selectedClasses.length){const e=P(this.selectedClasses);e&&this.center(e.position.x+e.rectangle.width/2,e.position.y+e.rectangle.height/2)}else this.autoRecenter()}switchToZoomMode(){this.changeMode(this.interactionMode!==qu.ZOOM_IN?qu.ZOOM_IN:qu.ZOOM_OUT,Ju.NONE)}switchToViewMode(){this.changeMode(qu.LAYOUT,Ju.NONE)}switchToPanMode(){this.changeMode(qu.PAN,Ju.NONE)}switchToAddPropertyMode(){this.isReadOnly||this.changeMode(qu.ADD_RELATIONSHIP,Ju.PROPERTY)}switchToAddInheritanceMode(){this.isReadOnly||this.changeMode(qu.ADD_RELATIONSHIP,Ju.INHERITANCE)}switchToAddClassMode(){this.isReadOnly||this.changeMode(qu.ADD_CLASS,Ju.NONE)}ejectProperty(){this.isReadOnly||(this.mouseOverClassProperty?this.mouseOverClassProperty.genericType.value.rawType instanceof os&&this.addClassView(this.mouseOverClassProperty.genericType.value.rawType,this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new ic(this.cursorPosition.x,this.cursorPosition.y)))):this.selectedClassProperty&&(this.selectedClassProperty.property.genericType.value.rawType instanceof os&&this.addClassView(this.selectedClassProperty.property.genericType.value.rawType,this.selectedClassProperty.selectionPoint),this.selectedClassProperty=void 0))}keydown(e){var t;if(t=e,document.getElementById(vd)?.dispatchEvent(new KeyboardEvent(t.type,t)),"Delete"===e.code)this.isReadOnly||(this.selectedClasses.forEach((e=>{Pu(this.diagram,e),wu(this.diagram,this.diagram.associationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),bu(this.diagram,this.diagram.generalizationViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e)))),ku(this.diagram,this.diagram.propertyViews.filter((t=>!(t.from.classView.value===e||t.to.classView.value===e))))})),this.selectedPropertyOrAssociation instanceof xu?Lu(this.diagram,this.selectedPropertyOrAssociation):this.selectedPropertyOrAssociation instanceof uc&&ju(this.diagram,this.selectedPropertyOrAssociation),this.selectedInheritance&&this.diagram.generalizationViews.find((e=>e===this.selectedInheritance))&&Mu(this.diagram,this.selectedInheritance),this.setSelectedClasses([]),this.drawScreen());else if("KeyE"===e.code)this.selectedClassProperty?(this.handleEditProperty(this.selectedClassProperty.property,this.selectedClassProperty.selectionPoint,void 0),e.preventDefault()):this.selectedPropertyOrAssociation?(this.handleEditProperty(this.selectedPropertyOrAssociation.property.value,this.selectedPoint??(this.selectedPropertyOrAssociation.path.length?this.selectedPropertyOrAssociation.path[0]:this.selectedPropertyOrAssociation.from.classView.value.center()),this.selectedPropertyOrAssociation),e.preventDefault()):1===this.selectedClasses.length&&this.handleEditClassView(this.selectedClasses[0]);else if(e.altKey&&"KeyP"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Uu(e,!e.hideProperties)})),this.drawScreen());else if(e.altKey&&"KeyS"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Vu(e,!e.hideStereotypes)})),this.drawScreen());else if(e.altKey&&"KeyT"===e.code)this.isReadOnly||0!==this.selectedClasses.length&&(this.selectedClasses.forEach((e=>{Gu(e,!e.hideTaggedValues)})),this.drawScreen());else if(e.altKey&&"ArrowDown"===e.code)this.isReadOnly||1!==this.selectedClasses.length||this.handleAddSimpleProperty(this.selectedClasses[0]);else if("ArrowUp"===e.code){const e=this.getSuperTypeLevels(this.selectedClasses,this.diagram,0,1),t=this.layoutTaxonomy(e,this.diagram,!1,!0);t[0].forEach((e=>Ru(this.diagram,e))),t[1].forEach((e=>Du(this.diagram,e))),this.drawScreen()}else if("ArrowDown"===e.code){const e=(0,hu.Z)(this.selectedClasses.flatMap((e=>e.class.value._subclasses.flatMap((e=>new rc(this.diagram,(0,a.Z)(),Ts.create(e)))))),(e=>e.class.value));if(e.length>0){e.forEach((e=>this.ensureClassViewMeetMinDimensions(e)));const t=this.layoutTaxonomy([e,this.selectedClasses],this.diagram,!1,!1);t[0].forEach((e=>Ru(this.diagram,e))),t[1].forEach((e=>Du(this.diagram,e)))}this.drawScreen()}}mouseup(e){if(!this.isReadOnly)switch(this.interactionMode){case qu.LAYOUT:this.diagram.generalizationViews.forEach((e=>Hu(e))),this.diagram.associationViews.forEach((e=>Hu(e))),this.diagram.propertyViews.forEach((e=>Hu(e)));break;case qu.ADD_CLASS:{const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)));this.onAddClassViewClick(t),this.changeMode(qu.LAYOUT,Ju.NONE);break}case qu.ZOOM_IN:{const t=Math.round(100*this.zoom);let s;s=t<=tp[0]-10?10*Math.floor(t/10)+10:t>=tp[tp.length-1]?100*Math.floor(t/100)+100:H(tp.find((e=>e>t))),this.zoomPoint(s/100,new ic(e.x,e.y));break}case qu.ZOOM_OUT:{const t=Math.round(100*this.zoom);let s;s=t<=tp[0]?10*Math.ceil(t/10)-10:t>=tp[tp.length-1]+100?100*Math.ceil(t/100)-100:H((0,Fl.Z)(tp,(e=>e<t))),this.zoomPoint(s/100,new ic(e.x,e.y));break}case qu.ADD_RELATIONSHIP:if(this.startClassView&&this.selectionStart&&this.handleAddRelationship){const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)));for(let e=this.diagram.classViews.length-1;e>=0;e--){const s=this.diagram.classViews[e];if(s.contains(t.x,t.y)){const e=this.handleAddRelationship(this.startClassView,s);e&&($u(e.from,-(this.startClassView.position.x+this.startClassView.rectangle.width/2-this.selectionStart.x)),zu(e.from,-(this.startClassView.position.y+this.startClassView.rectangle.height/2-this.selectionStart.y)),$u(e.to,-(s.position.x+s.rectangle.width/2-t.x)),zu(e.to,-(s.position.y+s.rectangle.height/2-t.y)))}}this.changeMode(qu.LAYOUT,Ju.NONE)}}this.setLeftClick(!1),this.setMiddleClick(!1),this.setRightClick(!1),this.setSelectedClassCorner(void 0),this.setSelectionStart(void 0),this.drawScreen()}mousedblclick(e){if([qu.ADD_RELATIONSHIP,qu.ADD_CLASS,qu.ZOOM_IN,qu.ZOOM_OUT].includes(this.interactionMode))return;const t=this.canvasCoordinateToModelCoordinate(this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)));if(this.mouseOverClassProperty&&this.onClassPropertyDoubleClick)return void this.onClassPropertyDoubleClick(this.mouseOverClassProperty,t,void 0);if(this.mouseOverClassName&&this.onClassNameDoubleClick)return void this.onClassNameDoubleClick(this.mouseOverClassName,t);const s=this.diagram.classViews.find((e=>e.contains(t.x,t.y)));s&&this.onClassViewDoubleClick?this.onClassViewDoubleClick(s,t):this.mouseOverPropertyHolderViewLabel&&this.onClassPropertyDoubleClick?this.onClassPropertyDoubleClick(this.mouseOverPropertyHolderViewLabel.property.value,t,this.mouseOverPropertyHolderViewLabel):this.onBackgroundDoubleClick&&this.onBackgroundDoubleClick(t)}mousedown(e){this.setSelectionStart(void 0),this.setSelectedClassCorner(void 0),this.setSelectedPropertyOrAssociation(void 0),this.setSelectedInheritance(void 0),this.selection=void 0,this.selectedClassProperty=void 0,this.selectedPoint=void 0,this.startClassView=void 0;const t=this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);if(0===e.button)switch(this.setLeftClick(!0),this.interactionMode){case qu.PAN:return void(this.positionBeforeLastMove=new ic(e.x,e.y));case qu.LAYOUT:for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];if(xc(t).contains(s.x,s.y)){this.setSelectedClasses([]),this.setSelectedClassCorner(this.diagram.classViews[e]),this.isReadOnly||vu(this.diagram,this.reorderDiagramDomain(H(this.selectedClassCorner),this.diagram));break}}if(!this.selectedClassCorner)if(this.mouseOverClassProperty)this.selectedClassProperty={property:this.mouseOverClassProperty,selectionPoint:s},this.setSelectedClasses([]);else{let e=!1;for(let i=this.diagram.classViews.length-1;i>=0;i--){const n=this.diagram.classViews[i];if(n.contains(s.x,s.y)){0!==this.selectedClasses.length&&-1!==this.selectedClasses.indexOf(n)||this.setSelectedClasses([n]),this.isReadOnly||vu(this.diagram,this.reorderDiagramDomain(this.selectedClasses[0],this.diagram)),this.clickX=t.x/this.zoom-this.screenOffset.x,this.clickY=t.y/this.zoom-this.screenOffset.y,this._selectedClassesInitialPositions=this.selectedClasses.map((e=>({classView:e,oldPos:new ic(e.position.x,e.position.y)}))),e=!0;break}}if(e||this.setSelectedClasses([]),!this.selectedClasses.length){for(const e of this.diagram.generalizationViews){const t=Yu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedInheritance(e);break}}if(!this.selectedPoint)for(const e of this.diagram.associationViews){const t=Yu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}if(!this.selectedPoint)for(const e of this.diagram.propertyViews){const t=Yu(e,s.x,s.y,this.zoom,!this.isReadOnly);if(t){this.selectedPoint=t,this.setSelectedPropertyOrAssociation(e);break}}this.selectedPoint||this.setSelectionStart(s)}}break;case qu.ADD_RELATIONSHIP:this.setSelectionStart(s),this.startClassView=void 0;for(let e=this.diagram.classViews.length-1;e>=0;e--){const t=this.diagram.classViews[e];t.contains(s.x,s.y)&&(this.startClassView=t)}this.startClassView||this.changeMode(qu.LAYOUT,Ju.NONE)}else{if(1===e.button)return this.setMiddleClick(!0),void(this.positionBeforeLastMove=new ic(e.x,e.y));if(2===e.button)return this.setRightClick(!0),this.positionBeforeLastMove=new ic(e.x,e.y),void(this.mouseOverClassView&&(this.onClassViewRightClick(this.mouseOverClassView,s),this.setRightClick(!1)))}this.clearScreen(),this.drawAll()}mousewheel(e){if(e.preventDefault(),e.stopImmediatePropagation(),Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;const t=this.zoom-e.deltaY/120*.05;this.executeZoom(t,new ic(e.x,e.y))}mousemove(e){if(this.cursorPosition=new ic(e.x,e.y),this.rightClick||this.middleClick||this.leftClick&&this.interactionMode===qu.PAN)this.screenOffset=new ic(this.screenOffset.x+(e.x-this.positionBeforeLastMove.x)/this.zoom,this.screenOffset.y+(e.y-this.positionBeforeLastMove.y)/this.zoom),this.positionBeforeLastMove=new ic(e.x,e.y),this.clearScreen(),this.drawAll();else if(this.leftClick){const t=this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);switch(this.interactionMode){case qu.LAYOUT:if(this.selectedClassCorner&&(Ku(this.selectedClassCorner,new nc(s.x-this.selectedClassCorner.position.x,s.y-this.selectedClassCorner.position.y)),Xu(this.selectedClassCorner),this.drawClassView(this.selectedClassCorner),this.drawScreen()),!this.selectionStart&&this.selectedClasses.length&&!this.isReadOnly){let e=0,s=0;this.selectedClasses.forEach(((i,n)=>{const a=this._selectedClassesInitialPositions.length>n?this._selectedClassesInitialPositions[n]:void 0;if(a){const n=t.x/this.zoom-this.screenOffset.x-(this.clickX-a.oldPos.x),r=t.y/this.zoom-this.screenOffset.y-(this.clickY-a.oldPos.y);e=i.position.x-n,s=i.position.y-r,Zu(i,new ic(n,r)),Xu(i)}})),this.potentiallyShiftRelationships(this.diagram.associationViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.propertyViews,this.selectedClasses,e,s),this.potentiallyShiftRelationships(this.diagram.generalizationViews,this.selectedClasses,e,s),this.drawScreen()}if(this.selectedPoint&&(this.selectedPropertyOrAssociation?Bu(this.selectedPropertyOrAssociation,this.selectedPoint,s):this.selectedInheritance&&Bu(this.selectedInheritance,this.selectedPoint,s),this.selectedPoint=s,this.drawScreen()),this.selectionStart){this.clearScreen(),this.drawAll();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.fillStyle=this.selectionBoxBorderColor,this.ctx.fillRect(e.x,e.y,t.x-e.x,t.y-e.y),this.ctx.strokeRect(e.x,e.y,t.x-e.x,t.y-e.y);const s=(t.x-e.x)/this.zoom,i=(t.y-e.y)/this.zoom;this.selection=new ac(new ic(s>0?this.selectionStart.x:this.selectionStart.x+s,i>0?this.selectionStart.y:this.selectionStart.y+i),new nc(Math.abs(s),Math.abs(i))),this.setSelectedClasses([]);for(const e of this.diagram.classViews)(Nc(this.selection,e)||Nc(e,this.selection))&&this.setSelectedClasses([...this.selectedClasses,e])}break;case qu.ADD_RELATIONSHIP:if(this.selectionStart&&this.startClassView){this.clearScreen(),this.drawBoundingBox();const e=this.modelCoordinateToCanvasCoordinate(this.selectionStart);this.ctx.moveTo(e.x,e.y),this.ctx.lineTo(t.x,t.y),this.ctx.stroke(),this.drawDiagram()}}}else{this.drawScreen();const t=this.eventCoordinateToCanvasCoordinate(new ic(e.x,e.y)),s=this.canvasCoordinateToModelCoordinate(t);this.setMouseOverClassView(void 0),this.setMouseOverClassName(void 0),this.setMouseOverClassCorner(void 0),this.setMouseOverClassProperty(void 0),this.setMouseOverPropertyHolderViewLabel(void 0);for(const e of this.diagram.classViews.slice().reverse())if(e.contains(s.x,s.y)){this.setMouseOverClassView(e),xc(e).contains(s.x,s.y)&&this.setMouseOverClassCorner(e);const i=e.class.value;let n=e.position.y+this.classViewSpaceY;n+=e.hideStereotypes?0:i.stereotypes.length*this.fontSize;const a=this.computeClassNameWidth(e);new ac(this.modelCoordinateToCanvasCoordinate(new ic(e.position.x+(e.rectangle.width-a)/2,n)),new nc(a,this.lineHeight)).contains(t.x,t.y)&&this.setMouseOverClassName(e),n+=this.lineHeight,n+=e.hideTaggedValues?0:i.taggedValues.length*this.fontSize,n+=this.classViewSpaceY;for(const s of Zl(i))this.hasPropertyView(e,s)||(this.ctx.font=`${(this.fontSize-1)*this.zoom}px ${this.fontFamily}`,new ac(this.modelCoordinateToCanvasCoordinate(new ic(e.position.x+this.classViewSpaceX,n)),new nc(this.drawClassViewProperty(e,s,0,0,!0)*this.zoom,this.fontSize*this.zoom)).contains(t.x,t.y)&&this.setMouseOverClassProperty(s),n+=this.fontSize);break}const i=[...this.diagram.propertyViews,...this.diagram.associationViews];for(const e of i){const t=dc.pruneUnnecessaryInsidePoints(e.buildFullPath(),e.from.classView.value,e.to.classView.value);if(this.drawLinePropertyText(t[t.length-2],t[t.length-1],e.to.classView.value,e.property.value,!1).contains(s.x,s.y)){this.setMouseOverPropertyHolderViewLabel(e);break}}}}getSuperTypeLevels(e,t,s,i){if(e.length){const n=(0,hu.Z)(e.flatMap((e=>e.class.value.generalizations.map((e=>new rc(t,(0,a.Z)(),Ts.create(Wl(e.value,os))))))),(e=>e.class.value));if(n.forEach((e=>this.ensureClassViewMeetMinDimensions(e))),-1===i||s<i){const a=this.getSuperTypeLevels(n,t,s+1,i);return a.push(e),a}return[e]}return[]}layoutTaxonomy(e,t,s,i){return e.reverse(),[e.flatMap(((t,n)=>{let a=0,r=0,o=0,l=0;if(n>0){const t=e[n-1];if(t.length){const e=[...t].sort(((e,t)=>e.position.x-t.position.x));o=e[0].position.x,a=e[e.length-1].position.x+e[e.length-1].rectangle.width-e[0].position.x;const s=[...t].sort(((e,t)=>e.position.y-t.position.y));l=s[0].position.y,r=s[s.length-1].position.y+s[s.length-1].rectangle.height-s[0].position.y}}const c=Math.max(...t.map((e=>e.rectangle.height))),d=o+a/2-t.map((e=>e.rectangle.width)).reduce(((e,t)=>e+t+10))/2,h=i?l-c-30:l+r+30;return(s||n>0)&&(Zu(t[0],new ic(d,h)),t.forEach(((e,s)=>{if(s>0){const i=t[s-1];Zu(e,new ic(i.position.x+i.rectangle.width+10,h))}}))),t})),(i?e:e.slice().reverse()).slice(0,e.length-1).flatMap(((s,i)=>s.flatMap((s=>e[i+1].flatMap((e=>s.class.value.generalizations.map((e=>e.value.rawType)).includes(e.class.value)?new pc(t,s,e):[]))))))]}}class np{_UUID=(0,a.Z)();tag;value;constructor(e,t){this.tag=e,this.value=t}get hashCode(){return qt([Jt.TAGGED_VALUE,this.tag.pointerHashCode,this.value])}}class ap extends Es{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Jt.TAG_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Xt).join(",")}}class rp extends ap{ownerReference;constructor(e){const t=Ts.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new rp(e)}}class op extends Es{ownerReference;value;constructor(e,t){super(e),this.ownerReference=e,this.value=t}get pointerHashCode(){return[Jt.STEREOTYPE_POINTER,this.value.value,this.ownerReference.valueForSerialization??""].map(Xt).join(",")}}class lp extends op{ownerReference;constructor(e){const t=Ts.create(e._OWNER);super(t,e),this.ownerReference=t}static create(e){return new lp(e)}}class cp extends as{_generatedMilestonedProperties=[];properties;derivedProperties=[];constructor(e){super(e);const t=[Au(Nu(),Nu()),Au(Nu(),Nu())];t[0]._OWNER=this,t[1]._OWNER=this,this.properties=t}get _elementHashCode(){return qt([Jt.ASSOCIATION,this.path,qt(this.properties),qt(this.derivedProperties),qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues)])}accept_PackageableElementVisitor(e){return e.visit_Association(this)}}class dp extends as{includes=[];classMappings=[];enumerationMappings=[];associationMappings=[];test=[];tests=[];get _elementHashCode(){return qt([Jt.MAPPING,this.path,qt(this.classMappings),qt(this.enumerationMappings),qt(this.associationMappings),qt(this.test),qt(this.includes),qt(this.tests)])}accept_PackageableElementVisitor(e){return e.visit_Mapping(this)}}class hp extends as{p_stereotypes=[];p_tags=[];get _elementHashCode(){return qt([Jt.PROFILE,this.path,qt(this.p_stereotypes.map((e=>e.value))),qt(this.p_tags.map((e=>e.value)))])}accept_PackageableElementVisitor(e){return e.visit_Profile(this)}}class up extends as{pattern="/";owners=[];documentation="";autoActivateUpdates=!0;execution;test;tests=[];postValidations=[];get patternParameters(){return(0,Xe.Z)((this.pattern.match(/\{\w+\}/gu)??[]).map((e=>e.substring(1,e.length-1))))}get _elementHashCode(){return qt([Jt.SERVICE,qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues),this.path,this.pattern,qt(this.owners),this.documentation,this.autoActivateUpdates.toString(),this.execution,this.test??"",qt(this.tests),qt(this.postValidations)])}accept_PackageableElementVisitor(e){return e.visit_Service(this)}}class pp extends as{functionName;constructor(e){super(e),this.functionName=e}}class mp extends pp{}class _p extends mp{returnType;returnMultiplicity;parameters=[];expressionSequence=[];constructor(e,t,s){super(e),this.returnType=t,this.returnMultiplicity=s}get _elementHashCode(){return qt([Jt.FUNCTION,this.path,qt(this.parameters),this.returnType.valueForSerialization??"",qt(this.taggedValues),qt(this.stereotypes.map((e=>e.pointerHashCode))),ts(void 0,this.expressionSequence)])}accept_PackageableElementVisitor(e){return e.visit_ConcreteFunctionDefinition(this)}}class gp extends as{includes=[]}class Ep extends gp{sections=[];get _elementHashCode(){return qt([Jt.FLAT_DATA,this.path,qt(this.includes.map((e=>e.valueForSerialization??""))),qt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_FlatData(this)}}class fp extends as{runtimeValue;get _elementHashCode(){return qt([Jt.PACKAGEABLE_RUNTIME,this.path,this.runtimeValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableRuntime(this)}}class Tp extends as{connectionValue;get _elementHashCode(){return qt([Jt.PACKAGEABLE_CONNECTION,this.path,this.connectionValue])}accept_PackageableElementVisitor(e){return e.visit_PackageableConnection(this)}}class Cp extends as{}class xp extends Cp{type;generationOutputPath;scopeElements=[];configurationProperties=[];get _elementHashCode(){return qt([Jt.FILE_GENERATION,this.path,this.type,this.generationOutputPath??"",qt(this.scopeElements.map((e=>e instanceof fs?e.valueForSerialization??"":e))),qt(this.configurationProperties)])}accept_PackageableElementVisitor(e){return e.visit_FileGenerationSpecification(this)}}class Np extends as{generationNodes=[];fileGenerations=[];findGenerationElementById(e){return this.generationNodes.find((t=>t.id===e))?.generationElement.value}get _elementHashCode(){return qt([Jt.GENERATION_TREE,this.path,qt(this.generationNodes),qt(this.fileGenerations.map((e=>ss(Le.FILE_GENERATION,e.valueForSerialization??""))))])}accept_PackageableElementVisitor(e){return e.visit_GenerationSpecification(this)}}class Ap extends gp{schemas=[];joins=[];filters=[];get _elementHashCode(){return qt([Jt.DATABASE,this.path,qt(this.includes.map((e=>e.valueForSerialization??""))),qt(this.schemas),qt(this.joins),qt(this.filters)])}accept_PackageableElementVisitor(e){return e.visit_Database(this)}}class Op{_class;index=new Map;constructor(e){this._class=e}getElementClass(){return this._class}get elements(){return Array.from(this.index.values())}getElement(e){return this.index.get(e)}setElement(e,t){this.index.set(e,t)}deleteElement(e){this.index.delete(e)}renameElement(e,t){const s=this.getElement(e);s&&(this.deleteElement(e),this.setElement(t,s))}}class Sp extends as{data;get hashCode(){return qt([Jt.DATA_ELEMENT,this.path,qt(this.stereotypes.map((e=>e.pointerHashCode))),qt(this.taggedValues),this.data])}accept_PackageableElementVisitor(e){return e.visit_DataElement(this)}}const yp=new Set([as,rs,ls,Cu,os,cp,cs,_p,hp,hs,ds,class extends as{sections=[];get _elementHashCode(){return qt([Jt.SECTION_INDEX,this.path,qt(this.sections)])}accept_PackageableElementVisitor(e){return e.visit_SectionIndex(this)}},gp,dp,Tp,fp,up,Np,xp,Sp]);class Ip{root;extensions=[];elementSectionIndex=new Map;sectionIndicesIndex=new Map;profilesIndex=new Map;typesIndex=new Map;associationsIndex=new Map;functionsIndex=new Map;storesIndex=new Map;mappingsIndex=new Map;connectionsIndex=new Map;runtimesIndex=new Map;servicesIndex=new Map;generationSpecificationsIndex=new Map;fileGenerationsIndex=new Map;dataElementsIndex=new Map;constructor(e,t){this.root=new us(e),this.extensions=this.createGraphExtensions(t)}createGraphExtensions(e){return e.map((e=>{if(yp.has(e))throw new j("Pure graph extension not allowed for the specified class. Consider removing this extension from plugins.");return new Op(e)}))}get ownSectionIndices(){return Array.from(this.sectionIndicesIndex.values())}get ownProfiles(){return Array.from(this.profilesIndex.values())}get ownEnumerations(){return Array.from(this.typesIndex.values()).filter(Y(cs))}get ownMeasures(){return Array.from(this.typesIndex.values()).filter(Y(hs))}get ownClasses(){return Array.from(this.typesIndex.values()).filter(Y(os))}get ownTypes(){return Array.from(this.typesIndex.values())}get ownAssociations(){return Array.from(this.associationsIndex.values())}get ownFunctions(){return Array.from(this.functionsIndex.values())}get ownStores(){return Array.from(this.storesIndex.values())}get ownFlatDatas(){return Array.from(this.storesIndex.values()).filter(Y(Ep))}get ownDatabases(){return Array.from(this.storesIndex.values()).filter(Y(Ap))}get ownMappings(){return Array.from(this.mappingsIndex.values())}get ownServices(){return Array.from(this.servicesIndex.values())}get ownRuntimes(){return Array.from(this.runtimesIndex.values())}get ownConnections(){return Array.from(this.connectionsIndex.values())}get ownFileGenerations(){return Array.from(this.fileGenerationsIndex.values())}get ownDataElements(){return Array.from(this.dataElementsIndex.values())}get ownGenerationSpecifications(){return Array.from(this.generationSpecificationsIndex.values())}get ownTestables(){return[...this.ownServices,...this.ownMappings]}getExtensionElements(e){return this.getExtensionForElementClass(e).elements}getExtensionForElementClass(e){const t=this.extensions.filter((t=>t.getElementClass()===e));if(0===t.length)throw new U("Can't find graph extension for the specified element class: no compatible graph extensions available from plugins");if(t.length>1)throw new j("Found multiple extensions for the specified element class");return t[0]}getOwnNullableSection=e=>this.elementSectionIndex.get(e);getOwnNullableSectionIndex=e=>this.sectionIndicesIndex.get(e);getOwnNullableProfile=e=>this.profilesIndex.get(e);getOwnNullableType=e=>this.typesIndex.get(e);getOwnNullableClass=e=>{const t=this.getOwnNullableType(e);return t instanceof os?t:void 0};getOwnNullableEnumeration=e=>{const t=this.getOwnNullableType(e);return t instanceof cs?t:void 0};getOwnNullableMeasure=e=>{const t=this.getOwnNullableType(e);return t instanceof hs?t:void 0};getOwnNullableAssociation=e=>this.associationsIndex.get(e);getOwnNullableFunction=e=>this.functionsIndex.get(e);getOwnNullableStore=e=>this.storesIndex.get(e);getOwnNullableMapping=e=>this.mappingsIndex.get(e);getOwnNullableConnection=e=>this.connectionsIndex.get(e);getOwnNullableRuntime=e=>this.runtimesIndex.get(e);getOwnNullableService=e=>this.servicesIndex.get(e);getOwnNullableGenerationSpecification=e=>this.generationSpecificationsIndex.get(e);getOwnNullableFileGeneration=e=>this.fileGenerationsIndex.get(e);getOwnNullableDataElement=e=>this.dataElementsIndex.get(e);getOwnSectionIndex=e=>H(this.getOwnNullableSectionIndex(e),`Can't find section index '${e}'`);getOwnProfile=e=>H(this.getOwnNullableProfile(e),`Can't find profile '${e}'`);getOwnType=e=>H(this.getOwnNullableType(e),`Can't find type '${e}'`);getOwnClass=e=>H(this.getOwnNullableClass(e),`Can't find class '${e}'`);getOwnEnumeration=e=>H(this.getOwnNullableEnumeration(e),`Can't find enumeration '${e}'`);getOwnMeasure=e=>H(this.getOwnNullableMeasure(e),`Can't find measure '${e}'`);getOwnAssociation=e=>H(this.getOwnNullableAssociation(e),`Can't find association '${e}'`);getOwnFunction=e=>H(this.getOwnNullableFunction(e),`Can't find function '${e}'`);getOwnStore=e=>H(this.getOwnNullableStore(e),`Can't find store '${e}'`);getOwnDatabase=e=>K(this.getOwnNullableStore(e),Ap,`Can't find database '${e}'`);getOwnFlatDataStore=e=>K(this.getOwnNullableStore(e),Ep,`Can't find flat-data store '${e}'`);getOwnMapping=e=>H(this.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getOwnConnection=e=>H(this.getOwnNullableConnection(e),`Can't find connection '${e}'`);getOwnRuntime=e=>H(this.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getOwnService=e=>H(this.getOwnNullableService(e),`Can't find service '${e}'`);getOwnGenerationSpecification=e=>H(this.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getOwnFileGeneration=e=>H(this.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getOwnDataElement=e=>H(this.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getOwnNullableExtensionElement(e,t){return this.getExtensionForElementClass(t).getElement(e)}setOwnSection(e,t){this.elementSectionIndex.set(e,t)}setOwnSectionIndex(e,t){this.sectionIndicesIndex.set(e,t)}setOwnProfile(e,t){this.profilesIndex.set(e,t)}setOwnType(e,t){this.typesIndex.set(e,t)}setOwnAssociation(e,t){this.associationsIndex.set(e,t)}setOwnFunction(e,t){this.functionsIndex.set(e,t)}setOwnStore(e,t){this.storesIndex.set(e,t)}setOwnMapping(e,t){this.mappingsIndex.set(e,t)}setOwnConnection(e,t){this.connectionsIndex.set(e,t)}setOwnRuntime(e,t){this.runtimesIndex.set(e,t)}setOwnService(e,t){this.servicesIndex.set(e,t)}setOwnGenerationSpecification(e,t){this.generationSpecificationsIndex.set(e,t)}setOwnFileGeneration(e,t){this.fileGenerationsIndex.set(e,t)}setOwnDataElement(e,t){this.dataElementsIndex.set(e,t)}setOwnElementInExtension(e,t,s){this.getExtensionForElementClass(s).setElement(e,t)}get allOwnElements(){return[...this.ownProfiles,...this.ownEnumerations,...this.ownMeasures,...this.ownClasses,...this.ownAssociations,...this.ownFunctions,...this.ownStores,...this.ownMappings,...this.ownServices,...this.ownRuntimes,...this.ownConnections,...this.ownGenerationSpecifications,...this.ownFileGenerations,...this.ownDataElements,...this.extensions.flatMap((e=>e.elements))]}async dispose(){this.allOwnElements.length&&await Promise.all(this.allOwnElements.map((e=>L((()=>{e.dispose()})))))}getNullablePackage=e=>e?G((()=>Hl(this.root,e,!1,void 0))):this.root;getOwnNullableElement(e,t){let s=this.sectionIndicesIndex.get(e)??this.typesIndex.get(e)??this.profilesIndex.get(e)??this.associationsIndex.get(e)??this.functionsIndex.get(e)??this.storesIndex.get(e)??this.mappingsIndex.get(e)??this.servicesIndex.get(e)??this.runtimesIndex.get(e)??this.connectionsIndex.get(e)??this.fileGenerationsIndex.get(e)??this.dataElementsIndex.get(e)??this.generationSpecificationsIndex.get(e);if(!s)for(const t of this.extensions){const i=t.getElement(e);if(i){s=i;break}}return t&&!s?this.getNullablePackage(e):s}addOwnElement(e,t){$l(t?Yl(this,t,void 0):this.root,e),e instanceof dp?this.setOwnMapping(e.path,e):e instanceof gp?this.setOwnStore(e.path,e):e instanceof rs?this.setOwnType(e.path,e):e instanceof cp?this.setOwnAssociation(e.path,e):e instanceof hp?this.setOwnProfile(e.path,e):e instanceof _p?this.setOwnFunction(e.path,e):e instanceof up?this.setOwnService(e.path,e):e instanceof Tp?this.setOwnConnection(e.path,e):e instanceof fp?this.setOwnRuntime(e.path,e):e instanceof xp?this.setOwnFileGeneration(e.path,e):e instanceof Np?this.setOwnGenerationSpecification(e.path,e):e instanceof Sp?this.setOwnDataElement(e.path,e):e instanceof us||this.getExtensionForElementClass(v(e)).setElement(e.path,e)}deleteOwnElement(e){e.package&&zl(e.package,e),e instanceof dp?this.mappingsIndex.delete(e.path):e instanceof gp?this.storesIndex.delete(e.path):e instanceof rs?(this.typesIndex.delete(e.path),e instanceof hs&&(e.canonicalUnit&&this.typesIndex.delete(e.canonicalUnit.path),e.nonCanonicalUnits.forEach((e=>this.typesIndex.delete(e.path))))):e instanceof cp?this.associationsIndex.delete(e.path):e instanceof hp?this.profilesIndex.delete(e.path):e instanceof _p?this.functionsIndex.delete(e.path):e instanceof up?this.servicesIndex.delete(e.path):e instanceof fp?this.runtimesIndex.delete(e.path):e instanceof Tp?this.connectionsIndex.delete(e.path):e instanceof xp?this.fileGenerationsIndex.delete(e.path):e instanceof Np?this.generationSpecificationsIndex.delete(e.path):e instanceof Sp?this.dataElementsIndex.delete(e.path):e instanceof us?e.children.forEach((e=>this.deleteOwnElement(e))):this.getExtensionForElementClass(v(e)).deleteElement(e.path)}renameOwnElement(e,t,s){if(t===s)return;if(!s)throw new U(`Can't rename element '${t} to '${s}': path is empty'`);if(e instanceof us&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)*$/))||!(e instanceof us)&&!Boolean(s.match(/^(?:\w[\w$_-]*)(?:::\w[\w$_-]*)+$/)))throw new U(`Can't rename element '${t} to '${s}': invalid path'`);if(this.getOwnNullableElement(s,!0))throw new U(`Can't rename element '${t} to '${s}': another element with the same path already existed'`);const[i,n]=Vl(s);if(!(e instanceof us)){const t=this.getNullablePackage(i)??(""!==i?Yl(this,i,void 0):this.root);e.name=n,e instanceof _p&&(e.functionName=(a=e,(r=e.name).substring(0,r.indexOf((e=>`_${e.parameters.map((e=>`${e.type.value.name}_${Xl(e.multiplicity.lowerBound,e.multiplicity.upperBound)}_`)).join("_")}_${e.returnType.value.name}_${Xl(e.returnMultiplicity.lowerBound,e.returnMultiplicity.upperBound)}_`)(a))))),e.package!==t&&(e.package&&zl(e.package,e),$l(t,e))}var a,r;if(e instanceof dp)this.mappingsIndex.delete(t),this.mappingsIndex.set(s,e);else if(e instanceof gp)this.storesIndex.delete(t),this.storesIndex.set(s,e);else if(e instanceof rs)this.typesIndex.delete(t),this.typesIndex.set(s,e),e instanceof hs&&(e.canonicalUnit&&(this.typesIndex.delete(e.canonicalUnit.path),this.typesIndex.set(e.canonicalUnit.path.replace(t,s),e.canonicalUnit)),e.nonCanonicalUnits.forEach((e=>{this.typesIndex.delete(e.path),this.typesIndex.set(e.path.replace(t,s),e)})));else if(e instanceof cp)this.associationsIndex.delete(t),this.associationsIndex.set(s,e);else if(e instanceof hp)this.profilesIndex.delete(t),this.profilesIndex.set(s,e);else if(e instanceof _p)this.functionsIndex.delete(t),this.functionsIndex.set(s,e);else if(e instanceof up)this.servicesIndex.delete(t),this.servicesIndex.set(s,e);else if(e instanceof fp)this.runtimesIndex.delete(t),this.runtimesIndex.set(s,e);else if(e instanceof Tp)this.connectionsIndex.delete(t),this.connectionsIndex.set(s,e);else if(e instanceof xp)this.fileGenerationsIndex.delete(t),this.fileGenerationsIndex.set(s,e);else if(e instanceof Sp)this.dataElementsIndex.delete(t),this.dataElementsIndex.set(s,e);else if(e instanceof Np)this.generationSpecificationsIndex.delete(t),this.generationSpecificationsIndex.set(s,e);else if(e instanceof us){const a=new Map;if(e.children.forEach((e=>{a.set(e.path,e)})),e.name=n,!e.package)throw new j("Can't rename root package");const r=e.package;if(r!==this.getNullablePackage(i)){zl(r,e);const t=""!==i?Yl(this,i,void 0):this.root;$l(t,e)}a.forEach(((e,i)=>{this.renameOwnElement(e,i,i.replace(t,s))}))}else this.getExtensionForElementClass(v(e)).renameElement(t,s)}TEMPORARY__deleteOwnSectionIndex(){this.sectionIndicesIndex.forEach((e=>{e.setIsDeleted(!0),this.sectionIndicesIndex.delete(e.path)})),this.sectionIndicesIndex=new Map,this.elementSectionIndex=new Map}}class vp extends Ip{constructor(e,t){super(t.name,e),this.root=t}}const Rp=(e,t)=>s=>{for(const i of e.dependencyGraphs){const e=t(i,s);if(e)return e}};class Pp{roots=[];projectDependencyModelsIndex=new Map;extensionElementClasses;constructor(e){this.extensionElementClasses=e}initialize(e){Array.from(e.keys()).forEach((e=>{const t=new us(e);this.roots.push(t),this.projectDependencyModelsIndex.set(e,new vp(this.extensionElementClasses,t))}))}get hasDependencies(){return Boolean(this.projectDependencyModelsIndex.size)}get dependencyGraphs(){return Array.from(this.projectDependencyModelsIndex.values())}get allOwnElements(){return this.dependencyGraphs.flatMap((e=>e.allOwnElements))}getOwnNullableSectionIndex=Rp(this,((e,t)=>e.getOwnNullableSectionIndex(t)));getOwnNullableProfile=Rp(this,((e,t)=>e.getOwnNullableProfile(t)));getOwnNullableType=Rp(this,((e,t)=>e.getOwnNullableType(t)));getOwnNullableClass=Rp(this,((e,t)=>e.getOwnNullableClass(t)));getOwnNullableEnumeration=Rp(this,((e,t)=>e.getOwnNullableEnumeration(t)));getOwnNullableMeasure=Rp(this,((e,t)=>e.getOwnNullableMeasure(t)));getOwnNullableAssociation=Rp(this,((e,t)=>e.getOwnNullableAssociation(t)));getOwnNullableFunction=Rp(this,((e,t)=>e.getOwnNullableFunction(t)));getOwnNullableStore=Rp(this,((e,t)=>e.getOwnNullableStore(t)));getOwnNullableMapping=Rp(this,((e,t)=>e.getOwnNullableMapping(t)));getOwnNullableConnection=Rp(this,((e,t)=>e.getOwnNullableConnection(t)));getOwnNullableRuntime=Rp(this,((e,t)=>e.getOwnNullableRuntime(t)));getOwnNullableService=Rp(this,((e,t)=>e.getOwnNullableService(t)));getOwnNullableGenerationSpecification=Rp(this,((e,t)=>e.getOwnNullableGenerationSpecification(t)));getOwnNullableFileGeneration=Rp(this,((e,t)=>e.getOwnNullableFileGeneration(t)));getOwnNullableDataElement=Rp(this,((e,t)=>e.getOwnNullableDataElement(t)));getOwnNullableExtensionElement(e,t){for(const s of this.dependencyGraphs){const i=s.getExtensionForElementClass(t).getElement(e);if(i)return i}}get sectionIndices(){return this.dependencyGraphs.flatMap((e=>e.ownSectionIndices))}get profiles(){return this.dependencyGraphs.flatMap((e=>e.ownProfiles))}get enumerations(){return this.dependencyGraphs.flatMap((e=>e.ownEnumerations))}get measures(){return this.dependencyGraphs.flatMap((e=>e.ownMeasures))}get classes(){return this.dependencyGraphs.flatMap((e=>e.ownClasses))}get types(){return this.dependencyGraphs.flatMap((e=>e.ownTypes))}get associations(){return this.dependencyGraphs.flatMap((e=>e.ownAssociations))}get functions(){return this.dependencyGraphs.flatMap((e=>e.ownFunctions))}get stores(){return this.dependencyGraphs.flatMap((e=>e.ownStores))}get databases(){return this.dependencyGraphs.flatMap((e=>e.ownDatabases))}get mappings(){return this.dependencyGraphs.flatMap((e=>e.ownMappings))}get services(){return this.dependencyGraphs.flatMap((e=>e.ownServices))}get runtimes(){return this.dependencyGraphs.flatMap((e=>e.ownRuntimes))}get connections(){return this.dependencyGraphs.flatMap((e=>e.ownConnections))}get dataElements(){return this.dependencyGraphs.flatMap((e=>e.ownDataElements))}get generationSpecifications(){return this.dependencyGraphs.flatMap((e=>e.ownGenerationSpecifications))}get fileGenerations(){return this.dependencyGraphs.flatMap((e=>e.ownFileGenerations))}getExtensionElements(e){return this.dependencyGraphs.flatMap((t=>t.getExtensionElements(e)))}getModel(e){return H(this.projectDependencyModelsIndex.get(e),`Can't find dependency model with project ID '${e}'`)}getNullableElement(e,t){return this.dependencyGraphs.find((s=>Boolean(s.getOwnNullableElement(e,t))))?.getOwnNullableElement(e,t)}}class wp extends gp{static NAME="ModelStore";static INSTANCE=new wp;constructor(){super(wp.NAME)}accept_PackageableElementVisitor(e){throw new U}}class Lp extends Ip{primitiveTypesIndex=new Map;get primitiveTypes(){return Array.from(this.primitiveTypesIndex.values())}constructor(e){super(Ce.CORE,e),this.initializePrimitiveTypes(),this.setOwnStore(wp.NAME,wp.INSTANCE)}get allOwnElements(){return[...super.allOwnElements,...this.primitiveTypes]}initializePrimitiveTypes(){[Cu.STRING,Cu.BOOLEAN,Cu.BINARY,Cu.NUMBER,Cu.INTEGER,Cu.FLOAT,Cu.DECIMAL,Cu.DATE,Cu.STRICTDATE,Cu.DATETIME,Cu.STRICTTIME,Cu.LATESTDATE].forEach((e=>{this.primitiveTypesIndex.set(e.path,e),this.setOwnType(e.path,e)}))}}class bp extends Ip{autoImports=[];constructor(e){super(Ce.SYSTEM,e)}initializeAutoImports(){this.autoImports=Se.map((e=>K(this.getOwnNullableElement(e,!0),us,`Can't find auto-import package '${e}'`)))}}class Dp extends Ip{constructor(e){super(Ce.MODEL_GENERATION,e)}}class Mp extends Ip{coreModel;systemModel;generationModel;dependencyManager;graphPlugins=[];constructor(e,t,s){const i=s.flatMap((e=>e.getExtraPureGraphExtensionClasses?.()??[]));super(Ce.MAIN,i),this.graphPlugins=s,this.coreModel=e,this.systemModel=t,this.generationModel=new Dp(i),this.dependencyManager=new Pp(i)}get autoImports(){return this.systemModel.autoImports}get primitiveTypes(){return this.coreModel.primitiveTypes}get sectionIndices(){return[...this.coreModel.ownSectionIndices,...this.systemModel.ownSectionIndices,...this.dependencyManager.sectionIndices,...this.ownSectionIndices,...this.generationModel.ownSectionIndices]}get profiles(){return[...this.coreModel.ownProfiles,...this.systemModel.ownProfiles,...this.dependencyManager.profiles,...this.ownProfiles,...this.generationModel.ownProfiles]}get enumerations(){return[...this.coreModel.ownEnumerations,...this.systemModel.ownEnumerations,...this.dependencyManager.enumerations,...this.ownEnumerations,...this.generationModel.ownEnumerations]}get measures(){return[...this.coreModel.ownMeasures,...this.systemModel.ownMeasures,...this.dependencyManager.measures,...this.ownMeasures,...this.generationModel.ownMeasures]}get classes(){return[...this.coreModel.ownClasses,...this.systemModel.ownClasses,...this.dependencyManager.classes,...this.ownClasses,...this.generationModel.ownClasses]}get types(){return[...this.coreModel.ownTypes,...this.systemModel.ownTypes,...this.dependencyManager.types,...this.ownTypes,...this.generationModel.ownTypes]}get associations(){return[...this.coreModel.ownAssociations,...this.systemModel.ownAssociations,...this.dependencyManager.associations,...this.ownAssociations,...this.generationModel.ownAssociations]}get functions(){return[...this.coreModel.ownFunctions,...this.systemModel.ownFunctions,...this.dependencyManager.functions,...this.ownFunctions,...this.generationModel.ownFunctions]}get stores(){return[...this.coreModel.ownStores,...this.systemModel.ownStores,...this.dependencyManager.stores,...this.ownStores,...this.generationModel.ownStores]}get databases(){return[...this.coreModel.ownDatabases,...this.systemModel.ownDatabases,...this.dependencyManager.databases,...this.ownDatabases,...this.generationModel.ownDatabases]}get mappings(){return[...this.coreModel.ownMappings,...this.systemModel.ownMappings,...this.dependencyManager.mappings,...this.ownMappings,...this.generationModel.ownMappings]}get services(){return[...this.coreModel.ownServices,...this.systemModel.ownServices,...this.dependencyManager.services,...this.ownServices,...this.generationModel.ownServices]}get runtimes(){return[...this.coreModel.ownRuntimes,...this.systemModel.ownRuntimes,...this.dependencyManager.runtimes,...this.ownRuntimes,...this.generationModel.ownRuntimes]}get connections(){return[...this.coreModel.ownConnections,...this.systemModel.ownConnections,...this.dependencyManager.connections,...this.ownConnections,...this.generationModel.ownConnections]}get dataElements(){return[...this.coreModel.ownDataElements,...this.systemModel.ownDataElements,...this.dependencyManager.dataElements,...this.ownDataElements,...this.generationModel.ownDataElements]}get generationSpecifications(){return[...this.coreModel.ownGenerationSpecifications,...this.systemModel.ownGenerationSpecifications,...this.dependencyManager.generationSpecifications,...this.ownGenerationSpecifications,...this.generationModel.ownGenerationSpecifications]}get fileGenerations(){return[...this.coreModel.ownFileGenerations,...this.systemModel.ownFileGenerations,...this.dependencyManager.fileGenerations,...this.ownFileGenerations,...this.generationModel.ownFileGenerations]}get allElements(){return[...this.coreModel.allOwnElements,...this.systemModel.allOwnElements,...this.dependencyManager.allOwnElements,...this.allOwnElements,...this.generationModel.allOwnElements]}get allOwnTestables(){const e=this.graphPlugins.flatMap((e=>e.getExtraTestablesCollectors?.()??[])).map((e=>e(this)));return[...this.ownTestables].concat(...e)}getPrimitiveType=e=>H(this.coreModel.primitiveTypesIndex.get(e),`Can't find primitive type '${e}'`);getType=e=>H(this.getOwnNullableType(e)??this.generationModel.getOwnNullableType(e)??this.dependencyManager.getOwnNullableType(e)??this.systemModel.getOwnNullableType(e)??this.coreModel.getOwnNullableType(e),`Can't find type '${e}'`);getProfile=e=>H(this.getOwnNullableProfile(e)??this.generationModel.getOwnNullableProfile(e)??this.dependencyManager.getOwnNullableProfile(e)??this.systemModel.getOwnNullableProfile(e),`Can't find profile '${e}'`);getEnumeration=e=>K(this.getType(e),cs,`Can't find enumeration '${e}'`);getMeasure=e=>K(this.getType(e),hs,`Can't find measure '${e}'`);getUnit=e=>K(this.getType(e),ds,`Can't find unit '${e}'`);getClass=e=>K(this.getType(e),os,`Can't find class '${e}'`);getAssociation=e=>H(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e),`Can't find association '${e}'`);getPropertyOwner=e=>H(this.getOwnNullableAssociation(e)??this.generationModel.getOwnNullableAssociation(e)??this.dependencyManager.getOwnNullableAssociation(e)??this.systemModel.getOwnNullableAssociation(e)??K(this.getType(e),os),`Can't find property owner '${e}'`);getFunction=e=>K(this.getOwnNullableFunction(e)??this.generationModel.getOwnNullableFunction(e)??this.dependencyManager.getOwnNullableFunction(e)??this.systemModel.getOwnNullableFunction(e),_p,`Can't find function '${e}'`);getStore=e=>H(this.getOwnNullableStore(e)??this.generationModel.getOwnNullableStore(e)??this.dependencyManager.getOwnNullableStore(e)??this.systemModel.getOwnNullableStore(e)??this.coreModel.getOwnNullableStore(e),`Can't find store '${e}'`);getFlatDataStore=e=>K(this.getStore(e),Ep,`Can't find flat-data store '${e}'`);getDatabase=e=>K(this.getStore(e),Ap,`Can't find database store '${e}'`);getMapping=e=>H(this.getOwnNullableMapping(e)??this.generationModel.getOwnNullableMapping(e)??this.dependencyManager.getOwnNullableMapping(e)??this.systemModel.getOwnNullableMapping(e),`Can't find mapping '${e}'`);getService=e=>H(this.getOwnNullableService(e)??this.generationModel.getOwnNullableService(e)??this.dependencyManager.getOwnNullableService(e)??this.systemModel.getOwnNullableService(e),`Can't find service '${e}'`);getConnection=e=>H(this.getOwnNullableConnection(e)??this.generationModel.getOwnNullableConnection(e)??this.dependencyManager.getOwnNullableConnection(e)??this.systemModel.getOwnNullableConnection(e),`Can't find connection '${e}'`);getRuntime=e=>H(this.getOwnNullableRuntime(e)??this.generationModel.getOwnNullableRuntime(e)??this.dependencyManager.getOwnNullableRuntime(e)??this.systemModel.getOwnNullableRuntime(e),`Can't find runtime '${e}'`);getGenerationSpecification=e=>H(this.getOwnNullableGenerationSpecification(e)??this.generationModel.getOwnNullableGenerationSpecification(e)??this.dependencyManager.getOwnNullableGenerationSpecification(e)??this.systemModel.getOwnNullableGenerationSpecification(e),`Can't find generation specification '${e}'`);getFileGeneration=e=>H(this.getOwnNullableFileGeneration(e)??this.generationModel.getOwnNullableFileGeneration(e)??this.dependencyManager.getOwnNullableFileGeneration(e)??this.systemModel.getOwnNullableFileGeneration(e),`Can't find file generation '${e}'`);getDataElement=e=>H(this.getOwnNullableDataElement(e)??this.generationModel.getOwnNullableDataElement(e)??this.dependencyManager.getOwnNullableDataElement(e)??this.systemModel.getOwnNullableDataElement(e),`Can't find data element '${e}'`);getExtensionElement(e,t,s){return H(this.getOwnNullableExtensionElement(e,t)??this.generationModel.getOwnNullableExtensionElement(e,t)??this.dependencyManager.getOwnNullableExtensionElement(e,t)??this.systemModel.getOwnNullableExtensionElement(e,t),s??`Can't find element '${e}'`)}getElement=(e,t)=>H(this.getNullableElement(e,t),`Can't find element '${e}'`);getNullableClass=e=>G((()=>this.getClass(e)));getNullableMapping=e=>G((()=>this.getMapping(e)));getNullableService=e=>G((()=>this.getService(e)));getNullableRuntime=e=>G((()=>this.getRuntime(e)));getNullableFileGeneration=e=>G((()=>this.getFileGeneration(e)));getNullableElement(e,t){const s=super.getOwnNullableElement(e)??this.dependencyManager.getNullableElement(e)??this.generationModel.getOwnNullableElement(e)??this.systemModel.getOwnNullableElement(e)??this.coreModel.getOwnNullableElement(e);return t&&!s?this.getNullablePackage(e)??this.dependencyManager.getNullableElement(e,!0)??this.generationModel.getNullablePackage(e)??this.systemModel.getNullablePackage(e):s}getMultiplicity(e,t){let s;return 1===e&&1===t?s=Eu.ONE:0===e&&1===t?s=Eu.ZERO_ONE:0===e&&void 0===t?s=Eu.ZERO_MANY:1===e&&void 0===t?s=Eu.ONE_MANY:0===e&&0===t&&(s=Eu.ZERO),s??new Eu(e,t)}addElement(e,t){const s=Gl(t??"",e.name);if(this.getNullableElement(s,!1))throw new j(`Can't create element '${s}': another element with the same path already existed`);super.addOwnElement(e,t)}deleteElement(e){super.deleteOwnElement(e);const t=this.graphPlugins.flatMap((e=>e.getExtraDeadReferencesCleaners?.()??[]));for(const e of t)e(this)}renameElement(e,t){if(this.getNullableElement(t,!1))throw new j(`Can't rename element '${e.path}' to '${t}': another element with the same path already existed`);super.renameOwnElement(e,e.path,t)}}class kp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class Fp{_UUID=(0,a.Z)();_OWNER;value;constructor(e,t){this._OWNER=e,this.value=t}}class jp{sourceId;line;column;startLine;startColumn;endLine;endColumn}(0,Be.yu)(jp,{column:(0,Be.Ru)(),endLine:(0,Be.Ru)(),endColumn:(0,Be.Ru)(),line:(0,Be.Ru)(),sourceId:(0,Be.Ru)(),startLine:(0,Be.Ru)(),startColumn:(0,Be.Ru)()});const Up=(0,Be.PG)((()=>Be.AM),(e=>(e.sourceId=e.source,(0,Be.vB)(jp,e))));class Vp{package;name;tags=[];stereotypes=[]}(0,Be.yu)(Vp,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ru)()),tags:(0,Be.pb)((0,Be.Ru)())});class Gp{profile;value}(0,Be.yu)(Gp,{profile:(0,Be.Ru)(),value:(0,Be.Ru)()});class $p{profile;value}(0,Be.yu)($p,{profile:(0,Be.Ru)(),value:(0,Be.Ru)()});class zp{tag;value}(0,Be.yu)(zp,{tag:(0,Be.Ry)($p),value:(0,Be.Ru)()});class Bp{rawType;typeParameter}(0,Be.yu)(Bp,{rawType:(0,Be.jt)((0,Be.Ru)()),typeParameter:(0,Be.jt)((0,Be.Ru)())});class Hp{name;stereotypes=[];taggedValues=[];aggregation;multiplicity;genericType}(0,Be.yu)(Hp,{aggregation:(0,Be.Ru)(),genericType:(0,Be.Ry)(Bp),multiplicity:(0,Be.Ru)(),name:(0,Be.Ru)(),stereotypes:(0,Be.pb)((0,Be.Ry)(Gp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp))});class Yp{package;name;sourceInformation}(0,Be.yu)(Yp,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),sourceInformation:Up});class Wp{package;name;sourceInformation;stereotypes=[];taggedValues=[];generalizations=[];properties=[];qualifiedProperties=[]}(0,Be.yu)(Wp,{generalizations:(0,Be.pb)((0,Be.Ry)(Bp)),name:(0,Be.Ru)(),package:(0,Be.Ru)(),properties:(0,Be.pb)((0,Be.Ry)(Hp)),qualifiedProperties:(0,Be.pb)((0,Be.Ry)(Hp)),sourceInformation:Up,stereotypes:(0,Be.pb)((0,Be.Ry)(Gp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp))});class Kp{package;name;enumValues=[]}(0,Be.yu)(Kp,{name:(0,Be.Ru)(),package:(0,Be.Ru)(),enumValues:(0,Be.pb)((0,Be.Ru)())});class Zp{x;y}(0,Be.yu)(Zp,{x:(0,Be.Ru)(),y:(0,Be.Ru)()});class Xp{height;width}(0,Be.yu)(Xp,{height:(0,Be.Ru)(),width:(0,Be.Ru)()});class qp{points=[]}(0,Be.yu)(qp,{points:(0,Be.pb)((0,Be.Ry)(Zp))});class Jp{id;source;target;geometry}(0,Be.yu)(Jp,{geometry:(0,Be.Ry)(qp),id:(0,Be.Ru)(),source:(0,Be.Ru)(),target:(0,Be.Ru)()});class Qp{name;owningType}(0,Be.yu)(Qp,{name:(0,Be.Ru)(),owningType:(0,Be.Ru)()});class em{id;source;target;property;geometry}(0,Be.yu)(em,{geometry:(0,Be.Ry)(qp),id:(0,Be.Ru)(),property:(0,Be.Ry)(Qp),source:(0,Be.Ru)(),target:(0,Be.Ru)()});class tm{id;type;position;rectangleGeometry}(0,Be.yu)(tm,{id:(0,Be.Ru)(),position:(0,Be.Ry)(Zp),rectangleGeometry:(0,Be.Ry)(Xp),type:(0,Be.Ru)()});class sm{package;name;stereotypes=[];taggedValues=[];generalizationViews=[];propertyViews=[];typeViews=[];sourceInformation}(0,Be.yu)(sm,{name:(0,Be.Ru)(),generalizationViews:(0,Be.pb)((0,Be.Ry)(Jp)),package:(0,Be.Ru)(),propertyViews:(0,Be.pb)((0,Be.Ry)(em)),sourceInformation:Up,stereotypes:(0,Be.pb)((0,Be.Ry)(Gp)),taggedValues:(0,Be.pb)((0,Be.Ry)(zp)),typeViews:(0,Be.pb)((0,Be.Ry)(tm))});class im{classes=[];enumerations=[];profiles=[]}(0,Be.yu)(im,{classes:(0,Be.pb)((0,Be.Ry)(Wp)),enumerations:(0,Be.pb)((0,Be.Ry)(Kp)),profiles:(0,Be.pb)((0,Be.Ry)(Vp))});class nm{name;diagram;domainInfo}(0,Be.yu)(nm,{diagram:(0,Be.Ry)(sm),name:(0,Be.Ru)(),domainInfo:(0,Be.jt)((0,Be.Ry)(im))});class am{class;enumerations=[];profiles=[];specializations=[]}(0,Be.yu)(am,{class:(0,Be.Ry)(Wp),enumerations:(0,Be.pb)((0,Be.Ry)(Kp)),profiles:(0,Be.pb)((0,Be.Ry)(Vp)),specializations:(0,Be.pb)((0,Be.Ry)(Yp))});const rm=e=>{const t=e.classViews.map((e=>` TypeView ${e.id}(\n type=${e.class.value.path},\n position=(${e.position.x.toFixed(5)}, ${e.position.y.toFixed(5)}),\n width=${e.rectangle.width.toFixed(5)},\n height=${e.rectangle.height.toFixed(5)},\n stereotypesVisible=true,\n attributesVisible=true,\n attributeStereotypesVisible=true,\n attributeTypesVisible=true,\n color=#FFFFCC,\n lineWidth=1.0)`)),s=e.generalizationViews.map(((e,t)=>` GeneralizationView gview_${t}(\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n color=#000000,\n lineWidth=-1.0,\n lineStyle=SIMPLE)`)),i=e.propertyViews.map(((e,t)=>` PropertyView pview_${t}(\n property=${e.property.value._OWNER.path}.${e.property.value.name},\n source=${e.from.classView.value.id},\n target=${e.to.classView.value.id},\n points=[${e.buildFullPath().map((e=>`(${e.x.toFixed(5)},${e.y.toFixed(5)})`)).join(",")}],\n label='',\n propertyPosition=(0.0,0.0),\n multiplicityPosition=(0.0,0.0),\n color=#000000,\n lineWidth=-1.0,\n stereotypesVisible=true,\n nameVisible=true,\n lineStyle=SIMPLE)`));return`Diagram ${e.path}(width=0.0, height=0.0)\n{\n${[...t,...s,...i].join("\n\n")}\n}`},om=(e,t,s,i)=>{const n=t.getOwnNullableClass(e);if(!n){const[n,a]=Vl(e),r=new os(a);return $l(Hl(t.root,n,!0,new Map),r),t.setOwnType(e,r),s.set(e,{isStubbed:!0,sourceInformation:i}),r}return n},lm=e=>{if("*"===e)return new Eu(0,void 0);{const t=e.split("..");if(1===t.length)return new Eu(parseInt(H(t[0]),10),parseInt(H(t[0]),10));if(2===t.length)return new Eu(parseInt(H(t[0]),10),"*"===t[1]?void 0:parseInt(H(t[1]),10));throw new Error(`Can't parse multiplicity value '${e}'`)}},cm=(e,t,s,i)=>{t.taggedValues.forEach((t=>{var i,n;b(e.taggedValues,new np(rp.create((i=s.getProfile(t.tag.profile),n=t.tag.value,H(i.p_tags.find((e=>e.value===n)),`Can't find tag '${n}' in profile '${i.path}'`))),t.value))})),t.stereotypes.forEach((t=>{var i,n;b(e.stereotypes,lp.create((i=s.getProfile(t.profile),n=t.value,H(i.p_stereotypes.find((e=>e.value===n)),`Can't find stereotype '${n}' in profile '${i.path}'`))))})),t.generalizations.filter((e=>Boolean(e.rawType))).forEach((t=>{const n=om(H(t.rawType),s,i,void 0);b(e.generalizations,mu.create(new _u(n))),b(n._subclasses,e)})),t.properties.filter((e=>Boolean(e.genericType.rawType))).forEach((t=>{const n=new gu(t.name,lm(t.multiplicity),mu.create(new _u(s.getOwnNullableEnumeration(H(t.genericType.rawType))??om(H(t.genericType.rawType),s,i,void 0))),e);n.aggregation="Composite"===t.aggregation?du.COMPOSITE:"Shared"===t.aggregation?du.SHARED:void 0,b(e.properties,n)})),t.qualifiedProperties.filter((e=>e.genericType.rawType)).forEach((t=>{b(e.derivedProperties,new uu(t.name,lm(t.multiplicity),mu.create(new _u(s.getOwnNullableEnumeration(H(t.genericType.rawType))??om(H(t.genericType.rawType),s,i,void 0))),e))}))},dm=e=>{const t=new Mp(new Lp([]),new bp([]),[]),s=new Map;if(e.domainInfo){const i=e.domainInfo;i.classes.forEach((e=>{const i=new os(e.name);$l(Hl(t.root,e.package,!0,new Map),i),t.setOwnType(i.path,i),s.set(i.path,{sourceInformation:e.sourceInformation,isStubbed:!1})})),i.profiles.forEach((e=>{const s=new hp(e.name);$l(Hl(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new kp(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new Fp(s,e))))})),i.enumerations.forEach((e=>{const s=new cs(e.name);$l(Hl(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)})),i.classes.forEach((e=>{const i=`${e.package}${""===e.package?"":Ee}${e.name}`,n=t.getClass(i);cm(n,e,t,s)}))}const i=e.diagram,n=new Xo(i.name);return $l(Hl(t.root,i.package,!0,new Map),n),i.typeViews.forEach((e=>{const s=new rc(n,e.id,Ts.create(t.getClass(e.type)));s.position=new ic(e.position.x,e.position.y),s.rectangle=new nc(e.rectangleGeometry.width,e.rectangleGeometry.height),b(n.classViews,s)})),i.propertyViews.forEach((e=>{const s=new uc(n,Tu.create((i=t.getClass(e.property.owningType),a=e.property.name,H(i instanceof os?Zl(i).find((e=>e.name===a)):i.properties.find((e=>e.name===a)),`Can't find property '${a}' of '${i.path}'`))),H(n.classViews.find((t=>t.id===e.source))),H(n.classViews.find((t=>t.id===e.target))));var i,a;s.path=e.geometry.points.map((e=>new ic(e.x,e.y))),Ec(s),b(n.propertyViews,s)})),i.generalizationViews.forEach((e=>{const t=new pc(n,H(n.classViews.find((t=>t.id===e.source))),H(n.classViews.find((t=>t.id===e.target))));t.path=e.geometry.points.map((e=>new ic(e.x,e.y))),Ec(t),b(n.generalizationViews,t)})),[n,t,s]};class hm extends sh{diagramInfo;_renderer;diagram;diagramClasses;graph;diagramPath;filePath;fileLine;fileColumn;constructor(e,t,s,i,n,a){super(e),(0,x.rC)(this,{_renderer:x.LO,diagram:x.LO,diagramInfo:x.LO,diagramName:x.Fl,diagramCursorClass:x.Fl,addClassView:x.ls,rebuild:x.aD,setRenderer:x.aD}),this.diagramPath=s,this.filePath=i,this.fileLine=n,this.fileColumn=a,this.diagramInfo=t;const[r,o,l]=dm(t);this.diagram=r,this.graph=o,this.diagramClasses=l}get label(){return Yd(this.diagramPath)}get description(){return`Diagram: ${Yd(this.diagramPath)}`}get diagramName(){return jl(this.diagramPath)}match(e){return e instanceof hm&&this.diagramPath===e.diagramPath}get renderer(){return H(this._renderer,"Diagram renderer must be initialized (this is likely caused by calling this method at the wrong place)")}get isDiagramRendererInitialized(){return Boolean(this._renderer)}get diagramCursorClass(){if(!this.isDiagramRendererInitialized)return"";if(this.renderer.middleClick||this.renderer.rightClick)return"diagram-editor__cursor--grabbing";switch(this.renderer.interactionMode){case qu.PAN:return this.renderer.leftClick?"diagram-editor__cursor--grabbing":"diagram-editor__cursor--grab";case qu.ZOOM_IN:return"diagram-editor__cursor--zoom-in";case qu.ZOOM_OUT:return"diagram-editor__cursor--zoom-out";case qu.LAYOUT:return this.renderer.selectionStart?"diagram-editor__cursor--crosshair":this.renderer.mouseOverClassCorner||this.renderer.selectedClassCorner?"diagram-editor__cursor--resize":this.renderer.mouseOverClassView?"diagram-editor__cursor--pointer":"";default:return""}}rebuild(e){this.diagramInfo=e;const[t,s,i]=dm(e);this.diagram=t,this.graph=s,this.diagramClasses=i,this.fileLine=e.diagram.sourceInformation.line,this.fileColumn=e.diagram.sourceInformation.column}setupRenderer(){this.renderer.onClassViewDoubleClick=e=>{const t=this.diagramClasses.get(e.class.value.path)?.sourceInformation;if(t){const e=new Kd(t.sourceId,t.startLine,t.startColumn);(0,x.fl)(this.editorStore.executeNavigation(e)).catch(this.editorStore.applicationStore.alertUnhandledError)}}}setRenderer(e){this._renderer=e}*addClassView(e,t){const s=((e,t,s)=>{e.profiles.forEach((e=>{const s=`${e.package}${""===e.package?"":Ee}${e.name}`;if(!t.getOwnNullableProfile(s)){const s=new hp(e.name);$l(Hl(t.root,e.package,!0,new Map),s),t.setOwnProfile(s.path,s),e.tags.forEach((e=>b(s.p_tags,new kp(s,e)))),e.stereotypes.forEach((e=>b(s.p_stereotypes,new Fp(s,e))))}})),e.enumerations.forEach((e=>{const s=`${e.package}${""===e.package?"":Ee}${e.name}`;if(!t.getOwnNullableEnumeration(s)){const s=new cs(e.name);$l(Hl(t.root,e.package,!0,new Map),s),t.setOwnType(s.path,s)}}));const i=e.class,n=`${i.package}${""===i.package?"":Ee}${i.name}`;let a=t.getOwnNullableClass(n);a||(a=new os(i.name),$l(Hl(t.root,i.package,!0,new Map),a),t.setOwnType(a.path,a));const r=s.get(a.path)?.isStubbed??!0;return s.set(a.path,{sourceInformation:i.sourceInformation,isStubbed:!1}),e.specializations.forEach((e=>{const i=H(a),n=om(H(`${e.package}${""===e.package?"":Ee}${e.name}`),t,s,e.sourceInformation);b(i._subclasses,n),n.generalizations.map((e=>e.value.rawType)).includes(i)||b(n.generalizations,mu.create(new _u(i)))})),r&&cm(a,i,t,s),a})((0,Be.vB)(am,yield this.editorStore.client.getDiagramClassInfo(e)),this.graph,this.diagramClasses),i=this.renderer.addClassView(s,t);i&&(i.id=((e,t)=>{if(!t.match(/^[\w_-]+$/))throw new Error("Token must only contain digits, letters, or special characters _ and -");const s=e.map((e=>{const s=e.match(new RegExp(`^${t}_(?<count>\\d+)$`));return s?.groups?.count?parseInt(s.groups.count,10):0})).reduce(((e,t)=>Math.max(e,t)),0);return`${t}_${s+1}`})(this.diagram.classViews.map((e=>e.id)),"cview"))}registerCommands(){const e=()=>this.editorStore.tabManagerState.currentTab===this&&this.isDiagramRendererInitialized;this.editorStore.applicationStore.commandCenter.registerCommand({key:rh.RECENTER,trigger:e,action:()=>this.renderer.recenter()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:rh.USE_ZOOM_TOOL,trigger:e,action:()=>this.renderer.switchToZoomMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:rh.USE_VIEW_TOOL,trigger:e,action:()=>this.renderer.switchToViewMode()}),this.editorStore.applicationStore.commandCenter.registerCommand({key:rh.USE_PAN_TOOL,trigger:e,action:()=>this.renderer.switchToPanMode()})}deregisterCommands(){[rh.RECENTER,rh.USE_ZOOM_TOOL,rh.USE_VIEW_TOOL,rh.USE_PAN_TOOL].forEach((e=>this.editorStore.applicationStore.commandCenter.deregisterCommand(e)))}}class um{text="";isCaseSensitive=!1;isRegExp=!1;constructor(){(0,x.rC)(this,{text:x.LO,isCaseSensitive:x.LO,isRegExp:x.LO,reset:x.aD,setText:x.aD,setCaseSensitive:x.aD,setRegExp:x.aD})}reset(){this.setText(""),this.setCaseSensitive(!1),this.setRegExp(!1)}setText(e){this.text=e}setCaseSensitive(e){this.isCaseSensitive=e}toggleCaseSensitive(){this.setCaseSensitive(!this.isCaseSensitive)}setRegExp(e){this.isRegExp=e}toggleRegExp(){this.setRegExp(!this.isRegExp)}}class pm extends k{}class mm{applicationStore;initState=ft.create();directoryTreeState;conceptTreeState;client;isMaxAuxPanelSizeSet=!1;activeAuxPanelMode=Fd.CONSOLE;auxPanelDisplayState=new cu({initial:0,default:300,snap:100});activeActivity=kd.CONCEPT;sideBarDisplayState=new cu({initial:300,default:300,snap:150});tabManagerState=new ih(this);executionState=ft.create();navigationStack=[];consoleText;fileSearchCommandLoadingState=ft.create();fileSearchCommandState=new um;openFileSearchCommand=!1;fileSearchCommandResults=[];textSearchCommandLoadingState=ft.create();textSearchCommandState=new um;openTextSearchCommand=!1;searchState;testRunState=ft.create();testRunnerState;constructor(e){(0,x.rC)(this,{isMaxAuxPanelSizeSet:x.LO,activeAuxPanelMode:x.LO,activeActivity:x.LO,consoleText:x.LO,navigationStack:x.LO,openFileSearchCommand:x.LO,fileSearchCommandResults:x.LO,fileSearchCommandState:x.LO,openTextSearchCommand:x.LO,textSearchCommandState:x.LO,searchState:x.LO,testRunnerState:x.LO,setOpenFileSearchCommand:x.aD,setOpenTextSearchCommand:x.aD,setActiveAuxPanelMode:x.aD,setActiveActivity:x.aD,setConsoleText:x.aD,setSearchState:x.aD,setTestRunnerState:x.aD,pullInitializationActivity:x.aD,pullExecutionStatus:x.aD,initialize:x.ls,checkIfSessionWakingUp:x.ls,loadDiagram:x.ls,loadFile:x.ls,execute:x.ls,executeGo:x.ls,manageExecuteGoResult:x.ls,executeTests:x.ls,executeFullTestSuite:x.ls,executeNavigation:x.ls,navigateBack:x.ls,fullReCompile:x.ls,command:x.ls,findUsages:x.ls,renameConcept:x.ls,movePackageableElements:x.ls,updateFileUsingSuggestionCandidate:x.ls,updateFile:x.ls,searchFile:x.ls,searchText:x.ls,createNewDirectory:x.ls,createNewFile:x.ls,renameFile:x.ls,deleteDirectoryOrFile:x.ls}),this.applicationStore=e,this.directoryTreeState=new xh(this),this.conceptTreeState=new Nh(this),this.client=new lu(new me({baseUrl:this.applicationStore.config.useDynamicPureServer?window.location.origin:this.applicationStore.config.pureUrl}))}setOpenFileSearchCommand(e){this.openFileSearchCommand=e}setOpenTextSearchCommand(e){this.openTextSearchCommand=e}setActiveAuxPanelMode(e){this.activeAuxPanelMode=e}setConsoleText(e){this.consoleText=e}setSearchState(e){this.searchState=e}setTestRunnerState(e){this.testRunnerState=e}cleanUp(){this.applicationStore.setBlockingAlert(void 0),this.applicationStore.setActionAlertInfo(void 0)}*initialize(e,t,s,i){if(this.initState.isInInitialState){this.client.mode=s,this.client.compilerMode=i,this.initState.inProgress();try{const s=this.client.initialize(!e);this.applicationStore.setBlockingAlert({message:"Loading Pure IDE...",prompt:"Please be patient as we are building the initial application state",showLoading:!0}),yield this.pullInitializationActivity(),this.applicationStore.setBlockingAlert(void 0);const i=(0,x.fl)(this.loadFile("/welcome.pure")),a=this.directoryTreeState.initialize(),r=this.conceptTreeState.initialize(),o=(n=yield s).error?n.source?(0,Be.vB)(Sh,n):(0,Be.vB)(Oh,n):(0,Be.vB)(Ah,n);o.text&&(this.setConsoleText(o.text),this.setActiveAuxPanelMode(Fd.CONSOLE),this.auxPanelDisplayState.open()),o instanceof Oh?o.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:o.sessionError}):o instanceof Sh&&(yield(0,x.fl)(this.loadFile(o.source,new Zd(o.source,o.line,o.column,new pm((o.text??"").split("\n").filter(Boolean)[0]))))):(t&&(yield t()),yield Promise.all([i,a,r]))}catch(e){return V(e),this.applicationStore.notifyError(e),this.initState.fail(),void this.applicationStore.setBlockingAlert({message:"Failed to initialize IDE",prompt:"Make sure the IDE server is working, otherwise try to restart it"})}var n;this.initState.pass()}else this.applicationStore.notifyIllegalState("Editor store is re-initialized")}*checkIfSessionWakingUp(e){this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",showLoading:!0}),yield this.pullInitializationActivity((t=>{t.text&&this.applicationStore.setBlockingAlert({message:e??"Checking IDE session...",prompt:t.text,showLoading:!0})})),this.applicationStore.setBlockingAlert(void 0)}async pullInitializationActivity(e){return(await this.client.getInitializationActivity()).initializing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullInitializationActivity())}catch(e){t(e)}}),1e3))):Promise.resolve()}registerCommands(){this.applicationStore.commandCenter.registerCommand({key:nh.SEARCH_FILE,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenFileSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:nh.SEARCH_TEXT,trigger:()=>this.initState.hasSucceeded,action:()=>this.setOpenTextSearchCommand(!0)}),this.applicationStore.commandCenter.registerCommand({key:nh.GO_TO_FILE,action:()=>{this.tabManagerState.currentTab instanceof uh&&this.directoryTreeState.revealPath(this.tabManagerState.currentTab.filePath,!0)}}),this.applicationStore.commandCenter.registerCommand({key:nh.TOGGLE_AUX_PANEL,trigger:()=>this.initState.hasSucceeded,action:()=>this.auxPanelDisplayState.toggle()}),this.applicationStore.commandCenter.registerCommand({key:nh.EXECUTE,action:()=>{(0,x.fl)(this.executeGo()).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:nh.FULL_RECOMPILE,action:()=>{(0,x.fl)(this.fullReCompile(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:nh.FULL_RECOMPILE_WITH_FULL_INIT,action:()=>{(0,x.fl)(this.fullReCompile(!0)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:nh.RUN_ALL_TESTS,action:()=>{(0,x.fl)(this.executeFullTestSuite(!1)).catch(this.applicationStore.alertUnhandledError)}}),this.applicationStore.commandCenter.registerCommand({key:nh.RUN_RELAVANT_TESTS,action:()=>{(0,x.fl)(this.executeFullTestSuite(!0)).catch(this.applicationStore.alertUnhandledError)}})}deregisterCommands(){[nh.SEARCH_FILE,nh.SEARCH_TEXT,nh.GO_TO_FILE,nh.TOGGLE_AUX_PANEL,nh.EXECUTE,nh.FULL_RECOMPILE,nh.FULL_RECOMPILE_WITH_FULL_INIT,nh.RUN_ALL_TESTS,nh.RUN_RELAVANT_TESTS].forEach((e=>this.applicationStore.commandCenter.deregisterCommand(e)))}setActiveActivity(e,t){this.sideBarDisplayState.isOpen?e!==this.activeActivity||t?.keepShowingIfMatchedCurrent||this.sideBarDisplayState.close():this.sideBarDisplayState.open(),this.activeActivity=e}*loadDiagram(e,t,s,i){let n=this.tabManagerState.tabs.find((e=>e instanceof hm&&e.diagramPath===t));n||(yield(0,x.fl)(this.checkIfSessionWakingUp()),n=new hm(this,(0,Be.vB)(nm,yield this.client.getDiagramInfo(t)),t,e,s,i)),this.tabManagerState.openTab(n)}*loadFile(e,t){let s=this.tabManagerState.tabs.find((t=>t instanceof uh&&t.filePath===e));s||(yield(0,x.fl)(this.checkIfSessionWakingUp()),s=new uh(this,(0,Be.vB)(Wd,yield this.client.getFile(e)),e)),this.tabManagerState.openTab(s),t&&(s.textEditorState.setForcedCursorPosition({lineNumber:t.line,column:t.column}),t instanceof Zd&&s.showError(t))}async reloadFile(e){const t=[];await Promise.all(this.tabManagerState.tabs.map((async s=>{if(s instanceof uh&&s.filePath===e)s.setFile((0,Be.vB)(Wd,await this.client.getFile(e)));else if(s instanceof hm&&s.filePath===e)try{s.rebuild((0,Be.vB)(nm,await this.client.getDiagramInfo(s.diagramPath)))}catch{t.push(s)}}))),t.forEach((e=>this.tabManagerState.closeTab(e)))}*execute(e,t,s,i,n){if(!this.initState.hasSucceeded)return void this.applicationStore.notifyWarning("Can't execute while initializing application");if(this.executionState.isInProgress)return void this.applicationStore.notifyWarning("Another execution is already in progress!");this.searchState instanceof zh||this.setSearchState(void 0),this.executionState.inProgress();const a=this.tabManagerState.tabs.filter(Y(uh)).map((e=>e.filePath));try{const o=this.tabManagerState.tabs.map((e=>e instanceof uh?{path:e.filePath,code:e.file.content}:e instanceof hm?{diagram:e.diagramPath,code:rm(e.diagram)}:void 0)).filter(z),l=this.client.execute(o,e,t),c=1e3;let d,h=!1;yield Promise.all([l.then((e=>{h=!0,d=e})),new Promise((e=>setTimeout((()=>{!h&&s&&(this.applicationStore.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),e(this.pullExecutionStatus())),e()}),c,!0)))]);const u=(r=H(d)).error?r.candidateName&&r.PureUnmatchedFunctionException?(0,Be.vB)(bh,r):r.candidateName&&r.candidates?(0,Be.vB)(Dh,r):(0,Be.vB)(vh,r):r.jumpTo?(0,Be.vB)(Ph,r):r.tests?(0,Be.vB)(Fh,r):(0,Be.vB)(Ih,r);this.applicationStore.setBlockingAlert(void 0),n?.avoidUpdatingConsoleText||this.setConsoleText(u.text),u instanceof vh?(this.applicationStore.notifyWarning("Execution failed"+(u.text?`: ${u.text}`:"")),u.sessionError?this.applicationStore.setBlockingAlert({message:"Session corrupted",prompt:u.sessionError}):yield(0,x.fl)(i(u,a))):u instanceof Ih?(this.applicationStore.notifySuccess("Execution succeeded!"),u.reinit?(this.applicationStore.setBlockingAlert({message:"Reinitializing...",prompt:"Please do not refresh the application",showLoading:!0}),this.initState.reset(),yield(0,x.fl)(this.initialize(!1,(()=>(0,x.fl)(this.execute(e,t,s,i))),this.client.mode,this.client.compilerMode))):yield(0,x.fl)(i(u,a))):yield(0,x.fl)(i(u,a))}finally{this.applicationStore.setBlockingAlert(void 0),this.executionState.reset()}var r}async pullExecutionStatus(){const e=await this.client.getExecutionActivity();return this.applicationStore.setBlockingAlert({message:"Executing...",prompt:e.text?e.text:"Please do not refresh the application",showLoading:!0}),e.executing?new Promise(((e,t)=>setTimeout((()=>{try{e(this.pullExecutionStatus())}catch(e){t(e)}}),500))):(this.applicationStore.setBlockingAlert({message:"Executing...",prompt:"Please do not refresh the application",showLoading:!0}),Promise.resolve())}*executeGo(){yield(0,x.fl)(this.execute("executeGo",{},!0,((e,t)=>(0,x.fl)(this.manageExecuteGoResult(e,t)))))}*manageExecuteGoResult(e,t){const s=this.refreshTrees();if(e instanceof vh)yield(0,x.fl)(this.loadFile(e.source,new Zd(e.source,e.line,e.column,new pm(e.text.split("\n").filter(Boolean)[0])))),e instanceof bh?(this.setSearchState(new Yh(this,e)),this.setActiveAuxPanelMode(Fd.SEARCH_RESULT),this.auxPanelDisplayState.open()):e instanceof Dh&&(this.setSearchState(new Wh(this,e)),this.setActiveAuxPanelMode(Fd.SEARCH_RESULT),this.auxPanelDisplayState.open()),this.resetChangeDetection(t);else if(e instanceof Ih){if(e.modifiedFiles.length)for(const t of e.modifiedFiles)yield this.reloadFile(t);this.resetChangeDetection(t.concat(e.modifiedFiles))}yield s}*executeTests(e,t){t?this.applicationStore.notifyUnsupportedFeature("Run relevant tests! (reason: VCS required)"):this.testRunState.isInProgress?this.applicationStore.notifyWarning("Test runner is working. Please try again later"):(this.testRunState.inProgress(),yield(0,x.fl)(this.execute("executeTests",{path:e,relevantTestsOnly:t},!1,(async(e,t)=>{const s=this.refreshTrees();if(e instanceof vh)await(0,x.fl)(this.loadFile(e.source,new Zd(e.source,e.line,e.column,new pm(e.text.split("\n").filter(Boolean)[0])))),this.setActiveAuxPanelMode(Fd.CONSOLE),this.auxPanelDisplayState.open(),this.testRunState.fail();else if(e instanceof Fh){this.setActiveAuxPanelMode(Fd.TEST_RUNNER),this.auxPanelDisplayState.open();const t=new au(this,e);this.setTestRunnerState(t),await(0,x.fl)(t.buildTestTreeData()),t.refreshTree(),await(0,x.fl)(t.pollTestRunnerResult()),this.testRunState.pass()}this.resetChangeDetection(t),await s}))))}*executeFullTestSuite(e){yield(0,x.fl)(this.executeTests("::",e))}*executeNavigation(e){this.navigationStack.push(e),yield(0,x.fl)(this.execute("getConcept",{file:e.file,line:e.line,column:e.column},!1,(async(e,t)=>{e instanceof Ph&&await(0,x.fl)(this.loadFile(e.jumpTo.source,new Kd(e.jumpTo.source,e.jumpTo.line,e.jumpTo.column))),this.resetChangeDetection(t)}),{avoidUpdatingConsoleText:!0}))}*navigateBack(){if(0!==this.navigationStack.length){if(this.navigationStack.length>0){const e=this.navigationStack.pop();e&&(yield(0,x.fl)(this.loadFile(e.file,e)))}}else this.applicationStore.notifyWarning("Can't navigate back any further - navigation stack is empty")}*fullReCompile(e){this.applicationStore.setActionAlertInfo({message:"Are you sure you want to perform a full re-compile?",prompt:"This may take a long time to complete",type:Rt.CAUTION,actions:[{label:"Perform full re-compile",type:Pt.PROCEED_WITH_CAUTION,handler:()=>{(0,x.fl)(this.execute("executeSaveAndReset",{},!0,(async(t,s)=>{this.initState.reset(),await(0,x.fl)(this.initialize(e,void 0,this.client.mode,this.client.compilerMode)),this.resetChangeDetection(s),this.setActiveActivity(kd.CONCEPT,{keepShowingIfMatchedCurrent:!0})}))).catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Pt.PROCEED,default:!0}]})}resetChangeDetection(e){this.tabManagerState.tabs.filter(Y(uh)).filter((t=>e.includes(t.filePath))).forEach((e=>e.resetChangeDetection()))}async refreshTrees(){await Promise.all([this.directoryTreeState.refreshTreeData(),this.conceptTreeState.refreshTreeData()])}async revealConceptInTree(e){let t;try{t=await this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning("Can't find concept info. Please make sure that the code compiles and that you are looking for references of non primitive types!")}if(t.path){this.applicationStore.setBlockingAlert({message:"Revealing concept in tree...",showLoading:!0});try{this.activeActivity!==kd.CONCEPT&&this.setActiveActivity(kd.CONCEPT);const e=t.path.split(Ee);let s=H(e[0]),i=H(this.conceptTreeState.getTreeData().nodes.get(s));for(let t=1;t<e.length;++t)s=`${s}${Ee}${e[t]}`,this.conceptTreeState.getTreeData().nodes.get(s)||await(0,x.fl)(this.conceptTreeState.expandNode(i)),i=H(this.conceptTreeState.getTreeData().nodes.get(s));this.conceptTreeState.setSelectedNode(i)}catch{this.applicationStore.notifyWarning("Error revealing concept. Please make sure that the code compiles and that you are looking for a valid concept")}finally{this.applicationStore.setBlockingAlert(void 0)}}}*command(e){try{const s=(t=yield e()).error?(0,Be.vB)(ou,t):new ru;return!(s instanceof ou&&(s.errorDialog?this.applicationStore.notifyWarning(`Error: ${s.text}`):this.setConsoleText(s.text),1))}catch(e){return V(e),this.applicationStore.notifyError(e),!1}var t}async getConceptInfo(e){try{return await this.client.getConceptInfo(e.file,e.line,e.column)}catch{return void this.applicationStore.notifyWarning("Can't find concept info. Please make sure that the code compiles and that you are looking for references of non primitive types!")}}async findConceptUsages(e,t){return(await this.client.getUsages(e,t)).map((e=>(0,Be.vB)(Jd,e)))}*findUsages(e){const t=yield this.getConceptInfo(e);if(t)try{this.applicationStore.setBlockingAlert({message:"Finding concept usages...",prompt:`Finding references of ${qd(t)}`,showLoading:!0});const e=yield this.findConceptUsages(t.pureType===Vd.ENUM_VALUE?Xd.ENUM:t.pureType===Vd.PROPERTY||t.pureType===Vd.QUALIFIED_PROPERTY?Xd.PROPERTY:Xd.ELEMENT,(t.owner?[`'${t.owner}'`]:[]).concat(`'${t.path}'`)),s=(yield this.client.getTextSearchPreview(e.map((e=>(0,Be.qC)(Vh,new Vh(e.source,e.startLine,e.startColumn,e.endLine,e.endColumn)))))).map((e=>(0,Be.vB)(Vh,e)));this.setSearchState(new Hh(this,t,e,s)),this.setActiveAuxPanelMode(Fd.SEARCH_RESULT),this.auxPanelDisplayState.open()}catch(e){V(e),this.applicationStore.notifyError(e)}finally{this.applicationStore.setBlockingAlert(void 0)}}*renameConcept(e,t,s,i){try{yield this.client.renameConcept({oldName:e,newName:t,pureType:s,sourceInformations:i.map((e=>({sourceId:e.source,line:e.line,column:e.column})))});const n=i.map((e=>e.source));for(const e of n)yield this.reloadFile(e);yield this.refreshTrees(),this.setConsoleText("Sucessfully renamed concept. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError(`Can't rename concept '${e}'`)}}*movePackageableElements(e){try{yield this.client.movePackageableElements(e.map((e=>({pureName:e.pureName,pureType:e.pureType,sourcePackage:e.sourcePackage,destinationPackage:e.destinationPackage,sourceInformations:e.usages.map((e=>({sourceId:e.source,line:e.line,column:e.column})))}))));const t=(0,Xe.Z)(e.flatMap((e=>e.usages.map((e=>e.source)))));for(const e of t)yield this.reloadFile(e);yield this.refreshTrees(),this.setConsoleText("Sucessfully moved packageble elements. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError("Can't move packageable elements")}}*updateFileUsingSuggestionCandidate(e){this.setSearchState(void 0),yield(0,x.fl)(this.updateFile(e.fileToBeModified,e.lineToBeModified,e.columnToBeModified,e.add,e.messageToBeModified)),this.setActiveAuxPanelMode(Fd.CONSOLE),this.auxPanelDisplayState.open()}*updateFile(e,t,s,i,n){try{const a=yield this.client.updateSource([{path:e,line:t,column:s,message:n,add:i}]);if(a.modifiedFiles.length)for(const e of a.modifiedFiles)yield this.reloadFile(e);this.setConsoleText("Sucessfully updated file. Please re-compile the code"),this.applicationStore.notifyWarning("Please re-compile the code after refacting")}catch{this.applicationStore.notifyError(`Can't update file: ${e}`)}}*searchFile(){this.fileSearchCommandLoadingState.isInProgress||(this.fileSearchCommandLoadingState.inProgress(),this.fileSearchCommandResults=yield this.client.findFiles(this.fileSearchCommandState.text,this.fileSearchCommandState.isRegExp),this.fileSearchCommandLoadingState.pass())}*searchText(){if(!this.textSearchCommandLoadingState.isInProgress){this.textSearchCommandLoadingState.inProgress(),this.setActiveAuxPanelMode(Fd.SEARCH_RESULT),this.auxPanelDisplayState.open();try{const e=(yield this.client.searchText(this.textSearchCommandState.text,this.textSearchCommandState.isCaseSensitive,this.textSearchCommandState.isRegExp)).map((e=>(e=>(0,Be.vB)(Gh,e))(e)));this.setSearchState(new Bh(this,e)),this.textSearchCommandLoadingState.pass()}catch(e){V(e),this.applicationStore.notifyError(e),this.textSearchCommandLoadingState.fail()}}}*createNewDirectory(e){try{yield(0,x.fl)(this.command((()=>this.client.createFolder(Yd(e))))),yield(0,x.fl)(this.directoryTreeState.refreshTreeData())}catch(e){V(e),this.applicationStore.notifyError(e)}}*createNewFile(e){try{const t=yield(0,x.fl)(this.command((()=>this.client.createFile(Yd(e)))));yield(0,x.fl)(this.directoryTreeState.refreshTreeData()),t&&(yield(0,x.fl)(this.loadFile(e)))}catch(e){V(e),this.applicationStore.notifyError(e)}}*renameFile(e,t){try{yield(0,x.fl)(this.command((()=>this.client.renameFile(e,t)))),yield(0,x.fl)(this.directoryTreeState.refreshTreeData());const s=this.tabManagerState.tabs.find((t=>t instanceof uh&&t.filePath===e));s&&this.tabManagerState.closeTab(s)}catch(e){V(e),this.applicationStore.notifyError(e)}}*deleteDirectoryOrFile(e,t,s){const i=async()=>{await(0,x.fl)(this.command((()=>this.client.deleteDirectoryOrFile(Yd(e))))),this.tabManagerState.tabs.filter((s=>s instanceof uh&&(t?s.filePath.startsWith(`${e}/`):s.filePath===e))).forEach((e=>this.tabManagerState.closeTab(e))),await(0,x.fl)(this.directoryTreeState.refreshTreeData())};this.applicationStore.setActionAlertInfo({message:`Are you sure you would like to delete this ${t?"directory":"file"}?`,prompt:s?"Beware! This directory is not empty, this action is not undo-able, you have to manually revert using VCS":"Beware! This action is not undo-able, you have to manually revert using VCS",type:Rt.CAUTION,actions:[{label:"Delete anyway",type:Pt.PROCEED_WITH_CAUTION,handler:()=>{i().catch(this.applicationStore.alertUnhandledError)}},{label:"Abort",type:Pt.PROCEED,default:!0}]})}}const _m=(0,at.createContext)(void 0),gm=({children:e})=>{const t=Ft(),s=(0,nt.fv)((()=>new mm(t)));return(0,T.jsx)(_m.Provider,{value:s,children:e})},Em=()=>H((0,at.useContext)(_m),"Can't find editor store in context"),fm=(0,nt.Pi)((()=>{const e=Em();return(0,T.jsxs)("div",{className:"console-panel",children:[e.consoleText&&(0,T.jsx)("pre",{className:"console-panel__content",children:e.consoleText.trim()}),!e.consoleText&&(0,T.jsx)(hd,{children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Execute to see output"}),(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F9"})})]})})})})]})})),Tm=(0,nt.Pi)((e=>{const{searchState:t,searchEntry:s}=e,i=Em(),n=Ft(),a=e=>()=>(0,x.fl)(i.loadFile(s.sourceId,new Kd(s.sourceId,e.startLine,e.startColumn))).catch(n.alertUnhandledError),r=e=>()=>{s.dismissCoordinate(e),s.coordinates.length||t.dismissSearchEntry(s)};return(0,T.jsxs)("div",{className:"search-panel__entry",children:[(0,T.jsxs)("div",{className:"search-panel__entry__header",children:[(0,T.jsxs)("div",{className:"search-panel__entry__header__title",children:[(0,T.jsx)("div",{className:"search-panel__entry__header__title__label",children:(0,T.jsx)(Xc.QqN,{})}),(0,T.jsx)("div",{className:"search-panel__entry__header__title__content",children:Yd(s.sourceId)})]}),(0,T.jsxs)("div",{className:"search-panel__entry__header__actions",children:[(0,T.jsx)("div",{className:"search-panel__entry__header__action search-panel__entry__header__action--with-counter",children:(0,T.jsx)("div",{className:"search-panel__entry__header__action__counter",children:s.coordinates.length})}),(0,T.jsx)("button",{className:"search-panel__entry__header__action search-panel__entry__header__action--hidden",tabIndex:-1,title:"Dismiss",onClick:()=>t.dismissSearchEntry(s),children:(0,T.jsx)(Xc.q1B,{})})]})]}),(0,T.jsx)("div",{className:"search-panel__entry__content",children:s.coordinates.map((e=>(0,T.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"search-panel__entry__content__item__label search-panel__entry__content__item__label--full",title:"Go to Result",onClick:a(e),children:[e.preview&&(0,T.jsxs)("div",{className:"search-panel__entry__content__item__label__content",children:[(0,T.jsx)("div",{className:"search-panel__entry__content__item__label__coordinates",children:`[${e.startLine}:${e.startColumn}]`}),(0,T.jsxs)("div",{className:"search-panel__entry__content__item__label__preview",children:[(0,T.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text",children:e.preview.before}),(0,T.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text search-panel__entry__content__item__label__preview__text--found",children:e.preview.found.replaceAll(/\n/g,"↵")}),(0,T.jsx)("span",{className:"search-panel__entry__content__item__label__preview__text",children:e.preview.after})]})]}),!e.preview&&(0,T.jsx)(T.Fragment,{children:`line: ${e.startLine} - column: ${e.startColumn}`})]}),(0,T.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"search-panel__entry__content__item__action search-panel__entry__content__item__action--hidden",tabIndex:-1,title:"Dismiss",onClick:r(e),children:(0,T.jsx)(Xc.q1B,{})})})]},e.uuid)))})]})})),Cm=(0,nt.Pi)((e=>{const{searchState:t}=e,s=Em();return t.searchEntries.length?(0,T.jsxs)("div",{className:"search-panel__content",children:[(0,T.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} result(s) in ${t.numberOfFiles} files for '${s.textSearchCommandState.text}'`}),t.searchEntries.map((e=>(0,T.jsx)(Tm,{searchState:t,searchEntry:e},e.uuid)))]}):(0,T.jsx)(hd,{children:`No occurrences found for '${s.textSearchCommandState.text}'`})})),xm=(0,nt.Pi)((e=>{const{usageState:t}=e;return t.searchEntries.length?(0,T.jsxs)("div",{className:"search-panel__content",children:[(0,T.jsx)("div",{className:"search-panel__content__header",children:`Showing ${t.numberOfResults} usages(s) in ${t.numberOfFiles} files for ${qd(t.usageConcept)}`}),t.searchEntries.map((e=>(0,T.jsx)(Tm,{searchState:t,searchEntry:e},e.uuid)))]}):(0,T.jsx)(hd,{children:`No usages found for ${qd(t.usageConcept)}`})})),Nm=(0,nt.Pi)((e=>{const{candidate:t}=e,s=Em(),i=Ft(),n=()=>{(0,x.fl)(s.loadFile(t.sourceID,new Kd(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)};return(0,T.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Go to Result",onClick:n,children:[(0,T.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,T.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${Yd(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,T.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:n,children:(0,T.jsx)(Xc.bK4,{})})})]})})),Am=(0,nt.Pi)((e=>{const{candidate:t}=e,s=Em(),i=Ft();return(0,T.jsxs)("div",{className:"search-panel__entry__content__item",children:[(0,T.jsxs)("div",{className:"search-panel__entry__content__item__label__candidate",title:"Add Suggested Import",onClick:()=>{(0,x.fl)(s.updateFileUsingSuggestionCandidate(t)).catch(i.alertUnhandledError)},children:[(0,T.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-name",children:t.foundName}),(0,T.jsx)("div",{className:"search-panel__entry__content__item__label__candidate-location",children:`${Yd(t.sourceID)} [${t.line}:${t.column}]`})]}),(0,T.jsx)("div",{className:"search-panel__entry__content__item__actions",children:(0,T.jsx)("button",{className:"search-panel__entry__content__item__action",tabIndex:-1,title:"Go to Result",onClick:()=>{(0,x.fl)(s.loadFile(t.sourceID,new Kd(t.sourceID,t.line,t.column))).catch(i.alertUnhandledError)},children:(0,T.jsx)(Xc.bK4,{})})})]})})),Om=(0,nt.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,T.jsxs)("div",{className:"search-panel__content",children:[!s.candidatesWithPackageImported.length&&(0,T.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages already imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageImported.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages already imported, would match the function '${s.candidateName}' if you changed the parameters`}),(0,T.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageImported.map((e=>(0,T.jsx)(Nm,{candidate:e},e.uuid)))})]}),!s.candidatesWithPackageNotImported.length&&(0,T.jsx)("div",{className:"search-panel__content__header",children:`No functions, in packages not imported, match the function '${s.candidateName}'`}),Boolean(s.candidatesWithPackageNotImported.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"search-panel__content__header",children:`These functions, in packages not imported, match the function '${s.candidateName}'. Click on result to import the necessary package`}),(0,T.jsx)("div",{className:"search-panel__entry",children:s.candidatesWithPackageNotImported.map((e=>(0,T.jsx)(Am,{candidate:e},e.uuid)))})]})]})})),Sm=(0,nt.Pi)((e=>{const{searchState:t}=e,s=t.result;return(0,T.jsxs)("div",{className:"search-panel__content",children:[!s.candidates.length&&(0,T.jsx)("div",{className:"search-panel__content__header",children:`No possible matches found for '${s.candidateName}'`}),Boolean(s.candidates.length)&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)("div",{className:"search-panel__content__header",children:`Found possible matches for '${s.candidateName}'. Click on result to import the necessary package`}),(0,T.jsx)("div",{className:"search-panel__entry",children:s.candidates.map((e=>(0,T.jsx)(Am,{candidate:e},e.uuid)))})]})]})})),ym=(0,nt.Pi)((()=>{const e=Em();return(0,T.jsxs)("div",{className:"search-panel",children:[(0,T.jsx)(Kc,{isLoading:e.textSearchCommandLoadingState.isInProgress}),!e.searchState&&(0,T.jsx)(hd,{children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content",children:(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Search something"}),(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Xc.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Xc.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F"})]})]})})})}),e.searchState instanceof Hh&&(0,T.jsx)(xm,{usageState:e.searchState}),e.searchState instanceof Bh&&(0,T.jsx)(Cm,{searchState:e.searchState}),e.searchState instanceof Yh&&(0,T.jsx)(Om,{searchState:e.searchState}),e.searchState instanceof Wh&&(0,T.jsx)(Sm,{searchState:e.searchState})]})})),Im=e=>{const{node:t,level:s,stepPaddingInRem:i,classPrefix:n,onNodeSelect:a}=e;return(0,T.jsxs)("div",{className:(0,jc.clsx)("tree-view__node__container",{[`${n}__tree-view__node__container`]:n}),onClick:()=>a?.(t),style:{paddingLeft:(s-1)*(i??1)+"rem",display:"flex"},children:[(0,T.jsx)("div",{className:(0,jc.clsx)("tree-view__node__icon",{[`${n}__tree-view__node__icon`]:n}),children:Boolean(t.childrenIds?.length)&&(t.isOpen?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.XCv,{}))}),(0,T.jsx)("div",{className:(0,jc.clsx)("tree-view__node__label",{[`${n}__tree-view__node__label`]:n}),children:t.label})]})},vm=e=>{const{node:t,level:s,onNodeSelect:i,getChildNodes:n,classPrefix:a,components:r,stepPaddingInRem:o,innerProps:l}=e,c={TreeNodeView:vm,TreeNodeContainer:Im},d=r?{...c,...r}:c;return(0,T.jsxs)("div",{className:(0,jc.clsx)("tree-view__node__block",{[`${a}__tree-view__node__block`]:a}),children:[(0,T.jsx)(d.TreeNodeContainer,{node:t,level:s+1,stepPaddingInRem:o,classPrefix:a,onNodeSelect:i,innerProps:l}),t.isOpen&&n(t).map((e=>(0,T.jsx)(d.TreeNodeView,{node:e,level:s+1,components:r,classPrefix:a,onNodeSelect:i,getChildNodes:n,innerProps:l},e.id)))]})},Rm=e=>{const{treeData:t,className:s,classPrefix:i,components:n,onNodeSelect:a,getChildNodes:r,getRootNodes:o,innerProps:l}=e,c=o?.(t)??t.rootIds.map((e=>t.nodes.get(e))).filter(z),d={TreeNodeView:vm,TreeNodeContainer:Im},h=n?{...d,...n}:d;return(0,T.jsx)("div",{className:(0,jc.clsx)("tree-view__node__root",s??"",{[`${i}__tree-view__node__root`]:i}),children:c.map((e=>(0,T.jsx)(h.TreeNodeView,{level:0,node:e,getChildNodes:r,components:h,onNodeSelect:a,classPrefix:i,innerProps:l},e.id)))})};var Pm=s(2546);const wm=Pm.gs,Lm="resizable-panel--collapsed",bm=(e,t)=>({collapsiblePanel:{className:(0,jc.clsx)(...t?.classes??[],{[Lm]:e}),onStartResize:e=>{e.domElement.classList.remove(Lm),t?.onStartResize?.(e)},onStopResize:e=>{const s=Number(e.domElement.style.flexGrow);s<=.01?e.domElement.style.flexGrow="0":s>=.99&&(e.domElement.style.flexGrow="1"),t?.onStopResize?.(e)},size:!e&&t?.size?t.size:0,flex:e?0:void 0},remainingPanel:{flex:e?1:void 0}}),Dm=Pm.jW,Mm=Pm.nN,km=e=>(0,T.jsx)("div",{className:"resizable-panel__splitter-line",style:{background:e.color}});var Fm=s(48845);const jm=(0,nt.Pi)((e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,{testRunnerState:r,onNodeOpen:o,onNodeExpand:l,onNodeCompress:c,renderNodeLabel:d}=a,h=Em(),u=Ft(),p=r.testResultInfo,m=!t.data.type,_=t.id===r.selectedTestId;let g;switch(p?((e,t)=>{const s=e.id;return Boolean(e.data.type)?((e,t)=>t.passedTests.has(e)?Xh.PASSED:t.failedTests.has(e)?Xh.FAILED:t.testsWithError.has(e)?Xh.ERROR:Xh.RUNNING)(s,t):t.failedTestIds.some((e=>e.startsWith(`${s}_`)))||t.testWithErrorIds.some((e=>e.startsWith(`${s}_`)))?Xh.FAILED:t.notRunTestIds.some((e=>e.startsWith(`${s}_`)))?Xh.RUNNING:Xh.PASSED})(t,p):void 0){case Xh.PASSED:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--passed",children:(0,T.jsx)(Xc.rE2,{})});break;case Xh.FAILED:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--failed",children:(0,T.jsx)(Xc.$Ow,{})});break;case Xh.ERROR:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--error",children:(0,T.jsx)(Xc.xDH,{})});break;case Xh.RUNNING:g=(0,T.jsx)("div",{className:"test-runner-panel__explorer__package-tree__status test-runner-panel__explorer__package-tree__status--running",children:(0,T.jsx)(Xc.VRP,{})});break;default:g=(0,T.jsx)(Xc.pTE,{})}const E=()=>{t.isOpen?c(t):l(t)};return(0,T.jsxs)("div",{className:(0,jc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected":_}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t),m?E():o(t)},onDoubleClick:()=>{m?E():(0,x.fl)(h.loadFile(t.data.li_attr.file,new Kd(t.data.li_attr.file,Number.parseInt(t.data.li_attr.line,10),Number.parseInt(t.data.li_attr.column,10)))).catch(u.alertUnhandledError)},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:E,children:m?t.isOpen?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.XCv,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:g})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:d?.(t)??t.label})]})})),Um=(0,nt.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=e=>t.setSelectedTestId(e.id),n=e=>{let t=e.id.split("__")[0];if(!t)return e.label;const s=t.split("_");return t=s.slice(1,s.length).join(Ee),(0,T.jsxs)("div",{className:"test-runner-list__item__label",children:[(0,T.jsx)("div",{className:"test-runner-list__item__label__name",children:e.label}),(0,T.jsx)("div",{className:"test-runner-list__item__label__path",children:t})]})};return(0,T.jsx)("div",{className:"explorer__content",children:Array.from(t.allTests.keys()).map((e=>s.nodes.get(e))).filter(z).map((e=>(0,T.jsx)(jm,{node:e,level:0,onNodeSelect:()=>{},innerProps:{testRunnerState:t,onNodeOpen:i,renderNodeLabel:n,onNodeExpand:()=>{},onNodeCompress:()=>{}}},e.id)))})})),Vm=(0,nt.Pi)((e=>{const{testRunnerState:t}=e,s=t.getTreeData(),i=0===s.nodes.size;return(0,T.jsxs)("div",{className:"explorer__content",children:[i&&(0,T.jsx)(hd,{children:"No tests found"}),!i&&(0,T.jsx)(Rm,{components:{TreeNodeContainer:jm},treeData:s,onNodeSelect:()=>{},getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>s.nodes.get(e))).filter(z),innerProps:{testRunnerState:t,onNodeOpen:e=>t.setSelectedTestId(e.id),onNodeExpand:e=>{e.isOpen=!0,t.refreshTree()},onNodeCompress:e=>{e.isOpen=!1,t.refreshTree()}}})]})})),Gm=(0,nt.Pi)((e=>{const{testRunnerState:t,selectedTestId:s,testResultInfo:i}=e,n=Em(),a=Ft(),r=i.results.get(s),o=H(t.allTests.get(s),`Can't find info for test with ID '${s}'`);return(0,T.jsxs)("div",{className:"panel",children:[(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__label",children:o.text})}),(0,T.jsx)("div",{className:"panel__header__actions",children:(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,title:"Open File",onClick:()=>{(0,x.fl)(n.loadFile(o.li_attr.file,new Kd(o.li_attr.file,Number.parseInt(o.li_attr.line,10),Number.parseInt(o.li_attr.column,10)))).catch(a.alertUnhandledError)},children:(0,T.jsx)(Xc.qdB,{})})})]}),(0,T.jsxs)("div",{className:"panel__content test-runner-panel__result",children:[!r&&(0,T.jsx)("div",{className:"test-runner-panel__result__content",children:"Running..."}),r instanceof Jh&&(0,T.jsx)("div",{className:"test-runner-panel__result__content",children:"Test passed!"}),r instanceof eu&&(0,T.jsx)("pre",{className:"test-runner-panel__result__content",children:r.error.text})]})]})})),$m=(0,nt.Pi)((e=>{const{testRunnerState:t}=e,s=Em(),i=Ft(),n=t.testExecutionResult.count,a=t.testResultInfo,r=a?.suiteStatus??Zh.NONE,o=a?.runPercentage??0;return(0,T.jsx)("div",{className:"test-runner-panel__content",children:(0,T.jsxs)(wm,{orientation:"vertical",children:[(0,T.jsx)(Dm,{minSize:400,children:(0,T.jsxs)("div",{className:"panel test-runner-panel__explorer",children:[(0,T.jsx)(Kc,{isLoading:t.treeBuildingState.isInProgress}),(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsxs)("div",{className:"panel__header__title__content test-runner-panel__explorer__report",children:[(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview",children:[(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--total",children:[n," total"]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--passed",children:[a?.passed??0," ",(0,T.jsx)(Xc.rE2,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--failed",children:[a?.failed??0," ",(0,T.jsx)(Xc.$Ow,{})]}),(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__overview__stat test-runner-panel__explorer__report__overview__stat--error",children:[a?.error??0," ",(0,T.jsx)(Xc.xDH,{})]})]}),a&&(0,T.jsxs)("div",{className:"test-runner-panel__explorer__report__time",children:[a.time,"ms"]})]})}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.setViewAsList(!t.viewAsList),title:t.viewAsList?"View As Tree":"View As List",children:t.viewAsList?(0,T.jsx)(Xc.NEI,{className:"test-runner-panel__icon--tree-view"}):(0,T.jsx)(Xc.VjU,{className:"test-runner-panel__icon--list-view"})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.expandTree(),title:"Expand All",children:(0,T.jsx)(Xc.Qq,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>t.collapseTree(),title:"Collapse All",children:(0,T.jsx)(Xc.jG4,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,disabled:!s.testRunState.isInProgress,onClick:()=>{(0,x.fl)(t.cancelTestRun()).catch(i.alertUnhandledError)},title:"Stop",children:(0,T.jsx)(Xc.SCS,{})}),(0,T.jsx)("button",{className:"panel__header__action",tabIndex:-1,onClick:()=>{(0,x.fl)(t.rerunTestSuite()).catch(i.alertUnhandledError)},disabled:s.testRunState.isInProgress,title:"Run Suite",children:(0,T.jsx)(Xc.o1U,{})})]})]}),(0,T.jsx)("div",{className:"test-runner-panel__header__status",children:(0,T.jsx)(Fm.Z,{className:`test-runner-panel__progress-bar test-runner-panel__progress-bar--${r.toLowerCase()}`,classes:{bar:`test-runner-panel__progress-bar__bar test-runner-panel__progress-bar__bar--${r.toLowerCase()}`},variant:"determinate",value:o})}),(0,T.jsx)("div",{className:"panel__content",children:t.treeData&&(0,T.jsxs)(T.Fragment,{children:[!t.viewAsList&&(0,T.jsx)(Vm,{testRunnerState:t}),t.viewAsList&&(0,T.jsx)(Um,{testRunnerState:t})]})})]})}),(0,T.jsx)(Mm,{children:(0,T.jsx)(km,{color:s.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsxs)(Dm,{minSize:400,children:[t.selectedTestId&&!a&&(0,T.jsx)("div",{}),t.selectedTestId&&a&&(0,T.jsx)(Gm,{testRunnerState:t,selectedTestId:t.selectedTestId,testResultInfo:a}),!t.selectedTestId&&(0,T.jsxs)("div",{className:"panel",children:[(0,T.jsx)("div",{className:"panel__header"}),(0,T.jsx)("div",{className:"panel__content",children:(0,T.jsx)(hd,{children:"No test selected"})})]}),(0,T.jsx)("div",{})]})]})})})),zm=(0,nt.Pi)((()=>{const e=Em().testRunnerState;return(0,T.jsxs)("div",{className:"test-runner-panel",children:[!e&&(0,T.jsx)(hd,{children:(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen",children:(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content",children:[(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run full test suite"}),(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"auxiliary-panel__splash-screen__content__item__label",children:"Run relevant tests only"}),(0,T.jsxs)("div",{className:"auxiliary-panel__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Shift"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Xc.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})]})]})]})})}),e&&(0,T.jsx)($m,{testRunnerState:e})]})})),Bm=(0,nt.Pi)((()=>{const e=Em(),t={[Fd.CONSOLE]:{mode:Fd.CONSOLE,name:"CONSOLE",icon:void 0,isVisible:!0},[Fd.SEARCH_RESULT]:{mode:Fd.SEARCH_RESULT,name:"SEARCH",icon:(0,T.jsx)("div",{className:"auxiliary-panel__header__tab__icon--search",children:(0,T.jsx)(Xc.W1M,{})}),isVisible:!0},[Fd.TEST_RUNNER]:{mode:Fd.TEST_RUNNER,name:"TEST",icon:(0,T.jsx)("div",{className:"auxiliary-panel__header__tab__icon--test",children:(0,T.jsx)(Xc.Vzd,{})}),isVisible:!0}},s=Object.values(Fd).filter((e=>z(t[e])&&t[e].isVisible)),i=t=>e.activeAuxPanelMode===t&&s.includes(t);return(0,at.useEffect)((()=>{s.includes(e.activeAuxPanelMode)||e.setActiveAuxPanelMode(Fd.CONSOLE)}),[e,s,e.activeAuxPanelMode]),(0,T.jsxs)("div",{className:"panel auxiliary-panel",children:[(0,T.jsxs)("div",{className:"panel__header",children:[(0,T.jsx)("div",{className:"auxiliary-panel__header__tabs",children:s.map((e=>t[e])).filter(z).map((t=>{return(0,T.jsxs)("button",{tabIndex:-1,className:(0,jc.clsx)("auxiliary-panel__header__tab",{"auxiliary-panel__header__tab--active":e.activeAuxPanelMode===t.mode}),onClick:(s=t.mode,()=>e.setActiveAuxPanelMode(s)),children:[t.icon&&(0,T.jsx)("div",{className:"auxiliary-panel__header__tab__icon",children:t.icon}),(0,T.jsx)("div",{className:"auxiliary-panel__header__tab__title",children:t.name})]},t.mode);var s}))}),(0,T.jsxs)("div",{className:"auxiliary-panel__header__actions",children:[(0,T.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggleMaximize(),tabIndex:-1,title:"Toggle Expand/Collapse",children:e.auxPanelDisplayState.isMaximized?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.g8U,{})}),(0,T.jsx)("button",{className:"auxiliary-panel__header__action",onClick:()=>e.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Close",children:(0,T.jsx)(Xc.b0D,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content",children:[i(Fd.CONSOLE)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(fm,{})}),i(Fd.SEARCH_RESULT)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(ym,{})}),i(Fd.TEST_RUNNER)&&(0,T.jsx)("div",{className:"auxiliary-panel__content__tab",children:(0,T.jsx)(zm,{})})]})]})}));var Hm=s(42689);const Ym=()=>(0,T.jsx)("div",{className:"icon color--package",children:(0,T.jsx)(Xc.jtq,{})}),Wm=()=>(0,T.jsx)("div",{className:"icon color--class",children:"C"}),Km=()=>(0,T.jsx)("div",{className:"icon color--enumeration",children:"E"}),Zm=()=>(0,T.jsx)("div",{className:"icon color--measure",children:"M"}),Xm=()=>(0,T.jsx)("div",{className:"icon color--unit",children:"u"}),qm=()=>(0,T.jsx)("div",{className:"icon color--profile",children:"P"}),Jm=()=>(0,T.jsx)("div",{className:"icon icon--function color--function",children:(0,T.jsx)(Xc.eid,{})}),Qm=()=>(0,T.jsx)("div",{className:"icon color--mapping",children:(0,T.jsx)(Xc.Zlt,{})}),e_=()=>(0,T.jsx)("div",{children:(0,T.jsx)(Xc.UOT,{})}),t_=()=>(0,T.jsx)("div",{className:"icon icon--function color--native-function",children:(0,T.jsx)(Xc.eid,{})}),s_=()=>(0,T.jsx)("div",{className:"icon icon--property color--property",children:(0,T.jsx)(Xc.HXR,{})}),i_=()=>(0,T.jsx)("div",{className:"icon color--diagram",children:(0,T.jsx)(Xc.oF7,{})}),n_=()=>(0,T.jsx)("div",{className:"icon icon--database",children:(0,T.jsx)(Xc.VHe,{})}),a_=()=>(0,T.jsx)("div",{className:"icon color--association color--pure-association",children:"A"}),r_=e=>{switch(e){case Vd.PACKAGE:return(0,T.jsx)(Ym,{});case Vd.PROFILE:return(0,T.jsx)(qm,{});case Vd.CLASS:return(0,T.jsx)(Wm,{});case Vd.ASSOCIATION:return(0,T.jsx)(a_,{});case Vd.PROPERTY:case Vd.QUALIFIED_PROPERTY:return(0,T.jsx)(s_,{});case Vd.ENUMERATION:return(0,T.jsx)(Km,{});case Vd.MEASURE:return(0,T.jsx)(Zm,{});case Vd.UNIT:return(0,T.jsx)(Xm,{});case Vd.FUNCTION:return(0,T.jsx)(Jm,{});case Vd.NATIVE_FUNCTION:return(0,T.jsx)(t_,{});case Vd.DIAGRAM:return(0,T.jsx)(i_,{});case Vd.DATABASE:return(0,T.jsx)(n_,{});case Vd.MAPPING:return(0,T.jsx)(Qm,{});default:return(0,T.jsx)(e_,{})}},o_=/^[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,l_=/^(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,c_=(0,nt.Pi)((e=>{const{node:t}=e,s=Em(),i=Ft(),n=t.data.li_attr.pureName??t.data.li_attr.pureId,a=t.data.li_attr.pureType===Vd.PACKAGE,[r,o]=(0,at.useState)(a?jl(n):n),l=(0,at.useRef)(null),c=Boolean(r.match(a?l_:o_)),d=(a?jl(n):n)===r,h=c?void 0:"Invalid path",u=()=>s.conceptTreeState.setNodeForRenameConcept(void 0),p=e=>{e.preventDefault(),d||s.conceptTreeState.renameConcept(t,r).catch(i.alertUnhandledError).finally((()=>u()))};return(0,T.jsx)(Fc.Z,{open:!0,onClose:u,TransitionProps:{onEnter:()=>l.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename concept"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:p,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:l,className:"input input--dark",onChange:e=>o(e.target.value),value:r,spellCheck:!1}),h&&(0,T.jsx)("div",{className:"input-group__error-message",children:h})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(h),onClick:p,children:"Rename"})]})]})})})),d_=/^(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*$/,h_=(0,nt.Pi)((e=>{const{node:t}=e,s=Em(),i=Ft(),n=Ul(t.data.li_attr.pureId)??"",[a,r]=(0,at.useState)(n),o=(0,at.useRef)(null),l=Boolean(a.match(d_)),c=n===a,d=l?void 0:"Invalid path",h=()=>s.conceptTreeState.setNodeForMoveElement(void 0),u=e=>{e.preventDefault(),c||s.conceptTreeState.movePackageableElements([K(t.data.li_attr,Bd)],a).catch(i.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(Fc.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Move element"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(d),onClick:u,children:"Move"})]})]})})})),u_=(0,nt.Pi)((0,at.forwardRef)((function(e,t){const{node:s,viewConceptSource:i}=e,n=s.data.li_attr,a=n.pureType,r=Em(),o=Ft();return(0,T.jsxs)(nd,{ref:t,children:[n.pureType!==Vd.PROPERTY&&n.pureType!==Vd.QUALIFIED_PROPERTY&&(0,T.jsx)(ad,{onClick:()=>{o.copyTextToClipboard(n.pureId).catch(o.alertUnhandledError)},children:"Copy Path"}),a===Vd.PACKAGE&&(0,T.jsx)(ad,{onClick:()=>{(0,x.fl)(r.executeTests(s.data.li_attr.pureId)).catch(o.alertUnhandledError)},children:"Run Tests"}),a===Vd.FUNCTION&&(0,T.jsx)(ad,{onClick:()=>{window.open(`${r.client.baseUrl}/execute?func=${n.pureId}&mode=${r.client.mode}`,"_blank")},children:"Service (JSON)"}),(n instanceof zd||n instanceof Bd)&&(0,T.jsx)(ad,{onClick:()=>{(n instanceof Bd||n instanceof zd)&&r.findUsages(new Kd(n.file,Number.parseInt(n.line,10),Number.parseInt(n.column,10)))},children:"Find Usages"}),a!==Vd.PACKAGE&&(0,T.jsx)(ad,{onClick:()=>i(s),children:"View Source"}),(0,T.jsx)(rd,{}),(0,T.jsx)(ad,{onClick:()=>r.conceptTreeState.setNodeForRenameConcept(s),children:"Rename"}),n instanceof Bd&&(0,T.jsx)(ad,{onClick:()=>r.conceptTreeState.setNodeForMoveElement(s),children:"Move"})]})})));var p_;!function(e){e.UNSUPPORTED="UNSUPPORTED",e.CLASS="CLASS"}(p_=p_||(p_={}));const m_=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,at.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d,viewConceptSource:h}=a,u=t.parent&&t.data.li_attr instanceof zd&&t.data.li_attr.classPath!==t.parent.id,p=[Vd.PACKAGE,Vd.CLASS].includes(t.data.li_attr.pureType),m=t.data.li_attr.pureType===Vd.QUALIFIED_PROPERTY?(0,T.jsxs)(T.Fragment,{children:[t.label,(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:"(...)"})]}):u?(0,T.jsxs)(T.Fragment,{children:[t.label,(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:jl(K(t.data.li_attr,zd).classPath)})]}):t.label.includes("(")?(0,T.jsxs)(T.Fragment,{children:[t.label.substring(0,t.label.indexOf("(")),(0,T.jsx)("span",{className:"explorer__package-tree__node__label__tag",children:t.label.substring(t.label.indexOf("("))})]}):t.label,_=()=>{t.isLoading||(t.isOpen?d(t):c(t))},[,g]=(0,Hm.c)((()=>({type:"Class"===t.data.li_attr.pureType?p_.CLASS:p_.UNSUPPORTED,item:t.data})),[t]);return(0,T.jsx)(id,{content:(0,T.jsx)(u_,{node:t,viewConceptSource:h}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,jc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},ref:g,onDoubleClick:()=>{t.isLoading||(p&&_(),n?.(t),l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,T.jsx)(Xc.VRP,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:_,children:p?t.isOpen?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.XCv,{}):(0,T.jsx)("div",{})}),(0,T.jsx)("div",{className:(0,jc.clsx)("explorer__package-tree__node__icon__type",{"explorer__package-tree__node__icon__type--property-from-association":u}),children:r_(t.data.li_attr.pureType)})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:m})]})})},__=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.conceptTreeState,i=e.conceptTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(Rm,{components:{TreeNodeContainer:m_},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(z),innerProps:{onNodeOpen:e=>{(0,x.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,x.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()},viewConceptSource:t=>{const s=t.data.li_attr;(s instanceof Bd||s instanceof zd)&&e.directoryTreeState.revealPath(s.file,!0,new Kd(s.file,Number.parseInt(s.line,10),Number.parseInt(s.column,10)))}}}),s.nodeForRenameConcept&&(0,T.jsx)(c_,{node:s.nodeForRenameConcept}),s.nodeForMoveElement&&(0,T.jsx)(h_,{node:s.nodeForMoveElement})]})})),g_=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.conceptTreeState;return(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsx)("div",{className:"panel__header side-bar__header",children:(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"CONCEPTS"})})}),(0,T.jsx)("div",{className:"panel__content side-bar__content",children:(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsxs)("div",{className:"panel__header explorer__header",children:[(0,T.jsx)("div",{className:"panel__header__title"}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,x.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(Xc.DuK,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,T.jsx)(Xc.jG4,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(Kc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(__,{}),!s.loadInitialDataState.hasSucceeded&&s.statusText&&(0,T.jsx)("div",{className:"explorer__content__container__message",children:s.statusText}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(hd,{children:"Failed to build concept tree"})]})]})})]})})),E_=/[a-zA-Z0-9_]+(?:.[a-zA-Z0-9_]+)*/,f_=(0,nt.Pi)((e=>{const{node:t}=e,s=Em(),i=Ft(),[n,a]=(0,at.useState)("untitled.pure"),r=(0,at.useRef)(null),o=Boolean(n.match(E_)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid file name",d=()=>s.directoryTreeState.setNodeForCreateNewFile(void 0),h=e=>{e.preventDefault(),d(),(0,x.fl)(s.createNewFile(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(Fc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Create a new file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Create"})]})]})})})),T_=/[a-zA-Z0-9_]+/,C_=(0,nt.Pi)((e=>{const{node:t}=e,s=Em(),i=Ft(),[n,a]=(0,at.useState)("untitled"),r=(0,at.useRef)(null),o=Boolean(n.match(T_)),l=!t.childrenIds?.map((e=>s.directoryTreeState.getTreeData().nodes.get(e))).filter((e=>e?.data.text===n)).length,c=o?l?void 0:"Already existed":"Invalid directory name",d=()=>s.directoryTreeState.setNodeForCreateNewDirectory(void 0),h=e=>{e.preventDefault(),d(),(0,x.fl)(s.createNewDirectory(`${t.data.li_attr.path}/${n}`)).catch(i.alertUnhandledError)};return(0,T.jsx)(Fc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Create a new directory"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Create"})]})]})})})),x_=/\/?(?:[a-zA-Z0-9_]\/)*[a-zA-Z0-9_]+(?:.[a-zA-Z0-9_]+)*/,N_=(0,nt.Pi)((e=>{const{node:t}=e,s=Em(),i=Ft(),[n,a]=(0,at.useState)(t.data.li_attr.path),r=(0,at.useRef)(null),o=Boolean(n.match(x_)),l=t.data.li_attr.path===n,c=o?void 0:"Invalid path",d=()=>s.directoryTreeState.setNodeForRenameFile(void 0),h=e=>{e.preventDefault(),l||(d(),(0,x.fl)(s.renameFile(t.data.li_attr.path,n)).catch(i.alertUnhandledError))};return(0,T.jsx)(Fc.Z,{open:!0,onClose:d,TransitionProps:{onEnter:()=>r.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:h,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:r,className:"input input--dark",onChange:e=>a(e.target.value),value:n,spellCheck:!1}),c&&(0,T.jsx)("div",{className:"input-group__error-message",children:c})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(c),onClick:h,children:"Rename"})]})]})})})),A_=(0,nt.Pi)((0,at.forwardRef)((function(e,t){const{node:s}=e,i=Ft(),n=Em(),a=s.data.isFolderNode,r=Boolean(s.data.children);return(0,T.jsxs)(nd,{ref:t,children:[(0,T.jsx)(ad,{onClick:()=>{i.copyTextToClipboard(s.data.li_attr.path).catch(i.alertUnhandledError)},children:"Copy Path"}),(0,T.jsx)(rd,{}),a&&(0,T.jsx)(ad,{onClick:()=>n.directoryTreeState.setNodeForCreateNewFile(s),children:"New File"}),a&&(0,T.jsx)(ad,{onClick:()=>n.directoryTreeState.setNodeForCreateNewDirectory(s),children:"New Directory"}),!a&&(0,T.jsx)(ad,{onClick:()=>n.directoryTreeState.setNodeForRenameFile(s),children:"Rename"}),(0,T.jsx)(ad,{disabled:Boolean(s.data instanceof Eh&&s.data.children),onClick:()=>{(0,x.fl)(n.deleteDirectoryOrFile(s.data.li_attr.path,a,r)).catch(i.alertUnhandledError)},children:"Delete"})]})}))),O_=e=>{const{node:t,level:s,stepPaddingInRem:i,onNodeSelect:n,innerProps:a}=e,[r,o]=(0,at.useState)(!1),{onNodeOpen:l,onNodeExpand:c,onNodeCompress:d}=a,h=t.data instanceof Eh&&"/platform"===t.data.li_attr.path,u=t.data instanceof Eh&&t.data.li_attr.path.startsWith("/platform"),p=t.data.isFolderNode,m=t.data instanceof Eh&&!t.data.children,_=h?(0,T.jsx)(Xc.R0,{className:"explorer__icon--platform"}):p?m?(0,T.jsx)(Xc.ROc,{className:(0,jc.clsx)({"explorer__icon--platform":u})}):t.isOpen?(0,T.jsx)(Xc.ry,{className:(0,jc.clsx)({"explorer__icon--platform":u})}):(0,T.jsx)(Xc.ROc,{className:(0,jc.clsx)({"explorer__icon--platform":u})}):(0,T.jsx)(Xc.QqN,{className:"explorer__icon--file"}),g=()=>{m||t.isLoading||(t.isOpen?d(t):c(t))};return(0,T.jsx)(id,{content:(0,T.jsx)(A_,{node:t}),menuProps:{elevation:7},onOpen:()=>o(!0),onClose:()=>o(!1),children:(0,T.jsxs)("div",{className:(0,jc.clsx)("tree-view__node__container explorer__package-tree__node__container",{"explorer__package-tree__node__container--selected-from-context-menu":!t.isSelected&&r},{"explorer__package-tree__node__container--selected":t.isSelected}),onClick:e=>{e.stopPropagation(),e.preventDefault(),n?.(t)},onDoubleClick:()=>{t.isLoading||(p?g():l(t))},style:{paddingLeft:s*(i??1)+"rem",display:"flex"},children:[(0,T.jsxs)("div",{className:"tree-view__node__icon explorer__package-tree__node__icon",children:[t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand explorer__package-tree__node__icon__expand--is-loading",children:(0,T.jsx)(Xc.VRP,{})}),!t.isLoading&&(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__expand",onClick:g,children:!p||m?(0,T.jsx)("div",{}):t.isOpen?(0,T.jsx)(Xc.v4q,{}):(0,T.jsx)(Xc.XCv,{})}),(0,T.jsx)("div",{className:"explorer__package-tree__node__icon__type",children:_})]}),(0,T.jsx)("button",{className:"tree-view__node__label explorer__package-tree__node__label",tabIndex:-1,children:h?"platform":t.label})]})})},S_=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.directoryTreeState,i=e.directoryTreeState.getTreeData();return(0,T.jsxs)("div",{className:"explorer__content",onClick:()=>s.setSelectedNode(void 0),children:[(0,T.jsx)(Rm,{components:{TreeNodeContainer:O_},treeData:i,onNodeSelect:e=>s.setSelectedNode(e),getChildNodes:e=>e.isLoading||!e.childrenIds?[]:e.childrenIds.map((e=>i.nodes.get(e))).filter(z),innerProps:{onNodeOpen:e=>{(0,x.fl)(s.openNode(e)).catch(t.alertUnhandledError)},onNodeExpand:e=>{(0,x.fl)(s.expandNode(e)).catch(t.alertUnhandledError)},onNodeCompress:e=>{e.isOpen=!1,s.refreshTree()}}}),s.nodeForCreateNewFile&&(0,T.jsx)(f_,{node:s.nodeForCreateNewFile}),s.nodeForCreateNewDirectory&&(0,T.jsx)(C_,{node:s.nodeForCreateNewDirectory}),s.nodeForRenameFile&&(0,T.jsx)(N_,{node:s.nodeForRenameFile})]})})),y_=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.directoryTreeState;return(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsx)("div",{className:"panel__header side-bar__header",children:(0,T.jsx)("div",{className:"panel__header__title",children:(0,T.jsx)("div",{className:"panel__header__title__content side-bar__header__title__content",children:"FILES"})})}),(0,T.jsx)("div",{className:"panel__content side-bar__content",children:(0,T.jsxs)("div",{className:"panel explorer",children:[(0,T.jsxs)("div",{className:"panel__header explorer__header",children:[(0,T.jsx)("div",{className:"panel__header__title"}),(0,T.jsxs)("div",{className:"panel__header__actions",children:[(0,T.jsx)("button",{className:"panel__header__action explorer__btn__refresh",onClick:()=>{(0,x.fl)(s.refreshTreeData()).catch(t.alertUnhandledError)},title:"Refresh Tree",children:(0,T.jsx)(Xc.DuK,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{const i=e.tabManagerState.currentTab;i instanceof uh&&(0,x.fl)(s.revealPath(i.filePath,!1)).catch(t.alertUnhandledError)},title:"Focus",children:(0,T.jsx)(Xc.cOE,{})}),(0,T.jsx)("button",{className:"panel__header__action",onClick:()=>{s.getTreeData().nodes.forEach((e=>{e.isOpen=!1})),s.setSelectedNode(void 0),s.refreshTree()},title:"Collapse All",children:(0,T.jsx)(Xc.jG4,{})})]})]}),(0,T.jsxs)("div",{className:"panel__content explorer__content__container",children:[(0,T.jsx)(Kc,{isLoading:s.loadInitialDataState.isInProgress}),s.loadInitialDataState.hasSucceeded&&(0,T.jsx)(S_,{}),s.loadInitialDataState.hasFailed&&(0,T.jsx)(hd,{children:"Failed to build directory tree"})]})]})})]})})),I_=(0,nt.Pi)((()=>{const e=Em();return(0,T.jsx)("div",{className:"side-bar",children:(0,T.jsx)("div",{className:(0,jc.clsx)("side-bar__view","side-bar__view--active"),children:(()=>{switch(e.activeActivity){case kd.CONCEPT:return(0,T.jsx)(g_,{});case kd.FILE:return(0,T.jsx)(y_,{});default:return null}})()},e.activeActivity)})})),v_=e=>{const{className:t}=e;return(0,T.jsx)("div",{className:(0,jc.clsx)("logo",t),children:(0,T.jsxs)("svg",{stroke:"currentColor",fill:"currentColor",strokeWidth:"0",width:"1em",height:"1em",viewBox:"0 0 215 215",xmlns:"https://www.w3.org/2000/svg",children:[(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M141.9,86.5L141.9,68.1C141.9,66.5 140.7,65.2 139.1,65.2L66.5,65.2C64.9,65.2 63.7,66.5 63.7,68.1L63.7,86.5C63.7,88.1 64.9,89.4 66.5,89.4L139.1,89.4C140.7,89.4 141.9,88.1 141.9,86.5Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M118.4,116.9L118.4,98.5C118.4,96.9 117.5,95.6 116.4,95.6L65.7,95.6C64.6,95.6 63.7,96.9 63.7,98.5L63.7,116.9C63.7,118.5 64.6,119.8 65.7,119.8L116.5,119.8C117.6,119.8 118.4,118.6 118.4,116.9Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M141.9,147.3L141.9,129C141.9,127.4 140.7,126.1 139.1,126.1L66.5,126.1C64.9,126.1 63.7,127.4 63.7,129L63.7,147.4C63.7,149 64.9,150.3 66.5,150.3L139.1,150.3C140.7,150.3 141.9,149 141.9,147.3Z"})}),(0,T.jsx)("g",{transform:"matrix(1.0246,0,0,0.999998,1.03751,2.43115)",children:(0,T.jsx)("path",{d:"M205,170.7L152.7,139.1C150,137.4 147.7,138.7 147.7,141.9L147.7,157.9L55.8,157.9L55.8,59.4L67.2,59.4C70.4,59.4 71.7,57.2 70,54.4L38.4,2.1C36.7,-0.6 34.1,-0.6 32.4,2.1L0.7,54.4C-1,57.1 0.3,59.4 3.5,59.4L15.6,59.4L15.6,185.5C15.6,188.5 18,190.9 21,190.9L147.7,190.9L147.7,205.7C147.7,208.9 149.9,210.1 152.7,208.5L205,176.9C207.7,175.1 207.7,172.4 205,170.7Z"})})]})})},R_=(0,nt.Pi)((()=>{const e=Em(),t=t=>()=>e.setActiveActivity(t),s=[{mode:kd.CONCEPT,title:"Concept Explorer",icon:(0,T.jsx)(Xc.DE2,{})},{mode:kd.FILE,title:"File Explorer",icon:(0,T.jsx)(Xc.QqN,{})}].filter((e=>Boolean(e)));return(0,T.jsxs)("div",{className:"activity-bar",children:[(0,T.jsx)("div",{className:"activity-bar__logo",children:(0,T.jsx)(v_,{})}),(0,T.jsx)("div",{className:"activity-bar__items",children:s.map((s=>(0,T.jsx)("button",{className:(0,jc.clsx)("activity-bar__item",{"activity-bar__item--active":e.sideBarDisplayState.isOpen&&e.activeActivity===s.mode}),onClick:t(s.mode),tabIndex:-1,title:`${s.title}${s.info?` - ${s.info}`:""}`,children:s.icon},s.mode)))})]})})),P_=(0,nt.Pi)((e=>{const{fileEditorState:t}=e,s=t.textEditorState.cursorObserver,i=s?.selection?t.textEditorState.model.getValueInRange(s.selection).length:0;return(0,T.jsx)("div",{className:"file-editor__status-bar",children:s?.position&&(0,T.jsx)("button",{className:"editor__status-bar__action file-editor__status-bar__cursor-info",onClick:()=>t.setShowGoToLinePrompt(!0),tabIndex:-1,title:"Go to Line/Column",children:`Ln ${s.position.lineNumber}, Col ${s.position.column} ${i?` (${i} selected)`:""}`})})})),w_=(0,nt.Pi)((e=>{const{actionsDisabled:t}=e,s=Em(),i=Ft();return(0,T.jsxs)("div",{className:"editor__status-bar",children:[(0,T.jsx)("div",{className:"editor__status-bar__left",children:(0,T.jsx)("div",{className:"editor__status-bar__workspace"})}),(0,T.jsxs)("div",{className:"editor__status-bar__right",children:[s.tabManagerState.currentTab instanceof uh&&(0,T.jsx)(P_,{fileEditorState:s.tabManagerState.currentTab}),(0,T.jsx)("button",{className:(0,jc.clsx)("editor__status-bar__action editor__status-bar__compile-btn",{"editor__status-bar__compile-btn--wiggling":s.executionState.isInProgress}),disabled:t||s.executionState.isInProgress,onClick:()=>{(0,x.fl)(s.executeGo()).catch(i.alertUnhandledError)},tabIndex:-1,title:"Execute (F9)",children:(0,T.jsx)(Xc.pgN,{})}),(0,T.jsx)("button",{className:(0,jc.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":Boolean(s.auxPanelDisplayState.isOpen)}),onClick:()=>s.auxPanelDisplayState.toggle(),tabIndex:-1,title:"Toggle auxiliary panel (Ctrl + `)",children:(0,T.jsx)(Xc.FxN,{})}),(0,T.jsx)("button",{className:(0,jc.clsx)("editor__status-bar__action editor__status-bar__action__toggler",{"editor__status-bar__action__toggler--active":!i.assistantService.isHidden}),onClick:()=>i.assistantService.toggleAssistant(),tabIndex:-1,title:"Toggle assistant",children:(0,T.jsx)(Xc.UHp,{})})]})]})})),L_=/[0-9]+(?::[0-9]+)?/,b_=(0,nt.Pi)((e=>{const{fileEditorState:t}=e,[s,i]=(0,at.useState)(""),n=(0,at.useRef)(null),a=Boolean(s.match(L_)),r=t.textEditorState.editor?.getPosition(),[o,l]=(e=>{const t=e.split(":");return t.length<1||t.length>2?[1,void 0]:[G((()=>parseInt(H(P(t)))))??1,G((()=>parseInt(H(w(t)))))]})(s),c=1<=o&&o<=t.textEditorState.model.getLineCount(),d=a?c?void 0:"Invalid line number":"Invalid value (format [line:column] - e.g. 123:45)",h=()=>t.setShowGoToLinePrompt(!1),u=e=>{e.preventDefault(),h(),t.textEditorState.setForcedCursorPosition({lineNumber:o,column:l??1})};return(0,T.jsx)(Fc.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>n.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Go to..."}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:n,className:"input input--dark",onChange:e=>i(e.target.value),placeholder:r?`Current Line: ${r.lineNumber}, Col: ${r.column}. Type a line between 1 and ${t.textEditorState.model.getLineCount()} to navigate to`:void 0,value:s,spellCheck:!1}),""!==s&&d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:""===s||Boolean(d),onClick:u,children:"Go"})]})]})})})),D_=(0,nt.Pi)((e=>{const{editorState:t}=e,s=Em(),i=Ft(),n=(0,at.useRef)(null),[a,r]=(0,at.useState)(),o=t.file.content,{ref:l,width:c,height:d}=(0,dd.NB)();return(0,at.useEffect)((()=>{if(!a&&n.current){const e=n.current,s=N.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,theme:O.LEGEND,wordWrap:t.textEditorState.wrapText?"on":"off"});s.onDidChangeModelContent((()=>{const e=s.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),s.onDidChangeCursorPosition((()=>{t.textEditorState.notifyCursorObserver()})),s.onDidChangeCursorSelection((()=>{t.textEditorState.notifyCursorObserver()})),s.setModel(t.textEditorState.model),t.textEditorState.viewState&&s.restoreViewState(t.textEditorState.viewState),s.focus(),t.textEditorState.setEditor(s),r(s)}}),[s,i,t,a]),a&&a.getValue()!==o&&a.setValue(o),(0,at.useEffect)((()=>{void 0!==c&&void 0!==d&&a?.layout({width:c,height:d})}),[a,c,d]),(0,at.useEffect)((()=>{a&&t.textEditorState.forcedCursorPosition&&(jd(a,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[a,t,t.textEditorState.forcedCursorPosition]),(0,at.useEffect)((()=>()=>{a&&(t.textEditorState.setViewState(a.saveViewState()??void 0),a.dispose())}),[t,a]),(0,T.jsxs)("div",{className:"panel edit-panel file-editor",children:[(0,T.jsx)("div",{className:"panel__header file-editor__header",children:(0,T.jsxs)("div",{className:"file-editor__header__actions",children:[(0,T.jsx)("button",{className:(0,jc.clsx)("file-editor__header__action",{"file-editor__header__action--active":t.textEditorState.wrapText}),tabIndex:-1,onClick:()=>t.textEditorState.setWrapText(!t.textEditorState.wrapText),title:"Toggle Text Wrap",children:(0,T.jsx)(Xc.NK0,{className:"file-editor__icon--text-wrap"})}),t.showGoToLinePrompt&&(0,T.jsx)(b_,{fileEditorState:t})]})}),(0,T.jsx)("div",{className:"panel__content file-editor__content",children:(0,T.jsx)("div",{ref:l,className:"text-editor__container",children:(0,T.jsx)("div",{className:"text-editor__body",ref:n})})})]})})),M_=(e,t,s=!1)=>{if(s)return t.map((e=>`${e}.pure`)).includes(e);const i=H(P(e.split(".")));return t.includes(i)},k_=e=>{(0,at.useEffect)((()=>(e.registerCommands(),()=>e.deregisterCommands())),[e])};class F_{pureType;pureId;pureName;text;requiredClassProperties=[]}(0,Be.yu)(F_,{pureType:(0,Be.Ru)(),pureId:(0,Be.Ru)(),pureName:(0,Be.Ru)(),text:(0,Be.Ru)(),requiredClassProperties:(0,Be.jt)((0,Be.pb)((0,Be.Ru)()))});class j_{pureType;pureName;owner;ownerPureType}(0,Be.yu)(j_,{pureType:(0,Be.Ru)(),pureName:(0,Be.Ru)(),owner:(0,Be.Ru)(),ownerPureType:(0,Be.Ru)()});class U_{pureId;pureName;requiredClassProperties=[]}(0,Be.yu)(U_,{pureId:(0,Be.Ru)(),pureName:(0,Be.Ru)(),requiredClassProperties:(0,Be.jt)((0,Be.pb)((0,Be.Ru)()))});class V_{name}(0,Be.yu)(V_,{name:(0,Be.Ru)()});const G_="Diagram",$_="Diagram",z_=e=>({label:{label:e.pureName,description:e.pureId},kind:N.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${e.pureName}(${e.requiredClassProperties.map(((e,t)=>`${e}=\${${t+1}:}`)).join(",")})`}),B_=(e,t)=>{const s=e.pureType,i=s===Vd.FUNCTION||s===Vd.NATIVE_FUNCTION?((e,t,s)=>{const i=jl(t),n=G((()=>i.substring(i.indexOf("_"),i.length-1)))?.split("__")??[];return n.pop(),s&&n.shift(),`${e}(${n.map(((e,t)=>`\${${t+1}:}`)).join(",")})`})(e.pureName,e.pureId,Boolean(t?.preferArrowFunctionForm)):e.pureName,n=s===Vd.PACKAGE?N.languages.CompletionItemKind.Folder:s===Vd.CLASS?N.languages.CompletionItemKind.Class:s===Vd.FUNCTION?N.languages.CompletionItemKind.Function:s===Vd.ENUMERATION?N.languages.CompletionItemKind.Enum:s===Vd.PROFILE?N.languages.CompletionItemKind.Module:s===Vd.ASSOCIATION?N.languages.CompletionItemKind.Interface:N.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:e.text},kind:n,filterText:e.pureName,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:i,sortText:s===Vd.PACKAGE?`zzzz_${e.text}`:e.text}},H_=/(?<incompletePath>(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*::)+$)/,Y_=/->\s*(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*::)+$/,W_=/\^\s*(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*::)+$/,K_=/^\s*import\s+(?:(?<importPath>(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*)::*)/,Z_=(e,t)=>{const s=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),i=`${fe}${Ue.PURE}\n${s}`.split("\n");return i.slice(i.map((e=>e.startsWith(fe))).lastIndexOf(!0)).map((e=>e.match(K_)?.groups?.importPath)).filter(z)},X_=/->\s*(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)?$/,q_=/\^\s*(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)?$/,J_=/^(?<owner>(?:(?:[a-zA-Z0-9_][a-zA-Z0-9_$]*)::)*[a-zA-Z0-9_][a-zA-Z0-9_$]*)\s*.$/,Q_=(e,t)=>({label:e.name,kind:N.languages.CompletionItemKind.Variable,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,sortText:t?e.name:`zzzz_${e.name}`,insertText:e.name}),eg=/^[a-zA-Z0-9_][a-zA-Z0-9_$]*/,tg=(0,nt.Pi)((e=>{const{renameConceptState:t}=e,s=Ft(),i=t.fileEditorState,n=t.concept.pureName,[a,r]=(0,at.useState)(n),o=(0,at.useRef)(null),l=Boolean(a.match(eg)),c=n===a,d=l?void 0:"Invalid path",h=()=>{(0,x.fl)(i.setConceptToRenameState(void 0)).catch(s.alertUnhandledError)},u=e=>{e.preventDefault(),c||i.renameConcept(a).catch(s.alertUnhandledError).finally((()=>h()))};return(0,T.jsx)(Fc.Z,{open:!0,onClose:h,TransitionProps:{onEnter:()=>o.current?.focus()},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Rename concept"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:u,children:(0,T.jsxs)("div",{className:"input-group command-modal__content__input",children:[(0,T.jsx)("input",{ref:o,className:"input input--dark",onChange:e=>r(e.target.value),value:a,spellCheck:!1}),d&&(0,T.jsx)("div",{className:"input-group__error-message",children:d})]})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark",disabled:Boolean(d),onClick:u,children:"Rename"})]})]})})})),sg=(0,nt.Pi)((e=>{const{editorState:t}=e,s=(0,at.useRef)(void 0),i=(0,at.useRef)(void 0),n=(0,at.useRef)(void 0),a=(0,at.useRef)(null),[r,o]=(0,at.useState)(),[l,c]=(0,at.useState)(!1),d=Em(),h=Ft(),{ref:u,width:p,height:m}=(0,dd.NB)();return(0,at.useEffect)((()=>{if(!r&&a.current){const e=a.current,s=N.editor.create(e,{contextmenu:!1,copyWithSyntaxHighlighting:!1,fontSize:14,fontFamily:"Roboto Mono",fontLigatures:!0,fixedOverflowWidgets:!0,detectIndentation:!1,tabSize:2,"bracketPairColorization.enabled":!1,language:S.PURE,theme:O.LEGEND,wordWrap:t.textEditorState.wrapText?"on":"off",contextmenu:!0,useShadowDOM:!1});s._codeEditorService.openCodeEditor=async()=>{const e=s.getPosition();e&&(0,x.fl)(d.executeNavigation(new Kd(t.filePath,e.lineNumber,e.column))).catch(h.alertUnhandledError)},s.updateOptions({gotoLocation:{multiple:"goto",multipleDefinitions:"goto",alternativeDefinitionCommand:"DUMMY"}}),s.onContextMenu((()=>c(!0))),s.addAction({id:lh.FIND_USAGES,label:"Find Usages",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){const e=new Kd(t.filePath,s.lineNumber,s.column);t.findConceptUsages(e)}}}),s.addAction({id:lh.REVEAL_CONCEPT_IN_TREE,label:"Reveal Concept",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();s&&d.revealConceptInTree(new Kd(t.filePath,s.lineNumber,s.column)).catch(h.alertUnhandledError)}}),s.addAction({id:lh.RENAME_CONCEPT,label:"Rename",contextMenuGroupId:"navigation",contextMenuOrder:1e3,run:function(e){const s=e.getPosition();if(s){if(!t.textEditorState.model.getWordAtPosition(s))return;const e=new Kd(t.filePath,s.lineNumber,s.column);(0,x.fl)(t.setConceptToRenameState(e)).catch(d.applicationStore.alertUnhandledError)}}}),s.onDidChangeModelContent((()=>{const e=s.getValue();e!==t.file.content&&t.clearError(),t.file.setContent(e)})),s.onDidChangeCursorPosition((()=>{t.textEditorState.notifyCursorObserver()})),s.onDidChangeCursorSelection((()=>{t.textEditorState.notifyCursorObserver()})),s.setModel(t.textEditorState.model),t.textEditorState.viewState&&s.restoreViewState(t.textEditorState.viewState),s.focus(),t.textEditorState.setEditor(s),o(s)}}),[d,h,t,r]),s.current?.dispose(),s.current=N.languages.registerDefinitionProvider(S.PURE,{provideDefinition:(e,s)=>{const i=N.editor.tokenize(e.getLineContent(s.lineNumber),S.PURE)[0];if(!i)return[];let n,a;for(let e=1;e<i.length;++e){const t=H(i[e]);if(t.offset+1>s.column){n=H(i[e-1]),a={startLineNumber:s.lineNumber,startColumn:n.offset+1,endLineNumber:s.lineNumber,endColumn:t.offset+1};break}}return n&&a&&M_(n.type,[Ge.TYPE,Ge.VARIABLE,Ge.PROPERTY,Ge.PARAMETER,Ge.IDENTIFIER])?[{uri:t.textEditorState.model.uri,range:a}]:[]}}),i.current?.dispose(),i.current=N.languages.registerCompletionItemProvider(S.PURE,{triggerCharacters:["#",":",">",".","@","^","$"],provideCompletionItems:async(e,s,i)=>{let n=[];if(i.triggerKind===N.languages.CompletionTriggerKind.TriggerCharacter)switch(i.triggerCharacter){case"#":n=n.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a={startLineNumber:e.lineNumber,startColumn:1,endLineNumber:e.lineNumber,endColumn:n.endColumn};var r;return r=t.getValueInRange(a).trim(),Boolean(r.match(/\s/))||s.forEach((e=>{i.push({label:{label:`${fe}${e.text}`,description:e.description},kind:N.languages.CompletionItemKind.Keyword,insertText:`${fe}${e.insertText}\n`,range:a,documentation:e.documentation?e.documentation.markdownText?{value:e.documentation.markdownText.value}:e.documentation.text:void 0})})),i})(s,e,[{text:Ue.PURE,description:"(core Pure)",insertText:Ue.PURE},{text:Ue.MAPPING,description:"(dsl)",insertText:Ue.MAPPING},{text:Ue.CONNECTION,description:"(dsl)",insertText:Ue.CONNECTION},{text:Ue.RUNTIME,description:"(dsl)",insertText:Ue.RUNTIME},{text:Ue.RELATIONAL,description:"(external store)",insertText:Ue.RELATIONAL},{text:G_,description:"(dsl)",insertText:$_}]));break;case":":n=n.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(H_);if(i?.groups?.incompletePath){const n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(Y_)),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(W_));let r=[];try{r=(await s.client.getSuggestionsForIncompletePath(i.groups.incompletePath.substring(0,i.groups.incompletePath.length-Ee.length),a?[Vd.CLASS]:n?[Vd.FUNCTION,Vd.NATIVE_FUNCTION]:[])).map((e=>(0,Be.vB)(F_,e)))}catch{}return r.map((e=>a?z_(e):B_(e,{preferArrowFunctionForm:n})))}return[]})(s,e,d));break;case">":n=n.concat(await(async(e,t,s)=>{const i=Z_(e,t);let n=[];try{n=(await s.client.getSuggestionsForIdentifier(i,[Vd.FUNCTION,Vd.NATIVE_FUNCTION])).map((e=>(0,Be.vB)(F_,e)))}catch{}return n.map((e=>B_(e,{preferArrowFunctionForm:!0})))})(s,e,d));break;case".":n=n.concat(await(async(e,t,s)=>{const i=t.getLineContent(e.lineNumber).substring(0,e.column-1).match(J_),n=Z_(e,t);if(i?.groups?.owner){let e=[];try{e=(await s.client.getSuggestionsForAttribute(n,i.groups.owner)).map((e=>(0,Be.vB)(j_,e)))}catch{}return e.map((e=>(e=>{const t=e.pureType,s=t===Vd.PROPERTY||t===Vd.QUALIFIED_PROPERTY?`${e.pureName}(\${1:})`:e.pureName,i=t===Vd.PROPERTY?N.languages.CompletionItemKind.Property:t===Vd.QUALIFIED_PROPERTY?N.languages.CompletionItemKind.Method:t===Vd.TAG?N.languages.CompletionItemKind.Constant:t===Vd.STEREOTYPE?N.languages.CompletionItemKind.Value:t===Vd.ENUM_VALUE?N.languages.CompletionItemKind.Enum:N.languages.CompletionItemKind.Value;return{label:{label:e.pureName,description:`${e.owner}.${e.pureName}`},kind:i,filterText:e.pureName,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:s}})(e)))}return[]})(s,e,d));break;case"^":n=n.concat(await(async(e,t,s)=>{const i=Z_(e,t);let n=[];try{n=(await s.client.getSuggestionsForClass(i)).map((e=>(0,Be.vB)(U_,e)))}catch{}return n.map((e=>z_(e)))})(s,e,d));break;case"@":n=n.concat(await(async(e,t,s)=>{const i=Z_(e,t);let n=[];try{n=(await s.client.getSuggestionsForClass(i)).map((e=>(0,Be.vB)(U_,e)))}catch{}return n.map((e=>(e=>({label:{label:e.pureName,description:e.pureId},kind:N.languages.CompletionItemKind.Class,filterText:e.pureName,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:e.pureName}))(e)))})(s,e,d));break;case"$":n=n.concat(await(async(e,t,s,i)=>{let n=[];try{n=(await i.client.getSuggestionsForVariable(s,e.lineNumber,e.column)).map((e=>(0,Be.vB)(V_,e)))}catch{}const a=new Set;let r=!1;for(let s=e.lineNumber-1;s>Math.max(0,e.lineNumber-1-10)&&!r;--s){const i=t.getLineContent(s+1);(i.match(/^\s*function\s+/)||i.match(/^\s*###\w+/))&&(r=!0);const n=H(N.editor.tokenize(t.getLineContent(s+1),S.PURE)[0]);n.forEach(((i,r)=>{(s!==e.lineNumber-1||i.offset<e.column)&&M_(i.type,[Ge.VARIABLE,Ge.PARAMETER],!0)&&a.add(t.getValueInRange({startLineNumber:s+1,startColumn:i.offset+1,endLineNumber:s+1,endColumn:r===n.length-1?Number.MAX_SAFE_INTEGER:H(n[r+1]).offset+1}))}))}const o=n.map((e=>e.name));return n.map((e=>Q_(e,!0))).concat(Array.from(a).filter((e=>!o.includes(e))).map((e=>{const t=new V_;return t.name=e,t})).map((e=>Q_(e,!1))))})(s,e,t.filePath,d))}return{suggestions:n}}}),n.current?.dispose(),n.current=N.languages.registerCompletionItemProvider(S.PURE,{triggerCharacters:[],provideCompletionItems:async(e,t,s)=>{let i=[];return s.triggerKind===N.languages.CompletionTriggerKind.Invoke&&(i=i.concat((()=>{const e=[];return e.push({label:{label:"#copyright",description:"(copyright header)"},kind:N.languages.CompletionItemKind.Snippet,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:'// Copyright ${1:2020} Goldman Sachs\n//\n// Licensed under the Apache License, Version 2.0 (the "License");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an "AS IS" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n',range:{startLineNumber:1,startColumn:1,endLineNumber:1,endColumn:1e3}}),e})()),i=i.concat(((e,t,s)=>{const i=[],n=t.getWordUntilPosition(e),a=t.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:e.lineNumber,endColumn:e.column}),r=`${fe}${Ue.PURE}\n${a}`.split("\n").filter((e=>e.startsWith(fe))),o=(e=>{if(e.startsWith(fe))return e.substring(fe.length).split(" ")[0]})(r[r.length-1]??"");return o&&s(o).forEach((t=>{i.push({label:{label:t.text,description:t.description},kind:N.languages.CompletionItemKind.Snippet,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:`${t.insertText}\n`,range:{startLineNumber:e.lineNumber,startColumn:n.startColumn,endLineNumber:e.lineNumber,endColumn:n.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})})),i})(t,e,(e=>(e=>{switch(e){case Ue.PURE:return[{text:Fe.CLASS,description:"(blank)",insertText:"Class ${1:model::NewClass}\n// example of a constraint\n// [\n// SomeConstraint: true\n// ]\n{\n ${2:// example of a standard property\n // prop1: String[1];\n\n // example of a derived property\n // derivation1() {''\\}: String[1];}\n}"},{text:Fe.CLASS,description:"with property",insertText:"Class ${1:model::NewClass}\n{\n ${2:prop1}: ${3:String[1]};\n}"},{text:Fe.CLASS,description:"with inheritance",insertText:"Class ${1:model::NewClass} extends ${2:model::ParentClass}\n{\n ${3:// class content}\n}"},{text:Fe.CLASS,description:"with constraint",insertText:"Class ${1:model::NewClass}\n[\n ${3:SomeConstraint: true}\n]\n{\n ${2:// class content}\n}"},{text:Fe.PROFILE,insertText:"Profile ${1:model::NewProfile}\n{\n stereotypes: [${2:}];\n tags: [${3:}];\n}"},{text:Fe.ENUMERATION,insertText:"Enum ${1:model::NewEnumeration}\n{\n ${2:VALUE_1,\n VALUE_2}\n}"},{text:Fe.ASSOCIATION,insertText:"Association ${1:model::NewAssociation}\n{\n ${2:prop1}: ${3:model::Type1[1]};\n ${4:prop2}: ${5:model::Type2[1]};\n}"},{text:Fe.FUNCTION,description:"(blank)",insertText:"function ${1:model::NewEnumeration}(${2:param1: String[1]}): ${3:String[1]}\n{\n ${4:''; // function content}\n}"},{text:Fe.FUNCTION,insertText:"function ${1:model::NewEnumeration}(): String[1]\n{\n ''\n}"}];case Ue.MAPPING:return[{text:Fe.MAPPING,description:"(blank)",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:// mapping content}\n)"},{text:Fe.MAPPING,description:"with model-to-model mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Pure\n {\n ~src ${3:model::SourceClass}\n // example of property mappings\n // prop1: $src.prop1\n }\n)"},{text:Fe.MAPPING,description:"with relational mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetClass}: Relational {\n ~mainTable ${3:[model::SomeDatabase]SomeTable}\n // example of property mappings\n // prop1: [model::SomeDatabase]SomeTable.col1,\n }\n)"},{text:Fe.MAPPING,description:"with enumeration mapping",insertText:"Mapping ${1:model::NewMapping}\n(\n ${2:model::TargetEnumeration}: EnumerationMapping ${3:EnumerationMappingID}\n {\n // example of enum-value mapping\n // VAL_1: ['val1'],\n // VAL_2: ['val2', 'val_2']\n }\n)"}];case Ue.RELATIONAL:return[{text:Fe.DATABASE,description:"(blank)",insertText:"Database ${1:model::NewDatabase}\n(\n // example database schema\n // Schema SOME_SCHEMA\n // (\n // Table TABLE_1\n // (\n // COL_1 VARCHAR(200)\n // )\n // Table TABLE_2\n // (\n // COL_2 VARCHAR(200) PRIMARY_KEY\n // )\n // )\n\n // example database join\n // Join SomeJoin(SOME_SCHEMA.TABLE_1.COL_1 = SCHEMA1.TABLE_2.COL_2)\n\n ${2:// database content}\n)"}];case G_:return[{text:$_,description:"(blank)",insertText:"Diagram ${1:model::NewDiagram}(width=0.0, height=0.0)\n(\n // NOTE: it is recommended to use diagram visual editor\n // to edit diagram: double-click on the diagram in\n // the concept explorer tree to open the editor\n)"}];default:return[]}})(e)))),i=i.concat(((e,t,s=[])=>{const i=t.getWordUntilPosition(e);return[{text:"let",description:"new variable",insertText:"let ${1:} = ${2:};"},{text:"let",description:"new collection",insertText:"let ${1:} = [${2:}];"},{text:"cast",description:"type casting",insertText:"cast(@${1:model::SomeClass})"},{text:"if",description:"(conditional)",insertText:"if(${1:'true'}, | ${2:/* if true do this */}, | ${3:/* if false do this */})"},{text:"case",description:"(conditional)",insertText:"case(${1:}, ${2:'true'}, ${3:'false'})"},{text:"match",description:"(conditional)",insertText:"match([x:${1:String[1]}, ${2:''}])"},{text:"map",description:"(collection)",insertText:"map(x|${1:})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"fold",description:"(collection)",insertText:"fold({a, b| ${1:$a + $b}}, ${2:0})"},{text:"filter",description:"(collection)",insertText:"filter(x|${1:})"},{text:"sort",description:"(collection)",insertText:"sort()"},{text:"in",description:"(collection)",insertText:"in()"},{text:"slice",description:"(collection)",insertText:"slice(${1:1},${2:2})"},{text:"removeDuplicates",description:"(collection)",insertText:"removeDuplicates()"},{text:"toOne",description:"(collection)",insertText:"toOne(${1:})"},{text:"toOneMany",description:"(collection)",insertText:"toOneMany(${1:})"},{text:"isEmpty",description:"(collection)",insertText:"isEmpty()"},{text:"endsWith",description:"(string)",insertText:"endsWith()"},{text:"startsWith",description:"(string)",insertText:"startsWith()"},...s].map((t=>({label:{label:t.text,description:t.description},kind:N.languages.CompletionItemKind.Snippet,insertTextRules:N.languages.CompletionItemInsertTextRule.InsertAsSnippet,insertText:t.insertText,range:{startLineNumber:e.lineNumber,startColumn:i.startColumn,endLineNumber:e.lineNumber,endColumn:i.endColumn},documentation:t.documentation?t.documentation.markdownText?{value:t.documentation.markdownText.value}:t.documentation.text:void 0})))})(t,e,[{text:"print",description:"(io)",insertText:"print(${1:})"},{text:"println",description:"(io)",insertText:"println(${1:})"},{text:"NULL",description:"(nullish value)",insertText:"[]"}])),i=i.concat(await(async(e,t,s)=>{const i=Z_(e,t),n=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(X_)),a=Boolean(t.getLineContent(e.lineNumber).substring(0,e.column-1).match(q_));let r=[];try{r=(await s.client.getSuggestionsForIdentifier(i,a?[Vd.CLASS]:n?[Vd.FUNCTION,Vd.NATIVE_FUNCTION]:[])).map((e=>(0,Be.vB)(F_,e)))}catch{}return r.map((e=>a?z_(e):B_(e,{preferArrowFunctionForm:n})))})(t,e,d))),{suggestions:i}}}),k_(t),(0,at.useEffect)((()=>{if(l){if(document.querySelector(".file-editor .monaco-menu")){const e=["Peek"];Array.from(document.querySelectorAll(".file-editor .monaco-menu .action-label")).filter((t=>e.includes(t.innerHTML))).forEach((e=>{const t=e.parentElement?.parentElement;t&&(t.classList.add("disabled"),t.style.opacity="0.3",t.style.pointerEvents="none")}))}c(!1)}}),[l]),(0,at.useEffect)((()=>{void 0!==p&&void 0!==m&&r?.layout({width:p,height:m})}),[r,p,m]),(0,at.useEffect)((()=>{r&&t.textEditorState.forcedCursorPosition&&(jd(r,t.textEditorState.forcedCursorPosition),t.textEditorState.setForcedCursorPosition(void 0))}),[r,t,t.textEditorState.forcedCursorPosition]),(0,at.useEffect)((()=>()=>{r&&(t.textEditorState.setViewState(r.saveViewState()??void 0),r.dispose()),s.current?.dispose(),i.current?.dispose(),n.current?.dispose()}),[t,r]),(0,T.jsxs)("div",{className:"panel edit-panel file-editor",children:[(0,T.jsx)("div",{className:"panel__header file-editor__header",children:(0,T.jsxs)("div",{className:"file-editor__header__actions",children:[(0,T.jsx)("button",{className:(0,jc.clsx)("file-editor__header__action",{"file-editor__header__action--active":t.textEditorState.wrapText}),tabIndex:-1,onClick:()=>t.textEditorState.setWrapText(!t.textEditorState.wrapText),title:"Toggle Text Wrap",children:(0,T.jsx)(Xc.NK0,{className:"file-editor__icon--text-wrap"})}),t.renameConceptState&&(0,T.jsx)(tg,{renameConceptState:t.renameConceptState}),t.showGoToLinePrompt&&(0,T.jsx)(b_,{fileEditorState:t})]})}),(0,T.jsx)("div",{className:"panel__content file-editor__content",children:(0,T.jsx)("div",{ref:u,className:"text-editor__container",children:(0,T.jsx)("div",{className:"text-editor__body",ref:a})})})]})}));var ig=s(8533);const ng=e=>{const{open:t,className:s,children:i,menuProps:n,content:a,title:r,disabled:o,onClose:l,onOpen:c}=e,d=(0,at.useRef)(null),[h,u]=(0,at.useState)(null);return(0,at.useEffect)((()=>{void 0!==t&&(t&&!h&&d.current?u(d.current):!t&&h&&u(null))}),[h,t]),(0,T.jsxs)("button",{ref:d,className:s,disabled:o,onClick:e=>{e.stopPropagation(),e.preventDefault(),o||(h?(l?.(),u(null)):d.current&&(c?.(),u(d.current)))},tabIndex:-1,title:r,children:[i,(0,T.jsx)(sd,{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},anchorEl:h,open:(void 0===t||Boolean(t))&&Boolean(h),BackdropProps:{invisible:!0},elevation:0,marginThreshold:0,disableRestoreFocus:!0,...n,children:a})]})},ag=(0,nt.Pi)((0,at.forwardRef)((function(e,t){const{diagramEditorState:s}=e,i=Ft(),n=s.diagram,a=t,{width:r,height:o}=(0,dd.NB)({refreshMode:"debounce",refreshRate:50,targetRef:a});(0,at.useEffect)((()=>{if(a.current){const e=new ip(a.current,n);s.setRenderer(e),s.setupRenderer(),e.render(),e.autoRecenter()}}),[a,s,n]),(0,at.useEffect)((()=>{s.isDiagramRendererInitialized&&s.renderer.refresh()}),[s,r,o]);const l=(0,at.useCallback)(((e,t)=>{if(e instanceof Hd){const n=t.getClientOffset(),a=n?s.renderer.canvasCoordinateToModelCoordinate(s.renderer.eventCoordinateToCanvasCoordinate(new ic(n.x,n.y))):void 0;(0,x.fl)(s.addClassView(e.li_attr.pureId,a)).catch(i.alertUnhandledError)}}),[i,s]),[,c]=(0,ig.L)((()=>({accept:p_.CLASS,drop:(e,t)=>l(e,t)})),[l]);return c(a),(0,T.jsx)("div",{ref:a,className:(0,jc.clsx)("diagram-canvas diagram-editor__canvas",s.diagramCursorClass),tabIndex:0})}))),rg=(0,nt.Pi)((e=>{const{diagramEditorState:t}=e,s=Em(),i=Ft(),n=e=>()=>{t.renderer.zoomCenter(e/100)},a=t.renderer.selectedClasses.length<2;return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align left",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_LEFT),children:(0,T.jsx)(Xc.eRw,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align center",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_CENTER),children:(0,T.jsx)(Xc.UPo,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align right",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_RIGHT),children:(0,T.jsx)(Xc.B_D,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align top",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_TOP),children:(0,T.jsx)(Xc.Cti,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align middle",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_MIDDLE),children:(0,T.jsx)(Xc.w0Y,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Align bottom",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.ALIGN_BOTTOM),children:(0,T.jsx)(Xc.HLb,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__group__separator"}),(0,T.jsxs)("div",{className:"diagram-editor__header__group",children:[(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space horizontally",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.SPACE_HORIZONTALLY),children:(0,T.jsx)(Xc.ppk,{className:"diagram-editor__icon--aligner"})}),(0,T.jsx)("button",{className:"diagram-editor__header__action diagram-editor__header__group__action",title:"Space vertically",disabled:a,tabIndex:-1,onClick:()=>t.renderer.align(Qu.SPACE_VERTICALLY),children:(0,T.jsx)(Xc.LyQ,{className:"diagram-editor__icon--aligner"})})]}),(0,T.jsxs)(ng,{className:"diagram-editor__header__dropdown",title:"Zoom...",content:(0,T.jsxs)(nd,{children:[(0,T.jsx)(ad,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:()=>t.renderer.zoomToFit(),children:"Fit"}),(0,T.jsx)(rd,{}),tp.map((e=>(0,T.jsxs)(ad,{className:"diagram-editor__header__zoomer__dropdown__menu__item",onClick:n(e),children:[e,"%"]},e)))]}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:7},children:[(0,T.jsxs)("div",{className:"diagram-editor__header__dropdown__label diagram-editor__header__zoomer__dropdown__label",children:[Math.round(100*t.renderer.zoom),"%"]}),(0,T.jsx)("div",{className:"diagram-editor__header__dropdown__trigger diagram-editor__header__zoomer__dropdown__trigger",children:(0,T.jsx)(Xc.VAA,{})})]}),(0,T.jsx)("div",{className:"diagram-editor__header__actions",children:(0,T.jsx)("button",{className:"diagram-editor__header__action",tabIndex:-1,onClick:()=>{(0,x.fl)(s.loadFile(t.filePath,new Kd(t.filePath,t.fileLine,t.fileColumn))).catch(i.alertUnhandledError)},children:(0,T.jsx)(Xc.qdB,{className:"diagram-editor__icon--go-to-file"})})})]})})),og=(0,nt.Pi)((e=>{const{diagramEditorState:t}=e,s=t.renderer,i=(e,t)=>()=>s.changeMode(e,t);return(0,T.jsxs)("div",{className:"diagram-editor__tools",children:[(0,T.jsx)("button",{className:(0,jc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===qu.LAYOUT}),tabIndex:-1,onClick:i(qu.LAYOUT,Ju.NONE),title:"View Tool (V)",children:(0,T.jsx)(Xc.Hrt,{className:"diagram-editor__icon--layout"})}),(0,T.jsx)("button",{className:(0,jc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===qu.PAN}),tabIndex:-1,onClick:i(qu.PAN,Ju.NONE),title:"Pan Tool (M)",children:(0,T.jsx)(Xc.tPC,{className:"diagram-editor__icon--pan"})}),(0,T.jsx)("button",{className:(0,jc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===qu.ZOOM_IN}),tabIndex:-1,title:"Zoom In (Z)",onClick:i(qu.ZOOM_IN,Ju.NONE),children:(0,T.jsx)(Xc.Sd5,{className:"diagram-editor__icon--zoom-in"})}),(0,T.jsx)("button",{className:(0,jc.clsx)("diagram-editor__tool",{"diagram-editor__tool--active":s.interactionMode===qu.ZOOM_OUT}),tabIndex:-1,title:"Zoom Out (Z)",onClick:i(qu.ZOOM_OUT,Ju.NONE),children:(0,T.jsx)(Xc.xLV,{className:"diagram-editor__icon--zoom-out"})})]})})),lg=(0,nt.Pi)((e=>{const{diagramEditorState:t}=e,s=(0,at.useRef)(null);return k_(t),(0,T.jsxs)("div",{className:"diagram-editor",children:[(0,T.jsx)("div",{className:"diagram-editor__header",children:t.isDiagramRendererInitialized&&(0,T.jsx)(rg,{diagramEditorState:t})}),(0,T.jsx)("div",{className:"diagram-editor__content",children:(0,T.jsxs)("div",{className:"diagram-editor__stage",children:[t.isDiagramRendererInitialized&&(0,T.jsx)(og,{diagramEditorState:t}),(0,T.jsx)(ag,{diagramEditorState:t,ref:s})]})})]})}));var cg=s(98533),dg=s(84153);const hg=e=>{const{children:t,label:s,showPlaceholder:i,className:n}=e;return i?(0,T.jsx)("div",{className:(0,jc.clsx)(["dnd__entry-dropzone__placeholder",n]),children:(0,T.jsx)("div",{className:"dnd__entry-dropzone__placeholder__content",children:(0,T.jsx)("div",{className:"dnd__entry-dropzone__placeholder__label",children:s??""})})}):(0,T.jsx)(T.Fragment,{children:t})};function ug(e){const{labelGetter:t,types:s}=e,{itemType:i,item:n,isDragging:a,currentPosition:r}=(0,cg.f)((e=>({itemType:e.getItemType(),item:e.getItem(),isDragging:e.isDragging(),initialOffset:e.getInitialSourceClientOffset(),currentPosition:e.getClientOffset()})));return a&&n&&i&&s.includes(i.toString())?(0,T.jsx)(bc.Z,{children:(0,T.jsx)("div",{className:"dnd__drag-preview-layer",children:(0,T.jsx)("div",{className:"dnd__drag-preview-layer__content",style:r?{transform:`translate(${r.x/10+2}rem, ${r.y/10+1}rem)`}:{display:"none"},children:t(n)})})}):null}const pg=e=>{if(Math.abs(e.deltaY)<=Math.abs(e.deltaX))return;let t;e.stopPropagation(),t=0===e.deltaY?e.deltaY:e.deltaY<0?-Math.abs(e.deltaY):Math.abs(e.deltaY),e.currentTarget.scrollBy(t,0)},mg=(0,nt.Pi)((e=>{const{tabState:t,managerTabState:s}=e;return(0,T.jsxs)(nd,{children:[(0,T.jsx)(ad,{onClick:()=>s.closeTab(t),children:"Close"}),(0,T.jsx)(ad,{disabled:s.tabs.length<2,onClick:()=>s.closeAllOtherTabs(t),children:"Close Others"}),(0,T.jsx)(ad,{onClick:()=>s.closeAllTabs(),children:"Close All"})]})})),_g=(0,nt.Pi)((e=>{const t=(0,at.useRef)(null),{tabManagerState:s,tabState:i,tabRenderer:n}=e,a=(0,at.useCallback)(((e,n)=>{const a=e.tab,r=i,o=s.tabs.findIndex((e=>e===a)),l=s.tabs.findIndex((e=>e===r)),c=t.current?.getBoundingClientRect(),d=((c?.left??0)-(c?.right??0))/2,h=(n.getClientOffset()?.x??0)-(c?.right??0);o<l&&h<d||o>l&&h>d||s.swapTabs(a,r)}),[s,i]),[{isBeingDraggedEditorPanel:r},o]=(0,ig.L)((()=>({accept:[s.dndType],hover:(e,t)=>a(e,t),collect:e=>({isBeingDraggedEditorPanel:e.getItem()?.tab})})),[a]),l=i===r,[,c,d]=(0,Hm.c)((()=>({type:s.dndType,item:()=>({tab:i})})),[i,s]);return c(o(t)),(e=>{(0,at.useEffect)((()=>{e((0,dg.r)())}),[e])})(d),(0,T.jsx)("div",{ref:t,className:(0,jc.clsx)("tab-manager__tab",{"tab-manager__tab--active":i===s.currentTab,"tab-manager__tab--dragged":l}),onMouseUp:(h=i,e=>{1===e.nativeEvent.button&&s.closeTab(h)}),children:(0,T.jsx)(hg,{showPlaceholder:!1,className:"tab-manager__tab__dnd__placeholder",children:(0,T.jsxs)(id,{content:(0,T.jsx)(mg,{tabState:i,managerTabState:s}),className:"tab-manager__tab__content",children:[(0,T.jsx)("button",{className:"tab-manager__tab__label",tabIndex:-1,onClick:()=>s.openTab(i),title:i.description,children:n?.(i)??i.label}),(0,T.jsx)("button",{className:"tab-manager__tab__close-btn",onClick:()=>s.closeTab(i),tabIndex:-1,title:"Close",children:(0,T.jsx)(Xc.q1B,{})})]})})});var h})),gg=(0,nt.Pi)((e=>{const{managerTabState:t}=e;return(0,T.jsx)(ng,{className:"tab-manager__menu__toggler",title:"Show All Tabs",content:(0,T.jsx)(nd,{className:"tab-manager__menu",children:t.tabs.map((e=>(0,T.jsxs)(ad,{className:(0,jc.clsx)("tab-manager__menu__item",{"tab-manager__menu__item--active":e===t.currentTab}),onClick:()=>t.openTab(e),children:[(0,T.jsx)("div",{className:"tab-manager__menu__item__label",children:e.label}),(0,T.jsx)("div",{className:"tab-manager__menu__item__close-btn",onClick:s=>{s.stopPropagation(),t.closeTab(e)},tabIndex:-1,title:"Close",children:(0,T.jsx)(Xc.q1B,{})})]},e.uuid)))}),menuProps:{anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},children:(0,T.jsx)(Xc.v4q,{})})})),Eg=(0,nt.Pi)((e=>{const{tabManagerState:t,tabRenderer:s}=e;return(0,T.jsxs)("div",{className:"tab-manager",children:[(0,T.jsxs)("div",{className:"tab-manager__content",onWheel:pg,children:[t.tabs.map((e=>(0,T.jsx)(_g,{tabState:e,tabManagerState:t,tabRenderer:s},e.uuid))),(0,T.jsx)(ug,{labelGetter:e=>e.tab.label,types:[t.dndType]})]}),(0,T.jsx)(gg,{managerTabState:t})]})})),fg=()=>{const[e,t]=(0,at.useState)(!1),{ref:s,width:i,height:n}=(0,dd.NB)();return(0,at.useEffect)((()=>{t((i??0)>300&&(n??0)>150)}),[i,n]),(0,T.jsx)("div",{ref:s,className:"edit-panel__splash-screen",children:(0,T.jsxs)("div",{className:(0,jc.clsx)("edit-panel__splash-screen__content",{"edit-panel__splash-screen__content--hidden":!e}),children:[(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Execute the 'go' function"}),(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F9"})})]}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Run the full test suite"}),(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:(0,T.jsx)("div",{className:"hotkey__key",children:"F10"})})]}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item",children:[(0,T.jsx)("div",{className:"edit-panel__splash-screen__content__item__label",children:"Search for a file"}),(0,T.jsxs)("div",{className:"edit-panel__splash-screen__content__item__hot-keys",children:[(0,T.jsx)("div",{className:"hotkey__key",children:"Ctrl"}),(0,T.jsx)("div",{className:"hotkey__plus",children:(0,T.jsx)(Xc.pOD,{})}),(0,T.jsx)("div",{className:"hotkey__key",children:"P"})]})]})]})})},Tg=(0,nt.Pi)((()=>{const e=Em(),t=e.tabManagerState.currentTab;return t?(0,T.jsxs)("div",{className:"panel edit-panel",children:[(0,T.jsxs)("div",{className:"panel__header edit-panel__header",children:[(0,T.jsx)("div",{className:"edit-panel__header__tabs",children:(0,T.jsx)(Eg,{tabManagerState:e.tabManagerState,tabRenderer:t=>{if(t instanceof uh){const s=e.tabManagerState.tabs.filter((e=>e instanceof uh&&e.fileName===t.fileName)).length>1;return(0,T.jsxs)("div",{className:"edit-panel__header__tab",children:[(0,T.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,T.jsx)(Xc.QqN,{className:"edit-panel__header__tab__icon--file"})}),(0,T.jsx)("div",{className:"edit-panel__header__tab__label",children:t.fileName}),s&&(0,T.jsx)("div",{className:"edit-panel__header__tab__path",children:t.filePath})]})}if(t instanceof hm){const s=e.tabManagerState.tabs.filter((e=>e instanceof hm&&e.diagramName===t.diagramName)).length>1;return(0,T.jsxs)("div",{className:"edit-panel__header__tab",children:[(0,T.jsx)("div",{className:"edit-panel__header__tab__icon",children:(0,T.jsx)(i_,{})}),(0,T.jsx)("div",{className:"edit-panel__header__tab__label",children:t.diagramName}),s&&(0,T.jsx)("div",{className:"edit-panel__header__tab__path",children:t.diagramPath})]})}return t.label}})}),(0,T.jsx)("div",{className:"panel__header__actions"})]}),(0,T.jsx)("div",{className:"panel__content edit-panel__content",children:t instanceof uh?t.textEditorState.language===S.PURE?(0,T.jsx)(sg,{editorState:t}):(0,T.jsx)(D_,{editorState:t}):t instanceof hm?(0,T.jsx)(lg,{diagramEditorState:t}):null},t.uuid)]}):(0,T.jsx)(fg,{})}));var Cg=s(82663),xg=s(35247);const Ng=e=>{const t=3.5*parseInt(getComputedStyle(document.documentElement).fontSize,10),{options:s,children:i,getValue:n,selectProps:a}=e,[r]=n(),o=s.indexOf(r)*t,l=i.length?i.findIndex((e=>e.props.isFocused)):0,c=(0,at.useRef)(null);return(0,at.useEffect)((()=>{c.current?.scrollToItem(l)}),[l]),i.length?(0,T.jsx)(Cg.t7,{className:a.darkMode?"scrollbar--light selector-menu--dark":"",ref:c,width:"100%",height:Math.min(i.length,6)*t,itemCount:i.length,itemSize:t,initialScrollOffset:o,children:({index:e,style:t})=>(0,T.jsx)("div",{style:t,children:i[e]})}):(0,T.jsx)("div",{className:"selector-menu--no-match "+(a.darkMode?"selector-menu--dark":""),children:a.noMatchMessage??"No match found"})},Ag="selector-input",Og="selector-input--dark",Sg=()=>(0,T.jsx)("div",{className:`${Ag}__indicator ${Ag}__loading-indicator ${Og}__loading-indicator`,children:(0,T.jsx)(Xc.VRP,{})}),yg=()=>(0,T.jsx)("div",{className:`${Ag}__indicator ${Ag}__dropdown-indicator`,children:(0,T.jsx)(Xc.VAA,{})}),Ig=e=>{const{innerProps:{ref:t,...s}}=e;return(0,T.jsx)("div",{...s,ref:t,children:(0,T.jsx)("div",{className:`${Ag}__indicator ${Ag}__clear-indicator`,children:(0,T.jsx)(Xc.q1B,{})})})},vg=e=>(0,T.jsx)(xg.baseComponents.Input,{...e,isHidden:!1}),Rg=(0,at.forwardRef)((function(e,t){const{option:s,allowCreating:i,noMatchMessage:n,disabled:a,components:r,className:o,darkMode:l,hasError:c,...d}=e,h=i?xg.CreatableSelect:xg.Select,u=l?Og:Ag;return(0,T.jsx)(h,{styles:{menuPortal:e=>({...e,zIndex:9999})},menuPortalTarget:document.body,ref:t,isDisabled:Boolean(a),className:`${u} ${o} ${c?"selector-input--has-error":""}`,classNamePrefix:u,components:{ClearIndicator:Ig,DropdownIndicator:yg,LoadingIndicator:Sg,MenuList:Ng,Input:vg,...r},...{...d,darkMode:l,noMatchMessage:n}})})),Pg=(e,t)=>e.label.localeCompare(t.label),wg=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.fileSearchCommandLoadingState,i=e.fileSearchCommandState,n=(0,at.useRef)(null),a=(0,at.useMemo)((()=>(0,md.Z)((()=>{(0,x.fl)(e.searchFile()).catch(t.alertUnhandledError)}),500)),[t,e]),r=()=>e.setOpenFileSearchCommand(!1);return(0,T.jsx)(Fc.Z,{open:e.openFileSearchCommand,onClose:r,TransitionProps:{onEnter:()=>{n.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Open file"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)(Rg,{ref:n,className:"command-modal__content__input",options:e.fileSearchCommandResults.map((e=>({label:e,value:e}))).sort(Pg),onChange:s=>{s?.value&&(r(),i.reset(),(0,x.fl)(e.loadFile(s.value)).catch(t.alertUnhandledError))},onInputChange:e=>{i.setText(e),a.cancel(),a()},placeholder:"Enter file name or path",escapeClearsValue:!0,darkMode:!0,isLoading:s.isInProgress}),(0,T.jsx)("button",{className:(0,jc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":i.isRegExp}),title:`Use Regular Expression (${i.isRegExp?"on":"off"})`,onClick:()=>i.toggleRegExp(),children:(0,T.jsx)(Xc.x47,{})})]})]})})})),Lg=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.textSearchCommandState,i=(0,at.useRef)(null),n=()=>e.setOpenTextSearchCommand(!1),a=s=>{s.preventDefault(),n(),(0,x.fl)(e.searchText()).catch(t.alertUnhandledError)};return(0,T.jsx)(Fc.Z,{open:e.openTextSearchCommand,onClose:n,TransitionProps:{onEnter:()=>{i.current?.focus()}},classes:{container:"command-modal__container"},PaperProps:{classes:{root:"command-modal__inner-container"}},children:(0,T.jsxs)("div",{className:"modal modal--dark command-modal",children:[(0,T.jsx)("div",{className:"modal__title",children:"Search"}),(0,T.jsxs)("div",{className:"command-modal__content",children:[(0,T.jsx)("form",{className:"command-modal__content__form",onSubmit:a,children:(0,T.jsx)("input",{ref:i,className:"command-modal__content__input input--dark",onChange:e=>s.setText(e.target.value),value:s.text})}),(0,T.jsx)("button",{className:(0,jc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isCaseSensitive}),title:`Match Case (${s.isCaseSensitive?"on":"off"})`,onClick:()=>s.toggleCaseSensitive(),children:(0,T.jsx)(Xc.a2g,{})}),(0,T.jsx)("button",{className:(0,jc.clsx)("command-modal__content__config-btn btn--sm",{"command-modal__content__config-btn--toggled":s.isRegExp}),title:`Use Regular Expression (${s.isRegExp?"on":"off"})`,onClick:()=>s.toggleRegExp(),children:(0,T.jsx)(Xc.x47,{})}),(0,T.jsx)("button",{className:"command-modal__content__submit-btn btn--dark btn--caution",onClick:a,children:"Search"})]})]})})})),bg=(Dg=(0,nt.Pi)((()=>{const e=Em(),t=Ft(),s=e.initState.hasSucceeded,{ref:i,width:n,height:a}=(0,dd.NB)(),r=bm(0===e.sideBarDisplayState.size,{onStopResize:t=>e.sideBarDisplayState.setSize(t.domElement.getBoundingClientRect().width),size:e.sideBarDisplayState.size}),o=bm(0===e.auxPanelDisplayState.size,{onStopResize:t=>e.auxPanelDisplayState.setSize(t.domElement.getBoundingClientRect().height),size:e.auxPanelDisplayState.size}),l=bm(e.auxPanelDisplayState.isMaximized);return(0,at.useEffect)((()=>{i.current&&e.auxPanelDisplayState.setMaxSize(i.current.offsetHeight)}),[e,i,a,n]),(0,at.useEffect)((()=>()=>{e.cleanUp()}),[e]),(0,at.useEffect)((()=>{const s=((e,t=!1)=>t?se.Z.parseUrl(e).query:se.Z.parse(e))(window.location.search);(0,x.fl)(e.initialize(!1,void 0,s.mode,s.fastCompile)).catch(t.alertUnhandledError)}),[e,t]),(0,at.useEffect)((()=>(t.navigator.blockNavigation([()=>!0],void 0,(()=>t.notifyWarning("Navigation from the editor is blocked"))),()=>{t.navigator.unblockNavigation()})),[e,t]),k_(e),(0,T.jsxs)("div",{className:"editor",children:[(0,T.jsxs)("div",{className:"editor__body",children:[(0,T.jsx)(R_,{}),(0,T.jsx)("div",{className:"editor__content-container",ref:i,children:(0,T.jsx)("div",{className:"editor__content",children:(0,T.jsxs)(wm,{orientation:"vertical",children:[(0,T.jsx)(Dm,{...r.collapsiblePanel,direction:1,children:(0,T.jsx)(I_,{})}),(0,T.jsx)(Mm,{}),(0,T.jsx)(Dm,{...r.remainingPanel,minSize:300,children:(0,T.jsxs)(wm,{orientation:"horizontal",children:[(0,T.jsx)(Dm,{...l.collapsiblePanel,...0===e.auxPanelDisplayState.size?o.remainingPanel:{},children:(0,T.jsx)(Tg,{})}),(0,T.jsx)(Mm,{children:(0,T.jsx)(km,{color:e.auxPanelDisplayState.isMaximized?"transparent":"var(--color-dark-grey-250)"})}),(0,T.jsx)(Dm,{...o.collapsiblePanel,...e.auxPanelDisplayState.isMaximized?l.remainingPanel:{},direction:-1,children:(0,T.jsx)(Bm,{})})]})})]})})})]}),(0,T.jsx)(w_,{actionsDisabled:!s}),s&&(0,T.jsx)(wg,{}),s&&(0,T.jsx)(Lg,{})]})})),function(){return(0,T.jsx)(gm,{children:(0,T.jsx)(Dg,{})})});var Dg;const Mg=()=>(0,T.jsx)(Md,{children:(0,T.jsx)(Ld,{children:(0,T.jsx)(bg,{})})}),kg=JSON.parse('{"i8":"6.2.31","Rw":{"p":"@finos/legend-application-pure-ide-plugin-core"}}');class Fg extends o{}class jg extends Fg{_$nominalTypeBrand;install(e){e.registerApplicationPlugin(this)}}class Ug extends jg{static NAME=kg.Rw.p;constructor(){super(Ug.NAME,kg.i8)}getExtraKeyedCommandConfigEntries(){return[ah,ch,oh].flatMap((e=>{return t=e,Object.entries(t).map((e=>({key:e[0],content:e[1]})));var t}))}}class Vg extends st{static create(){const e=new Vg(Gt.create());return e.withBasePlugins([new Ug]),e.withBasePresets([new Ic]),e}async configureApplication(e){return new Ut(e)}async loadApplication(){await(async(e,t)=>{(e=>{var t,s;N.editor.defineTheme(O.LEGEND,$e),N.editor.addKeybindingRules([{keybinding:N.KeyMod.WinCtrl|N.KeyCode.KeyG,command:null},{keybinding:N.KeyMod.WinCtrl|N.KeyCode.KeyB,command:null},{keybinding:N.KeyMod.WinCtrl|N.KeyCode.KeyO,command:null},{keybinding:N.KeyMod.WinCtrl|N.KeyCode.KeyP,command:null},{keybinding:N.KeyCode.F1,command:null},{keybinding:N.KeyCode.F8,command:null},{keybinding:N.KeyCode.F9,command:null},{keybinding:N.KeyMod.CtrlCmd|N.KeyCode.F2,command:null},{keybinding:N.KeyMod.Shift|N.KeyCode.F10,command:null},{keybinding:N.KeyMod.CtrlCmd|N.KeyCode.F12,command:null}]),N.languages.register({id:S.PURE}),N.languages.setLanguageConfiguration(S.PURE,ze),N.languages.setMonarchTokensProvider(S.PURE,(t=e.getPureGraphManagerPlugins().flatMap((e=>e.getExtraPureGrammarKeywords?.()??[])),s=e.getPureGraphManagerPlugins().flatMap((e=>e.getExtraPureGrammarParserNames?.()??[])),{defaultToken:"invalid",tokenPostfix:".pure",keywords:[...t,"Schema","Table","Join","View","primaryKey","groupBy","mainTable","let","extends","true","false","projects",Fe.CLASS,Fe.ASSOCIATION,Fe.ENUMERATION,Fe.MEASURE,Fe.PROFILE,Fe.FUNCTION,Fe.MAPPING,Fe.RUNTIME,Fe.CONNECTION,Fe.FILE_GENERATION,Fe.GENERATION_SPECIFICATION,Fe.DATA_ELEMENT,je.JSON_MODEL_CONNECTION,je.MODEL_CHAIN_CONNECTION,je.XML_MODEL_CONNECTION,"include","EnumerationMapping","Pure","AssociationMapping","XStore","AggregationAware",Fe.SERVICE,Fe.FLAT_DATA,Fe.DATABASE,je.FLAT_DATA_CONNECTION,je.RELATIONAL_DATABASE_CONNECTION,"Relational"],operators:["=",">","<","!","~","?",":","==","<=",">=","&&","||","++","--","+","-","*","/","&","|","^","%","->","#{","}#","@","<<",">>"],languageStructs:["import","native"],parsers:[Ue.PURE,Ue.CONNECTION,Ue.RUNTIME,Ue.MAPPING,Ue.SERVICE,Ue.FLATDATA,Ue.RELATIONAL,Ue.GENERATION_SPECIFICATION,Ue.FILE_GENERATION_SPECIFICATION,Ue.DATA].concat(s).map((e=>`${fe}${e}`)),identifier:/[a-zA-Z_$][\w$]*/,symbols:/[=><!~?:&|+\-*/^%#@]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,multiplicity:/\[(?:[a-zA-Z0-9]+(?:\.\.(?:[a-zA-Z0-9]+|\*|))?|\*)\]/,package:/(?:[\w_]+::)+/,generics:/<.+>/,date:/%-?\d+(?:-\d+(?:-\d+(?:T(?:\d+(?::\d+(?::\d+(?:.\d+)?)?)?)(?:[+-][0-9]{4})?)))/,time:/%\d+(?::\d+(?::\d+(?:.\d+)?)?)?/,tokenizer:{root:[{include:"@pure"},{include:"@date"},{include:"@color"},[/^\s*###[\w]+/,{cases:{"@parsers":Ge.PARSER,"@default":Ge.INVALID}}],[/(@identifier)/,{cases:{"@languageStructs":Ge.LANGUAGE_STRUCT,"@keywords":`${Ge.KEYWORD}.$0`,"@default":Ge.IDENTIFIER}}],{include:"@whitespace"},[/[{}()[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":Ge.OPERATOR,"@default":Ge.IDENTIFIER}}],{include:"@number"},[/[;,.]/,Ge.DELIMITER],[/'([^'\\]|\\.)*$/,`${Ge.STRING}.invalid`],[/'/,Ge.STRING,"@string"],{include:"@characters"}],pure:[[/(@package\*)/,[Ge.PACKAGE]],[/(@package?)(@identifier)(@generics?)(\s*)(@multiplicity)/,[Ge.PACKAGE,Ge.TYPE,Ge.GENERICS,Ge.WHITESPACE,Ge.MULTIPLICITY]],[/(@package)(@identifier)(@generics?)/,[Ge.PACKAGE,Ge.TYPE,Ge.GENERICS]],[/([@^])(\s*)(@package?)(@identifier)(@generics?)(@multiplicity?)/,[`${Ge.TYPE}.operator`,Ge.WHITESPACE,Ge.PACKAGE,Ge.TYPE,Ge.GENERICS,Ge.MULTIPLICITY]],[/(\.\s*)(@identifier)/,[Ge.DELIMITER,Ge.PROPERTY]],[/(@identifier)(\s*=)/,[Ge.PROPERTY,Ge.OPERATOR]],[/(@identifier)(\.)(@identifier)/,[Ge.TYPE,Ge.OPERATOR,Ge.PROPERTY]],[/(@identifier)(\s*:)/,[Ge.PARAMETER,Ge.OPERATOR]],[/(let)(\s+)(@identifier)(\s*=)/,[Ge.KEYWORD,Ge.WHITESPACE,Ge.VARIABLE,Ge.OPERATOR]],[/(\$@identifier)/,[`${Ge.VARIABLE}.reference`]]],date:[[/(%latest)/,[`${Ge.DATE}.latest`]],[/(@date)/,[Ge.DATE]],[/(@time)/,[`${Ge.DATE}.time`]]],color:[[/(#[0-9a-fA-F]{6})/,[Ge.COLOR]]],number:[[/(@digits)[eE]([-+]?(@digits))?[fFdD]?/,`${Ge.NUMBER}.float`],[/(@digits)\.(@digits)([eE][-+]?(@digits))?[fFdD]?/,`${Ge.NUMBER}.float`],[/0[xX](@hexdigits)[Ll]?/,`${Ge.NUMBER}.hex`],[/0(@octaldigits)[Ll]?/,`${Ge.NUMBER}.octal`],[/0[bB](@binarydigits)[Ll]?/,`${Ge.NUMBER}.binary`],[/(@digits)[fFdD]/,`${Ge.NUMBER}.float`],[/(@digits)[lL]?/,Ge.NUMBER]],whitespace:[[/[ \t\r\n]+/,Ge.WHITESPACE],[/\/\*\*(?!\/)/,`${Ge.COMMENT}.doc`,"@doc"],[/\/\*/,Ge.COMMENT,"@comment"],[/\/\/.*$/,Ge.COMMENT]],comment:[[/[^/*]+/,Ge.COMMENT],[/\*\//,Ge.COMMENT,"@pop"],[/[/*]/,Ge.COMMENT]],doc:[[/[^/*]+/,`${Ge.COMMENT}.doc`],[/\/\*/,`${Ge.COMMENT}.doc.invalid`],[/\*\//,`${Ge.COMMENT}.doc`,"@pop"],[/[/*]/,`${Ge.COMMENT}.doc`]],string:[[/[^\\']+/,Ge.STRING],[/@escapes/,`${Ge.STRING}.escape`],[/\\./,`${Ge.STRING}.escape.invalid`],[/'/,Ge.STRING,"@pop"]],characters:[[/'[^\\']'/,Ge.STRING],[/(')(@escapes)(')/,[Ge.STRING,`${Ge.STRING}.escape`,Ge.STRING]],[/'/,`${Ge.STRING}.invalid`]]}}))})(e);const s=`Monospaced font '${A}' has not been loaded properly, text editor display problems might occur`;await document.fonts.load(`1em ${A}`).then((()=>{document.fonts.check(`1em ${A}`)?(N.editor.remeasureFonts(),t.info(h.create(ge.TEXT_EDITOR_FONT_LOADED),`Monospaced font '${A}' has been loaded`)):t.error(h.create(ge.APPLICATION_SETUP_FAILURE),s)})).catch((()=>t.error(h.create(ge.APPLICATION_SETUP_FAILURE),s))),(0,x.jQ)({enforceActions:"observed"})})(this.pluginManager,this.logger),(0,C.s)((()=>{let e=document.getElementsByTagName("root").length?document.getElementsByTagName("root")[0]:void 0;return e||(e=document.createElement("root"),document.body.appendChild(e)),e})()).render((0,T.jsx)(it.VK,{basename:this.baseUrl,children:(0,T.jsx)(ct,{children:(0,T.jsx)(kt,{config:this.config,pluginManager:this.pluginManager,children:(0,T.jsx)(Mg,{})})})}))}}class Gg{static getPresetCollection(){return[]}static getPluginCollection(){return[new f]}static run(e){Vg.create().setup({baseUrl:e}).withPresets(Gg.getPresetCollection()).withPlugins(Gg.getPluginCollection()).start().catch((e=>{throw e}))}}Gg.run("/ide/")},94174:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Fuse=void 0;var n=s(71659);Object.defineProperty(t,"Fuse",{enumerable:!0,get:function(){return i(n).default}})},12889:(e,t,s)=>{t.J$M=t.DE2=t.W1M=t.oF7=t.bK4=t.o1U=t.Zlt=t.jG4=t.uMt=t.pTE=t.UOT=t.pgN=t.VAA=t.IEm=t.pOD=t.xDH=t.q1B=t.cOE=void 0,t.QqN=t.SCS=t.$Ow=t.ROc=t.ry=t.FxN=t.R0=t.Qq=t.VRP=t.nnZ=t.LPM=t.rE2=void 0,t.Two=t.qdB=t.NK0=t.UHp=t.VjU=t.NEI=t.DuK=t.ce8=t.dRK=t.VHe=t.DXi=t.jZm=t.Oag=t.kdY=void 0,t.xLV=t.Sd5=t.tPC=t.Hrt=t.jtq=t.HXR=t.LyQ=t.ppk=t.B_D=t.UPo=t.eRw=t.HLb=t.w0Y=t.Cti=t.POq=t.Vzd=t.b0D=t.XCv=t.g8U=t.v4q=t.a2g=t.x47=void 0,t.eid=void 0;var i=s(18978);Object.defineProperty(t,"cOE",{enumerable:!0,get:function(){return i.FaCrosshairs}}),Object.defineProperty(t,"q1B",{enumerable:!0,get:function(){return i.FaTimes}}),Object.defineProperty(t,"xDH",{enumerable:!0,get:function(){return i.FaTimesCircle}}),Object.defineProperty(t,"pOD",{enumerable:!0,get:function(){return i.FaPlus}}),Object.defineProperty(t,"IEm",{enumerable:!0,get:function(){return i.FaCog}}),Object.defineProperty(t,"VAA",{enumerable:!0,get:function(){return i.FaCaretDown}}),Object.defineProperty(t,"pgN",{enumerable:!0,get:function(){return i.FaHammer}}),Object.defineProperty(t,"UOT",{enumerable:!0,get:function(){return i.FaQuestion}}),Object.defineProperty(t,"pTE",{enumerable:!0,get:function(){return i.FaQuestionCircle}}),Object.defineProperty(t,"uMt",{enumerable:!0,get:function(){return i.FaInfoCircle}}),Object.defineProperty(t,"jG4",{enumerable:!0,get:function(){return i.FaCompress}}),Object.defineProperty(t,"Zlt",{enumerable:!0,get:function(){return i.FaMap}}),Object.defineProperty(t,"o1U",{enumerable:!0,get:function(){return i.FaPlay}}),Object.defineProperty(t,"bK4",{enumerable:!0,get:function(){return i.FaArrowAltCircleRight}}),Object.defineProperty(t,"oF7",{enumerable:!0,get:function(){return i.FaShapes}}),Object.defineProperty(t,"W1M",{enumerable:!0,get:function(){return i.FaSearch}}),Object.defineProperty(t,"DE2",{enumerable:!0,get:function(){return i.FaList}}),Object.defineProperty(t,"J$M",{enumerable:!0,get:function(){return i.FaCircle}}),Object.defineProperty(t,"rE2",{enumerable:!0,get:function(){return i.FaCheckCircle}}),Object.defineProperty(t,"LPM",{enumerable:!0,get:function(){return i.FaExclamationTriangle}}),Object.defineProperty(t,"nnZ",{enumerable:!0,get:function(){return i.FaBug}}),Object.defineProperty(t,"VRP",{enumerable:!0,get:function(){return i.FaCircleNotch}}),Object.defineProperty(t,"Qq",{enumerable:!0,get:function(){return i.FaExpand}}),Object.defineProperty(t,"R0",{enumerable:!0,get:function(){return i.FaWrench}}),Object.defineProperty(t,"FxN",{enumerable:!0,get:function(){return i.FaTerminal}}),Object.defineProperty(t,"ry",{enumerable:!0,get:function(){return i.FaFolderOpen}}),Object.defineProperty(t,"ROc",{enumerable:!0,get:function(){return i.FaFolder}}),Object.defineProperty(t,"$Ow",{enumerable:!0,get:function(){return i.FaExclamationCircle}}),Object.defineProperty(t,"SCS",{enumerable:!0,get:function(){return i.FaBan}}),Object.defineProperty(t,"QqN",{enumerable:!0,get:function(){return i.FaFileAlt}}),Object.defineProperty(t,"kdY",{enumerable:!0,get:function(){return i.FaMapMarkerAlt}}),Object.defineProperty(t,"Oag",{enumerable:!0,get:function(){return i.FaHatWizard}}),Object.defineProperty(t,"jZm",{enumerable:!0,get:function(){return i.FaRegLaughWink}}),Object.defineProperty(t,"DXi",{enumerable:!0,get:function(){return i.FaRegSadTear}}),Object.defineProperty(t,"VHe",{enumerable:!0,get:function(){return i.FaDatabase}});var n=s(1553);Object.defineProperty(t,"dRK",{enumerable:!0,get:function(){return n.GiBeard}}),Object.defineProperty(t,"ce8",{enumerable:!0,get:function(){return n.GiSunglasses}});var a=s(65186);Object.defineProperty(t,"DuK",{enumerable:!0,get:function(){return a.MdRefresh}}),Object.defineProperty(t,"NEI",{enumerable:!0,get:function(){return a.MdSubject}}),Object.defineProperty(t,"VjU",{enumerable:!0,get:function(){return a.MdViewHeadline}}),Object.defineProperty(t,"UHp",{enumerable:!0,get:function(){return a.MdAssistant}});var r=s(49385);Object.defineProperty(t,"NK0",{enumerable:!0,get:function(){return r.VscWordWrap}}),Object.defineProperty(t,"qdB",{enumerable:!0,get:function(){return r.VscGoToFile}}),Object.defineProperty(t,"Two",{enumerable:!0,get:function(){return r.VscClose}}),Object.defineProperty(t,"x47",{enumerable:!0,get:function(){return r.VscRegex}}),Object.defineProperty(t,"a2g",{enumerable:!0,get:function(){return r.VscCaseSensitive}});var o=s(70563);Object.defineProperty(t,"v4q",{enumerable:!0,get:function(){return o.GoChevronDown}}),Object.defineProperty(t,"g8U",{enumerable:!0,get:function(){return o.GoChevronUp}}),Object.defineProperty(t,"XCv",{enumerable:!0,get:function(){return o.GoChevronRight}}),Object.defineProperty(t,"b0D",{enumerable:!0,get:function(){return o.GoX}});s(16636);var l=s(91914);Object.defineProperty(t,"Vzd",{enumerable:!0,get:function(){return l.IoFlaskSharp}});var c=s(8799);Object.defineProperty(t,"POq",{enumerable:!0,get:function(){return c.BsGripVertical}}),Object.defineProperty(t,"Cti",{enumerable:!0,get:function(){return c.BsAlignTop}}),Object.defineProperty(t,"w0Y",{enumerable:!0,get:function(){return c.BsAlignMiddle}}),Object.defineProperty(t,"HLb",{enumerable:!0,get:function(){return c.BsAlignBottom}}),Object.defineProperty(t,"eRw",{enumerable:!0,get:function(){return c.BsAlignStart}}),Object.defineProperty(t,"UPo",{enumerable:!0,get:function(){return c.BsAlignCenter}}),Object.defineProperty(t,"B_D",{enumerable:!0,get:function(){return c.BsAlignEnd}}),Object.defineProperty(t,"ppk",{enumerable:!0,get:function(){return c.BsDistributeHorizontal}}),Object.defineProperty(t,"LyQ",{enumerable:!0,get:function(){return c.BsDistributeVertical}});var d=s(77245);Object.defineProperty(t,"HXR",{enumerable:!0,get:function(){return d.BiAtom}});s(30924);var h=s(34543);Object.defineProperty(t,"jtq",{enumerable:!0,get:function(){return h.FiPackage}}),Object.defineProperty(t,"Hrt",{enumerable:!0,get:function(){return h.FiMousePointer}}),Object.defineProperty(t,"tPC",{enumerable:!0,get:function(){return h.FiMove}}),Object.defineProperty(t,"Sd5",{enumerable:!0,get:function(){return h.FiZoomIn}}),Object.defineProperty(t,"xLV",{enumerable:!0,get:function(){return h.FiZoomOut}});s(75100);var u=s(58920);Object.defineProperty(t,"eid",{enumerable:!0,get:function(){return u.TbMathFunction}})},35247:function(e,t,s){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.baseComponents=t.createFilter=t.Select=t.CreatableSelect=void 0;var n=s(54319);Object.defineProperty(t,"CreatableSelect",{enumerable:!0,get:function(){return i(n).default}});var a=s(31776);Object.defineProperty(t,"Select",{enumerable:!0,get:function(){return i(a).default}}),Object.defineProperty(t,"createFilter",{enumerable:!0,get:function(){return a.createFilter}}),Object.defineProperty(t,"baseComponents",{enumerable:!0,get:function(){return a.components}})}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var s=r[e]={id:e,loaded:!1,exports:{}};return a[e].call(s.exports,s,s.exports,o),s.loaded=!0,s.exports}o.m=a,o.amdO={},e=[],o.O=(t,s,i,n)=>{if(!s){var a=1/0;for(d=0;d<e.length;d++){for(var[s,i,n]=e[d],r=!0,l=0;l<s.length;l++)(!1&n||a>=n)&&Object.keys(o.O).every((e=>o.O[e](s[l])))?s.splice(l--,1):(r=!1,n<a&&(a=n));if(r){e.splice(d--,1);var c=i();void 0!==c&&(t=c)}}return t}n=n||0;for(var d=e.length;d>0&&e[d-1][2]>n;d--)e[d]=e[d-1];e[d]=[s,i,n]},o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},s=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,i){if(1&i&&(e=this(e)),8&i)return e;if("object"==typeof e&&e){if(4&i&&e.__esModule)return e;if(16&i&&"function"==typeof e.then)return e}var n=Object.create(null);o.r(n);var a={};t=t||[null,s({}),s([]),s(s)];for(var r=2&i&&e;"object"==typeof r&&!~t.indexOf(r);r=s(r))Object.getOwnPropertyNames(r).forEach((t=>a[t]=()=>e[t]));return a.default=()=>e,o.d(n,a),n},o.d=(e,t)=>{for(var s in t)o.o(t,s)&&!o.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,s)=>(o.f[s](e,t),t)),[])),o.u=e=>"static/"+e+"."+{14:"b63f5ea7",135:"3b62eae4",246:"55fd6716",309:"ca0f7cf5",399:"7ad47fd9",471:"bde04e4b",947:"50215a8f"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},n="@finos/legend-application-pure-ide-deployment:",o.l=(e,t,s,a)=>{if(i[e])i[e].push(t);else{var r,l;if(void 0!==s)for(var c=document.getElementsByTagName("script"),d=0;d<c.length;d++){var h=c[d];if(h.getAttribute("src")==e||h.getAttribute("data-webpack")==n+s){r=h;break}}r||(l=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,o.nc&&r.setAttribute("nonce",o.nc),r.setAttribute("data-webpack",n+s),r.src=e),i[e]=[t];var u=(t,s)=>{r.onerror=r.onload=null,clearTimeout(p);var n=i[e];if(delete i[e],r.parentNode&&r.parentNode.removeChild(r),n&&n.forEach((e=>e(s))),t)return t(s)},p=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),l&&document.head.appendChild(r)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/ide/",(()=>{var e={826:0};o.f.j=(t,s)=>{var i=o.o(e,t)?e[t]:void 0;if(0!==i)if(i)s.push(i[2]);else{var n=new Promise(((s,n)=>i=e[t]=[s,n]));s.push(i[2]=n);var a=o.p+o.u(t),r=new Error;o.l(a,(s=>{if(o.o(e,t)&&(0!==(i=e[t])&&(e[t]=void 0),i)){var n=s&&("load"===s.type?"missing":s.type),a=s&&s.target&&s.target.src;r.message="Loading chunk "+t+" failed.\n("+n+": "+a+")",r.name="ChunkLoadError",r.type=n,r.request=a,i[1](r)}}),"chunk-"+t,t)}},o.O.j=t=>0===e[t];var t=(t,s)=>{var i,n,[a,r,l]=s,c=0;if(a.some((t=>0!==e[t]))){for(i in r)o.o(r,i)&&(o.m[i]=r[i]);if(l)var d=l(o)}for(t&&t(s);c<a.length;c++)n=a[c],o.o(e,n)&&e[n]&&e[n][0](),e[n]=0;return o.O(d)},s=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment=globalThis.webpackChunk_finos_legend_application_pure_ide_deployment||[];s.forEach(t.bind(null,0)),s.push=t.bind(null,s.push.bind(s))})();var l=o.O(void 0,[736],(()=>o(26067)));l=o.O(l)})();
|
2
|
+
//# sourceMappingURL=index.6f5b9fa2.js.map
|