@g1cloud/entity-modeler-next 5.2.49 → 5.2.50
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/editor/controller.d.ts +12 -0
- package/dist/editor/hostSync.d.ts +1 -1
- package/dist/entity-modeler-next.css +1 -1
- package/dist/entity-modeler.js +753 -731
- package/dist/entity-modeler.umd.cjs +6 -6
- package/dist/i18n/ko.d.ts +1 -0
- package/dist/view/opConflictNotice.d.ts +31 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ye,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@g1cloud/open-bluesea-core")):typeof define=="function"&&define.amd?define(["exports","vue","@g1cloud/open-bluesea-core"],t):(ye=typeof globalThis<"u"?globalThis:ye||self,t(ye.EntityModeler={},ye.Vue,ye.OpenBlueseaCore))})(this,(function(ye,t,ne){"use strict";var _P=Object.defineProperty;var EP=(ye,t,ne)=>t in ye?_P(ye,t,{enumerable:!0,configurable:!0,writable:!0,value:ne}):ye[t]=ne;var st=(ye,t,ne)=>EP(ye,typeof t!="symbol"?t+"":t,ne);const ug={startX:40,startY:40,columnGap:280,rowGap:220,perRow:4,defaultSize:{width:220,height:140}};function mg(e,n){const o=e%n.perRow,i=Math.floor(e/n.perRow);return{location:{x:n.startX+o*n.columnGap,y:n.startY+i*n.rowGap},size:{...n.defaultSize}}}function Dc(e,n,o={}){const i={...ug,...o},a=new Map(e.entities.map(b=>[b.modelId,b])),r=new Map(n.entityLayouts.map(b=>[b.entityRef,b])),l=new Map(n.associationLayouts.map(b=>[b.associationRef,b])),s=new Map;for(const b of e.groups)for(const k of b.memberEntityRefs)s.set(k,b.modelId);const c=new Map;for(const b of n.groupLayouts)for(const k of b.memberNoteRefs??[])c.set(k,b.groupRef);let d=0;const u=e.entities.map(b=>{const k=s.get(b.modelId),_=r.get(b.modelId);if(_){const C={location:{x:_.geo.location.x,y:_.geo.location.y},size:{width:_.geo.size.width,height:_.geo.size.height}};return{entity:b,geo:C,collapsed:_.collapsed??!1,locked:_.locked??!1,groupRef:k,style:_.style,attributeStyles:_.attributeStyles,operationStyles:_.operationStyles}}const h=mg(d++,i);return{entity:b,geo:h,collapsed:!1,locked:!1,groupRef:k}}),m=new Map(n.groupLayouts.map(b=>[b.groupRef,b])),f=e.groups.map(b=>{const k=m.get(b.modelId),_=k?{location:{x:k.geo.location.x,y:k.geo.location.y},size:{width:k.geo.size.width,height:k.geo.size.height}}:{location:{x:0,y:0},size:{width:400,height:300}};return{group:b,geo:_,style:k==null?void 0:k.style,locked:(k==null?void 0:k.locked)??!1}}),p=e.associations.map(b=>{const k=l.get(b.modelId);return{association:b,waypoints:(k==null?void 0:k.waypoints)??[],sourceColumnRef:k==null?void 0:k.sourceColumnRef,targetColumnRef:k==null?void 0:k.targetColumnRef}}),y=n.notes.map(b=>({note:{...b,geo:{location:{x:b.geo.location.x,y:b.geo.location.y},size:{width:b.geo.size.width,height:b.geo.size.height}}},groupRef:c.get(b.modelId)})),g=[];for(const b of n.notes)for(const k of b.connections??[])a.has(k.targetRef)&&g.push({noteRef:b.modelId,targetRef:k.targetRef,waypoints:k.waypoints.map(_=>({x:_.x,y:_.y}))});return{entities:u,associations:p,groups:f,notes:y,noteConnections:g}}const Oc={cellWidth:260,cellHeight:200,pad:24,headerHeight:28,ungroupedCols:4};function Pc(e,n,o={}){const i={...Oc,...o},a=new Map(n.groupLayouts.map(u=>[u.groupRef,u.geo])),r=[];let l=0;for(const u of e.groups){const m=a.get(u.modelId),f=m?m.location:{x:0,y:0},p=m?m.size.width:800;m&&(l=Math.max(l,m.location.y+m.size.height));const y=Math.max(1,Math.floor((p-i.pad*2)/i.cellWidth));u.memberEntityRefs.forEach((g,b)=>{const k=b%y,_=Math.floor(b/y);r.push({id:g,location:{x:f.x+i.pad+k*i.cellWidth,y:f.y+i.pad+i.headerHeight+_*i.cellHeight}})})}const s=new Set(e.groups.flatMap(u=>u.memberEntityRefs)),c=e.entities.filter(u=>!s.has(u.modelId)),d=l>0?l+40:i.pad;return c.forEach((u,m)=>{const f=m%i.ungroupedCols,p=Math.floor(m/i.ungroupedCols);r.push({id:u.modelId,location:{x:i.pad+f*i.cellWidth,y:d+p*i.cellHeight}})}),r}const zc={cols:5,boxWidth:200,gap:60,baseX:0,baseY:0,headerHeight:48,rowHeight:24,footerHeight:16,minHeight:120};function fg(e,n={}){const o={...zc,...n},i=o.headerHeight+Math.max(0,e)*o.rowHeight+o.footerHeight;return Math.max(o.minHeight,i)}function rl(e,n={}){const o={...zc,...n},i=Math.max(1,o.cols),a=new Array(i).fill(o.baseY);return e.map((r,l)=>{const s=l%i,c=fg(r.attributeCount,o),d=o.baseX+s*(o.boxWidth+o.gap),u=a[s];return a[s]=u+c+o.gap,{id:r.id,location:{x:d,y:u},size:{width:o.boxWidth,height:c}}})}function Fc(e,n,o={}){const i=o.step??Oc.headerHeight,a=o.maxSteps??32,r=l=>n.some(s=>Math.abs(s.x-l.x)<i&&Math.abs(s.y-l.y)<i);for(let l=0;l<=a;l++){const s={x:e.x+l*i,y:e.y+l*i};if(!r(s))return s}return{x:e.x+a*i,y:e.y+a*i}}function so(e){const n=new Map,o=new Map;for(const i of e){o.set(i.modelId,i),i.dbAttrs.length===1&&n.set(i.modelId,i.dbAttrs[0]);for(const a of i.dbAttrs)n.set(a.modelId,a),o.set(a.modelId,i)}return{attributeOf:i=>o.get(i),columnOf:i=>n.get(i),canon:i=>{var a;return((a=n.get(i))==null?void 0:a.modelId)??i}}}function Uc(e,n){const o=e.attributeOf(n);if(!o)return n;const i=o.name||"(이름 없음)";if(o.dbAttrs.length<=1)return i;const a=e.columnOf(n);if(!a)return`${i}(컬럼 ${o.dbAttrs.length}개 중 미지정)`;const r=o.dbAttrs.findIndex(l=>l.modelId===a.modelId);return`${i}.${a.physicalName||`#${r+1}`}`}const pg={UNDEFINED:"Undefined",JPA_ENTITY:"Entity",JPA_EMBEDDABLE:"Embeddable",JPA_MULTI_LANGUAGE_ENTITY:"MultiLanguageEntity",SERIALIZED_TYPE:"Serialized"};function gi(e){return pg[e]??e}function lt(e){return e==="JPA_EMBEDDABLE"||e==="SERIALIZED_TYPE"}function mn(e){return e==="SERIALIZED_TYPE"}const ya="inherited:";function Hc(e,n){return`${ya}${e}:${n}`}function co(e){return e.startsWith(ya)}function ll(e){if(!co(e))return null;const n=e.slice(ya.length),o=n.indexOf(":");if(o<0)return null;const i=n.slice(0,o),a=n.slice(o+1);return!i||!a?null:{baseClass:i,field:a}}function bi(e,n){var a;if(lt(e.stereotype))return[];if(n.some(r=>r.name===e.name))return[];const o=e.superClass||((a=n.find(r=>r.default))==null?void 0:a.name);if(!o)return[];const i=n.find(r=>r.name===o);return i?i.columns.map(r=>({modelId:Hc(i.name,r.field),baseClass:i.name,field:r.field,physicalName:r.physicalName,dataType:r.dataType,logicalName:r.logicalName,length:r.length,scale:r.scale})):[]}function ki(e){return e.attrType.startsWith("RELATION")&&e.dbAttrs.length>0}function vn(e){return e.attrType==="RELATION_OWN"&&e.dbAttrs.length>1}function sl(e){const n=new Set;for(const o of e)o.end2.attributeRef&&n.add(o.end2.attributeRef),o.end1.attributeRef&&o.end1.navigable&&n.add(o.end1.attributeRef);return n}function cl(e,n,o){var a;if(e.attrType!=="RELATION_OWN"||o.has(e.modelId))return!1;const i=(a=e.derivedFrom)==null?void 0:a.associationRef;return i?n.attributes.some(r=>{var l;return r.modelId!==e.modelId&&r.attrType==="RELATION_OWN"&&((l=r.derivedFrom)==null?void 0:l.associationRef)===i&&o.has(r.modelId)}):!1}function ga(e,n,o,i,a=0){var d;if(!ki(e))return;const r=i.find(u=>u.end1.attributeRef===e.modelId||u.end2.attributeRef===e.modelId),l=n==null?void 0:n.modelId,s=r?o.find(u=>u.modelId===(r.end1.entityRef===l?r.end2.entityRef:r.end1.entityRef)):void 0,c=(d=e.derivedFrom)==null?void 0:d.sourceAttributeRef;if(c){const u=s==null?void 0:s.attributes.find(m=>m.modelId===c);if(u!=null&&u.dbAttrs[a])return u.dbAttrs[a];if(u)return Yn(s)[a];for(const m of o){const f=m.attributes.find(p=>p.modelId===c);if(f)return f.dbAttrs[a]??Yn(s)[a]}}if(s)return Yn(s)[a]}function dl(e){return e.identifier?e.attrType==="NORMAL"||e.attrType==="RELATION_OWN"?!0:jc(e):!1}function jc(e){return e.identifier===!0&&(e.attrType==="EMBED_PREDEF"||e.attrType==="EMBED_OWN")&&e.dbAttrs.length>0}function Yn(e){return((e==null?void 0:e.attributes)??[]).filter(dl).slice().sort((n,o)=>n.order-o.order).flatMap(n=>n.dbAttrs)}const Kc={attr:["identifier","notNull"],column:["dataType","length","scale"]},Gc={attr:["transient","naturalId","defaultValue","personalInfoAttributeType"],column:["unique","autoIncrement","multiValue","notNull"]},qn=["ko","en","ja","zh"],ul=e=>e==null||e.trim()==="";function fn(e){return e!=null&&Object.values(e).some(n=>!ul(n))}function Yc(e){if(e==null)return;const n=Object.keys(e),o=n.filter(a=>!ul(e[a]));if(o.length===0)return;if(o.length===n.length)return e;const i={};for(const a of o)i[a]=e[a];return i}function hg(e){return e==null?!0:typeof e!="object"||Array.isArray(e)?!1:Object.entries(e).every(([n,o])=>qn.includes(n)&&(o==null||typeof o=="string"))}function Ct(e,n){if(e==null)return;const o=n?[n,...qn.filter(i=>i!==n)]:qn;for(const i of o){const a=e[i];if(!ul(a))return a}}function yg(e,n,o){var i,a,r,l;if(e.attrType==="EMBED_PREDEF"){const s=(a=(i=n==null?void 0:n.embeddableCatalog)==null?void 0:i.find(c=>c.type===e.type))==null?void 0:a.fields;return e.dbAttrs.map((c,d)=>{var u;return((u=s==null?void 0:s[d])==null?void 0:u.name)||void 0})}if(e.attrType==="EMBED_OWN"){const s=(r=e.embedded)==null?void 0:r.embeddableRef,c=s!=null?(l=n==null?void 0:n.entities)==null?void 0:l.find(u=>u.modelId===s):void 0,d=qc(c,n,o);return d.length!==e.dbAttrs.length?e.dbAttrs.map(()=>{}):d.map(u=>u.propertyPath||void 0)}}function Cn(e,n){return qc(e,n,new Set)}function qc(e,n,o){if(e==null||o.has(e.modelId))return[];const i=new Set(o).add(e.modelId);return e.attributes.flatMap(a=>{var c,d;const r=yg(a,n,i),l=a.name??"",s=a.attrType==="EMBED_PREDEF"?(d=(c=n==null?void 0:n.embeddableCatalog)==null?void 0:c.find(u=>u.type===a.type))==null?void 0:d.fields:void 0;return a.dbAttrs.map((u,m)=>{var f;return{col:u,ownerAttr:a,ownerIndex:m,propertyPath:l?r===void 0?a.dbAttrs.length>1?"":l:r[m]?`${l}.${r[m]}`:"":"",defaultPhysical:u.physicalName||(u.sharedColumnRef==null?((f=s==null?void 0:s[m])==null?void 0:f.physicalName)??"":""),...u.sharedColumnRef!=null?{defaultSharedRef:u.sharedColumnRef}:{},ownColumn:!!u.physicalName&&u.sharedColumnRef==null}})})}const ba=e=>e==null||e.trim()==="";function Wc(e,n,o,i,a,r){var l,s,c;if(e.attrType==="EMBED_PREDEF")return(s=(l=a==null?void 0:a.embeddableCatalog)==null?void 0:l.find(d=>d.type===e.type))==null?void 0:s.fields[n];if(e.attrType==="EMBED_OWN"){const d=(c=e.embedded)==null?void 0:c.embeddableRef;if(d==null||r.has(d))return;const u=i.entities.find(_=>_.modelId===d),m=Cn(u,{entities:i.entities,embeddableCatalog:a==null?void 0:a.embeddableCatalog}),f=m[n];if(f==null)return;const p=ba(f.col.dataType),y=e.dbAttrs.length===m.length,g=y&&ba(f.col.physicalName)&&f.col.sharedColumnRef==null,b=y&&!fn(f.col.logicalName);if(!p&&!g&&!b)return f.col;const k=Xc(f.ownerAttr,f.col,f.ownerIndex,u,i,a,new Set(r).add(d));return{...f.col,...p?{dataType:k.dataType,length:k.length,scale:k.scale}:{},...g&&!ba(k.physicalName)?{physicalName:k.physicalName}:{},...b&&fn(k.logicalName)?{logicalName:k.logicalName}:{}}}if(e.attrType.startsWith("RELATION"))return ga(e,o,i.entities,i.associations,n)}function Lt(e,n,o,i,a,r){return Xc(e,n,o,i,a,r,Jc)}const Jc=new Set;function Xc(e,n,o,i,a,r,l){const s=Wc(e,o,i,a,r,l);return s?{...n,physicalName:n.physicalName||s.physicalName||"",dataType:n.dataType||s.dataType||"",length:n.length??s.length,scale:n.scale??s.scale,logicalName:fn(n.logicalName)?n.logicalName:s.logicalName,...n.sharedColumnRef==null&&!n.physicalName&&s.sharedColumnRef!=null&&(e.attrType==="EMBED_OWN"||e.attrType==="EMBED_PREDEF")?{sharedColumnRef:s.sharedColumnRef}:{}}:n}function uo(e,n){return((n==null?void 0:n.notNull)??e.notNull)===!0}function Sn(e){var n,o;return fn((n=e.table)==null?void 0:n.logicalName)?(o=e.table)==null?void 0:o.logicalName:e.classLogicalName}function jo(e,n){return fn(n==null?void 0:n.logicalName)?n==null?void 0:n.logicalName:e.fieldLogicalName}function _i(e,n,o,i,a,r){var l;return ba(n.physicalName)?((l=Wc(e,o,i,a,r,Jc))==null?void 0:l.physicalName)??"":n.physicalName}function Zc(e,n,o,i){var a,r,l,s;if(e.attrType==="EMBED_PREDEF")return((l=(r=(a=i==null?void 0:i.embeddableCatalog)==null?void 0:a.find(c=>c.type===e.type))==null?void 0:r.fields[n])==null?void 0:l.name)||void 0;if(e.attrType==="EMBED_OWN"){const c=(s=e.embedded)==null?void 0:s.embeddableRef;if(c==null)return;const d=o.entities.find(m=>m.modelId===c);if(!d)return;let u=0;for(const m of d.attributes)for(let f=0;f<m.dbAttrs.length;f++){if(u===n)return m.name||void 0;u++}}}function Qc(e){return typeof e=="object"&&e!==null?e:void 0}const ed=["physicalName","dataType","length","scale","logicalName"],td=e=>e!=null&&e!==""&&!(typeof e=="object"&&Object.keys(e).length===0);function nd(e,n){return e?ed.filter(o=>o==="physicalName"&&n.sharedColumnRef!=null?!1:!td(e[o])&&td(n[o])):[]}function Wn(e){return e.referenceOnly===!0}function ml(e){const n=new Set;for(const o of e.entities)Wn(o)&&n.add(o.modelId);return n}function od(e){return e.entities.filter(n=>!Wn(n))}function id(e,n=ml(e)){return n.size===0?e.associations:e.associations.filter(o=>!n.has(o.end1.entityRef)&&!n.has(o.end2.entityRef))}function fl(e,n){return n?{...e,entities:e.entities.map(o=>o.referenceOnly?o:{...o,referenceOnly:!0})}:e}function gg(e,n){return Wn(e)||n===!0}function pl(e,n){if(e.stereotype!=="JPA_EMBEDDABLE")return[e];const o=n.filter(i=>i.modelId!==e.modelId&&i.attributes.some(a=>{var r;return a.attrType==="EMBED_OWN"&&((r=a.embedded)==null?void 0:r.embeddableRef)===e.modelId}));return[e,...o]}function Rn(e,n){return pl(e,n).flatMap(o=>o.attributes.flatMap(i=>i.dbAttrs))}function mo(e){const n=new Map;for(const o of e)n.set(o.modelId,o);return n}function fo(e,n){if(e.sharedColumnRef==null)return null;const o=n.get(e.sharedColumnRef);return o?{physicalName:o.physicalName,insertable:!1,updatable:!1}:null}function Ko(e,n){if(e.packageName)return{kind:"explicit",value:e.packageName};const o=n.groups.find(i=>{var a;return(a=i.memberEntityRefs)==null?void 0:a.includes(e.modelId)});return{kind:"group",value:(o==null?void 0:o.packageName)??""}}function bg(e,n,o){const i=Ko(e,o),a=Ko(n,o);return i.kind===a.kind&&i.value!==a.value}function Go(e){const n=new Map;for(const o of e.entities){if(o.stereotype!=="SERIALIZED_TYPE"||!o.name)continue;const i=n.get(o.name);i?i.push(o):n.set(o.name,[o])}return n}function ad(e,n){var i,a;const o=(i=n==null?void 0:n.serialization)==null?void 0:i.collectionType;if(!o)return e;if(o==="MAP"){const r=(a=n==null?void 0:n.serialization)==null?void 0:a.mapKeyType;return`Map<${r&&r.trim()?r.slice(r.lastIndexOf(".")+1):"?"}, ${e}>`}return`${o==="SET"?"Set":"List"}<${e}>`}function Ei(e,n,o,i){if(n.size===0)return{kind:"none"};const a=n.has(e.type)?e.type:e.customType&&n.has(e.customType)?e.customType:void 0;if(!a)return{kind:"none"};const r=n.get(a);if(r.length===1)return{kind:"resolved",entity:r[0]};if(o&&i){const l=Ko(o,i),s=r.filter(c=>{const d=Ko(c,i);return d.kind===l.kind&&d.value===l.value});if(s.length===1)return{kind:"resolved",entity:s[0]}}return{kind:"ambiguous",name:a,candidates:r}}const rd=["BIT","TINYINT","SMALLINT","INTEGER","BIGINT","FLOAT","REAL","DOUBLE","NUMERIC","DECIMAL","CHAR","VARCHAR","LONGVARCHAR","DATE","TIME","TIMESTAMP","BINARY","VARBINARY","LONGVARBINARY","NULL","OTHER","JAVA_OBJECT","DISTINCT","STRUCT","ARRAY","BLOB","CLOB","REF","DATALINK","BOOLEAN","ROWID","NCHAR","NVARCHAR","LONGNVARCHAR","NCLOB","SQLXML","REF_CURSOR","TIME_WITH_TIMEZONE","TIMESTAMP_WITH_TIMEZONE","SERIAL","BIG_SERIAL","JSONB"],kg=new Set(["NULL","OTHER","JAVA_OBJECT","DISTINCT","STRUCT","ARRAY","REF","DATALINK","ROWID","REF_CURSOR","NCHAR","NVARCHAR","LONGNVARCHAR","NCLOB","SQLXML","TIME_WITH_TIMEZONE","BIT","TINYINT","FLOAT"]),_g=rd.filter(e=>!kg.has(e)),Eg={TIMESTAMP_WITH_TIMEZONE:"TIMESTAMP WITH TIME ZONE",BIG_SERIAL:"BIGSERIAL",DOUBLE:"DOUBLE PRECISION"};function hl(e){return Eg[e]??e}const Ng=new Set(["CHAR","VARCHAR","NCHAR","NVARCHAR","BINARY","VARBINARY","NUMERIC","DECIMAL"]),yl=new Set(["NUMERIC","DECIMAL"]),gl=new Set(["TINYINT","SMALLINT","INTEGER","BIGINT","FLOAT","REAL","DOUBLE","NUMERIC","DECIMAL","SERIAL","BIG_SERIAL"]);function ld(e,n=_g){const o=[...n];return e&&!o.includes(e)?[e,...o]:o}const pn="CustomType";function sd(e){var o;if(e.type!==pn)return;const n=(o=e.customType)==null?void 0:o.trim();return n||void 0}const An="GroupCodeEnum",bl="String",Ni=[{value:"String",label:"String"},{value:"Integer",label:"Integer"},{value:"Long",label:"Long"},{value:"Double",label:"Double"},{value:"Boolean",label:"Boolean"},{value:"Date",label:"Date"},{value:"LocalDate",label:"LocalDate"},{value:"LocalDateTime",label:"LocalDateTime"},{value:"Instant",label:"Instant"},{value:"ZonedDateTime",label:"ZonedDateTime"},{value:"OffsetDateTime",label:"OffsetDateTime"},{value:"BigDecimal",label:"BigDecimal"},{value:"BigInteger",label:"BigInteger"},{value:"Currency",label:"Currency"},{value:"ByteArray",label:"Byte[]"},{value:"CharacterArray",label:"Character[]"},{value:"Short",label:"Short"},{value:"PrimitiveInt",label:"int",boxed:"Integer"},{value:"PrimitiveLong",label:"long",boxed:"Long"},{value:"PrimitiveDouble",label:"double",boxed:"Double"},{value:"PrimitiveBoolean",label:"boolean",boxed:"Boolean"},{value:"PrimitiveShort",label:"short",boxed:"Short"},{value:"PrimitiveByteArray",label:"byte[]",boxed:"Byte[]"},{value:"PrimitiveCharacterArray",label:"char[]",boxed:"Character[]"},{value:An,label:"GroupCodeEnum"},{value:"CustomMoneyType",label:"Money"},{value:pn,label:"CustomType"}],wg=new Map(Ni.map(e=>[e.value,e.label]));function Yo(e){return wg.get(e)??e}const Ig={TINYINT:"Short",SMALLINT:"Short",INTEGER:"Integer",BIGINT:"Long",SERIAL:"Integer",BIG_SERIAL:"Long",FLOAT:"Double",REAL:"Double",DOUBLE:"Double",NUMERIC:"BigDecimal",DECIMAL:"BigDecimal",CHAR:"String",VARCHAR:"String",LONGVARCHAR:"String",NCHAR:"String",NVARCHAR:"String",LONGNVARCHAR:"String",CLOB:"String",NCLOB:"String",BIT:"Boolean",BOOLEAN:"Boolean",DATE:"LocalDate",TIMESTAMP:"LocalDateTime",TIMESTAMP_WITH_TIMEZONE:"OffsetDateTime",BINARY:"ByteArray",VARBINARY:"ByteArray",LONGVARBINARY:"ByteArray",BLOB:"ByteArray"};function cd(e){if(e)return Ig[e.toUpperCase()]}const vg={String:new Set(["VARCHAR","CHAR","LONGVARCHAR","CLOB","NCHAR","NVARCHAR","LONGNVARCHAR","NCLOB","JSONB"]),CharacterArray:new Set(["CHAR","VARCHAR","LONGVARCHAR","CLOB"]),Integer:new Set(["INTEGER","SERIAL","SMALLINT","NUMERIC","DECIMAL"]),Long:new Set(["BIGINT","BIG_SERIAL","NUMERIC","DECIMAL"]),Short:new Set(["SMALLINT","TINYINT","NUMERIC","DECIMAL"]),Double:new Set(["DOUBLE","FLOAT","REAL","NUMERIC","DECIMAL"]),BigDecimal:new Set(["NUMERIC","DECIMAL"]),BigInteger:new Set(["NUMERIC","DECIMAL","BIGINT"]),Boolean:new Set(["BOOLEAN","BIT","CHAR","VARCHAR"]),Date:new Set(["DATE","TIME","TIMESTAMP","TIMESTAMP_WITH_TIMEZONE"]),LocalDate:new Set(["DATE"]),LocalDateTime:new Set(["TIMESTAMP"]),Instant:new Set(["TIMESTAMP","TIMESTAMP_WITH_TIMEZONE"]),ZonedDateTime:new Set(["TIMESTAMP_WITH_TIMEZONE","TIMESTAMP"]),OffsetDateTime:new Set(["TIMESTAMP_WITH_TIMEZONE","TIMESTAMP"]),ByteArray:new Set(["BINARY","VARBINARY","LONGVARBINARY","BLOB"]),Currency:new Set(["VARCHAR","CHAR"]),[An]:new Set(["VARCHAR","CHAR"])},dd=new Map(Ni.filter(e=>e.boxed).map(e=>[e.value,e.boxed]));function Cg(e,n,o){const i=e==null?void 0:e.trim(),a=n==null?void 0:n.trim();if(!i||!a||!rd.includes(a))return;const r=dd.get(i)??i,l=vg[r];if(l)return l.has(a);const s=o==null?void 0:o.find(c=>c.type===i);if(s!=null&&s.dataType)return s.dataType.trim()===a}function Sg(e){return e?dd.get(e):void 0}const Rg=new Set(["VARCHAR","CHAR"]);function ud(e,n,o){return o||!n||!Rg.has(n)?null:e==="PrimitiveBoolean"?"primitive":e==="Boolean"?"boxed":null}const Ag=new Set(["PrimitiveInt","PrimitiveLong","PrimitiveDouble","PrimitiveShort"]);function xg(e,n,o){return o||!e?!1:Ag.has(e)?!0:e==="PrimitiveBoolean"?ud(e,n,o)==null:!1}const $g=new Set([An,"CustomMoneyType"]),md=Ni.filter(e=>!$g.has(e.value)).map(e=>e.value===pn?{...e,label:"CustomType (사용자정의)"}:e);function fd(e,n=[],o=[],i=[]){const a=n.map(c=>{const d=Ct(c.label);return{value:c.type,label:d?`${c.type} (${d})`:c.type}}),r=o.map(c=>({value:c,label:c})),l=i.map(c=>{const d=Ct(c.label);return{value:c.type,label:d?`${c.type} (${d})`:c.type}}),s=[...md,...a,...r,...l];return e&&!s.some(c=>c.value===e)?[{value:e,label:Yo(e)},...s]:s}function kl(e){return e.attrType==="EMBED_PREDEF"?"structural":e.attrType==="EMBED_OWN"||e.attrType==="EMBED_REF"?"association":e.attrType.startsWith("RELATION")?"derived":"own"}function pd(e,n,o){return n===e.type?!1:kl(e)!=="own"||o.some(i=>i.type===n)}function Tg(e,n,o){if(!n||n===e.type||e.attrType!=="NORMAL"&&e.attrType!=="EMBED_PREDEF")return;const i=o.find(a=>a.type===n);if(i)return i.fields.length===e.dbAttrs.length?i:void 0}function ka(e,n){return e===An!=!!n}function hd(e,n){return{...e,dataType:n.dataType,length:n.length,scale:n.scale}}function Mg(e){return e.attrType.startsWith("EMBED")&&e.dbAttrs.length>0}function wi(e,n){var r;if(!e.embedded||!e.attrType.startsWith("EMBED"))return;const o=n.find(l=>l.modelId===e.embedded.associationRef);if(!o)return;const i=o.end2.entityRef===e.embedded.embeddableRef?o.end2:o.end1;if(i.multiplicity==="ZERO_OR_MORE_INSTANCES"||i.multiplicity==="ONE_OR_MORE_INSTANCES")return((r=i.jpa)==null?void 0:r.collectionType)??"LIST"}function _l(e,n,o,i,a){var r;if(n.attrType==="DIVIDER"||e==="LOGICAL")return"";if((e==="CLASS"||vn(n))&&n.attrType.startsWith("RELATION")&&i)return o?`${o==="SET"?"Set":"List"}<${i}>`:i;if(o&&n.attrType.startsWith("EMBED"))return`${o==="SET"?"Set":"List"}<${Yo(n.type)}>`;if(Mg(n))return Yo(n.type);if(e==="CLASS"){const l=sd(n)??Yo(n.type);return a?ad(l,a):l}return hl(((r=n.dbAttrs[0])==null?void 0:r.dataType)??"")}function _a(e,n,o,i,a="(논리명)"){switch(e){case"CLASS":return n;case"PHYSICAL":return i||n;case"LOGICAL":return o||a;default:return i?`${o||a} · ${i}`:o||a}}const El="(미지정)",Vg="(이름 없음)",Ea=e=>e==null||String(e).trim()==="",qo=e=>Ea(e)?Vg:String(e),yd=e=>Ea(e)?El:String(e);function gd(e){switch(e){case"NO_INSTANCE_OR_ONE_INSTANCE":return"0..1";case"EXACTLY_ONE_INSTANCE":return"1";case"ZERO_OR_MORE_INSTANCES":return"0..*";case"ONE_OR_MORE_INSTANCES":return"1..*"}return El}function bd(e,n){const o=e.length?`(${e.length}${e.scale!=null?`,${e.scale}`:""})`:"",i=Ea(n)?yd(e.physicalName):String(n),a=Ea(e.dataType)?"":String(e.dataType).trim();return a?`${i} ${a}${o}`:i}function Nl(e){const n=(Ct(e)??"").trim();return n?` «${n}»`:""}function wl(e){const n=(Ct(e)??"").trim();return n?` — ${n}`:""}function kd(e,n){const o=nd(n,e);return[e.unique?"UNIQUE":"",e.autoIncrement?"AUTO_INCREMENT":"",e.sharedColumnRef?"SHARED":"",e.updatable===void 0?"":`updatable=${e.updatable}`,e.multiValue?`multiValue${e.multiValueSeparator?`='${e.multiValueSeparator}'`:""}`:"",o.length?`inherited=${o.join(",")}`:""].filter(Boolean)}function _d(e,n){var l,s,c,d;const o=new Map(e.entities.map(u=>[u.modelId,u.name])),i=new Map;for(const u of e.groups)for(const m of u.memberEntityRefs)i.set(m,u.packageName||(Ct(u.name)??u.modelId));const a=[];for(const u of e.entities){const m=(l=u.table)!=null&&l.physicalName?` (${u.table.physicalName})`:"",f=i.get(u.modelId),p=[Wn(u)?"REFERENCE_ONLY":"",(s=u.jpaAttrs)!=null&&s.useVersion?"VERSIONED":""].filter(Boolean);a.push(`## ${qo(u.name)}${m} «${gi(u.stereotype)}»${f?` [${f}]`:""}${p.length?` {${p.join(", ")}}`:""}${Nl(Sn(u))}`);const y=mo(Rn(u,e.entities)),g=h=>{var C;return h.sharedColumnRef?(C=fo(h,y))==null?void 0:C.physicalName:void 0},b=[...u.attributes].sort((h,C)=>h.order-C.order);for(const h of b){if(h.attrType==="DIVIDER"){a.push(` ${"─".repeat(8)}${h.name?` ${h.name} ${"─".repeat(8)}`:""}`);continue}const C=h.dbAttrs.map((D,E)=>Lt(h,D,E,u,e,n)),v=[h.attrType==="NORMAL"?"":h.attrType,h.identifier?"PK":"",h.notNull&&!mn(u.stereotype)?"NOT NULL":"",(c=h.defaultValue)!=null&&c.trim()?`default=${h.defaultValue.trim()}`:"",(d=h.groupCode)!=null&&d.trim()?`groupCode=${h.groupCode.trim()}`:""].filter(Boolean),S=Ei(h,Go(e),u,e),N=sd(h)??h.type,A=S.kind==="resolved"?ad(N,S.entity):yd(N),T=` - ${qo(h.name)}: ${A}`,O=D=>D.length?` {${D.join(", ")}}`:"";if(C.length>1){a.push(`${T}${O(v)}${wl(h.description)}`),C.forEach((D,E)=>{const R=Zc(h,E,e,n);a.push(` · ${R?`${R} → `:""}${bd(D,g(D))}${O(kd(D,h.dbAttrs[E]))}${Nl(D.logicalName)}`)});continue}const z=C[0],P=z?` → ${bd(z,g(z))}`:"";a.push(`${T}${P}${O([...v,...z?kd(z,h.dbAttrs[0]):[]])}${Nl(jo(h,z))}${wl(h.description)}`)}const k=so(u.attributes);for(const h of u.indexes??[]){const C=h.columns.map(v=>{var S,N;return`${((S=k.attributeOf(v.columnRef))==null?void 0:S.name)??((N=ll(v.columnRef))==null?void 0:N.field)??v.columnRef}${v.descending?" DESC":""}`}).join(", ");a.push(` index ${qo(h.name)}${h.unique?" UNIQUE":""}: ${C}`)}const _=[...u.operations??[]].sort((h,C)=>h.order-C.order);for(const h of _){const C=h.visibility?` {${h.visibility}}`:"";a.push(` method ${qo(h.name)}()${C}${wl(h.description)}`)}a.push("")}const r=e.groups.filter(u=>(u.memberEntityRefs??[]).length===0);if(r.length){a.push("# 빈 그룹 (멤버 0 — `[그룹]` 태그로는 안 보인다)");for(const u of r)a.push(` ${qo(u.packageName||Ct(u.name))}`)}if(e.associations.length){a.push("# 관계");const u=new Map;for(const f of e.entities)u.set(f.modelId,new Map(f.attributes.map(p=>[p.modelId,p.name])));const m=(f,p,y)=>{var k,_;if(!f.navigable)return"";const g=f.attributeRef,b=g?((k=u.get(f.entityRef))==null?void 0:k.get(g))??((_=u.get(p.entityRef))==null?void 0:_.get(g)):void 0;return`${y}.nav=${b===void 0?El:qo(b)}`};for(const f of e.associations){const p=o.get(f.end1.entityRef)??f.end1.entityRef,y=o.get(f.end2.entityRef)??f.end2.entityRef,g=f.end2.composition||f.end1.composition?" (composition)":"",b=[m(f.end1,f.end2,"from"),m(f.end2,f.end1,"to")].filter(Boolean),k=b.length?` {${b.join(", ")}}`:"";a.push(` ${p} ${gd(f.end1.multiplicity)} —— ${gd(f.end2.multiplicity)} ${y}${g}${k}`)}}return a.join(`
|
|
1
|
+
(function(ye,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("vue"),require("@g1cloud/open-bluesea-core")):typeof define=="function"&&define.amd?define(["exports","vue","@g1cloud/open-bluesea-core"],t):(ye=typeof globalThis<"u"?globalThis:ye||self,t(ye.EntityModeler={},ye.Vue,ye.OpenBlueseaCore))})(this,(function(ye,t,ne){"use strict";var NP=Object.defineProperty;var wP=(ye,t,ne)=>t in ye?NP(ye,t,{enumerable:!0,configurable:!0,writable:!0,value:ne}):ye[t]=ne;var st=(ye,t,ne)=>wP(ye,typeof t!="symbol"?t+"":t,ne);const ug={startX:40,startY:40,columnGap:280,rowGap:220,perRow:4,defaultSize:{width:220,height:140}};function mg(e,n){const o=e%n.perRow,i=Math.floor(e/n.perRow);return{location:{x:n.startX+o*n.columnGap,y:n.startY+i*n.rowGap},size:{...n.defaultSize}}}function Dc(e,n,o={}){const i={...ug,...o},a=new Map(e.entities.map(b=>[b.modelId,b])),r=new Map(n.entityLayouts.map(b=>[b.entityRef,b])),l=new Map(n.associationLayouts.map(b=>[b.associationRef,b])),s=new Map;for(const b of e.groups)for(const k of b.memberEntityRefs)s.set(k,b.modelId);const c=new Map;for(const b of n.groupLayouts)for(const k of b.memberNoteRefs??[])c.set(k,b.groupRef);let d=0;const u=e.entities.map(b=>{const k=s.get(b.modelId),_=r.get(b.modelId);if(_){const C={location:{x:_.geo.location.x,y:_.geo.location.y},size:{width:_.geo.size.width,height:_.geo.size.height}};return{entity:b,geo:C,collapsed:_.collapsed??!1,locked:_.locked??!1,groupRef:k,style:_.style,attributeStyles:_.attributeStyles,operationStyles:_.operationStyles}}const h=mg(d++,i);return{entity:b,geo:h,collapsed:!1,locked:!1,groupRef:k}}),m=new Map(n.groupLayouts.map(b=>[b.groupRef,b])),f=e.groups.map(b=>{const k=m.get(b.modelId),_=k?{location:{x:k.geo.location.x,y:k.geo.location.y},size:{width:k.geo.size.width,height:k.geo.size.height}}:{location:{x:0,y:0},size:{width:400,height:300}};return{group:b,geo:_,style:k==null?void 0:k.style,locked:(k==null?void 0:k.locked)??!1}}),p=e.associations.map(b=>{const k=l.get(b.modelId);return{association:b,waypoints:(k==null?void 0:k.waypoints)??[],sourceColumnRef:k==null?void 0:k.sourceColumnRef,targetColumnRef:k==null?void 0:k.targetColumnRef}}),y=n.notes.map(b=>({note:{...b,geo:{location:{x:b.geo.location.x,y:b.geo.location.y},size:{width:b.geo.size.width,height:b.geo.size.height}}},groupRef:c.get(b.modelId)})),g=[];for(const b of n.notes)for(const k of b.connections??[])a.has(k.targetRef)&&g.push({noteRef:b.modelId,targetRef:k.targetRef,waypoints:k.waypoints.map(_=>({x:_.x,y:_.y}))});return{entities:u,associations:p,groups:f,notes:y,noteConnections:g}}const Oc={cellWidth:260,cellHeight:200,pad:24,headerHeight:28,ungroupedCols:4};function Pc(e,n,o={}){const i={...Oc,...o},a=new Map(n.groupLayouts.map(u=>[u.groupRef,u.geo])),r=[];let l=0;for(const u of e.groups){const m=a.get(u.modelId),f=m?m.location:{x:0,y:0},p=m?m.size.width:800;m&&(l=Math.max(l,m.location.y+m.size.height));const y=Math.max(1,Math.floor((p-i.pad*2)/i.cellWidth));u.memberEntityRefs.forEach((g,b)=>{const k=b%y,_=Math.floor(b/y);r.push({id:g,location:{x:f.x+i.pad+k*i.cellWidth,y:f.y+i.pad+i.headerHeight+_*i.cellHeight}})})}const s=new Set(e.groups.flatMap(u=>u.memberEntityRefs)),c=e.entities.filter(u=>!s.has(u.modelId)),d=l>0?l+40:i.pad;return c.forEach((u,m)=>{const f=m%i.ungroupedCols,p=Math.floor(m/i.ungroupedCols);r.push({id:u.modelId,location:{x:i.pad+f*i.cellWidth,y:d+p*i.cellHeight}})}),r}const zc={cols:5,boxWidth:200,gap:60,baseX:0,baseY:0,headerHeight:48,rowHeight:24,footerHeight:16,minHeight:120};function fg(e,n={}){const o={...zc,...n},i=o.headerHeight+Math.max(0,e)*o.rowHeight+o.footerHeight;return Math.max(o.minHeight,i)}function rl(e,n={}){const o={...zc,...n},i=Math.max(1,o.cols),a=new Array(i).fill(o.baseY);return e.map((r,l)=>{const s=l%i,c=fg(r.attributeCount,o),d=o.baseX+s*(o.boxWidth+o.gap),u=a[s];return a[s]=u+c+o.gap,{id:r.id,location:{x:d,y:u},size:{width:o.boxWidth,height:c}}})}function Fc(e,n,o={}){const i=o.step??Oc.headerHeight,a=o.maxSteps??32,r=l=>n.some(s=>Math.abs(s.x-l.x)<i&&Math.abs(s.y-l.y)<i);for(let l=0;l<=a;l++){const s={x:e.x+l*i,y:e.y+l*i};if(!r(s))return s}return{x:e.x+a*i,y:e.y+a*i}}function so(e){const n=new Map,o=new Map;for(const i of e){o.set(i.modelId,i),i.dbAttrs.length===1&&n.set(i.modelId,i.dbAttrs[0]);for(const a of i.dbAttrs)n.set(a.modelId,a),o.set(a.modelId,i)}return{attributeOf:i=>o.get(i),columnOf:i=>n.get(i),canon:i=>{var a;return((a=n.get(i))==null?void 0:a.modelId)??i}}}function Uc(e,n){const o=e.attributeOf(n);if(!o)return n;const i=o.name||"(이름 없음)";if(o.dbAttrs.length<=1)return i;const a=e.columnOf(n);if(!a)return`${i}(컬럼 ${o.dbAttrs.length}개 중 미지정)`;const r=o.dbAttrs.findIndex(l=>l.modelId===a.modelId);return`${i}.${a.physicalName||`#${r+1}`}`}const pg={UNDEFINED:"Undefined",JPA_ENTITY:"Entity",JPA_EMBEDDABLE:"Embeddable",JPA_MULTI_LANGUAGE_ENTITY:"MultiLanguageEntity",SERIALIZED_TYPE:"Serialized"};function gi(e){return pg[e]??e}function lt(e){return e==="JPA_EMBEDDABLE"||e==="SERIALIZED_TYPE"}function mn(e){return e==="SERIALIZED_TYPE"}const ya="inherited:";function Hc(e,n){return`${ya}${e}:${n}`}function co(e){return e.startsWith(ya)}function ll(e){if(!co(e))return null;const n=e.slice(ya.length),o=n.indexOf(":");if(o<0)return null;const i=n.slice(0,o),a=n.slice(o+1);return!i||!a?null:{baseClass:i,field:a}}function bi(e,n){var a;if(lt(e.stereotype))return[];if(n.some(r=>r.name===e.name))return[];const o=e.superClass||((a=n.find(r=>r.default))==null?void 0:a.name);if(!o)return[];const i=n.find(r=>r.name===o);return i?i.columns.map(r=>({modelId:Hc(i.name,r.field),baseClass:i.name,field:r.field,physicalName:r.physicalName,dataType:r.dataType,logicalName:r.logicalName,length:r.length,scale:r.scale})):[]}function ki(e){return e.attrType.startsWith("RELATION")&&e.dbAttrs.length>0}function vn(e){return e.attrType==="RELATION_OWN"&&e.dbAttrs.length>1}function sl(e){const n=new Set;for(const o of e)o.end2.attributeRef&&n.add(o.end2.attributeRef),o.end1.attributeRef&&o.end1.navigable&&n.add(o.end1.attributeRef);return n}function cl(e,n,o){var a;if(e.attrType!=="RELATION_OWN"||o.has(e.modelId))return!1;const i=(a=e.derivedFrom)==null?void 0:a.associationRef;return i?n.attributes.some(r=>{var l;return r.modelId!==e.modelId&&r.attrType==="RELATION_OWN"&&((l=r.derivedFrom)==null?void 0:l.associationRef)===i&&o.has(r.modelId)}):!1}function ga(e,n,o,i,a=0){var d;if(!ki(e))return;const r=i.find(u=>u.end1.attributeRef===e.modelId||u.end2.attributeRef===e.modelId),l=n==null?void 0:n.modelId,s=r?o.find(u=>u.modelId===(r.end1.entityRef===l?r.end2.entityRef:r.end1.entityRef)):void 0,c=(d=e.derivedFrom)==null?void 0:d.sourceAttributeRef;if(c){const u=s==null?void 0:s.attributes.find(m=>m.modelId===c);if(u!=null&&u.dbAttrs[a])return u.dbAttrs[a];if(u)return Yn(s)[a];for(const m of o){const f=m.attributes.find(p=>p.modelId===c);if(f)return f.dbAttrs[a]??Yn(s)[a]}}if(s)return Yn(s)[a]}function dl(e){return e.identifier?e.attrType==="NORMAL"||e.attrType==="RELATION_OWN"?!0:jc(e):!1}function jc(e){return e.identifier===!0&&(e.attrType==="EMBED_PREDEF"||e.attrType==="EMBED_OWN")&&e.dbAttrs.length>0}function Yn(e){return((e==null?void 0:e.attributes)??[]).filter(dl).slice().sort((n,o)=>n.order-o.order).flatMap(n=>n.dbAttrs)}const Kc={attr:["identifier","notNull"],column:["dataType","length","scale"]},Gc={attr:["transient","naturalId","defaultValue","personalInfoAttributeType"],column:["unique","autoIncrement","multiValue","notNull"]},qn=["ko","en","ja","zh"],ul=e=>e==null||e.trim()==="";function fn(e){return e!=null&&Object.values(e).some(n=>!ul(n))}function Yc(e){if(e==null)return;const n=Object.keys(e),o=n.filter(a=>!ul(e[a]));if(o.length===0)return;if(o.length===n.length)return e;const i={};for(const a of o)i[a]=e[a];return i}function hg(e){return e==null?!0:typeof e!="object"||Array.isArray(e)?!1:Object.entries(e).every(([n,o])=>qn.includes(n)&&(o==null||typeof o=="string"))}function Ct(e,n){if(e==null)return;const o=n?[n,...qn.filter(i=>i!==n)]:qn;for(const i of o){const a=e[i];if(!ul(a))return a}}function yg(e,n,o){var i,a,r,l;if(e.attrType==="EMBED_PREDEF"){const s=(a=(i=n==null?void 0:n.embeddableCatalog)==null?void 0:i.find(c=>c.type===e.type))==null?void 0:a.fields;return e.dbAttrs.map((c,d)=>{var u;return((u=s==null?void 0:s[d])==null?void 0:u.name)||void 0})}if(e.attrType==="EMBED_OWN"){const s=(r=e.embedded)==null?void 0:r.embeddableRef,c=s!=null?(l=n==null?void 0:n.entities)==null?void 0:l.find(u=>u.modelId===s):void 0,d=qc(c,n,o);return d.length!==e.dbAttrs.length?e.dbAttrs.map(()=>{}):d.map(u=>u.propertyPath||void 0)}}function Cn(e,n){return qc(e,n,new Set)}function qc(e,n,o){if(e==null||o.has(e.modelId))return[];const i=new Set(o).add(e.modelId);return e.attributes.flatMap(a=>{var c,d;const r=yg(a,n,i),l=a.name??"",s=a.attrType==="EMBED_PREDEF"?(d=(c=n==null?void 0:n.embeddableCatalog)==null?void 0:c.find(u=>u.type===a.type))==null?void 0:d.fields:void 0;return a.dbAttrs.map((u,m)=>{var f;return{col:u,ownerAttr:a,ownerIndex:m,propertyPath:l?r===void 0?a.dbAttrs.length>1?"":l:r[m]?`${l}.${r[m]}`:"":"",defaultPhysical:u.physicalName||(u.sharedColumnRef==null?((f=s==null?void 0:s[m])==null?void 0:f.physicalName)??"":""),...u.sharedColumnRef!=null?{defaultSharedRef:u.sharedColumnRef}:{},ownColumn:!!u.physicalName&&u.sharedColumnRef==null}})})}const ba=e=>e==null||e.trim()==="";function Wc(e,n,o,i,a,r){var l,s,c;if(e.attrType==="EMBED_PREDEF")return(s=(l=a==null?void 0:a.embeddableCatalog)==null?void 0:l.find(d=>d.type===e.type))==null?void 0:s.fields[n];if(e.attrType==="EMBED_OWN"){const d=(c=e.embedded)==null?void 0:c.embeddableRef;if(d==null||r.has(d))return;const u=i.entities.find(_=>_.modelId===d),m=Cn(u,{entities:i.entities,embeddableCatalog:a==null?void 0:a.embeddableCatalog}),f=m[n];if(f==null)return;const p=ba(f.col.dataType),y=e.dbAttrs.length===m.length,g=y&&ba(f.col.physicalName)&&f.col.sharedColumnRef==null,b=y&&!fn(f.col.logicalName);if(!p&&!g&&!b)return f.col;const k=Xc(f.ownerAttr,f.col,f.ownerIndex,u,i,a,new Set(r).add(d));return{...f.col,...p?{dataType:k.dataType,length:k.length,scale:k.scale}:{},...g&&!ba(k.physicalName)?{physicalName:k.physicalName}:{},...b&&fn(k.logicalName)?{logicalName:k.logicalName}:{}}}if(e.attrType.startsWith("RELATION"))return ga(e,o,i.entities,i.associations,n)}function Lt(e,n,o,i,a,r){return Xc(e,n,o,i,a,r,Jc)}const Jc=new Set;function Xc(e,n,o,i,a,r,l){const s=Wc(e,o,i,a,r,l);return s?{...n,physicalName:n.physicalName||s.physicalName||"",dataType:n.dataType||s.dataType||"",length:n.length??s.length,scale:n.scale??s.scale,logicalName:fn(n.logicalName)?n.logicalName:s.logicalName,...n.sharedColumnRef==null&&!n.physicalName&&s.sharedColumnRef!=null&&(e.attrType==="EMBED_OWN"||e.attrType==="EMBED_PREDEF")?{sharedColumnRef:s.sharedColumnRef}:{}}:n}function uo(e,n){return((n==null?void 0:n.notNull)??e.notNull)===!0}function Sn(e){var n,o;return fn((n=e.table)==null?void 0:n.logicalName)?(o=e.table)==null?void 0:o.logicalName:e.classLogicalName}function jo(e,n){return fn(n==null?void 0:n.logicalName)?n==null?void 0:n.logicalName:e.fieldLogicalName}function _i(e,n,o,i,a,r){var l;return ba(n.physicalName)?((l=Wc(e,o,i,a,r,Jc))==null?void 0:l.physicalName)??"":n.physicalName}function Zc(e,n,o,i){var a,r,l,s;if(e.attrType==="EMBED_PREDEF")return((l=(r=(a=i==null?void 0:i.embeddableCatalog)==null?void 0:a.find(c=>c.type===e.type))==null?void 0:r.fields[n])==null?void 0:l.name)||void 0;if(e.attrType==="EMBED_OWN"){const c=(s=e.embedded)==null?void 0:s.embeddableRef;if(c==null)return;const d=o.entities.find(m=>m.modelId===c);if(!d)return;let u=0;for(const m of d.attributes)for(let f=0;f<m.dbAttrs.length;f++){if(u===n)return m.name||void 0;u++}}}function Qc(e){return typeof e=="object"&&e!==null?e:void 0}const ed=["physicalName","dataType","length","scale","logicalName"],td=e=>e!=null&&e!==""&&!(typeof e=="object"&&Object.keys(e).length===0);function nd(e,n){return e?ed.filter(o=>o==="physicalName"&&n.sharedColumnRef!=null?!1:!td(e[o])&&td(n[o])):[]}function Wn(e){return e.referenceOnly===!0}function ml(e){const n=new Set;for(const o of e.entities)Wn(o)&&n.add(o.modelId);return n}function od(e){return e.entities.filter(n=>!Wn(n))}function id(e,n=ml(e)){return n.size===0?e.associations:e.associations.filter(o=>!n.has(o.end1.entityRef)&&!n.has(o.end2.entityRef))}function fl(e,n){return n?{...e,entities:e.entities.map(o=>o.referenceOnly?o:{...o,referenceOnly:!0})}:e}function gg(e,n){return Wn(e)||n===!0}function pl(e,n){if(e.stereotype!=="JPA_EMBEDDABLE")return[e];const o=n.filter(i=>i.modelId!==e.modelId&&i.attributes.some(a=>{var r;return a.attrType==="EMBED_OWN"&&((r=a.embedded)==null?void 0:r.embeddableRef)===e.modelId}));return[e,...o]}function Rn(e,n){return pl(e,n).flatMap(o=>o.attributes.flatMap(i=>i.dbAttrs))}function mo(e){const n=new Map;for(const o of e)n.set(o.modelId,o);return n}function fo(e,n){if(e.sharedColumnRef==null)return null;const o=n.get(e.sharedColumnRef);return o?{physicalName:o.physicalName,insertable:!1,updatable:!1}:null}function Ko(e,n){if(e.packageName)return{kind:"explicit",value:e.packageName};const o=n.groups.find(i=>{var a;return(a=i.memberEntityRefs)==null?void 0:a.includes(e.modelId)});return{kind:"group",value:(o==null?void 0:o.packageName)??""}}function bg(e,n,o){const i=Ko(e,o),a=Ko(n,o);return i.kind===a.kind&&i.value!==a.value}function Go(e){const n=new Map;for(const o of e.entities){if(o.stereotype!=="SERIALIZED_TYPE"||!o.name)continue;const i=n.get(o.name);i?i.push(o):n.set(o.name,[o])}return n}function ad(e,n){var i,a;const o=(i=n==null?void 0:n.serialization)==null?void 0:i.collectionType;if(!o)return e;if(o==="MAP"){const r=(a=n==null?void 0:n.serialization)==null?void 0:a.mapKeyType;return`Map<${r&&r.trim()?r.slice(r.lastIndexOf(".")+1):"?"}, ${e}>`}return`${o==="SET"?"Set":"List"}<${e}>`}function Ei(e,n,o,i){if(n.size===0)return{kind:"none"};const a=n.has(e.type)?e.type:e.customType&&n.has(e.customType)?e.customType:void 0;if(!a)return{kind:"none"};const r=n.get(a);if(r.length===1)return{kind:"resolved",entity:r[0]};if(o&&i){const l=Ko(o,i),s=r.filter(c=>{const d=Ko(c,i);return d.kind===l.kind&&d.value===l.value});if(s.length===1)return{kind:"resolved",entity:s[0]}}return{kind:"ambiguous",name:a,candidates:r}}const rd=["BIT","TINYINT","SMALLINT","INTEGER","BIGINT","FLOAT","REAL","DOUBLE","NUMERIC","DECIMAL","CHAR","VARCHAR","LONGVARCHAR","DATE","TIME","TIMESTAMP","BINARY","VARBINARY","LONGVARBINARY","NULL","OTHER","JAVA_OBJECT","DISTINCT","STRUCT","ARRAY","BLOB","CLOB","REF","DATALINK","BOOLEAN","ROWID","NCHAR","NVARCHAR","LONGNVARCHAR","NCLOB","SQLXML","REF_CURSOR","TIME_WITH_TIMEZONE","TIMESTAMP_WITH_TIMEZONE","SERIAL","BIG_SERIAL","JSONB"],kg=new Set(["NULL","OTHER","JAVA_OBJECT","DISTINCT","STRUCT","ARRAY","REF","DATALINK","ROWID","REF_CURSOR","NCHAR","NVARCHAR","LONGNVARCHAR","NCLOB","SQLXML","TIME_WITH_TIMEZONE","BIT","TINYINT","FLOAT"]),_g=rd.filter(e=>!kg.has(e)),Eg={TIMESTAMP_WITH_TIMEZONE:"TIMESTAMP WITH TIME ZONE",BIG_SERIAL:"BIGSERIAL",DOUBLE:"DOUBLE PRECISION"};function hl(e){return Eg[e]??e}const Ng=new Set(["CHAR","VARCHAR","NCHAR","NVARCHAR","BINARY","VARBINARY","NUMERIC","DECIMAL"]),yl=new Set(["NUMERIC","DECIMAL"]),gl=new Set(["TINYINT","SMALLINT","INTEGER","BIGINT","FLOAT","REAL","DOUBLE","NUMERIC","DECIMAL","SERIAL","BIG_SERIAL"]);function ld(e,n=_g){const o=[...n];return e&&!o.includes(e)?[e,...o]:o}const pn="CustomType";function sd(e){var o;if(e.type!==pn)return;const n=(o=e.customType)==null?void 0:o.trim();return n||void 0}const An="GroupCodeEnum",bl="String",Ni=[{value:"String",label:"String"},{value:"Integer",label:"Integer"},{value:"Long",label:"Long"},{value:"Double",label:"Double"},{value:"Boolean",label:"Boolean"},{value:"Date",label:"Date"},{value:"LocalDate",label:"LocalDate"},{value:"LocalDateTime",label:"LocalDateTime"},{value:"Instant",label:"Instant"},{value:"ZonedDateTime",label:"ZonedDateTime"},{value:"OffsetDateTime",label:"OffsetDateTime"},{value:"BigDecimal",label:"BigDecimal"},{value:"BigInteger",label:"BigInteger"},{value:"Currency",label:"Currency"},{value:"ByteArray",label:"Byte[]"},{value:"CharacterArray",label:"Character[]"},{value:"Short",label:"Short"},{value:"PrimitiveInt",label:"int",boxed:"Integer"},{value:"PrimitiveLong",label:"long",boxed:"Long"},{value:"PrimitiveDouble",label:"double",boxed:"Double"},{value:"PrimitiveBoolean",label:"boolean",boxed:"Boolean"},{value:"PrimitiveShort",label:"short",boxed:"Short"},{value:"PrimitiveByteArray",label:"byte[]",boxed:"Byte[]"},{value:"PrimitiveCharacterArray",label:"char[]",boxed:"Character[]"},{value:An,label:"GroupCodeEnum"},{value:"CustomMoneyType",label:"Money"},{value:pn,label:"CustomType"}],wg=new Map(Ni.map(e=>[e.value,e.label]));function Yo(e){return wg.get(e)??e}const Ig={TINYINT:"Short",SMALLINT:"Short",INTEGER:"Integer",BIGINT:"Long",SERIAL:"Integer",BIG_SERIAL:"Long",FLOAT:"Double",REAL:"Double",DOUBLE:"Double",NUMERIC:"BigDecimal",DECIMAL:"BigDecimal",CHAR:"String",VARCHAR:"String",LONGVARCHAR:"String",NCHAR:"String",NVARCHAR:"String",LONGNVARCHAR:"String",CLOB:"String",NCLOB:"String",BIT:"Boolean",BOOLEAN:"Boolean",DATE:"LocalDate",TIMESTAMP:"LocalDateTime",TIMESTAMP_WITH_TIMEZONE:"OffsetDateTime",BINARY:"ByteArray",VARBINARY:"ByteArray",LONGVARBINARY:"ByteArray",BLOB:"ByteArray"};function cd(e){if(e)return Ig[e.toUpperCase()]}const vg={String:new Set(["VARCHAR","CHAR","LONGVARCHAR","CLOB","NCHAR","NVARCHAR","LONGNVARCHAR","NCLOB","JSONB"]),CharacterArray:new Set(["CHAR","VARCHAR","LONGVARCHAR","CLOB"]),Integer:new Set(["INTEGER","SERIAL","SMALLINT","NUMERIC","DECIMAL"]),Long:new Set(["BIGINT","BIG_SERIAL","NUMERIC","DECIMAL"]),Short:new Set(["SMALLINT","TINYINT","NUMERIC","DECIMAL"]),Double:new Set(["DOUBLE","FLOAT","REAL","NUMERIC","DECIMAL"]),BigDecimal:new Set(["NUMERIC","DECIMAL"]),BigInteger:new Set(["NUMERIC","DECIMAL","BIGINT"]),Boolean:new Set(["BOOLEAN","BIT","CHAR","VARCHAR"]),Date:new Set(["DATE","TIME","TIMESTAMP","TIMESTAMP_WITH_TIMEZONE"]),LocalDate:new Set(["DATE"]),LocalDateTime:new Set(["TIMESTAMP"]),Instant:new Set(["TIMESTAMP","TIMESTAMP_WITH_TIMEZONE"]),ZonedDateTime:new Set(["TIMESTAMP_WITH_TIMEZONE","TIMESTAMP"]),OffsetDateTime:new Set(["TIMESTAMP_WITH_TIMEZONE","TIMESTAMP"]),ByteArray:new Set(["BINARY","VARBINARY","LONGVARBINARY","BLOB"]),Currency:new Set(["VARCHAR","CHAR"]),[An]:new Set(["VARCHAR","CHAR"])},dd=new Map(Ni.filter(e=>e.boxed).map(e=>[e.value,e.boxed]));function Cg(e,n,o){const i=e==null?void 0:e.trim(),a=n==null?void 0:n.trim();if(!i||!a||!rd.includes(a))return;const r=dd.get(i)??i,l=vg[r];if(l)return l.has(a);const s=o==null?void 0:o.find(c=>c.type===i);if(s!=null&&s.dataType)return s.dataType.trim()===a}function Sg(e){return e?dd.get(e):void 0}const Rg=new Set(["VARCHAR","CHAR"]);function ud(e,n,o){return o||!n||!Rg.has(n)?null:e==="PrimitiveBoolean"?"primitive":e==="Boolean"?"boxed":null}const Ag=new Set(["PrimitiveInt","PrimitiveLong","PrimitiveDouble","PrimitiveShort"]);function xg(e,n,o){return o||!e?!1:Ag.has(e)?!0:e==="PrimitiveBoolean"?ud(e,n,o)==null:!1}const $g=new Set([An,"CustomMoneyType"]),md=Ni.filter(e=>!$g.has(e.value)).map(e=>e.value===pn?{...e,label:"CustomType (사용자정의)"}:e);function fd(e,n=[],o=[],i=[]){const a=n.map(c=>{const d=Ct(c.label);return{value:c.type,label:d?`${c.type} (${d})`:c.type}}),r=o.map(c=>({value:c,label:c})),l=i.map(c=>{const d=Ct(c.label);return{value:c.type,label:d?`${c.type} (${d})`:c.type}}),s=[...md,...a,...r,...l];return e&&!s.some(c=>c.value===e)?[{value:e,label:Yo(e)},...s]:s}function kl(e){return e.attrType==="EMBED_PREDEF"?"structural":e.attrType==="EMBED_OWN"||e.attrType==="EMBED_REF"?"association":e.attrType.startsWith("RELATION")?"derived":"own"}function pd(e,n,o){return n===e.type?!1:kl(e)!=="own"||o.some(i=>i.type===n)}function Tg(e,n,o){if(!n||n===e.type||e.attrType!=="NORMAL"&&e.attrType!=="EMBED_PREDEF")return;const i=o.find(a=>a.type===n);if(i)return i.fields.length===e.dbAttrs.length?i:void 0}function ka(e,n){return e===An!=!!n}function hd(e,n){return{...e,dataType:n.dataType,length:n.length,scale:n.scale}}function Mg(e){return e.attrType.startsWith("EMBED")&&e.dbAttrs.length>0}function wi(e,n){var r;if(!e.embedded||!e.attrType.startsWith("EMBED"))return;const o=n.find(l=>l.modelId===e.embedded.associationRef);if(!o)return;const i=o.end2.entityRef===e.embedded.embeddableRef?o.end2:o.end1;if(i.multiplicity==="ZERO_OR_MORE_INSTANCES"||i.multiplicity==="ONE_OR_MORE_INSTANCES")return((r=i.jpa)==null?void 0:r.collectionType)??"LIST"}function _l(e,n,o,i,a){var r;if(n.attrType==="DIVIDER"||e==="LOGICAL")return"";if((e==="CLASS"||vn(n))&&n.attrType.startsWith("RELATION")&&i)return o?`${o==="SET"?"Set":"List"}<${i}>`:i;if(o&&n.attrType.startsWith("EMBED"))return`${o==="SET"?"Set":"List"}<${Yo(n.type)}>`;if(Mg(n))return Yo(n.type);if(e==="CLASS"){const l=sd(n)??Yo(n.type);return a?ad(l,a):l}return hl(((r=n.dbAttrs[0])==null?void 0:r.dataType)??"")}function _a(e,n,o,i,a="(논리명)"){switch(e){case"CLASS":return n;case"PHYSICAL":return i||n;case"LOGICAL":return o||a;default:return i?`${o||a} · ${i}`:o||a}}const El="(미지정)",Vg="(이름 없음)",Ea=e=>e==null||String(e).trim()==="",qo=e=>Ea(e)?Vg:String(e),yd=e=>Ea(e)?El:String(e);function gd(e){switch(e){case"NO_INSTANCE_OR_ONE_INSTANCE":return"0..1";case"EXACTLY_ONE_INSTANCE":return"1";case"ZERO_OR_MORE_INSTANCES":return"0..*";case"ONE_OR_MORE_INSTANCES":return"1..*"}return El}function bd(e,n){const o=e.length?`(${e.length}${e.scale!=null?`,${e.scale}`:""})`:"",i=Ea(n)?yd(e.physicalName):String(n),a=Ea(e.dataType)?"":String(e.dataType).trim();return a?`${i} ${a}${o}`:i}function Nl(e){const n=(Ct(e)??"").trim();return n?` «${n}»`:""}function wl(e){const n=(Ct(e)??"").trim();return n?` — ${n}`:""}function kd(e,n){const o=nd(n,e);return[e.unique?"UNIQUE":"",e.autoIncrement?"AUTO_INCREMENT":"",e.sharedColumnRef?"SHARED":"",e.updatable===void 0?"":`updatable=${e.updatable}`,e.multiValue?`multiValue${e.multiValueSeparator?`='${e.multiValueSeparator}'`:""}`:"",o.length?`inherited=${o.join(",")}`:""].filter(Boolean)}function _d(e,n){var l,s,c,d;const o=new Map(e.entities.map(u=>[u.modelId,u.name])),i=new Map;for(const u of e.groups)for(const m of u.memberEntityRefs)i.set(m,u.packageName||(Ct(u.name)??u.modelId));const a=[];for(const u of e.entities){const m=(l=u.table)!=null&&l.physicalName?` (${u.table.physicalName})`:"",f=i.get(u.modelId),p=[Wn(u)?"REFERENCE_ONLY":"",(s=u.jpaAttrs)!=null&&s.useVersion?"VERSIONED":""].filter(Boolean);a.push(`## ${qo(u.name)}${m} «${gi(u.stereotype)}»${f?` [${f}]`:""}${p.length?` {${p.join(", ")}}`:""}${Nl(Sn(u))}`);const y=mo(Rn(u,e.entities)),g=h=>{var C;return h.sharedColumnRef?(C=fo(h,y))==null?void 0:C.physicalName:void 0},b=[...u.attributes].sort((h,C)=>h.order-C.order);for(const h of b){if(h.attrType==="DIVIDER"){a.push(` ${"─".repeat(8)}${h.name?` ${h.name} ${"─".repeat(8)}`:""}`);continue}const C=h.dbAttrs.map((D,E)=>Lt(h,D,E,u,e,n)),v=[h.attrType==="NORMAL"?"":h.attrType,h.identifier?"PK":"",h.notNull&&!mn(u.stereotype)?"NOT NULL":"",(c=h.defaultValue)!=null&&c.trim()?`default=${h.defaultValue.trim()}`:"",(d=h.groupCode)!=null&&d.trim()?`groupCode=${h.groupCode.trim()}`:""].filter(Boolean),S=Ei(h,Go(e),u,e),N=sd(h)??h.type,A=S.kind==="resolved"?ad(N,S.entity):yd(N),T=` - ${qo(h.name)}: ${A}`,O=D=>D.length?` {${D.join(", ")}}`:"";if(C.length>1){a.push(`${T}${O(v)}${wl(h.description)}`),C.forEach((D,E)=>{const R=Zc(h,E,e,n);a.push(` · ${R?`${R} → `:""}${bd(D,g(D))}${O(kd(D,h.dbAttrs[E]))}${Nl(D.logicalName)}`)});continue}const z=C[0],P=z?` → ${bd(z,g(z))}`:"";a.push(`${T}${P}${O([...v,...z?kd(z,h.dbAttrs[0]):[]])}${Nl(jo(h,z))}${wl(h.description)}`)}const k=so(u.attributes);for(const h of u.indexes??[]){const C=h.columns.map(v=>{var S,N;return`${((S=k.attributeOf(v.columnRef))==null?void 0:S.name)??((N=ll(v.columnRef))==null?void 0:N.field)??v.columnRef}${v.descending?" DESC":""}`}).join(", ");a.push(` index ${qo(h.name)}${h.unique?" UNIQUE":""}: ${C}`)}const _=[...u.operations??[]].sort((h,C)=>h.order-C.order);for(const h of _){const C=h.visibility?` {${h.visibility}}`:"";a.push(` method ${qo(h.name)}()${C}${wl(h.description)}`)}a.push("")}const r=e.groups.filter(u=>(u.memberEntityRefs??[]).length===0);if(r.length){a.push("# 빈 그룹 (멤버 0 — `[그룹]` 태그로는 안 보인다)");for(const u of r)a.push(` ${qo(u.packageName||Ct(u.name))}`)}if(e.associations.length){a.push("# 관계");const u=new Map;for(const f of e.entities)u.set(f.modelId,new Map(f.attributes.map(p=>[p.modelId,p.name])));const m=(f,p,y)=>{var k,_;if(!f.navigable)return"";const g=f.attributeRef,b=g?((k=u.get(f.entityRef))==null?void 0:k.get(g))??((_=u.get(p.entityRef))==null?void 0:_.get(g)):void 0;return`${y}.nav=${b===void 0?El:qo(b)}`};for(const f of e.associations){const p=o.get(f.end1.entityRef)??f.end1.entityRef,y=o.get(f.end2.entityRef)??f.end2.entityRef,g=f.end2.composition||f.end1.composition?" (composition)":"",b=[m(f.end1,f.end2,"from"),m(f.end2,f.end1,"to")].filter(Boolean),k=b.length?` {${b.join(", ")}}`:"";a.push(` ${p} ${gd(f.end1.multiplicity)} —— ${gd(f.end2.multiplicity)} ${y}${g}${k}`)}}return a.join(`
|
|
2
2
|
`).trim()}const Lg=e=>e&&e[0].toLowerCase()+e.slice(1);function Na(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function Ed(e){return e!=="EXACTLY_ONE_INSTANCE"&&e!=="ONE_OR_MORE_INSTANCES"}function wa(e){switch(e){case"NO_INSTANCE_OR_ONE_INSTANCE":return"0..1";case"EXACTLY_ONE_INSTANCE":return"1";case"ZERO_OR_MORE_INSTANCES":return"0..*";case"ONE_OR_MORE_INSTANCES":return"1..*"}}function Bg(e){return/[^aeiou]y$/.test(e)?`${e.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/.test(e)?`${e}es`:`${e}s`}function Ia(e,n){const o=Lg(e);return n?Bg(o):o}function po(e,n){if(!n.has(e))return e;for(let o=2;;o++){const i=`${e}${o}`;if(!n.has(i))return i}}function Dg(e){return e==="CLASS"?"class":"er"}function Il(e,n,o){const i=Og(e),a=Qc(n);return a?Cd(i,a):n==="class"?jg(i):Cd(i,o)}function Og(e){const n=ml(e);return n.size===0?e:{...e,entities:od(e),associations:id(e,n)}}function Ii(e,n){return(e??"").trim().replace(/[^0-9A-Za-z_]/g,"_").replace(/^(\d)/,"_$1")||n}function vl(e){return(e??"").replace(/"/g,"'").replace(/\s+/g," ").trim()}function Nd(e,n){const o=new Set,i=new Map;return e.entities.forEach((a,r)=>{const l=Ii(n(a),`Entity_${r+1}`);let s=l,c=2;for(;o.has(s);)s=`${l}_${c++}`;o.add(s),i.set(a.modelId,s)}),i}function Pg(e){return e.attrType==="RELATION_OWN"||e.attrType==="RELATION_REF"||e.derivedFrom!=null}const wd=wa;function Cl(e){return e!=null&&Id[e]!=null}const Id={NO_INSTANCE_OR_ONE_INSTANCE:"|o",EXACTLY_ONE_INSTANCE:"||",ZERO_OR_MORE_INSTANCES:"}o",ONE_OR_MORE_INSTANCES:"}|"};function vd(e,n){const o={NO_INSTANCE_OR_ONE_INSTANCE:"o|",EXACTLY_ONE_INSTANCE:"||",ZERO_OR_MORE_INSTANCES:"o{",ONE_OR_MORE_INSTANCES:"|{"},i=Cl(e)?e:"ZERO_OR_MORE_INSTANCES";return(n==="left"?Id:o)[i]}function zg(e,n,o,i){if(e.dbAttrs.length===0)return[];const a=[];return e.dbAttrs.forEach((r,l)=>{var f;const s=Lt(e,r,l,n,o,i);if(s.sharedColumnRef!=null)return;const c=l===0?e.name:Zc(e,l,o,i),d=Ii(s.dataType||e.type,"unknown"),u=Ii(s.physicalName||c,"col"),m=s.length?`(${s.length}${s.scale!=null?`,${s.scale}`:""})`:"";a.push(Fg(d,u,e,s.unique===!0,m,(f=s.logicalName)==null?void 0:f.ko))}),a}function Fg(e,n,o,i,a,r){const l=[o.identifier?"PK":"",Pg(o)?"FK":"",i?"UK":""].filter(Boolean).join(", "),s=vl([r,a].filter(Boolean).join(" ")),c=[` ${e} ${n}`];return l&&c.push(l),c.join(" ")+(s?` "${s}"`:"")}function Cd(e,n){const o=Nd(e,r=>{var l;return((l=r.table)==null?void 0:l.physicalName)||r.name}),i=["erDiagram"];for(const r of e.entities){const l=o.get(r.modelId),s=[...r.attributes].filter(c=>c.attrType!=="DIVIDER").sort((c,d)=>c.order-d.order);if(s.length===0){i.push(` ${l}`);continue}i.push(` ${l} {`);for(const c of s)for(const d of zg(c,r,e,n))i.push(d);i.push(" }")}const a=[];for(const r of e.associations){const l=o.get(r.end1.entityRef),s=o.get(r.end2.entityRef);if(!l||!s)continue;const c=`${vd(r.end1.multiplicity,"left")}--${vd(r.end2.multiplicity,"right")}`,d=vl(r.description);i.push(` ${l} ${c} ${s} : "${d}"`),(!Cl(r.end1.multiplicity)||!Cl(r.end2.multiplicity))&&a.push(`${l} -- ${s}`)}if(a.length>0){i.push(`%% ⚠ 다중성 미지정 ${a.length}건 — 0..*(가장 약한 주장)로 표기함. 모델을 정정할 지점:`);for(const r of a)i.push(`%% ${r}`)}return i.join(`
|
|
3
3
|
`)}function Ug(e){return e&&e!=="UNDEFINED"?gi(e):null}function Hg(e){return(e??"").trim().replace(/</g,"~").replace(/>/g,"~").replace(/[^0-9A-Za-z_~]/g,"")||"any"}function jg(e){const n=Nd(e,i=>i.name),o=["classDiagram"];for(const i of e.entities){const a=n.get(i.modelId),r=[],l=Ug(i.stereotype);l&&r.push(` <<${l}>>`);const s=[...i.attributes].filter(c=>c.attrType!=="DIVIDER").sort((c,d)=>c.order-d.order);for(const c of s)r.push(` +${Hg(c.type)} ${Ii(c.name,"field")}`);for(const c of[...i.operations??[]].sort((d,u)=>d.order-u.order))r.push(` +${Ii(c.name,"op")}()`);r.length===0?o.push(` class ${a}`):(o.push(` class ${a} {`),o.push(...r),o.push(" }"))}for(const i of e.associations){const a=n.get(i.end1.entityRef),r=n.get(i.end2.entityRef);if(!a||!r)continue;const l=Kg(i),s=vl(i.description),c=` ${a} "${wd(i.end1.multiplicity)}" ${l} "${wd(i.end2.multiplicity)}" ${r}`;o.push(s?`${c} : ${s}`:c)}return o.join(`
|
|
4
4
|
`)}function Kg(e){return e.end1.composition||e.end2.composition?"*--":e.end2.navigable||e.end1.navigable?"-->":"--"}function Fe(){return crypto.randomUUID()}const Gg={"|o":"NO_INSTANCE_OR_ONE_INSTANCE","||":"EXACTLY_ONE_INSTANCE","}o":"ZERO_OR_MORE_INSTANCES","}|":"ONE_OR_MORE_INSTANCES"},Yg={"o|":"NO_INSTANCE_OR_ONE_INSTANCE","||":"EXACTLY_ONE_INSTANCE","o{":"ZERO_OR_MORE_INSTANCES","|{":"ONE_OR_MORE_INSTANCES"};function qg(e,n,o){var a,r;if(!o.size)return;const i=new Map(e.map(l=>[l.modelId,l]));for(const l of e){const s=l.attributes.filter(d=>o.has(d.modelId));if(!s.length)continue;const c=n.filter(d=>d.end2.entityRef===l.modelId).map(d=>({assoc:d,parent:i.get(d.end1.entityRef)})).filter(d=>d.parent!=null);if(c.length)for(const d of s){const u=(a=d.dbAttrs[0])==null?void 0:a.physicalName,m=(p,y)=>p.attributes.find(g=>{var b;return g.identifier&&(y==null||((b=g.dbAttrs[0])==null?void 0:b.physicalName)===y)});let f=c.length===1?c[0]:void 0;if(!f){const p=c.filter(y=>m(y.parent,u)!=null);p.length===1&&(f=p[0])}f&&(d.attrType="RELATION_OWN",d.derivedFrom={associationRef:f.assoc.modelId,sourceAttributeRef:((r=m(f.parent,u)??m(f.parent))==null?void 0:r.modelId)??""},f.assoc.end2.attributeRef||(f.assoc.end2.attributeRef=d.modelId))}}}function Wg(e,n){let o=e,i;const a=o.match(/"([^"]*)"\s*$/);a&&(i=a[1],o=o.slice(0,a.index).trim());const r=o.split(/\s+/).filter(Boolean);if(r.length<2)return null;const l=r[0],s=r[1],c=new Set(r.slice(2).join(" ").split(",").map(y=>y.trim()).filter(Boolean));let d,u,m;if(i!=null){const y=i.match(/\((\d+)(?:,\s*(\d+))?\)\s*$/);if(y){d=Number(y[1]),y[2]!=null&&(u=Number(y[2]));const g=i.slice(0,y.index).trim();g&&(m=g)}else i.trim()&&(m=i.trim())}const f={modelId:Fe(),physicalName:s,dataType:l};return d!=null&&(f.length=d),u!=null&&(f.scale=u),c.has("UK")&&(f.unique=!0),m&&(f.logicalName={ko:m}),{attr:{modelId:Fe(),name:s,type:cd(l)??"",attrType:"NORMAL",identifier:c.has("PK"),notNull:c.has("PK"),order:n,dbAttrs:[f]},foreignKey:c.has("FK")}}function Sd(e){const n=e.split(`
|
|
@@ -31,7 +31,7 @@ ${u}
|
|
|
31
31
|
`)+`
|
|
32
32
|
`}}function pk(e,n,o,i){const a=[`${n}.${e}`,...i?[i]:[],nt.jpaRepository,nt.querydslExecutor].sort(),r=[`package ${n};`,""];for(const l of a)r.push(`import ${l};`);return r.push(""),r.push(`public interface ${e}Repository extends JpaRepository<${e}, ${o}>, QuerydslPredicateExecutor<${e}> {`),r.push("}"),{fileName:`${e}Repository.java`,source:r.join(`
|
|
33
33
|
`)+`
|
|
34
|
-
`}}const ko="com.example",hk="command.domain";function $n(e,n,o={}){const i=Ko(e,n);if(i.kind==="explicit")return i.value;const a=o.packageConfig;if(a!=null&&a.basePackage){const r=i.value?`.${i.value}`:"",l=a.layerSuffix??hk,s=l?`.${l}`:"";return`${a.basePackage}${r}${s}`}return n.packageName||""}const yk="CustomMoneyType",gk="Money";function bk(e){return!(e.type!==yk||e.attrType!=="NORMAL"||e.identifier||e.dbAttrs.length>1)}function kk(e){const n=e.dbAttrs[0]??{modelId:Fe(),physicalName:"",dataType:""},o={modelId:Fe(),physicalName:"",dataType:""},{customType:i,...a}=e;return{...a,type:gk,attrType:"EMBED_PREDEF",dbAttrs:[n,o]}}function _k(e){let n=!1;const o=e.entities.map(i=>{let a=!1;const r=i.attributes.map(l=>bk(l)?(a=!0,n=!0,kk(l)):l);return a?{...i,attributes:r}:i});return n?{...e,entities:o}:e}function Ek(e,n){const o=new Map,i=[],a=new Map;for(const y of e.entities){const g=new Map,b=new Map,k=new Map,_=(h,C,v)=>{if(!h)return;o.get(h)||o.set(h,[{entityId:C,assignedId:h}]),i.push({id:h,entityId:C,sink:v}),v(h)};for(const h of y.attributes){_(h.modelId,y.modelId,C=>g.set(h,C));for(const C of h.dbAttrs)_(C.modelId,y.modelId,v=>b.set(C,v))}for(const h of y.indexes??[])_(h.modelId,y.modelId,C=>k.set(h,C));a.set(y,{attrs:g,cols:b,idx:k})}const r=new Set(o.keys()),l=new Map;for(const y of i){const g=(l.get(y.id)??0)+1;if(l.set(y.id,g),g===1)continue;const b=Nk(y.id,g-1,r);r.add(b),o.get(y.id).push({entityId:y.entityId,assignedId:b}),y.sink(b)}const s=[...o.values()].reduce((y,g)=>y+Math.max(0,g.length-1),0);if(s===0)return{logical:e,layout:n,reissued:0};const c=(y,g)=>{var k;if(!g||!y)return g;const b=o.get(g);return!b||b.length<2?g:((k=b.find(_=>_.entityId===y))==null?void 0:k.assignedId)??g},d=new Map(e.associations.map(y=>[y.modelId,y])),u=(y,g)=>{const b=d.get(y);if(b)return b.end1.entityRef===g?b.end2.entityRef:b.end1.entityRef},m=e.entities.map(y=>{var h;const g=a.get(y),b=y.attributes.map(C=>{const v=g.attrs.get(C),S=C.dbAttrs.map(T=>{const O=g.cols.get(T);return O===T.modelId?T:{...T,modelId:O}});let N=C.derivedFrom;if(N){const T=u(N.associationRef,y.modelId),O=c(T,N.sourceAttributeRef);O!==N.sourceAttributeRef&&(N={...N,sourceAttributeRef:O})}return v!==C.modelId||N!==C.derivedFrom||S.some((T,O)=>T!==C.dbAttrs[O])?{...C,modelId:v,dbAttrs:S,derivedFrom:N}:C}),k=(h=y.indexes)==null?void 0:h.map(C=>{const v=g.idx.get(C),S=C.columns.map(A=>{const T=c(y.modelId,A.columnRef);return T===A.columnRef?A:{...A,columnRef:T}});return v!==C.modelId||S.some((A,T)=>A!==C.columns[T])?{...C,modelId:v,columns:S}:C});return b.some((C,v)=>C!==y.attributes[v])||k&&y.indexes&&k.some((C,v)=>C!==y.indexes[v])?{...y,attributes:b,...k?{indexes:k}:{}}:y}),f=e.associations.map(y=>{const g=c(y.end1.entityRef,y.end1.attributeRef),b=c(y.end2.entityRef,y.end2.attributeRef);return g===y.end1.attributeRef&&b===y.end2.attributeRef?y:{...y,end1:g===y.end1.attributeRef?y.end1:{...y.end1,attributeRef:g},end2:b===y.end2.attributeRef?y.end2:{...y.end2,attributeRef:b}}}),p=n.associationLayouts.map(y=>{const g=d.get(y.associationRef);if(!g)return y;const b=c(g.end1.entityRef,y.sourceColumnRef),k=c(g.end2.entityRef,y.targetColumnRef);return b===y.sourceColumnRef&&k===y.targetColumnRef?y:{...y,sourceColumnRef:b,targetColumnRef:k}});return{logical:{...e,entities:m,associations:f},layout:p.some((y,g)=>y!==n.associationLayouts[g])?{...n,associationLayouts:p}:n,reissued:s}}function Nk(e,n,o){let i=n;for(;;){const a=`dup${i}:${e}`;if(!o.has(a))return a;i++}}const wk="5.2.49";function Jt(e){return e.reduce((n,o)=>Math.max(n,o.order),-1)+1}function Jl(e,n,o){const i=new Set(n),a=e.filter(s=>i.has(s.modelId)),r=e.filter(s=>!i.has(s.modelId)),l=Math.max(0,Math.min(o,r.length));return[...r.slice(0,l),...a,...r.slice(l)]}function yu(e){return!!e.derivedFrom&&e.dbAttrs.length>0}function gu(e){for(const n of e){const o=[...n.attributes].sort((s,c)=>s.order-c.order),i=o.filter(yu);if(!i.length)continue;const a=o.filter(s=>!yu(s));let r=0;a.forEach((s,c)=>{s.identifier&&!s.derivedFrom&&(r=c+1)});const l=[...a.slice(0,r),...i,...a.slice(r)];l.forEach((s,c)=>s.order=c),n.attributes=l}}function Zo(e){return JSON.parse(JSON.stringify(e))}function bu(e,n,o){var A;const i=o.idFactory??Fe,a=o.offset??{x:0,y:0},{logical:r,layout:l}=e,s=new Set(n);if(o.includeRelated){const T=new Set(n);for(const O of r.associations){const z=T.has(O.end1.entityRef),P=T.has(O.end2.entityRef);z!==P&&s.add(z?O.end2.entityRef:O.end1.entityRef)}}const c=r.entities.filter(T=>s.has(T.modelId)),d=new Set(c.map(T=>T.modelId)),u=r.associations.filter(T=>d.has(T.end1.entityRef)&&d.has(T.end2.entityRef)),m=new Set(u.map(T=>T.modelId)),f=new Map,p=T=>{let O=f.get(T);return O||(O=i(),f.set(T,O)),O};for(const T of c){p(T.modelId);for(const O of T.attributes){p(O.modelId);for(const z of O.dbAttrs)p(z.modelId)}for(const O of T.indexes??[])p(O.modelId);for(const O of T.operations??[])p(O.modelId)}for(const T of u)p(T.modelId);const y=T=>f.get(T),g=c.map(T=>{const O=Zo(T);O.modelId=y(T.modelId),O.attributes=O.attributes.map(z=>Ik(z,y,m,d));for(const z of O.indexes??[])z.modelId=y(z.modelId),z.columns=z.columns.map(P=>co(P.columnRef)?P:{...P,columnRef:y(P.columnRef)}).filter(P=>P.columnRef!==void 0);for(const z of O.operations??[])z.modelId=y(z.modelId);return O});gu(g);const b=u.map(T=>{const O=Zo(T);return O.modelId=y(T.modelId),O.end1=ku(O.end1,y),O.end2=ku(O.end2,y),O}),k=[];for(const T of r.groups){const O=T.memberEntityRefs.filter(P=>d.has(P));if(O.length===0)continue;const z=Zo(T);z.modelId=p(T.modelId),z.memberEntityRefs=O.map(P=>y(P)),k.push(z)}const _=o.collisionSuffix??"_imported",h=new Set(o.existing.entities.map(T=>T.name)),C=new Set(o.existing.entities.map(T=>{var O;return(O=T.table)==null?void 0:O.physicalName}).filter(T=>!!T));for(const T of g)h.has(T.name)&&(T.name=`${T.name}${_}`),(A=T.table)!=null&&A.physicalName&&C.has(T.table.physicalName)&&(T.table.physicalName=`${T.table.physicalName}${_}`);const v=[];for(const T of l.entityLayouts){const O=y(T.entityRef);if(!O)continue;const z=Zo(T);z.entityRef=O,z.geo={...z.geo,location:Xl(z.geo.location,a)},z.attributeStyles&&(z.attributeStyles=Va(z.attributeStyles,y)),z.operationStyles&&(z.operationStyles=Va(z.operationStyles,y)),v.push(z)}const S=[];for(const T of l.associationLayouts){const O=y(T.associationRef);if(!O)continue;const z=Zo(T);z.associationRef=O,z.sourceColumnRef=T.sourceColumnRef?y(T.sourceColumnRef):void 0,z.targetColumnRef=T.targetColumnRef?y(T.targetColumnRef):void 0,z.waypoints=z.waypoints.map(P=>Xl(P,a)),S.push(z)}const N=[];for(const T of l.groupLayouts){const O=y(T.groupRef);if(!O)continue;const z=Zo(T);z.groupRef=O,z.geo={...z.geo,location:Xl(z.geo.location,a)},delete z.memberNoteRefs,N.push(z)}return{logical:{entities:g,associations:b,groups:k},layout:{entityLayouts:v,associationLayouts:S,groupLayouts:N},idMap:f}}function Xl(e,n){return{x:e.x+n.x,y:e.y+n.y}}function Ik(e,n,o,i){e.modelId=n(e.modelId);for(const a of e.dbAttrs)if(a.modelId=n(a.modelId),a.sharedColumnRef!==void 0){const r=n(a.sharedColumnRef);r?a.sharedColumnRef=r:delete a.sharedColumnRef}return e.derivedFrom&&(o.has(e.derivedFrom.associationRef)?e.derivedFrom={associationRef:n(e.derivedFrom.associationRef),sourceAttributeRef:n(e.derivedFrom.sourceAttributeRef)??e.derivedFrom.sourceAttributeRef}:(delete e.derivedFrom,(e.attrType==="RELATION_OWN"||e.attrType==="RELATION_REF")&&(e.attrType="NORMAL"))),e.embedded&&(i.has(e.embedded.embeddableRef)?e.embedded={associationRef:n(e.embedded.associationRef)??e.embedded.associationRef,embeddableRef:n(e.embedded.embeddableRef)}:(delete e.embedded,e.attrType.startsWith("EMBED")&&(e.attrType="NORMAL"))),e}function ku(e,n){return{...e,entityRef:n(e.entityRef),attributeRef:e.attributeRef?n(e.attributeRef):void 0}}function Va(e,n){const o={};for(const[i,a]of Object.entries(e)){const r=n(i);r&&(o[r]=a)}return o}function Zl(e){if(!("rev"in e))return e;const{rev:n,...o}=e;return o}function _o(e,n){if(e===n||e==null&&n==null)return!0;if(e==null||n==null)return!1;if(Array.isArray(e)||Array.isArray(n))return!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length?!1:e.every((o,i)=>_o(o,n[i]));if(typeof e=="object"&&typeof n=="object"){const o=new Set([...Object.keys(e),...Object.keys(n)]);for(const i of o)if(!_o(e[i],n[i]))return!1;return!0}return!1}function Eo(e,n,o){const i={},a=new Set([...Object.keys(e),...Object.keys(n)]);for(const r of a)o.has(r)||_o(e[r],n[r])||(i[r]=n[r]===void 0?null:n[r]);return Object.keys(i).length?i:null}function No(e,n,o){const i=new Map(e.map(d=>[o(d),d])),a=new Map(n.map(d=>[o(d),d])),r=[],l=[],s=[];for(const[d,u]of a){const m=i.get(d);m?s.push({cur:m,tgt:u}):r.push(u)}for(const[d,u]of i)a.has(d)||l.push(u);const c=(d,u)=>o(d)<o(u)?-1:o(d)>o(u)?1:0;return r.sort(c),l.sort(c),s.sort((d,u)=>c(d.tgt,u.tgt)),{added:r,removed:l,common:s}}function vk(e,n){const o=new Set(e),i=new Set(n),a=n.filter(l=>!o.has(l)).sort(),r=e.filter(l=>!i.has(l)).sort();return{added:a,removed:r}}const Ck=new Set(["attributes","operations","indexes","rev"]),Sk=new Set(["end1","end2","rev"]),Rk=new Set(["memberEntityRefs","rev"]),_u=new Set(["modelId"]),Ak=new Set(["modelId","columns"]),xk=new Set([]);function $k(e,n,o,i){const a=No(n.attributes??[],o.attributes??[],s=>s.modelId);for(const s of a.removed)i.push({kind:"attribute.remove",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:s.modelId});for(const s of a.added)i.push({kind:"attribute.add",casUnit:"logical",containerRef:e,entityRef:e,value:s});for(const{cur:s,tgt:c}of a.common){const d=Eo(s,c,_u);d&&i.push({kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:s.modelId,patch:d})}const r=No(n.operations??[],o.operations??[],s=>s.modelId);for(const s of r.removed)i.push({kind:"operation.remove",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId});for(const s of r.added)i.push({kind:"operation.add",casUnit:"logical",containerRef:e,entityRef:e,value:s});for(const{cur:s,tgt:c}of r.common){const d=Eo(s,c,_u);d&&i.push({kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId,patch:d})}const l=No(n.indexes??[],o.indexes??[],s=>s.modelId);for(const s of l.removed)i.push({kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId});for(const s of l.added)i.push({kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:s});for(const{cur:s,tgt:c}of l.common){if(!_o(s.columns,c.columns)){i.push({kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId}),i.push({kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:c});continue}const d=Eo(s,c,Ak);d&&i.push({kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId,patch:d})}}function Tk(e,n,o){const i=No(e.entities??[],n.entities??[],l=>l.modelId);for(const l of i.removed)o.push({kind:"entity.remove",casUnit:"logical",entityRef:l.modelId});for(const l of i.added)o.push({kind:"entity.add",casUnit:"logical",entityRef:l.modelId,value:Zl(l)});for(const{cur:l,tgt:s}of i.common){const c=Eo(l,s,Ck);c&&o.push({kind:"entity.update",casUnit:"logical",containerRef:l.modelId,entityRef:l.modelId,patch:c}),$k(l.modelId,l,s,o)}const a=No(e.associations??[],n.associations??[],l=>l.modelId);for(const l of a.removed)o.push({kind:"association.remove",casUnit:"logical",associationRef:l.modelId});for(const l of a.added)o.push({kind:"association.add",casUnit:"logical",associationRef:l.modelId,value:Zl(l)});for(const{cur:l,tgt:s}of a.common){const c=Eo(l,s,Sk);c&&o.push({kind:"association.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,patch:c});for(const d of["end1","end2"]){const u=Eo(l[d]??{},s[d]??{},xk);u&&o.push({kind:"associationEnd.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,end:d,patch:u})}}const r=No(e.groups??[],n.groups??[],l=>l.modelId);for(const l of r.removed)o.push({kind:"group.remove",casUnit:"logical",groupRef:l.modelId});for(const l of r.added)o.push({kind:"group.add",casUnit:"logical",groupRef:l.modelId,value:Zl(l)});for(const{cur:l,tgt:s}of r.common){const c=Eo(l,s,Rk);c&&o.push({kind:"group.update",casUnit:"logical",containerRef:l.modelId,groupRef:l.modelId,patch:c});const d=vk(l.memberEntityRefs??[],s.memberEntityRefs??[]);for(const u of d.removed)o.push({kind:"group.removeMember",casUnit:"logical",containerRef:l.modelId,groupRef:l.modelId,entityRef:u});for(const u of d.added)o.push({kind:"group.addMember",casUnit:"logical",containerRef:l.modelId,groupRef:l.modelId,entityRef:u})}}function La(e,n,o,i,a,r,l){const s=No(e,n,o);for(const c of s.removed)l.push({kind:a,casUnit:"layout",[r]:o(c),value:void 0});for(const c of s.added)l.push({kind:i,casUnit:"layout",[r]:o(c),value:c});for(const{cur:c,tgt:d}of s.common)_o(c,d)||(l.push({kind:a,casUnit:"layout",[r]:o(c),value:void 0}),l.push({kind:i,casUnit:"layout",[r]:o(d),value:d}))}function Mk(e,n,o){La(e.entityLayouts??[],n.entityLayouts??[],i=>i.entityRef,"entityLayout.add","entityLayout.remove","entityRef",o),La(e.associationLayouts??[],n.associationLayouts??[],i=>i.associationRef,"associationLayout.add","associationLayout.remove","associationRef",o),La(e.groupLayouts??[],n.groupLayouts??[],i=>i.groupRef,"groupLayout.add","groupLayout.remove","groupRef",o),La(e.notes??[],n.notes??[],i=>i.modelId,"note.add","note.remove","noteRef",o)}function Vk(e,n){const o=[];return Tk(e.logical,n.logical,o),Mk(e.layout,n.layout,o),o}function Lk(e){if(e.groupRef!=null)return"group";if(e.noteRef!=null)return"note";if(e.associationRef!=null)return e.end!=null?"associationEnd":"association";if(e.entityRef!=null&&e.attributeRef!=null)return"attribute";if(e.entityRef!=null&&e.operationRef!=null)return"operation";if(e.entityRef!=null&&e.indexRef!=null)return"index";if(e.entityRef!=null)return"entity";throw new Error("projectFieldAudit: 대상 로케이터가 비었습니다(entityRef/associationRef/groupRef/noteRef 중 하나 필요).")}const Bk={entity:new Set(["attributes","operations","indexes","rev","modelId"]),association:new Set(["end1","end2","rev","modelId"]),group:new Set(["memberEntityRefs","rev","modelId"]),attribute:new Set(["modelId"]),operation:new Set(["modelId"]),index:new Set(["modelId"]),associationEnd:new Set([]),note:new Set(["geo","style","connections","legacyRaw","modelId"])};class Dk{constructor(n){st(this,"out",[]);st(this,"last",new Map);this.fieldFilter=n}set(n,o,i){if(this.fieldFilter!=null&&o!==this.fieldFilter)return;const a=this.last.get(o);this.out.push({...$i(n),field:o,value:i,...this.last.has(o)?{oldValue:a}:{}}),this.last.set(o,i)}remove(n,o){if(o!=null){if(this.fieldFilter!=null&&o!==this.fieldFilter)return;this.out.push({...$i(n),field:o,value:void 0,removed:!0,...this.last.has(o)?{oldValue:this.last.get(o)}:{}}),this.last.delete(o);return}const i=this.fieldFilter!=null?[this.fieldFilter]:[...this.last.keys()];for(const a of i){if(!this.last.has(a)){this.out.push({...$i(n),field:a,value:void 0,removed:!0});continue}this.out.push({...$i(n),field:a,value:void 0,removed:!0,oldValue:this.last.get(a)}),this.last.delete(a)}}collectionMember(n,o,i,a){this.fieldFilter!=null&&o!==this.fieldFilter||this.out.push({...$i(n),field:o,value:i,...a?{removed:!0}:{}})}member(n,o,i){this.collectionMember(n,"memberEntityRefs",o,i)}result(){return this.out}}function $i(e){const n={seq:e.seq};return e.ts!==void 0&&(n.ts=e.ts),e.origin!==void 0&&(n.origin=e.origin),e.author!==void 0&&(n.author=e.author),e.kind!==void 0&&(n.kind=e.kind),e.restoredFromSeq!==void 0&&(n.restoredFromSeq=e.restoredFromSeq),n}function en(e,n,o,i){if(o==null||typeof o!="object")return;const a=Bk[i];for(const[r,l]of Object.entries(o))a.has(r)||e.set(n,r,l)}function wo(e,n,o){if(!(o==null||typeof o!="object"))for(const[i,a]of Object.entries(o))e.set(n,i,a)}function Ql(e,n){if(Array.isArray(e))return e.find(o=>o.modelId===n)}function Tn(e,n){var r,l,s,c,d,u,m,f,p,y;const o=Lk(n),i=new Dk(n.field),a=[...e].sort((g,b)=>g.seq-b.seq);for(const g of a)for(const b of g.ops)switch(o){case"entity":if(b.entityRef!==n.entityRef)break;b.kind==="entity.add"?en(i,g,b.value,"entity"):b.kind==="entity.update"?wo(i,g,b.patch):b.kind==="entity.remove"&&i.remove(g);break;case"attribute":if(b.entityRef!==n.entityRef)break;if(b.kind==="entity.add"){const k=Ql((r=b.value)==null?void 0:r.attributes,n.attributeRef);k&&en(i,g,k,"attribute")}else b.kind==="attribute.add"&&((l=b.value)==null?void 0:l.modelId)===n.attributeRef?en(i,g,b.value,"attribute"):b.kind==="attribute.update"&&b.attributeRef===n.attributeRef?wo(i,g,b.patch):(b.kind==="attribute.remove"&&b.attributeRef===n.attributeRef||b.kind==="entity.remove")&&i.remove(g);break;case"operation":if(b.entityRef!==n.entityRef)break;if(b.kind==="entity.add"){const k=Ql((s=b.value)==null?void 0:s.operations,n.operationRef);k&&en(i,g,k,"operation")}else b.kind==="operation.add"&&((c=b.value)==null?void 0:c.modelId)===n.operationRef?en(i,g,b.value,"operation"):b.kind==="operation.update"&&b.operationRef===n.operationRef?wo(i,g,b.patch):(b.kind==="operation.remove"&&b.operationRef===n.operationRef||b.kind==="entity.remove")&&i.remove(g);break;case"index":if(b.entityRef!==n.entityRef)break;if(b.kind==="entity.add"){const k=Ql((d=b.value)==null?void 0:d.indexes,n.indexRef);k&&en(i,g,k,"index")}else b.kind==="index.add"&&((u=b.value)==null?void 0:u.modelId)===n.indexRef?en(i,g,b.value,"index"):b.kind==="index.update"&&b.indexRef===n.indexRef?wo(i,g,b.patch):(b.kind==="index.remove"&&b.indexRef===n.indexRef||b.kind==="entity.remove")&&i.remove(g);break;case"association":if(b.associationRef!==n.associationRef)break;b.kind==="association.add"?en(i,g,b.value,"association"):b.kind==="association.update"?wo(i,g,b.patch):b.kind==="association.remove"&&i.remove(g);break;case"associationEnd":if(b.associationRef!==n.associationRef)break;if(b.kind==="association.add"){const k=(m=b.value)==null?void 0:m[n.end];en(i,g,k,"associationEnd")}else b.kind==="associationEnd.update"&&b.end===n.end?wo(i,g,b.patch):b.kind==="association.remove"&&i.remove(g);break;case"group":if(b.groupRef!==n.groupRef)break;if(b.kind==="group.add"){en(i,g,b.value,"group");const k=(f=b.value)==null?void 0:f.memberEntityRefs;if(Array.isArray(k))for(const _ of k)i.member(g,_,!1)}else b.kind==="group.update"?wo(i,g,b.patch):b.kind==="group.remove"?i.remove(g):b.kind==="group.addMember"&&b.entityRef!=null?i.member(g,b.entityRef,!1):b.kind==="group.removeMember"&&b.entityRef!=null&&i.member(g,b.entityRef,!0);break;case"note":if(b.noteRef!==n.noteRef)break;if(b.kind==="note.add"){en(i,g,b.value,"note");const k=(p=b.value)==null?void 0:p.connections;if(Array.isArray(k))for(const _ of k){const h=_.targetRef;typeof h=="string"&&i.collectionMember(g,"connections",h,!1)}}else if(b.kind==="note.setMemo"){const k=(y=b.value)==null?void 0:y.memo;k!==void 0&&i.set(g,"memo",k)}else b.kind==="note.remove"?i.remove(g):b.kind==="noteConnection.add"&&typeof b.targetRef=="string"?i.collectionMember(g,"connections",b.targetRef,!1):b.kind==="noteConnection.remove"&&typeof b.targetRef=="string"&&i.collectionMember(g,"connections",b.targetRef,!0);break}return i.result()}const kt={subject:null,existence:null,fieldAudit:!1,note:"레이아웃 축(LWW) — 감사·복원 diff는 논리 축 전용(AA-5: 좌표·크기·스타일은 의도적 범위 밖)"},Ba={subject:null,existence:null,fieldAudit:!1,note:"노트의 기하·스타일 축 — 캔버스에서 가장 자주 바뀌어 편입하면 이력을 덮는다(존재·메모·연결만 편입)"},Ok={"entity.add":{subject:"entity",existence:"add",fieldAudit:!0},"entity.update":{subject:"entity",existence:null,fieldAudit:!0},"entity.remove":{subject:"entity",existence:"remove",fieldAudit:!0},"attribute.add":{subject:"attribute",existence:"add",fieldAudit:!0},"attribute.update":{subject:"attribute",existence:null,fieldAudit:!0},"attribute.remove":{subject:"attribute",existence:"remove",fieldAudit:!0},"operation.add":{subject:"operation",existence:"add",fieldAudit:!0},"operation.update":{subject:"operation",existence:null,fieldAudit:!0},"operation.remove":{subject:"operation",existence:"remove",fieldAudit:!0},"index.add":{subject:"index",existence:"add",fieldAudit:!0},"index.update":{subject:"index",existence:null,fieldAudit:!0},"index.remove":{subject:"index",existence:"remove",fieldAudit:!0},"attribute.reorder":{subject:null,existence:null,fieldAudit:!1,note:"과거 어휘(호스트 지원·lib 미방출). 컬렉션 순서 축이라 subject 단위 필드 변경으로 표현 안 됨"},"operation.reorder":{subject:null,existence:null,fieldAudit:!1,note:"과거 어휘(호스트 지원·lib 미방출). attribute.reorder와 동형"},"association.add":{subject:"association",existence:"add",fieldAudit:!0},"association.update":{subject:"association",existence:null,fieldAudit:!0},"association.remove":{subject:"association",existence:"remove",fieldAudit:!0},"associationEnd.update":{subject:"associationEnd",existence:null,fieldAudit:!0},"group.add":{subject:"group",existence:"add",fieldAudit:!0},"group.update":{subject:"group",existence:null,fieldAudit:!0},"group.remove":{subject:"group",existence:"remove",fieldAudit:!0},"group.addMember":{subject:"group",existence:null,fieldAudit:!0},"group.removeMember":{subject:"group",existence:null,fieldAudit:!0},"entityLayout.add":kt,"entityLayout.remove":kt,"entityLayout.move":kt,"entityLayout.resize":kt,"entityLayout.setCollapsed":kt,"entityLayout.setLocked":kt,"entityLayout.setStyle":kt,"entityLayout.setAttrStyle":kt,"entityLayout.setOpStyle":kt,"groupLayout.add":kt,"groupLayout.remove":kt,"groupLayout.move":kt,"groupLayout.resize":kt,"groupLayout.setLocked":kt,"groupLayout.setStyle":kt,"groupLayout.addNoteMember":kt,"groupLayout.removeNoteMember":kt,"associationLayout.add":kt,"associationLayout.remove":kt,"associationLayout.setWaypoints":kt,"note.add":{subject:"note",existence:"add",fieldAudit:!0},"note.remove":{subject:"note",existence:"remove",fieldAudit:!0},"note.setMemo":{subject:"note",existence:null,fieldAudit:!0},"note.move":Ba,"note.resize":Ba,"note.setStyle":Ba,"noteConnection.add":{subject:"note",existence:null,fieldAudit:!0},"noteConnection.remove":{subject:"note",existence:null,fieldAudit:!0},"noteConnection.setWaypoints":Ba},Gt=e=>typeof e=="string"?e:void 0,Pk=e=>{var n;return Gt((n=e.value)==null?void 0:n.modelId)};function Eu(e){return Gt(e.containerRef)??Gt(e.entityRef)}function es(e,n,o,i){var l;const a=(l=e.value)==null?void 0:l[n];if(!Array.isArray(a))return[];const r=[];for(const s of a){const c=Gt(s.modelId);c&&r.push({subject:{kind:o,ref:c,...i?{entityRef:i}:{}},existence:"add",inline:!0})}return r}function Da(e){const n=Ok[e.kind];if(!n||!n.subject)return[];const o=e,i=n.existence??void 0;switch(n.subject){case"entity":{const a=Gt(o.entityRef);if(!a)return[];const r={subject:{kind:"entity",ref:a},...i?{existence:i}:{}};return e.kind!=="entity.add"?[r]:[r,...es(o,"attributes","attribute",a),...es(o,"operations","operation",a),...es(o,"indexes","index",a)]}case"attribute":case"operation":case"index":{const a=n.subject,r=Eu(o),l={attribute:"attributeRef",operation:"operationRef",index:"indexRef"}[a],s=i==="add"?Pk(o):Gt(o[l]);return s?[{subject:{kind:a,ref:s,...r?{entityRef:r}:{}},...i?{existence:i}:{}}]:[]}case"association":case"associationEnd":{const a=Gt(o.associationRef);if(!a)return[];const r=o.end==="end1"||o.end==="end2"?o.end:void 0;return[{subject:{kind:n.subject,ref:a,...r?{end:r}:{}},...i?{existence:i}:{}}]}case"group":{const a=Gt(o.groupRef);return a?[{subject:{kind:"group",ref:a},...i?{existence:i}:{}}]:[]}case"note":{const a=Gt(o.noteRef);return a?[{subject:{kind:"note",ref:a},...i?{existence:i}:{}}]:[]}}}function zk(e){const n=e,o=e.kind;if(o.startsWith("entity.")){const i=Gt(n.entityRef);return i?{kind:"entity",ref:i}:null}if(o.startsWith("attribute.")||o.startsWith("operation.")||o.startsWith("index.")){const i=Eu(n);return i?{kind:"entity",ref:i}:null}if(o.startsWith("associationEnd.")||o.startsWith("association.")){const i=Gt(n.associationRef);return i?{kind:"association",ref:i}:null}if(o.startsWith("group.")){const i=Gt(n.groupRef);return i?{kind:"group",ref:i}:null}if(o.startsWith("note.")||o.startsWith("noteConnection.")){const i=Gt(n.noteRef);return i?{kind:"note",ref:i}:null}return null}function Fk(e,n){const o=e;return o.entityRef===n||o.containerRef===n}function Uk(e,n){const o=new Set,i=new Set,a=new Set,r={attribute:o,operation:i,index:a};for(const l of e)for(const s of l.ops)for(const{subject:c}of Da(s))c.kind==="entity"||c.entityRef!==n||c.kind in r&&r[c.kind].add(c.ref);return{attributes:o,operations:i,indexes:a}}function Oa(e,n){return e.map(o=>({...o,subject:n}))}function Nu(e,n){const o=e.filter(s=>s.ops.some(c=>Fk(c,n))),{attributes:i,operations:a,indexes:r}=Uk(o,n),l=[...Oa(Tn(o,{entityRef:n}),{kind:"entity",ref:n})];for(const s of i)l.push(...Oa(Tn(o,{entityRef:n,attributeRef:s}),{kind:"attribute",ref:s}));for(const s of a)l.push(...Oa(Tn(o,{entityRef:n,operationRef:s}),{kind:"operation",ref:s}));for(const s of r)l.push(...Oa(Tn(o,{entityRef:n,indexRef:s}),{kind:"index",ref:s}));return l.map((s,c)=>({e:s,i:c})).sort((s,c)=>s.e.seq-c.e.seq||s.i-c.i).map(({e:s})=>s)}function Pa(e){return`${e.kind}:${e.ref}:${e.end??""}`}function Hk(e){const n=new Set;for(const o of e)for(const i of o.ops)for(const a of Da(i))a.existence==="add"&&n.add(Pa(a.subject));return n}function jk(e){const n=new Map;for(const o of e)for(const i of o.ops)for(const a of Da(i)){if(a.existence!=="remove")continue;let r=n.get(o.seq);r||(r=new Map,n.set(o.seq,r)),r.set(Pa(a.subject),a.subject)}return n}function Kk(e){const n=new Set,o=new Set,i=new Set,a=new Set,r={entity:n,association:o,group:i,note:a};for(const l of e)for(const s of l.ops){const c=zk(s);c&&r[c.kind].add(c.ref)}return{entities:n,associations:o,groups:i,notes:a}}function Gk(e){const{entities:n,associations:o,groups:i,notes:a}=Kk(e),r=[];for(const l of n)for(const s of Nu(e,l))r.push({...s,subject:{...s.subject,entityRef:l}});for(const l of o){for(const s of Tn(e,{associationRef:l}))r.push({...s,subject:{kind:"association",ref:l}});for(const s of["end1","end2"])for(const c of Tn(e,{associationRef:l,end:s}))r.push({...c,subject:{kind:"associationEnd",ref:l,end:s}})}for(const l of i)for(const s of Tn(e,{groupRef:l}))r.push({...s,subject:{kind:"group",ref:l}});for(const l of a)for(const s of Tn(e,{noteRef:l}))r.push({...s,subject:{kind:"note",ref:l}});return r}function ts(e){const n=Gk(e),o=Hk(e),i=jk(e),a=(c,d)=>{var u;return((u=i.get(c))==null?void 0:u.has(d))===!0},r=new Map;for(const c of n){const d=Pa(c.subject),u=r.get(d);(u===void 0||c.seq<u)&&r.set(d,c.seq)}const l=new Map;for(const c of n){let d=l.get(c.seq);d||(d={meta:c,subjects:new Map},l.set(c.seq,d));const u=Pa(c.subject),m=a(c.seq,u);let f=d.subjects.get(u);if(!f){const p=m?"remove":r.get(u)===c.seq&&o.has(u)?"add":"update";f={subject:c.subject,verb:p,fields:[]},d.subjects.set(u,f)}m&&c.removed||f.fields.push({field:c.field,value:c.value,...c.oldValue!==void 0?{oldValue:c.oldValue}:{},...c.removed?{removed:!0}:{}})}for(const c of e){const d=i.get(c.seq);if(!d)continue;let u=l.get(c.seq);u||(u={meta:c,subjects:new Map},l.set(c.seq,u));for(const[m,f]of d){const p=u.subjects.get(m),y=f.kind==="entity"?{...f,entityRef:f.ref}:f;p?p.verb="remove":u.subjects.set(m,{subject:y,verb:"remove",fields:[]})}}const s=[];for(const[c,d]of l){const u=d.meta;s.push({seq:c,...u.ts!==void 0?{ts:u.ts}:{},...u.origin!==void 0?{origin:u.origin}:{},...u.author!==void 0?{author:u.author}:{},...u.kind!==void 0?{kind:u.kind}:{},...u.restoredFromSeq!==void 0?{restoredFromSeq:u.restoredFromSeq}:{},actions:[...d.subjects.values()]})}return s.sort((c,d)=>d.seq-c.seq)}function wu(e){return`${e.kind}:${e.ref}:${e.end??""}`}function Yk(e,n,o){const i=[];for(const a of e)if(!(a.seq<=n||a.seq>o))for(const r of a.ops)for(const l of Da(r)){if(!l.existence||l.inline)continue;const s=l.subject;qk.has(s.kind)&&!s.entityRef||i.push({seq:a.seq,subject:s,verb:l.existence,fields:[]})}return i}const qk=new Set(["attribute","operation","index"]);function ns(e,n){const{fromSeq:o}=n,i=ts(e);let a=o;for(const m of e)m.seq>a&&(a=m.seq);const r=n.toSeq??a,l=i.filter(m=>m.seq>o&&m.seq<=r).reverse(),s=new Map,c=m=>{const f=wu(m.subject);let p=s.get(f);p||(p={subject:m.subject,evs:[]},s.set(f,p)),p.evs.push(m)};for(const m of l)for(const f of m.actions)c({seq:m.seq,subject:f.subject,verb:f.verb,fields:f.fields});for(const m of Yk(e,o,r)){const f=s.get(wu(m.subject));f!=null&&f.evs.some(p=>p.seq===m.seq)||c(m)}const d=[],u=new Set;for(const m of s.values()){m.evs.sort((p,y)=>p.seq-y.seq);const f=m.evs[m.evs.length-1];m.subject.kind==="entity"&&f.verb==="remove"&&u.add(m.subject.ref)}for(const m of s.values()){const f=m.evs[0].verb==="add",p=m.evs[m.evs.length-1].verb==="remove";if(m.subject.kind!=="entity"&&m.subject.entityRef&&u.has(m.subject.entityRef)||f&&p)continue;const y=new Map;let g=null;for(const k of m.evs){k.verb==="add"&&g!==null&&g!=="add"&&y.clear(),g=k.verb;for(const _ of k.fields){const h=y.get(_.field);h?h.lastValue=_.value:y.set(_.field,{firstOld:_.oldValue,hasOld:_.oldValue!==void 0,lastValue:_.value})}}if(p){d.push({subject:m.subject,verb:"removed",fields:[]});continue}if(f){const k=[];for(const[_,h]of y)k.push({field:_,value:h.lastValue});d.push({subject:m.subject,verb:"added",fields:k});continue}const b=[];for(const[k,_]of y)_.hasOld&&_o(_.firstOld,_.lastValue)||b.push({field:k,value:_.lastValue,..._.hasOld?{oldValue:_.firstOld}:{}});b.length!==0&&d.push({subject:m.subject,verb:"modified",fields:b})}return{fromSeq:o,toSeq:r,entries:d}}function Iu(e){const n=new Map,o=i=>{let a=n.get(i);return a||(a={verb:"modified",changedAttributeIds:new Set,changedOperationIds:new Set},n.set(i,a)),a};for(const i of e.entries){const a=i.subject;if(a.kind==="entity"){if(i.verb==="removed")continue;o(a.ref).verb=i.verb}else if((a.kind==="attribute"||a.kind==="operation"||a.kind==="index")&&a.entityRef){const r=o(a.entityRef);i.verb!=="removed"&&(a.kind==="attribute"?r.changedAttributeIds.add(a.ref):a.kind==="operation"&&r.changedOperationIds.add(a.ref))}}return n}class os{constructor(n){st(this,"undoStack",[]);st(this,"redoStack",[]);st(this,"savePoint",null);st(this,"listeners",new Set);st(this,"commandListeners",new Set);st(this,"coalesceSealed",!1);this.state=n}execute(n){n.apply(this.state);const o=this.undoStack.at(-1),i=!this.coalesceSealed&&n.coalesceKey!=null&&!!o&&o.coalesceKey===n.coalesceKey;this.coalesceSealed=!1,i?(n.invert=o.invert,this.undoStack[this.undoStack.length-1]=n):this.undoStack.push(n),this.redoStack=[],this.emitCommand(n,"do",i),this.emit()}undo(){const n=this.undoStack.pop();n&&(n.invert(this.state),this.redoStack.push(n),this.emitCommand(n,"undo",!1),this.emit())}redo(){const n=this.redoStack.pop();n&&(n.apply(this.state),this.undoStack.push(n),this.emitCommand(n,"redo",!1),this.emit())}sealCoalesce(){this.coalesceSealed=!0}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}markSavePoint(){this.savePoint=this.undoStack.at(-1)??null,this.sealCoalesce(),this.emit()}get isDirty(){return(this.undoStack.at(-1)??null)!==this.savePoint}onChange(n){return this.listeners.add(n),()=>this.listeners.delete(n)}onCommand(n){return this.commandListeners.add(n),()=>this.commandListeners.delete(n)}emit(){for(const n of this.listeners)n()}emitCommand(n,o,i){for(const a of this.commandListeners)a(n,o,i)}}function Ft(e){const n={};for(const[o,i]of Object.entries(e))n[o]=i===void 0?null:i;return n}function vu(e,n){var r,l;const o={logical:structuredClone(e.logical),layout:structuredClone(e.layout)},i=[],a=[];for(const s of n){s.apply(o);const c=((l=(r=s.emitOps)==null?void 0:r.call(s,o))==null?void 0:l.forward)??[];c.length===0&&a.push(s.label),i.push(...c)}return{ops:i,skipped:a}}function Cu(e,n){return e.logical.entities.findIndex(o=>o.modelId===n)}function It(e,n){return e.layout.entityLayouts.findIndex(o=>o.entityRef===n)}function tn(e,n){return e.layout.associationLayouts.find(o=>o.associationRef===n)}function dt(e,n){const o=e.logical.entities.find(i=>i.modelId===n);if(!o)throw new Error(`엔티티 없음: ${n}`);return o}function Mn(e,n,o){var i,a;return(a=(i=e.layout.notes.find(r=>r.modelId===n))==null?void 0:i.connections)==null?void 0:a.find(r=>r.targetRef===o)}function za(e,n,o){return{label:`엔티티 추가: ${e.name}`,apply(i){i.logical.entities.push(e),i.layout.entityLayouts.push({entityRef:e.modelId,geo:n,...o})},invert(i){const a=Cu(i,e.modelId);a>=0&&i.logical.entities.splice(a,1);const r=It(i,e.modelId);r>=0&&i.layout.entityLayouts.splice(r,1)},emitOps(){const i={kind:"entity.add",casUnit:"logical",entityRef:e.modelId,value:e},a={kind:"entityLayout.add",casUnit:"layout",entityRef:e.modelId,value:{entityRef:e.modelId,geo:n,...o},incidental:!0};return{forward:[i,a],invert:[{kind:"entityLayout.remove",casUnit:"layout",entityRef:e.modelId,incidental:!0},{kind:"entity.remove",casUnit:"logical",entityRef:e.modelId}]}}}}function Su(e){let n=null;const o=i=>i.end1.entityRef===e||i.end2.entityRef===e;return{label:"엔티티 삭제",apply(i){const a=Cu(i,e);if(a<0)throw new Error(`엔티티 없음: ${e}`);const r=It(i,e),l=[];i.logical.associations.forEach((u,m)=>{o(u)&&l.push({item:u,index:m})});const s=new Set(l.map(u=>u.item.modelId)),c=[];i.layout.associationLayouts.forEach((u,m)=>{s.has(u.associationRef)&&c.push({item:u,index:m})});const d=[];i.logical.groups.forEach(u=>{const m=u.memberEntityRefs.indexOf(e);m>=0&&d.push({groupId:u.modelId,index:m})}),n={entity:{item:i.logical.entities[a],index:a},entityLayout:r>=0?{item:i.layout.entityLayouts[r],index:r}:void 0,assocs:l,assocLayouts:c,groupMemberships:d},[...c].sort((u,m)=>m.index-u.index).forEach(u=>i.layout.associationLayouts.splice(u.index,1)),[...l].sort((u,m)=>m.index-u.index).forEach(u=>i.logical.associations.splice(u.index,1));for(const u of d){const m=i.logical.groups.find(f=>f.modelId===u.groupId);m==null||m.memberEntityRefs.splice(u.index,1)}r>=0&&i.layout.entityLayouts.splice(r,1),i.logical.entities.splice(a,1)},invert(i){if(n){i.logical.entities.splice(n.entity.index,0,n.entity.item),n.entityLayout&&i.layout.entityLayouts.splice(n.entityLayout.index,0,n.entityLayout.item),[...n.assocs].sort((a,r)=>a.index-r.index).forEach(a=>i.logical.associations.splice(a.index,0,a.item)),[...n.assocLayouts].sort((a,r)=>a.index-r.index).forEach(a=>i.layout.associationLayouts.splice(a.index,0,a.item));for(const a of n.groupMemberships){const r=i.logical.groups.find(l=>l.modelId===a.groupId);r==null||r.memberEntityRefs.splice(a.index,0,e)}}},emitOps(){if(!n)return{forward:[],invert:[]};const i=[],a=[];for(const r of n.assocs)i.push({kind:"association.remove",casUnit:"logical",associationRef:r.item.modelId}),a.push({kind:"association.add",casUnit:"logical",associationRef:r.item.modelId,value:r.item});for(const r of n.assocLayouts)i.push({kind:"associationLayout.remove",casUnit:"layout",associationRef:r.item.associationRef,incidental:!0}),a.push({kind:"associationLayout.add",casUnit:"layout",associationRef:r.item.associationRef,value:r.item,incidental:!0});for(const r of n.groupMemberships)i.push({kind:"group.removeMember",casUnit:"logical",containerRef:r.groupId,groupRef:r.groupId,entityRef:e}),a.push({kind:"group.addMember",casUnit:"logical",containerRef:r.groupId,groupRef:r.groupId,entityRef:e});return n.entityLayout&&(i.push({kind:"entityLayout.remove",casUnit:"layout",entityRef:e,incidental:!0}),a.push({kind:"entityLayout.add",casUnit:"layout",entityRef:e,value:n.entityLayout.item,incidental:!0})),i.push({kind:"entity.remove",casUnit:"logical",entityRef:e}),a.push({kind:"entity.add",casUnit:"logical",entityRef:e,value:n.entity.item}),{forward:i,invert:a.reverse()}}}}function Fa(e,n){const o={};return{label:"엔티티 수정",apply(i){const a=dt(i,e);for(const r of Object.keys(n))o[r]=a[r];Object.assign(a,n)},invert(i){Object.assign(dt(i,e),o)},emitOps(){return{forward:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:Ft(n)}],invert:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:Ft(o)}]}}}}function Ru(e,n){let o="";return{label:`엔티티 이름 변경: ${n}`,apply(i){const a=dt(i,e);o=a.name,a.name=n},invert(i){dt(i,e).name=o},emitOps(){return{forward:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:{name:n}}],invert:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:{name:o}}]}}}}function Qo(e,n){let o=null;return{label:"엔티티 이동",apply(i){const a=It(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a].geo;o={...r.location},r.location={...n}},invert(i){const a=It(i,e);a>=0&&o&&(i.layout.entityLayouts[a].geo.location=o)},emitOps(){const i=a=>({kind:"entityLayout.move",casUnit:"layout",entityRef:e,value:{location:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function Au(e,n){let o=null;return{label:"엔티티 크기 변경",apply(i){const a=It(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a].geo;o={...r.size},r.size={...n}},invert(i){const a=It(i,e);a>=0&&o&&(i.layout.entityLayouts[a].geo.size=o)},emitOps(){const i=a=>({kind:"entityLayout.resize",casUnit:"layout",entityRef:e,value:{size:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function Ti(e,n){const o={...(e==null?void 0:e.properties)??{}};return n?o.swatch=n:delete o.swatch,Object.keys(o).length?{properties:o}:void 0}function xu(e,n){let o;return{label:"엔티티 색상 변경",apply(i){const a=It(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.style,r.style=Ti(r.style,n)},invert(i){const a=It(i,e);a>=0&&(i.layout.entityLayouts[a].style=o)},emitOps(i){const a=It(i,e),r=a>=0?i.layout.entityLayouts[a].style:void 0,l=s=>({kind:"entityLayout.setStyle",casUnit:"layout",entityRef:e,value:{style:s}});return{forward:[l(r)],invert:[l(o)]}}}}function $u(e,n){let o;return{label:n?"엔티티 접기":"엔티티 펼치기",apply(i){const a=It(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.collapsed,r.collapsed=n},invert(i){const a=It(i,e);a>=0&&(i.layout.entityLayouts[a].collapsed=o)},emitOps(){const i=a=>({kind:"entityLayout.setCollapsed",casUnit:"layout",entityRef:e,value:{collapsed:a}});return{forward:[i(n)],invert:[i(o)]}}}}function Tu(e,n){let o;return{label:n?"엔티티 잠금":"엔티티 잠금 해제",apply(i){const a=It(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.locked,r.locked=n},invert(i){const a=It(i,e);a>=0&&(i.layout.entityLayouts[a].locked=o)},emitOps(){const i=a=>({kind:"entityLayout.setLocked",casUnit:"layout",entityRef:e,value:{locked:a}});return{forward:[i(n)],invert:[i(o)]}}}}function is(e){let n=[];return{label:e?"모두 접기":"모두 펼치기",apply(o){n=o.layout.entityLayouts.map(i=>i.collapsed);for(const i of o.layout.entityLayouts)i.collapsed=e},invert(o){o.layout.entityLayouts.forEach((i,a)=>{i.collapsed=n[a]})},emitOps(o){const i=[],a=[];return o.layout.entityLayouts.forEach((r,l)=>{i.push({kind:"entityLayout.setCollapsed",casUnit:"layout",entityRef:r.entityRef,value:{collapsed:e}}),a.push({kind:"entityLayout.setCollapsed",casUnit:"layout",entityRef:r.entityRef,value:{collapsed:n[l]}})}),{forward:i,invert:a}}}}function Ua(e,n,o){let i;return{label:"속성 색상 변경",apply(a){const r=It(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.attributeStyles;const s={...l.attributeStyles},c=Ti(s[n],o);c?s[n]=c:delete s[n],l.attributeStyles=Object.keys(s).length?s:void 0},invert(a){const r=It(a,e);r>=0&&(a.layout.entityLayouts[r].attributeStyles=i)},emitOps(a){const r=It(a,e),l=r>=0?a.layout.entityLayouts[r].attributeStyles:void 0,s=c=>({kind:"entityLayout.setAttrStyle",casUnit:"layout",entityRef:e,value:{attributeStyles:c}});return{forward:[s(l)],invert:[s(i)]}}}}function Ha(e,n,o){return{label:"그룹 추가",apply(i){i.logical.groups.push(e),i.layout.groupLayouts.push({groupRef:e.modelId,geo:n,...o})},invert(i){const a=i.logical.groups.findIndex(l=>l.modelId===e.modelId);a>=0&&i.logical.groups.splice(a,1);const r=i.layout.groupLayouts.findIndex(l=>l.groupRef===e.modelId);r>=0&&i.layout.groupLayouts.splice(r,1)},emitOps(){const i={kind:"group.add",casUnit:"logical",groupRef:e.modelId,value:e},a={kind:"groupLayout.add",casUnit:"layout",groupRef:e.modelId,value:{groupRef:e.modelId,geo:n,...o},incidental:!0};return{forward:[i,a],invert:[{kind:"groupLayout.remove",casUnit:"layout",groupRef:e.modelId,incidental:!0},{kind:"group.remove",casUnit:"logical",groupRef:e.modelId}]}}}}function Mu(e,n){const o={},i=a=>{const r=a.logical.groups.find(l=>l.modelId===e);if(!r)throw new Error(`그룹 없음: ${e}`);return r};return{label:"그룹 수정",apply(a){const r=i(a);for(const l of Object.keys(n))o[l]=r[l];Object.assign(r,n)},invert(a){Object.assign(i(a),o)},emitOps(){return{forward:[{kind:"group.update",casUnit:"logical",containerRef:e,groupRef:e,patch:Ft(n)}],invert:[{kind:"group.update",casUnit:"logical",containerRef:e,groupRef:e,patch:Ft(o)}]}}}}function Vu(e){let n=null;return{label:"그룹 해제",apply(o){const i=o.logical.groups.findIndex(r=>r.modelId===e);if(i<0)throw new Error(`그룹 없음: ${e}`);const a=o.layout.groupLayouts.findIndex(r=>r.groupRef===e);n={group:{item:o.logical.groups[i],index:i},layout:a>=0?{item:o.layout.groupLayouts[a],index:a}:void 0},a>=0&&o.layout.groupLayouts.splice(a,1),o.logical.groups.splice(i,1)},invert(o){n&&(o.logical.groups.splice(n.group.index,0,n.group.item),n.layout&&o.layout.groupLayouts.splice(n.layout.index,0,n.layout.item))},emitOps(){if(!n)return{forward:[],invert:[]};const o=[],i=[];return n.layout&&(o.push({kind:"groupLayout.remove",casUnit:"layout",groupRef:e,incidental:!0}),i.push({kind:"groupLayout.add",casUnit:"layout",groupRef:e,value:n.layout.item,incidental:!0})),o.push({kind:"group.remove",casUnit:"logical",groupRef:e}),i.push({kind:"group.add",casUnit:"logical",groupRef:e,value:n.group.item}),{forward:o,invert:i.reverse()}}}}function Lu(e,n){let o=!1;const i=a=>a.logical.groups.find(r=>r.modelId===e);return{label:"그룹에 편입",apply(a){const r=i(a);r&&!r.memberEntityRefs.includes(n)&&(r.memberEntityRefs.push(n),o=!0)},invert(a){if(!o)return;const r=i(a),l=(r==null?void 0:r.memberEntityRefs.indexOf(n))??-1;l>=0&&r.memberEntityRefs.splice(l,1)},emitOps(){return o?{forward:[{kind:"group.addMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:n}],invert:[{kind:"group.removeMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:n}]}:{forward:[],invert:[]}}}}function ja(e,n){let o=-1;const i=a=>a.logical.groups.find(r=>r.modelId===e);return{label:"그룹에서 제외",apply(a){const r=i(a);o=(r==null?void 0:r.memberEntityRefs.indexOf(n))??-1,o>=0&&r.memberEntityRefs.splice(o,1)},invert(a){var r;o<0||(r=i(a))==null||r.memberEntityRefs.splice(o,0,n)},emitOps(){return o<0?{forward:[],invert:[]}:{forward:[{kind:"group.removeMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:n}],invert:[{kind:"group.addMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:n}]}}}}function Bu(e,n){let o=null;return{label:"그룹 이동",apply(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o={...a.geo.location},a.geo.location={...n}},invert(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);a&&o&&(a.geo.location=o)},emitOps(){const i=a=>({kind:"groupLayout.move",casUnit:"layout",groupRef:e,value:{location:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function Du(e,n){let o=null;return{label:"그룹 크기 변경",apply(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o={...a.geo.size},a.geo.size={...n}},invert(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);a&&o&&(a.geo.size=o)},emitOps(){const i=a=>({kind:"groupLayout.resize",casUnit:"layout",groupRef:e,value:{size:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function Ou(e,n){let o;return{label:"그룹 색상 변경",apply(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o=a.style,a.style=Ti(a.style,n)},invert(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);a&&(a.style=o)},emitOps(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e),r=l=>({kind:"groupLayout.setStyle",casUnit:"layout",groupRef:e,value:{style:l}});return{forward:[r(a==null?void 0:a.style)],invert:[r(o)]}}}}function Pu(e,n){let o;return{label:n?"그룹 잠금":"그룹 잠금 해제",apply(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o=a.locked,a.locked=n},invert(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);a&&(a.locked=o)},emitOps(){const i=a=>({kind:"groupLayout.setLocked",casUnit:"layout",groupRef:e,value:{locked:a}});return{forward:[i(n)],invert:[i(o)]}}}}function Xt(e,n){return{label:`속성 추가: ${n.name}`,apply(o){dt(o,e).attributes.push(n)},invert(o){const i=dt(o,e),a=i.attributes.findIndex(r=>r.modelId===n.modelId);a>=0&&i.attributes.splice(a,1)},emitOps(){return{forward:[{kind:"attribute.add",casUnit:"logical",containerRef:e,entityRef:e,value:n}],invert:[{kind:"attribute.remove",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:n.modelId}]}}}}function nn(e,n,o){const i={},a=r=>{const l=dt(r,e).attributes.find(s=>s.modelId===n);if(!l)throw new Error(`속성 없음: ${n}`);return l};return{label:"속성 수정",apply(r){const l=a(r);for(const s of Object.keys(o))i[s]=l[s];Object.assign(l,o)},invert(r){Object.assign(a(r),i)},emitOps(){return{forward:[{kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:n,patch:Ft(o)}],invert:[{kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:n,patch:Ft(i)}]}}}}function zu(e,n){let o=null;return{label:"속성 삭제",apply(i){const a=dt(i,e),r=a.attributes.findIndex(l=>l.modelId===n);if(r<0)throw new Error(`속성 없음: ${n}`);o={item:a.attributes[r],index:r},a.attributes.splice(r,1)},invert(i){o&&dt(i,e).attributes.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"attribute.remove",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:n}],invert:[{kind:"attribute.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}function Fu(e,n,o,i,a){const r=new Map(a.map(c=>[c.modelId,c.order])),l=[],s=[];for(const c of i){const d=r.get(c.modelId);if(d===c.order)continue;const u=n==="attributeRef"?{attributeRef:c.modelId}:{operationRef:c.modelId};l.push({kind:e,casUnit:"logical",containerRef:o,entityRef:o,...u,patch:{order:c.order}}),s.push({kind:e,casUnit:"logical",containerRef:o,entityRef:o,...u,patch:{order:d??c.order}})}return{forward:l,invert:s}}function as(e,n,o){let i=null;return{label:"속성 재정렬",apply(a){const r=dt(a,e);i=r.attributes.map(s=>({...s}));const l=Jl([...r.attributes].sort((s,c)=>s.order-c.order),n,o);r.attributes.splice(0,r.attributes.length,...l),r.attributes.forEach((s,c)=>s.order=c)},invert(a){i&&dt(a,e).attributes.splice(0,1/0,...i)},emitOps(a){const r=dt(a,e).attributes;return Fu("attribute.update","attributeRef",e,r,i??[])}}}function Uu(e,n){let o=!1;return{label:`메서드 추가: ${n.name}`,apply(i){const a=dt(i,e);a.operations||(a.operations=[],o=!0),a.operations.push(n)},invert(i){var l;const a=dt(i,e),r=((l=a.operations)==null?void 0:l.findIndex(s=>s.modelId===n.modelId))??-1;r>=0&&a.operations.splice(r,1),o&&a.operations&&a.operations.length===0&&(a.operations=void 0)},emitOps(){return{forward:[{kind:"operation.add",casUnit:"logical",containerRef:e,entityRef:e,value:n}],invert:[{kind:"operation.remove",casUnit:"logical",containerRef:e,entityRef:e,operationRef:n.modelId}]}}}}function Hu(e,n,o){const i={},a=r=>{var s;const l=(s=dt(r,e).operations)==null?void 0:s.find(c=>c.modelId===n);if(!l)throw new Error(`메서드 없음: ${n}`);return l};return{label:"메서드 수정",apply(r){const l=a(r);for(const s of Object.keys(o))i[s]=l[s];Object.assign(l,o)},invert(r){Object.assign(a(r),i)},emitOps(){return{forward:[{kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:n,patch:Ft(o)}],invert:[{kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:n,patch:Ft(i)}]}}}}function ju(e,n){let o=null;return{label:"메서드 삭제",apply(i){var s;const a=dt(i,e),r=((s=a.operations)==null?void 0:s.findIndex(c=>c.modelId===n))??-1;if(r<0)throw new Error(`메서드 없음: ${n}`);const l=a.operations.length===1;o={item:a.operations[r],index:r,wasSole:l},a.operations.splice(r,1),l&&(a.operations=void 0)},invert(i){if(!o)return;const a=dt(i,e);a.operations||(a.operations=[]),a.operations.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"operation.remove",casUnit:"logical",containerRef:e,entityRef:e,operationRef:n}],invert:[{kind:"operation.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}function Ku(e,n,o){let i=null;return{label:"메서드 재정렬",apply(a){const r=dt(a,e),l=r.operations??[];i=l.map(c=>({...c}));const s=Jl([...l].sort((c,d)=>c.order-d.order),n,o);l.splice(0,l.length,...s),l.forEach((c,d)=>c.order=d),r.operations=l},invert(a){if(!i)return;const r=dt(a,e);r.operations&&r.operations.splice(0,1/0,...i)},emitOps(a){const r=dt(a,e).operations??[];return Fu("operation.update","operationRef",e,r,i??[])}}}function Gu(e,n,o){let i;return{label:"메서드 색상 변경",apply(a){const r=It(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.operationStyles;const s={...l.operationStyles},c=Ti(s[n],o);c?s[n]=c:delete s[n],l.operationStyles=Object.keys(s).length?s:void 0},invert(a){const r=It(a,e);r>=0&&(a.layout.entityLayouts[r].operationStyles=i)},emitOps(a){const r=It(a,e),l=r>=0?a.layout.entityLayouts[r].operationStyles:void 0,s=c=>({kind:"entityLayout.setOpStyle",casUnit:"layout",entityRef:e,value:{operationStyles:c}});return{forward:[s(l)],invert:[s(i)]}}}}function Ka(e,n){return{label:"관계 추가",apply(o){o.logical.associations.push(e),o.layout.associationLayouts.push(n)},invert(o){const i=o.logical.associations.findIndex(r=>r.modelId===e.modelId);i>=0&&o.logical.associations.splice(i,1);const a=o.layout.associationLayouts.findIndex(r=>r.associationRef===e.modelId);a>=0&&o.layout.associationLayouts.splice(a,1)},emitOps(){const o={kind:"association.add",casUnit:"logical",associationRef:e.modelId,value:e},i={kind:"associationLayout.add",casUnit:"layout",associationRef:e.modelId,value:n,incidental:!0};return{forward:[o,i],invert:[{kind:"associationLayout.remove",casUnit:"layout",associationRef:e.modelId,incidental:!0},{kind:"association.remove",casUnit:"logical",associationRef:e.modelId}]}}}}function Yu(e){let n=null;return{label:"관계 삭제",apply(o){const i=o.logical.associations.findIndex(r=>r.modelId===e);if(i<0)throw new Error(`관계 없음: ${e}`);const a=o.layout.associationLayouts.findIndex(r=>r.associationRef===e);n={assoc:{item:o.logical.associations[i],index:i},layout:a>=0?{item:o.layout.associationLayouts[a],index:a}:void 0},a>=0&&o.layout.associationLayouts.splice(a,1),o.logical.associations.splice(i,1)},invert(o){n&&(o.logical.associations.splice(n.assoc.index,0,n.assoc.item),n.layout&&o.layout.associationLayouts.splice(n.layout.index,0,n.layout.item))},emitOps(){if(!n)return{forward:[],invert:[]};const o=[],i=[];return n.layout&&(o.push({kind:"associationLayout.remove",casUnit:"layout",associationRef:e,incidental:!0}),i.push({kind:"associationLayout.add",casUnit:"layout",associationRef:e,value:n.layout.item,incidental:!0})),o.push({kind:"association.remove",casUnit:"logical",associationRef:e}),i.push({kind:"association.add",casUnit:"logical",associationRef:e,value:n.assoc.item}),{forward:o,invert:i.reverse()}}}}function Ga(e,n){const o={},i=a=>{const r=a.logical.associations.find(l=>l.modelId===e);if(!r)throw new Error(`관계 없음: ${e}`);return r};return{label:"관계 수정",apply(a){const r=i(a);for(const l of Object.keys(n))o[l]=r[l];Object.assign(r,n)},invert(a){Object.assign(i(a),o)},emitOps(){return{forward:[{kind:"association.update",casUnit:"logical",containerRef:e,associationRef:e,patch:Ft(n)}],invert:[{kind:"association.update",casUnit:"logical",containerRef:e,associationRef:e,patch:Ft(o)}]}}}}function on(e,n,o){const i={},a=r=>{const l=r.logical.associations.find(s=>s.modelId===e);if(!l)throw new Error(`관계 없음: ${e}`);return l[n]};return{label:"관계 수정",apply(r){const l=a(r);for(const s of Object.keys(o))i[s]=l[s];Object.assign(l,o)},invert(r){Object.assign(a(r),i)},emitOps(){return{forward:[{kind:"associationEnd.update",casUnit:"logical",containerRef:e,associationRef:e,end:n,patch:Ft(o)}],invert:[{kind:"associationEnd.update",casUnit:"logical",containerRef:e,associationRef:e,end:n,patch:Ft(i)}]}}}}function qu(e,n){return{label:"인덱스 추가",apply(o){const i=dt(o,e);(i.indexes??(i.indexes=[])).push(n)},invert(o){var r;const i=dt(o,e),a=((r=i.indexes)==null?void 0:r.findIndex(l=>l.modelId===n.modelId))??-1;a>=0&&i.indexes.splice(a,1)},emitOps(){return{forward:[{kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:n}],invert:[{kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:n.modelId}]}}}}function Ya(e,n,o){const i={},a=r=>{var s;const l=(s=dt(r,e).indexes)==null?void 0:s.find(c=>c.modelId===n);if(!l)throw new Error(`인덱스 없음: ${n}`);return l};return{label:"인덱스 수정",apply(r){const l=a(r);for(const s of Object.keys(o))i[s]=l[s];Object.assign(l,o)},invert(r){Object.assign(a(r),i)},emitOps(){return{forward:[{kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:n,patch:Ft(o)}],invert:[{kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:n,patch:Ft(i)}]}}}}function Wu(e,n){let o=null;return{label:"인덱스 삭제",apply(i){var l;const a=dt(i,e),r=((l=a.indexes)==null?void 0:l.findIndex(s=>s.modelId===n))??-1;if(r<0)throw new Error(`인덱스 없음: ${n}`);o={item:a.indexes[r],index:r},a.indexes.splice(r,1)},invert(i){o&&dt(i,e).indexes.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:n}],invert:[{kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}const hn=(e,n)=>({kind:"associationLayout.setWaypoints",casUnit:"layout",associationRef:e,value:{waypoints:n}}),Mi=(e,n)=>{var o;return((o=tn(e,n))==null?void 0:o.waypoints.map(i=>({...i})))??[]};function Ju(e,n,o){let i=null;return{label:"waypoint 이동",coalesceKey:`waypoint:${e}`,apply(a){const r=tn(a,e);if(!r||!r.waypoints[n])throw new Error(`waypoint 없음: ${e}[${n}]`);i={...r.waypoints[n]},r.waypoints.splice(n,1,{...o})},invert(a){const r=tn(a,e);r&&i&&r.waypoints.splice(n,1,i)},emitOps(a){const r=Mi(a,e),l=r.map((s,c)=>c===n&&i?{...i}:s);return{forward:[hn(e,r)],invert:[hn(e,l)]}}}}function Xu(e,n){let o=null;return{label:"waypoint 제거",apply(i){const a=tn(i,e);if(!a||!a.waypoints[n])throw new Error(`waypoint 없음: ${e}[${n}]`);o={...a.waypoints[n]},a.waypoints.splice(n,1)},invert(i){const a=tn(i,e);a&&o&&a.waypoints.splice(n,0,o)},emitOps(i){const a=Mi(i,e),r=a.slice();return o&&r.splice(n,0,{...o}),{forward:[hn(e,a)],invert:[hn(e,r)]}}}}function Zu(e,n,o){let i=null;return{label:"waypoint 평행이동",apply(a){const r=tn(a,e);if(!r)throw new Error(`관계 레이아웃 없음: ${e}`);i=r.waypoints.map(l=>({...l})),r.waypoints=i.map(l=>({x:l.x+n,y:l.y+o}))},invert(a){const r=tn(a,e);r&&i&&(r.waypoints=i)},emitOps(a){return{forward:[hn(e,Mi(a,e))],invert:[hn(e,i??[])]}}}}function Qu(e){let n=null;return{label:"꺾은선 풀기",apply(o){const i=tn(o,e);if(!i)throw new Error(`관계 레이아웃 없음: ${e}`);n=i.waypoints.map(a=>({...a})),i.waypoints=[]},invert(o){const i=tn(o,e);i&&n&&(i.waypoints=n)},emitOps(o){return{forward:[hn(e,Mi(o,e))],invert:[hn(e,n??[])]}}}}function em(e,n,o){return{label:"waypoint 추가",apply(i){const a=tn(i,e);if(!a)throw new Error(`관계 레이아웃 없음: ${e}`);a.waypoints.splice(n,0,{...o})},invert(i){const a=tn(i,e);a==null||a.waypoints.splice(n,1)},emitOps(i){const a=Mi(i,e),r=a.slice();return r.splice(n,1),{forward:[hn(e,a)],invert:[hn(e,r)]}}}}function tm(e){return{label:"노트 추가",apply(n){n.layout.notes.push(e)},invert(n){const o=n.layout.notes.findIndex(i=>i.modelId===e.modelId);o>=0&&n.layout.notes.splice(o,1)},emitOps(){return{forward:[{kind:"note.add",casUnit:"layout",noteRef:e.modelId,value:e}],invert:[{kind:"note.remove",casUnit:"layout",noteRef:e.modelId}]}}}}function nm(e){let n=null,o=null;return{label:"노트 삭제",apply(i){var r;const a=i.layout.notes.findIndex(l=>l.modelId===e);if(a<0)throw new Error(`노트 없음: ${e}`);n={item:i.layout.notes[a],index:a},i.layout.notes.splice(a,1);for(const l of i.layout.groupLayouts){const s=((r=l.memberNoteRefs)==null?void 0:r.indexOf(e))??-1;if(!(s<0)){l.memberNoteRefs.splice(s,1),o={groupRef:l.groupRef,index:s};break}}},invert(i){if(n&&i.layout.notes.splice(n.index,0,n.item),!o)return;const a=i.layout.groupLayouts.find(r=>r.groupRef===o.groupRef);a&&(a.memberNoteRefs||(a.memberNoteRefs=[]),a.memberNoteRefs.splice(o.index,0,e))},emitOps(){if(!n)return{forward:[],invert:[]};const i=[],a=[];return o&&(i.push({kind:"groupLayout.removeNoteMember",casUnit:"layout",groupRef:o.groupRef,noteRef:e,incidental:!0}),a.push({kind:"groupLayout.addNoteMember",casUnit:"layout",groupRef:o.groupRef,noteRef:e,incidental:!0})),i.push({kind:"note.remove",casUnit:"layout",noteRef:e}),a.push({kind:"note.add",casUnit:"layout",noteRef:e,value:n.item}),{forward:i,invert:a.reverse()}}}}function Vi(e,n){let o=null;return{label:"노트 이동",apply(i){const a=i.layout.notes.find(r=>r.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o={...a.geo.location},a.geo.location={...n}},invert(i){const a=i.layout.notes.find(r=>r.modelId===e);a&&o&&(a.geo.location=o)},emitOps(){const i=a=>({kind:"note.move",casUnit:"layout",noteRef:e,value:{location:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function om(e,n){let o=null;return{label:"노트 크기 변경",apply(i){const a=i.layout.notes.find(r=>r.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o={...a.geo.size},a.geo.size={...n}},invert(i){const a=i.layout.notes.find(r=>r.modelId===e);a&&o&&(a.geo.size=o)},emitOps(){const i=a=>({kind:"note.resize",casUnit:"layout",noteRef:e,value:{size:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function im(e,n){let o="";return{label:"노트 내용 변경",apply(i){const a=i.layout.notes.find(r=>r.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o=a.memo,a.memo=n},invert(i){const a=i.layout.notes.find(r=>r.modelId===e);a&&(a.memo=o)},emitOps(){const i=a=>({kind:"note.setMemo",casUnit:"layout",noteRef:e,value:{memo:a}});return{forward:[i(n)],invert:[i(o)]}}}}function am(e,n){let o;return{label:"노트 색상 변경",apply(i){const a=i.layout.notes.find(r=>r.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o=a.style,a.style=Ti(a.style,n)},invert(i){const a=i.layout.notes.find(r=>r.modelId===e);a&&(a.style=o)},emitOps(i){const a=i.layout.notes.find(l=>l.modelId===e),r=l=>({kind:"note.setStyle",casUnit:"layout",noteRef:e,value:{style:l}});return{forward:[r(a==null?void 0:a.style)],invert:[r(o)]}}}}function rm(e,n){let o=!1,i=!1;const a=r=>r.layout.groupLayouts.find(l=>l.groupRef===e);return{label:"그룹에 노트 편입",apply(r){const l=a(r);l&&(l.memberNoteRefs||(l.memberNoteRefs=[],i=!0),!l.memberNoteRefs.includes(n)&&(l.memberNoteRefs.push(n),o=!0))},invert(r){if(!o)return;const l=a(r);if(!(l!=null&&l.memberNoteRefs))return;const s=l.memberNoteRefs.indexOf(n);s>=0&&l.memberNoteRefs.splice(s,1),i&&delete l.memberNoteRefs},emitOps(){return o?{forward:[{kind:"groupLayout.addNoteMember",casUnit:"layout",groupRef:e,noteRef:n}],invert:[{kind:"groupLayout.removeNoteMember",casUnit:"layout",groupRef:e,noteRef:n}]}:{forward:[],invert:[]}}}}function lm(e,n){let o=-1;const i=a=>a.layout.groupLayouts.find(r=>r.groupRef===e);return{label:"그룹에서 노트 제외",apply(a){var l;const r=i(a);o=((l=r==null?void 0:r.memberNoteRefs)==null?void 0:l.indexOf(n))??-1,o>=0&&r.memberNoteRefs.splice(o,1)},invert(a){if(o<0)return;const r=i(a);r&&(r.memberNoteRefs||(r.memberNoteRefs=[]),r.memberNoteRefs.splice(o,0,n))},emitOps(){return o<0?{forward:[],invert:[]}:{forward:[{kind:"groupLayout.removeNoteMember",casUnit:"layout",groupRef:e,noteRef:n}],invert:[{kind:"groupLayout.addNoteMember",casUnit:"layout",groupRef:e,noteRef:n}]}}}}const Xn=(e,n,o)=>({kind:"noteConnection.setWaypoints",casUnit:"layout",noteRef:e,targetRef:n,value:{waypoints:o}}),qa=(e,n,o)=>{var i;return((i=Mn(e,n,o))==null?void 0:i.waypoints.map(a=>({...a})))??[]};function sm(e,n){let o=!1,i=!1;return{label:"노트 연결 추가",apply(a){const r=a.layout.notes.find(l=>l.modelId===e);if(!r)throw new Error(`노트 없음: ${e}`);if(r.connections||(r.connections=[],i=!0),r.connections.some(l=>l.targetRef===n)){o=!1;return}r.connections.push({targetRef:n,waypoints:[]}),o=!0},invert(a){if(!o)return;const r=a.layout.notes.find(s=>s.modelId===e);if(!(r!=null&&r.connections))return;const l=r.connections.findIndex(s=>s.targetRef===n);l>=0&&r.connections.splice(l,1),i&&delete r.connections},emitOps(){return o?{forward:[{kind:"noteConnection.add",casUnit:"layout",noteRef:e,targetRef:n,value:{targetRef:n,waypoints:[]}}],invert:[{kind:"noteConnection.remove",casUnit:"layout",noteRef:e,targetRef:n}]}:{forward:[],invert:[]}}}}function cm(e,n){let o=null;return{label:"노트 연결 삭제",apply(i){var l;const a=i.layout.notes.find(s=>s.modelId===e),r=((l=a==null?void 0:a.connections)==null?void 0:l.findIndex(s=>s.targetRef===n))??-1;if(!(a!=null&&a.connections)||r<0)throw new Error(`노트 연결 없음: ${e}→${n}`);o={item:a.connections[r],index:r},a.connections.splice(r,1)},invert(i){if(!o)return;const a=i.layout.notes.find(r=>r.modelId===e);a!=null&&a.connections&&a.connections.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"noteConnection.remove",casUnit:"layout",noteRef:e,targetRef:n}],invert:[{kind:"noteConnection.add",casUnit:"layout",noteRef:e,targetRef:n,value:o.item}]}:{forward:[],invert:[]}}}}function dm(e,n,o,i){let a=null;return{label:"waypoint 이동",coalesceKey:`noteConnWaypoint:${e}:${n}`,apply(r){const l=Mn(r,e,n);if(!l||!l.waypoints[o])throw new Error(`waypoint 없음: ${e}→${n}[${o}]`);a={...l.waypoints[o]},l.waypoints.splice(o,1,{...i})},invert(r){const l=Mn(r,e,n);l&&a&&l.waypoints.splice(o,1,a)},emitOps(r){const l=qa(r,e,n),s=l.map((c,d)=>d===o&&a?{...a}:c);return{forward:[Xn(e,n,l)],invert:[Xn(e,n,s)]}}}}function um(e,n,o,i){return{label:"waypoint 추가",apply(a){const r=Mn(a,e,n);if(!r)throw new Error(`노트 연결 없음: ${e}→${n}`);r.waypoints.splice(o,0,{...i})},invert(a){const r=Mn(a,e,n);r==null||r.waypoints.splice(o,1)},emitOps(a){const r=qa(a,e,n),l=r.slice();return l.splice(o,1),{forward:[Xn(e,n,r)],invert:[Xn(e,n,l)]}}}}function mm(e,n,o){let i=null;return{label:"waypoint 제거",apply(a){const r=Mn(a,e,n);if(!r||!r.waypoints[o])throw new Error(`waypoint 없음: ${e}→${n}[${o}]`);i={...r.waypoints[o]},r.waypoints.splice(o,1)},invert(a){const r=Mn(a,e,n);r&&i&&r.waypoints.splice(o,0,i)},emitOps(a){const r=qa(a,e,n),l=r.slice();return i&&l.splice(o,0,{...i}),{forward:[Xn(e,n,r)],invert:[Xn(e,n,l)]}}}}function fm(e,n){let o=null;return{label:"꺾은선 풀기",apply(i){const a=Mn(i,e,n);if(!a)throw new Error(`노트 연결 없음: ${e}→${n}`);o=a.waypoints.map(r=>({...r})),a.waypoints=[]},invert(i){const a=Mn(i,e,n);a&&o&&(a.waypoints=o)},emitOps(i){return{forward:[Xn(e,n,qa(i,e,n))],invert:[Xn(e,n,o??[])]}}}}function rt(e,n,o){return{label:e,coalesceKey:o,apply(i){for(const a of n)a.apply(i)},invert(i){for(let a=n.length-1;a>=0;a--)n[a].invert(i)},emitOps(i){const a=n.map(r=>{if(!r.emitOps)throw new Error(`emitOps 미구현 command가 composite에 포함됨: ${r.label}`);return r.emitOps(i)});return{forward:a.flatMap(r=>r.forward),invert:a.slice().reverse().flatMap(r=>r.invert)}}}}const Wk=Object.freeze(Object.defineProperty({__proto__:null,addAssociation:Ka,addAttribute:Xt,addEntity:za,addEntityToGroup:Lu,addGroup:Ha,addIndex:qu,addNote:tm,addNoteConnection:sm,addNoteConnectionWaypoint:um,addNoteToGroup:rm,addOperation:Uu,addWaypoint:em,clearNoteConnectionWaypoints:fm,clearWaypoints:Qu,composite:rt,moveEntity:Qo,moveGroup:Bu,moveNote:Vi,moveNoteConnectionWaypoint:dm,moveWaypoint:Ju,removeAssociation:Yu,removeAttribute:zu,removeEntity:Su,removeEntityFromGroup:ja,removeGroup:Vu,removeIndex:Wu,removeNote:nm,removeNoteConnection:cm,removeNoteConnectionWaypoint:mm,removeNoteFromGroup:lm,removeOperation:ju,removeWaypoint:Xu,renameEntity:Ru,reorderAttributes:as,reorderOperations:Ku,resizeEntity:Au,resizeGroup:Du,resizeNote:om,setAllEntitiesCollapsed:is,setAttributeSwatch:Ua,setEntityCollapsed:$u,setEntityLocked:Tu,setEntitySwatch:xu,setGroupLocked:Pu,setGroupSwatch:Ou,setNoteMemo:im,setNoteSwatch:am,setOperationSwatch:Gu,translateWaypoints:Zu,updateAssociation:Ga,updateAssociationEnd:on,updateAttribute:nn,updateEntity:Fa,updateGroup:Mu,updateIndex:Ya,updateOperation:Hu},Symbol.toStringTag,{value:"Module"}));class pm{constructor(){st(this,"revs",new Map);st(this,"layoutVersion",0);st(this,"logicalVersion",0)}seed(n){this.revs.clear();for(const[o,i]of Object.entries(n.revs??{}))this.revs.set(o,i);this.layoutVersion=n.layoutVersion??0,this.logicalVersion=n.logicalVersion??0}rev(n){return this.revs.get(n)??0}setRev(n,o){this.revs.set(n,o)}deleteRev(n){this.revs.delete(n)}snapshot(){return{revs:Object.fromEntries(this.revs),layoutVersion:this.layoutVersion,logicalVersion:this.logicalVersion}}}const Jk=[400,1200];function Xk(e){var o;if(typeof e!="object"||e===null)return;const n=e;for(const i of[n.statusCode,n.status,(o=n.response)==null?void 0:o.status])if(typeof i=="number"&&Number.isFinite(i))return i}function Zk(e){const n=Xk(e);return n==null||n===408||n===429?!0:n<400||n>=500}const Qk=e=>new Promise(n=>setTimeout(n,e));class hm{constructor(n){st(this,"cache",new pm);st(this,"newClientOpId");st(this,"debounceMs");st(this,"retryDelaysMs");st(this,"emissions",new WeakMap);st(this,"open",null);st(this,"debounceHandle",null);st(this,"queue",[]);st(this,"sending",!1);st(this,"_frozen",!1);st(this,"stack",null);st(this,"settledWaiters",[]);this.opts=n,this.newClientOpId=n.newClientOpId??Fe,this.debounceMs=n.debounceMs??300,this.retryDelaysMs=n.retryDelaysMs??Jk}seed(n){this.cache.seed(n)}attach(n){this.stack=n,n.sealCoalesce();const o=n.onCommand((i,a,r)=>this.handle(i,a,r));return()=>{o(),this.stack===n&&(this.stack=null)}}get frozen(){return this._frozen}get hasPending(){return this.open!==null||this.queue.length>0||this.sending}cacheSnapshot(){return this.cache.snapshot()}flush(){this.flushOpen(!0)}whenSettled(){return this.hasPending?new Promise(n=>this.settledWaiters.push(n)):Promise.resolve()}handle(n,o,i){var l,s,c;if(this._frozen)return;let a;if(o==="do"){const d=(l=n.emitOps)==null?void 0:l.call(n,this.opts.state);if(!d)throw new Error(`op-mode에서 emitOps 미구현 command 실행: ${n.label}`);a=d}else{const d=this.emissions.get(n);if(!d)throw new Error(`op-mode ${o} 대상 command의 emission 미기록: ${n.label}`);a=d}const r=o==="undo"?a.invert:a.forward;if(o==="do"&&i&&this.open&&this.open.coalesceKey===n.coalesceKey){this.open.fwd=r,this.emissions.set(n,{forward:r,invert:this.open.inv}),this.resetDebounce();return}if(i){const d=new Error(`op-mode coalesce 경계 불일치: 스택은 병합했으나 어댑터에 대응 그룹이 없음 (${n.label}, key=${String(n.coalesceKey)})`);console.error("[op-sync]",d),(c=(s=this.opts).onError)==null||c.call(s,d)}if(this.flushOpen(!1),o==="do"&&(this.emissions.set(n,a),n.coalesceKey!=null)){this.open={coalesceKey:n.coalesceKey,fwd:r,inv:a.invert},this.startDebounce();return}r.length&&this.enqueue(this.buildBatch(r))}flushOpen(n){var i;this.cancelDebounce();const o=this.open;this.open=null,o&&o.fwd.length&&this.enqueue(this.buildBatch(o.fwd)),n&&((i=this.stack)==null||i.sealCoalesce())}startDebounce(){this.cancelDebounce(),this.debounceHandle=setTimeout(()=>{this.debounceHandle=null,this.flushOpen(!0)},this.debounceMs)}resetDebounce(){this.startDebounce()}cancelDebounce(){this.debounceHandle!=null&&(clearTimeout(this.debounceHandle),this.debounceHandle=null)}buildBatch(n){const o={},i=new Set;let a=!1,r=!1;for(const l of n)if(l.casUnit==="logical")if(a=!0,l.containerRef)i.add(l.containerRef);else{const s=l.entityRef??l.associationRef??l.groupRef;s&&(l.kind.endsWith(".add")?this.cache.setRev(s,0):l.kind.endsWith(".remove")&&this.cache.deleteRev(s))}else l.incidental||(r=!0);if(i.size){o.revs={};for(const l of i){const s=this.cache.rev(l);o.revs[l]=s,this.cache.setRev(l,s+1)}}return r&&(o.layout=this.cache.layoutVersion,this.cache.layoutVersion=o.layout+1),a&&(this.cache.logicalVersion+=1),{diagramId:this.opts.diagramId,ops:n,cas:o,origin:this.opts.origin??"gui",clientOpId:this.newClientOpId()}}enqueue(n){this.queue.push(n),this.pump()}async pump(){var i,a;if(this.sending||this._frozen)return;const n=this.queue.shift();if(!n){this.notifySettled();return}this.sending=!0;let o;for(let r=0;;r++)try{o=await this.opts.transport(n);break}catch(l){const s=this.retryDelaysMs.length+1;console.error(`[op-sync] op 전송 실패 (시도 ${r+1}/${s}):`,l),(a=(i=this.opts).onError)==null||a.call(i,l);const c=this.retryDelaysMs[r];if(c==null||!Zk(l)){this.sending=!1,console.error("[op-sync] 전송 실패 확정 → 하드 프리즈(kind:missing)"),this.freeze({kind:"missing"});return}await Qk(c)}this.sending=!1,o.ok?(this.reconcile(o),this.pump()):this.freeze(o.conflict)}reconcile(n){if(!(this.queue.length>0)){for(const[o,i]of Object.entries(n.revs))this.cache.setRev(o,i);this.cache.layoutVersion=n.layoutVersion,this.cache.logicalVersion=n.logicalVersion}}freeze(n){var o,i;this._frozen=!0,this.queue.length=0,this.open=null,this.cancelDebounce(),(i=(o=this.opts).onFreeze)==null||i.call(o,n),this.notifySettled()}notifySettled(){if(this.hasPending)return;const n=this.settledWaiters;this.settledWaiters=[];for(const o of n)o()}}const ym=["entity.add","entity.update","entity.remove","attribute.add","attribute.update","attribute.remove","association.add","association.remove","association.update","associationEnd.update","index.add","index.update","index.remove","operation.add","operation.update","operation.remove","attribute.reorder","operation.reorder","group.add","group.update","group.remove","group.addMember","group.removeMember"],gm=["NORMAL","RELATION_OWN","RELATION_REF","EMBED_OWN","EMBED_REF","EMBED_PREDEF","DIVIDER"];function bm(e,n,o){var c;if(!n.length||!((c=e.indexes)!=null&&c.length))return[];const i=new Set(n),a=new Set,r=new Map,l=d=>{const u=o==null?void 0:o.get(d);u===void 0?a.add(d):u!==d&&r.set(d,u)};for(const d of e.attributes)if(i.has(d.modelId)){l(d.modelId);for(const u of d.dbAttrs)l(u.modelId)}if(!a.size&&!r.size)return[];const s=[];for(const d of e.indexes){let u=!1;const m=[];for(const f of d.columns){if(a.has(f.columnRef)){u=!0;continue}const p=r.get(f.columnRef);p===void 0?m.push(f):(m.push({...f,columnRef:p}),u=!0)}u&&s.push({indexRef:d.modelId,columns:m})}return s}function e_(e){return Cn(e).length}function rs(e,n){return new Set(e.associations.filter(o=>{const i=o.end1.entityRef===n?o.end1:o.end2;return i.multiplicity==="ZERO_OR_MORE_INSTANCES"||i.multiplicity==="ONE_OR_MORE_INSTANCES"}).map(o=>o.modelId))}function t_(e,n,o,i){var r;const a=new Set;for(const l of e.attributes)l.dbAttrs.forEach((s,c)=>{if(s.sharedColumnRef!=null)return;const d=_i(l,s,c,e,i);d&&a.add(d)});for(let l=n.dbAttrs.length;l<o.length;l++){const s=(r=o[l])==null?void 0:r.physicalName;if(s&&a.has(s))return!0}return!1}function km(e,n,o=Fe){const i=e.entities.find(c=>c.modelId===n);if(!i)return[];const a=e_(i);if(a===0)return[];const r=rs(e,n),l=Cn(i).map(c=>c.col),s=[];for(const c of e.entities){const d=c.attributes.filter(u=>{var m;return u.attrType==="EMBED_OWN"&&((m=u.embedded)==null?void 0:m.embeddableRef)===n&&!r.has(u.embedded.associationRef)&&a-u.dbAttrs.length>0});if(!(d.length>1))for(const u of d){const m=a-u.dbAttrs.length;t_(c,u,l,e)||s.push({entityId:c.modelId,attributeId:u.modelId,dbAttrs:[...u.dbAttrs,...Array.from({length:m},()=>({modelId:o(),physicalName:"",dataType:""}))],added:m})}}return s}function _m(e,n,o){var f;const i=e.entities.find(p=>p.modelId===n);if(!i)return[];const a=i.attributes;if(o.length!==a.length)return[];const r=new Map(a.map(p=>[p.modelId,p])),l=[];for(const p of o){const y=r.get(p);if(!y)return[];l.push(y)}const s=a.flatMap(p=>p.dbAttrs).map(p=>p.modelId),c=l.flatMap(p=>p.dbAttrs).map(p=>p.modelId);if(s.length!==c.length)return[];if(s.every((p,y)=>p===c[y]))return[];const d=new Map(s.map((p,y)=>[p,y])),u=rs(e,n),m=[];for(const p of e.entities)for(const y of p.attributes){if(y.attrType!=="EMBED_OWN"||((f=y.embedded)==null?void 0:f.embeddableRef)!==n||u.has(y.embedded.associationRef)||y.dbAttrs.length!==s.length)continue;const g=c.map(k=>y.dbAttrs[d.get(k)]),b=g.reduce((k,_,h)=>_===y.dbAttrs[h]?k:k+1,0);b&&m.push({entityId:p.modelId,attributeId:y.modelId,dbAttrs:g,moved:b})}return m}function Em(e,n,o){var f;const i=e.entities.find(p=>p.modelId===n);if(!i)return[];const a=new Set(o),r=i.attributes.filter(p=>!a.has(p.modelId));if(r.length===i.attributes.length)return[];const l=Cn(i).map(p=>p.col),s=l.map(p=>p.modelId),c=new Set(Cn({...i,attributes:r}).map(p=>p.col.modelId)),d=new Set;if(s.forEach((p,y)=>{c.has(p)&&d.add(y)}),d.size===s.length)return[];const u=rs(e,n),m=[];for(const p of e.entities)for(const y of p.attributes){if(y.attrType!=="EMBED_OWN"||((f=y.embedded)==null?void 0:f.embeddableRef)!==n||u.has(y.embedded.associationRef)||y.dbAttrs.length!==s.length)continue;const g=y.dbAttrs.filter((_,h)=>d.has(h)),b=y.dbAttrs.filter((_,h)=>!d.has(h));y.dbAttrs.some((_,h)=>{if(d.has(h))return!1;const C=l[h],v=!!_.physicalName&&_.physicalName!==((C==null?void 0:C.physicalName)??""),S=_.sharedColumnRef!=null&&_.sharedColumnRef!==(C==null?void 0:C.sharedColumnRef);return v||S})||m.push({entityId:p.modelId,attributeId:y.modelId,dbAttrs:g,dropped:b})}return m}function yn(e,n,o){const i=new Set(o.map(r=>`${r.entityId}\0${r.attributeId}`)),a=[];for(const r of n){const l=`${e}\0${r}`;i.has(l)||(i.add(l),a.push(r),o.push({entityId:e,attributeId:r}))}return a.map(r=>zu(e,r))}function Zt(e,n,o){if(!n.length)return[];const i=new Map;for(const{entityId:r,attributeId:l}of n){const s=i.get(r)??[];s.push(l),i.set(r,s)}const a=[];for(const[r,l]of i){const s=e.entities.find(c=>c.modelId===r);if(s)for(const c of bm(s,l,o))a.push(Ya(r,c.indexRef,{columns:c.columns}))}return a}function Wa(e,n,o,i){var c;const a=[];a.push(...yn(n,o.remove,i));for(const d of o.update)a.push(nn(n,d.attributeId,d.patch));for(const d of o.add)a.push(Xt(n,d));const r=new Set(o.remove),l=[...(((c=e.entities.find(d=>d.modelId===n))==null?void 0:c.attributes)??[]).filter(d=>!r.has(d.modelId)),...o.add],s=new Set(l.map(d=>d.modelId));for(const d of e.associations){if(d.end2.entityRef!==n)continue;const u=d.end2.attributeRef;if(u&&s.has(u))continue;const f=l.filter(p=>{var y;return((y=p.derivedFrom)==null?void 0:y.associationRef)===d.modelId&&p.dbAttrs.length>0}).sort((p,y)=>p.order-y.order)[0];f&&a.push(on(d.modelId,"end2",{attributeRef:f.modelId}))}return a}function Vn(e,n,o){return{...e,entities:e.entities.map(i=>i.modelId===n?{...i,attributes:o(i.attributes)}:i)}}function Li(e,n,o){return[...Nm(e,n,o),...vm(e,n)]}function Nm(e,n,o){const i=[];for(const[a,r]of Ll(e,n,Fe))i.push(...Wa(e,a,r,o));return i}function n_(e,n,o,i){const a=e.entities.find(l=>l.modelId===n);if(!a)return[];const r=Jl([...a.attributes].sort((l,s)=>l.order-s.order),o,i).map(l=>l.modelId);return _m(e,n,r).map(l=>nn(l.entityId,l.attributeId,{dbAttrs:l.dbAttrs}))}function wm(e,n,o){return Im(e,n,o).commands}function Im(e,n,o){const i=Em(e,n,o),a=i.map(l=>nn(l.entityId,l.attributeId,{dbAttrs:l.dbAttrs})),r=i.reduce((l,s)=>Vn(l,s.entityId,c=>c.map(d=>d.modelId===s.attributeId?{...d,dbAttrs:s.dbAttrs}:d)),e);return{commands:a,projected:r}}function vm(e,n){return km(e,n,Fe).map(o=>nn(o.entityId,o.attributeId,{dbAttrs:o.dbAttrs}))}function o_(e,n,o){const i=new Set(o.remove);return Vn(e,n,a=>[...a.filter(r=>!i.has(r.modelId)).map(r=>{const l=o.update.find(s=>s.attributeId===r.modelId);return l?{...r,...l.patch}:r}),...o.add])}function Ja(e,n,o){const i=[];for(const{entityId:a,plan:r}of Wd(e,n,Fe))i.push(...Wa(e,a,r,o));return i}function Cm(e,n,o=new Set){var r,l,s,c;if(!mn(n))return[];const i=[];for(const d of e.attributes){if(o.has(d.modelId))continue;const u={},m=(r=d.dbAttrs.find(f=>fn(f.logicalName)))==null?void 0:r.logicalName;m&&!fn(d.fieldLogicalName)&&(u.fieldLogicalName=m),d.dbAttrs.length>0&&(u.dbAttrs=[]),d.notNull&&(u.notNull=!1),Object.keys(u).length>0&&i.push(nn(e.modelId,d.modelId,u))}const a={};return fn((l=e.table)==null?void 0:l.logicalName)&&!fn(e.classLogicalName)&&(a.classLogicalName=e.table.logicalName),(s=e.table)!=null&&s.physicalName&&(a.table=null),(c=e.indexes)!=null&&c.length&&(a.indexes=[]),e.schema&&(a.schema=null),e.jpaAttrs&&(a.jpaAttrs=null),Object.keys(a).length>0&&i.push(Fa(e.modelId,a)),i}function Sm(e){return Cn(e).map(n=>({...n.col,modelId:Fe()}))}function Rm(e,n){var u;const o=e.entities.find(m=>m.modelId===n);if(!o)return[];const i=[];let a;if(!o.attributes.some(m=>m.identifier)){const m=Jt(o.attributes),f=new Set(o.attributes.map(y=>y.name));let p="id";for(let y=2;f.has(p);y++)p=`id${y}`;a={modelId:Fe(),name:p,type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:m,dbAttrs:[{modelId:Fe(),physicalName:p.toLowerCase(),dataType:"BIGINT"}]},i.push(Xt(n,a))}const r=[];for(const m of e.entities)for(const f of m.attributes){if(((u=f.embedded)==null?void 0:u.embeddableRef)!==n)continue;const p=e.associations.find(k=>k.modelId===f.embedded.associationRef);if(!p)continue;const y=p.end1.entityRef===m.modelId,g=y?p.end1:p.end2,b=y?p.end2:p.end1;r.push({ownerId:m.modelId,dispId:f.modelId,assocId:p.modelId,end1:{entityRef:m.modelId,multiplicity:g.multiplicity,navigable:g.navigable,composition:!1},end2:{entityRef:n,multiplicity:b.multiplicity,navigable:b.navigable,composition:!1}})}const l={...e,entities:e.entities.map(m=>{if(m.modelId===n)return a?{...m,stereotype:"JPA_ENTITY",attributes:[...m.attributes,a]}:{...m,stereotype:"JPA_ENTITY"};const f=new Set(r.filter(p=>p.ownerId===m.modelId).map(p=>p.dispId));return f.size?{...m,attributes:m.attributes.filter(p=>!f.has(p.modelId))}:m}),associations:e.associations.map(m=>{const f=r.find(p=>p.assocId===m.modelId);return f?{...m,end1:f.end1,end2:f.end2}:m})},s=Ci(l,n,Fe);for(const m of r){const f=s.add.find(p=>{var y;return((y=p.derivedFrom)==null?void 0:y.associationRef)===m.assocId});f&&(m.end2.attributeRef=f.modelId)}const c=[];for(const m of r)i.push(...yn(m.ownerId,[m.dispId],c)),i.push(Ga(m.assocId,{end1:m.end1,end2:m.end2}));i.push(...Wa(l,n,s,c));const d=o_(l,n,s);return i.push(...Li(d,n,c)),i.push(...Zt(e,c)),i}function Am(e,n,o){const i=e.associations.find(l=>l.modelId===n);if(!i||i.end1.navigable===o)return null;const a=e.entities.find(l=>l.modelId===i.end1.entityRef),r=e.entities.find(l=>l.modelId===i.end2.entityRef);if(!a||!r||a.stereotype==="JPA_EMBEDDABLE"||r.stereotype==="JPA_EMBEDDABLE")return null;if(o===!0&&!i.end1.attributeRef){const l=Na(i.end2.multiplicity),s=i.end1.navFieldNameHint||Ia(r.name,l),c=po(s,new Set(a.attributes.map(m=>m.name))),d=Fe(),u={modelId:d,name:c,type:r.name,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:Jt(a.attributes),dbAttrs:[]};return{cmds:[Xt(i.end1.entityRef,u)],endPatch:{attributeRef:d,navFieldNameHint:void 0}}}if(o===!1&&i.end1.attributeRef){const l=i.end1.attributeRef,s=a.attributes.find(m=>m.modelId===l&&m.attrType==="RELATION_REF"),c={attributeRef:void 0,navFieldNameHint:(s==null?void 0:s.name)??i.end1.navFieldNameHint};if(!s)return{cmds:[],endPatch:c};const d=[],u=[...yn(i.end1.entityRef,[l],d)];return u.push(...Zt(e,d)),{cmds:u,endPatch:c}}return null}function xm(e,n,o){const i=e.entities.find(u=>u.modelId===n);if(!i)return[];const a=i.attributes.filter(u=>u.identifier&&!u.derivedFrom).map(u=>nn(n,u.modelId,{identifier:!1})),r=Vn({...e,entities:e.entities.map(u=>u.modelId===n?{...u,stereotype:o}:u)},n,u=>u.map(m=>m.identifier&&!m.derivedFrom?{...m,identifier:!1}:m)),l=[],s=Ja(r,[n],l);s.push(...Zt(e,l));const c=o==="JPA_EMBEDDABLE"?i_(e,n):[],d=Cm(i,o,new Set(l.filter(u=>u.entityId===n).map(u=>u.attributeId)));return[...a,...s,...c,...d]}function i_(e,n){const o=e.entities.find(r=>r.modelId===n);if(!o)return[];const i=[],a=r=>r&&r.charAt(0).toLowerCase()+r.slice(1);for(const r of e.associations){if(r.end1.entityRef===r.end2.entityRef)continue;const l=r.end1.entityRef===n,s=r.end2.entityRef===n;if(!l&&!s)continue;const c=l?r.end2.entityRef:r.end1.entityRef,d=e.entities.find(h=>h.modelId===c);if(!d||d.attributes.some(h=>{var C;return((C=h.embedded)==null?void 0:C.associationRef)===r.modelId}))continue;const u=Fe(),m=Jt(d.attributes),f=new Set(d.attributes.map(h=>h.name)),p=a(o.name);let y=p;for(let h=2;f.has(y);h++)y=`${p}${h}`;const g=o.attributes.filter(h=>!h.identifier&&!h.derivedFrom).flatMap(h=>h.dbAttrs).map(h=>({...h,modelId:Fe()})),b={modelId:u,name:y,type:o.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:m,dbAttrs:g,embedded:{associationRef:r.modelId,embeddableRef:n}};i.push(Xt(c,b));const k=l?"end2":"end1",_=l?"end1":"end2";i.push(Ga(r.modelId,{identifying:!1,[k]:{entityRef:c,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:Fe()},[_]:{entityRef:n,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:u}}))}return i}function $m(e,n,o,i){var d;const a=e.layout.groupLayouts.find(u=>u.groupRef===n),r=(a==null?void 0:a.geo.location)??o,l=o.x-r.x,s=o.y-r.y,c=[Bu(n,o),...i.map(u=>Qo(u.id,u.location))];if(l||s){const u=new Set(((d=e.logical.groups.find(m=>m.modelId===n))==null?void 0:d.memberEntityRefs)??[]);for(const m of e.logical.associations){if(!u.has(m.end1.entityRef)||!u.has(m.end2.entityRef))continue;const f=e.layout.associationLayouts.find(p=>p.associationRef===m.modelId);f&&f.waypoints.length&&c.push(Zu(m.modelId,l,s))}for(const m of(a==null?void 0:a.memberNoteRefs)??[]){const f=e.layout.notes.find(p=>p.modelId===m);f&&c.push(Vi(m,{x:f.geo.location.x+l,y:f.geo.location.y+s}))}}return c}const Tm={diagramId:"",logicalModelRef:"",entityLayouts:[],associationLayouts:[],groupLayouts:[],notes:[]};function Mm(e,n,o){for(const[i,a]of Object.entries(n)){if(i==="dbAttrs"){if(!Array.isArray(a))continue;a.forEach((l,s)=>{if(l&&typeof l=="object")for(const[c,d]of Object.entries(l))o(s,c,d,`dbAttrs.${s}.${c}`)});continue}const r=/^dbAttrs\.(\d+)\.(.+)$/.exec(i);if(r){o(Number(r[1]),r[2],a,i);continue}e.dbAttrs.length===1&&Xa.has(i)&&o(0,i,a,i)}}function a_(e,n){const o=new Set,i=new Set,a=r=>r!=null;for(const[r,l]of Object.entries(n))r==="dbAttrs"||r.startsWith("dbAttrs.")||(Kc.attr.includes(r)?o.add(r):Gc.attr.includes(r)&&a(l)&&i.add(r));return Mm(e,n,(r,l,s,c)=>{Kc.column.includes(l)?o.add(c):Gc.column.includes(l)&&a(s)&&i.add(c)}),{locked:[...o],inapplicable:[...i]}}function r_(e,n,o,i,a){const r=a?{embeddableCatalog:a}:void 0,l=d=>{const u=e.dbAttrs[d];return u?nd(u,Lt(e,u,d,n,o,r)):[]},s=new Map;Mm(e,i,(d,u,m)=>{m!=null&&ed.includes(u)&&(s.has(d)||s.set(d,new Set),s.get(d).add(u))});const c=[];for(const[d,u]of[...s.entries()].sort((m,f)=>m[0]-f[0])){const m=l(d).filter(f=>u.has(f));m.length&&c.push([d,m])}return c}function l_(e,n){const o=()=>e.entities.filter(r=>{var l;return((l=r.table)==null?void 0:l.physicalName)===n.ref}),i=()=>e.entities.filter(r=>r.name===n.ref);if(n.by==="modelId")return e.entities.filter(r=>r.modelId===n.ref);if(n.by==="physicalName")return o();if(n.by==="name")return i();const a=o();return a.length?a:i()}function s_(e,n){const o=()=>e.attributes.filter(r=>r.name===n.ref),i=()=>e.attributes.filter(r=>r.dbAttrs.some(l=>l.physicalName===n.ref));if(n.by==="modelId")return e.attributes.filter(r=>r.modelId===n.ref);if(n.by==="name")return o();if(n.by==="physicalName")return i();const a=o();return a.length?a:i()}function Vm(e,n,o){return e.associations.filter(i=>{const a=[i.end1.entityRef,i.end2.entityRef];return a.includes(n)&&a.includes(o)})}function Tt(e,n){if(!Za(n))return{ok:!1,reason:"shape",matches:[]};const o=l_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>u_(i,e))}}function c_(e,n){const o=()=>e.groups.filter(r=>r.packageName===n.ref),i=()=>e.groups.filter(r=>Object.values(r.name??{}).some(l=>l===n.ref));if(n.by==="modelId")return e.groups.filter(r=>r.modelId===n.ref);if(n.by==="packageName")return o();if(n.by==="name")return i();const a=o();return a.length?a:i()}function ls(e,n){const o=c_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>({modelId:i.modelId,name:i.name??null,packageName:i.packageName??null,members:i.memberEntityRefs.length}))}}function ss(e,n,o){return e.reason==="shape"?{code:"handle-shape-invalid",opIndex:n,where:"group",expected:"{ref, by?}",got:us(o)}:e.reason==="not-found"?{code:"group-not-found",opIndex:n,handle:o}:{code:"group-ambiguous",opIndex:n,handle:o,matches:e.matches}}const d_=new Set(["name","description","packageName","excludeDDLGeneration"]);function u_(e,n){var a;const o=Ko(e,n).value,i=n.associations.filter(r=>{var l,s;return((l=r.end1)==null?void 0:l.entityRef)===e.modelId||((s=r.end2)==null?void 0:s.entityRef)===e.modelId});return{modelId:e.modelId,stereotype:e.stereotype,packageName:o||null,table:((a=e.table)==null?void 0:a.physicalName)||null,attributes:e.attributes.length,references:i.length,referencedBy:[...new Set(i.map(r=>{var c,d,u,m;const l=((c=r.end1)==null?void 0:c.entityRef)===e.modelId?(d=r.end2)==null?void 0:d.entityRef:(u=r.end1)==null?void 0:u.entityRef,s=n.entities.find(f=>f.modelId===l);return(s==null?void 0:s.name)||((m=s==null?void 0:s.table)==null?void 0:m.physicalName)||String(l??"?")}))]}}function Lm(e,n){const o=s_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>i.modelId)}}function m_(e,n){const o=()=>e.attributes.flatMap(r=>r.dbAttrs).filter(r=>r.physicalName===n.ref),i=()=>e.attributes.filter(r=>r.name===n.ref).flatMap(r=>r.dbAttrs);if(n.by==="modelId")return e.attributes.flatMap(r=>r.dbAttrs).filter(r=>r.modelId===n.ref);if(n.by==="physicalName")return o();if(n.by==="name")return i();const a=o();return a.length?a:i()}function f_(e,n){const o=m_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>i.modelId)}}function Bm(e,n){const o=e.filter(i=>i.physicalName===n.ref);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>i.modelId)}}function cs(e){return e.by!==void 0&&e.by!=="name"}function p_(e,n){return(e.indexes??[]).filter(o=>o.name===n.ref)}function h_(e,n){return(e.operations??[]).filter(o=>o.name===n.ref)}function y_(e,n){const o=p_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>i.modelId)}}function Dm(e,n){const o=h_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>i.modelId)}}function Om(e){return e.physicalName!=null||e.dataType!=null||e.length!=null||e.scale!=null||e.columnLogicalName!=null||e.unique!=null||e.updatable!=null}function Pm(e){return Om(e)&&e.dataType==null}function zm(e,n,o){const i=Om(e);return{modelId:o(),name:e.name,type:e.type,attrType:"NORMAL",identifier:e.identifier??!1,notNull:e.notNull??!1,order:n,...e.transient?{transient:!0}:{},...e.groupCode?{groupCode:e.groupCode}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.attributeGroup?{attributeGroup:e.attributeGroup}:{},...e.description?{description:e.description}:{},...e.collectionType?{collectionType:e.collectionType}:{},...e.fieldLogicalName?{fieldLogicalName:e.fieldLogicalName}:{},dbAttrs:i?[{modelId:o(),physicalName:e.physicalName??e.name,dataType:e.dataType??"",...e.length?{length:e.length}:{},...e.scale?{scale:e.scale}:{},...e.columnLogicalName?{logicalName:e.columnLogicalName}:{},...e.unique!=null?{unique:e.unique}:{},...e.updatable!=null?{updatable:e.updatable}:{}}]:[]}}function Fm(e,n,o,i,a,r,l,s,c){const d=Km(e.embeddableOverrides);if(d.length)return s.push({code:"embeddable-override-unknown-key",opIndex:r,entity:l,handle:{ref:e.name},keys:d}),null;const u=c(),m=new Map((e.embeddableOverrides??[]).map(y=>[y.field,y])),f=[];let p=!1;for(const y of n.fields){const g=m.get(y.name);if(g!=null&&g.sharedColumnPhysicalName){const b={ref:g.sharedColumnPhysicalName,by:"physicalName"},k=Bm(Rn(i,a),b);if(!k.ok){s.push(k.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:r,entity:l,handle:b}:{code:"shared-column-target-ambiguous",opIndex:r,entity:l,handle:b,matches:k.matches}),p=!0;continue}f.push({modelId:c(),physicalName:"",dataType:"",sharedColumnRef:k.value.modelId});continue}f.push({modelId:c(),physicalName:(g==null?void 0:g.physicalName)??"",dataType:"",...g!=null&&g.length?{length:g.length}:{},...g!=null&&g.scale?{scale:g.scale}:{},...(g==null?void 0:g.insertable)!=null?{insertable:g.insertable}:{},...(g==null?void 0:g.updatable)!=null?{updatable:g.updatable}:{},...(g==null?void 0:g.notNull)!=null?{notNull:g.notNull}:{}})}return p?null:{modelId:u,name:e.name,type:n.type,attrType:"EMBED_PREDEF",identifier:e.identifier??!1,notNull:e.notNull??!1,order:o,...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.attributeGroup?{attributeGroup:e.attributeGroup}:{},...e.description?{description:e.description}:{},dbAttrs:f}}const g_=new Set(["name","type","customType","attrType","identifier","notNull","transient","naturalId","naturalIdMutable","description","attributeGroup","groupCode","defaultValue","personalInfoAttributeType","order","dbAttrs","derivedIdFieldName","collectionType","fieldLogicalName"]),Io=e=>new Set(Object.keys(e)),b_=Io({name:!0,stereotype:!0,physicalName:!0,useVersion:!0,attributes:!0,indexes:!0,operations:!0,serialization:!0,classLogicalName:!0}),Um=Io({name:!0,type:!0,identifier:!0,notNull:!0,transient:!0,physicalName:!0,dataType:!0,length:!0,scale:!0,groupCode:!0,defaultValue:!0,attributeGroup:!0,description:!0,columnLogicalName:!0,unique:!0,updatable:!0,embeddableOverrides:!0,collectionType:!0,fieldLogicalName:!0}),k_=Io({field:!0,physicalName:!0,length:!0,scale:!0,insertable:!0,updatable:!0,notNull:!0,sharedColumnPhysicalName:!0}),Hm=Io({name:!0,unique:!0,columns:!0,description:!0,parameters:!0}),jm=Io({name:!0,visibility:!0,sourceCode:!0,description:!0,personalInfoAttributeType:!0}),__=Io({from:!0,to:!0,fromMultiplicity:!0,toMultiplicity:!0,identifying:!0,composition:!0}),E_=Io({name:!0,packageName:!0,description:!0,excludeDDLGeneration:!0,members:!0});function gn(e,n){return vo(e,n)}function Km(e){const n=new Set;for(const o of e??[])for(const i of gn(o,k_))n.add(i);return[...n]}const N_=new Set(["name","stereotype","packageName","superClass","schema","description","abstractClass","hasPersonalInfo","declarationOfInterfaces","table","classLogicalName","referenceOnly","serialization"]),w_=new Set(["description","identifying"]),I_=new Set(["multiplicity","navigable","composition"]),v_=new Set(["name","unique","description","parameters"]),C_=new Set(["name","visibility","sourceCode","description","order","personalInfoAttributeType"]);function vo(e,n,o=[]){const i=[];for(const a of Object.keys(e)){if(a.includes(".")){o.some(r=>a.startsWith(r))||i.push(a);continue}n.has(a)||i.push(a)}return i}const Xa=new Set(["physicalName","logicalName","dataType","length","scale","unique","autoIncrement","updatable","insertable","sharedColumnRef","multiValue","multiValueSeparator","sequenceName"]),S_=new Set([...Xa].filter(e=>e!=="sharedColumnRef"));function R_(e,n,o,i){if(i||o.some(l=>!S_.has(l))||e.attrType!=="NORMAL"||e.dbAttrs.length!==1)return null;const a={...e.dbAttrs[0]};for(const l of o)a[l]=n[l];const r={};for(const[l,s]of Object.entries(n))Xa.has(l)||(r[l]=s);return{...r,dbAttrs:[a]}}function A_(e,n,o,i,a,r,l,s){const c=Km(o);if(c.length)return s.push({code:"embeddable-override-unknown-key",opIndex:r,entity:l,handle:{ref:e.name},keys:c}),null;const d=new Map(o.map(f=>[f.field,f])),u=[];let m=!1;return e.dbAttrs.forEach((f,p)=>{const y=n.fields[p],g=y?d.get(y.name):void 0;if(!g){u.push(f);return}if(g.sharedColumnPhysicalName){const k={ref:g.sharedColumnPhysicalName,by:"physicalName"},_=Bm(Rn(i,a),k);if(!_.ok){s.push(_.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:r,entity:l,handle:k}:{code:"shared-column-target-ambiguous",opIndex:r,entity:l,handle:k,matches:_.matches}),m=!0;return}u.push({modelId:f.modelId,physicalName:"",dataType:"",sharedColumnRef:_.value.modelId});return}const b={...f};delete b.sharedColumnRef,u.push({...b,...g.physicalName!=null?{physicalName:g.physicalName}:{},...g.length!=null?{length:g.length}:{},...g.scale!=null?{scale:g.scale}:{},...g.notNull!=null?{notNull:g.notNull}:{},...g.insertable!=null?{insertable:g.insertable}:{},...g.updatable!=null?{updatable:g.updatable}:{}})}),m?null:u}function Gm(e,n,o){return{modelId:o(),name:e.name,order:n,...e.visibility?{visibility:e.visibility}:{},...e.sourceCode?{sourceCode:e.sourceCode}:{},...e.description?{description:e.description}:{},...e.personalInfoAttributeType?{personalInfoAttributeType:e.personalInfoAttributeType}:{}}}function Ym(e,n,o,i,a,r){const l=[];let s=!1;for(const c of n.columns){const d=f_(e,c.column);if(!d.ok){a.push(d.reason==="not-found"?{code:"column-not-found",opIndex:o,entity:i,handle:c.column}:{code:"column-ambiguous",opIndex:o,entity:i,handle:c.column,matches:d.matches}),s=!0;continue}l.push({columnRef:d.value.modelId,descending:c.descending??!1})}return s?null:{modelId:r(),name:n.name,unique:n.unique??!1,columns:l,...n.description?{description:n.description}:{},...n.parameters?{parameters:n.parameters}:{}}}function ei(e,n,o,i){const a=`${o}:${i}`;n.seen.has(a)||(n.seen.add(a),n.pairs.push({entityId:o,attributeId:i}),e.push({kind:"attribute.remove",casUnit:"logical",containerRef:o,entityRef:o,attributeRef:i}))}function x_(e,n,o,i){const a=new Map;for(const{entityId:r,attributeId:l}of o.pairs){if(i.has(r))continue;const s=a.get(r)??[];s.push(l),a.set(r,s)}for(const[r,l]of a){const s=n.entities.find(c=>c.modelId===r);if(s)for(const c of bm(s,l))e.push({kind:"index.update",casUnit:"logical",containerRef:r,entityRef:r,indexRef:c.indexRef,patch:{columns:c.columns}})}}function $_(e,n,o,i,a,r){const l=m=>{const f=new Map;for(const{entityId:p,item:y}of m){if(a.has(p))continue;const g=f.get(p)??[];g.push(y),f.set(p,g)}return f},s=l(o.pairs.map(m=>({entityId:m.entityId,item:m.attributeId}))),c=l(i.map(m=>({entityId:m.entityId,item:m.attribute}))),d=new Set(e.filter(m=>m.kind==="attribute.update").map(m=>m.attributeRef)),u=m=>{d.has(m.attributeId)||(d.add(m.attributeId),e.push({kind:"attribute.update",casUnit:"logical",containerRef:m.entityId,entityRef:m.entityId,attributeRef:m.attributeId,patch:{dbAttrs:m.dbAttrs}}))};for(const[m,f]of s)if(!c.has(m))for(const p of Em(n,m,f))u(p);for(const[m,f]of c){if(s.has(m))continue;const p={...n,entities:n.entities.map(y=>y.modelId===m?{...y,attributes:[...y.attributes,...f]}:y)};for(const y of km(p,m,r))u(y)}}function qm(e,n){const o={...e},i=[];for(const[a,r]of Object.entries(n)){if(!a.includes(".")){o[a]=r===null?void 0:r;continue}const l=/^dbAttrs\.(\d+)\.(.+)$/.exec(a);l&&i.push([Number(l[1]),l[2],r])}if(i.length){const a=(o.dbAttrs??[]).map(r=>({...r}));for(const[r,l,s]of i)a[r]&&(a[r][l]=s===null?void 0:s);o.dbAttrs=a}return o}function Wm(e,n,o,i,a,r,l){var f;for(const p of i.remove)ei(e,r,o,p);for(const p of i.update)e.push({kind:"attribute.update",casUnit:"logical",containerRef:o,entityRef:o,attributeRef:p.attributeId,patch:p.patch}),a.attrPatches.push({entityId:o,attributeId:p.attributeId,patch:p.patch});const s=((f=n.entities.find(p=>p.modelId===o))==null?void 0:f.attributes)??[],c=[];for(const p of i.add){const y={...p,order:l(o,s)};e.push({kind:"attribute.add",casUnit:"logical",containerRef:o,entityRef:o,value:y}),a.cascadeAdds.push({entityId:o,attribute:y}),c.push(y)}const d=new Set(i.remove),u=[...s.filter(p=>!d.has(p.modelId)),...c],m=new Set(u.map(p=>p.modelId));for(const p of n.associations){if(p.end2.entityRef!==o)continue;const y=p.end2.attributeRef;if(y&&m.has(y))continue;const b=u.filter(k=>{var _;return((_=k.derivedFrom)==null?void 0:_.associationRef)===p.modelId&&k.dbAttrs.length>0}).sort((k,_)=>k.order-_.order)[0];b&&(e.push({kind:"associationEnd.update",casUnit:"logical",containerRef:p.modelId,associationRef:p.modelId,end:"end2",patch:{attributeRef:b.modelId}}),a.endPatches.push({associationRef:p.modelId,end:"end2",patch:{attributeRef:b.modelId}}))}}function ds(e,n,o,i,a,r,l){for(const{entityId:s,plan:c}of Wd(n,o,i))Wm(e,n,s,c,a,r,l)}function T_(e,n,o,i,a,r){const l=new Map;for(const{entityId:f,attributeId:p}of i.pairs)l.has(f)||l.set(f,new Set),l.get(f).add(p);const s=new Map;for(const f of r.attrPatches)s.has(f.entityId)||s.set(f.entityId,[]),s.get(f.entityId).push(f);const c=new Map;for(const{entityId:f,attribute:p}of[...a,...r.cascadeAdds])c.has(f)||c.set(f,[]),c.get(f).push(p);const d=f=>{const p={};for(const[y,g]of Object.entries(f))y.includes(".")||(p[y]=g===null?void 0:g);return p},u=e.entities.filter(f=>!n.has(f.modelId)).map(f=>{const p=l.get(f.modelId),y=s.get(f.modelId),g=c.get(f.modelId);if(!p&&!y&&!g)return f;let b=f.attributes;return p&&(b=b.filter(k=>!p.has(k.modelId))),y&&(b=b.map(k=>{const _=y.filter(h=>h.attributeId===k.modelId);return _.length?_.reduce((h,C)=>qm(h,C.patch),k):k})),g&&(b=[...b,...g]),{...f,attributes:b}}),m=e.associations.filter(f=>!o.has(f.modelId)&&!n.has(f.end1.entityRef)&&!n.has(f.end2.entityRef)).map(f=>{let p=f;for(const y of r.assocPatches)y.associationRef===f.modelId&&(p={...p,...d(y.patch)});for(const y of r.endPatches)y.associationRef===f.modelId&&(p={...p,[y.end]:{...p[y.end],...d(y.patch)}});return p}).concat(r.addedAssociations);return{...e,entities:u,associations:m}}function M_(e,n,o,i,a,r,l,s,c){if(!l.identifierCascadeParents.size)return;const d=T_(n,o,i,a,r,l),u=new Map;for(const m of l.identifierCascadeParents)for(const[f,p]of Ll(d,m,s)){const y=u.get(f);u.set(f,y?Vl(y,p):p)}for(const[m,f]of u)Wm(e,d,m,qd(f),l,a,c)}const V_=new Set(["classLogicalName","columnLogicalName","fieldLogicalName","logicalName"]),L_=[{key:"name",kinds:new Set(["group.add","group.update"])},{key:"description",kinds:new Set(["attribute.add","attribute.update","operation.add","operation.update"])}];function B_(e){const n=[],o=e.kind??"",i=l=>V_.has(l)||L_.some(s=>s.key===l&&s.kinds.has(o)),a=l=>l===null?"null":Array.isArray(l)?"array":typeof l,r=(l,s)=>{if(!(l==null||typeof l!="object")){if(Array.isArray(l)){l.forEach((c,d)=>r(c,`${s}[${d}]`));return}for(const[c,d]of Object.entries(l)){const u=c.includes(".")?c.split(".").pop():c,m=s?`${s}.${c}`:c;i(u)&&!hg(d)?n.push({path:m,got:a(d)}):r(d,m)}}};return r(e,""),n}function D_(e){const n=i=>{if(i==null||typeof i!="object"||Array.isArray(i))return!1;const a=Object.keys(i);return a.length>0&&a.every(r=>qn.includes(r))},o=i=>{if(n(i))return Yc(i)??null;if(Array.isArray(i)){const a=i.map(o);return a.some((r,l)=>r!==i[l])?a:i}if(i!=null&&typeof i=="object"){const a=i;let r=!1;const l={};for(const[s,c]of Object.entries(a))l[s]=o(c),l[s]!==c&&(r=!0);return r?l:i}return i};return e.map(i=>o(i))}function O_(e,n,o={}){const i=D_(n),a=o.mkId??Fe,r=o.embeddableCatalog??[],l=N=>r.find(A=>A.type===N),s=[],c=[],d=[],u=new Set;n.forEach((N,A)=>{for(const T of B_(N))u.add(A),c.push({code:"multilang-shape-invalid",opIndex:A,where:T.path,expected:"{ko?,en?,ja?,zh?} | null | {}",got:T.got})});const m=new Map,f=(N,A)=>{const T=m.get(N)??Jt(A);return m.set(N,T+1),T},p=new Map,y=new Set,g=new Set,b={seen:new Set,pairs:[]},k=[],_={attrPatches:[],cascadeAdds:[],addedAssociations:[],assocPatches:[],endPatches:[],identifierCascadeParents:new Set},h=new Set,C=(N,A)=>`${N}\0${A}`,v=new Set;for(const N of i)N.kind==="entity.add"&&(v.add(N.spec.name),N.spec.physicalName&&v.add(N.spec.physicalName));const S=new Set;return i.forEach((N,A)=>{var T,O,z,P,D;if(!u.has(A)&&z_(N,A,c))switch(N.kind){case"entity.add":{{const B={ref:N.spec.name},j=gn(N.spec,b_);if(j.length){c.push({code:"entity-spec-unknown-key",opIndex:A,handle:B,keys:j});break}let X=!1;for(const W of N.spec.attributes??[]){const oe=gn(W,Um);oe.length&&(c.push({code:"attribute-spec-unknown-key",opIndex:A,entity:B,handle:{ref:W.name},keys:oe}),X=!0)}for(const W of N.spec.indexes??[]){const oe=gn(W,Hm);oe.length&&(c.push({code:"index-spec-unknown-key",opIndex:A,entity:B,handle:{ref:W.name},keys:oe}),X=!0)}for(const W of N.spec.operations??[]){const oe=gn(W,jm);oe.length&&(c.push({code:"operation-spec-unknown-key",opIndex:A,entity:B,handle:{ref:W.name},keys:oe}),X=!0)}if(X)break}const E=e.entities.filter(B=>B.name===N.spec.name).map(B=>B.modelId);if(E.length||S.has(N.spec.name)){c.push({code:"entity-name-conflict",opIndex:A,handle:{ref:N.spec.name},matches:E});break}S.add(N.spec.name);const R=a(),I={modelId:R,name:N.spec.name,stereotype:N.spec.stereotype??"JPA_ENTITY",attributes:[],...N.spec.useVersion?{jpaAttrs:{useVersion:!0}}:{},...N.spec.physicalName?{table:{physicalName:N.spec.physicalName}}:{},...N.spec.serialization?{serialization:N.spec.serialization}:{},...N.spec.classLogicalName?{classLogicalName:N.spec.classLogicalName}:{}},x={ref:N.spec.name};let $=!1;for(const[B,j]of(N.spec.attributes??[]).entries()){if(ka(j.type,j.groupCode)){c.push(j.groupCode?{code:"groupcode-type-mismatch",opIndex:A,entity:x,handle:{ref:j.name},type:String(j.type??""),groupCode:j.groupCode}:{code:"groupcode-required",opIndex:A,entity:x,handle:{ref:j.name}}),$=!0;continue}if(!l(j.type)&&!((T=j.embeddableOverrides)!=null&&T.length)&&Pm(j)){c.push({code:"datatype-required",opIndex:A,entity:x,handle:{ref:j.name}}),$=!0;continue}const X=l(j.type);if(X){const W=Fm(j,X,B,I,e.entities,A,x,c,a);W?I.attributes.push(W):$=!0}else(O=j.embeddableOverrides)!=null&&O.length?(c.push({code:"embeddable-type-unresolved",opIndex:A,entity:x,handle:{ref:j.name}}),$=!0):I.attributes.push(zm(j,B,a))}const U=(N.spec.operations??[]).map((B,j)=>Gm(B,j,a));U.length&&(I.operations=U);const F=[];for(const B of N.spec.indexes??[]){const j=Ym(I,B,A,x,c,a);j?F.push(j):$=!0}if(F.length&&(I.indexes=F),$)break;s.push({kind:"entity.add",casUnit:"logical",entityRef:R,value:I});break}case"entity.update":{const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}const R=vo(N.patch,N_,["jpaAttrs.","table.","serialization."]);if(R.length){c.push({code:"entity-patch-unknown-key",opIndex:A,entity:N.entity,keys:R});break}const I=N.patch.stereotype;if(typeof I=="string"&&I!==E.value.stereotype){const x=E.value.stereotype,$=I,U=lt($)&&!lt(x),F=!lt($)&<(x);if($!==x&<($)&<(x)&&e.entities.filter(W=>W.attributes.some(oe=>{var de;return((de=oe.embedded)==null?void 0:de.embeddableRef)===E.value.modelId})).length>0){c.push({code:"stereotype-embeddable-transition-unsupported",opIndex:A,entity:N.entity,from:x??"",to:$});break}if($==="SERIALIZED_TYPE"&&e.associations.filter(W=>W.end1.entityRef===E.value.modelId||W.end2.entityRef===E.value.modelId).length>0){c.push({code:"stereotype-serialized-transition-unsupported",opIndex:A,entity:N.entity,from:x??"",to:$});break}const j=U?xm(e,E.value.modelId,$):F?Rm(e,E.value.modelId):[];if(j.length){const X=Fa(E.value.modelId,N.patch),W=vu({logical:e,layout:Tm},[X,...j]);s.push(...W.ops);break}}s.push({kind:"entity.update",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,patch:N.patch});break}case"entity.remove":{const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}const R=E.value.modelId,I=e.associations.filter(F=>F.end1.entityRef===R||F.end2.entityRef===R),x=new Set(I.map(F=>F.modelId));for(const F of I)y.has(F.modelId)||(y.add(F.modelId),s.push({kind:"association.remove",casUnit:"logical",associationRef:F.modelId}));for(const F of e.entities)if(F.modelId!==R)for(const B of F.attributes)B.embedded&&x.has(B.embedded.associationRef)&&ei(s,b,F.modelId,B.modelId);for(const F of I){if(F.end1.entityRef===R||!F.end1.attributeRef)continue;const B=e.entities.find(X=>X.modelId===F.end1.entityRef),j=B==null?void 0:B.attributes.find(X=>X.modelId===F.end1.attributeRef&&X.attrType==="RELATION_REF");j&&ei(s,b,B.modelId,j.modelId)}const $={...e,entities:e.entities.filter(F=>F.modelId!==R),associations:e.associations.filter(F=>!x.has(F.modelId))},U=new Set(I.filter(F=>F.end1.entityRef===R&&F.end2.entityRef!==R).map(F=>F.end2.entityRef));ds(s,$,[...U],a,_,b,f);for(const F of e.groups)F.memberEntityRefs.includes(R)&&(h.has(C(F.modelId,R))||(h.add(C(F.modelId,R)),s.push({kind:"group.removeMember",casUnit:"logical",containerRef:F.modelId,groupRef:F.modelId,entityRef:R})));g.add(R),s.push({kind:"entity.remove",casUnit:"logical",entityRef:R});break}case"attribute.add":{{const $=gn(N.spec,Um);if($.length){c.push({code:"attribute-spec-unknown-key",opIndex:A,entity:N.entity,handle:{ref:N.spec.name},keys:$});break}}const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}if(ka(N.spec.type,N.spec.groupCode)){c.push(N.spec.groupCode?{code:"groupcode-type-mismatch",opIndex:A,entity:N.entity,handle:{ref:N.spec.name},type:String(N.spec.type??""),groupCode:N.spec.groupCode}:{code:"groupcode-required",opIndex:A,entity:N.entity,handle:{ref:N.spec.name}});break}if(!l(N.spec.type)&&!((z=N.spec.embeddableOverrides)!=null&&z.length)&&Pm(N.spec)){c.push({code:"datatype-required",opIndex:A,entity:N.entity,handle:{ref:N.spec.name}});break}const R=f(E.value.modelId,E.value.attributes),I=l(N.spec.type);let x;if(I)x=Fm(N.spec,I,R,E.value,e.entities,A,N.entity,c,a);else if((P=N.spec.embeddableOverrides)!=null&&P.length){c.push({code:"embeddable-type-unresolved",opIndex:A,entity:N.entity,handle:{ref:N.spec.name}});break}else x=zm(N.spec,R,a);if(!x)break;s.push({kind:"attribute.add",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,value:x}),k.push({entityId:E.value.modelId,attribute:x}),x.identifier&&_.identifierCascadeParents.add(E.value.modelId);break}case"attribute.update":case"attribute.remove":{const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}const R=Lm(E.value,N.attribute);if(!R.ok){c.push(R.reason==="not-found"?{code:"attribute-not-found",opIndex:A,entity:N.entity,handle:N.attribute}:{code:"attribute-ambiguous",opIndex:A,entity:N.entity,handle:N.attribute,matches:R.matches});break}if(N.kind==="attribute.update"){const I=[],x=[];let $=!1;for(const W of Object.keys(N.patch)){if(W.includes(".")){W.startsWith("dbAttrs.")?$=!0:x.push(W);continue}Xa.has(W)?I.push(W):g_.has(W)||x.push(W)}if(x.length){c.push({code:"attribute-patch-unknown-key",opIndex:A,entity:N.entity,handle:N.attribute,keys:x});break}if(ki(R.value)){const W=a_(R.value,N.patch);if(W.locked.length){const oe=Jn(e,E.value.modelId,R.value.modelId),de=ie=>{var Ie;return((Ie=e.entities.find(Le=>Le.modelId===ie))==null?void 0:Ie.name)??ie};c.push({code:"attribute-fk-derived-field-locked",opIndex:A,entity:N.entity,handle:N.attribute,fields:W.locked,...oe?{association:{from:de(oe.end1.entityRef),to:de(oe.end2.entityRef)}}:{}});break}W.inapplicable.length&&d.push({code:"fk-derived-inapplicable-field",opIndex:A,entity:N.entity,attribute:N.attribute,fields:W.inapplicable})}const U=Array.isArray(N.patch.dbAttrs)?N.patch.dbAttrs:R.value.dbAttrs,F="type"in N.patch?Tg({attrType:R.value.attrType,type:R.value.type,dbAttrs:U},String(N.patch.type),r):void 0;for(const[W,oe]of r_(R.value,E.value,e,N.patch,r))d.push({code:"inherited-slot-override",opIndex:A,entity:N.entity,attribute:N.attribute,columnIndex:W,fields:oe});if("attrType"in N.patch){const W=String(N.patch.attrType),oe=F?"EMBED_PREDEF":void 0,de=gm.includes(W)?W!==R.value.attrType&&W!==oe?"transition":void 0:"unknown-value";if(de){c.push({code:"attribute-attrtype-unsupported",opIndex:A,entity:N.entity,handle:N.attribute,reason:de,current:R.value.attrType,requested:W});break}}if("type"in N.patch&&!F){const W=String(N.patch.type);if(pd(R.value,W,r)){const oe=kl(R.value),de=oe==="association"?"association-owned":oe==="derived"?"derived":"column-count";c.push({code:"attribute-type-conversion-unsupported",opIndex:A,entity:N.entity,handle:N.attribute,reason:de,current:R.value.type,requested:W});break}}const B="type"in N.patch?N.patch.type:R.value.type,j="groupCode"in N.patch?N.patch.groupCode:R.value.groupCode;if(ka(B,j)){c.push(j?{code:"groupcode-type-mismatch",opIndex:A,entity:N.entity,handle:N.attribute,type:String(B??""),groupCode:String(j)}:{code:"groupcode-required",opIndex:A,entity:N.entity,handle:N.attribute});break}let X=N.patch;if(F&&R.value.attrType!=="EMBED_PREDEF"&&(X={...X,attrType:"EMBED_PREDEF"}),F&&R.value.customType!==void 0&&!("customType"in X)&&(X={...X,customType:null}),I.length){const W=R_(R.value,N.patch,I,$);if(!W){c.push({code:"attribute-patch-dbattr-flat-key",opIndex:A,entity:N.entity,handle:N.attribute,keys:I});break}X=W}if((D=N.embeddableOverrides)!=null&&D.length){const W=l(R.value.type);if(!W||R.value.attrType!=="EMBED_PREDEF"){c.push({code:"embeddable-type-unresolved",opIndex:A,entity:N.entity,handle:N.attribute});break}const oe=A_(R.value,W,N.embeddableOverrides,E.value,e.entities,A,N.entity,c);if(!oe)break;X={...X,dbAttrs:oe}}s.push({kind:"attribute.update",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,attributeRef:R.value.modelId,patch:X}),_.attrPatches.push({entityId:E.value.modelId,attributeId:R.value.modelId,patch:X});{const W=R.value,oe=qm(W,X),de=(oe.identifier??!1)!==(W.identifier??!1),ie=(W.identifier||oe.identifier)&&("type"in X||"customType"in X||"dbAttrs"in X||Object.keys(X).some(Ie=>Ie.startsWith("dbAttrs.")));(de||ie)&&_.identifierCascadeParents.add(E.value.modelId)}}else{const I=Jn(e,E.value.modelId,R.value.modelId);if(I){const x=$=>{var U;return((U=e.entities.find(F=>F.modelId===$))==null?void 0:U.name)??$};c.push({code:"attribute-fk-managed",opIndex:A,entity:N.entity,handle:N.attribute,association:{from:x(I.end1.entityRef),to:x(I.end2.entityRef)}});break}ei(s,b,E.value.modelId,R.value.modelId),R.value.identifier&&_.identifierCascadeParents.add(E.value.modelId)}break}case"association.add":{{const F=gn(N.spec,__);if(F.length){c.push({code:"association-spec-unknown-key",opIndex:A,handle:{from:N.spec.from,to:N.spec.to},keys:F});break}}const E=Tt(e,N.spec.from),R=Tt(e,N.spec.to);if(E.ok||c.push(Mt(E.reason,A,N.spec.from,E.matches,v)),R.ok||c.push(Mt(R.reason,A,N.spec.to,R.matches,v)),!E.ok||!R.ok)break;if(N.spec.identifying&&E.value.modelId===R.value.modelId){c.push({code:"self-identifying",opIndex:A,handle:{from:N.spec.from,to:N.spec.to}});break}if(E.value.stereotype==="JPA_EMBEDDABLE"||R.value.stereotype==="JPA_EMBEDDABLE"){c.push({code:"embeddable-relation-unsupported",opIndex:A,handle:{from:N.spec.from,to:N.spec.to}});break}if(E.value.stereotype==="SERIALIZED_TYPE"||R.value.stereotype==="SERIALIZED_TYPE"){c.push({code:"serialized-relation-invalid",opIndex:A,handle:{from:N.spec.from,to:N.spec.to}});break}const I=a(),x={modelId:I,...N.spec.identifying!=null?{identifying:N.spec.identifying}:{},end1:{entityRef:E.value.modelId,multiplicity:N.spec.fromMultiplicity??"EXACTLY_ONE_INSTANCE",navigable:!1,composition:!1},end2:{entityRef:R.value.modelId,multiplicity:N.spec.toMultiplicity??"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:N.spec.composition??!1}},$={...e,associations:[...e.associations,x]},U=Ci($,R.value.modelId,a);U.add[0]&&(x.end2.attributeRef=U.add[0].modelId),s.push({kind:"association.add",casUnit:"logical",associationRef:I,value:x}),_.addedAssociations.push(x);for(const F of U.add){const B={...F,order:f(R.value.modelId,R.value.attributes)};s.push({kind:"attribute.add",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,value:B}),_.cascadeAdds.push({entityId:R.value.modelId,attribute:B})}break}case"association.remove":{const E=Tt(e,N.association.from),R=Tt(e,N.association.to);if(E.ok||c.push(Mt(E.reason,A,N.association.from,E.matches,v)),R.ok||c.push(Mt(R.reason,A,N.association.to,R.matches,v)),!E.ok||!R.ok)break;const I=Vm(e,E.value.modelId,R.value.modelId);if(I.length!==1){c.push(I.length===0?{code:"association-not-found",opIndex:A,handle:N.association}:{code:"association-ambiguous",opIndex:A,handle:N.association,matches:I.map(F=>F.modelId)});break}const x=I[0];y.has(x.modelId)||(y.add(x.modelId),s.push({kind:"association.remove",casUnit:"logical",associationRef:x.modelId}));const $=e.entities.find(F=>F.attributes.some(B=>{var j;return((j=B.embedded)==null?void 0:j.associationRef)===x.modelId}));if($){const F=$.attributes.find(B=>{var j;return((j=B.embedded)==null?void 0:j.associationRef)===x.modelId});ei(s,b,$.modelId,F.modelId);break}if(x.end1.attributeRef){const F=e.entities.find(j=>j.modelId===x.end1.entityRef),B=F==null?void 0:F.attributes.find(j=>j.modelId===x.end1.attributeRef&&j.attrType==="RELATION_REF");B&&ei(s,b,F.modelId,B.modelId)}const U={...e,associations:e.associations.filter(F=>F.modelId!==x.modelId)};ds(s,U,[x.end2.entityRef],a,_,b,f);break}case"association.update":{const E=Jm(e,N.association,A,c,v);if(!E)break;const R=N.patch.identifying,I=typeof R=="boolean"?R:void 0;if(I===!0&&E.end1.entityRef===E.end2.entityRef){c.push({code:"self-identifying",opIndex:A,handle:N.association});break}const x=vo(N.patch,w_);if(x.length){c.push({code:"association-patch-unknown-key",opIndex:A,handle:N.association,keys:x});break}if(s.push({kind:"association.update",casUnit:"logical",containerRef:E.modelId,associationRef:E.modelId,patch:N.patch}),_.assocPatches.push({associationRef:E.modelId,patch:N.patch}),I!==void 0&&I!==(E.identifying??!1)){const $={...e,associations:e.associations.map(U=>U.modelId===E.modelId?{...U,identifying:I}:U)};ds(s,$,[E.end2.entityRef],a,_,b,f)}break}case"associationEnd.update":{const E=Jm(e,N.association,A,c,v);if(!E)break;const R=N.end==="from"?"end1":"end2";if(Object.prototype.hasOwnProperty.call(N.patch,"navigable")){if(R==="end2"){c.push({code:"navigable-toggle-unsupported",opIndex:A,handle:N.association});break}const x=N.patch.navigable===!0;if(E.end1.navigable!==x){const $=Am(e,E.modelId,x);if($){const U=on(E.modelId,"end1",{...N.patch,...$.endPatch}),F=vu({logical:e,layout:Tm},[...$.cmds,U]);s.push(...F.ops);break}}}const I=vo(N.patch,I_,["jpa."]);if(I.length){c.push({code:"association-end-patch-unknown-key",opIndex:A,handle:N.association,keys:I});break}s.push({kind:"associationEnd.update",casUnit:"logical",containerRef:E.modelId,associationRef:E.modelId,end:R,patch:N.patch}),_.endPatches.push({associationRef:E.modelId,end:R,patch:N.patch});break}case"index.add":{{const I=gn(N.spec,Hm);if(I.length){c.push({code:"index-spec-unknown-key",opIndex:A,entity:N.entity,handle:{ref:N.spec.name},keys:I});break}}const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}const R=Ym(E.value,N.spec,A,N.entity,c,a);if(!R)break;s.push({kind:"index.add",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,indexRef:R.modelId,value:R});break}case"index.update":case"index.remove":{const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}if(cs(N.index)){c.push({code:"handle-by-unsupported",opIndex:A,entity:N.entity,handle:N.index,target:"index"});break}const R=y_(E.value,N.index);if(!R.ok){c.push(R.reason==="not-found"?{code:"index-not-found",opIndex:A,entity:N.entity,handle:N.index}:{code:"index-ambiguous",opIndex:A,entity:N.entity,handle:N.index,matches:R.matches});break}if(N.kind==="index.update"){if("columns"in N.patch){c.push({code:"index-columns-patch-unsupported",opIndex:A,entity:N.entity,handle:N.index});break}const I=vo(N.patch,v_);if(I.length){c.push({code:"index-patch-unknown-key",opIndex:A,entity:N.entity,handle:N.index,keys:I});break}s.push({kind:"index.update",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,indexRef:R.value.modelId,patch:N.patch})}else s.push({kind:"index.remove",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,indexRef:R.value.modelId});break}case"operation.add":{{const x=gn(N.spec,jm);if(x.length){c.push({code:"operation-spec-unknown-key",opIndex:A,entity:N.entity,handle:{ref:N.spec.name},keys:x});break}}const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}const R=p.get(E.value.modelId)??(E.value.operations?Jt(E.value.operations):0);p.set(E.value.modelId,R+1);const I=Gm(N.spec,R,a);s.push({kind:"operation.add",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,operationRef:I.modelId,value:I});break}case"operation.update":case"operation.remove":{const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}if(cs(N.operation)){c.push({code:"handle-by-unsupported",opIndex:A,entity:N.entity,handle:N.operation,target:"operation"});break}const R=Dm(E.value,N.operation);if(!R.ok){c.push(R.reason==="not-found"?{code:"operation-not-found",opIndex:A,entity:N.entity,handle:N.operation}:{code:"operation-ambiguous",opIndex:A,entity:N.entity,handle:N.operation,matches:R.matches});break}if(N.kind==="operation.update"){const I=vo(N.patch,C_);if(I.length){c.push({code:"operation-patch-unknown-key",opIndex:A,entity:N.entity,handle:N.operation,keys:I});break}s.push({kind:"operation.update",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,operationRef:R.value.modelId,patch:N.patch})}else s.push({kind:"operation.remove",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,operationRef:R.value.modelId});break}case"attribute.reorder":case"operation.reorder":{const E=N.kind==="attribute.reorder",R=Tt(e,N.entity);if(!R.ok){c.push(Mt(R.reason,A,N.entity,R.matches,v));break}const I=E?N.order:N.operations;if(I.length===0){c.push({code:"reorder-empty",opIndex:A,entity:N.entity});break}const x=[],$=new Set;let U=!1;for(const X of I){if(!E&&cs(X)){c.push({code:"handle-by-unsupported",opIndex:A,entity:N.entity,handle:X,target:"operation"}),U=!0;continue}const W=E?Lm(R.value,X):Dm(R.value,X);if(!W.ok){c.push(W.reason==="not-found"?{code:"reorder-handle-not-found",opIndex:A,entity:N.entity,handle:X}:{code:"reorder-handle-ambiguous",opIndex:A,entity:N.entity,handle:X,matches:W.matches}),U=!0;continue}if($.has(W.value.modelId)){c.push({code:"reorder-handle-duplicate",opIndex:A,entity:N.entity,handle:X}),U=!0;continue}$.add(W.value.modelId),x.push(W.value)}if(U)break;const B=[...E?R.value.attributes:R.value.operations??[]].sort((X,W)=>X.order-W.order).filter(X=>!$.has(X.modelId)),j=[...x,...B];if(j.forEach((X,W)=>{X.order!==W&&s.push(E?{kind:"attribute.update",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,attributeRef:X.modelId,patch:{order:W}}:{kind:"operation.update",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,operationRef:X.modelId,patch:{order:W}})}),E)for(const X of _m(e,R.value.modelId,j.map(W=>W.modelId)))s.push({kind:"attribute.update",casUnit:"logical",containerRef:X.entityId,entityRef:X.entityId,attributeRef:X.attributeId,patch:{dbAttrs:X.dbAttrs}});break}case"group.add":{{const $=gn(N.spec,E_);if($.length){c.push({code:"group-spec-unknown-key",opIndex:A,keys:$});break}}const E=[];let R=!1;for(const $ of N.spec.members){const U=Tt(e,$);if(!U.ok){c.push(Mt(U.reason,A,$,U.matches,v)),R=!0;continue}E.push(U.value.modelId)}if(R)break;const I=a(),x={modelId:I,excludeDDLGeneration:N.spec.excludeDDLGeneration??!1,memberEntityRefs:E,...N.spec.name?{name:N.spec.name}:{},...N.spec.packageName?{packageName:N.spec.packageName}:{},...N.spec.description?{description:N.spec.description}:{}};s.push({kind:"group.add",casUnit:"logical",groupRef:I,value:x});break}case"group.update":{const E=ls(e,N.group);if(!E.ok){c.push(ss(E,A,N.group));break}const R=vo(N.patch,d_);if(R.length){c.push({code:"group-patch-unknown-key",opIndex:A,handle:N.group,keys:R});break}s.push({kind:"group.update",casUnit:"logical",containerRef:E.value.modelId,groupRef:E.value.modelId,patch:N.patch});break}case"group.remove":{const E=ls(e,N.group);if(!E.ok){c.push(ss(E,A,N.group));break}s.push({kind:"group.remove",casUnit:"logical",groupRef:E.value.modelId});break}case"group.addMember":case"group.removeMember":{const E=ls(e,N.group);if(!E.ok){c.push(ss(E,A,N.group));break}const R=Tt(e,N.entity);if(!R.ok){c.push(Mt(R.reason,A,N.entity,R.matches,v));break}const I=E.value.memberEntityRefs.includes(R.value.modelId);if(N.kind==="group.addMember"?I:!I)break;if(N.kind==="group.removeMember"){if(h.has(C(E.value.modelId,R.value.modelId)))break;h.add(C(E.value.modelId,R.value.modelId))}s.push({kind:N.kind,casUnit:"logical",containerRef:E.value.modelId,groupRef:E.value.modelId,entityRef:R.value.modelId});break}}}),c.length||M_(s,e,g,y,b,k,_,a,f),c.length||x_(s,e,b,g),c.length||$_(s,e,b,k,g,a),c.length?{ok:!1,errors:c}:d.length?{ok:!0,ops:s,notices:d}:{ok:!0,ops:s}}function Mt(e,n,o,i,a){return e==="shape"?{code:"handle-shape-invalid",opIndex:n,where:"entity",expected:"{ref, by?}",got:us(o)}:e==="not-found"&&(a!=null&&a.has(o.ref))?{code:"pending-entity-ref",opIndex:n,handle:o}:e==="not-found"?{code:"entity-not-found",opIndex:n,handle:o}:{code:"entity-ambiguous",opIndex:n,handle:o,matches:i}}const Za=e=>!!e&&typeof e=="object"&&typeof e.ref=="string",P_=e=>!!e&&typeof e=="object"&&Za(e.from)&&Za(e.to),us=e=>e===void 0?"undefined":e===null?"null":typeof e!="object"?typeof e:`{${Object.keys(e).join(",")}}`;function z_(e,n,o){const i=e,a=[];for(const l of["attribute","index","operation","group"])l in i&&a.push([l,i[l],Za(i[l])]);(e.kind==="association.update"||e.kind==="association.remove"||e.kind==="associationEnd.update")&&a.push(["association",i.association,P_(i.association)]);let r=!0;for(const[l,s,c]of a)c||(r=!1,o.push({code:"handle-shape-invalid",opIndex:n,where:l,expected:l==="association"?"{from:{ref}, to:{ref}}":"{ref, by?}",got:us(s)}));return r}function Jm(e,n,o,i,a){const r=Tt(e,n.from),l=Tt(e,n.to);if(r.ok||i.push(Mt(r.reason,o,n.from,r.matches,a)),l.ok||i.push(Mt(l.reason,o,n.to,l.matches,a)),!r.ok||!l.ok)return null;const s=Vm(e,r.value.modelId,l.value.modelId);return s.length!==1?(i.push(s.length===0?{code:"association-not-found",opIndex:o,handle:n}:{code:"association-ambiguous",opIndex:o,handle:n,matches:s.map(c=>c.modelId)}),null):s[0]}const Xm={type:"object",description:"요소 지정 핸들. 엔티티: 물리명(table.physicalName) 우선, 논리명(name) 보조. 속성: 소속 엔티티 내 속성명 또는 컬럼 물리명.",properties:{ref:{type:"string",description:"매칭할 이름/물리명. by:'modelId'면 modelId 원문."},by:{type:"string",enum:["physicalName","name","modelId"],description:"매칭 키 고정(미지정 시 대상별 기본 순서). 'modelId'는 모호 해소 전용 탈출구 — 평시엔 쓰지 말고, entity-ambiguous 응답의 후보를 사용자에게 제시해 확인받은 뒤 그 modelId로 재전송할 때만 쓴다."}},required:["ref"],additionalProperties:!1},F_={type:"object",description:"엔티티 내 이름으로 지정(인덱스명·메서드명). 물리명 차원이 없어 매칭 키 고정(`by`)을 받지 않는다.",properties:{ref:{type:"string",description:"매칭할 이름."}},required:["ref"],additionalProperties:!1},U_={type:"object",description:"관계는 무명이라 양 끝 엔티티로 주소. from=부모(end1), to=자식(end2). 같은 쌍 복수 관계는 모호 보고.",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"}},required:["from","to"],additionalProperties:!1},an={type:"object",properties:{ko:{type:"string"},en:{type:"string"},ja:{type:"string"},zh:{type:"string"}},additionalProperties:!1},H_={type:"object",description:"신규 엔티티. 자식(속성·인덱스·operation)은 별도 attribute.add 등이 아니라 여기 inline 배열로 담아라 — 같은 배치에서 갓 추가된 엔티티에 닿는 child op은 silent no-op이 된다(서버가 pending-entity-ref로 거부). 관계는 inline 불가 → 엔티티 추가 배치 확정 후 별도 배치로 association.add.",properties:{name:{type:"string"},stereotype:{type:"string",enum:["UNDEFINED","JPA_ENTITY","JPA_EMBEDDABLE","JPA_MULTI_LANGUAGE_ENTITY","SERIALIZED_TYPE"],description:"기본 JPA_ENTITY."},physicalName:{type:"string",description:"설정 시 table.physicalName."},classLogicalName:{...an,description:"**클래스** 논리명(다국어). 테이블이 없는 자리(직렬화 타입 SERIALIZED_TYPE)의 논리명이 여기 산다 — 그 타입은 table 자체를 갖지 않아 table.logicalName 을 줄 데가 없다. ⚠️테이블이 있는 엔티티는 table.logicalName 이 이기므로 그쪽을 쓴다."},useVersion:{type:"boolean",description:'JPA @Version(낙관적 락) → jpaAttrs.useVersion. @Version 필드는 별도 속성이 아니라 이 엔티티 플래그로 흡수 (버전 컬럼은 코드젠 소유). 기존 엔티티는 entity.update patch의 dotted key {"jpaAttrs.useVersion":true} 사용.'},attributes:{type:"array",description:"inline 속성(배열 순서가 order). attribute.add와 동일 규칙 — GroupCodeEnum은 groupCode 동반 필수.",items:{$ref:"#/$defs/attrSpec"}},indexes:{type:"array",description:"inline 인덱스. 컬럼 핸들은 이 엔티티가 inline으로 만드는 dbAttr 내에서 해소된다(attributes 동반 전제).",items:{$ref:"#/$defs/indexSpec"}},operations:{type:"array",description:"inline 도메인 메서드(배열 순서가 order).",items:{$ref:"#/$defs/operationSpec"}},serialization:{$ref:"#/$defs/serialization"}},required:["name"],additionalProperties:!1},j_={type:"object",description:"직렬화 타입의 컨테이너(SERIALIZED_TYPE 전용). 미지정 = 컬렉션이 아닌 단일 값(한 컬럼에 구조 하나). 신규 엔티티는 entity.add 에 함께 줘야 한다 — 같은 배치의 entity.update 는 갓 만든 엔티티에 닿지 못한다.",properties:{collectionType:{type:"string",enum:["LIST","SET","MAP"],description:"컨테이너 종류. 코퍼스 실재가 java.util 3종뿐이라 그만 표현한다(미지 컨테이너는 발명하지 않는다)."},mapKeyType:{type:"string",description:"collectionType='MAP' 일 때의 키 타입(단순명 또는 FQN). 그 외엔 무의미."}},additionalProperties:!1},K_={type:"object",properties:{name:{type:"string"},type:{type:"string",description:"Java 타입(예: Long, String). GroupCodeEnum은 파생 타입이라 groupCode 동반 필수(없으면 거부). 호스트 임베더블 카탈로그에 등록된 predefined 임베더블 타입(예: Money, EmbeddableAddress)이면 EMBED_PREDEF로 다중 컬럼 확장(서브컬럼 조정은 embeddableOverrides)."},identifier:{type:"boolean"},notNull:{type:"boolean"},transient:{type:"boolean",description:"JPA @Transient(비영속) → Attribute.transient. 컬럼을 만들지 않으므로 physicalName/dataType 등 컬럼 필드는 함께 주지 않는다. 기존 속성은 attribute.update patch {transient:true}로도 가능."},physicalName:{type:"string",description:"설정 시 단일 dbAttr 컬럼 생성(미설정이면 name을 물리명으로)."},dataType:{type:"string",description:"dbAttr 물리 타입(예: BIGINT). physicalName/dataType/length/scale 중 하나라도 있으면 컬럼 생성."},length:{type:"integer",description:"dbAttr 컬럼 길이(VARCHAR(n)·DECIMAL precision)."},scale:{type:"integer",description:"dbAttr 소수 자릿수(DECIMAL/NUMERIC scale). length 동반이 일반적."},groupCode:{type:"string",description:"코드성 속성의 group code 바인딩. type=GroupCodeEnum이면 필수."},defaultValue:{type:"string",description:"속성 기본값(문자열 패스스루)."},attributeGroup:{type:"string",description:"속성 분류 그룹(예: 'code'·'amt')."},description:{...an,description:"속성 설명(다국어)."},columnLogicalName:{...an,description:'dbAttr 컬럼 논리명(다국어, 예: {ko:"체크아웃유형"}). 한글 업무명 보존 위치.'},fieldLogicalName:{...an,description:"**필드** 논리명(다국어). 평탄 `logicalName`(컬럼 논리명)과 **다른 축**이다 — 컬럼이 없는 자리(직렬화 타입 SERIALIZED_TYPE 의 자기 필드)는 dbAttrs 가 0이라 컬럼 논리명을 줄 데가 없고, 그 자리의 논리명이 여기 산다(캔버스 논리 뷰·탐색기 검색·코드젠 javadoc 이 읽는다). 컬럼이 있는 자리에서는 컬럼 논리명이 이긴다."},unique:{type:"boolean",description:"dbAttr UNIQUE 제약."},updatable:{type:"boolean",description:"dbAttr 갱신 가능(JPA @Column(updatable=))."},embeddableOverrides:{$ref:"#/$defs/embeddableOverrides"},collectionType:{type:"string",enum:["LIST","SET"],description:"이 «필드»가 컬렉션인가 — **직렬화 타입(SERIALIZED_TYPE)의 자기 필드 전용**(예: Set<String>·List<StoredFile>). 컬럼 있는 자리는 읽지 않는다 — 그쪽 컨테이너는 요소 타입이 소유한다(entity 의 serialization.collectionType). 요소가 문서 안 직렬화 타입이면 그 타입이 이미 감싸므로 지정하지 않는다. 미지정 = 컬렉션 아님."}},required:["name","type"],additionalProperties:!1},G_={type:"array",description:"predefined 임베더블 서브컬럼 오버라이드(속성 type이 카탈로그 엔트리이자 EMBED_PREDEF일 때만). field=카탈로그 필드명으로 매칭(@AttributeOverride 대응). 미설정 서브컬럼은 add=카탈로그 기본 상속 / update=기존값 유지. currency 등 공유 컬럼은 sharedColumnPhysicalName으로 SHARED_REF. ⚠️바인딩 축만 덮는다 — 서브컬럼 **논리명**은 여기 없고 patch의 dotted `dbAttrs.<i>.logicalName`이 받는다.",items:{type:"object",properties:{field:{type:"string",description:"대상 카탈로그 필드명(예: amount·currency)."},physicalName:{type:"string",description:"서브컬럼 물리명 오버라이드(@AttributeOverride column name). 미설정 시 카탈로그 기본."},length:{type:"integer",description:"서브컬럼 길이 오버라이드."},scale:{type:"integer",description:"서브컬럼 소수 자릿수 오버라이드."},insertable:{type:"boolean",description:"JPA @Column(insertable=). OWN 컬럼에만 저장."},updatable:{type:"boolean",description:"JPA @Column(updatable=). OWN 컬럼에만 저장."},notNull:{type:"boolean",description:"JPA @Column(nullable=false) — **이 서브컬럼 하나의** NOT NULL. 미설정이면 속성 축(notNull)을 따른다. ★임베더블은 컬럼마다 제약이 갈릴 수 있어(실측: ChangedBy 는 type 컬럼만 NOT NULL) 속성 축 하나로는 담기지 않는다. OWN 컬럼에만 저장."},sharedColumnPhysicalName:{type:"string",description:"SHARED_REF — 같은 엔터티(임베더블이면 owner 합집합) 다른 컬럼(물리명)을 공유해 read-only 투영(대표: currency). 설정 시 자체 컬럼 미보유, 타깃은 해소 시점 존재 필수."}},required:["field"],additionalProperties:!1}},Zm={type:"string",enum:["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"]},Y_={type:"object",description:'일반 연관 생성. 양 end 는 일반 엔티티여야 한다 — 임베더블(JPA_EMBEDDABLE)·직렬화 타입을 end 로 주면 거부된다. 직렬화 타입은 관계가 아니라 소비 속성의 type 으로 지목한다(attribute.update {type: "<타입명>"}). (임베드는 EMBED 관계여야 하고 이 어휘엔 없다 → 캔버스에서 연결).',properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"},fromMultiplicity:{...Zm,description:"end1 다중성(기본 EXACTLY_ONE_INSTANCE)."},toMultiplicity:{...Zm,description:"end2 다중성(기본 ZERO_OR_MORE_INSTANCES)."},identifying:{type:"boolean",description:"식별 관계(부모 PK가 자식 PK로 전파). self-association은 식별 불가."},composition:{type:"boolean",description:"end2 composition."}},required:["from","to"],additionalProperties:!1},q_={type:"object",properties:{name:{type:"string"},unique:{type:"boolean",description:"UNIQUE 인덱스 여부(기본 false)."},columns:{type:"array",description:"인덱스 컬럼(순서 의미 있음).",items:{type:"object",properties:{column:{...Xm,description:"컬럼 핸들 — 컬럼 물리명 우선, 속성명 보조(단일 컬럼 속성만). 엔티티 내에서 dbAttr modelId로 해소."},descending:{type:"boolean",description:"내림차순(기본 false)."}},required:["column"],additionalProperties:!1}},description:{type:"string",description:"인덱스 설명(평문)."},parameters:{type:"string",description:"인덱스 파라미터(패스스루)."}},required:["name","columns"],additionalProperties:!1},W_={type:"object",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"],description:"가시성(기본 미설정)."},sourceCode:{type:"string",description:"Java 메서드 본문(멀티라인, 파라미터·반환 시그니처 포함)."},description:{...an,description:"메서드 설명(다국어)."},personalInfoAttributeType:{type:"string",description:"개인정보 속성 유형(패스스루)."}},required:["name"],additionalProperties:!1},J_={type:"object",properties:{name:{...an,description:'그룹 논리명(다국어, 예: {ko:"주문"}).'},packageName:{type:"string",description:"자바 패키지명 등 그룹 물리 식별(레거시 LogicalGroup.packageName)."},description:{type:"string",description:"그룹 설명(자유 텍스트 — 도메인 경계 메모)."},excludeDDLGeneration:{type:"boolean",description:"DDL 생성 제외(기본 false)."},members:{type:"array",description:"멤버 엔티티 핸들(물리명 우선/논리명 보조). 기존 엔티티여야 함 — 같은 배치 신규 엔티티는 별도 배치 후.",items:{$ref:"#/$defs/handle"}}},required:["members"],additionalProperties:!1},X_={type:"object",description:'기존 속성 부분 patch. 논리 필드 + 스칼라 단일 컬럼의 물리 필드(physicalName·dataType·length·scale 등 — 서버가 dbAttrs[0]에 매핑). ⚠️평탄 물리 키는 **attrType 이 NORMAL 이고 컬럼이 하나일 때만** 매핑된다 — FK 파생(RELATION_*)·임베드·직렬화 타입 자리에서는 거부되고 **dotted 로 지목**해야 한다(`{"dbAttrs.0.physicalName":"…"}`). EMBED_PREDEF/Money 서브컬럼 «바인딩» 조정만 op-레벨 embeddableOverrides 소관이다(그 배열엔 논리명·dataType 축이 없다). ★다중 컬럼 속성의 **개별 컬럼 필드**는 dotted 키로 지목한다 — `{"dbAttrs.<i>.logicalName":{ko:"…"}}` 처럼. dotted 허용 접두는 `dbAttrs.` 하나뿐이고, 같은 op에서 평탄 키와 섞으면 $set 충돌로 거부된다.',properties:{name:{type:"string"},type:{type:"string",description:"자바 타입. **컬럼 개수가 바뀌는 전환만 거부된다**(임베더블 타입으로 1→N, 임베더블을 다른 타입으로 N→1). 그 전환은 attribute.remove + attribute.add 로 내고(자리를 지키려면 같은 배치에 attribute.reorder). ★반대로 **개수가 같은 값 타입 재지정은 이 patch 하나로 된다** — 1컬럼 속성을 1필드 임베더블로 바꾸는 등. attrType은 목적지에서 파생되므로 생략해도 되고(EMBED_PREDEF로 자동), 실어 보내면 그 파생값과 같아야 한다. dbAttrs는 modelId째 보존되어 물리명·논리명·길이·인덱스 ref·order가 그대로 살아남는다. 임베드 서브컬럼 «바인딩» 조정만 embeddableOverrides 소관이다."},customType:{type:"string"},attrType:{type:"string",enum:[...gm],description:"속성 종류. **현재 값과 다르게 주면 거부된다** — 관계/임베드/구분선은 동반 구조(관계 소유·embedded·빈 dbAttrs)가 있어야 성립하고 patch로는 표현할 수 없다. 관계 실체화는 association.add, 임베드 서브컬럼은 embeddableOverrides 소관. ★예외 하나 — 같은 patch의 type이 «컬럼 개수가 같은» 임베더블을 가리키면 NORMAL→EMBED_PREDEF 동반 전환이 허용된다(생략해도 파생된다)."},identifier:{type:"boolean"},notNull:{type:"boolean"},transient:{type:"boolean"},naturalId:{type:"boolean"},naturalIdMutable:{type:"boolean"},derivedIdFieldName:{type:"string",description:"파생 식별(@MapsId) FK가 매핑되는 **스칼라 @Id 필드명**. 이 속성의 name은 연관 필드명(@MapsId @OneToOne 필드)이고 같은 관계가 두 Java 필드를 만든다. 단일 컬럼 @OneToOne 식별 FK에만 의미가 있고, 미설정 시 부모 PK 물리명의 camelCase로 파생된다(실물 관행). 컬럼은 공유하므로 속성은 하나이며 물리명은 지정하지 않는다."},description:{...an,description:"속성 설명(다국어)."},fieldLogicalName:{...an,description:"**필드** 논리명(다국어). 평탄 `logicalName`(컬럼 논리명)과 **다른 축**이다 — 컬럼이 없는 자리(직렬화 타입 SERIALIZED_TYPE 의 자기 필드)는 dbAttrs 가 0이라 컬럼 논리명을 줄 데가 없고, 그 자리의 논리명이 여기 산다(캔버스 논리 뷰·탐색기 검색·코드젠 javadoc 이 읽는다). 컬럼이 있는 자리에서는 컬럼 논리명이 이긴다."},attributeGroup:{type:"string"},groupCode:{type:"string"},defaultValue:{type:"string"},personalInfoAttributeType:{type:"string"},order:{type:"integer"},physicalName:{type:"string"},dataType:{type:"string"},length:{type:"integer"},scale:{type:"integer"},unique:{type:"boolean"},updatable:{type:"boolean"},insertable:{type:"boolean"},autoIncrement:{type:"boolean"},multiValue:{type:"boolean"},multiValueSeparator:{type:"string"},sequenceName:{type:"string"},logicalName:{...an,description:"**컬럼** 논리명(다국어). 대상이 스칼라 단일 컬럼일 때 dbAttrs[0]에 매핑된다. ★대상이 **다중 컬럼**(EMBED_PREDEF·Money 등)이면 이 평탄 키는 «어느 컬럼인지 모호» 로 거부되고, dotted `dbAttrs.<i>.logicalName` 이 그 값을 받는다(embeddableOverrides 에는 논리명 축이 없다). dbAttrs 가 0인 속성(직렬화 타입 필드·transient)에 주면 거부되고, 그 자리는 `fieldLogicalName` 이 받는다."}},additionalProperties:!1},Z_={type:"object",description:"관계 부분 patch. 양 end 설정(multiplicity·nav·jpa)은 associationEnd.update로.",properties:{description:{type:"string"},identifying:{type:"boolean",description:"식별 관계(부모 PK가 자식 PK 일부로 전파)."}},additionalProperties:!1},Q_={type:"object",description:"인덱스 부분 patch. columns(컬럼 구성) 변경은 index.remove+index.add로(패치 불가).",properties:{name:{type:"string"},unique:{type:"boolean"},description:{type:"string"},parameters:{type:"string"}},additionalProperties:!1},eE={type:"object",description:"메서드 부분 patch.",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"]},sourceCode:{type:"string"},description:{...an,description:"메서드 설명(다국어)."},order:{type:"integer"},personalInfoAttributeType:{type:"string"}},additionalProperties:!1},tE={type:"object",description:'엔티티 부분 patch. 논리 키: name·stereotype·packageName·superClass·schema·description·abstractClass·hasPersonalInfo·referenceOnly·declarationOfInterfaces·table·serialization·classLogicalName. classLogicalName = **클래스** 논리명(테이블 없는 직렬화 타입의 논리명이 사는 곳 — 그 타입은 table 을 갖지 않는다). 테이블이 있는 엔티티는 table.logicalName(dotted-key)이 이긴다. serialization(직렬화 타입 컨테이너)은 통째로 주거나(예: {"serialization":{"collectionType":"LIST"}}) dotted-key로 준다({"serialization.collectionType":"LIST"}). 컬렉션 아님으로 되돌릴 땐 null 로 비운다(wire clear 규약). jpaAttrs 플래그(useVersion 등)는 형제 클로버 방지를 위해 dotted-key로 준다: {"jpaAttrs.useVersion": true}. 자식(attributes/indexes/operations)은 patch가 아니라 전용 op로 변경. stereotype 은 값 타입(JPA_EMBEDDABLE·SERIALIZED_TYPE) 경계를 넘을 수 없다 — 들어가고 나오는 전환은 PK 해제/부여·FK reconcile·EMBED 복원/해체가 동반되는 composite라 patch로 표현되지 않는다(거부. 전환은 GUI 소관).'},nE={type:"object",description:'관계 end 부분 patch. 논리 키: multiplicity·navigable·composition. jpa 설정(cascadeTypes·fetchType·orphanRemoval·orderBy·collectionType·collectionTable·orderColumn)은 형제 클로버 방지를 위해 dotted-key로: {"jpa.orphanRemoval": true}.'};function pt(e,n){return{type:"object",properties:{kind:{const:e},...n.properties},required:["kind",...n.required],additionalProperties:!1}}const oE={"entity.add":pt("entity.add",{properties:{spec:{$ref:"#/$defs/entitySpec"}},required:["spec"]}),"entity.update":pt("entity.update",{properties:{entity:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/entityUpdatePatch"}},required:["entity","patch"]}),"entity.remove":pt("entity.remove",{properties:{entity:{$ref:"#/$defs/handle"}},required:["entity"]}),"attribute.add":pt("attribute.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/attrSpec"}},required:["entity","spec"]}),"attribute.update":pt("attribute.update",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/attrUpdatePatch"},embeddableOverrides:{$ref:"#/$defs/embeddableOverrides"}},required:["entity","attribute","patch"]}),"attribute.remove":pt("attribute.remove",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"}},required:["entity","attribute"]}),"association.add":pt("association.add",{properties:{spec:{$ref:"#/$defs/assocSpec"}},required:["spec"]}),"association.remove":pt("association.remove",{properties:{association:{$ref:"#/$defs/assocHandle"}},required:["association"]}),"association.update":pt("association.update",{properties:{association:{$ref:"#/$defs/assocHandle"},patch:{$ref:"#/$defs/assocUpdatePatch"}},required:["association","patch"]}),"associationEnd.update":pt("associationEnd.update",{properties:{association:{$ref:"#/$defs/assocHandle"},end:{type:"string",enum:["from","to"],description:"from=부모(end1), to=자식(end2)."},patch:{$ref:"#/$defs/assocEndUpdatePatch"}},required:["association","end","patch"]}),"index.add":pt("index.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/indexSpec"}},required:["entity","spec"]}),"index.update":pt("index.update",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/nameHandle"},patch:{$ref:"#/$defs/indexUpdatePatch"}},required:["entity","index","patch"]}),"index.remove":pt("index.remove",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/nameHandle"}},required:["entity","index"]}),"operation.add":pt("operation.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/operationSpec"}},required:["entity","spec"]}),"operation.update":pt("operation.update",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/nameHandle"},patch:{$ref:"#/$defs/operationUpdatePatch"}},required:["entity","operation","patch"]}),"operation.remove":pt("operation.remove",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/nameHandle"}},required:["entity","operation"]}),"attribute.reorder":pt("attribute.reorder",{properties:{entity:{$ref:"#/$defs/handle"},order:{type:"array",items:{$ref:"#/$defs/handle"}}},required:["entity","order"]}),"operation.reorder":pt("operation.reorder",{properties:{entity:{$ref:"#/$defs/handle"},operations:{type:"array",items:{$ref:"#/$defs/nameHandle"}}},required:["entity","operations"]}),"group.add":pt("group.add",{properties:{spec:{$ref:"#/$defs/groupSpec"}},required:["spec"]}),"group.update":pt("group.update",{properties:{group:{$ref:"#/$defs/groupHandle"},patch:{$ref:"#/$defs/groupUpdatePatch"}},required:["group","patch"]}),"group.remove":pt("group.remove",{properties:{group:{$ref:"#/$defs/groupHandle"}},required:["group"]}),"group.addMember":pt("group.addMember",{properties:{group:{$ref:"#/$defs/groupHandle"},entity:{$ref:"#/$defs/handle"}},required:["group","entity"]}),"group.removeMember":pt("group.removeMember",{properties:{group:{$ref:"#/$defs/groupHandle"},entity:{$ref:"#/$defs/handle"}},required:["group","entity"]})},iE={type:"object",description:"그룹 지정 핸들. 패키지명(packageName) 우선, 이름(name) 보조 — 이름은 다국어라 어느 로케일 값이든 일치하면 매칭. 'modelId'는 모호 해소 전용(group-ambiguous 후보를 사용자에게 확인받은 뒤).",properties:{ref:{type:"string",description:"매칭할 패키지명/이름. by:'modelId'면 modelId 원문."},by:{type:"string",enum:["packageName","name","modelId"],description:"매칭 키 고정(미지정 시 packageName → name)."}},required:["ref"],additionalProperties:!1},aE={type:"object",description:"그룹 부분 patch. 멤버 변경은 group.addMember/removeMember로(배열 통째 교체는 동시 편집이 서로를 덮는다).",properties:{name:{...an,description:"그룹 논리명(다국어)."},packageName:{type:"string"},description:{type:"string"},excludeDDLGeneration:{type:"boolean"}},additionalProperties:!1},Qm={anyOf:ym.map(e=>oE[e])},rE={type:"object",description:"엔티티 모델을 생성·수정·삭제할 때 호출한다. ops는 사람 핸들(엔티티 물리명/논리명, 속성명)로 지정하며 서버가 modelId로 해소한다. 모호하면 에러로 후보를 돌려주니 리소스로 현재 모델을 먼저 읽어 핸들을 확정하라.",properties:{ops:{type:"array",items:{$ref:"#/$defs/symbolicOp"}}},required:["ops"],additionalProperties:!1,$defs:{handle:Xm,nameHandle:F_,groupHandle:iE,assocHandle:U_,entitySpec:H_,serialization:j_,attrSpec:K_,embeddableOverrides:G_,assocSpec:Y_,indexSpec:q_,operationSpec:W_,groupSpec:J_,entityUpdatePatch:tE,attrUpdatePatch:X_,assocUpdatePatch:Z_,assocEndUpdatePatch:nE,indexUpdatePatch:Q_,operationUpdatePatch:eE,groupUpdatePatch:aE,symbolicOp:Qm}};function lE(e,n,o,i={}){const a=i.mkClientOpId??Fe,r=new Set;for(const s of o)s.casUnit==="logical"&&s.containerRef&&r.add(s.containerRef);const l={};if(r.size){l.revs={};for(const s of r)l.revs[s]=n[s]??0}return{diagramId:e,ops:o,cas:l,origin:i.origin??"agent",clientOpId:a()}}const ef={location:{x:0,y:0},size:{width:220,height:140}};function tf(e){return{modelId:e.modelId,physicalName:e.physicalName,logicalName:e.logicalName,dataType:e.dataType,length:e.length,scale:e.scale,unique:e.unique,autoIncrement:e.autoIncrement,updatable:e.updatable,insertable:e.insertable,notNull:e.notNull,sharedColumnRef:e.sharedColumnRef,multiValue:e.multiValue,multiValueSeparator:e.multiValueSeparator,sequenceName:e.sequenceName}}const sE=/^[-=_*~\s]{3,}$/;function cE(e){return e.attrType&&e.attrType!=="NORMAL"||!sE.test(e.name??"")?!1:!(e.dbAttrs??[]).some(n=>n.physicalName||n.dataType)}function dE(e){return e.type===pn&&e.customType==="java.util.Currency"?{type:"Currency",customType:void 0}:{type:e.type,customType:e.customType}}function uE(e,n){if(e.attrType==="DIVIDER"||cE(e))return{modelId:e.modelId,name:e.attrType==="DIVIDER"?e.name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:e.order??n,dbAttrs:[]};const o=dE(e);return{modelId:e.modelId,name:e.name,type:o.type,customType:o.customType,attrType:e.attrType,identifier:e.identifier,notNull:e.notNull,transient:e.transient_,naturalId:e.naturalId,naturalIdMutable:e.naturalIdMutable,description:e.description,attributeGroup:e.attributeGroup,groupCode:e.groupCode,defaultValue:e.defaultValue,personalInfoAttributeType:e.personalInfoAttributeType,order:e.order??n,dbAttrs:e.dbAttrs.map(tf)}}function mE(e,n){const{modelId:o,name:i,visibility:a,sourceCode:r,description:l,order:s,personalInfoAttributeType:c,style:d,...u}=e;return{modelId:o,name:i,visibility:a,sourceCode:r,description:l?{ko:l}:void 0,order:s??n,personalInfoAttributeType:c,legacyRaw:Object.keys(u).length?u:void 0}}function fE(e){return{modelId:e.modelId,name:e.name,unique:e.unique,description:e.description,parameters:e.parameters,columns:e.indexColumns.map(n=>({columnRef:n.targetColumn.refId,descending:n.descending}))}}function pE(e){var n,o;return{modelId:e.modelId,name:e.name,stereotype:e.stereotype,packageName:e.packageName,superClass:e.superClass,schema:e.schema,description:e.description,abstractClass:e.abstractClass,hasPersonalInfo:e.hasPersonalInfo,declarationOfInterfaces:e.declarationOfInterfaces,attributes:e.attributes.map(uE),operations:(n=e.operations)==null?void 0:n.map(mE),indexes:(o=e.indexes)==null?void 0:o.map(fE),jpaAttrs:e.jpaAttrs,table:e.dbAttrs?{physicalName:e.dbAttrs.physicalName,logicalName:e.dbAttrs.logicalName}:void 0}}function hE(e){const n={};for(const i of e.attributes)i.style&&(n[i.modelId]=i.style);const o={};for(const i of e.operations??[])i.style&&(o[i.modelId]=i.style);return{entityRef:e.modelId,geo:e.geo??{...ef},style:e.style,attributeStyles:Object.keys(n).length?n:void 0,operationStyles:Object.keys(o).length?o:void 0,collapsed:e.collapsed,locked:e.locked}}function nf(e){return e.jpaAttribute?{fetchType:e.jpaAttribute.fetchType,cascadeTypes:e.jpaAttribute.cascadeTypes,orphanRemoval:e.jpaAttribute.orphanRemoval,orderBy:e.jpaAttribute.orderBy,collectionType:e.jpaAttribute.collectionType,collectionTable:e.jpaAttribute.collectionTable,orderColumn:e.jpaAttribute.orderColumn}:void 0}function ms(e){var n;return{entityRef:e.endModel.refId,multiplicity:e.multiplicity,navigable:e.navigable,composition:e.composition,attributeRef:(n=e.attribute)==null?void 0:n.modelId,jpa:nf(e)}}function yE(e){if(e.end1.endModel.refId===e.end2.endModel.refId)return;const n=o=>fs(o)&&(o==null?void 0:o.identifier)===!0;return n(e.end1.attribute)||n(e.end2.attribute)?!0:void 0}function gE(e){var i,a;const n={modelId:e.modelId,description:e.description,identifying:yE(e),end1:ms(e.end1),end2:ms(e.end2)},o={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:(i=e.end1.attribute)==null?void 0:i.modelId,targetColumnRef:(a=e.end2.attribute)==null?void 0:a.modelId,style:e.style};return{assoc:n,layout:o}}function fs(e){var n;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("RELATION")&&(((n=e.dbAttrs)==null?void 0:n.length)??0)>0}function of(e){var n;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("EMBED")&&(((n=e.dbAttrs)==null?void 0:n.length)??0)>0}function af(e){var o;const n=e.attribute;return(n==null?void 0:n.attrType)==="EMBED_OWN"&&(((o=n.dbAttrs)==null?void 0:o.length)??0)===0&&(e.multiplicity==="ZERO_OR_MORE_INSTANCES"||e.multiplicity==="ONE_OR_MORE_INSTANCES")}function rf(e,n){return{modelId:e.modelId,name:e.name??"",type:e.type??"",customType:e.customType,attrType:e.attrType??"RELATION_OWN",identifier:e.identifier??!1,notNull:e.notNull??!1,transient:e.transient_,naturalId:e.naturalId,naturalIdMutable:e.naturalIdMutable,description:e.description,attributeGroup:e.attributeGroup,groupCode:e.groupCode,defaultValue:e.defaultValue,personalInfoAttributeType:e.personalInfoAttributeType,order:n,dbAttrs:(e.dbAttrs??[]).map(tf)}}function bE(e,n,o){var C,v;const i=fs(e.end1.attribute),a=fs(e.end2.attribute);if(i===a)return gE(e);const r=i?e.end1:e.end2,l=i?e.end2:e.end1,s=r.attribute,c=(v=(C=s.dbAttrs)==null?void 0:C[0])==null?void 0:v.targetModelId,d=c?o.get(c):void 0,u=n.get(l.endModel.refId),m=u?u.attributes.reduce((S,N)=>Math.max(S,N.order),-1)+1:s.order??0,f={...rf(s,m),attrType:"RELATION_OWN",derivedFrom:d?{associationRef:e.modelId,sourceAttributeRef:d}:void 0};u&&u.attributes.push(f);const p=n.get(r.endModel.refId),y=l.attribute;let g;if(y&&p&&r.navigable){const S=Na(l.multiplicity);g={modelId:y.modelId??crypto.randomUUID(),name:po(y.name??Ia((u==null?void 0:u.name)??l.endModel.refId,S),new Set(p.attributes.map(N=>N.name))),type:(u==null?void 0:u.name)??l.endModel.refId,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:p.attributes.reduce((N,A)=>Math.max(N,A.order),-1)+1,dbAttrs:[]},p.attributes.push(g)}const b=(S,N)=>({entityRef:S.endModel.refId,multiplicity:S.multiplicity,navigable:S.navigable,composition:S.composition,attributeRef:N?g==null?void 0:g.modelId:f.modelId,jpa:nf(S)}),k=r.endModel.refId===l.endModel.refId,_={modelId:e.modelId,description:e.description,identifying:!k&&f.identifier===!0?!0:void 0,end1:b(e.end1,i),end2:b(e.end2,a)},h={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:i?d:f.modelId,targetColumnRef:i?f.modelId:d,style:e.style};return{assoc:_,layout:h}}function kE(e,n){const o=e.targetModelId?n.get(e.targetModelId):void 0;return{modelId:e.modelId,physicalName:e.physicalName||(o==null?void 0:o.physicalName)||"",logicalName:e.logicalName??(o==null?void 0:o.logicalName),dataType:e.dataType||(o==null?void 0:o.dataType)||"",length:e.length??(o==null?void 0:o.length),scale:e.scale??(o==null?void 0:o.scale),unique:e.unique??(o==null?void 0:o.unique),autoIncrement:e.autoIncrement??(o==null?void 0:o.autoIncrement),updatable:e.updatable??(o==null?void 0:o.updatable),insertable:e.insertable??(o==null?void 0:o.insertable),notNull:e.notNull??(o==null?void 0:o.notNull)}}function _E(e,n,o){var y;const i=((y=e.end1.attribute)==null?void 0:y.attrType)==="EMBED_OWN",a=i?e.end1:e.end2,r=i?e.end2:e.end1,l=a.attribute,s=n.get(r.endModel.refId),c=s?s.attributes.reduce((g,b)=>Math.max(g,b.order),-1)+1:l.order??0,d={...rf(l,c),attrType:l.attrType??"EMBED_OWN",dbAttrs:(l.dbAttrs??[]).map(g=>kE(g,o)),embedded:{associationRef:e.modelId,embeddableRef:a.endModel.refId}};s&&s.attributes.push(d);const u=g=>({...ms(g),legacyEmbedRaw:g.attribute}),m={modelId:e.modelId,description:e.description,end1:u(e.end1),end2:u(e.end2)},f=!i,p={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:f?d.modelId:void 0,targetColumnRef:f?void 0:d.modelId,style:e.style};return{assoc:m,layout:p}}function EE(e,n){var i,a,r,l;const o=[];for(const s of n){const c=(a=(i=s.end1)==null?void 0:i.endModel)==null?void 0:a.refId,d=(l=(r=s.end2)==null?void 0:r.endModel)==null?void 0:l.refId,u=c===e?d:c;!u||u===e||o.push({targetRef:u,waypoints:s.locations??[]})}return o}function lf(e,n={x:0,y:0}){const{modelId:o,memo:i,geo:a,style:r,connections:l,ownedConnections:s,...c}=e;let d=l;if(!d&&Array.isArray(s)){const u=EE(o,s);u.length&&(d=u)}return{modelId:o,memo:i,geo:{location:{x:a.location.x+n.x,y:a.location.y+n.y},size:a.size},style:r,connections:d,legacyRaw:Object.keys(c).length?c:void 0}}function sf(e,n,o){if(!(o!=null&&o.length))return;const i=new Map(e.map(l=>[l.modelId,l])),a=new Map(n.map(l=>[l.modelId,l])),r=(l,s)=>{var c;return!!s&&!!((c=i.get(l??""))!=null&&c.attributes.some(d=>d.modelId===s))};for(const l of o){const s=a.get(l.associationRef);s&&(l.sourceColumnRef&&!r(s.end1.entityRef,l.sourceColumnRef)&&(l.sourceColumnRef=void 0),l.targetColumnRef&&!r(s.end2.entityRef,l.targetColumnRef)&&(l.targetColumnRef=void 0))}}function cf(e,n){const o=(i,a)=>{if(i==null)return;const r=i[a];if(r==null)return;const l=Yc(r);l!==r&&(l===void 0?delete i[a]:i[a]=l)};for(const i of n)o(i,"name");for(const i of e){o(i,"classLogicalName"),o(i,"description"),o(i.table,"logicalName");for(const a of i.operations??[])o(a,"description");for(const a of i.attributes){o(a,"fieldLogicalName"),o(a,"description");for(const r of a.dbAttrs??[])o(r,"logicalName")}}}function NE(e,n){const o=new Map(e.map(i=>[i.modelId,i]));for(const i of n){if(i.end1.navigable!==!0)continue;const a=o.get(i.end1.entityRef),r=o.get(i.end2.entityRef);if(!a||!r||lt(a.stereotype)||lt(r.stereotype))continue;const l=i.end1.attributeRef?a.attributes.find(f=>f.modelId===i.end1.attributeRef):void 0;if((l==null?void 0:l.attrType)==="RELATION_REF")continue;const s=`nav:${i.modelId}`,c=a.attributes.find(f=>f.modelId===s);if((c==null?void 0:c.attrType)==="RELATION_REF"){i.end1.attributeRef=s;continue}const d=Na(i.end2.multiplicity),u=Ia(r.name,d),m=po(u,new Set(a.attributes.map(f=>f.name)));a.attributes.push({modelId:s,name:m,type:r.name,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:a.attributes.reduce((f,p)=>Math.max(f,p.order),-1)+1,dbAttrs:[]}),i.end1.attributeRef=s}}function wE(e,n){const o=new Map(e.map(i=>[i.modelId,i]));for(const i of n){if(i.identifying===!0||i.end1.entityRef===i.end2.entityRef)continue;const a=o.get(i.end1.entityRef),r=o.get(i.end2.entityRef);if(!a||!r||lt(a.stereotype)||lt(r.stereotype))continue;const l=r.attributes.find(s=>s.modelId===i.end2.attributeRef);l&&l.attrType.startsWith("RELATION")&&l.dbAttrs.length>0&&l.identifier===!0&&(i.identifying=!0)}}function df(e,n){var i;const o=new Map(e.map(a=>[a.modelId,a]));for(const a of n){const r=o.get(a.end2.entityRef);if(!r)continue;const l=o.get(a.end1.entityRef);if(l&<(l.stereotype))continue;const s=a.end1.entityRef===a.end2.entityRef,c=a.identifying===!0||!s&&!Ed(a.end1.multiplicity);for(const d of r.attributes)!d.attrType.startsWith("RELATION")||d.dbAttrs.length===0||!(((i=d.derivedFrom)==null?void 0:i.associationRef)===a.modelId||!d.derivedFrom&&d.modelId===a.end2.attributeRef)||(d.notNull=c)}}function uf(e){const n=JSON.parse(JSON.stringify(e));return(n.schemaVersion??1)>=2&&"logical"in n?IE(n):vE(n)}function IE(e){const n=e.id??e.logical.modelId??"",o={},i=m=>{const{rev:f,...p}=m;return f!=null&&(o[m.modelId]=f),p},a=e.logical.entities.map(i),r=e.logical.associations.map(i),l=e.logical.groups.map(i);NE(a,r),wE(a,r),df(a,r),cf(a,l);const{version:s,...c}=e.layout;sf(a,r,c.associationLayouts);const d={logical:{modelId:e.logical.modelId??n,packageName:e.logical.packageName,entities:a,associations:r,groups:l},layout:{...c,diagramId:c.diagramId??n,logicalModelRef:c.logicalModelRef??n}},u={id:e.id,version:e.version,diagramVersion:e.diagramVersion,size:e.size,packageName:e.packageName,schemaVersion:e.schemaVersion,opWriteEnabled:e.opWriteEnabled,referenceOnly:e.referenceOnly,revSeed:{revs:o,layoutVersion:s??0,logicalVersion:e.logical.version??0}};return{state:d,meta:u}}function vE(e){var k,_;const n=e.id??"",o=[],i=[],a=[],r=[],l=[],s=[],c=[],d=(h,C)=>{o.push(pE(h));const v=hE(h);v.geo={location:{x:v.geo.location.x+C.x,y:v.geo.location.y+C.y},size:v.geo.size},i.push(v);for(const S of h.ownedAssociations??[])c.push(S)},u={x:0,y:0};for(const h of e.entities??[])d(h,u);const m=[];for(const h of e.groups??[]){const C=h.entities??[];l.push({modelId:h.modelId,name:h.name,description:h.description,packageName:h.packageName,excludeDDLGeneration:h.excludeDDLGeneration??!1,memberEntityRefs:C.map(S=>S.modelId)});const v=((k=h.geo)==null?void 0:k.location)??u;if(h.geo){const S=(h.notes??[]).map(N=>N.modelId);s.push({groupRef:h.modelId,geo:h.geo,style:h.style,locked:h.locked,memberNoteRefs:S.length?S:void 0})}for(const S of C)d(S,v);for(const S of h.notes??[])m.push(lf(S,v))}const f=new Map(o.map(h=>[h.modelId,h])),p=new Map,y=new Map;for(const h of o)for(const C of h.attributes)for(const v of C.dbAttrs)p.set(v.modelId,C.modelId),y.set(v.modelId,v);for(const h of c)for(const C of[h.end1,h.end2]){const v=C.attribute;if(v&&(((_=v.dbAttrs)==null?void 0:_.length)??0)>0)for(const S of v.dbAttrs)S.modelId&&p.set(S.modelId,v.modelId)}for(const h of c){const C=of(h.end1.attribute),v=of(h.end2.attribute),S=af(h.end1)||af(h.end2),{assoc:N,layout:A}=C!==v||S?_E(h,f,y):bE(h,f,p);a.push(N),r.push(A)}sf(o,a,r),gu(o),df(o,a),cf(o,l);const g={logical:{modelId:n,packageName:e.packageName,entities:o,associations:a,groups:l},layout:{diagramId:n,logicalModelRef:n,canvasSize:e.size,entityLayouts:i,associationLayouts:r,groupLayouts:s,notes:[...(e.notes??[]).map(h=>lf(h)),...m]}},b={id:e.id,version:e.version,diagramVersion:e.diagramVersion,size:e.size,packageName:e.packageName,schemaVersion:e.schemaVersion??1};return{state:g,meta:b}}function mf(e){return{modelId:e.modelId,physicalName:e.physicalName,logicalName:e.logicalName,dataType:e.dataType,length:e.length,scale:e.scale,unique:e.unique,autoIncrement:e.autoIncrement,updatable:e.updatable,insertable:e.insertable,notNull:e.notNull,sharedColumnRef:e.sharedColumnRef,multiValue:e.multiValue,multiValueSeparator:e.multiValueSeparator,sequenceName:e.sequenceName}}function CE(e,n){return{modelId:e.modelId,name:e.name,type:e.type,customType:e.customType,attrType:e.attrType,identifier:e.identifier,notNull:e.notNull,transient_:e.transient,naturalId:e.naturalId,naturalIdMutable:e.naturalIdMutable,description:e.description,attributeGroup:e.attributeGroup,groupCode:e.groupCode,defaultValue:e.defaultValue,personalInfoAttributeType:e.personalInfoAttributeType,order:e.order,dbAttrs:e.dbAttrs.map(mf),style:n}}function SE(e,n){var o;return{...e.legacyRaw,modelId:e.modelId,name:e.name,visibility:e.visibility,sourceCode:e.sourceCode,description:(o=e.description)==null?void 0:o.ko,order:e.order,personalInfoAttributeType:e.personalInfoAttributeType,style:n}}function RE(e){return{modelId:e.modelId,name:e.name,unique:e.unique,description:e.description,parameters:e.parameters,indexColumns:e.columns.map(n=>({targetColumn:{refId:n.columnRef},descending:n.descending}))}}function Zn(e,n){return{endModel:{refId:e.entityRef},multiplicity:e.multiplicity,navigable:e.navigable,composition:e.composition,jpaAttribute:e.jpa,attribute:n??(e.attributeRef?{modelId:e.attributeRef}:void 0)}}function AE(e,n){const o=n==null?void 0:n.attributes.find(i=>{var a;return i.modelId===((a=e.derivedFrom)==null?void 0:a.sourceAttributeRef)});return{modelId:e.modelId,name:e.name,type:e.type,attrType:"RELATION_REF",identifier:e.identifier,notNull:e.notNull,transient_:e.transient,description:e.description,attributeGroup:e.attributeGroup,groupCode:e.groupCode,order:e.order,dbAttrs:e.dbAttrs.map((i,a)=>{var r;return{...mf(i),targetModelId:(r=o==null?void 0:o.dbAttrs[a])==null?void 0:r.modelId}})}}function xE(e){return{modelId:e.modelId,name:e.name,type:e.type,attrType:"RELATION_OWN",dbAttrs:[]}}function ff(e,n){const o=l=>{if(!l.attributeRef)return;const s=n.logical.entities.find(c=>c.modelId===l.entityRef);return s==null?void 0:s.attributes.find(c=>c.modelId===l.attributeRef)},i=o(e.end1),a=o(e.end2),r=l=>(l==null?void 0:l.attrType)==="RELATION_OWN"?l:void 0;return(i==null?void 0:i.attrType)==="RELATION_REF"?{navEnd:e.end1,fkEnd:e.end2,navAttr:i,fk:r(a)}:(a==null?void 0:a.attrType)==="RELATION_REF"?{navEnd:e.end2,fkEnd:e.end1,navAttr:a,fk:r(i)}:null}function $E(e){const n=new Set;for(const o of e.logical.associations){const i=ff(o,e);i&&(n.add(i.navAttr.modelId),i.fk&&n.add(i.fk.modelId))}return n}function TE(e){const n=new Set;for(const o of e.logical.entities)for(const i of o.attributes)i.embedded&&n.add(i.modelId);return n}function ME(e,n){return e===n||JSON.stringify(e??null)===JSON.stringify(n??null)}function VE(e,n){const o=(i,a)=>i===a?void 0:i;return{modelId:e.modelId,targetModelId:n==null?void 0:n.modelId,physicalName:e.physicalName===((n==null?void 0:n.physicalName)??"")?"":e.physicalName,logicalName:ME(e.logicalName,n==null?void 0:n.logicalName)?void 0:e.logicalName,dataType:e.dataType===((n==null?void 0:n.dataType)??"")?"":e.dataType,length:o(e.length,n==null?void 0:n.length),scale:o(e.scale,n==null?void 0:n.scale),unique:o(e.unique,n==null?void 0:n.unique),autoIncrement:o(e.autoIncrement,n==null?void 0:n.autoIncrement),updatable:o(e.updatable,n==null?void 0:n.updatable),insertable:o(e.insertable,n==null?void 0:n.insertable),notNull:o(e.notNull,n==null?void 0:n.notNull)}}function LE(e,n,o){let i;for(const m of n.logical.entities){const f=m.attributes.find(p=>{var y;return((y=p.embedded)==null?void 0:y.associationRef)===e.modelId});if(f){i=f;break}}if(!i)return;const a=i.embedded.embeddableRef,r=n.logical.entities.find(m=>m.modelId===a);if(!r)return;const l=r.attributes.flatMap(m=>m.dbAttrs),s={modelId:i.modelId,name:i.name,type:i.type,attrType:i.attrType,identifier:i.identifier,notNull:i.notNull,transient_:i.transient,description:i.description,attributeGroup:i.attributeGroup,groupCode:i.groupCode,order:i.order,dbAttrs:i.dbAttrs.map((m,f)=>VE(m,l[f]))},c=e.end1.entityRef===a,d=c?e.end2:e.end1,u=d.attributeRef?{modelId:d.attributeRef,attrType:"EMBED_REF",dbAttrs:[]}:void 0;return{...o,end1:Zn(e.end1,c?s:u),end2:Zn(e.end2,c?u:s)}}function BE(e,n,o){const i={modelId:e.modelId,description:e.description,locations:(o==null?void 0:o.waypoints)??[],style:o==null?void 0:o.style};if(e.end1.legacyEmbedRaw||e.end2.legacyEmbedRaw)return{...i,end1:Zn(e.end1,e.end1.legacyEmbedRaw),end2:Zn(e.end2,e.end2.legacyEmbedRaw)};const a=LE(e,n,i);if(a)return a;const r=ff(e,n);if(r){const l=n.logical.entities.find(d=>d.modelId===r.navEnd.entityRef),s=r.fk?AE(r.fk,l):void 0,c=xE(r.navAttr);return{...i,end1:Zn(e.end1,r.navEnd===e.end1?s:c),end2:Zn(e.end2,r.navEnd===e.end2?s:c)}}return{...i,end1:Zn(e.end1),end2:Zn(e.end2)}}function pf(e,n,o,i,a={x:0,y:0}){var u,m;const r=n.layout.entityLayouts.find(f=>f.entityRef===e.modelId),l=n.logical.associations.filter(f=>f.end1.entityRef===e.modelId),s=f=>n.layout.associationLayouts.find(p=>p.associationRef===f),c=(r==null?void 0:r.geo)??{...ef},d={location:{x:c.location.x-a.x,y:c.location.y-a.y},size:c.size};return{modelId:e.modelId,name:e.name,stereotype:e.stereotype,packageName:e.packageName,superClass:e.superClass,schema:e.schema,description:e.description,abstractClass:e.abstractClass,hasPersonalInfo:e.hasPersonalInfo,declarationOfInterfaces:e.declarationOfInterfaces,attributes:e.attributes.filter(f=>!o.has(f.modelId)&&!i.has(f.modelId)).map(f=>{var p;return CE(f,(p=r==null?void 0:r.attributeStyles)==null?void 0:p[f.modelId])}),operations:(u=e.operations)==null?void 0:u.map(f=>{var p;return SE(f,(p=r==null?void 0:r.operationStyles)==null?void 0:p[f.modelId])}),ownedAssociations:l.map(f=>BE(f,n,s(f.modelId))),indexes:(m=e.indexes)==null?void 0:m.map(RE),jpaAttrs:e.jpaAttrs,dbAttrs:e.table?{physicalName:e.table.physicalName,logicalName:e.table.logicalName}:void 0,geo:d,style:r==null?void 0:r.style,collapsed:r==null?void 0:r.collapsed,locked:r==null?void 0:r.locked}}function DE(e,n,o,i){const a=n.layout.groupLayouts.find(c=>c.groupRef===e.modelId),r=e.memberEntityRefs.map(c=>n.logical.entities.find(d=>d.modelId===c)).filter(c=>!!c),l=(a==null?void 0:a.geo.location)??{x:0,y:0},s=((a==null?void 0:a.memberNoteRefs)??[]).map(c=>n.layout.notes.find(d=>d.modelId===c)).filter(c=>!!c).map(c=>hf(c,l));return{modelId:e.modelId,name:e.name,description:e.description,packageName:e.packageName,excludeDDLGeneration:e.excludeDDLGeneration,entities:r.map(c=>pf(c,n,o,i,l)),notes:s.length?s:void 0,geo:a==null?void 0:a.geo,style:a==null?void 0:a.style,locked:a==null?void 0:a.locked}}function hf(e,n={x:0,y:0}){return{...e.legacyRaw,modelId:e.modelId,memo:e.memo,geo:{location:{x:e.geo.location.x-n.x,y:e.geo.location.y-n.y},size:e.geo.size},style:e.style,connections:e.connections}}function OE(e,n={}){const o=new Set(e.logical.groups.flatMap(s=>s.memberEntityRefs)),i=e.logical.entities.filter(s=>!o.has(s.modelId)),a=$E(e),r=TE(e),l=new Set(e.layout.groupLayouts.flatMap(s=>s.memberNoteRefs??[]));return{id:n.id,diagramVersion:n.diagramVersion,version:n.version,size:n.size??e.layout.canvasSize,packageName:n.packageName??e.logical.packageName,entities:i.map(s=>pf(s,e,a,r)),groups:e.logical.groups.map(s=>DE(s,e,a,r)),notes:e.layout.notes.filter(s=>!l.has(s.modelId)).map(s=>hf(s))}}function PE(e,n={}){var a,r,l;const o=((a=n.revSeed)==null?void 0:a.revs)??{},i=s=>({...s,rev:o[s.modelId]??0});return{id:n.id,schemaVersion:2,opWriteEnabled:n.opWriteEnabled,referenceOnly:n.referenceOnly,version:n.version,diagramVersion:n.diagramVersion,packageName:n.packageName,size:n.size,logical:{version:((r=n.revSeed)==null?void 0:r.logicalVersion)??0,modelId:e.logical.modelId,packageName:e.logical.packageName,entities:e.logical.entities.map(i),associations:e.logical.associations.map(i),groups:e.logical.groups.map(i)},layout:{...e.layout,version:((l=n.revSeed)==null?void 0:l.layoutVersion)??0}}}const zE=["notNull"];function FE(e){var u;const n=()=>({navAdds:0,navRefPatches:0,identifyingPatches:0,attributeFieldPatches:0,attributeFieldsByName:{}});if((e.schemaVersion??1)<2||!("logical"in e))return{ops:[],revs:{},summary:n()};const o=e,{state:i,meta:a}=uf(e),r=((u=a.revSeed)==null?void 0:u.revs)??{},l=[],s=n(),c=new Map(o.logical.entities.map(m=>[m.modelId,new Map(m.attributes.map(f=>[f.modelId,f]))]));for(const m of i.logical.entities){const f=c.get(m.modelId);if(f)for(const p of m.attributes){const y=f.get(p.modelId);if(!y){l.push({kind:"attribute.add",casUnit:"logical",containerRef:m.modelId,entityRef:m.modelId,value:p}),s.navAdds++;continue}const g={};for(const b of zE)p[b]===!0!=(y[b]===!0)&&(g[b]=p[b],s.attributeFieldsByName[b]=(s.attributeFieldsByName[b]??0)+1);Object.keys(g).length!==0&&(l.push({kind:"attribute.update",casUnit:"logical",containerRef:m.modelId,entityRef:m.modelId,attributeRef:p.modelId,patch:g}),s.attributeFieldPatches++)}}const d=new Map(o.logical.associations.map(m=>[m.modelId,m]));for(const m of i.logical.associations){const f=d.get(m.modelId);f&&(m.end1.attributeRef&&m.end1.attributeRef!==f.end1.attributeRef&&(l.push({kind:"associationEnd.update",casUnit:"logical",containerRef:m.modelId,associationRef:m.modelId,end:"end1",patch:{attributeRef:m.end1.attributeRef}}),s.navRefPatches++),m.identifying===!0&&f.identifying!==!0&&(l.push({kind:"association.update",casUnit:"logical",containerRef:m.modelId,associationRef:m.modelId,patch:{identifying:!0}}),s.identifyingPatches++))}return{ops:l,revs:r,summary:s}}function Bi(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function Ln(e){return typeof e=="function"?e():t.unref(e)}const UE=typeof window<"u"&&typeof document<"u",HE=e=>typeof e<"u",jE=Object.prototype.toString,KE=e=>jE.call(e)==="[object Object]",GE=()=>{};function YE(e,n){function o(...i){return new Promise((a,r)=>{Promise.resolve(e(()=>n.apply(this,i),{fn:n,thisArg:this,args:i})).then(a).catch(r)})}return o}const yf=e=>e();function qE(e=yf){const n=t.ref(!0);function o(){n.value=!1}function i(){n.value=!0}const a=(...r)=>{n.value&&e(...r)};return{isActive:t.readonly(n),pause:o,resume:i,eventFilter:a}}function gf(e,n=!1,o="Timeout"){return new Promise((i,a)=>{setTimeout(n?()=>a(o):i,e)})}function WE(e,n,o={}){const{eventFilter:i=yf,...a}=o;return t.watch(e,YE(i,n),a)}function ti(e,n,o={}){const{eventFilter:i,...a}=o,{eventFilter:r,pause:l,resume:s,isActive:c}=qE(i);return{stop:WE(e,n,{...a,eventFilter:r}),pause:l,resume:s,isActive:c}}function JE(e,n={}){if(!t.isRef(e))return t.toRefs(e);const o=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)o[i]=t.customRef(()=>({get(){return e.value[i]},set(a){var r;if((r=Ln(n.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const s=[...e.value];s[i]=a,e.value=s}else{const s={...e.value,[i]:a};Object.setPrototypeOf(s,Object.getPrototypeOf(e.value)),e.value=s}else e.value[i]=a}}));return o}function ps(e,n=!1){function o(m,{flush:f="sync",deep:p=!1,timeout:y,throwOnTimeout:g}={}){let b=null;const _=[new Promise(h=>{b=t.watch(e,C=>{m(C)!==n&&(b==null||b(),h(C))},{flush:f,deep:p,immediate:!0})})];return y!=null&&_.push(gf(y,g).then(()=>Ln(e)).finally(()=>b==null?void 0:b())),Promise.race(_)}function i(m,f){if(!t.isRef(m))return o(C=>C===m,f);const{flush:p="sync",deep:y=!1,timeout:g,throwOnTimeout:b}=f??{};let k=null;const h=[new Promise(C=>{k=t.watch([e,m],([v,S])=>{n!==(v===S)&&(k==null||k(),C(v))},{flush:p,deep:y,immediate:!0})})];return g!=null&&h.push(gf(g,b).then(()=>Ln(e)).finally(()=>(k==null||k(),Ln(e)))),Promise.race(h)}function a(m){return o(f=>!!f,m)}function r(m){return i(null,m)}function l(m){return i(void 0,m)}function s(m){return o(Number.isNaN,m)}function c(m,f){return o(p=>{const y=Array.from(p);return y.includes(m)||y.includes(Ln(m))},f)}function d(m){return u(1,m)}function u(m=1,f){let p=-1;return o(()=>(p+=1,p>=m),f)}return Array.isArray(Ln(e))?{toMatch:o,toContains:c,changed:d,changedTimes:u,get not(){return ps(e,!n)}}:{toMatch:o,toBe:i,toBeTruthy:a,toBeNull:r,toBeNaN:s,toBeUndefined:l,changed:d,changedTimes:u,get not(){return ps(e,!n)}}}function hs(e){return ps(e)}function XE(e){var n;const o=Ln(e);return(n=o==null?void 0:o.$el)!=null?n:o}const bf=UE?window:void 0;function kf(...e){let n,o,i,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([o,i,a]=e,n=bf):[n,o,i,a]=e,!n)return GE;Array.isArray(o)||(o=[o]),Array.isArray(i)||(i=[i]);const r=[],l=()=>{r.forEach(u=>u()),r.length=0},s=(u,m,f,p)=>(u.addEventListener(m,f,p),()=>u.removeEventListener(m,f,p)),c=t.watch(()=>[XE(n),Ln(a)],([u,m])=>{if(l(),!u)return;const f=KE(m)?{...m}:m;r.push(...o.flatMap(p=>i.map(y=>s(u,p,y,f))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return Bi(d),d}function ZE(e){return typeof e=="function"?e:typeof e=="string"?n=>n.key===e:Array.isArray(e)?n=>e.includes(n.key):()=>!0}function _f(...e){let n,o,i={};e.length===3?(n=e[0],o=e[1],i=e[2]):e.length===2?typeof e[1]=="object"?(n=!0,o=e[0],i=e[1]):(n=e[0],o=e[1]):(n=!0,o=e[0]);const{target:a=bf,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=i,c=ZE(n);return kf(a,r,u=>{u.repeat&&Ln(s)||c(u)&&o(u)},l)}function QE(e){return JSON.parse(JSON.stringify(e))}function ys(e,n,o,i={}){var a,r,l;const{clone:s=!1,passive:c=!1,eventName:d,deep:u=!1,defaultValue:m,shouldEmit:f}=i,p=t.getCurrentInstance(),y=o||(p==null?void 0:p.emit)||((a=p==null?void 0:p.$emit)==null?void 0:a.bind(p))||((l=(r=p==null?void 0:p.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(p==null?void 0:p.proxy));let g=d;n||(n="modelValue"),g=g||`update:${n.toString()}`;const b=h=>s?typeof s=="function"?s(h):QE(h):h,k=()=>HE(e[n])?b(e[n]):m,_=h=>{f?f(h)&&y(g,h):y(g,h)};if(c){const h=k(),C=t.ref(h);let v=!1;return t.watch(()=>e[n],S=>{v||(v=!0,C.value=b(S),t.nextTick(()=>v=!1))}),t.watch(C,S=>{!v&&(S!==e[n]||u)&&_(S)},{deep:u}),C}else return t.computed({get(){return k()},set(h){_(h)}})}var e1={value:()=>{}};function Qa(){for(var e=0,n=arguments.length,o={},i;e<n;++e){if(!(i=arguments[e]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new er(o)}function er(e){this._=e}function t1(e,n){return e.trim().split(/^|\s+/).map(function(o){var i="",a=o.indexOf(".");if(a>=0&&(i=o.slice(a+1),o=o.slice(0,a)),o&&!n.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}er.prototype=Qa.prototype={constructor:er,on:function(e,n){var o=this._,i=t1(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=n1(o[a],e.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++r<l;)if(a=(e=i[r]).type)o[a]=Ef(o[a],e.name,n);else if(n==null)for(a in o)o[a]=Ef(o[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var o in n)e[o]=n[o].slice();return new er(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var o=new Array(a),i=0,a,r;i<a;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(n,o)},apply:function(e,n,o){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],a=0,r=i.length;a<r;++a)i[a].value.apply(n,o)}};function n1(e,n){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===n)return a.value}function Ef(e,n,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=e1,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:n,value:o}),e}var gs="http://www.w3.org/1999/xhtml";const Nf={svg:"http://www.w3.org/2000/svg",xhtml:gs,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tr(e){var n=e+="",o=n.indexOf(":");return o>=0&&(n=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),Nf.hasOwnProperty(n)?{space:Nf[n],local:e}:e}function o1(e){return function(){var n=this.ownerDocument,o=this.namespaceURI;return o===gs&&n.documentElement.namespaceURI===gs?n.createElement(e):n.createElementNS(o,e)}}function i1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wf(e){var n=tr(e);return(n.local?i1:o1)(n)}function a1(){}function bs(e){return e==null?a1:function(){return this.querySelector(e)}}function r1(e){typeof e!="function"&&(e=bs(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=new Array(l),c,d,u=0;u<l;++u)(c=r[u])&&(d=e.call(c,c.__data__,u,r))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new Yt(i,this._parents)}function l1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function s1(){return[]}function If(e){return e==null?s1:function(){return this.querySelectorAll(e)}}function c1(e){return function(){return l1(e.apply(this,arguments))}}function d1(e){typeof e=="function"?e=c1(e):e=If(e);for(var n=this._groups,o=n.length,i=[],a=[],r=0;r<o;++r)for(var l=n[r],s=l.length,c,d=0;d<s;++d)(c=l[d])&&(i.push(e.call(c,c.__data__,d,l)),a.push(c));return new Yt(i,a)}function vf(e){return function(){return this.matches(e)}}function Cf(e){return function(n){return n.matches(e)}}var u1=Array.prototype.find;function m1(e){return function(){return u1.call(this.children,e)}}function f1(){return this.firstElementChild}function p1(e){return this.select(e==null?f1:m1(typeof e=="function"?e:Cf(e)))}var h1=Array.prototype.filter;function y1(){return Array.from(this.children)}function g1(e){return function(){return h1.call(this.children,e)}}function b1(e){return this.selectAll(e==null?y1:g1(typeof e=="function"?e:Cf(e)))}function k1(e){typeof e!="function"&&(e=vf(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=[],c,d=0;d<l;++d)(c=r[d])&&e.call(c,c.__data__,d,r)&&s.push(c);return new Yt(i,this._parents)}function Sf(e){return new Array(e.length)}function _1(){return new Yt(this._enter||this._groups.map(Sf),this._parents)}function nr(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}nr.prototype={constructor:nr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function E1(e){return function(){return e}}function N1(e,n,o,i,a,r){for(var l=0,s,c=n.length,d=r.length;l<d;++l)(s=n[l])?(s.__data__=r[l],i[l]=s):o[l]=new nr(e,r[l]);for(;l<c;++l)(s=n[l])&&(a[l]=s)}function w1(e,n,o,i,a,r,l){var s,c,d=new Map,u=n.length,m=r.length,f=new Array(u),p;for(s=0;s<u;++s)(c=n[s])&&(f[s]=p=l.call(c,c.__data__,s,n)+"",d.has(p)?a[s]=c:d.set(p,c));for(s=0;s<m;++s)p=l.call(e,r[s],s,r)+"",(c=d.get(p))?(i[s]=c,c.__data__=r[s],d.delete(p)):o[s]=new nr(e,r[s]);for(s=0;s<u;++s)(c=n[s])&&d.get(f[s])===c&&(a[s]=c)}function I1(e){return e.__data__}function v1(e,n){if(!arguments.length)return Array.from(this,I1);var o=n?w1:N1,i=this._parents,a=this._groups;typeof e!="function"&&(e=E1(e));for(var r=a.length,l=new Array(r),s=new Array(r),c=new Array(r),d=0;d<r;++d){var u=i[d],m=a[d],f=m.length,p=C1(e.call(u,u&&u.__data__,d,i)),y=p.length,g=s[d]=new Array(y),b=l[d]=new Array(y),k=c[d]=new Array(f);o(u,m,g,b,k,p,n);for(var _=0,h=0,C,v;_<y;++_)if(C=g[_]){for(_>=h&&(h=_+1);!(v=b[h])&&++h<y;);C._next=v||null}}return l=new Yt(l,i),l._enter=s,l._exit=c,l}function C1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function S1(){return new Yt(this._exit||this._groups.map(Sf),this._parents)}function R1(e,n,o){var i=this.enter(),a=this,r=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(a=n(a),a&&(a=a.selection())),o==null?r.remove():o(r),i&&a?i.merge(a).order():a}function A1(e){for(var n=e.selection?e.selection():e,o=this._groups,i=n._groups,a=o.length,r=i.length,l=Math.min(a,r),s=new Array(a),c=0;c<l;++c)for(var d=o[c],u=i[c],m=d.length,f=s[c]=new Array(m),p,y=0;y<m;++y)(p=d[y]||u[y])&&(f[y]=p);for(;c<a;++c)s[c]=o[c];return new Yt(s,this._parents)}function x1(){for(var e=this._groups,n=-1,o=e.length;++n<o;)for(var i=e[n],a=i.length-1,r=i[a],l;--a>=0;)(l=i[a])&&(r&&l.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(l,r),r=l);return this}function $1(e){e||(e=T1);function n(m,f){return m&&f?e(m.__data__,f.__data__):!m-!f}for(var o=this._groups,i=o.length,a=new Array(i),r=0;r<i;++r){for(var l=o[r],s=l.length,c=a[r]=new Array(s),d,u=0;u<s;++u)(d=l[u])&&(c[u]=d);c.sort(n)}return new Yt(a,this._parents).order()}function T1(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function M1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function V1(){return Array.from(this)}function L1(){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],a=0,r=i.length;a<r;++a){var l=i[a];if(l)return l}return null}function B1(){let e=0;for(const n of this)++e;return e}function D1(){return!this.node()}function O1(e){for(var n=this._groups,o=0,i=n.length;o<i;++o)for(var a=n[o],r=0,l=a.length,s;r<l;++r)(s=a[r])&&e.call(s,s.__data__,r,a);return this}function P1(e){return function(){this.removeAttribute(e)}}function z1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function F1(e,n){return function(){this.setAttribute(e,n)}}function U1(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function H1(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function j1(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,o)}}function K1(e,n){var o=tr(e);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((n==null?o.local?z1:P1:typeof n=="function"?o.local?j1:H1:o.local?U1:F1)(o,n))}function Rf(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function G1(e){return function(){this.style.removeProperty(e)}}function Y1(e,n,o){return function(){this.style.setProperty(e,n,o)}}function q1(e,n,o){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function W1(e,n,o){return arguments.length>1?this.each((n==null?G1:typeof n=="function"?q1:Y1)(e,n,o??"")):ni(this.node(),e)}function ni(e,n){return e.style.getPropertyValue(n)||Rf(e).getComputedStyle(e,null).getPropertyValue(n)}function J1(e){return function(){delete this[e]}}function X1(e,n){return function(){this[e]=n}}function Z1(e,n){return function(){var o=n.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function Q1(e,n){return arguments.length>1?this.each((n==null?J1:typeof n=="function"?Z1:X1)(e,n)):this.node()[e]}function Af(e){return e.trim().split(/^|\s+/)}function ks(e){return e.classList||new xf(e)}function xf(e){this._node=e,this._names=Af(e.getAttribute("class")||"")}xf.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function $f(e,n){for(var o=ks(e),i=-1,a=n.length;++i<a;)o.add(n[i])}function Tf(e,n){for(var o=ks(e),i=-1,a=n.length;++i<a;)o.remove(n[i])}function eN(e){return function(){$f(this,e)}}function tN(e){return function(){Tf(this,e)}}function nN(e,n){return function(){(n.apply(this,arguments)?$f:Tf)(this,e)}}function oN(e,n){var o=Af(e+"");if(arguments.length<2){for(var i=ks(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof n=="function"?nN:n?eN:tN)(o,n))}function iN(){this.textContent=""}function aN(e){return function(){this.textContent=e}}function rN(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function lN(e){return arguments.length?this.each(e==null?iN:(typeof e=="function"?rN:aN)(e)):this.node().textContent}function sN(){this.innerHTML=""}function cN(e){return function(){this.innerHTML=e}}function dN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function uN(e){return arguments.length?this.each(e==null?sN:(typeof e=="function"?dN:cN)(e)):this.node().innerHTML}function mN(){this.nextSibling&&this.parentNode.appendChild(this)}function fN(){return this.each(mN)}function pN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function hN(){return this.each(pN)}function yN(e){var n=typeof e=="function"?e:wf(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function gN(){return null}function bN(e,n){var o=typeof e=="function"?e:wf(e),i=n==null?gN:typeof n=="function"?n:bs(n);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function kN(){var e=this.parentNode;e&&e.removeChild(this)}function _N(){return this.each(kN)}function EN(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function NN(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function wN(e){return this.select(e?NN:EN)}function IN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function vN(e){return function(n){e.call(this,n,this.__data__)}}function CN(e){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");return i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),{type:n,name:o}})}function SN(e){return function(){var n=this.__on;if(n){for(var o=0,i=-1,a=n.length,r;o<a;++o)r=n[o],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):n[++i]=r;++i?n.length=i:delete this.__on}}}function RN(e,n,o){return function(){var i=this.__on,a,r=vN(n);if(i){for(var l=0,s=i.length;l<s;++l)if((a=i[l]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=r,a.options=o),a.value=n;return}}this.addEventListener(e.type,r,o),a={type:e.type,name:e.name,value:n,listener:r,options:o},i?i.push(a):this.__on=[a]}}function AN(e,n,o){var i=CN(e+""),a,r=i.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,d=s.length,u;c<d;++c)for(a=0,u=s[c];a<r;++a)if((l=i[a]).type===u.type&&l.name===u.name)return u.value}return}for(s=n?RN:SN,a=0;a<r;++a)this.each(s(i[a],n,o));return this}function Mf(e,n,o){var i=Rf(e),a=i.CustomEvent;typeof a=="function"?a=new a(n,o):(a=i.document.createEvent("Event"),o?(a.initEvent(n,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function xN(e,n){return function(){return Mf(this,e,n)}}function $N(e,n){return function(){return Mf(this,e,n.apply(this,arguments))}}function TN(e,n){return this.each((typeof n=="function"?$N:xN)(e,n))}function*MN(){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],a=0,r=i.length,l;a<r;++a)(l=i[a])&&(yield l)}var Vf=[null];function Yt(e,n){this._groups=e,this._parents=n}function Di(){return new Yt([[document.documentElement]],Vf)}function VN(){return this}Yt.prototype=Di.prototype={constructor:Yt,select:r1,selectAll:d1,selectChild:p1,selectChildren:b1,filter:k1,data:v1,enter:_1,exit:S1,join:R1,merge:A1,selection:VN,order:x1,sort:$1,call:M1,nodes:V1,node:L1,size:B1,empty:D1,each:O1,attr:K1,style:W1,property:Q1,classed:oN,text:lN,html:uN,raise:fN,lower:hN,append:yN,insert:bN,remove:_N,clone:wN,datum:IN,on:AN,dispatch:TN,[Symbol.iterator]:MN};function rn(e){return typeof e=="string"?new Yt([[document.querySelector(e)]],[document.documentElement]):new Yt([[e]],Vf)}function LN(e){let n;for(;n=e.sourceEvent;)e=n;return e}function bn(e,n){if(e=LN(e),n===void 0&&(n=e.currentTarget),n){var o=n.ownerSVGElement||n;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}const BN={passive:!1},Oi={capture:!0,passive:!1};function _s(e){e.stopImmediatePropagation()}function oi(e){e.preventDefault(),e.stopImmediatePropagation()}function Lf(e){var n=e.document.documentElement,o=rn(e).on("dragstart.drag",oi,Oi);"onselectstart"in n?o.on("selectstart.drag",oi,Oi):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Bf(e,n){var o=e.document.documentElement,i=rn(e).on("dragstart.drag",null);n&&(i.on("click.drag",oi,Oi),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in o?i.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const or=e=>()=>e;function Es(e,{sourceEvent:n,subject:o,target:i,identifier:a,active:r,x:l,y:s,dx:c,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}Es.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function DN(e){return!e.ctrlKey&&!e.button}function ON(){return this.parentNode}function PN(e,n){return n??{x:e.x,y:e.y}}function zN(){return navigator.maxTouchPoints||"ontouchstart"in this}function FN(){var e=DN,n=ON,o=PN,i=zN,a={},r=Qa("start","drag","end"),l=0,s,c,d,u,m=0;function f(C){C.on("mousedown.drag",p).filter(i).on("touchstart.drag",b).on("touchmove.drag",k,BN).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(C,v){if(!(u||!e.call(this,C,v))){var S=h(this,n.call(this,C,v),C,v,"mouse");S&&(rn(C.view).on("mousemove.drag",y,Oi).on("mouseup.drag",g,Oi),Lf(C.view),_s(C),d=!1,s=C.clientX,c=C.clientY,S("start",C))}}function y(C){if(oi(C),!d){var v=C.clientX-s,S=C.clientY-c;d=v*v+S*S>m}a.mouse("drag",C)}function g(C){rn(C.view).on("mousemove.drag mouseup.drag",null),Bf(C.view,d),oi(C),a.mouse("end",C)}function b(C,v){if(e.call(this,C,v)){var S=C.changedTouches,N=n.call(this,C,v),A=S.length,T,O;for(T=0;T<A;++T)(O=h(this,N,C,v,S[T].identifier,S[T]))&&(_s(C),O("start",C,S[T]))}}function k(C){var v=C.changedTouches,S=v.length,N,A;for(N=0;N<S;++N)(A=a[v[N].identifier])&&(oi(C),A("drag",C,v[N]))}function _(C){var v=C.changedTouches,S=v.length,N,A;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),N=0;N<S;++N)(A=a[v[N].identifier])&&(_s(C),A("end",C,v[N]))}function h(C,v,S,N,A,T){var O=r.copy(),z=bn(T||S,v),P,D,E;if((E=o.call(C,new Es("beforestart",{sourceEvent:S,target:f,identifier:A,active:l,x:z[0],y:z[1],dx:0,dy:0,dispatch:O}),N))!=null)return P=E.x-z[0]||0,D=E.y-z[1]||0,function R(I,x,$){var U=z,F;switch(I){case"start":a[A]=R,F=l++;break;case"end":delete a[A],--l;case"drag":z=bn($||x,v),F=l;break}O.call(I,C,new Es(I,{sourceEvent:x,subject:E,target:f,identifier:A,active:F,x:z[0]+P,y:z[1]+D,dx:z[0]-U[0],dy:z[1]-U[1],dispatch:O}),N)}}return f.filter=function(C){return arguments.length?(e=typeof C=="function"?C:or(!!C),f):e},f.container=function(C){return arguments.length?(n=typeof C=="function"?C:or(C),f):n},f.subject=function(C){return arguments.length?(o=typeof C=="function"?C:or(C),f):o},f.touchable=function(C){return arguments.length?(i=typeof C=="function"?C:or(!!C),f):i},f.on=function(){var C=r.on.apply(r,arguments);return C===r?f:C},f.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,f):Math.sqrt(m)},f}function Ns(e,n,o){e.prototype=n.prototype=o,o.constructor=e}function Df(e,n){var o=Object.create(e.prototype);for(var i in n)o[i]=n[i];return o}function Pi(){}var zi=.7,ir=1/zi,ii="\\s*([+-]?\\d+)\\s*",Fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",kn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",UN=/^#([0-9a-f]{3,8})$/,HN=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),jN=new RegExp(`^rgb\\(${kn},${kn},${kn}\\)$`),KN=new RegExp(`^rgba\\(${ii},${ii},${ii},${Fi}\\)$`),GN=new RegExp(`^rgba\\(${kn},${kn},${kn},${Fi}\\)$`),YN=new RegExp(`^hsl\\(${Fi},${kn},${kn}\\)$`),qN=new RegExp(`^hsla\\(${Fi},${kn},${kn},${Fi}\\)$`),Of={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ns(Pi,Co,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Pf,formatHex:Pf,formatHex8:WN,formatHsl:JN,formatRgb:zf,toString:zf});function Pf(){return this.rgb().formatHex()}function WN(){return this.rgb().formatHex8()}function JN(){return Kf(this).formatHsl()}function zf(){return this.rgb().formatRgb()}function Co(e){var n,o;return e=(e+"").trim().toLowerCase(),(n=UN.exec(e))?(o=n[1].length,n=parseInt(n[1],16),o===6?Ff(n):o===3?new Ut(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):o===8?ar(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):o===4?ar(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=HN.exec(e))?new Ut(n[1],n[2],n[3],1):(n=jN.exec(e))?new Ut(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=KN.exec(e))?ar(n[1],n[2],n[3],n[4]):(n=GN.exec(e))?ar(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=YN.exec(e))?jf(n[1],n[2]/100,n[3]/100,1):(n=qN.exec(e))?jf(n[1],n[2]/100,n[3]/100,n[4]):Of.hasOwnProperty(e)?Ff(Of[e]):e==="transparent"?new Ut(NaN,NaN,NaN,0):null}function Ff(e){return new Ut(e>>16&255,e>>8&255,e&255,1)}function ar(e,n,o,i){return i<=0&&(e=n=o=NaN),new Ut(e,n,o,i)}function XN(e){return e instanceof Pi||(e=Co(e)),e?(e=e.rgb(),new Ut(e.r,e.g,e.b,e.opacity)):new Ut}function ws(e,n,o,i){return arguments.length===1?XN(e):new Ut(e,n,o,i??1)}function Ut(e,n,o,i){this.r=+e,this.g=+n,this.b=+o,this.opacity=+i}Ns(Ut,ws,Df(Pi,{brighter(e){return e=e==null?ir:Math.pow(ir,e),new Ut(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zi:Math.pow(zi,e),new Ut(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ut(So(this.r),So(this.g),So(this.b),rr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Uf,formatHex:Uf,formatHex8:ZN,formatRgb:Hf,toString:Hf}));function Uf(){return`#${Ro(this.r)}${Ro(this.g)}${Ro(this.b)}`}function ZN(){return`#${Ro(this.r)}${Ro(this.g)}${Ro(this.b)}${Ro((isNaN(this.opacity)?1:this.opacity)*255)}`}function Hf(){const e=rr(this.opacity);return`${e===1?"rgb(":"rgba("}${So(this.r)}, ${So(this.g)}, ${So(this.b)}${e===1?")":`, ${e})`}`}function rr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function So(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ro(e){return e=So(e),(e<16?"0":"")+e.toString(16)}function jf(e,n,o,i){return i<=0?e=n=o=NaN:o<=0||o>=1?e=n=NaN:n<=0&&(e=NaN),new ln(e,n,o,i)}function Kf(e){if(e instanceof ln)return new ln(e.h,e.s,e.l,e.opacity);if(e instanceof Pi||(e=Co(e)),!e)return new ln;if(e instanceof ln)return e;e=e.rgb();var n=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(n,o,i),r=Math.max(n,o,i),l=NaN,s=r-a,c=(r+a)/2;return s?(n===r?l=(o-i)/s+(o<i)*6:o===r?l=(i-n)/s+2:l=(n-o)/s+4,s/=c<.5?r+a:2-r-a,l*=60):s=c>0&&c<1?0:l,new ln(l,s,c,e.opacity)}function QN(e,n,o,i){return arguments.length===1?Kf(e):new ln(e,n,o,i??1)}function ln(e,n,o,i){this.h=+e,this.s=+n,this.l=+o,this.opacity=+i}Ns(ln,QN,Df(Pi,{brighter(e){return e=e==null?ir:Math.pow(ir,e),new ln(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zi:Math.pow(zi,e),new ln(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,i=o+(o<.5?o:1-o)*n,a=2*o-i;return new Ut(Is(e>=240?e-240:e+120,a,i),Is(e,a,i),Is(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new ln(Gf(this.h),lr(this.s),lr(this.l),rr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=rr(this.opacity);return`${e===1?"hsl(":"hsla("}${Gf(this.h)}, ${lr(this.s)*100}%, ${lr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Gf(e){return e=(e||0)%360,e<0?e+360:e}function lr(e){return Math.max(0,Math.min(1,e||0))}function Is(e,n,o){return(e<60?n+(o-n)*e/60:e<180?o:e<240?n+(o-n)*(240-e)/60:n)*255}const vs=e=>()=>e;function e0(e,n){return function(o){return e+o*n}}function t0(e,n,o){return e=Math.pow(e,o),n=Math.pow(n,o)-e,o=1/o,function(i){return Math.pow(e+i*n,o)}}function n0(e){return(e=+e)==1?Yf:function(n,o){return o-n?t0(n,o,e):vs(isNaN(n)?o:n)}}function Yf(e,n){var o=n-e;return o?e0(e,o):vs(isNaN(e)?n:e)}const sr=(function e(n){var o=n0(n);function i(a,r){var l=o((a=ws(a)).r,(r=ws(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=Yf(a.opacity,r.opacity);return function(u){return a.r=l(u),a.g=s(u),a.b=c(u),a.opacity=d(u),a+""}}return i.gamma=e,i})(1);function o0(e,n){n||(n=[]);var o=e?Math.min(n.length,e.length):0,i=n.slice(),a;return function(r){for(a=0;a<o;++a)i[a]=e[a]*(1-r)+n[a]*r;return i}}function i0(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function a0(e,n){var o=n?n.length:0,i=e?Math.min(o,e.length):0,a=new Array(i),r=new Array(o),l;for(l=0;l<i;++l)a[l]=Ui(e[l],n[l]);for(;l<o;++l)r[l]=n[l];return function(s){for(l=0;l<i;++l)r[l]=a[l](s);return r}}function r0(e,n){var o=new Date;return e=+e,n=+n,function(i){return o.setTime(e*(1-i)+n*i),o}}function _n(e,n){return e=+e,n=+n,function(o){return e*(1-o)+n*o}}function l0(e,n){var o={},i={},a;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(a in n)a in e?o[a]=Ui(e[a],n[a]):i[a]=n[a];return function(r){for(a in o)i[a]=o[a](r);return i}}var Cs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ss=new RegExp(Cs.source,"g");function s0(e){return function(){return e}}function c0(e){return function(n){return e(n)+""}}function qf(e,n){var o=Cs.lastIndex=Ss.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",n=n+"";(i=Cs.exec(e))&&(a=Ss.exec(n));)(r=a.index)>o&&(r=n.slice(o,r),s[l]?s[l]+=r:s[++l]=r),(i=i[0])===(a=a[0])?s[l]?s[l]+=a:s[++l]=a:(s[++l]=null,c.push({i:l,x:_n(i,a)})),o=Ss.lastIndex;return o<n.length&&(r=n.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?c0(c[0].x):s0(n):(n=c.length,function(d){for(var u=0,m;u<n;++u)s[(m=c[u]).i]=m.x(d);return s.join("")})}function Ui(e,n){var o=typeof n,i;return n==null||o==="boolean"?vs(n):(o==="number"?_n:o==="string"?(i=Co(n))?(n=i,sr):qf:n instanceof Co?sr:n instanceof Date?r0:i0(n)?o0:Array.isArray(n)?a0:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?l0:_n)(e,n)}var Wf=180/Math.PI,Rs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Jf(e,n,o,i,a,r){var l,s,c;return(l=Math.sqrt(e*e+n*n))&&(e/=l,n/=l),(c=e*o+n*i)&&(o-=e*c,i-=n*c),(s=Math.sqrt(o*o+i*i))&&(o/=s,i/=s,c/=s),e*i<n*o&&(e=-e,n=-n,c=-c,l=-l),{translateX:a,translateY:r,rotate:Math.atan2(n,e)*Wf,skewX:Math.atan(c)*Wf,scaleX:l,scaleY:s}}var cr;function d0(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Rs:Jf(n.a,n.b,n.c,n.d,n.e,n.f)}function u0(e){return e==null||(cr||(cr=document.createElementNS("http://www.w3.org/2000/svg","g")),cr.setAttribute("transform",e),!(e=cr.transform.baseVal.consolidate()))?Rs:(e=e.matrix,Jf(e.a,e.b,e.c,e.d,e.e,e.f))}function Xf(e,n,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,f,p,y){if(d!==m||u!==f){var g=p.push("translate(",null,n,null,o);y.push({i:g-4,x:_n(d,m)},{i:g-2,x:_n(u,f)})}else(m||f)&&p.push("translate("+m+n+f+o)}function l(d,u,m,f){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),f.push({i:m.push(a(m)+"rotate(",null,i)-2,x:_n(d,u)})):u&&m.push(a(m)+"rotate("+u+i)}function s(d,u,m,f){d!==u?f.push({i:m.push(a(m)+"skewX(",null,i)-2,x:_n(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,f,p,y){if(d!==m||u!==f){var g=p.push(a(p)+"scale(",null,",",null,")");y.push({i:g-4,x:_n(d,m)},{i:g-2,x:_n(u,f)})}else(m!==1||f!==1)&&p.push(a(p)+"scale("+m+","+f+")")}return function(d,u){var m=[],f=[];return d=e(d),u=e(u),r(d.translateX,d.translateY,u.translateX,u.translateY,m,f),l(d.rotate,u.rotate,m,f),s(d.skewX,u.skewX,m,f),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,m,f),d=u=null,function(p){for(var y=-1,g=f.length,b;++y<g;)m[(b=f[y]).i]=b.x(p);return m.join("")}}}var m0=Xf(d0,"px, ","px)","deg)"),f0=Xf(u0,", ",")",")"),p0=1e-12;function Zf(e){return((e=Math.exp(e))+1/e)/2}function h0(e){return((e=Math.exp(e))-1/e)/2}function y0(e){return((e=Math.exp(2*e))-1)/(e+1)}const dr=(function e(n,o,i){function a(r,l){var s=r[0],c=r[1],d=r[2],u=l[0],m=l[1],f=l[2],p=u-s,y=m-c,g=p*p+y*y,b,k;if(g<p0)k=Math.log(f/d)/n,b=function(N){return[s+N*p,c+N*y,d*Math.exp(n*N*k)]};else{var _=Math.sqrt(g),h=(f*f-d*d+i*g)/(2*d*o*_),C=(f*f-d*d-i*g)/(2*f*o*_),v=Math.log(Math.sqrt(h*h+1)-h),S=Math.log(Math.sqrt(C*C+1)-C);k=(S-v)/n,b=function(N){var A=N*k,T=Zf(v),O=d/(o*_)*(T*y0(n*A+v)-h0(v));return[s+O*p,c+O*y,d*T/Zf(n*A+v)]}}return b.duration=k*1e3*n/Math.SQRT2,b}return a.rho=function(r){var l=Math.max(.001,+r),s=l*l,c=s*s;return e(l,s,c)},a})(Math.SQRT2,2,4);var ai=0,Hi=0,ji=0,Qf=1e3,ur,Ki,mr=0,Ao=0,fr=0,Gi=typeof performance=="object"&&performance.now?performance:Date,ep=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function As(){return Ao||(ep(g0),Ao=Gi.now()+fr)}function g0(){Ao=0}function pr(){this._call=this._time=this._next=null}pr.prototype=tp.prototype={constructor:pr,restart:function(e,n,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?As():+o)+(n==null?0:+n),!this._next&&Ki!==this&&(Ki?Ki._next=this:ur=this,Ki=this),this._call=e,this._time=o,xs()},stop:function(){this._call&&(this._call=null,this._time=1/0,xs())}};function tp(e,n,o){var i=new pr;return i.restart(e,n,o),i}function b0(){As(),++ai;for(var e=ur,n;e;)(n=Ao-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ai}function np(){Ao=(mr=Gi.now())+fr,ai=Hi=0;try{b0()}finally{ai=0,_0(),Ao=0}}function k0(){var e=Gi.now(),n=e-mr;n>Qf&&(fr-=n,mr=e)}function _0(){for(var e,n=ur,o,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(o=n._next,n._next=null,n=e?e._next=o:ur=o);Ki=e,xs(i)}function xs(e){if(!ai){Hi&&(Hi=clearTimeout(Hi));var n=e-Ao;n>24?(e<1/0&&(Hi=setTimeout(np,e-Gi.now()-fr)),ji&&(ji=clearInterval(ji))):(ji||(mr=Gi.now(),ji=setInterval(k0,Qf)),ai=1,ep(np))}}function op(e,n,o){var i=new pr;return n=n==null?0:+n,i.restart(a=>{i.stop(),e(a+n)},n,o),i}var E0=Qa("start","end","cancel","interrupt"),N0=[],ip=0,ap=1,$s=2,hr=3,rp=4,Ts=5,yr=6;function gr(e,n,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;w0(e,o,{name:n,index:i,group:a,on:E0,tween:N0,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:ip})}function Ms(e,n){var o=sn(e,n);if(o.state>ip)throw new Error("too late; already scheduled");return o}function En(e,n){var o=sn(e,n);if(o.state>hr)throw new Error("too late; already running");return o}function sn(e,n){var o=e.__transition;if(!o||!(o=o[n]))throw new Error("transition not found");return o}function w0(e,n,o){var i=e.__transition,a;i[n]=o,o.timer=tp(r,0,o.time);function r(d){o.state=ap,o.timer.restart(l,o.delay,o.time),o.delay<=d&&l(d-o.delay)}function l(d){var u,m,f,p;if(o.state!==ap)return c();for(u in i)if(p=i[u],p.name===o.name){if(p.state===hr)return op(l);p.state===rp?(p.state=yr,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[u]):+u<n&&(p.state=yr,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[u])}if(op(function(){o.state===hr&&(o.state=rp,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=$s,o.on.call("start",e,e.__data__,o.index,o.group),o.state===$s){for(o.state=hr,a=new Array(f=o.tween.length),u=0,m=-1;u<f;++u)(p=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++m]=p);a.length=m+1}}function s(d){for(var u=d<o.duration?o.ease.call(null,d/o.duration):(o.timer.restart(c),o.state=Ts,1),m=-1,f=a.length;++m<f;)a[m].call(e,u);o.state===Ts&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=yr,o.timer.stop(),delete i[n];for(var d in i)return;delete e.__transition}}function br(e,n){var o=e.__transition,i,a,r=!0,l;if(o){n=n==null?null:n+"";for(l in o){if((i=o[l]).name!==n){r=!1;continue}a=i.state>$s&&i.state<Ts,i.state=yr,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function I0(e){return this.each(function(){br(this,e)})}function v0(e,n){var o,i;return function(){var a=En(this,e),r=a.tween;if(r!==o){i=o=r;for(var l=0,s=i.length;l<s;++l)if(i[l].name===n){i=i.slice(),i.splice(l,1);break}}a.tween=i}}function C0(e,n,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=En(this,e),l=r.tween;if(l!==i){a=(i=l).slice();for(var s={name:n,value:o},c=0,d=a.length;c<d;++c)if(a[c].name===n){a[c]=s;break}c===d&&a.push(s)}r.tween=a}}function S0(e,n){var o=this._id;if(e+="",arguments.length<2){for(var i=sn(this.node(),o).tween,a=0,r=i.length,l;a<r;++a)if((l=i[a]).name===e)return l.value;return null}return this.each((n==null?v0:C0)(o,e,n))}function Vs(e,n,o){var i=e._id;return e.each(function(){var a=En(this,i);(a.value||(a.value={}))[n]=o.apply(this,arguments)}),function(a){return sn(a,i).value[n]}}function lp(e,n){var o;return(typeof n=="number"?_n:n instanceof Co?sr:(o=Co(n))?(n=o,sr):qf)(e,n)}function R0(e){return function(){this.removeAttribute(e)}}function A0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function x0(e,n,o){var i,a=o+"",r;return function(){var l=this.getAttribute(e);return l===a?null:l===i?r:r=n(i=l,o)}}function $0(e,n,o){var i,a=o+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===i?r:r=n(i=l,o)}}function T0(e,n,o){var i,a,r;return function(){var l,s=o(this),c;return s==null?void this.removeAttribute(e):(l=this.getAttribute(e),c=s+"",l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s)))}}function M0(e,n,o){var i,a,r;return function(){var l,s=o(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),c=s+"",l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s)))}}function V0(e,n){var o=tr(e),i=o==="transform"?f0:lp;return this.attrTween(e,typeof n=="function"?(o.local?M0:T0)(o,i,Vs(this,"attr."+e,n)):n==null?(o.local?A0:R0)(o):(o.local?$0:x0)(o,i,n))}function L0(e,n){return function(o){this.setAttribute(e,n.call(this,o))}}function B0(e,n){return function(o){this.setAttributeNS(e.space,e.local,n.call(this,o))}}function D0(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&B0(e,r)),o}return a._value=n,a}function O0(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&L0(e,r)),o}return a._value=n,a}function P0(e,n){var o="attr."+e;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(n==null)return this.tween(o,null);if(typeof n!="function")throw new Error;var i=tr(e);return this.tween(o,(i.local?D0:O0)(i,n))}function z0(e,n){return function(){Ms(this,e).delay=+n.apply(this,arguments)}}function F0(e,n){return n=+n,function(){Ms(this,e).delay=n}}function U0(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?z0:F0)(n,e)):sn(this.node(),n).delay}function H0(e,n){return function(){En(this,e).duration=+n.apply(this,arguments)}}function j0(e,n){return n=+n,function(){En(this,e).duration=n}}function K0(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?H0:j0)(n,e)):sn(this.node(),n).duration}function G0(e,n){if(typeof n!="function")throw new Error;return function(){En(this,e).ease=n}}function Y0(e){var n=this._id;return arguments.length?this.each(G0(n,e)):sn(this.node(),n).ease}function q0(e,n){return function(){var o=n.apply(this,arguments);if(typeof o!="function")throw new Error;En(this,e).ease=o}}function W0(e){if(typeof e!="function")throw new Error;return this.each(q0(this._id,e))}function J0(e){typeof e!="function"&&(e=vf(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=[],c,d=0;d<l;++d)(c=r[d])&&e.call(c,c.__data__,d,r)&&s.push(c);return new Bn(i,this._parents,this._name,this._id)}function X0(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,o=e._groups,i=n.length,a=o.length,r=Math.min(i,a),l=new Array(i),s=0;s<r;++s)for(var c=n[s],d=o[s],u=c.length,m=l[s]=new Array(u),f,p=0;p<u;++p)(f=c[p]||d[p])&&(m[p]=f);for(;s<i;++s)l[s]=n[s];return new Bn(l,this._parents,this._name,this._id)}function Z0(e){return(e+"").trim().split(/^|\s+/).every(function(n){var o=n.indexOf(".");return o>=0&&(n=n.slice(0,o)),!n||n==="start"})}function Q0(e,n,o){var i,a,r=Z0(n)?Ms:En;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(n,o),l.on=a}}function ew(e,n){var o=this._id;return arguments.length<2?sn(this.node(),o).on.on(e):this.each(Q0(o,e,n))}function tw(e){return function(){var n=this.parentNode;for(var o in this.__transition)if(+o!==e)return;n&&n.removeChild(this)}}function nw(){return this.on("end.remove",tw(this._id))}function ow(e){var n=this._name,o=this._id;typeof e!="function"&&(e=bs(e));for(var i=this._groups,a=i.length,r=new Array(a),l=0;l<a;++l)for(var s=i[l],c=s.length,d=r[l]=new Array(c),u,m,f=0;f<c;++f)(u=s[f])&&(m=e.call(u,u.__data__,f,s))&&("__data__"in u&&(m.__data__=u.__data__),d[f]=m,gr(d[f],n,o,f,d,sn(u,o)));return new Bn(r,this._parents,n,o)}function iw(e){var n=this._name,o=this._id;typeof e!="function"&&(e=If(e));for(var i=this._groups,a=i.length,r=[],l=[],s=0;s<a;++s)for(var c=i[s],d=c.length,u,m=0;m<d;++m)if(u=c[m]){for(var f=e.call(u,u.__data__,m,c),p,y=sn(u,o),g=0,b=f.length;g<b;++g)(p=f[g])&&gr(p,n,o,g,f,y);r.push(f),l.push(u)}return new Bn(r,l,n,o)}var aw=Di.prototype.constructor;function rw(){return new aw(this._groups,this._parents)}function lw(e,n){var o,i,a;return function(){var r=ni(this,e),l=(this.style.removeProperty(e),ni(this,e));return r===l?null:r===o&&l===i?a:a=n(o=r,i=l)}}function sp(e){return function(){this.style.removeProperty(e)}}function sw(e,n,o){var i,a=o+"",r;return function(){var l=ni(this,e);return l===a?null:l===i?r:r=n(i=l,o)}}function cw(e,n,o){var i,a,r;return function(){var l=ni(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),ni(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s))}}function dw(e,n){var o,i,a,r="style."+n,l="end."+r,s;return function(){var c=En(this,e),d=c.on,u=c.value[r]==null?s||(s=sp(n)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function uw(e,n,o){var i=(e+="")=="transform"?m0:lp;return n==null?this.styleTween(e,lw(e,i)).on("end.style."+e,sp(e)):typeof n=="function"?this.styleTween(e,cw(e,i,Vs(this,"style."+e,n))).each(dw(this._id,e)):this.styleTween(e,sw(e,i,n),o).on("end.style."+e,null)}function mw(e,n,o){return function(i){this.style.setProperty(e,n.call(this,i),o)}}function fw(e,n,o){var i,a;function r(){var l=n.apply(this,arguments);return l!==a&&(i=(a=l)&&mw(e,l,o)),i}return r._value=n,r}function pw(e,n,o){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,fw(e,n,o??""))}function hw(e){return function(){this.textContent=e}}function yw(e){return function(){var n=e(this);this.textContent=n??""}}function gw(e){return this.tween("text",typeof e=="function"?yw(Vs(this,"text",e)):hw(e==null?"":e+""))}function bw(e){return function(n){this.textContent=e.call(this,n)}}function kw(e){var n,o;function i(){var a=e.apply(this,arguments);return a!==o&&(n=(o=a)&&bw(a)),n}return i._value=e,i}function _w(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,kw(e))}function Ew(){for(var e=this._name,n=this._id,o=cp(),i=this._groups,a=i.length,r=0;r<a;++r)for(var l=i[r],s=l.length,c,d=0;d<s;++d)if(c=l[d]){var u=sn(c,n);gr(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Bn(i,this._parents,e,o)}function Nw(){var e,n,o=this,i=o._id,a=o.size();return new Promise(function(r,l){var s={value:l},c={value:function(){--a===0&&r()}};o.each(function(){var d=En(this,i),u=d.on;u!==e&&(n=(e=u).copy(),n._.cancel.push(s),n._.interrupt.push(s),n._.end.push(c)),d.on=n}),a===0&&r()})}var ww=0;function Bn(e,n,o,i){this._groups=e,this._parents=n,this._name=o,this._id=i}function cp(){return++ww}var Dn=Di.prototype;Bn.prototype={constructor:Bn,select:ow,selectAll:iw,selectChild:Dn.selectChild,selectChildren:Dn.selectChildren,filter:J0,merge:X0,selection:rw,transition:Ew,call:Dn.call,nodes:Dn.nodes,node:Dn.node,size:Dn.size,empty:Dn.empty,each:Dn.each,on:ew,attr:V0,attrTween:P0,style:uw,styleTween:pw,text:gw,textTween:_w,remove:nw,tween:S0,delay:U0,duration:K0,ease:Y0,easeVarying:W0,end:Nw,[Symbol.iterator]:Dn[Symbol.iterator]};function Iw(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var vw={time:null,delay:0,duration:250,ease:Iw};function Cw(e,n){for(var o;!(o=e.__transition)||!(o=o[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return o}function Sw(e){var n,o;e instanceof Bn?(n=e._id,e=e._name):(n=cp(),(o=vw).time=As(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,r=0;r<a;++r)for(var l=i[r],s=l.length,c,d=0;d<s;++d)(c=l[d])&&gr(c,e,n,d,l,o||Cw(c,n));return new Bn(i,this._parents,e,n)}Di.prototype.interrupt=I0,Di.prototype.transition=Sw;const kr=e=>()=>e;function Rw(e,{sourceEvent:n,target:o,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function On(e,n,o){this.k=e,this.x=n,this.y=o}On.prototype={constructor:On,scale:function(e){return e===1?this:new On(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new On(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ri=new On(1,0,0);On.prototype;function Ls(e){e.stopImmediatePropagation()}function Yi(e){e.preventDefault(),e.stopImmediatePropagation()}function Aw(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function xw(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function dp(){return this.__zoom||ri}function $w(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Tw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mw(e,n,o){var i=e.invertX(n[0][0])-o[0][0],a=e.invertX(n[1][0])-o[1][0],r=e.invertY(n[0][1])-o[0][1],l=e.invertY(n[1][1])-o[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),l>r?(r+l)/2:Math.min(0,r)||Math.max(0,l))}function Vw(){var e=Aw,n=xw,o=Mw,i=$w,a=Tw,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=dr,d=Qa("start","zoom","end"),u,m,f,p=500,y=150,g=0,b=10;function k(E){E.property("__zoom",dp).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",O).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(E,R,I,x){var $=E.selection?E.selection():E;$.property("__zoom",dp),E!==$?v(E,R,I,x):$.interrupt().each(function(){S(this,arguments).event(x).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},k.scaleBy=function(E,R,I,x){k.scaleTo(E,function(){var $=this.__zoom.k,U=typeof R=="function"?R.apply(this,arguments):R;return $*U},I,x)},k.scaleTo=function(E,R,I,x){k.transform(E,function(){var $=n.apply(this,arguments),U=this.__zoom,F=I==null?C($):typeof I=="function"?I.apply(this,arguments):I,B=U.invert(F),j=typeof R=="function"?R.apply(this,arguments):R;return o(h(_(U,j),F,B),$,l)},I,x)},k.translateBy=function(E,R,I,x){k.transform(E,function(){return o(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof I=="function"?I.apply(this,arguments):I),n.apply(this,arguments),l)},null,x)},k.translateTo=function(E,R,I,x,$){k.transform(E,function(){var U=n.apply(this,arguments),F=this.__zoom,B=x==null?C(U):typeof x=="function"?x.apply(this,arguments):x;return o(ri.translate(B[0],B[1]).scale(F.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof I=="function"?-I.apply(this,arguments):-I),U,l)},x,$)};function _(E,R){return R=Math.max(r[0],Math.min(r[1],R)),R===E.k?E:new On(R,E.x,E.y)}function h(E,R,I){var x=R[0]-I[0]*E.k,$=R[1]-I[1]*E.k;return x===E.x&&$===E.y?E:new On(E.k,x,$)}function C(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function v(E,R,I,x){E.on("start.zoom",function(){S(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(x).end()}).tween("zoom",function(){var $=this,U=arguments,F=S($,U).event(x),B=n.apply($,U),j=I==null?C(B):typeof I=="function"?I.apply($,U):I,X=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),W=$.__zoom,oe=typeof R=="function"?R.apply($,U):R,de=c(W.invert(j).concat(X/W.k),oe.invert(j).concat(X/oe.k));return function(ie){if(ie===1)ie=oe;else{var Ie=de(ie),Le=X/Ie[2];ie=new On(Le,j[0]-Ie[0]*Le,j[1]-Ie[1]*Le)}F.zoom(null,ie)}})}function S(E,R,I){return!I&&E.__zooming||new N(E,R)}function N(E,R){this.that=E,this.args=R,this.active=0,this.sourceEvent=null,this.extent=n.apply(E,R),this.taps=0}N.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,R){return this.mouse&&E!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var R=rn(this.that).datum();d.call(E,this.that,new Rw(E,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),R)}};function A(E,...R){if(!e.apply(this,arguments))return;var I=S(this,R).event(E),x=this.__zoom,$=Math.max(r[0],Math.min(r[1],x.k*Math.pow(2,i.apply(this,arguments)))),U=bn(E);if(I.wheel)(I.mouse[0][0]!==U[0]||I.mouse[0][1]!==U[1])&&(I.mouse[1]=x.invert(I.mouse[0]=U)),clearTimeout(I.wheel);else{if(x.k===$)return;I.mouse=[U,x.invert(U)],br(this),I.start()}Yi(E),I.wheel=setTimeout(F,y),I.zoom("mouse",o(h(_(x,$),I.mouse[0],I.mouse[1]),I.extent,l));function F(){I.wheel=null,I.end()}}function T(E,...R){if(f||!e.apply(this,arguments))return;var I=E.currentTarget,x=S(this,R,!0).event(E),$=rn(E.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",X,!0),U=bn(E,I),F=E.clientX,B=E.clientY;Lf(E.view),Ls(E),x.mouse=[U,this.__zoom.invert(U)],br(this),x.start();function j(W){if(Yi(W),!x.moved){var oe=W.clientX-F,de=W.clientY-B;x.moved=oe*oe+de*de>g}x.event(W).zoom("mouse",o(h(x.that.__zoom,x.mouse[0]=bn(W,I),x.mouse[1]),x.extent,l))}function X(W){$.on("mousemove.zoom mouseup.zoom",null),Bf(W.view,x.moved),Yi(W),x.event(W).end()}}function O(E,...R){if(e.apply(this,arguments)){var I=this.__zoom,x=bn(E.changedTouches?E.changedTouches[0]:E,this),$=I.invert(x),U=I.k*(E.shiftKey?.5:2),F=o(h(_(I,U),x,$),n.apply(this,R),l);Yi(E),s>0?rn(this).transition().duration(s).call(v,F,x,E):rn(this).call(k.transform,F,x,E)}}function z(E,...R){if(e.apply(this,arguments)){var I=E.touches,x=I.length,$=S(this,R,E.changedTouches.length===x).event(E),U,F,B,j;for(Ls(E),F=0;F<x;++F)B=I[F],j=bn(B,this),j=[j,this.__zoom.invert(j),B.identifier],$.touch0?!$.touch1&&$.touch0[2]!==j[2]&&($.touch1=j,$.taps=0):($.touch0=j,U=!0,$.taps=1+!!u);u&&(u=clearTimeout(u)),U&&($.taps<2&&(m=j[0],u=setTimeout(function(){u=null},p)),br(this),$.start())}}function P(E,...R){if(this.__zooming){var I=S(this,R).event(E),x=E.changedTouches,$=x.length,U,F,B,j;for(Yi(E),U=0;U<$;++U)F=x[U],B=bn(F,this),I.touch0&&I.touch0[2]===F.identifier?I.touch0[0]=B:I.touch1&&I.touch1[2]===F.identifier&&(I.touch1[0]=B);if(F=I.that.__zoom,I.touch1){var X=I.touch0[0],W=I.touch0[1],oe=I.touch1[0],de=I.touch1[1],ie=(ie=oe[0]-X[0])*ie+(ie=oe[1]-X[1])*ie,Ie=(Ie=de[0]-W[0])*Ie+(Ie=de[1]-W[1])*Ie;F=_(F,Math.sqrt(ie/Ie)),B=[(X[0]+oe[0])/2,(X[1]+oe[1])/2],j=[(W[0]+de[0])/2,(W[1]+de[1])/2]}else if(I.touch0)B=I.touch0[0],j=I.touch0[1];else return;I.zoom("touch",o(h(F,B,j),I.extent,l))}}function D(E,...R){if(this.__zooming){var I=S(this,R).event(E),x=E.changedTouches,$=x.length,U,F;for(Ls(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),U=0;U<$;++U)F=x[U],I.touch0&&I.touch0[2]===F.identifier?delete I.touch0:I.touch1&&I.touch1[2]===F.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(F=bn(F,this),Math.hypot(m[0]-F[0],m[1]-F[1])<b)){var B=rn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return k.wheelDelta=function(E){return arguments.length?(i=typeof E=="function"?E:kr(+E),k):i},k.filter=function(E){return arguments.length?(e=typeof E=="function"?E:kr(!!E),k):e},k.touchable=function(E){return arguments.length?(a=typeof E=="function"?E:kr(!!E),k):a},k.extent=function(E){return arguments.length?(n=typeof E=="function"?E:kr([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),k):n},k.scaleExtent=function(E){return arguments.length?(r[0]=+E[0],r[1]=+E[1],k):[r[0],r[1]]},k.translateExtent=function(E){return arguments.length?(l[0][0]=+E[0][0],l[1][0]=+E[1][0],l[0][1]=+E[0][1],l[1][1]=+E[1][1],k):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},k.constrain=function(E){return arguments.length?(o=E,k):o},k.duration=function(E){return arguments.length?(s=+E,k):s},k.interpolate=function(E){return arguments.length?(c=E,k):c},k.on=function(){var E=d.on.apply(d,arguments);return E===d?k:E},k.clickDistance=function(E){return arguments.length?(g=(E=+E)*E,k):Math.sqrt(g)},k.tapDistance=function(E){return arguments.length?(b=+E,k):b},k}var Ve=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(Ve||{}),Bs=(e=>(e.Partial="partial",e.Full="full",e))(Bs||{}),xo=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(xo||{}),Pn=(e=>(e.Strict="strict",e.Loose="loose",e))(Pn||{}),Ds=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(Ds||{}),qi=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(qi||{}),up=(e=>(e.TopLeft="top-left",e.TopCenter="top-center",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomCenter="bottom-center",e.BottomRight="bottom-right",e))(up||{});const Lw=["INPUT","SELECT","TEXTAREA"],Bw=typeof document<"u"?document:null;function Os(e){var n,o;const i=((o=(n=e.composedPath)==null?void 0:n.call(e))==null?void 0:o[0])||e.target,a=typeof(i==null?void 0:i.hasAttribute)=="function"?i.hasAttribute("contenteditable"):!1,r=typeof(i==null?void 0:i.closest)=="function"?i.closest(".nokey"):null;return Lw.includes(i==null?void 0:i.nodeName)||a||!!r}function Dw(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function mp(e,n,o,i){const a=n.replace("+",`
|
|
34
|
+
`}}const ko="com.example",hk="command.domain";function $n(e,n,o={}){const i=Ko(e,n);if(i.kind==="explicit")return i.value;const a=o.packageConfig;if(a!=null&&a.basePackage){const r=i.value?`.${i.value}`:"",l=a.layerSuffix??hk,s=l?`.${l}`:"";return`${a.basePackage}${r}${s}`}return n.packageName||""}const yk="CustomMoneyType",gk="Money";function bk(e){return!(e.type!==yk||e.attrType!=="NORMAL"||e.identifier||e.dbAttrs.length>1)}function kk(e){const n=e.dbAttrs[0]??{modelId:Fe(),physicalName:"",dataType:""},o={modelId:Fe(),physicalName:"",dataType:""},{customType:i,...a}=e;return{...a,type:gk,attrType:"EMBED_PREDEF",dbAttrs:[n,o]}}function _k(e){let n=!1;const o=e.entities.map(i=>{let a=!1;const r=i.attributes.map(l=>bk(l)?(a=!0,n=!0,kk(l)):l);return a?{...i,attributes:r}:i});return n?{...e,entities:o}:e}function Ek(e,n){const o=new Map,i=[],a=new Map;for(const y of e.entities){const g=new Map,b=new Map,k=new Map,_=(h,C,v)=>{if(!h)return;o.get(h)||o.set(h,[{entityId:C,assignedId:h}]),i.push({id:h,entityId:C,sink:v}),v(h)};for(const h of y.attributes){_(h.modelId,y.modelId,C=>g.set(h,C));for(const C of h.dbAttrs)_(C.modelId,y.modelId,v=>b.set(C,v))}for(const h of y.indexes??[])_(h.modelId,y.modelId,C=>k.set(h,C));a.set(y,{attrs:g,cols:b,idx:k})}const r=new Set(o.keys()),l=new Map;for(const y of i){const g=(l.get(y.id)??0)+1;if(l.set(y.id,g),g===1)continue;const b=Nk(y.id,g-1,r);r.add(b),o.get(y.id).push({entityId:y.entityId,assignedId:b}),y.sink(b)}const s=[...o.values()].reduce((y,g)=>y+Math.max(0,g.length-1),0);if(s===0)return{logical:e,layout:n,reissued:0};const c=(y,g)=>{var k;if(!g||!y)return g;const b=o.get(g);return!b||b.length<2?g:((k=b.find(_=>_.entityId===y))==null?void 0:k.assignedId)??g},d=new Map(e.associations.map(y=>[y.modelId,y])),u=(y,g)=>{const b=d.get(y);if(b)return b.end1.entityRef===g?b.end2.entityRef:b.end1.entityRef},m=e.entities.map(y=>{var h;const g=a.get(y),b=y.attributes.map(C=>{const v=g.attrs.get(C),S=C.dbAttrs.map(T=>{const O=g.cols.get(T);return O===T.modelId?T:{...T,modelId:O}});let N=C.derivedFrom;if(N){const T=u(N.associationRef,y.modelId),O=c(T,N.sourceAttributeRef);O!==N.sourceAttributeRef&&(N={...N,sourceAttributeRef:O})}return v!==C.modelId||N!==C.derivedFrom||S.some((T,O)=>T!==C.dbAttrs[O])?{...C,modelId:v,dbAttrs:S,derivedFrom:N}:C}),k=(h=y.indexes)==null?void 0:h.map(C=>{const v=g.idx.get(C),S=C.columns.map(A=>{const T=c(y.modelId,A.columnRef);return T===A.columnRef?A:{...A,columnRef:T}});return v!==C.modelId||S.some((A,T)=>A!==C.columns[T])?{...C,modelId:v,columns:S}:C});return b.some((C,v)=>C!==y.attributes[v])||k&&y.indexes&&k.some((C,v)=>C!==y.indexes[v])?{...y,attributes:b,...k?{indexes:k}:{}}:y}),f=e.associations.map(y=>{const g=c(y.end1.entityRef,y.end1.attributeRef),b=c(y.end2.entityRef,y.end2.attributeRef);return g===y.end1.attributeRef&&b===y.end2.attributeRef?y:{...y,end1:g===y.end1.attributeRef?y.end1:{...y.end1,attributeRef:g},end2:b===y.end2.attributeRef?y.end2:{...y.end2,attributeRef:b}}}),p=n.associationLayouts.map(y=>{const g=d.get(y.associationRef);if(!g)return y;const b=c(g.end1.entityRef,y.sourceColumnRef),k=c(g.end2.entityRef,y.targetColumnRef);return b===y.sourceColumnRef&&k===y.targetColumnRef?y:{...y,sourceColumnRef:b,targetColumnRef:k}});return{logical:{...e,entities:m,associations:f},layout:p.some((y,g)=>y!==n.associationLayouts[g])?{...n,associationLayouts:p}:n,reissued:s}}function Nk(e,n,o){let i=n;for(;;){const a=`dup${i}:${e}`;if(!o.has(a))return a;i++}}const wk="5.2.50";function Jt(e){return e.reduce((n,o)=>Math.max(n,o.order),-1)+1}function Jl(e,n,o){const i=new Set(n),a=e.filter(s=>i.has(s.modelId)),r=e.filter(s=>!i.has(s.modelId)),l=Math.max(0,Math.min(o,r.length));return[...r.slice(0,l),...a,...r.slice(l)]}function yu(e){return!!e.derivedFrom&&e.dbAttrs.length>0}function gu(e){for(const n of e){const o=[...n.attributes].sort((s,c)=>s.order-c.order),i=o.filter(yu);if(!i.length)continue;const a=o.filter(s=>!yu(s));let r=0;a.forEach((s,c)=>{s.identifier&&!s.derivedFrom&&(r=c+1)});const l=[...a.slice(0,r),...i,...a.slice(r)];l.forEach((s,c)=>s.order=c),n.attributes=l}}function Zo(e){return JSON.parse(JSON.stringify(e))}function bu(e,n,o){var A;const i=o.idFactory??Fe,a=o.offset??{x:0,y:0},{logical:r,layout:l}=e,s=new Set(n);if(o.includeRelated){const T=new Set(n);for(const O of r.associations){const z=T.has(O.end1.entityRef),P=T.has(O.end2.entityRef);z!==P&&s.add(z?O.end2.entityRef:O.end1.entityRef)}}const c=r.entities.filter(T=>s.has(T.modelId)),d=new Set(c.map(T=>T.modelId)),u=r.associations.filter(T=>d.has(T.end1.entityRef)&&d.has(T.end2.entityRef)),m=new Set(u.map(T=>T.modelId)),f=new Map,p=T=>{let O=f.get(T);return O||(O=i(),f.set(T,O)),O};for(const T of c){p(T.modelId);for(const O of T.attributes){p(O.modelId);for(const z of O.dbAttrs)p(z.modelId)}for(const O of T.indexes??[])p(O.modelId);for(const O of T.operations??[])p(O.modelId)}for(const T of u)p(T.modelId);const y=T=>f.get(T),g=c.map(T=>{const O=Zo(T);O.modelId=y(T.modelId),O.attributes=O.attributes.map(z=>Ik(z,y,m,d));for(const z of O.indexes??[])z.modelId=y(z.modelId),z.columns=z.columns.map(P=>co(P.columnRef)?P:{...P,columnRef:y(P.columnRef)}).filter(P=>P.columnRef!==void 0);for(const z of O.operations??[])z.modelId=y(z.modelId);return O});gu(g);const b=u.map(T=>{const O=Zo(T);return O.modelId=y(T.modelId),O.end1=ku(O.end1,y),O.end2=ku(O.end2,y),O}),k=[];for(const T of r.groups){const O=T.memberEntityRefs.filter(P=>d.has(P));if(O.length===0)continue;const z=Zo(T);z.modelId=p(T.modelId),z.memberEntityRefs=O.map(P=>y(P)),k.push(z)}const _=o.collisionSuffix??"_imported",h=new Set(o.existing.entities.map(T=>T.name)),C=new Set(o.existing.entities.map(T=>{var O;return(O=T.table)==null?void 0:O.physicalName}).filter(T=>!!T));for(const T of g)h.has(T.name)&&(T.name=`${T.name}${_}`),(A=T.table)!=null&&A.physicalName&&C.has(T.table.physicalName)&&(T.table.physicalName=`${T.table.physicalName}${_}`);const v=[];for(const T of l.entityLayouts){const O=y(T.entityRef);if(!O)continue;const z=Zo(T);z.entityRef=O,z.geo={...z.geo,location:Xl(z.geo.location,a)},z.attributeStyles&&(z.attributeStyles=Va(z.attributeStyles,y)),z.operationStyles&&(z.operationStyles=Va(z.operationStyles,y)),v.push(z)}const S=[];for(const T of l.associationLayouts){const O=y(T.associationRef);if(!O)continue;const z=Zo(T);z.associationRef=O,z.sourceColumnRef=T.sourceColumnRef?y(T.sourceColumnRef):void 0,z.targetColumnRef=T.targetColumnRef?y(T.targetColumnRef):void 0,z.waypoints=z.waypoints.map(P=>Xl(P,a)),S.push(z)}const N=[];for(const T of l.groupLayouts){const O=y(T.groupRef);if(!O)continue;const z=Zo(T);z.groupRef=O,z.geo={...z.geo,location:Xl(z.geo.location,a)},delete z.memberNoteRefs,N.push(z)}return{logical:{entities:g,associations:b,groups:k},layout:{entityLayouts:v,associationLayouts:S,groupLayouts:N},idMap:f}}function Xl(e,n){return{x:e.x+n.x,y:e.y+n.y}}function Ik(e,n,o,i){e.modelId=n(e.modelId);for(const a of e.dbAttrs)if(a.modelId=n(a.modelId),a.sharedColumnRef!==void 0){const r=n(a.sharedColumnRef);r?a.sharedColumnRef=r:delete a.sharedColumnRef}return e.derivedFrom&&(o.has(e.derivedFrom.associationRef)?e.derivedFrom={associationRef:n(e.derivedFrom.associationRef),sourceAttributeRef:n(e.derivedFrom.sourceAttributeRef)??e.derivedFrom.sourceAttributeRef}:(delete e.derivedFrom,(e.attrType==="RELATION_OWN"||e.attrType==="RELATION_REF")&&(e.attrType="NORMAL"))),e.embedded&&(i.has(e.embedded.embeddableRef)?e.embedded={associationRef:n(e.embedded.associationRef)??e.embedded.associationRef,embeddableRef:n(e.embedded.embeddableRef)}:(delete e.embedded,e.attrType.startsWith("EMBED")&&(e.attrType="NORMAL"))),e}function ku(e,n){return{...e,entityRef:n(e.entityRef),attributeRef:e.attributeRef?n(e.attributeRef):void 0}}function Va(e,n){const o={};for(const[i,a]of Object.entries(e)){const r=n(i);r&&(o[r]=a)}return o}function Zl(e){if(!("rev"in e))return e;const{rev:n,...o}=e;return o}function _o(e,n){if(e===n||e==null&&n==null)return!0;if(e==null||n==null)return!1;if(Array.isArray(e)||Array.isArray(n))return!Array.isArray(e)||!Array.isArray(n)||e.length!==n.length?!1:e.every((o,i)=>_o(o,n[i]));if(typeof e=="object"&&typeof n=="object"){const o=new Set([...Object.keys(e),...Object.keys(n)]);for(const i of o)if(!_o(e[i],n[i]))return!1;return!0}return!1}function Eo(e,n,o){const i={},a=new Set([...Object.keys(e),...Object.keys(n)]);for(const r of a)o.has(r)||_o(e[r],n[r])||(i[r]=n[r]===void 0?null:n[r]);return Object.keys(i).length?i:null}function No(e,n,o){const i=new Map(e.map(d=>[o(d),d])),a=new Map(n.map(d=>[o(d),d])),r=[],l=[],s=[];for(const[d,u]of a){const m=i.get(d);m?s.push({cur:m,tgt:u}):r.push(u)}for(const[d,u]of i)a.has(d)||l.push(u);const c=(d,u)=>o(d)<o(u)?-1:o(d)>o(u)?1:0;return r.sort(c),l.sort(c),s.sort((d,u)=>c(d.tgt,u.tgt)),{added:r,removed:l,common:s}}function vk(e,n){const o=new Set(e),i=new Set(n),a=n.filter(l=>!o.has(l)).sort(),r=e.filter(l=>!i.has(l)).sort();return{added:a,removed:r}}const Ck=new Set(["attributes","operations","indexes","rev"]),Sk=new Set(["end1","end2","rev"]),Rk=new Set(["memberEntityRefs","rev"]),_u=new Set(["modelId"]),Ak=new Set(["modelId","columns"]),xk=new Set([]);function $k(e,n,o,i){const a=No(n.attributes??[],o.attributes??[],s=>s.modelId);for(const s of a.removed)i.push({kind:"attribute.remove",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:s.modelId});for(const s of a.added)i.push({kind:"attribute.add",casUnit:"logical",containerRef:e,entityRef:e,value:s});for(const{cur:s,tgt:c}of a.common){const d=Eo(s,c,_u);d&&i.push({kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:s.modelId,patch:d})}const r=No(n.operations??[],o.operations??[],s=>s.modelId);for(const s of r.removed)i.push({kind:"operation.remove",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId});for(const s of r.added)i.push({kind:"operation.add",casUnit:"logical",containerRef:e,entityRef:e,value:s});for(const{cur:s,tgt:c}of r.common){const d=Eo(s,c,_u);d&&i.push({kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId,patch:d})}const l=No(n.indexes??[],o.indexes??[],s=>s.modelId);for(const s of l.removed)i.push({kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId});for(const s of l.added)i.push({kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:s});for(const{cur:s,tgt:c}of l.common){if(!_o(s.columns,c.columns)){i.push({kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId}),i.push({kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:c});continue}const d=Eo(s,c,Ak);d&&i.push({kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId,patch:d})}}function Tk(e,n,o){const i=No(e.entities??[],n.entities??[],l=>l.modelId);for(const l of i.removed)o.push({kind:"entity.remove",casUnit:"logical",entityRef:l.modelId});for(const l of i.added)o.push({kind:"entity.add",casUnit:"logical",entityRef:l.modelId,value:Zl(l)});for(const{cur:l,tgt:s}of i.common){const c=Eo(l,s,Ck);c&&o.push({kind:"entity.update",casUnit:"logical",containerRef:l.modelId,entityRef:l.modelId,patch:c}),$k(l.modelId,l,s,o)}const a=No(e.associations??[],n.associations??[],l=>l.modelId);for(const l of a.removed)o.push({kind:"association.remove",casUnit:"logical",associationRef:l.modelId});for(const l of a.added)o.push({kind:"association.add",casUnit:"logical",associationRef:l.modelId,value:Zl(l)});for(const{cur:l,tgt:s}of a.common){const c=Eo(l,s,Sk);c&&o.push({kind:"association.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,patch:c});for(const d of["end1","end2"]){const u=Eo(l[d]??{},s[d]??{},xk);u&&o.push({kind:"associationEnd.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,end:d,patch:u})}}const r=No(e.groups??[],n.groups??[],l=>l.modelId);for(const l of r.removed)o.push({kind:"group.remove",casUnit:"logical",groupRef:l.modelId});for(const l of r.added)o.push({kind:"group.add",casUnit:"logical",groupRef:l.modelId,value:Zl(l)});for(const{cur:l,tgt:s}of r.common){const c=Eo(l,s,Rk);c&&o.push({kind:"group.update",casUnit:"logical",containerRef:l.modelId,groupRef:l.modelId,patch:c});const d=vk(l.memberEntityRefs??[],s.memberEntityRefs??[]);for(const u of d.removed)o.push({kind:"group.removeMember",casUnit:"logical",containerRef:l.modelId,groupRef:l.modelId,entityRef:u});for(const u of d.added)o.push({kind:"group.addMember",casUnit:"logical",containerRef:l.modelId,groupRef:l.modelId,entityRef:u})}}function La(e,n,o,i,a,r,l){const s=No(e,n,o);for(const c of s.removed)l.push({kind:a,casUnit:"layout",[r]:o(c),value:void 0});for(const c of s.added)l.push({kind:i,casUnit:"layout",[r]:o(c),value:c});for(const{cur:c,tgt:d}of s.common)_o(c,d)||(l.push({kind:a,casUnit:"layout",[r]:o(c),value:void 0}),l.push({kind:i,casUnit:"layout",[r]:o(d),value:d}))}function Mk(e,n,o){La(e.entityLayouts??[],n.entityLayouts??[],i=>i.entityRef,"entityLayout.add","entityLayout.remove","entityRef",o),La(e.associationLayouts??[],n.associationLayouts??[],i=>i.associationRef,"associationLayout.add","associationLayout.remove","associationRef",o),La(e.groupLayouts??[],n.groupLayouts??[],i=>i.groupRef,"groupLayout.add","groupLayout.remove","groupRef",o),La(e.notes??[],n.notes??[],i=>i.modelId,"note.add","note.remove","noteRef",o)}function Vk(e,n){const o=[];return Tk(e.logical,n.logical,o),Mk(e.layout,n.layout,o),o}function Lk(e){if(e.groupRef!=null)return"group";if(e.noteRef!=null)return"note";if(e.associationRef!=null)return e.end!=null?"associationEnd":"association";if(e.entityRef!=null&&e.attributeRef!=null)return"attribute";if(e.entityRef!=null&&e.operationRef!=null)return"operation";if(e.entityRef!=null&&e.indexRef!=null)return"index";if(e.entityRef!=null)return"entity";throw new Error("projectFieldAudit: 대상 로케이터가 비었습니다(entityRef/associationRef/groupRef/noteRef 중 하나 필요).")}const Bk={entity:new Set(["attributes","operations","indexes","rev","modelId"]),association:new Set(["end1","end2","rev","modelId"]),group:new Set(["memberEntityRefs","rev","modelId"]),attribute:new Set(["modelId"]),operation:new Set(["modelId"]),index:new Set(["modelId"]),associationEnd:new Set([]),note:new Set(["geo","style","connections","legacyRaw","modelId"])};class Dk{constructor(n){st(this,"out",[]);st(this,"last",new Map);this.fieldFilter=n}set(n,o,i){if(this.fieldFilter!=null&&o!==this.fieldFilter)return;const a=this.last.get(o);this.out.push({...$i(n),field:o,value:i,...this.last.has(o)?{oldValue:a}:{}}),this.last.set(o,i)}remove(n,o){if(o!=null){if(this.fieldFilter!=null&&o!==this.fieldFilter)return;this.out.push({...$i(n),field:o,value:void 0,removed:!0,...this.last.has(o)?{oldValue:this.last.get(o)}:{}}),this.last.delete(o);return}const i=this.fieldFilter!=null?[this.fieldFilter]:[...this.last.keys()];for(const a of i){if(!this.last.has(a)){this.out.push({...$i(n),field:a,value:void 0,removed:!0});continue}this.out.push({...$i(n),field:a,value:void 0,removed:!0,oldValue:this.last.get(a)}),this.last.delete(a)}}collectionMember(n,o,i,a){this.fieldFilter!=null&&o!==this.fieldFilter||this.out.push({...$i(n),field:o,value:i,...a?{removed:!0}:{}})}member(n,o,i){this.collectionMember(n,"memberEntityRefs",o,i)}result(){return this.out}}function $i(e){const n={seq:e.seq};return e.ts!==void 0&&(n.ts=e.ts),e.origin!==void 0&&(n.origin=e.origin),e.author!==void 0&&(n.author=e.author),e.kind!==void 0&&(n.kind=e.kind),e.restoredFromSeq!==void 0&&(n.restoredFromSeq=e.restoredFromSeq),n}function en(e,n,o,i){if(o==null||typeof o!="object")return;const a=Bk[i];for(const[r,l]of Object.entries(o))a.has(r)||e.set(n,r,l)}function wo(e,n,o){if(!(o==null||typeof o!="object"))for(const[i,a]of Object.entries(o))e.set(n,i,a)}function Ql(e,n){if(Array.isArray(e))return e.find(o=>o.modelId===n)}function Tn(e,n){var r,l,s,c,d,u,m,f,p,y;const o=Lk(n),i=new Dk(n.field),a=[...e].sort((g,b)=>g.seq-b.seq);for(const g of a)for(const b of g.ops)switch(o){case"entity":if(b.entityRef!==n.entityRef)break;b.kind==="entity.add"?en(i,g,b.value,"entity"):b.kind==="entity.update"?wo(i,g,b.patch):b.kind==="entity.remove"&&i.remove(g);break;case"attribute":if(b.entityRef!==n.entityRef)break;if(b.kind==="entity.add"){const k=Ql((r=b.value)==null?void 0:r.attributes,n.attributeRef);k&&en(i,g,k,"attribute")}else b.kind==="attribute.add"&&((l=b.value)==null?void 0:l.modelId)===n.attributeRef?en(i,g,b.value,"attribute"):b.kind==="attribute.update"&&b.attributeRef===n.attributeRef?wo(i,g,b.patch):(b.kind==="attribute.remove"&&b.attributeRef===n.attributeRef||b.kind==="entity.remove")&&i.remove(g);break;case"operation":if(b.entityRef!==n.entityRef)break;if(b.kind==="entity.add"){const k=Ql((s=b.value)==null?void 0:s.operations,n.operationRef);k&&en(i,g,k,"operation")}else b.kind==="operation.add"&&((c=b.value)==null?void 0:c.modelId)===n.operationRef?en(i,g,b.value,"operation"):b.kind==="operation.update"&&b.operationRef===n.operationRef?wo(i,g,b.patch):(b.kind==="operation.remove"&&b.operationRef===n.operationRef||b.kind==="entity.remove")&&i.remove(g);break;case"index":if(b.entityRef!==n.entityRef)break;if(b.kind==="entity.add"){const k=Ql((d=b.value)==null?void 0:d.indexes,n.indexRef);k&&en(i,g,k,"index")}else b.kind==="index.add"&&((u=b.value)==null?void 0:u.modelId)===n.indexRef?en(i,g,b.value,"index"):b.kind==="index.update"&&b.indexRef===n.indexRef?wo(i,g,b.patch):(b.kind==="index.remove"&&b.indexRef===n.indexRef||b.kind==="entity.remove")&&i.remove(g);break;case"association":if(b.associationRef!==n.associationRef)break;b.kind==="association.add"?en(i,g,b.value,"association"):b.kind==="association.update"?wo(i,g,b.patch):b.kind==="association.remove"&&i.remove(g);break;case"associationEnd":if(b.associationRef!==n.associationRef)break;if(b.kind==="association.add"){const k=(m=b.value)==null?void 0:m[n.end];en(i,g,k,"associationEnd")}else b.kind==="associationEnd.update"&&b.end===n.end?wo(i,g,b.patch):b.kind==="association.remove"&&i.remove(g);break;case"group":if(b.groupRef!==n.groupRef)break;if(b.kind==="group.add"){en(i,g,b.value,"group");const k=(f=b.value)==null?void 0:f.memberEntityRefs;if(Array.isArray(k))for(const _ of k)i.member(g,_,!1)}else b.kind==="group.update"?wo(i,g,b.patch):b.kind==="group.remove"?i.remove(g):b.kind==="group.addMember"&&b.entityRef!=null?i.member(g,b.entityRef,!1):b.kind==="group.removeMember"&&b.entityRef!=null&&i.member(g,b.entityRef,!0);break;case"note":if(b.noteRef!==n.noteRef)break;if(b.kind==="note.add"){en(i,g,b.value,"note");const k=(p=b.value)==null?void 0:p.connections;if(Array.isArray(k))for(const _ of k){const h=_.targetRef;typeof h=="string"&&i.collectionMember(g,"connections",h,!1)}}else if(b.kind==="note.setMemo"){const k=(y=b.value)==null?void 0:y.memo;k!==void 0&&i.set(g,"memo",k)}else b.kind==="note.remove"?i.remove(g):b.kind==="noteConnection.add"&&typeof b.targetRef=="string"?i.collectionMember(g,"connections",b.targetRef,!1):b.kind==="noteConnection.remove"&&typeof b.targetRef=="string"&&i.collectionMember(g,"connections",b.targetRef,!0);break}return i.result()}const kt={subject:null,existence:null,fieldAudit:!1,note:"레이아웃 축(LWW) — 감사·복원 diff는 논리 축 전용(AA-5: 좌표·크기·스타일은 의도적 범위 밖)"},Ba={subject:null,existence:null,fieldAudit:!1,note:"노트의 기하·스타일 축 — 캔버스에서 가장 자주 바뀌어 편입하면 이력을 덮는다(존재·메모·연결만 편입)"},Ok={"entity.add":{subject:"entity",existence:"add",fieldAudit:!0},"entity.update":{subject:"entity",existence:null,fieldAudit:!0},"entity.remove":{subject:"entity",existence:"remove",fieldAudit:!0},"attribute.add":{subject:"attribute",existence:"add",fieldAudit:!0},"attribute.update":{subject:"attribute",existence:null,fieldAudit:!0},"attribute.remove":{subject:"attribute",existence:"remove",fieldAudit:!0},"operation.add":{subject:"operation",existence:"add",fieldAudit:!0},"operation.update":{subject:"operation",existence:null,fieldAudit:!0},"operation.remove":{subject:"operation",existence:"remove",fieldAudit:!0},"index.add":{subject:"index",existence:"add",fieldAudit:!0},"index.update":{subject:"index",existence:null,fieldAudit:!0},"index.remove":{subject:"index",existence:"remove",fieldAudit:!0},"attribute.reorder":{subject:null,existence:null,fieldAudit:!1,note:"과거 어휘(호스트 지원·lib 미방출). 컬렉션 순서 축이라 subject 단위 필드 변경으로 표현 안 됨"},"operation.reorder":{subject:null,existence:null,fieldAudit:!1,note:"과거 어휘(호스트 지원·lib 미방출). attribute.reorder와 동형"},"association.add":{subject:"association",existence:"add",fieldAudit:!0},"association.update":{subject:"association",existence:null,fieldAudit:!0},"association.remove":{subject:"association",existence:"remove",fieldAudit:!0},"associationEnd.update":{subject:"associationEnd",existence:null,fieldAudit:!0},"group.add":{subject:"group",existence:"add",fieldAudit:!0},"group.update":{subject:"group",existence:null,fieldAudit:!0},"group.remove":{subject:"group",existence:"remove",fieldAudit:!0},"group.addMember":{subject:"group",existence:null,fieldAudit:!0},"group.removeMember":{subject:"group",existence:null,fieldAudit:!0},"entityLayout.add":kt,"entityLayout.remove":kt,"entityLayout.move":kt,"entityLayout.resize":kt,"entityLayout.setCollapsed":kt,"entityLayout.setLocked":kt,"entityLayout.setStyle":kt,"entityLayout.setAttrStyle":kt,"entityLayout.setOpStyle":kt,"groupLayout.add":kt,"groupLayout.remove":kt,"groupLayout.move":kt,"groupLayout.resize":kt,"groupLayout.setLocked":kt,"groupLayout.setStyle":kt,"groupLayout.addNoteMember":kt,"groupLayout.removeNoteMember":kt,"associationLayout.add":kt,"associationLayout.remove":kt,"associationLayout.setWaypoints":kt,"note.add":{subject:"note",existence:"add",fieldAudit:!0},"note.remove":{subject:"note",existence:"remove",fieldAudit:!0},"note.setMemo":{subject:"note",existence:null,fieldAudit:!0},"note.move":Ba,"note.resize":Ba,"note.setStyle":Ba,"noteConnection.add":{subject:"note",existence:null,fieldAudit:!0},"noteConnection.remove":{subject:"note",existence:null,fieldAudit:!0},"noteConnection.setWaypoints":Ba},Gt=e=>typeof e=="string"?e:void 0,Pk=e=>{var n;return Gt((n=e.value)==null?void 0:n.modelId)};function Eu(e){return Gt(e.containerRef)??Gt(e.entityRef)}function es(e,n,o,i){var l;const a=(l=e.value)==null?void 0:l[n];if(!Array.isArray(a))return[];const r=[];for(const s of a){const c=Gt(s.modelId);c&&r.push({subject:{kind:o,ref:c,...i?{entityRef:i}:{}},existence:"add",inline:!0})}return r}function Da(e){const n=Ok[e.kind];if(!n||!n.subject)return[];const o=e,i=n.existence??void 0;switch(n.subject){case"entity":{const a=Gt(o.entityRef);if(!a)return[];const r={subject:{kind:"entity",ref:a},...i?{existence:i}:{}};return e.kind!=="entity.add"?[r]:[r,...es(o,"attributes","attribute",a),...es(o,"operations","operation",a),...es(o,"indexes","index",a)]}case"attribute":case"operation":case"index":{const a=n.subject,r=Eu(o),l={attribute:"attributeRef",operation:"operationRef",index:"indexRef"}[a],s=i==="add"?Pk(o):Gt(o[l]);return s?[{subject:{kind:a,ref:s,...r?{entityRef:r}:{}},...i?{existence:i}:{}}]:[]}case"association":case"associationEnd":{const a=Gt(o.associationRef);if(!a)return[];const r=o.end==="end1"||o.end==="end2"?o.end:void 0;return[{subject:{kind:n.subject,ref:a,...r?{end:r}:{}},...i?{existence:i}:{}}]}case"group":{const a=Gt(o.groupRef);return a?[{subject:{kind:"group",ref:a},...i?{existence:i}:{}}]:[]}case"note":{const a=Gt(o.noteRef);return a?[{subject:{kind:"note",ref:a},...i?{existence:i}:{}}]:[]}}}function zk(e){const n=e,o=e.kind;if(o.startsWith("entity.")){const i=Gt(n.entityRef);return i?{kind:"entity",ref:i}:null}if(o.startsWith("attribute.")||o.startsWith("operation.")||o.startsWith("index.")){const i=Eu(n);return i?{kind:"entity",ref:i}:null}if(o.startsWith("associationEnd.")||o.startsWith("association.")){const i=Gt(n.associationRef);return i?{kind:"association",ref:i}:null}if(o.startsWith("group.")){const i=Gt(n.groupRef);return i?{kind:"group",ref:i}:null}if(o.startsWith("note.")||o.startsWith("noteConnection.")){const i=Gt(n.noteRef);return i?{kind:"note",ref:i}:null}return null}function Fk(e,n){const o=e;return o.entityRef===n||o.containerRef===n}function Uk(e,n){const o=new Set,i=new Set,a=new Set,r={attribute:o,operation:i,index:a};for(const l of e)for(const s of l.ops)for(const{subject:c}of Da(s))c.kind==="entity"||c.entityRef!==n||c.kind in r&&r[c.kind].add(c.ref);return{attributes:o,operations:i,indexes:a}}function Oa(e,n){return e.map(o=>({...o,subject:n}))}function Nu(e,n){const o=e.filter(s=>s.ops.some(c=>Fk(c,n))),{attributes:i,operations:a,indexes:r}=Uk(o,n),l=[...Oa(Tn(o,{entityRef:n}),{kind:"entity",ref:n})];for(const s of i)l.push(...Oa(Tn(o,{entityRef:n,attributeRef:s}),{kind:"attribute",ref:s}));for(const s of a)l.push(...Oa(Tn(o,{entityRef:n,operationRef:s}),{kind:"operation",ref:s}));for(const s of r)l.push(...Oa(Tn(o,{entityRef:n,indexRef:s}),{kind:"index",ref:s}));return l.map((s,c)=>({e:s,i:c})).sort((s,c)=>s.e.seq-c.e.seq||s.i-c.i).map(({e:s})=>s)}function Pa(e){return`${e.kind}:${e.ref}:${e.end??""}`}function Hk(e){const n=new Set;for(const o of e)for(const i of o.ops)for(const a of Da(i))a.existence==="add"&&n.add(Pa(a.subject));return n}function jk(e){const n=new Map;for(const o of e)for(const i of o.ops)for(const a of Da(i)){if(a.existence!=="remove")continue;let r=n.get(o.seq);r||(r=new Map,n.set(o.seq,r)),r.set(Pa(a.subject),a.subject)}return n}function Kk(e){const n=new Set,o=new Set,i=new Set,a=new Set,r={entity:n,association:o,group:i,note:a};for(const l of e)for(const s of l.ops){const c=zk(s);c&&r[c.kind].add(c.ref)}return{entities:n,associations:o,groups:i,notes:a}}function Gk(e){const{entities:n,associations:o,groups:i,notes:a}=Kk(e),r=[];for(const l of n)for(const s of Nu(e,l))r.push({...s,subject:{...s.subject,entityRef:l}});for(const l of o){for(const s of Tn(e,{associationRef:l}))r.push({...s,subject:{kind:"association",ref:l}});for(const s of["end1","end2"])for(const c of Tn(e,{associationRef:l,end:s}))r.push({...c,subject:{kind:"associationEnd",ref:l,end:s}})}for(const l of i)for(const s of Tn(e,{groupRef:l}))r.push({...s,subject:{kind:"group",ref:l}});for(const l of a)for(const s of Tn(e,{noteRef:l}))r.push({...s,subject:{kind:"note",ref:l}});return r}function ts(e){const n=Gk(e),o=Hk(e),i=jk(e),a=(c,d)=>{var u;return((u=i.get(c))==null?void 0:u.has(d))===!0},r=new Map;for(const c of n){const d=Pa(c.subject),u=r.get(d);(u===void 0||c.seq<u)&&r.set(d,c.seq)}const l=new Map;for(const c of n){let d=l.get(c.seq);d||(d={meta:c,subjects:new Map},l.set(c.seq,d));const u=Pa(c.subject),m=a(c.seq,u);let f=d.subjects.get(u);if(!f){const p=m?"remove":r.get(u)===c.seq&&o.has(u)?"add":"update";f={subject:c.subject,verb:p,fields:[]},d.subjects.set(u,f)}m&&c.removed||f.fields.push({field:c.field,value:c.value,...c.oldValue!==void 0?{oldValue:c.oldValue}:{},...c.removed?{removed:!0}:{}})}for(const c of e){const d=i.get(c.seq);if(!d)continue;let u=l.get(c.seq);u||(u={meta:c,subjects:new Map},l.set(c.seq,u));for(const[m,f]of d){const p=u.subjects.get(m),y=f.kind==="entity"?{...f,entityRef:f.ref}:f;p?p.verb="remove":u.subjects.set(m,{subject:y,verb:"remove",fields:[]})}}const s=[];for(const[c,d]of l){const u=d.meta;s.push({seq:c,...u.ts!==void 0?{ts:u.ts}:{},...u.origin!==void 0?{origin:u.origin}:{},...u.author!==void 0?{author:u.author}:{},...u.kind!==void 0?{kind:u.kind}:{},...u.restoredFromSeq!==void 0?{restoredFromSeq:u.restoredFromSeq}:{},actions:[...d.subjects.values()]})}return s.sort((c,d)=>d.seq-c.seq)}function wu(e){return`${e.kind}:${e.ref}:${e.end??""}`}function Yk(e,n,o){const i=[];for(const a of e)if(!(a.seq<=n||a.seq>o))for(const r of a.ops)for(const l of Da(r)){if(!l.existence||l.inline)continue;const s=l.subject;qk.has(s.kind)&&!s.entityRef||i.push({seq:a.seq,subject:s,verb:l.existence,fields:[]})}return i}const qk=new Set(["attribute","operation","index"]);function ns(e,n){const{fromSeq:o}=n,i=ts(e);let a=o;for(const m of e)m.seq>a&&(a=m.seq);const r=n.toSeq??a,l=i.filter(m=>m.seq>o&&m.seq<=r).reverse(),s=new Map,c=m=>{const f=wu(m.subject);let p=s.get(f);p||(p={subject:m.subject,evs:[]},s.set(f,p)),p.evs.push(m)};for(const m of l)for(const f of m.actions)c({seq:m.seq,subject:f.subject,verb:f.verb,fields:f.fields});for(const m of Yk(e,o,r)){const f=s.get(wu(m.subject));f!=null&&f.evs.some(p=>p.seq===m.seq)||c(m)}const d=[],u=new Set;for(const m of s.values()){m.evs.sort((p,y)=>p.seq-y.seq);const f=m.evs[m.evs.length-1];m.subject.kind==="entity"&&f.verb==="remove"&&u.add(m.subject.ref)}for(const m of s.values()){const f=m.evs[0].verb==="add",p=m.evs[m.evs.length-1].verb==="remove";if(m.subject.kind!=="entity"&&m.subject.entityRef&&u.has(m.subject.entityRef)||f&&p)continue;const y=new Map;let g=null;for(const k of m.evs){k.verb==="add"&&g!==null&&g!=="add"&&y.clear(),g=k.verb;for(const _ of k.fields){const h=y.get(_.field);h?h.lastValue=_.value:y.set(_.field,{firstOld:_.oldValue,hasOld:_.oldValue!==void 0,lastValue:_.value})}}if(p){d.push({subject:m.subject,verb:"removed",fields:[]});continue}if(f){const k=[];for(const[_,h]of y)k.push({field:_,value:h.lastValue});d.push({subject:m.subject,verb:"added",fields:k});continue}const b=[];for(const[k,_]of y)_.hasOld&&_o(_.firstOld,_.lastValue)||b.push({field:k,value:_.lastValue,..._.hasOld?{oldValue:_.firstOld}:{}});b.length!==0&&d.push({subject:m.subject,verb:"modified",fields:b})}return{fromSeq:o,toSeq:r,entries:d}}function Iu(e){const n=new Map,o=i=>{let a=n.get(i);return a||(a={verb:"modified",changedAttributeIds:new Set,changedOperationIds:new Set},n.set(i,a)),a};for(const i of e.entries){const a=i.subject;if(a.kind==="entity"){if(i.verb==="removed")continue;o(a.ref).verb=i.verb}else if((a.kind==="attribute"||a.kind==="operation"||a.kind==="index")&&a.entityRef){const r=o(a.entityRef);i.verb!=="removed"&&(a.kind==="attribute"?r.changedAttributeIds.add(a.ref):a.kind==="operation"&&r.changedOperationIds.add(a.ref))}}return n}class os{constructor(n){st(this,"undoStack",[]);st(this,"redoStack",[]);st(this,"savePoint",null);st(this,"listeners",new Set);st(this,"commandListeners",new Set);st(this,"coalesceSealed",!1);this.state=n}execute(n){n.apply(this.state);const o=this.undoStack.at(-1),i=!this.coalesceSealed&&n.coalesceKey!=null&&!!o&&o.coalesceKey===n.coalesceKey;this.coalesceSealed=!1,i?(n.invert=o.invert,this.undoStack[this.undoStack.length-1]=n):this.undoStack.push(n),this.redoStack=[],this.emitCommand(n,"do",i),this.emit()}undo(){const n=this.undoStack.pop();n&&(n.invert(this.state),this.redoStack.push(n),this.emitCommand(n,"undo",!1),this.emit())}redo(){const n=this.redoStack.pop();n&&(n.apply(this.state),this.undoStack.push(n),this.emitCommand(n,"redo",!1),this.emit())}sealCoalesce(){this.coalesceSealed=!0}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}markSavePoint(){this.savePoint=this.undoStack.at(-1)??null,this.sealCoalesce(),this.emit()}get isDirty(){return(this.undoStack.at(-1)??null)!==this.savePoint}onChange(n){return this.listeners.add(n),()=>this.listeners.delete(n)}onCommand(n){return this.commandListeners.add(n),()=>this.commandListeners.delete(n)}emit(){for(const n of this.listeners)n()}emitCommand(n,o,i){for(const a of this.commandListeners)a(n,o,i)}}function Ft(e){const n={};for(const[o,i]of Object.entries(e))n[o]=i===void 0?null:i;return n}function vu(e,n){var r,l;const o={logical:structuredClone(e.logical),layout:structuredClone(e.layout)},i=[],a=[];for(const s of n){s.apply(o);const c=((l=(r=s.emitOps)==null?void 0:r.call(s,o))==null?void 0:l.forward)??[];c.length===0&&a.push(s.label),i.push(...c)}return{ops:i,skipped:a}}function Cu(e,n){return e.logical.entities.findIndex(o=>o.modelId===n)}function It(e,n){return e.layout.entityLayouts.findIndex(o=>o.entityRef===n)}function tn(e,n){return e.layout.associationLayouts.find(o=>o.associationRef===n)}function dt(e,n){const o=e.logical.entities.find(i=>i.modelId===n);if(!o)throw new Error(`엔티티 없음: ${n}`);return o}function Mn(e,n,o){var i,a;return(a=(i=e.layout.notes.find(r=>r.modelId===n))==null?void 0:i.connections)==null?void 0:a.find(r=>r.targetRef===o)}function za(e,n,o){return{label:`엔티티 추가: ${e.name}`,apply(i){i.logical.entities.push(e),i.layout.entityLayouts.push({entityRef:e.modelId,geo:n,...o})},invert(i){const a=Cu(i,e.modelId);a>=0&&i.logical.entities.splice(a,1);const r=It(i,e.modelId);r>=0&&i.layout.entityLayouts.splice(r,1)},emitOps(){const i={kind:"entity.add",casUnit:"logical",entityRef:e.modelId,value:e},a={kind:"entityLayout.add",casUnit:"layout",entityRef:e.modelId,value:{entityRef:e.modelId,geo:n,...o},incidental:!0};return{forward:[i,a],invert:[{kind:"entityLayout.remove",casUnit:"layout",entityRef:e.modelId,incidental:!0},{kind:"entity.remove",casUnit:"logical",entityRef:e.modelId}]}}}}function Su(e){let n=null;const o=i=>i.end1.entityRef===e||i.end2.entityRef===e;return{label:"엔티티 삭제",apply(i){const a=Cu(i,e);if(a<0)throw new Error(`엔티티 없음: ${e}`);const r=It(i,e),l=[];i.logical.associations.forEach((u,m)=>{o(u)&&l.push({item:u,index:m})});const s=new Set(l.map(u=>u.item.modelId)),c=[];i.layout.associationLayouts.forEach((u,m)=>{s.has(u.associationRef)&&c.push({item:u,index:m})});const d=[];i.logical.groups.forEach(u=>{const m=u.memberEntityRefs.indexOf(e);m>=0&&d.push({groupId:u.modelId,index:m})}),n={entity:{item:i.logical.entities[a],index:a},entityLayout:r>=0?{item:i.layout.entityLayouts[r],index:r}:void 0,assocs:l,assocLayouts:c,groupMemberships:d},[...c].sort((u,m)=>m.index-u.index).forEach(u=>i.layout.associationLayouts.splice(u.index,1)),[...l].sort((u,m)=>m.index-u.index).forEach(u=>i.logical.associations.splice(u.index,1));for(const u of d){const m=i.logical.groups.find(f=>f.modelId===u.groupId);m==null||m.memberEntityRefs.splice(u.index,1)}r>=0&&i.layout.entityLayouts.splice(r,1),i.logical.entities.splice(a,1)},invert(i){if(n){i.logical.entities.splice(n.entity.index,0,n.entity.item),n.entityLayout&&i.layout.entityLayouts.splice(n.entityLayout.index,0,n.entityLayout.item),[...n.assocs].sort((a,r)=>a.index-r.index).forEach(a=>i.logical.associations.splice(a.index,0,a.item)),[...n.assocLayouts].sort((a,r)=>a.index-r.index).forEach(a=>i.layout.associationLayouts.splice(a.index,0,a.item));for(const a of n.groupMemberships){const r=i.logical.groups.find(l=>l.modelId===a.groupId);r==null||r.memberEntityRefs.splice(a.index,0,e)}}},emitOps(){if(!n)return{forward:[],invert:[]};const i=[],a=[];for(const r of n.assocs)i.push({kind:"association.remove",casUnit:"logical",associationRef:r.item.modelId}),a.push({kind:"association.add",casUnit:"logical",associationRef:r.item.modelId,value:r.item});for(const r of n.assocLayouts)i.push({kind:"associationLayout.remove",casUnit:"layout",associationRef:r.item.associationRef,incidental:!0}),a.push({kind:"associationLayout.add",casUnit:"layout",associationRef:r.item.associationRef,value:r.item,incidental:!0});for(const r of n.groupMemberships)i.push({kind:"group.removeMember",casUnit:"logical",containerRef:r.groupId,groupRef:r.groupId,entityRef:e}),a.push({kind:"group.addMember",casUnit:"logical",containerRef:r.groupId,groupRef:r.groupId,entityRef:e});return n.entityLayout&&(i.push({kind:"entityLayout.remove",casUnit:"layout",entityRef:e,incidental:!0}),a.push({kind:"entityLayout.add",casUnit:"layout",entityRef:e,value:n.entityLayout.item,incidental:!0})),i.push({kind:"entity.remove",casUnit:"logical",entityRef:e}),a.push({kind:"entity.add",casUnit:"logical",entityRef:e,value:n.entity.item}),{forward:i,invert:a.reverse()}}}}function Fa(e,n){const o={};return{label:"엔티티 수정",apply(i){const a=dt(i,e);for(const r of Object.keys(n))o[r]=a[r];Object.assign(a,n)},invert(i){Object.assign(dt(i,e),o)},emitOps(){return{forward:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:Ft(n)}],invert:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:Ft(o)}]}}}}function Ru(e,n){let o="";return{label:`엔티티 이름 변경: ${n}`,apply(i){const a=dt(i,e);o=a.name,a.name=n},invert(i){dt(i,e).name=o},emitOps(){return{forward:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:{name:n}}],invert:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:{name:o}}]}}}}function Qo(e,n){let o=null;return{label:"엔티티 이동",apply(i){const a=It(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a].geo;o={...r.location},r.location={...n}},invert(i){const a=It(i,e);a>=0&&o&&(i.layout.entityLayouts[a].geo.location=o)},emitOps(){const i=a=>({kind:"entityLayout.move",casUnit:"layout",entityRef:e,value:{location:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function Au(e,n){let o=null;return{label:"엔티티 크기 변경",apply(i){const a=It(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a].geo;o={...r.size},r.size={...n}},invert(i){const a=It(i,e);a>=0&&o&&(i.layout.entityLayouts[a].geo.size=o)},emitOps(){const i=a=>({kind:"entityLayout.resize",casUnit:"layout",entityRef:e,value:{size:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function Ti(e,n){const o={...(e==null?void 0:e.properties)??{}};return n?o.swatch=n:delete o.swatch,Object.keys(o).length?{properties:o}:void 0}function xu(e,n){let o;return{label:"엔티티 색상 변경",apply(i){const a=It(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.style,r.style=Ti(r.style,n)},invert(i){const a=It(i,e);a>=0&&(i.layout.entityLayouts[a].style=o)},emitOps(i){const a=It(i,e),r=a>=0?i.layout.entityLayouts[a].style:void 0,l=s=>({kind:"entityLayout.setStyle",casUnit:"layout",entityRef:e,value:{style:s}});return{forward:[l(r)],invert:[l(o)]}}}}function $u(e,n){let o;return{label:n?"엔티티 접기":"엔티티 펼치기",apply(i){const a=It(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.collapsed,r.collapsed=n},invert(i){const a=It(i,e);a>=0&&(i.layout.entityLayouts[a].collapsed=o)},emitOps(){const i=a=>({kind:"entityLayout.setCollapsed",casUnit:"layout",entityRef:e,value:{collapsed:a}});return{forward:[i(n)],invert:[i(o)]}}}}function Tu(e,n){let o;return{label:n?"엔티티 잠금":"엔티티 잠금 해제",apply(i){const a=It(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.locked,r.locked=n},invert(i){const a=It(i,e);a>=0&&(i.layout.entityLayouts[a].locked=o)},emitOps(){const i=a=>({kind:"entityLayout.setLocked",casUnit:"layout",entityRef:e,value:{locked:a}});return{forward:[i(n)],invert:[i(o)]}}}}function is(e){let n=[];return{label:e?"모두 접기":"모두 펼치기",apply(o){n=o.layout.entityLayouts.map(i=>i.collapsed);for(const i of o.layout.entityLayouts)i.collapsed=e},invert(o){o.layout.entityLayouts.forEach((i,a)=>{i.collapsed=n[a]})},emitOps(o){const i=[],a=[];return o.layout.entityLayouts.forEach((r,l)=>{i.push({kind:"entityLayout.setCollapsed",casUnit:"layout",entityRef:r.entityRef,value:{collapsed:e}}),a.push({kind:"entityLayout.setCollapsed",casUnit:"layout",entityRef:r.entityRef,value:{collapsed:n[l]}})}),{forward:i,invert:a}}}}function Ua(e,n,o){let i;return{label:"속성 색상 변경",apply(a){const r=It(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.attributeStyles;const s={...l.attributeStyles},c=Ti(s[n],o);c?s[n]=c:delete s[n],l.attributeStyles=Object.keys(s).length?s:void 0},invert(a){const r=It(a,e);r>=0&&(a.layout.entityLayouts[r].attributeStyles=i)},emitOps(a){const r=It(a,e),l=r>=0?a.layout.entityLayouts[r].attributeStyles:void 0,s=c=>({kind:"entityLayout.setAttrStyle",casUnit:"layout",entityRef:e,value:{attributeStyles:c}});return{forward:[s(l)],invert:[s(i)]}}}}function Ha(e,n,o){return{label:"그룹 추가",apply(i){i.logical.groups.push(e),i.layout.groupLayouts.push({groupRef:e.modelId,geo:n,...o})},invert(i){const a=i.logical.groups.findIndex(l=>l.modelId===e.modelId);a>=0&&i.logical.groups.splice(a,1);const r=i.layout.groupLayouts.findIndex(l=>l.groupRef===e.modelId);r>=0&&i.layout.groupLayouts.splice(r,1)},emitOps(){const i={kind:"group.add",casUnit:"logical",groupRef:e.modelId,value:e},a={kind:"groupLayout.add",casUnit:"layout",groupRef:e.modelId,value:{groupRef:e.modelId,geo:n,...o},incidental:!0};return{forward:[i,a],invert:[{kind:"groupLayout.remove",casUnit:"layout",groupRef:e.modelId,incidental:!0},{kind:"group.remove",casUnit:"logical",groupRef:e.modelId}]}}}}function Mu(e,n){const o={},i=a=>{const r=a.logical.groups.find(l=>l.modelId===e);if(!r)throw new Error(`그룹 없음: ${e}`);return r};return{label:"그룹 수정",apply(a){const r=i(a);for(const l of Object.keys(n))o[l]=r[l];Object.assign(r,n)},invert(a){Object.assign(i(a),o)},emitOps(){return{forward:[{kind:"group.update",casUnit:"logical",containerRef:e,groupRef:e,patch:Ft(n)}],invert:[{kind:"group.update",casUnit:"logical",containerRef:e,groupRef:e,patch:Ft(o)}]}}}}function Vu(e){let n=null;return{label:"그룹 해제",apply(o){const i=o.logical.groups.findIndex(r=>r.modelId===e);if(i<0)throw new Error(`그룹 없음: ${e}`);const a=o.layout.groupLayouts.findIndex(r=>r.groupRef===e);n={group:{item:o.logical.groups[i],index:i},layout:a>=0?{item:o.layout.groupLayouts[a],index:a}:void 0},a>=0&&o.layout.groupLayouts.splice(a,1),o.logical.groups.splice(i,1)},invert(o){n&&(o.logical.groups.splice(n.group.index,0,n.group.item),n.layout&&o.layout.groupLayouts.splice(n.layout.index,0,n.layout.item))},emitOps(){if(!n)return{forward:[],invert:[]};const o=[],i=[];return n.layout&&(o.push({kind:"groupLayout.remove",casUnit:"layout",groupRef:e,incidental:!0}),i.push({kind:"groupLayout.add",casUnit:"layout",groupRef:e,value:n.layout.item,incidental:!0})),o.push({kind:"group.remove",casUnit:"logical",groupRef:e}),i.push({kind:"group.add",casUnit:"logical",groupRef:e,value:n.group.item}),{forward:o,invert:i.reverse()}}}}function Lu(e,n){let o=!1;const i=a=>a.logical.groups.find(r=>r.modelId===e);return{label:"그룹에 편입",apply(a){const r=i(a);r&&!r.memberEntityRefs.includes(n)&&(r.memberEntityRefs.push(n),o=!0)},invert(a){if(!o)return;const r=i(a),l=(r==null?void 0:r.memberEntityRefs.indexOf(n))??-1;l>=0&&r.memberEntityRefs.splice(l,1)},emitOps(){return o?{forward:[{kind:"group.addMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:n}],invert:[{kind:"group.removeMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:n}]}:{forward:[],invert:[]}}}}function ja(e,n){let o=-1;const i=a=>a.logical.groups.find(r=>r.modelId===e);return{label:"그룹에서 제외",apply(a){const r=i(a);o=(r==null?void 0:r.memberEntityRefs.indexOf(n))??-1,o>=0&&r.memberEntityRefs.splice(o,1)},invert(a){var r;o<0||(r=i(a))==null||r.memberEntityRefs.splice(o,0,n)},emitOps(){return o<0?{forward:[],invert:[]}:{forward:[{kind:"group.removeMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:n}],invert:[{kind:"group.addMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:n}]}}}}function Bu(e,n){let o=null;return{label:"그룹 이동",apply(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o={...a.geo.location},a.geo.location={...n}},invert(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);a&&o&&(a.geo.location=o)},emitOps(){const i=a=>({kind:"groupLayout.move",casUnit:"layout",groupRef:e,value:{location:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function Du(e,n){let o=null;return{label:"그룹 크기 변경",apply(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o={...a.geo.size},a.geo.size={...n}},invert(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);a&&o&&(a.geo.size=o)},emitOps(){const i=a=>({kind:"groupLayout.resize",casUnit:"layout",groupRef:e,value:{size:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function Ou(e,n){let o;return{label:"그룹 색상 변경",apply(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o=a.style,a.style=Ti(a.style,n)},invert(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);a&&(a.style=o)},emitOps(i){const a=i.layout.groupLayouts.find(l=>l.groupRef===e),r=l=>({kind:"groupLayout.setStyle",casUnit:"layout",groupRef:e,value:{style:l}});return{forward:[r(a==null?void 0:a.style)],invert:[r(o)]}}}}function Pu(e,n){let o;return{label:n?"그룹 잠금":"그룹 잠금 해제",apply(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o=a.locked,a.locked=n},invert(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);a&&(a.locked=o)},emitOps(){const i=a=>({kind:"groupLayout.setLocked",casUnit:"layout",groupRef:e,value:{locked:a}});return{forward:[i(n)],invert:[i(o)]}}}}function Xt(e,n){return{label:`속성 추가: ${n.name}`,apply(o){dt(o,e).attributes.push(n)},invert(o){const i=dt(o,e),a=i.attributes.findIndex(r=>r.modelId===n.modelId);a>=0&&i.attributes.splice(a,1)},emitOps(){return{forward:[{kind:"attribute.add",casUnit:"logical",containerRef:e,entityRef:e,value:n}],invert:[{kind:"attribute.remove",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:n.modelId}]}}}}function nn(e,n,o){const i={},a=r=>{const l=dt(r,e).attributes.find(s=>s.modelId===n);if(!l)throw new Error(`속성 없음: ${n}`);return l};return{label:"속성 수정",apply(r){const l=a(r);for(const s of Object.keys(o))i[s]=l[s];Object.assign(l,o)},invert(r){Object.assign(a(r),i)},emitOps(){return{forward:[{kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:n,patch:Ft(o)}],invert:[{kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:n,patch:Ft(i)}]}}}}function zu(e,n){let o=null;return{label:"속성 삭제",apply(i){const a=dt(i,e),r=a.attributes.findIndex(l=>l.modelId===n);if(r<0)throw new Error(`속성 없음: ${n}`);o={item:a.attributes[r],index:r},a.attributes.splice(r,1)},invert(i){o&&dt(i,e).attributes.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"attribute.remove",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:n}],invert:[{kind:"attribute.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}function Fu(e,n,o,i,a){const r=new Map(a.map(c=>[c.modelId,c.order])),l=[],s=[];for(const c of i){const d=r.get(c.modelId);if(d===c.order)continue;const u=n==="attributeRef"?{attributeRef:c.modelId}:{operationRef:c.modelId};l.push({kind:e,casUnit:"logical",containerRef:o,entityRef:o,...u,patch:{order:c.order}}),s.push({kind:e,casUnit:"logical",containerRef:o,entityRef:o,...u,patch:{order:d??c.order}})}return{forward:l,invert:s}}function as(e,n,o){let i=null;return{label:"속성 재정렬",apply(a){const r=dt(a,e);i=r.attributes.map(s=>({...s}));const l=Jl([...r.attributes].sort((s,c)=>s.order-c.order),n,o);r.attributes.splice(0,r.attributes.length,...l),r.attributes.forEach((s,c)=>s.order=c)},invert(a){i&&dt(a,e).attributes.splice(0,1/0,...i)},emitOps(a){const r=dt(a,e).attributes;return Fu("attribute.update","attributeRef",e,r,i??[])}}}function Uu(e,n){let o=!1;return{label:`메서드 추가: ${n.name}`,apply(i){const a=dt(i,e);a.operations||(a.operations=[],o=!0),a.operations.push(n)},invert(i){var l;const a=dt(i,e),r=((l=a.operations)==null?void 0:l.findIndex(s=>s.modelId===n.modelId))??-1;r>=0&&a.operations.splice(r,1),o&&a.operations&&a.operations.length===0&&(a.operations=void 0)},emitOps(){return{forward:[{kind:"operation.add",casUnit:"logical",containerRef:e,entityRef:e,value:n}],invert:[{kind:"operation.remove",casUnit:"logical",containerRef:e,entityRef:e,operationRef:n.modelId}]}}}}function Hu(e,n,o){const i={},a=r=>{var s;const l=(s=dt(r,e).operations)==null?void 0:s.find(c=>c.modelId===n);if(!l)throw new Error(`메서드 없음: ${n}`);return l};return{label:"메서드 수정",apply(r){const l=a(r);for(const s of Object.keys(o))i[s]=l[s];Object.assign(l,o)},invert(r){Object.assign(a(r),i)},emitOps(){return{forward:[{kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:n,patch:Ft(o)}],invert:[{kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:n,patch:Ft(i)}]}}}}function ju(e,n){let o=null;return{label:"메서드 삭제",apply(i){var s;const a=dt(i,e),r=((s=a.operations)==null?void 0:s.findIndex(c=>c.modelId===n))??-1;if(r<0)throw new Error(`메서드 없음: ${n}`);const l=a.operations.length===1;o={item:a.operations[r],index:r,wasSole:l},a.operations.splice(r,1),l&&(a.operations=void 0)},invert(i){if(!o)return;const a=dt(i,e);a.operations||(a.operations=[]),a.operations.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"operation.remove",casUnit:"logical",containerRef:e,entityRef:e,operationRef:n}],invert:[{kind:"operation.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}function Ku(e,n,o){let i=null;return{label:"메서드 재정렬",apply(a){const r=dt(a,e),l=r.operations??[];i=l.map(c=>({...c}));const s=Jl([...l].sort((c,d)=>c.order-d.order),n,o);l.splice(0,l.length,...s),l.forEach((c,d)=>c.order=d),r.operations=l},invert(a){if(!i)return;const r=dt(a,e);r.operations&&r.operations.splice(0,1/0,...i)},emitOps(a){const r=dt(a,e).operations??[];return Fu("operation.update","operationRef",e,r,i??[])}}}function Gu(e,n,o){let i;return{label:"메서드 색상 변경",apply(a){const r=It(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.operationStyles;const s={...l.operationStyles},c=Ti(s[n],o);c?s[n]=c:delete s[n],l.operationStyles=Object.keys(s).length?s:void 0},invert(a){const r=It(a,e);r>=0&&(a.layout.entityLayouts[r].operationStyles=i)},emitOps(a){const r=It(a,e),l=r>=0?a.layout.entityLayouts[r].operationStyles:void 0,s=c=>({kind:"entityLayout.setOpStyle",casUnit:"layout",entityRef:e,value:{operationStyles:c}});return{forward:[s(l)],invert:[s(i)]}}}}function Ka(e,n){return{label:"관계 추가",apply(o){o.logical.associations.push(e),o.layout.associationLayouts.push(n)},invert(o){const i=o.logical.associations.findIndex(r=>r.modelId===e.modelId);i>=0&&o.logical.associations.splice(i,1);const a=o.layout.associationLayouts.findIndex(r=>r.associationRef===e.modelId);a>=0&&o.layout.associationLayouts.splice(a,1)},emitOps(){const o={kind:"association.add",casUnit:"logical",associationRef:e.modelId,value:e},i={kind:"associationLayout.add",casUnit:"layout",associationRef:e.modelId,value:n,incidental:!0};return{forward:[o,i],invert:[{kind:"associationLayout.remove",casUnit:"layout",associationRef:e.modelId,incidental:!0},{kind:"association.remove",casUnit:"logical",associationRef:e.modelId}]}}}}function Yu(e){let n=null;return{label:"관계 삭제",apply(o){const i=o.logical.associations.findIndex(r=>r.modelId===e);if(i<0)throw new Error(`관계 없음: ${e}`);const a=o.layout.associationLayouts.findIndex(r=>r.associationRef===e);n={assoc:{item:o.logical.associations[i],index:i},layout:a>=0?{item:o.layout.associationLayouts[a],index:a}:void 0},a>=0&&o.layout.associationLayouts.splice(a,1),o.logical.associations.splice(i,1)},invert(o){n&&(o.logical.associations.splice(n.assoc.index,0,n.assoc.item),n.layout&&o.layout.associationLayouts.splice(n.layout.index,0,n.layout.item))},emitOps(){if(!n)return{forward:[],invert:[]};const o=[],i=[];return n.layout&&(o.push({kind:"associationLayout.remove",casUnit:"layout",associationRef:e,incidental:!0}),i.push({kind:"associationLayout.add",casUnit:"layout",associationRef:e,value:n.layout.item,incidental:!0})),o.push({kind:"association.remove",casUnit:"logical",associationRef:e}),i.push({kind:"association.add",casUnit:"logical",associationRef:e,value:n.assoc.item}),{forward:o,invert:i.reverse()}}}}function Ga(e,n){const o={},i=a=>{const r=a.logical.associations.find(l=>l.modelId===e);if(!r)throw new Error(`관계 없음: ${e}`);return r};return{label:"관계 수정",apply(a){const r=i(a);for(const l of Object.keys(n))o[l]=r[l];Object.assign(r,n)},invert(a){Object.assign(i(a),o)},emitOps(){return{forward:[{kind:"association.update",casUnit:"logical",containerRef:e,associationRef:e,patch:Ft(n)}],invert:[{kind:"association.update",casUnit:"logical",containerRef:e,associationRef:e,patch:Ft(o)}]}}}}function on(e,n,o){const i={},a=r=>{const l=r.logical.associations.find(s=>s.modelId===e);if(!l)throw new Error(`관계 없음: ${e}`);return l[n]};return{label:"관계 수정",apply(r){const l=a(r);for(const s of Object.keys(o))i[s]=l[s];Object.assign(l,o)},invert(r){Object.assign(a(r),i)},emitOps(){return{forward:[{kind:"associationEnd.update",casUnit:"logical",containerRef:e,associationRef:e,end:n,patch:Ft(o)}],invert:[{kind:"associationEnd.update",casUnit:"logical",containerRef:e,associationRef:e,end:n,patch:Ft(i)}]}}}}function qu(e,n){return{label:"인덱스 추가",apply(o){const i=dt(o,e);(i.indexes??(i.indexes=[])).push(n)},invert(o){var r;const i=dt(o,e),a=((r=i.indexes)==null?void 0:r.findIndex(l=>l.modelId===n.modelId))??-1;a>=0&&i.indexes.splice(a,1)},emitOps(){return{forward:[{kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:n}],invert:[{kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:n.modelId}]}}}}function Ya(e,n,o){const i={},a=r=>{var s;const l=(s=dt(r,e).indexes)==null?void 0:s.find(c=>c.modelId===n);if(!l)throw new Error(`인덱스 없음: ${n}`);return l};return{label:"인덱스 수정",apply(r){const l=a(r);for(const s of Object.keys(o))i[s]=l[s];Object.assign(l,o)},invert(r){Object.assign(a(r),i)},emitOps(){return{forward:[{kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:n,patch:Ft(o)}],invert:[{kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:n,patch:Ft(i)}]}}}}function Wu(e,n){let o=null;return{label:"인덱스 삭제",apply(i){var l;const a=dt(i,e),r=((l=a.indexes)==null?void 0:l.findIndex(s=>s.modelId===n))??-1;if(r<0)throw new Error(`인덱스 없음: ${n}`);o={item:a.indexes[r],index:r},a.indexes.splice(r,1)},invert(i){o&&dt(i,e).indexes.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:n}],invert:[{kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}const hn=(e,n)=>({kind:"associationLayout.setWaypoints",casUnit:"layout",associationRef:e,value:{waypoints:n}}),Mi=(e,n)=>{var o;return((o=tn(e,n))==null?void 0:o.waypoints.map(i=>({...i})))??[]};function Ju(e,n,o){let i=null;return{label:"waypoint 이동",coalesceKey:`waypoint:${e}`,apply(a){const r=tn(a,e);if(!r||!r.waypoints[n])throw new Error(`waypoint 없음: ${e}[${n}]`);i={...r.waypoints[n]},r.waypoints.splice(n,1,{...o})},invert(a){const r=tn(a,e);r&&i&&r.waypoints.splice(n,1,i)},emitOps(a){const r=Mi(a,e),l=r.map((s,c)=>c===n&&i?{...i}:s);return{forward:[hn(e,r)],invert:[hn(e,l)]}}}}function Xu(e,n){let o=null;return{label:"waypoint 제거",apply(i){const a=tn(i,e);if(!a||!a.waypoints[n])throw new Error(`waypoint 없음: ${e}[${n}]`);o={...a.waypoints[n]},a.waypoints.splice(n,1)},invert(i){const a=tn(i,e);a&&o&&a.waypoints.splice(n,0,o)},emitOps(i){const a=Mi(i,e),r=a.slice();return o&&r.splice(n,0,{...o}),{forward:[hn(e,a)],invert:[hn(e,r)]}}}}function Zu(e,n,o){let i=null;return{label:"waypoint 평행이동",apply(a){const r=tn(a,e);if(!r)throw new Error(`관계 레이아웃 없음: ${e}`);i=r.waypoints.map(l=>({...l})),r.waypoints=i.map(l=>({x:l.x+n,y:l.y+o}))},invert(a){const r=tn(a,e);r&&i&&(r.waypoints=i)},emitOps(a){return{forward:[hn(e,Mi(a,e))],invert:[hn(e,i??[])]}}}}function Qu(e){let n=null;return{label:"꺾은선 풀기",apply(o){const i=tn(o,e);if(!i)throw new Error(`관계 레이아웃 없음: ${e}`);n=i.waypoints.map(a=>({...a})),i.waypoints=[]},invert(o){const i=tn(o,e);i&&n&&(i.waypoints=n)},emitOps(o){return{forward:[hn(e,Mi(o,e))],invert:[hn(e,n??[])]}}}}function em(e,n,o){return{label:"waypoint 추가",apply(i){const a=tn(i,e);if(!a)throw new Error(`관계 레이아웃 없음: ${e}`);a.waypoints.splice(n,0,{...o})},invert(i){const a=tn(i,e);a==null||a.waypoints.splice(n,1)},emitOps(i){const a=Mi(i,e),r=a.slice();return r.splice(n,1),{forward:[hn(e,a)],invert:[hn(e,r)]}}}}function tm(e){return{label:"노트 추가",apply(n){n.layout.notes.push(e)},invert(n){const o=n.layout.notes.findIndex(i=>i.modelId===e.modelId);o>=0&&n.layout.notes.splice(o,1)},emitOps(){return{forward:[{kind:"note.add",casUnit:"layout",noteRef:e.modelId,value:e}],invert:[{kind:"note.remove",casUnit:"layout",noteRef:e.modelId}]}}}}function nm(e){let n=null,o=null;return{label:"노트 삭제",apply(i){var r;const a=i.layout.notes.findIndex(l=>l.modelId===e);if(a<0)throw new Error(`노트 없음: ${e}`);n={item:i.layout.notes[a],index:a},i.layout.notes.splice(a,1);for(const l of i.layout.groupLayouts){const s=((r=l.memberNoteRefs)==null?void 0:r.indexOf(e))??-1;if(!(s<0)){l.memberNoteRefs.splice(s,1),o={groupRef:l.groupRef,index:s};break}}},invert(i){if(n&&i.layout.notes.splice(n.index,0,n.item),!o)return;const a=i.layout.groupLayouts.find(r=>r.groupRef===o.groupRef);a&&(a.memberNoteRefs||(a.memberNoteRefs=[]),a.memberNoteRefs.splice(o.index,0,e))},emitOps(){if(!n)return{forward:[],invert:[]};const i=[],a=[];return o&&(i.push({kind:"groupLayout.removeNoteMember",casUnit:"layout",groupRef:o.groupRef,noteRef:e,incidental:!0}),a.push({kind:"groupLayout.addNoteMember",casUnit:"layout",groupRef:o.groupRef,noteRef:e,incidental:!0})),i.push({kind:"note.remove",casUnit:"layout",noteRef:e}),a.push({kind:"note.add",casUnit:"layout",noteRef:e,value:n.item}),{forward:i,invert:a.reverse()}}}}function Vi(e,n){let o=null;return{label:"노트 이동",apply(i){const a=i.layout.notes.find(r=>r.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o={...a.geo.location},a.geo.location={...n}},invert(i){const a=i.layout.notes.find(r=>r.modelId===e);a&&o&&(a.geo.location=o)},emitOps(){const i=a=>({kind:"note.move",casUnit:"layout",noteRef:e,value:{location:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function om(e,n){let o=null;return{label:"노트 크기 변경",apply(i){const a=i.layout.notes.find(r=>r.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o={...a.geo.size},a.geo.size={...n}},invert(i){const a=i.layout.notes.find(r=>r.modelId===e);a&&o&&(a.geo.size=o)},emitOps(){const i=a=>({kind:"note.resize",casUnit:"layout",noteRef:e,value:{size:{...a}}});return{forward:[i(n)],invert:[i(o)]}}}}function im(e,n){let o="";return{label:"노트 내용 변경",apply(i){const a=i.layout.notes.find(r=>r.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o=a.memo,a.memo=n},invert(i){const a=i.layout.notes.find(r=>r.modelId===e);a&&(a.memo=o)},emitOps(){const i=a=>({kind:"note.setMemo",casUnit:"layout",noteRef:e,value:{memo:a}});return{forward:[i(n)],invert:[i(o)]}}}}function am(e,n){let o;return{label:"노트 색상 변경",apply(i){const a=i.layout.notes.find(r=>r.modelId===e);if(!a)throw new Error(`노트 없음: ${e}`);o=a.style,a.style=Ti(a.style,n)},invert(i){const a=i.layout.notes.find(r=>r.modelId===e);a&&(a.style=o)},emitOps(i){const a=i.layout.notes.find(l=>l.modelId===e),r=l=>({kind:"note.setStyle",casUnit:"layout",noteRef:e,value:{style:l}});return{forward:[r(a==null?void 0:a.style)],invert:[r(o)]}}}}function rm(e,n){let o=!1,i=!1;const a=r=>r.layout.groupLayouts.find(l=>l.groupRef===e);return{label:"그룹에 노트 편입",apply(r){const l=a(r);l&&(l.memberNoteRefs||(l.memberNoteRefs=[],i=!0),!l.memberNoteRefs.includes(n)&&(l.memberNoteRefs.push(n),o=!0))},invert(r){if(!o)return;const l=a(r);if(!(l!=null&&l.memberNoteRefs))return;const s=l.memberNoteRefs.indexOf(n);s>=0&&l.memberNoteRefs.splice(s,1),i&&delete l.memberNoteRefs},emitOps(){return o?{forward:[{kind:"groupLayout.addNoteMember",casUnit:"layout",groupRef:e,noteRef:n}],invert:[{kind:"groupLayout.removeNoteMember",casUnit:"layout",groupRef:e,noteRef:n}]}:{forward:[],invert:[]}}}}function lm(e,n){let o=-1;const i=a=>a.layout.groupLayouts.find(r=>r.groupRef===e);return{label:"그룹에서 노트 제외",apply(a){var l;const r=i(a);o=((l=r==null?void 0:r.memberNoteRefs)==null?void 0:l.indexOf(n))??-1,o>=0&&r.memberNoteRefs.splice(o,1)},invert(a){if(o<0)return;const r=i(a);r&&(r.memberNoteRefs||(r.memberNoteRefs=[]),r.memberNoteRefs.splice(o,0,n))},emitOps(){return o<0?{forward:[],invert:[]}:{forward:[{kind:"groupLayout.removeNoteMember",casUnit:"layout",groupRef:e,noteRef:n}],invert:[{kind:"groupLayout.addNoteMember",casUnit:"layout",groupRef:e,noteRef:n}]}}}}const Xn=(e,n,o)=>({kind:"noteConnection.setWaypoints",casUnit:"layout",noteRef:e,targetRef:n,value:{waypoints:o}}),qa=(e,n,o)=>{var i;return((i=Mn(e,n,o))==null?void 0:i.waypoints.map(a=>({...a})))??[]};function sm(e,n){let o=!1,i=!1;return{label:"노트 연결 추가",apply(a){const r=a.layout.notes.find(l=>l.modelId===e);if(!r)throw new Error(`노트 없음: ${e}`);if(r.connections||(r.connections=[],i=!0),r.connections.some(l=>l.targetRef===n)){o=!1;return}r.connections.push({targetRef:n,waypoints:[]}),o=!0},invert(a){if(!o)return;const r=a.layout.notes.find(s=>s.modelId===e);if(!(r!=null&&r.connections))return;const l=r.connections.findIndex(s=>s.targetRef===n);l>=0&&r.connections.splice(l,1),i&&delete r.connections},emitOps(){return o?{forward:[{kind:"noteConnection.add",casUnit:"layout",noteRef:e,targetRef:n,value:{targetRef:n,waypoints:[]}}],invert:[{kind:"noteConnection.remove",casUnit:"layout",noteRef:e,targetRef:n}]}:{forward:[],invert:[]}}}}function cm(e,n){let o=null;return{label:"노트 연결 삭제",apply(i){var l;const a=i.layout.notes.find(s=>s.modelId===e),r=((l=a==null?void 0:a.connections)==null?void 0:l.findIndex(s=>s.targetRef===n))??-1;if(!(a!=null&&a.connections)||r<0)throw new Error(`노트 연결 없음: ${e}→${n}`);o={item:a.connections[r],index:r},a.connections.splice(r,1)},invert(i){if(!o)return;const a=i.layout.notes.find(r=>r.modelId===e);a!=null&&a.connections&&a.connections.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"noteConnection.remove",casUnit:"layout",noteRef:e,targetRef:n}],invert:[{kind:"noteConnection.add",casUnit:"layout",noteRef:e,targetRef:n,value:o.item}]}:{forward:[],invert:[]}}}}function dm(e,n,o,i){let a=null;return{label:"waypoint 이동",coalesceKey:`noteConnWaypoint:${e}:${n}`,apply(r){const l=Mn(r,e,n);if(!l||!l.waypoints[o])throw new Error(`waypoint 없음: ${e}→${n}[${o}]`);a={...l.waypoints[o]},l.waypoints.splice(o,1,{...i})},invert(r){const l=Mn(r,e,n);l&&a&&l.waypoints.splice(o,1,a)},emitOps(r){const l=qa(r,e,n),s=l.map((c,d)=>d===o&&a?{...a}:c);return{forward:[Xn(e,n,l)],invert:[Xn(e,n,s)]}}}}function um(e,n,o,i){return{label:"waypoint 추가",apply(a){const r=Mn(a,e,n);if(!r)throw new Error(`노트 연결 없음: ${e}→${n}`);r.waypoints.splice(o,0,{...i})},invert(a){const r=Mn(a,e,n);r==null||r.waypoints.splice(o,1)},emitOps(a){const r=qa(a,e,n),l=r.slice();return l.splice(o,1),{forward:[Xn(e,n,r)],invert:[Xn(e,n,l)]}}}}function mm(e,n,o){let i=null;return{label:"waypoint 제거",apply(a){const r=Mn(a,e,n);if(!r||!r.waypoints[o])throw new Error(`waypoint 없음: ${e}→${n}[${o}]`);i={...r.waypoints[o]},r.waypoints.splice(o,1)},invert(a){const r=Mn(a,e,n);r&&i&&r.waypoints.splice(o,0,i)},emitOps(a){const r=qa(a,e,n),l=r.slice();return i&&l.splice(o,0,{...i}),{forward:[Xn(e,n,r)],invert:[Xn(e,n,l)]}}}}function fm(e,n){let o=null;return{label:"꺾은선 풀기",apply(i){const a=Mn(i,e,n);if(!a)throw new Error(`노트 연결 없음: ${e}→${n}`);o=a.waypoints.map(r=>({...r})),a.waypoints=[]},invert(i){const a=Mn(i,e,n);a&&o&&(a.waypoints=o)},emitOps(i){return{forward:[Xn(e,n,qa(i,e,n))],invert:[Xn(e,n,o??[])]}}}}function rt(e,n,o){return{label:e,coalesceKey:o,apply(i){for(const a of n)a.apply(i)},invert(i){for(let a=n.length-1;a>=0;a--)n[a].invert(i)},emitOps(i){const a=n.map(r=>{if(!r.emitOps)throw new Error(`emitOps 미구현 command가 composite에 포함됨: ${r.label}`);return r.emitOps(i)});return{forward:a.flatMap(r=>r.forward),invert:a.slice().reverse().flatMap(r=>r.invert)}}}}const Wk=Object.freeze(Object.defineProperty({__proto__:null,addAssociation:Ka,addAttribute:Xt,addEntity:za,addEntityToGroup:Lu,addGroup:Ha,addIndex:qu,addNote:tm,addNoteConnection:sm,addNoteConnectionWaypoint:um,addNoteToGroup:rm,addOperation:Uu,addWaypoint:em,clearNoteConnectionWaypoints:fm,clearWaypoints:Qu,composite:rt,moveEntity:Qo,moveGroup:Bu,moveNote:Vi,moveNoteConnectionWaypoint:dm,moveWaypoint:Ju,removeAssociation:Yu,removeAttribute:zu,removeEntity:Su,removeEntityFromGroup:ja,removeGroup:Vu,removeIndex:Wu,removeNote:nm,removeNoteConnection:cm,removeNoteConnectionWaypoint:mm,removeNoteFromGroup:lm,removeOperation:ju,removeWaypoint:Xu,renameEntity:Ru,reorderAttributes:as,reorderOperations:Ku,resizeEntity:Au,resizeGroup:Du,resizeNote:om,setAllEntitiesCollapsed:is,setAttributeSwatch:Ua,setEntityCollapsed:$u,setEntityLocked:Tu,setEntitySwatch:xu,setGroupLocked:Pu,setGroupSwatch:Ou,setNoteMemo:im,setNoteSwatch:am,setOperationSwatch:Gu,translateWaypoints:Zu,updateAssociation:Ga,updateAssociationEnd:on,updateAttribute:nn,updateEntity:Fa,updateGroup:Mu,updateIndex:Ya,updateOperation:Hu},Symbol.toStringTag,{value:"Module"}));class pm{constructor(){st(this,"revs",new Map);st(this,"layoutVersion",0);st(this,"logicalVersion",0)}seed(n){this.revs.clear();for(const[o,i]of Object.entries(n.revs??{}))this.revs.set(o,i);this.layoutVersion=n.layoutVersion??0,this.logicalVersion=n.logicalVersion??0}rev(n){return this.revs.get(n)??0}setRev(n,o){this.revs.set(n,o)}deleteRev(n){this.revs.delete(n)}snapshot(){return{revs:Object.fromEntries(this.revs),layoutVersion:this.layoutVersion,logicalVersion:this.logicalVersion}}}const Jk=[400,1200];function Xk(e){var o;if(typeof e!="object"||e===null)return;const n=e;for(const i of[n.statusCode,n.status,(o=n.response)==null?void 0:o.status])if(typeof i=="number"&&Number.isFinite(i))return i}function Zk(e){const n=Xk(e);return n==null||n===408||n===429?!0:n<400||n>=500}const Qk=e=>new Promise(n=>setTimeout(n,e));class hm{constructor(n){st(this,"cache",new pm);st(this,"newClientOpId");st(this,"debounceMs");st(this,"retryDelaysMs");st(this,"emissions",new WeakMap);st(this,"open",null);st(this,"debounceHandle",null);st(this,"queue",[]);st(this,"sending",!1);st(this,"_frozen",!1);st(this,"stack",null);st(this,"settledWaiters",[]);this.opts=n,this.newClientOpId=n.newClientOpId??Fe,this.debounceMs=n.debounceMs??300,this.retryDelaysMs=n.retryDelaysMs??Jk}seed(n){this.cache.seed(n)}attach(n){this.stack=n,n.sealCoalesce();const o=n.onCommand((i,a,r)=>this.handle(i,a,r));return()=>{o(),this.stack===n&&(this.stack=null)}}get frozen(){return this._frozen}get hasPending(){return this.open!==null||this.queue.length>0||this.sending}cacheSnapshot(){return this.cache.snapshot()}flush(){this.flushOpen(!0)}whenSettled(){return this.hasPending?new Promise(n=>this.settledWaiters.push(n)):Promise.resolve()}handle(n,o,i){var l,s,c;if(this._frozen)return;let a;if(o==="do"){const d=(l=n.emitOps)==null?void 0:l.call(n,this.opts.state);if(!d)throw new Error(`op-mode에서 emitOps 미구현 command 실행: ${n.label}`);a=d}else{const d=this.emissions.get(n);if(!d)throw new Error(`op-mode ${o} 대상 command의 emission 미기록: ${n.label}`);a=d}const r=o==="undo"?a.invert:a.forward;if(o==="do"&&i&&this.open&&this.open.coalesceKey===n.coalesceKey){this.open.fwd=r,this.emissions.set(n,{forward:r,invert:this.open.inv}),this.resetDebounce();return}if(i){const d=new Error(`op-mode coalesce 경계 불일치: 스택은 병합했으나 어댑터에 대응 그룹이 없음 (${n.label}, key=${String(n.coalesceKey)})`);console.error("[op-sync]",d),(c=(s=this.opts).onError)==null||c.call(s,d)}if(this.flushOpen(!1),o==="do"&&(this.emissions.set(n,a),n.coalesceKey!=null)){this.open={coalesceKey:n.coalesceKey,fwd:r,inv:a.invert},this.startDebounce();return}r.length&&this.enqueue(this.buildBatch(r))}flushOpen(n){var i;this.cancelDebounce();const o=this.open;this.open=null,o&&o.fwd.length&&this.enqueue(this.buildBatch(o.fwd)),n&&((i=this.stack)==null||i.sealCoalesce())}startDebounce(){this.cancelDebounce(),this.debounceHandle=setTimeout(()=>{this.debounceHandle=null,this.flushOpen(!0)},this.debounceMs)}resetDebounce(){this.startDebounce()}cancelDebounce(){this.debounceHandle!=null&&(clearTimeout(this.debounceHandle),this.debounceHandle=null)}buildBatch(n){const o={},i=new Set;let a=!1,r=!1;for(const l of n)if(l.casUnit==="logical")if(a=!0,l.containerRef)i.add(l.containerRef);else{const s=l.entityRef??l.associationRef??l.groupRef;s&&(l.kind.endsWith(".add")?this.cache.setRev(s,0):l.kind.endsWith(".remove")&&this.cache.deleteRev(s))}else l.incidental||(r=!0);if(i.size){o.revs={};for(const l of i){const s=this.cache.rev(l);o.revs[l]=s,this.cache.setRev(l,s+1)}}return r&&(o.layout=this.cache.layoutVersion,this.cache.layoutVersion=o.layout+1),a&&(this.cache.logicalVersion+=1),{diagramId:this.opts.diagramId,ops:n,cas:o,origin:this.opts.origin??"gui",clientOpId:this.newClientOpId()}}enqueue(n){this.queue.push(n),this.pump()}async pump(){var i,a;if(this.sending||this._frozen)return;const n=this.queue.shift();if(!n){this.notifySettled();return}this.sending=!0;let o;for(let r=0;;r++)try{o=await this.opts.transport(n);break}catch(l){const s=this.retryDelaysMs.length+1;console.error(`[op-sync] op 전송 실패 (시도 ${r+1}/${s}):`,l),(a=(i=this.opts).onError)==null||a.call(i,l);const c=this.retryDelaysMs[r];if(c==null||!Zk(l)){this.sending=!1,console.error("[op-sync] 전송 실패 확정 → 하드 프리즈(kind:missing)"),this.freeze({kind:"missing"});return}await Qk(c)}this.sending=!1,o.ok?(this.reconcile(o),this.pump()):this.freeze(o.conflict)}reconcile(n){if(!(this.queue.length>0)){for(const[o,i]of Object.entries(n.revs))this.cache.setRev(o,i);this.cache.layoutVersion=n.layoutVersion,this.cache.logicalVersion=n.logicalVersion}}freeze(n){var o,i;this._frozen=!0,this.queue.length=0,this.open=null,this.cancelDebounce(),(i=(o=this.opts).onFreeze)==null||i.call(o,n),this.notifySettled()}notifySettled(){if(this.hasPending)return;const n=this.settledWaiters;this.settledWaiters=[];for(const o of n)o()}}const ym=["entity.add","entity.update","entity.remove","attribute.add","attribute.update","attribute.remove","association.add","association.remove","association.update","associationEnd.update","index.add","index.update","index.remove","operation.add","operation.update","operation.remove","attribute.reorder","operation.reorder","group.add","group.update","group.remove","group.addMember","group.removeMember"],gm=["NORMAL","RELATION_OWN","RELATION_REF","EMBED_OWN","EMBED_REF","EMBED_PREDEF","DIVIDER"];function bm(e,n,o){var c;if(!n.length||!((c=e.indexes)!=null&&c.length))return[];const i=new Set(n),a=new Set,r=new Map,l=d=>{const u=o==null?void 0:o.get(d);u===void 0?a.add(d):u!==d&&r.set(d,u)};for(const d of e.attributes)if(i.has(d.modelId)){l(d.modelId);for(const u of d.dbAttrs)l(u.modelId)}if(!a.size&&!r.size)return[];const s=[];for(const d of e.indexes){let u=!1;const m=[];for(const f of d.columns){if(a.has(f.columnRef)){u=!0;continue}const p=r.get(f.columnRef);p===void 0?m.push(f):(m.push({...f,columnRef:p}),u=!0)}u&&s.push({indexRef:d.modelId,columns:m})}return s}function e_(e){return Cn(e).length}function rs(e,n){return new Set(e.associations.filter(o=>{const i=o.end1.entityRef===n?o.end1:o.end2;return i.multiplicity==="ZERO_OR_MORE_INSTANCES"||i.multiplicity==="ONE_OR_MORE_INSTANCES"}).map(o=>o.modelId))}function t_(e,n,o,i){var r;const a=new Set;for(const l of e.attributes)l.dbAttrs.forEach((s,c)=>{if(s.sharedColumnRef!=null)return;const d=_i(l,s,c,e,i);d&&a.add(d)});for(let l=n.dbAttrs.length;l<o.length;l++){const s=(r=o[l])==null?void 0:r.physicalName;if(s&&a.has(s))return!0}return!1}function km(e,n,o=Fe){const i=e.entities.find(c=>c.modelId===n);if(!i)return[];const a=e_(i);if(a===0)return[];const r=rs(e,n),l=Cn(i).map(c=>c.col),s=[];for(const c of e.entities){const d=c.attributes.filter(u=>{var m;return u.attrType==="EMBED_OWN"&&((m=u.embedded)==null?void 0:m.embeddableRef)===n&&!r.has(u.embedded.associationRef)&&a-u.dbAttrs.length>0});if(!(d.length>1))for(const u of d){const m=a-u.dbAttrs.length;t_(c,u,l,e)||s.push({entityId:c.modelId,attributeId:u.modelId,dbAttrs:[...u.dbAttrs,...Array.from({length:m},()=>({modelId:o(),physicalName:"",dataType:""}))],added:m})}}return s}function _m(e,n,o){var f;const i=e.entities.find(p=>p.modelId===n);if(!i)return[];const a=i.attributes;if(o.length!==a.length)return[];const r=new Map(a.map(p=>[p.modelId,p])),l=[];for(const p of o){const y=r.get(p);if(!y)return[];l.push(y)}const s=a.flatMap(p=>p.dbAttrs).map(p=>p.modelId),c=l.flatMap(p=>p.dbAttrs).map(p=>p.modelId);if(s.length!==c.length)return[];if(s.every((p,y)=>p===c[y]))return[];const d=new Map(s.map((p,y)=>[p,y])),u=rs(e,n),m=[];for(const p of e.entities)for(const y of p.attributes){if(y.attrType!=="EMBED_OWN"||((f=y.embedded)==null?void 0:f.embeddableRef)!==n||u.has(y.embedded.associationRef)||y.dbAttrs.length!==s.length)continue;const g=c.map(k=>y.dbAttrs[d.get(k)]),b=g.reduce((k,_,h)=>_===y.dbAttrs[h]?k:k+1,0);b&&m.push({entityId:p.modelId,attributeId:y.modelId,dbAttrs:g,moved:b})}return m}function Em(e,n,o){var f;const i=e.entities.find(p=>p.modelId===n);if(!i)return[];const a=new Set(o),r=i.attributes.filter(p=>!a.has(p.modelId));if(r.length===i.attributes.length)return[];const l=Cn(i).map(p=>p.col),s=l.map(p=>p.modelId),c=new Set(Cn({...i,attributes:r}).map(p=>p.col.modelId)),d=new Set;if(s.forEach((p,y)=>{c.has(p)&&d.add(y)}),d.size===s.length)return[];const u=rs(e,n),m=[];for(const p of e.entities)for(const y of p.attributes){if(y.attrType!=="EMBED_OWN"||((f=y.embedded)==null?void 0:f.embeddableRef)!==n||u.has(y.embedded.associationRef)||y.dbAttrs.length!==s.length)continue;const g=y.dbAttrs.filter((_,h)=>d.has(h)),b=y.dbAttrs.filter((_,h)=>!d.has(h));y.dbAttrs.some((_,h)=>{if(d.has(h))return!1;const C=l[h],v=!!_.physicalName&&_.physicalName!==((C==null?void 0:C.physicalName)??""),S=_.sharedColumnRef!=null&&_.sharedColumnRef!==(C==null?void 0:C.sharedColumnRef);return v||S})||m.push({entityId:p.modelId,attributeId:y.modelId,dbAttrs:g,dropped:b})}return m}function yn(e,n,o){const i=new Set(o.map(r=>`${r.entityId}\0${r.attributeId}`)),a=[];for(const r of n){const l=`${e}\0${r}`;i.has(l)||(i.add(l),a.push(r),o.push({entityId:e,attributeId:r}))}return a.map(r=>zu(e,r))}function Zt(e,n,o){if(!n.length)return[];const i=new Map;for(const{entityId:r,attributeId:l}of n){const s=i.get(r)??[];s.push(l),i.set(r,s)}const a=[];for(const[r,l]of i){const s=e.entities.find(c=>c.modelId===r);if(s)for(const c of bm(s,l,o))a.push(Ya(r,c.indexRef,{columns:c.columns}))}return a}function Wa(e,n,o,i){var c;const a=[];a.push(...yn(n,o.remove,i));for(const d of o.update)a.push(nn(n,d.attributeId,d.patch));for(const d of o.add)a.push(Xt(n,d));const r=new Set(o.remove),l=[...(((c=e.entities.find(d=>d.modelId===n))==null?void 0:c.attributes)??[]).filter(d=>!r.has(d.modelId)),...o.add],s=new Set(l.map(d=>d.modelId));for(const d of e.associations){if(d.end2.entityRef!==n)continue;const u=d.end2.attributeRef;if(u&&s.has(u))continue;const f=l.filter(p=>{var y;return((y=p.derivedFrom)==null?void 0:y.associationRef)===d.modelId&&p.dbAttrs.length>0}).sort((p,y)=>p.order-y.order)[0];f&&a.push(on(d.modelId,"end2",{attributeRef:f.modelId}))}return a}function Vn(e,n,o){return{...e,entities:e.entities.map(i=>i.modelId===n?{...i,attributes:o(i.attributes)}:i)}}function Li(e,n,o){return[...Nm(e,n,o),...vm(e,n)]}function Nm(e,n,o){const i=[];for(const[a,r]of Ll(e,n,Fe))i.push(...Wa(e,a,r,o));return i}function n_(e,n,o,i){const a=e.entities.find(l=>l.modelId===n);if(!a)return[];const r=Jl([...a.attributes].sort((l,s)=>l.order-s.order),o,i).map(l=>l.modelId);return _m(e,n,r).map(l=>nn(l.entityId,l.attributeId,{dbAttrs:l.dbAttrs}))}function wm(e,n,o){return Im(e,n,o).commands}function Im(e,n,o){const i=Em(e,n,o),a=i.map(l=>nn(l.entityId,l.attributeId,{dbAttrs:l.dbAttrs})),r=i.reduce((l,s)=>Vn(l,s.entityId,c=>c.map(d=>d.modelId===s.attributeId?{...d,dbAttrs:s.dbAttrs}:d)),e);return{commands:a,projected:r}}function vm(e,n){return km(e,n,Fe).map(o=>nn(o.entityId,o.attributeId,{dbAttrs:o.dbAttrs}))}function o_(e,n,o){const i=new Set(o.remove);return Vn(e,n,a=>[...a.filter(r=>!i.has(r.modelId)).map(r=>{const l=o.update.find(s=>s.attributeId===r.modelId);return l?{...r,...l.patch}:r}),...o.add])}function Ja(e,n,o){const i=[];for(const{entityId:a,plan:r}of Wd(e,n,Fe))i.push(...Wa(e,a,r,o));return i}function Cm(e,n,o=new Set){var r,l,s,c;if(!mn(n))return[];const i=[];for(const d of e.attributes){if(o.has(d.modelId))continue;const u={},m=(r=d.dbAttrs.find(f=>fn(f.logicalName)))==null?void 0:r.logicalName;m&&!fn(d.fieldLogicalName)&&(u.fieldLogicalName=m),d.dbAttrs.length>0&&(u.dbAttrs=[]),d.notNull&&(u.notNull=!1),Object.keys(u).length>0&&i.push(nn(e.modelId,d.modelId,u))}const a={};return fn((l=e.table)==null?void 0:l.logicalName)&&!fn(e.classLogicalName)&&(a.classLogicalName=e.table.logicalName),(s=e.table)!=null&&s.physicalName&&(a.table=null),(c=e.indexes)!=null&&c.length&&(a.indexes=[]),e.schema&&(a.schema=null),e.jpaAttrs&&(a.jpaAttrs=null),Object.keys(a).length>0&&i.push(Fa(e.modelId,a)),i}function Sm(e){return Cn(e).map(n=>({...n.col,modelId:Fe()}))}function Rm(e,n){var u;const o=e.entities.find(m=>m.modelId===n);if(!o)return[];const i=[];let a;if(!o.attributes.some(m=>m.identifier)){const m=Jt(o.attributes),f=new Set(o.attributes.map(y=>y.name));let p="id";for(let y=2;f.has(p);y++)p=`id${y}`;a={modelId:Fe(),name:p,type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:m,dbAttrs:[{modelId:Fe(),physicalName:p.toLowerCase(),dataType:"BIGINT"}]},i.push(Xt(n,a))}const r=[];for(const m of e.entities)for(const f of m.attributes){if(((u=f.embedded)==null?void 0:u.embeddableRef)!==n)continue;const p=e.associations.find(k=>k.modelId===f.embedded.associationRef);if(!p)continue;const y=p.end1.entityRef===m.modelId,g=y?p.end1:p.end2,b=y?p.end2:p.end1;r.push({ownerId:m.modelId,dispId:f.modelId,assocId:p.modelId,end1:{entityRef:m.modelId,multiplicity:g.multiplicity,navigable:g.navigable,composition:!1},end2:{entityRef:n,multiplicity:b.multiplicity,navigable:b.navigable,composition:!1}})}const l={...e,entities:e.entities.map(m=>{if(m.modelId===n)return a?{...m,stereotype:"JPA_ENTITY",attributes:[...m.attributes,a]}:{...m,stereotype:"JPA_ENTITY"};const f=new Set(r.filter(p=>p.ownerId===m.modelId).map(p=>p.dispId));return f.size?{...m,attributes:m.attributes.filter(p=>!f.has(p.modelId))}:m}),associations:e.associations.map(m=>{const f=r.find(p=>p.assocId===m.modelId);return f?{...m,end1:f.end1,end2:f.end2}:m})},s=Ci(l,n,Fe);for(const m of r){const f=s.add.find(p=>{var y;return((y=p.derivedFrom)==null?void 0:y.associationRef)===m.assocId});f&&(m.end2.attributeRef=f.modelId)}const c=[];for(const m of r)i.push(...yn(m.ownerId,[m.dispId],c)),i.push(Ga(m.assocId,{end1:m.end1,end2:m.end2}));i.push(...Wa(l,n,s,c));const d=o_(l,n,s);return i.push(...Li(d,n,c)),i.push(...Zt(e,c)),i}function Am(e,n,o){const i=e.associations.find(l=>l.modelId===n);if(!i||i.end1.navigable===o)return null;const a=e.entities.find(l=>l.modelId===i.end1.entityRef),r=e.entities.find(l=>l.modelId===i.end2.entityRef);if(!a||!r||a.stereotype==="JPA_EMBEDDABLE"||r.stereotype==="JPA_EMBEDDABLE")return null;if(o===!0&&!i.end1.attributeRef){const l=Na(i.end2.multiplicity),s=i.end1.navFieldNameHint||Ia(r.name,l),c=po(s,new Set(a.attributes.map(m=>m.name))),d=Fe(),u={modelId:d,name:c,type:r.name,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:Jt(a.attributes),dbAttrs:[]};return{cmds:[Xt(i.end1.entityRef,u)],endPatch:{attributeRef:d,navFieldNameHint:void 0}}}if(o===!1&&i.end1.attributeRef){const l=i.end1.attributeRef,s=a.attributes.find(m=>m.modelId===l&&m.attrType==="RELATION_REF"),c={attributeRef:void 0,navFieldNameHint:(s==null?void 0:s.name)??i.end1.navFieldNameHint};if(!s)return{cmds:[],endPatch:c};const d=[],u=[...yn(i.end1.entityRef,[l],d)];return u.push(...Zt(e,d)),{cmds:u,endPatch:c}}return null}function xm(e,n,o){const i=e.entities.find(u=>u.modelId===n);if(!i)return[];const a=i.attributes.filter(u=>u.identifier&&!u.derivedFrom).map(u=>nn(n,u.modelId,{identifier:!1})),r=Vn({...e,entities:e.entities.map(u=>u.modelId===n?{...u,stereotype:o}:u)},n,u=>u.map(m=>m.identifier&&!m.derivedFrom?{...m,identifier:!1}:m)),l=[],s=Ja(r,[n],l);s.push(...Zt(e,l));const c=o==="JPA_EMBEDDABLE"?i_(e,n):[],d=Cm(i,o,new Set(l.filter(u=>u.entityId===n).map(u=>u.attributeId)));return[...a,...s,...c,...d]}function i_(e,n){const o=e.entities.find(r=>r.modelId===n);if(!o)return[];const i=[],a=r=>r&&r.charAt(0).toLowerCase()+r.slice(1);for(const r of e.associations){if(r.end1.entityRef===r.end2.entityRef)continue;const l=r.end1.entityRef===n,s=r.end2.entityRef===n;if(!l&&!s)continue;const c=l?r.end2.entityRef:r.end1.entityRef,d=e.entities.find(h=>h.modelId===c);if(!d||d.attributes.some(h=>{var C;return((C=h.embedded)==null?void 0:C.associationRef)===r.modelId}))continue;const u=Fe(),m=Jt(d.attributes),f=new Set(d.attributes.map(h=>h.name)),p=a(o.name);let y=p;for(let h=2;f.has(y);h++)y=`${p}${h}`;const g=o.attributes.filter(h=>!h.identifier&&!h.derivedFrom).flatMap(h=>h.dbAttrs).map(h=>({...h,modelId:Fe()})),b={modelId:u,name:y,type:o.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:m,dbAttrs:g,embedded:{associationRef:r.modelId,embeddableRef:n}};i.push(Xt(c,b));const k=l?"end2":"end1",_=l?"end1":"end2";i.push(Ga(r.modelId,{identifying:!1,[k]:{entityRef:c,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:Fe()},[_]:{entityRef:n,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:u}}))}return i}function $m(e,n,o,i){var d;const a=e.layout.groupLayouts.find(u=>u.groupRef===n),r=(a==null?void 0:a.geo.location)??o,l=o.x-r.x,s=o.y-r.y,c=[Bu(n,o),...i.map(u=>Qo(u.id,u.location))];if(l||s){const u=new Set(((d=e.logical.groups.find(m=>m.modelId===n))==null?void 0:d.memberEntityRefs)??[]);for(const m of e.logical.associations){if(!u.has(m.end1.entityRef)||!u.has(m.end2.entityRef))continue;const f=e.layout.associationLayouts.find(p=>p.associationRef===m.modelId);f&&f.waypoints.length&&c.push(Zu(m.modelId,l,s))}for(const m of(a==null?void 0:a.memberNoteRefs)??[]){const f=e.layout.notes.find(p=>p.modelId===m);f&&c.push(Vi(m,{x:f.geo.location.x+l,y:f.geo.location.y+s}))}}return c}const Tm={diagramId:"",logicalModelRef:"",entityLayouts:[],associationLayouts:[],groupLayouts:[],notes:[]};function Mm(e,n,o){for(const[i,a]of Object.entries(n)){if(i==="dbAttrs"){if(!Array.isArray(a))continue;a.forEach((l,s)=>{if(l&&typeof l=="object")for(const[c,d]of Object.entries(l))o(s,c,d,`dbAttrs.${s}.${c}`)});continue}const r=/^dbAttrs\.(\d+)\.(.+)$/.exec(i);if(r){o(Number(r[1]),r[2],a,i);continue}e.dbAttrs.length===1&&Xa.has(i)&&o(0,i,a,i)}}function a_(e,n){const o=new Set,i=new Set,a=r=>r!=null;for(const[r,l]of Object.entries(n))r==="dbAttrs"||r.startsWith("dbAttrs.")||(Kc.attr.includes(r)?o.add(r):Gc.attr.includes(r)&&a(l)&&i.add(r));return Mm(e,n,(r,l,s,c)=>{Kc.column.includes(l)?o.add(c):Gc.column.includes(l)&&a(s)&&i.add(c)}),{locked:[...o],inapplicable:[...i]}}function r_(e,n,o,i,a){const r=a?{embeddableCatalog:a}:void 0,l=d=>{const u=e.dbAttrs[d];return u?nd(u,Lt(e,u,d,n,o,r)):[]},s=new Map;Mm(e,i,(d,u,m)=>{m!=null&&ed.includes(u)&&(s.has(d)||s.set(d,new Set),s.get(d).add(u))});const c=[];for(const[d,u]of[...s.entries()].sort((m,f)=>m[0]-f[0])){const m=l(d).filter(f=>u.has(f));m.length&&c.push([d,m])}return c}function l_(e,n){const o=()=>e.entities.filter(r=>{var l;return((l=r.table)==null?void 0:l.physicalName)===n.ref}),i=()=>e.entities.filter(r=>r.name===n.ref);if(n.by==="modelId")return e.entities.filter(r=>r.modelId===n.ref);if(n.by==="physicalName")return o();if(n.by==="name")return i();const a=o();return a.length?a:i()}function s_(e,n){const o=()=>e.attributes.filter(r=>r.name===n.ref),i=()=>e.attributes.filter(r=>r.dbAttrs.some(l=>l.physicalName===n.ref));if(n.by==="modelId")return e.attributes.filter(r=>r.modelId===n.ref);if(n.by==="name")return o();if(n.by==="physicalName")return i();const a=o();return a.length?a:i()}function Vm(e,n,o){return e.associations.filter(i=>{const a=[i.end1.entityRef,i.end2.entityRef];return a.includes(n)&&a.includes(o)})}function Tt(e,n){if(!Za(n))return{ok:!1,reason:"shape",matches:[]};const o=l_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>u_(i,e))}}function c_(e,n){const o=()=>e.groups.filter(r=>r.packageName===n.ref),i=()=>e.groups.filter(r=>Object.values(r.name??{}).some(l=>l===n.ref));if(n.by==="modelId")return e.groups.filter(r=>r.modelId===n.ref);if(n.by==="packageName")return o();if(n.by==="name")return i();const a=o();return a.length?a:i()}function ls(e,n){const o=c_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>({modelId:i.modelId,name:i.name??null,packageName:i.packageName??null,members:i.memberEntityRefs.length}))}}function ss(e,n,o){return e.reason==="shape"?{code:"handle-shape-invalid",opIndex:n,where:"group",expected:"{ref, by?}",got:us(o)}:e.reason==="not-found"?{code:"group-not-found",opIndex:n,handle:o}:{code:"group-ambiguous",opIndex:n,handle:o,matches:e.matches}}const d_=new Set(["name","description","packageName","excludeDDLGeneration"]);function u_(e,n){var a;const o=Ko(e,n).value,i=n.associations.filter(r=>{var l,s;return((l=r.end1)==null?void 0:l.entityRef)===e.modelId||((s=r.end2)==null?void 0:s.entityRef)===e.modelId});return{modelId:e.modelId,stereotype:e.stereotype,packageName:o||null,table:((a=e.table)==null?void 0:a.physicalName)||null,attributes:e.attributes.length,references:i.length,referencedBy:[...new Set(i.map(r=>{var c,d,u,m;const l=((c=r.end1)==null?void 0:c.entityRef)===e.modelId?(d=r.end2)==null?void 0:d.entityRef:(u=r.end1)==null?void 0:u.entityRef,s=n.entities.find(f=>f.modelId===l);return(s==null?void 0:s.name)||((m=s==null?void 0:s.table)==null?void 0:m.physicalName)||String(l??"?")}))]}}function Lm(e,n){const o=s_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>i.modelId)}}function m_(e,n){const o=()=>e.attributes.flatMap(r=>r.dbAttrs).filter(r=>r.physicalName===n.ref),i=()=>e.attributes.filter(r=>r.name===n.ref).flatMap(r=>r.dbAttrs);if(n.by==="modelId")return e.attributes.flatMap(r=>r.dbAttrs).filter(r=>r.modelId===n.ref);if(n.by==="physicalName")return o();if(n.by==="name")return i();const a=o();return a.length?a:i()}function f_(e,n){const o=m_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>i.modelId)}}function Bm(e,n){const o=e.filter(i=>i.physicalName===n.ref);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>i.modelId)}}function cs(e){return e.by!==void 0&&e.by!=="name"}function p_(e,n){return(e.indexes??[]).filter(o=>o.name===n.ref)}function h_(e,n){return(e.operations??[]).filter(o=>o.name===n.ref)}function y_(e,n){const o=p_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>i.modelId)}}function Dm(e,n){const o=h_(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>i.modelId)}}function Om(e){return e.physicalName!=null||e.dataType!=null||e.length!=null||e.scale!=null||e.columnLogicalName!=null||e.unique!=null||e.updatable!=null}function Pm(e){return Om(e)&&e.dataType==null}function zm(e,n,o){const i=Om(e);return{modelId:o(),name:e.name,type:e.type,attrType:"NORMAL",identifier:e.identifier??!1,notNull:e.notNull??!1,order:n,...e.transient?{transient:!0}:{},...e.groupCode?{groupCode:e.groupCode}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.attributeGroup?{attributeGroup:e.attributeGroup}:{},...e.description?{description:e.description}:{},...e.collectionType?{collectionType:e.collectionType}:{},...e.fieldLogicalName?{fieldLogicalName:e.fieldLogicalName}:{},dbAttrs:i?[{modelId:o(),physicalName:e.physicalName??e.name,dataType:e.dataType??"",...e.length?{length:e.length}:{},...e.scale?{scale:e.scale}:{},...e.columnLogicalName?{logicalName:e.columnLogicalName}:{},...e.unique!=null?{unique:e.unique}:{},...e.updatable!=null?{updatable:e.updatable}:{}}]:[]}}function Fm(e,n,o,i,a,r,l,s,c){const d=Km(e.embeddableOverrides);if(d.length)return s.push({code:"embeddable-override-unknown-key",opIndex:r,entity:l,handle:{ref:e.name},keys:d}),null;const u=c(),m=new Map((e.embeddableOverrides??[]).map(y=>[y.field,y])),f=[];let p=!1;for(const y of n.fields){const g=m.get(y.name);if(g!=null&&g.sharedColumnPhysicalName){const b={ref:g.sharedColumnPhysicalName,by:"physicalName"},k=Bm(Rn(i,a),b);if(!k.ok){s.push(k.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:r,entity:l,handle:b}:{code:"shared-column-target-ambiguous",opIndex:r,entity:l,handle:b,matches:k.matches}),p=!0;continue}f.push({modelId:c(),physicalName:"",dataType:"",sharedColumnRef:k.value.modelId});continue}f.push({modelId:c(),physicalName:(g==null?void 0:g.physicalName)??"",dataType:"",...g!=null&&g.length?{length:g.length}:{},...g!=null&&g.scale?{scale:g.scale}:{},...(g==null?void 0:g.insertable)!=null?{insertable:g.insertable}:{},...(g==null?void 0:g.updatable)!=null?{updatable:g.updatable}:{},...(g==null?void 0:g.notNull)!=null?{notNull:g.notNull}:{}})}return p?null:{modelId:u,name:e.name,type:n.type,attrType:"EMBED_PREDEF",identifier:e.identifier??!1,notNull:e.notNull??!1,order:o,...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.attributeGroup?{attributeGroup:e.attributeGroup}:{},...e.description?{description:e.description}:{},dbAttrs:f}}const g_=new Set(["name","type","customType","attrType","identifier","notNull","transient","naturalId","naturalIdMutable","description","attributeGroup","groupCode","defaultValue","personalInfoAttributeType","order","dbAttrs","derivedIdFieldName","collectionType","fieldLogicalName"]),Io=e=>new Set(Object.keys(e)),b_=Io({name:!0,stereotype:!0,physicalName:!0,useVersion:!0,attributes:!0,indexes:!0,operations:!0,serialization:!0,classLogicalName:!0}),Um=Io({name:!0,type:!0,identifier:!0,notNull:!0,transient:!0,physicalName:!0,dataType:!0,length:!0,scale:!0,groupCode:!0,defaultValue:!0,attributeGroup:!0,description:!0,columnLogicalName:!0,unique:!0,updatable:!0,embeddableOverrides:!0,collectionType:!0,fieldLogicalName:!0}),k_=Io({field:!0,physicalName:!0,length:!0,scale:!0,insertable:!0,updatable:!0,notNull:!0,sharedColumnPhysicalName:!0}),Hm=Io({name:!0,unique:!0,columns:!0,description:!0,parameters:!0}),jm=Io({name:!0,visibility:!0,sourceCode:!0,description:!0,personalInfoAttributeType:!0}),__=Io({from:!0,to:!0,fromMultiplicity:!0,toMultiplicity:!0,identifying:!0,composition:!0}),E_=Io({name:!0,packageName:!0,description:!0,excludeDDLGeneration:!0,members:!0});function gn(e,n){return vo(e,n)}function Km(e){const n=new Set;for(const o of e??[])for(const i of gn(o,k_))n.add(i);return[...n]}const N_=new Set(["name","stereotype","packageName","superClass","schema","description","abstractClass","hasPersonalInfo","declarationOfInterfaces","table","classLogicalName","referenceOnly","serialization"]),w_=new Set(["description","identifying"]),I_=new Set(["multiplicity","navigable","composition"]),v_=new Set(["name","unique","description","parameters"]),C_=new Set(["name","visibility","sourceCode","description","order","personalInfoAttributeType"]);function vo(e,n,o=[]){const i=[];for(const a of Object.keys(e)){if(a.includes(".")){o.some(r=>a.startsWith(r))||i.push(a);continue}n.has(a)||i.push(a)}return i}const Xa=new Set(["physicalName","logicalName","dataType","length","scale","unique","autoIncrement","updatable","insertable","sharedColumnRef","multiValue","multiValueSeparator","sequenceName"]),S_=new Set([...Xa].filter(e=>e!=="sharedColumnRef"));function R_(e,n,o,i){if(i||o.some(l=>!S_.has(l))||e.attrType!=="NORMAL"||e.dbAttrs.length!==1)return null;const a={...e.dbAttrs[0]};for(const l of o)a[l]=n[l];const r={};for(const[l,s]of Object.entries(n))Xa.has(l)||(r[l]=s);return{...r,dbAttrs:[a]}}function A_(e,n,o,i,a,r,l,s){const c=Km(o);if(c.length)return s.push({code:"embeddable-override-unknown-key",opIndex:r,entity:l,handle:{ref:e.name},keys:c}),null;const d=new Map(o.map(f=>[f.field,f])),u=[];let m=!1;return e.dbAttrs.forEach((f,p)=>{const y=n.fields[p],g=y?d.get(y.name):void 0;if(!g){u.push(f);return}if(g.sharedColumnPhysicalName){const k={ref:g.sharedColumnPhysicalName,by:"physicalName"},_=Bm(Rn(i,a),k);if(!_.ok){s.push(_.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:r,entity:l,handle:k}:{code:"shared-column-target-ambiguous",opIndex:r,entity:l,handle:k,matches:_.matches}),m=!0;return}u.push({modelId:f.modelId,physicalName:"",dataType:"",sharedColumnRef:_.value.modelId});return}const b={...f};delete b.sharedColumnRef,u.push({...b,...g.physicalName!=null?{physicalName:g.physicalName}:{},...g.length!=null?{length:g.length}:{},...g.scale!=null?{scale:g.scale}:{},...g.notNull!=null?{notNull:g.notNull}:{},...g.insertable!=null?{insertable:g.insertable}:{},...g.updatable!=null?{updatable:g.updatable}:{}})}),m?null:u}function Gm(e,n,o){return{modelId:o(),name:e.name,order:n,...e.visibility?{visibility:e.visibility}:{},...e.sourceCode?{sourceCode:e.sourceCode}:{},...e.description?{description:e.description}:{},...e.personalInfoAttributeType?{personalInfoAttributeType:e.personalInfoAttributeType}:{}}}function Ym(e,n,o,i,a,r){const l=[];let s=!1;for(const c of n.columns){const d=f_(e,c.column);if(!d.ok){a.push(d.reason==="not-found"?{code:"column-not-found",opIndex:o,entity:i,handle:c.column}:{code:"column-ambiguous",opIndex:o,entity:i,handle:c.column,matches:d.matches}),s=!0;continue}l.push({columnRef:d.value.modelId,descending:c.descending??!1})}return s?null:{modelId:r(),name:n.name,unique:n.unique??!1,columns:l,...n.description?{description:n.description}:{},...n.parameters?{parameters:n.parameters}:{}}}function ei(e,n,o,i){const a=`${o}:${i}`;n.seen.has(a)||(n.seen.add(a),n.pairs.push({entityId:o,attributeId:i}),e.push({kind:"attribute.remove",casUnit:"logical",containerRef:o,entityRef:o,attributeRef:i}))}function x_(e,n,o,i){const a=new Map;for(const{entityId:r,attributeId:l}of o.pairs){if(i.has(r))continue;const s=a.get(r)??[];s.push(l),a.set(r,s)}for(const[r,l]of a){const s=n.entities.find(c=>c.modelId===r);if(s)for(const c of bm(s,l))e.push({kind:"index.update",casUnit:"logical",containerRef:r,entityRef:r,indexRef:c.indexRef,patch:{columns:c.columns}})}}function $_(e,n,o,i,a,r){const l=m=>{const f=new Map;for(const{entityId:p,item:y}of m){if(a.has(p))continue;const g=f.get(p)??[];g.push(y),f.set(p,g)}return f},s=l(o.pairs.map(m=>({entityId:m.entityId,item:m.attributeId}))),c=l(i.map(m=>({entityId:m.entityId,item:m.attribute}))),d=new Set(e.filter(m=>m.kind==="attribute.update").map(m=>m.attributeRef)),u=m=>{d.has(m.attributeId)||(d.add(m.attributeId),e.push({kind:"attribute.update",casUnit:"logical",containerRef:m.entityId,entityRef:m.entityId,attributeRef:m.attributeId,patch:{dbAttrs:m.dbAttrs}}))};for(const[m,f]of s)if(!c.has(m))for(const p of Em(n,m,f))u(p);for(const[m,f]of c){if(s.has(m))continue;const p={...n,entities:n.entities.map(y=>y.modelId===m?{...y,attributes:[...y.attributes,...f]}:y)};for(const y of km(p,m,r))u(y)}}function qm(e,n){const o={...e},i=[];for(const[a,r]of Object.entries(n)){if(!a.includes(".")){o[a]=r===null?void 0:r;continue}const l=/^dbAttrs\.(\d+)\.(.+)$/.exec(a);l&&i.push([Number(l[1]),l[2],r])}if(i.length){const a=(o.dbAttrs??[]).map(r=>({...r}));for(const[r,l,s]of i)a[r]&&(a[r][l]=s===null?void 0:s);o.dbAttrs=a}return o}function Wm(e,n,o,i,a,r,l){var f;for(const p of i.remove)ei(e,r,o,p);for(const p of i.update)e.push({kind:"attribute.update",casUnit:"logical",containerRef:o,entityRef:o,attributeRef:p.attributeId,patch:p.patch}),a.attrPatches.push({entityId:o,attributeId:p.attributeId,patch:p.patch});const s=((f=n.entities.find(p=>p.modelId===o))==null?void 0:f.attributes)??[],c=[];for(const p of i.add){const y={...p,order:l(o,s)};e.push({kind:"attribute.add",casUnit:"logical",containerRef:o,entityRef:o,value:y}),a.cascadeAdds.push({entityId:o,attribute:y}),c.push(y)}const d=new Set(i.remove),u=[...s.filter(p=>!d.has(p.modelId)),...c],m=new Set(u.map(p=>p.modelId));for(const p of n.associations){if(p.end2.entityRef!==o)continue;const y=p.end2.attributeRef;if(y&&m.has(y))continue;const b=u.filter(k=>{var _;return((_=k.derivedFrom)==null?void 0:_.associationRef)===p.modelId&&k.dbAttrs.length>0}).sort((k,_)=>k.order-_.order)[0];b&&(e.push({kind:"associationEnd.update",casUnit:"logical",containerRef:p.modelId,associationRef:p.modelId,end:"end2",patch:{attributeRef:b.modelId}}),a.endPatches.push({associationRef:p.modelId,end:"end2",patch:{attributeRef:b.modelId}}))}}function ds(e,n,o,i,a,r,l){for(const{entityId:s,plan:c}of Wd(n,o,i))Wm(e,n,s,c,a,r,l)}function T_(e,n,o,i,a,r){const l=new Map;for(const{entityId:f,attributeId:p}of i.pairs)l.has(f)||l.set(f,new Set),l.get(f).add(p);const s=new Map;for(const f of r.attrPatches)s.has(f.entityId)||s.set(f.entityId,[]),s.get(f.entityId).push(f);const c=new Map;for(const{entityId:f,attribute:p}of[...a,...r.cascadeAdds])c.has(f)||c.set(f,[]),c.get(f).push(p);const d=f=>{const p={};for(const[y,g]of Object.entries(f))y.includes(".")||(p[y]=g===null?void 0:g);return p},u=e.entities.filter(f=>!n.has(f.modelId)).map(f=>{const p=l.get(f.modelId),y=s.get(f.modelId),g=c.get(f.modelId);if(!p&&!y&&!g)return f;let b=f.attributes;return p&&(b=b.filter(k=>!p.has(k.modelId))),y&&(b=b.map(k=>{const _=y.filter(h=>h.attributeId===k.modelId);return _.length?_.reduce((h,C)=>qm(h,C.patch),k):k})),g&&(b=[...b,...g]),{...f,attributes:b}}),m=e.associations.filter(f=>!o.has(f.modelId)&&!n.has(f.end1.entityRef)&&!n.has(f.end2.entityRef)).map(f=>{let p=f;for(const y of r.assocPatches)y.associationRef===f.modelId&&(p={...p,...d(y.patch)});for(const y of r.endPatches)y.associationRef===f.modelId&&(p={...p,[y.end]:{...p[y.end],...d(y.patch)}});return p}).concat(r.addedAssociations);return{...e,entities:u,associations:m}}function M_(e,n,o,i,a,r,l,s,c){if(!l.identifierCascadeParents.size)return;const d=T_(n,o,i,a,r,l),u=new Map;for(const m of l.identifierCascadeParents)for(const[f,p]of Ll(d,m,s)){const y=u.get(f);u.set(f,y?Vl(y,p):p)}for(const[m,f]of u)Wm(e,d,m,qd(f),l,a,c)}const V_=new Set(["classLogicalName","columnLogicalName","fieldLogicalName","logicalName"]),L_=[{key:"name",kinds:new Set(["group.add","group.update"])},{key:"description",kinds:new Set(["attribute.add","attribute.update","operation.add","operation.update"])}];function B_(e){const n=[],o=e.kind??"",i=l=>V_.has(l)||L_.some(s=>s.key===l&&s.kinds.has(o)),a=l=>l===null?"null":Array.isArray(l)?"array":typeof l,r=(l,s)=>{if(!(l==null||typeof l!="object")){if(Array.isArray(l)){l.forEach((c,d)=>r(c,`${s}[${d}]`));return}for(const[c,d]of Object.entries(l)){const u=c.includes(".")?c.split(".").pop():c,m=s?`${s}.${c}`:c;i(u)&&!hg(d)?n.push({path:m,got:a(d)}):r(d,m)}}};return r(e,""),n}function D_(e){const n=i=>{if(i==null||typeof i!="object"||Array.isArray(i))return!1;const a=Object.keys(i);return a.length>0&&a.every(r=>qn.includes(r))},o=i=>{if(n(i))return Yc(i)??null;if(Array.isArray(i)){const a=i.map(o);return a.some((r,l)=>r!==i[l])?a:i}if(i!=null&&typeof i=="object"){const a=i;let r=!1;const l={};for(const[s,c]of Object.entries(a))l[s]=o(c),l[s]!==c&&(r=!0);return r?l:i}return i};return e.map(i=>o(i))}function O_(e,n,o={}){const i=D_(n),a=o.mkId??Fe,r=o.embeddableCatalog??[],l=N=>r.find(A=>A.type===N),s=[],c=[],d=[],u=new Set;n.forEach((N,A)=>{for(const T of B_(N))u.add(A),c.push({code:"multilang-shape-invalid",opIndex:A,where:T.path,expected:"{ko?,en?,ja?,zh?} | null | {}",got:T.got})});const m=new Map,f=(N,A)=>{const T=m.get(N)??Jt(A);return m.set(N,T+1),T},p=new Map,y=new Set,g=new Set,b={seen:new Set,pairs:[]},k=[],_={attrPatches:[],cascadeAdds:[],addedAssociations:[],assocPatches:[],endPatches:[],identifierCascadeParents:new Set},h=new Set,C=(N,A)=>`${N}\0${A}`,v=new Set;for(const N of i)N.kind==="entity.add"&&(v.add(N.spec.name),N.spec.physicalName&&v.add(N.spec.physicalName));const S=new Set;return i.forEach((N,A)=>{var T,O,z,P,D;if(!u.has(A)&&z_(N,A,c))switch(N.kind){case"entity.add":{{const B={ref:N.spec.name},j=gn(N.spec,b_);if(j.length){c.push({code:"entity-spec-unknown-key",opIndex:A,handle:B,keys:j});break}let X=!1;for(const W of N.spec.attributes??[]){const oe=gn(W,Um);oe.length&&(c.push({code:"attribute-spec-unknown-key",opIndex:A,entity:B,handle:{ref:W.name},keys:oe}),X=!0)}for(const W of N.spec.indexes??[]){const oe=gn(W,Hm);oe.length&&(c.push({code:"index-spec-unknown-key",opIndex:A,entity:B,handle:{ref:W.name},keys:oe}),X=!0)}for(const W of N.spec.operations??[]){const oe=gn(W,jm);oe.length&&(c.push({code:"operation-spec-unknown-key",opIndex:A,entity:B,handle:{ref:W.name},keys:oe}),X=!0)}if(X)break}const E=e.entities.filter(B=>B.name===N.spec.name).map(B=>B.modelId);if(E.length||S.has(N.spec.name)){c.push({code:"entity-name-conflict",opIndex:A,handle:{ref:N.spec.name},matches:E});break}S.add(N.spec.name);const R=a(),I={modelId:R,name:N.spec.name,stereotype:N.spec.stereotype??"JPA_ENTITY",attributes:[],...N.spec.useVersion?{jpaAttrs:{useVersion:!0}}:{},...N.spec.physicalName?{table:{physicalName:N.spec.physicalName}}:{},...N.spec.serialization?{serialization:N.spec.serialization}:{},...N.spec.classLogicalName?{classLogicalName:N.spec.classLogicalName}:{}},x={ref:N.spec.name};let $=!1;for(const[B,j]of(N.spec.attributes??[]).entries()){if(ka(j.type,j.groupCode)){c.push(j.groupCode?{code:"groupcode-type-mismatch",opIndex:A,entity:x,handle:{ref:j.name},type:String(j.type??""),groupCode:j.groupCode}:{code:"groupcode-required",opIndex:A,entity:x,handle:{ref:j.name}}),$=!0;continue}if(!l(j.type)&&!((T=j.embeddableOverrides)!=null&&T.length)&&Pm(j)){c.push({code:"datatype-required",opIndex:A,entity:x,handle:{ref:j.name}}),$=!0;continue}const X=l(j.type);if(X){const W=Fm(j,X,B,I,e.entities,A,x,c,a);W?I.attributes.push(W):$=!0}else(O=j.embeddableOverrides)!=null&&O.length?(c.push({code:"embeddable-type-unresolved",opIndex:A,entity:x,handle:{ref:j.name}}),$=!0):I.attributes.push(zm(j,B,a))}const U=(N.spec.operations??[]).map((B,j)=>Gm(B,j,a));U.length&&(I.operations=U);const F=[];for(const B of N.spec.indexes??[]){const j=Ym(I,B,A,x,c,a);j?F.push(j):$=!0}if(F.length&&(I.indexes=F),$)break;s.push({kind:"entity.add",casUnit:"logical",entityRef:R,value:I});break}case"entity.update":{const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}const R=vo(N.patch,N_,["jpaAttrs.","table.","serialization."]);if(R.length){c.push({code:"entity-patch-unknown-key",opIndex:A,entity:N.entity,keys:R});break}const I=N.patch.stereotype;if(typeof I=="string"&&I!==E.value.stereotype){const x=E.value.stereotype,$=I,U=lt($)&&!lt(x),F=!lt($)&<(x);if($!==x&<($)&<(x)&&e.entities.filter(W=>W.attributes.some(oe=>{var de;return((de=oe.embedded)==null?void 0:de.embeddableRef)===E.value.modelId})).length>0){c.push({code:"stereotype-embeddable-transition-unsupported",opIndex:A,entity:N.entity,from:x??"",to:$});break}if($==="SERIALIZED_TYPE"&&e.associations.filter(W=>W.end1.entityRef===E.value.modelId||W.end2.entityRef===E.value.modelId).length>0){c.push({code:"stereotype-serialized-transition-unsupported",opIndex:A,entity:N.entity,from:x??"",to:$});break}const j=U?xm(e,E.value.modelId,$):F?Rm(e,E.value.modelId):[];if(j.length){const X=Fa(E.value.modelId,N.patch),W=vu({logical:e,layout:Tm},[X,...j]);s.push(...W.ops);break}}s.push({kind:"entity.update",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,patch:N.patch});break}case"entity.remove":{const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}const R=E.value.modelId,I=e.associations.filter(F=>F.end1.entityRef===R||F.end2.entityRef===R),x=new Set(I.map(F=>F.modelId));for(const F of I)y.has(F.modelId)||(y.add(F.modelId),s.push({kind:"association.remove",casUnit:"logical",associationRef:F.modelId}));for(const F of e.entities)if(F.modelId!==R)for(const B of F.attributes)B.embedded&&x.has(B.embedded.associationRef)&&ei(s,b,F.modelId,B.modelId);for(const F of I){if(F.end1.entityRef===R||!F.end1.attributeRef)continue;const B=e.entities.find(X=>X.modelId===F.end1.entityRef),j=B==null?void 0:B.attributes.find(X=>X.modelId===F.end1.attributeRef&&X.attrType==="RELATION_REF");j&&ei(s,b,B.modelId,j.modelId)}const $={...e,entities:e.entities.filter(F=>F.modelId!==R),associations:e.associations.filter(F=>!x.has(F.modelId))},U=new Set(I.filter(F=>F.end1.entityRef===R&&F.end2.entityRef!==R).map(F=>F.end2.entityRef));ds(s,$,[...U],a,_,b,f);for(const F of e.groups)F.memberEntityRefs.includes(R)&&(h.has(C(F.modelId,R))||(h.add(C(F.modelId,R)),s.push({kind:"group.removeMember",casUnit:"logical",containerRef:F.modelId,groupRef:F.modelId,entityRef:R})));g.add(R),s.push({kind:"entity.remove",casUnit:"logical",entityRef:R});break}case"attribute.add":{{const $=gn(N.spec,Um);if($.length){c.push({code:"attribute-spec-unknown-key",opIndex:A,entity:N.entity,handle:{ref:N.spec.name},keys:$});break}}const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}if(ka(N.spec.type,N.spec.groupCode)){c.push(N.spec.groupCode?{code:"groupcode-type-mismatch",opIndex:A,entity:N.entity,handle:{ref:N.spec.name},type:String(N.spec.type??""),groupCode:N.spec.groupCode}:{code:"groupcode-required",opIndex:A,entity:N.entity,handle:{ref:N.spec.name}});break}if(!l(N.spec.type)&&!((z=N.spec.embeddableOverrides)!=null&&z.length)&&Pm(N.spec)){c.push({code:"datatype-required",opIndex:A,entity:N.entity,handle:{ref:N.spec.name}});break}const R=f(E.value.modelId,E.value.attributes),I=l(N.spec.type);let x;if(I)x=Fm(N.spec,I,R,E.value,e.entities,A,N.entity,c,a);else if((P=N.spec.embeddableOverrides)!=null&&P.length){c.push({code:"embeddable-type-unresolved",opIndex:A,entity:N.entity,handle:{ref:N.spec.name}});break}else x=zm(N.spec,R,a);if(!x)break;s.push({kind:"attribute.add",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,value:x}),k.push({entityId:E.value.modelId,attribute:x}),x.identifier&&_.identifierCascadeParents.add(E.value.modelId);break}case"attribute.update":case"attribute.remove":{const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}const R=Lm(E.value,N.attribute);if(!R.ok){c.push(R.reason==="not-found"?{code:"attribute-not-found",opIndex:A,entity:N.entity,handle:N.attribute}:{code:"attribute-ambiguous",opIndex:A,entity:N.entity,handle:N.attribute,matches:R.matches});break}if(N.kind==="attribute.update"){const I=[],x=[];let $=!1;for(const W of Object.keys(N.patch)){if(W.includes(".")){W.startsWith("dbAttrs.")?$=!0:x.push(W);continue}Xa.has(W)?I.push(W):g_.has(W)||x.push(W)}if(x.length){c.push({code:"attribute-patch-unknown-key",opIndex:A,entity:N.entity,handle:N.attribute,keys:x});break}if(ki(R.value)){const W=a_(R.value,N.patch);if(W.locked.length){const oe=Jn(e,E.value.modelId,R.value.modelId),de=ie=>{var Ie;return((Ie=e.entities.find(Le=>Le.modelId===ie))==null?void 0:Ie.name)??ie};c.push({code:"attribute-fk-derived-field-locked",opIndex:A,entity:N.entity,handle:N.attribute,fields:W.locked,...oe?{association:{from:de(oe.end1.entityRef),to:de(oe.end2.entityRef)}}:{}});break}W.inapplicable.length&&d.push({code:"fk-derived-inapplicable-field",opIndex:A,entity:N.entity,attribute:N.attribute,fields:W.inapplicable})}const U=Array.isArray(N.patch.dbAttrs)?N.patch.dbAttrs:R.value.dbAttrs,F="type"in N.patch?Tg({attrType:R.value.attrType,type:R.value.type,dbAttrs:U},String(N.patch.type),r):void 0;for(const[W,oe]of r_(R.value,E.value,e,N.patch,r))d.push({code:"inherited-slot-override",opIndex:A,entity:N.entity,attribute:N.attribute,columnIndex:W,fields:oe});if("attrType"in N.patch){const W=String(N.patch.attrType),oe=F?"EMBED_PREDEF":void 0,de=gm.includes(W)?W!==R.value.attrType&&W!==oe?"transition":void 0:"unknown-value";if(de){c.push({code:"attribute-attrtype-unsupported",opIndex:A,entity:N.entity,handle:N.attribute,reason:de,current:R.value.attrType,requested:W});break}}if("type"in N.patch&&!F){const W=String(N.patch.type);if(pd(R.value,W,r)){const oe=kl(R.value),de=oe==="association"?"association-owned":oe==="derived"?"derived":"column-count";c.push({code:"attribute-type-conversion-unsupported",opIndex:A,entity:N.entity,handle:N.attribute,reason:de,current:R.value.type,requested:W});break}}const B="type"in N.patch?N.patch.type:R.value.type,j="groupCode"in N.patch?N.patch.groupCode:R.value.groupCode;if(ka(B,j)){c.push(j?{code:"groupcode-type-mismatch",opIndex:A,entity:N.entity,handle:N.attribute,type:String(B??""),groupCode:String(j)}:{code:"groupcode-required",opIndex:A,entity:N.entity,handle:N.attribute});break}let X=N.patch;if(F&&R.value.attrType!=="EMBED_PREDEF"&&(X={...X,attrType:"EMBED_PREDEF"}),F&&R.value.customType!==void 0&&!("customType"in X)&&(X={...X,customType:null}),I.length){const W=R_(R.value,N.patch,I,$);if(!W){c.push({code:"attribute-patch-dbattr-flat-key",opIndex:A,entity:N.entity,handle:N.attribute,keys:I});break}X=W}if((D=N.embeddableOverrides)!=null&&D.length){const W=l(R.value.type);if(!W||R.value.attrType!=="EMBED_PREDEF"){c.push({code:"embeddable-type-unresolved",opIndex:A,entity:N.entity,handle:N.attribute});break}const oe=A_(R.value,W,N.embeddableOverrides,E.value,e.entities,A,N.entity,c);if(!oe)break;X={...X,dbAttrs:oe}}s.push({kind:"attribute.update",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,attributeRef:R.value.modelId,patch:X}),_.attrPatches.push({entityId:E.value.modelId,attributeId:R.value.modelId,patch:X});{const W=R.value,oe=qm(W,X),de=(oe.identifier??!1)!==(W.identifier??!1),ie=(W.identifier||oe.identifier)&&("type"in X||"customType"in X||"dbAttrs"in X||Object.keys(X).some(Ie=>Ie.startsWith("dbAttrs.")));(de||ie)&&_.identifierCascadeParents.add(E.value.modelId)}}else{const I=Jn(e,E.value.modelId,R.value.modelId);if(I){const x=$=>{var U;return((U=e.entities.find(F=>F.modelId===$))==null?void 0:U.name)??$};c.push({code:"attribute-fk-managed",opIndex:A,entity:N.entity,handle:N.attribute,association:{from:x(I.end1.entityRef),to:x(I.end2.entityRef)}});break}ei(s,b,E.value.modelId,R.value.modelId),R.value.identifier&&_.identifierCascadeParents.add(E.value.modelId)}break}case"association.add":{{const F=gn(N.spec,__);if(F.length){c.push({code:"association-spec-unknown-key",opIndex:A,handle:{from:N.spec.from,to:N.spec.to},keys:F});break}}const E=Tt(e,N.spec.from),R=Tt(e,N.spec.to);if(E.ok||c.push(Mt(E.reason,A,N.spec.from,E.matches,v)),R.ok||c.push(Mt(R.reason,A,N.spec.to,R.matches,v)),!E.ok||!R.ok)break;if(N.spec.identifying&&E.value.modelId===R.value.modelId){c.push({code:"self-identifying",opIndex:A,handle:{from:N.spec.from,to:N.spec.to}});break}if(E.value.stereotype==="JPA_EMBEDDABLE"||R.value.stereotype==="JPA_EMBEDDABLE"){c.push({code:"embeddable-relation-unsupported",opIndex:A,handle:{from:N.spec.from,to:N.spec.to}});break}if(E.value.stereotype==="SERIALIZED_TYPE"||R.value.stereotype==="SERIALIZED_TYPE"){c.push({code:"serialized-relation-invalid",opIndex:A,handle:{from:N.spec.from,to:N.spec.to}});break}const I=a(),x={modelId:I,...N.spec.identifying!=null?{identifying:N.spec.identifying}:{},end1:{entityRef:E.value.modelId,multiplicity:N.spec.fromMultiplicity??"EXACTLY_ONE_INSTANCE",navigable:!1,composition:!1},end2:{entityRef:R.value.modelId,multiplicity:N.spec.toMultiplicity??"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:N.spec.composition??!1}},$={...e,associations:[...e.associations,x]},U=Ci($,R.value.modelId,a);U.add[0]&&(x.end2.attributeRef=U.add[0].modelId),s.push({kind:"association.add",casUnit:"logical",associationRef:I,value:x}),_.addedAssociations.push(x);for(const F of U.add){const B={...F,order:f(R.value.modelId,R.value.attributes)};s.push({kind:"attribute.add",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,value:B}),_.cascadeAdds.push({entityId:R.value.modelId,attribute:B})}break}case"association.remove":{const E=Tt(e,N.association.from),R=Tt(e,N.association.to);if(E.ok||c.push(Mt(E.reason,A,N.association.from,E.matches,v)),R.ok||c.push(Mt(R.reason,A,N.association.to,R.matches,v)),!E.ok||!R.ok)break;const I=Vm(e,E.value.modelId,R.value.modelId);if(I.length!==1){c.push(I.length===0?{code:"association-not-found",opIndex:A,handle:N.association}:{code:"association-ambiguous",opIndex:A,handle:N.association,matches:I.map(F=>F.modelId)});break}const x=I[0];y.has(x.modelId)||(y.add(x.modelId),s.push({kind:"association.remove",casUnit:"logical",associationRef:x.modelId}));const $=e.entities.find(F=>F.attributes.some(B=>{var j;return((j=B.embedded)==null?void 0:j.associationRef)===x.modelId}));if($){const F=$.attributes.find(B=>{var j;return((j=B.embedded)==null?void 0:j.associationRef)===x.modelId});ei(s,b,$.modelId,F.modelId);break}if(x.end1.attributeRef){const F=e.entities.find(j=>j.modelId===x.end1.entityRef),B=F==null?void 0:F.attributes.find(j=>j.modelId===x.end1.attributeRef&&j.attrType==="RELATION_REF");B&&ei(s,b,F.modelId,B.modelId)}const U={...e,associations:e.associations.filter(F=>F.modelId!==x.modelId)};ds(s,U,[x.end2.entityRef],a,_,b,f);break}case"association.update":{const E=Jm(e,N.association,A,c,v);if(!E)break;const R=N.patch.identifying,I=typeof R=="boolean"?R:void 0;if(I===!0&&E.end1.entityRef===E.end2.entityRef){c.push({code:"self-identifying",opIndex:A,handle:N.association});break}const x=vo(N.patch,w_);if(x.length){c.push({code:"association-patch-unknown-key",opIndex:A,handle:N.association,keys:x});break}if(s.push({kind:"association.update",casUnit:"logical",containerRef:E.modelId,associationRef:E.modelId,patch:N.patch}),_.assocPatches.push({associationRef:E.modelId,patch:N.patch}),I!==void 0&&I!==(E.identifying??!1)){const $={...e,associations:e.associations.map(U=>U.modelId===E.modelId?{...U,identifying:I}:U)};ds(s,$,[E.end2.entityRef],a,_,b,f)}break}case"associationEnd.update":{const E=Jm(e,N.association,A,c,v);if(!E)break;const R=N.end==="from"?"end1":"end2";if(Object.prototype.hasOwnProperty.call(N.patch,"navigable")){if(R==="end2"){c.push({code:"navigable-toggle-unsupported",opIndex:A,handle:N.association});break}const x=N.patch.navigable===!0;if(E.end1.navigable!==x){const $=Am(e,E.modelId,x);if($){const U=on(E.modelId,"end1",{...N.patch,...$.endPatch}),F=vu({logical:e,layout:Tm},[...$.cmds,U]);s.push(...F.ops);break}}}const I=vo(N.patch,I_,["jpa."]);if(I.length){c.push({code:"association-end-patch-unknown-key",opIndex:A,handle:N.association,keys:I});break}s.push({kind:"associationEnd.update",casUnit:"logical",containerRef:E.modelId,associationRef:E.modelId,end:R,patch:N.patch}),_.endPatches.push({associationRef:E.modelId,end:R,patch:N.patch});break}case"index.add":{{const I=gn(N.spec,Hm);if(I.length){c.push({code:"index-spec-unknown-key",opIndex:A,entity:N.entity,handle:{ref:N.spec.name},keys:I});break}}const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}const R=Ym(E.value,N.spec,A,N.entity,c,a);if(!R)break;s.push({kind:"index.add",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,indexRef:R.modelId,value:R});break}case"index.update":case"index.remove":{const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}if(cs(N.index)){c.push({code:"handle-by-unsupported",opIndex:A,entity:N.entity,handle:N.index,target:"index"});break}const R=y_(E.value,N.index);if(!R.ok){c.push(R.reason==="not-found"?{code:"index-not-found",opIndex:A,entity:N.entity,handle:N.index}:{code:"index-ambiguous",opIndex:A,entity:N.entity,handle:N.index,matches:R.matches});break}if(N.kind==="index.update"){if("columns"in N.patch){c.push({code:"index-columns-patch-unsupported",opIndex:A,entity:N.entity,handle:N.index});break}const I=vo(N.patch,v_);if(I.length){c.push({code:"index-patch-unknown-key",opIndex:A,entity:N.entity,handle:N.index,keys:I});break}s.push({kind:"index.update",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,indexRef:R.value.modelId,patch:N.patch})}else s.push({kind:"index.remove",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,indexRef:R.value.modelId});break}case"operation.add":{{const x=gn(N.spec,jm);if(x.length){c.push({code:"operation-spec-unknown-key",opIndex:A,entity:N.entity,handle:{ref:N.spec.name},keys:x});break}}const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}const R=p.get(E.value.modelId)??(E.value.operations?Jt(E.value.operations):0);p.set(E.value.modelId,R+1);const I=Gm(N.spec,R,a);s.push({kind:"operation.add",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,operationRef:I.modelId,value:I});break}case"operation.update":case"operation.remove":{const E=Tt(e,N.entity);if(!E.ok){c.push(Mt(E.reason,A,N.entity,E.matches,v));break}if(cs(N.operation)){c.push({code:"handle-by-unsupported",opIndex:A,entity:N.entity,handle:N.operation,target:"operation"});break}const R=Dm(E.value,N.operation);if(!R.ok){c.push(R.reason==="not-found"?{code:"operation-not-found",opIndex:A,entity:N.entity,handle:N.operation}:{code:"operation-ambiguous",opIndex:A,entity:N.entity,handle:N.operation,matches:R.matches});break}if(N.kind==="operation.update"){const I=vo(N.patch,C_);if(I.length){c.push({code:"operation-patch-unknown-key",opIndex:A,entity:N.entity,handle:N.operation,keys:I});break}s.push({kind:"operation.update",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,operationRef:R.value.modelId,patch:N.patch})}else s.push({kind:"operation.remove",casUnit:"logical",containerRef:E.value.modelId,entityRef:E.value.modelId,operationRef:R.value.modelId});break}case"attribute.reorder":case"operation.reorder":{const E=N.kind==="attribute.reorder",R=Tt(e,N.entity);if(!R.ok){c.push(Mt(R.reason,A,N.entity,R.matches,v));break}const I=E?N.order:N.operations;if(I.length===0){c.push({code:"reorder-empty",opIndex:A,entity:N.entity});break}const x=[],$=new Set;let U=!1;for(const X of I){if(!E&&cs(X)){c.push({code:"handle-by-unsupported",opIndex:A,entity:N.entity,handle:X,target:"operation"}),U=!0;continue}const W=E?Lm(R.value,X):Dm(R.value,X);if(!W.ok){c.push(W.reason==="not-found"?{code:"reorder-handle-not-found",opIndex:A,entity:N.entity,handle:X}:{code:"reorder-handle-ambiguous",opIndex:A,entity:N.entity,handle:X,matches:W.matches}),U=!0;continue}if($.has(W.value.modelId)){c.push({code:"reorder-handle-duplicate",opIndex:A,entity:N.entity,handle:X}),U=!0;continue}$.add(W.value.modelId),x.push(W.value)}if(U)break;const B=[...E?R.value.attributes:R.value.operations??[]].sort((X,W)=>X.order-W.order).filter(X=>!$.has(X.modelId)),j=[...x,...B];if(j.forEach((X,W)=>{X.order!==W&&s.push(E?{kind:"attribute.update",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,attributeRef:X.modelId,patch:{order:W}}:{kind:"operation.update",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,operationRef:X.modelId,patch:{order:W}})}),E)for(const X of _m(e,R.value.modelId,j.map(W=>W.modelId)))s.push({kind:"attribute.update",casUnit:"logical",containerRef:X.entityId,entityRef:X.entityId,attributeRef:X.attributeId,patch:{dbAttrs:X.dbAttrs}});break}case"group.add":{{const $=gn(N.spec,E_);if($.length){c.push({code:"group-spec-unknown-key",opIndex:A,keys:$});break}}const E=[];let R=!1;for(const $ of N.spec.members){const U=Tt(e,$);if(!U.ok){c.push(Mt(U.reason,A,$,U.matches,v)),R=!0;continue}E.push(U.value.modelId)}if(R)break;const I=a(),x={modelId:I,excludeDDLGeneration:N.spec.excludeDDLGeneration??!1,memberEntityRefs:E,...N.spec.name?{name:N.spec.name}:{},...N.spec.packageName?{packageName:N.spec.packageName}:{},...N.spec.description?{description:N.spec.description}:{}};s.push({kind:"group.add",casUnit:"logical",groupRef:I,value:x});break}case"group.update":{const E=ls(e,N.group);if(!E.ok){c.push(ss(E,A,N.group));break}const R=vo(N.patch,d_);if(R.length){c.push({code:"group-patch-unknown-key",opIndex:A,handle:N.group,keys:R});break}s.push({kind:"group.update",casUnit:"logical",containerRef:E.value.modelId,groupRef:E.value.modelId,patch:N.patch});break}case"group.remove":{const E=ls(e,N.group);if(!E.ok){c.push(ss(E,A,N.group));break}s.push({kind:"group.remove",casUnit:"logical",groupRef:E.value.modelId});break}case"group.addMember":case"group.removeMember":{const E=ls(e,N.group);if(!E.ok){c.push(ss(E,A,N.group));break}const R=Tt(e,N.entity);if(!R.ok){c.push(Mt(R.reason,A,N.entity,R.matches,v));break}const I=E.value.memberEntityRefs.includes(R.value.modelId);if(N.kind==="group.addMember"?I:!I)break;if(N.kind==="group.removeMember"){if(h.has(C(E.value.modelId,R.value.modelId)))break;h.add(C(E.value.modelId,R.value.modelId))}s.push({kind:N.kind,casUnit:"logical",containerRef:E.value.modelId,groupRef:E.value.modelId,entityRef:R.value.modelId});break}}}),c.length||M_(s,e,g,y,b,k,_,a,f),c.length||x_(s,e,b,g),c.length||$_(s,e,b,k,g,a),c.length?{ok:!1,errors:c}:d.length?{ok:!0,ops:s,notices:d}:{ok:!0,ops:s}}function Mt(e,n,o,i,a){return e==="shape"?{code:"handle-shape-invalid",opIndex:n,where:"entity",expected:"{ref, by?}",got:us(o)}:e==="not-found"&&(a!=null&&a.has(o.ref))?{code:"pending-entity-ref",opIndex:n,handle:o}:e==="not-found"?{code:"entity-not-found",opIndex:n,handle:o}:{code:"entity-ambiguous",opIndex:n,handle:o,matches:i}}const Za=e=>!!e&&typeof e=="object"&&typeof e.ref=="string",P_=e=>!!e&&typeof e=="object"&&Za(e.from)&&Za(e.to),us=e=>e===void 0?"undefined":e===null?"null":typeof e!="object"?typeof e:`{${Object.keys(e).join(",")}}`;function z_(e,n,o){const i=e,a=[];for(const l of["attribute","index","operation","group"])l in i&&a.push([l,i[l],Za(i[l])]);(e.kind==="association.update"||e.kind==="association.remove"||e.kind==="associationEnd.update")&&a.push(["association",i.association,P_(i.association)]);let r=!0;for(const[l,s,c]of a)c||(r=!1,o.push({code:"handle-shape-invalid",opIndex:n,where:l,expected:l==="association"?"{from:{ref}, to:{ref}}":"{ref, by?}",got:us(s)}));return r}function Jm(e,n,o,i,a){const r=Tt(e,n.from),l=Tt(e,n.to);if(r.ok||i.push(Mt(r.reason,o,n.from,r.matches,a)),l.ok||i.push(Mt(l.reason,o,n.to,l.matches,a)),!r.ok||!l.ok)return null;const s=Vm(e,r.value.modelId,l.value.modelId);return s.length!==1?(i.push(s.length===0?{code:"association-not-found",opIndex:o,handle:n}:{code:"association-ambiguous",opIndex:o,handle:n,matches:s.map(c=>c.modelId)}),null):s[0]}const Xm={type:"object",description:"요소 지정 핸들. 엔티티: 물리명(table.physicalName) 우선, 논리명(name) 보조. 속성: 소속 엔티티 내 속성명 또는 컬럼 물리명.",properties:{ref:{type:"string",description:"매칭할 이름/물리명. by:'modelId'면 modelId 원문."},by:{type:"string",enum:["physicalName","name","modelId"],description:"매칭 키 고정(미지정 시 대상별 기본 순서). 'modelId'는 모호 해소 전용 탈출구 — 평시엔 쓰지 말고, entity-ambiguous 응답의 후보를 사용자에게 제시해 확인받은 뒤 그 modelId로 재전송할 때만 쓴다."}},required:["ref"],additionalProperties:!1},F_={type:"object",description:"엔티티 내 이름으로 지정(인덱스명·메서드명). 물리명 차원이 없어 매칭 키 고정(`by`)을 받지 않는다.",properties:{ref:{type:"string",description:"매칭할 이름."}},required:["ref"],additionalProperties:!1},U_={type:"object",description:"관계는 무명이라 양 끝 엔티티로 주소. from=부모(end1), to=자식(end2). 같은 쌍 복수 관계는 모호 보고.",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"}},required:["from","to"],additionalProperties:!1},an={type:"object",properties:{ko:{type:"string"},en:{type:"string"},ja:{type:"string"},zh:{type:"string"}},additionalProperties:!1},H_={type:"object",description:"신규 엔티티. 자식(속성·인덱스·operation)은 별도 attribute.add 등이 아니라 여기 inline 배열로 담아라 — 같은 배치에서 갓 추가된 엔티티에 닿는 child op은 silent no-op이 된다(서버가 pending-entity-ref로 거부). 관계는 inline 불가 → 엔티티 추가 배치 확정 후 별도 배치로 association.add.",properties:{name:{type:"string"},stereotype:{type:"string",enum:["UNDEFINED","JPA_ENTITY","JPA_EMBEDDABLE","JPA_MULTI_LANGUAGE_ENTITY","SERIALIZED_TYPE"],description:"기본 JPA_ENTITY."},physicalName:{type:"string",description:"설정 시 table.physicalName."},classLogicalName:{...an,description:"**클래스** 논리명(다국어). 테이블이 없는 자리(직렬화 타입 SERIALIZED_TYPE)의 논리명이 여기 산다 — 그 타입은 table 자체를 갖지 않아 table.logicalName 을 줄 데가 없다. ⚠️테이블이 있는 엔티티는 table.logicalName 이 이기므로 그쪽을 쓴다."},useVersion:{type:"boolean",description:'JPA @Version(낙관적 락) → jpaAttrs.useVersion. @Version 필드는 별도 속성이 아니라 이 엔티티 플래그로 흡수 (버전 컬럼은 코드젠 소유). 기존 엔티티는 entity.update patch의 dotted key {"jpaAttrs.useVersion":true} 사용.'},attributes:{type:"array",description:"inline 속성(배열 순서가 order). attribute.add와 동일 규칙 — GroupCodeEnum은 groupCode 동반 필수.",items:{$ref:"#/$defs/attrSpec"}},indexes:{type:"array",description:"inline 인덱스. 컬럼 핸들은 이 엔티티가 inline으로 만드는 dbAttr 내에서 해소된다(attributes 동반 전제).",items:{$ref:"#/$defs/indexSpec"}},operations:{type:"array",description:"inline 도메인 메서드(배열 순서가 order).",items:{$ref:"#/$defs/operationSpec"}},serialization:{$ref:"#/$defs/serialization"}},required:["name"],additionalProperties:!1},j_={type:"object",description:"직렬화 타입의 컨테이너(SERIALIZED_TYPE 전용). 미지정 = 컬렉션이 아닌 단일 값(한 컬럼에 구조 하나). 신규 엔티티는 entity.add 에 함께 줘야 한다 — 같은 배치의 entity.update 는 갓 만든 엔티티에 닿지 못한다.",properties:{collectionType:{type:"string",enum:["LIST","SET","MAP"],description:"컨테이너 종류. 코퍼스 실재가 java.util 3종뿐이라 그만 표현한다(미지 컨테이너는 발명하지 않는다)."},mapKeyType:{type:"string",description:"collectionType='MAP' 일 때의 키 타입(단순명 또는 FQN). 그 외엔 무의미."}},additionalProperties:!1},K_={type:"object",properties:{name:{type:"string"},type:{type:"string",description:"Java 타입(예: Long, String). GroupCodeEnum은 파생 타입이라 groupCode 동반 필수(없으면 거부). 호스트 임베더블 카탈로그에 등록된 predefined 임베더블 타입(예: Money, EmbeddableAddress)이면 EMBED_PREDEF로 다중 컬럼 확장(서브컬럼 조정은 embeddableOverrides)."},identifier:{type:"boolean"},notNull:{type:"boolean"},transient:{type:"boolean",description:"JPA @Transient(비영속) → Attribute.transient. 컬럼을 만들지 않으므로 physicalName/dataType 등 컬럼 필드는 함께 주지 않는다. 기존 속성은 attribute.update patch {transient:true}로도 가능."},physicalName:{type:"string",description:"설정 시 단일 dbAttr 컬럼 생성(미설정이면 name을 물리명으로)."},dataType:{type:"string",description:"dbAttr 물리 타입(예: BIGINT). physicalName/dataType/length/scale 중 하나라도 있으면 컬럼 생성."},length:{type:"integer",description:"dbAttr 컬럼 길이(VARCHAR(n)·DECIMAL precision)."},scale:{type:"integer",description:"dbAttr 소수 자릿수(DECIMAL/NUMERIC scale). length 동반이 일반적."},groupCode:{type:"string",description:"코드성 속성의 group code 바인딩. type=GroupCodeEnum이면 필수."},defaultValue:{type:"string",description:"속성 기본값(문자열 패스스루)."},attributeGroup:{type:"string",description:"속성 분류 그룹(예: 'code'·'amt')."},description:{...an,description:"속성 설명(다국어)."},columnLogicalName:{...an,description:'dbAttr 컬럼 논리명(다국어, 예: {ko:"체크아웃유형"}). 한글 업무명 보존 위치.'},fieldLogicalName:{...an,description:"**필드** 논리명(다국어). 평탄 `logicalName`(컬럼 논리명)과 **다른 축**이다 — 컬럼이 없는 자리(직렬화 타입 SERIALIZED_TYPE 의 자기 필드)는 dbAttrs 가 0이라 컬럼 논리명을 줄 데가 없고, 그 자리의 논리명이 여기 산다(캔버스 논리 뷰·탐색기 검색·코드젠 javadoc 이 읽는다). 컬럼이 있는 자리에서는 컬럼 논리명이 이긴다."},unique:{type:"boolean",description:"dbAttr UNIQUE 제약."},updatable:{type:"boolean",description:"dbAttr 갱신 가능(JPA @Column(updatable=))."},embeddableOverrides:{$ref:"#/$defs/embeddableOverrides"},collectionType:{type:"string",enum:["LIST","SET"],description:"이 «필드»가 컬렉션인가 — **직렬화 타입(SERIALIZED_TYPE)의 자기 필드 전용**(예: Set<String>·List<StoredFile>). 컬럼 있는 자리는 읽지 않는다 — 그쪽 컨테이너는 요소 타입이 소유한다(entity 의 serialization.collectionType). 요소가 문서 안 직렬화 타입이면 그 타입이 이미 감싸므로 지정하지 않는다. 미지정 = 컬렉션 아님."}},required:["name","type"],additionalProperties:!1},G_={type:"array",description:"predefined 임베더블 서브컬럼 오버라이드(속성 type이 카탈로그 엔트리이자 EMBED_PREDEF일 때만). field=카탈로그 필드명으로 매칭(@AttributeOverride 대응). 미설정 서브컬럼은 add=카탈로그 기본 상속 / update=기존값 유지. currency 등 공유 컬럼은 sharedColumnPhysicalName으로 SHARED_REF. ⚠️바인딩 축만 덮는다 — 서브컬럼 **논리명**은 여기 없고 patch의 dotted `dbAttrs.<i>.logicalName`이 받는다.",items:{type:"object",properties:{field:{type:"string",description:"대상 카탈로그 필드명(예: amount·currency)."},physicalName:{type:"string",description:"서브컬럼 물리명 오버라이드(@AttributeOverride column name). 미설정 시 카탈로그 기본."},length:{type:"integer",description:"서브컬럼 길이 오버라이드."},scale:{type:"integer",description:"서브컬럼 소수 자릿수 오버라이드."},insertable:{type:"boolean",description:"JPA @Column(insertable=). OWN 컬럼에만 저장."},updatable:{type:"boolean",description:"JPA @Column(updatable=). OWN 컬럼에만 저장."},notNull:{type:"boolean",description:"JPA @Column(nullable=false) — **이 서브컬럼 하나의** NOT NULL. 미설정이면 속성 축(notNull)을 따른다. ★임베더블은 컬럼마다 제약이 갈릴 수 있어(실측: ChangedBy 는 type 컬럼만 NOT NULL) 속성 축 하나로는 담기지 않는다. OWN 컬럼에만 저장."},sharedColumnPhysicalName:{type:"string",description:"SHARED_REF — 같은 엔터티(임베더블이면 owner 합집합) 다른 컬럼(물리명)을 공유해 read-only 투영(대표: currency). 설정 시 자체 컬럼 미보유, 타깃은 해소 시점 존재 필수."}},required:["field"],additionalProperties:!1}},Zm={type:"string",enum:["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"]},Y_={type:"object",description:'일반 연관 생성. 양 end 는 일반 엔티티여야 한다 — 임베더블(JPA_EMBEDDABLE)·직렬화 타입을 end 로 주면 거부된다. 직렬화 타입은 관계가 아니라 소비 속성의 type 으로 지목한다(attribute.update {type: "<타입명>"}). (임베드는 EMBED 관계여야 하고 이 어휘엔 없다 → 캔버스에서 연결).',properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"},fromMultiplicity:{...Zm,description:"end1 다중성(기본 EXACTLY_ONE_INSTANCE)."},toMultiplicity:{...Zm,description:"end2 다중성(기본 ZERO_OR_MORE_INSTANCES)."},identifying:{type:"boolean",description:"식별 관계(부모 PK가 자식 PK로 전파). self-association은 식별 불가."},composition:{type:"boolean",description:"end2 composition."}},required:["from","to"],additionalProperties:!1},q_={type:"object",properties:{name:{type:"string"},unique:{type:"boolean",description:"UNIQUE 인덱스 여부(기본 false)."},columns:{type:"array",description:"인덱스 컬럼(순서 의미 있음).",items:{type:"object",properties:{column:{...Xm,description:"컬럼 핸들 — 컬럼 물리명 우선, 속성명 보조(단일 컬럼 속성만). 엔티티 내에서 dbAttr modelId로 해소."},descending:{type:"boolean",description:"내림차순(기본 false)."}},required:["column"],additionalProperties:!1}},description:{type:"string",description:"인덱스 설명(평문)."},parameters:{type:"string",description:"인덱스 파라미터(패스스루)."}},required:["name","columns"],additionalProperties:!1},W_={type:"object",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"],description:"가시성(기본 미설정)."},sourceCode:{type:"string",description:"Java 메서드 본문(멀티라인, 파라미터·반환 시그니처 포함)."},description:{...an,description:"메서드 설명(다국어)."},personalInfoAttributeType:{type:"string",description:"개인정보 속성 유형(패스스루)."}},required:["name"],additionalProperties:!1},J_={type:"object",properties:{name:{...an,description:'그룹 논리명(다국어, 예: {ko:"주문"}).'},packageName:{type:"string",description:"자바 패키지명 등 그룹 물리 식별(레거시 LogicalGroup.packageName)."},description:{type:"string",description:"그룹 설명(자유 텍스트 — 도메인 경계 메모)."},excludeDDLGeneration:{type:"boolean",description:"DDL 생성 제외(기본 false)."},members:{type:"array",description:"멤버 엔티티 핸들(물리명 우선/논리명 보조). 기존 엔티티여야 함 — 같은 배치 신규 엔티티는 별도 배치 후.",items:{$ref:"#/$defs/handle"}}},required:["members"],additionalProperties:!1},X_={type:"object",description:'기존 속성 부분 patch. 논리 필드 + 스칼라 단일 컬럼의 물리 필드(physicalName·dataType·length·scale 등 — 서버가 dbAttrs[0]에 매핑). ⚠️평탄 물리 키는 **attrType 이 NORMAL 이고 컬럼이 하나일 때만** 매핑된다 — FK 파생(RELATION_*)·임베드·직렬화 타입 자리에서는 거부되고 **dotted 로 지목**해야 한다(`{"dbAttrs.0.physicalName":"…"}`). EMBED_PREDEF/Money 서브컬럼 «바인딩» 조정만 op-레벨 embeddableOverrides 소관이다(그 배열엔 논리명·dataType 축이 없다). ★다중 컬럼 속성의 **개별 컬럼 필드**는 dotted 키로 지목한다 — `{"dbAttrs.<i>.logicalName":{ko:"…"}}` 처럼. dotted 허용 접두는 `dbAttrs.` 하나뿐이고, 같은 op에서 평탄 키와 섞으면 $set 충돌로 거부된다.',properties:{name:{type:"string"},type:{type:"string",description:"자바 타입. **컬럼 개수가 바뀌는 전환만 거부된다**(임베더블 타입으로 1→N, 임베더블을 다른 타입으로 N→1). 그 전환은 attribute.remove + attribute.add 로 내고(자리를 지키려면 같은 배치에 attribute.reorder). ★반대로 **개수가 같은 값 타입 재지정은 이 patch 하나로 된다** — 1컬럼 속성을 1필드 임베더블로 바꾸는 등. attrType은 목적지에서 파생되므로 생략해도 되고(EMBED_PREDEF로 자동), 실어 보내면 그 파생값과 같아야 한다. dbAttrs는 modelId째 보존되어 물리명·논리명·길이·인덱스 ref·order가 그대로 살아남는다. 임베드 서브컬럼 «바인딩» 조정만 embeddableOverrides 소관이다."},customType:{type:"string"},attrType:{type:"string",enum:[...gm],description:"속성 종류. **현재 값과 다르게 주면 거부된다** — 관계/임베드/구분선은 동반 구조(관계 소유·embedded·빈 dbAttrs)가 있어야 성립하고 patch로는 표현할 수 없다. 관계 실체화는 association.add, 임베드 서브컬럼은 embeddableOverrides 소관. ★예외 하나 — 같은 patch의 type이 «컬럼 개수가 같은» 임베더블을 가리키면 NORMAL→EMBED_PREDEF 동반 전환이 허용된다(생략해도 파생된다)."},identifier:{type:"boolean"},notNull:{type:"boolean"},transient:{type:"boolean"},naturalId:{type:"boolean"},naturalIdMutable:{type:"boolean"},derivedIdFieldName:{type:"string",description:"파생 식별(@MapsId) FK가 매핑되는 **스칼라 @Id 필드명**. 이 속성의 name은 연관 필드명(@MapsId @OneToOne 필드)이고 같은 관계가 두 Java 필드를 만든다. 단일 컬럼 @OneToOne 식별 FK에만 의미가 있고, 미설정 시 부모 PK 물리명의 camelCase로 파생된다(실물 관행). 컬럼은 공유하므로 속성은 하나이며 물리명은 지정하지 않는다."},description:{...an,description:"속성 설명(다국어)."},fieldLogicalName:{...an,description:"**필드** 논리명(다국어). 평탄 `logicalName`(컬럼 논리명)과 **다른 축**이다 — 컬럼이 없는 자리(직렬화 타입 SERIALIZED_TYPE 의 자기 필드)는 dbAttrs 가 0이라 컬럼 논리명을 줄 데가 없고, 그 자리의 논리명이 여기 산다(캔버스 논리 뷰·탐색기 검색·코드젠 javadoc 이 읽는다). 컬럼이 있는 자리에서는 컬럼 논리명이 이긴다."},attributeGroup:{type:"string"},groupCode:{type:"string"},defaultValue:{type:"string"},personalInfoAttributeType:{type:"string"},order:{type:"integer"},physicalName:{type:"string"},dataType:{type:"string"},length:{type:"integer"},scale:{type:"integer"},unique:{type:"boolean"},updatable:{type:"boolean"},insertable:{type:"boolean"},autoIncrement:{type:"boolean"},multiValue:{type:"boolean"},multiValueSeparator:{type:"string"},sequenceName:{type:"string"},logicalName:{...an,description:"**컬럼** 논리명(다국어). 대상이 스칼라 단일 컬럼일 때 dbAttrs[0]에 매핑된다. ★대상이 **다중 컬럼**(EMBED_PREDEF·Money 등)이면 이 평탄 키는 «어느 컬럼인지 모호» 로 거부되고, dotted `dbAttrs.<i>.logicalName` 이 그 값을 받는다(embeddableOverrides 에는 논리명 축이 없다). dbAttrs 가 0인 속성(직렬화 타입 필드·transient)에 주면 거부되고, 그 자리는 `fieldLogicalName` 이 받는다."}},additionalProperties:!1},Z_={type:"object",description:"관계 부분 patch. 양 end 설정(multiplicity·nav·jpa)은 associationEnd.update로.",properties:{description:{type:"string"},identifying:{type:"boolean",description:"식별 관계(부모 PK가 자식 PK 일부로 전파)."}},additionalProperties:!1},Q_={type:"object",description:"인덱스 부분 patch. columns(컬럼 구성) 변경은 index.remove+index.add로(패치 불가).",properties:{name:{type:"string"},unique:{type:"boolean"},description:{type:"string"},parameters:{type:"string"}},additionalProperties:!1},eE={type:"object",description:"메서드 부분 patch.",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"]},sourceCode:{type:"string"},description:{...an,description:"메서드 설명(다국어)."},order:{type:"integer"},personalInfoAttributeType:{type:"string"}},additionalProperties:!1},tE={type:"object",description:'엔티티 부분 patch. 논리 키: name·stereotype·packageName·superClass·schema·description·abstractClass·hasPersonalInfo·referenceOnly·declarationOfInterfaces·table·serialization·classLogicalName. classLogicalName = **클래스** 논리명(테이블 없는 직렬화 타입의 논리명이 사는 곳 — 그 타입은 table 을 갖지 않는다). 테이블이 있는 엔티티는 table.logicalName(dotted-key)이 이긴다. serialization(직렬화 타입 컨테이너)은 통째로 주거나(예: {"serialization":{"collectionType":"LIST"}}) dotted-key로 준다({"serialization.collectionType":"LIST"}). 컬렉션 아님으로 되돌릴 땐 null 로 비운다(wire clear 규약). jpaAttrs 플래그(useVersion 등)는 형제 클로버 방지를 위해 dotted-key로 준다: {"jpaAttrs.useVersion": true}. 자식(attributes/indexes/operations)은 patch가 아니라 전용 op로 변경. stereotype 은 값 타입(JPA_EMBEDDABLE·SERIALIZED_TYPE) 경계를 넘을 수 없다 — 들어가고 나오는 전환은 PK 해제/부여·FK reconcile·EMBED 복원/해체가 동반되는 composite라 patch로 표현되지 않는다(거부. 전환은 GUI 소관).'},nE={type:"object",description:'관계 end 부분 patch. 논리 키: multiplicity·navigable·composition. jpa 설정(cascadeTypes·fetchType·orphanRemoval·orderBy·collectionType·collectionTable·orderColumn)은 형제 클로버 방지를 위해 dotted-key로: {"jpa.orphanRemoval": true}.'};function pt(e,n){return{type:"object",properties:{kind:{const:e},...n.properties},required:["kind",...n.required],additionalProperties:!1}}const oE={"entity.add":pt("entity.add",{properties:{spec:{$ref:"#/$defs/entitySpec"}},required:["spec"]}),"entity.update":pt("entity.update",{properties:{entity:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/entityUpdatePatch"}},required:["entity","patch"]}),"entity.remove":pt("entity.remove",{properties:{entity:{$ref:"#/$defs/handle"}},required:["entity"]}),"attribute.add":pt("attribute.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/attrSpec"}},required:["entity","spec"]}),"attribute.update":pt("attribute.update",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/attrUpdatePatch"},embeddableOverrides:{$ref:"#/$defs/embeddableOverrides"}},required:["entity","attribute","patch"]}),"attribute.remove":pt("attribute.remove",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"}},required:["entity","attribute"]}),"association.add":pt("association.add",{properties:{spec:{$ref:"#/$defs/assocSpec"}},required:["spec"]}),"association.remove":pt("association.remove",{properties:{association:{$ref:"#/$defs/assocHandle"}},required:["association"]}),"association.update":pt("association.update",{properties:{association:{$ref:"#/$defs/assocHandle"},patch:{$ref:"#/$defs/assocUpdatePatch"}},required:["association","patch"]}),"associationEnd.update":pt("associationEnd.update",{properties:{association:{$ref:"#/$defs/assocHandle"},end:{type:"string",enum:["from","to"],description:"from=부모(end1), to=자식(end2)."},patch:{$ref:"#/$defs/assocEndUpdatePatch"}},required:["association","end","patch"]}),"index.add":pt("index.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/indexSpec"}},required:["entity","spec"]}),"index.update":pt("index.update",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/nameHandle"},patch:{$ref:"#/$defs/indexUpdatePatch"}},required:["entity","index","patch"]}),"index.remove":pt("index.remove",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/nameHandle"}},required:["entity","index"]}),"operation.add":pt("operation.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/operationSpec"}},required:["entity","spec"]}),"operation.update":pt("operation.update",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/nameHandle"},patch:{$ref:"#/$defs/operationUpdatePatch"}},required:["entity","operation","patch"]}),"operation.remove":pt("operation.remove",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/nameHandle"}},required:["entity","operation"]}),"attribute.reorder":pt("attribute.reorder",{properties:{entity:{$ref:"#/$defs/handle"},order:{type:"array",items:{$ref:"#/$defs/handle"}}},required:["entity","order"]}),"operation.reorder":pt("operation.reorder",{properties:{entity:{$ref:"#/$defs/handle"},operations:{type:"array",items:{$ref:"#/$defs/nameHandle"}}},required:["entity","operations"]}),"group.add":pt("group.add",{properties:{spec:{$ref:"#/$defs/groupSpec"}},required:["spec"]}),"group.update":pt("group.update",{properties:{group:{$ref:"#/$defs/groupHandle"},patch:{$ref:"#/$defs/groupUpdatePatch"}},required:["group","patch"]}),"group.remove":pt("group.remove",{properties:{group:{$ref:"#/$defs/groupHandle"}},required:["group"]}),"group.addMember":pt("group.addMember",{properties:{group:{$ref:"#/$defs/groupHandle"},entity:{$ref:"#/$defs/handle"}},required:["group","entity"]}),"group.removeMember":pt("group.removeMember",{properties:{group:{$ref:"#/$defs/groupHandle"},entity:{$ref:"#/$defs/handle"}},required:["group","entity"]})},iE={type:"object",description:"그룹 지정 핸들. 패키지명(packageName) 우선, 이름(name) 보조 — 이름은 다국어라 어느 로케일 값이든 일치하면 매칭. 'modelId'는 모호 해소 전용(group-ambiguous 후보를 사용자에게 확인받은 뒤).",properties:{ref:{type:"string",description:"매칭할 패키지명/이름. by:'modelId'면 modelId 원문."},by:{type:"string",enum:["packageName","name","modelId"],description:"매칭 키 고정(미지정 시 packageName → name)."}},required:["ref"],additionalProperties:!1},aE={type:"object",description:"그룹 부분 patch. 멤버 변경은 group.addMember/removeMember로(배열 통째 교체는 동시 편집이 서로를 덮는다).",properties:{name:{...an,description:"그룹 논리명(다국어)."},packageName:{type:"string"},description:{type:"string"},excludeDDLGeneration:{type:"boolean"}},additionalProperties:!1},Qm={anyOf:ym.map(e=>oE[e])},rE={type:"object",description:"엔티티 모델을 생성·수정·삭제할 때 호출한다. ops는 사람 핸들(엔티티 물리명/논리명, 속성명)로 지정하며 서버가 modelId로 해소한다. 모호하면 에러로 후보를 돌려주니 리소스로 현재 모델을 먼저 읽어 핸들을 확정하라.",properties:{ops:{type:"array",items:{$ref:"#/$defs/symbolicOp"}}},required:["ops"],additionalProperties:!1,$defs:{handle:Xm,nameHandle:F_,groupHandle:iE,assocHandle:U_,entitySpec:H_,serialization:j_,attrSpec:K_,embeddableOverrides:G_,assocSpec:Y_,indexSpec:q_,operationSpec:W_,groupSpec:J_,entityUpdatePatch:tE,attrUpdatePatch:X_,assocUpdatePatch:Z_,assocEndUpdatePatch:nE,indexUpdatePatch:Q_,operationUpdatePatch:eE,groupUpdatePatch:aE,symbolicOp:Qm}};function lE(e,n,o,i={}){const a=i.mkClientOpId??Fe,r=new Set;for(const s of o)s.casUnit==="logical"&&s.containerRef&&r.add(s.containerRef);const l={};if(r.size){l.revs={};for(const s of r)l.revs[s]=n[s]??0}return{diagramId:e,ops:o,cas:l,origin:i.origin??"agent",clientOpId:a()}}const ef={location:{x:0,y:0},size:{width:220,height:140}};function tf(e){return{modelId:e.modelId,physicalName:e.physicalName,logicalName:e.logicalName,dataType:e.dataType,length:e.length,scale:e.scale,unique:e.unique,autoIncrement:e.autoIncrement,updatable:e.updatable,insertable:e.insertable,notNull:e.notNull,sharedColumnRef:e.sharedColumnRef,multiValue:e.multiValue,multiValueSeparator:e.multiValueSeparator,sequenceName:e.sequenceName}}const sE=/^[-=_*~\s]{3,}$/;function cE(e){return e.attrType&&e.attrType!=="NORMAL"||!sE.test(e.name??"")?!1:!(e.dbAttrs??[]).some(n=>n.physicalName||n.dataType)}function dE(e){return e.type===pn&&e.customType==="java.util.Currency"?{type:"Currency",customType:void 0}:{type:e.type,customType:e.customType}}function uE(e,n){if(e.attrType==="DIVIDER"||cE(e))return{modelId:e.modelId,name:e.attrType==="DIVIDER"?e.name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:e.order??n,dbAttrs:[]};const o=dE(e);return{modelId:e.modelId,name:e.name,type:o.type,customType:o.customType,attrType:e.attrType,identifier:e.identifier,notNull:e.notNull,transient:e.transient_,naturalId:e.naturalId,naturalIdMutable:e.naturalIdMutable,description:e.description,attributeGroup:e.attributeGroup,groupCode:e.groupCode,defaultValue:e.defaultValue,personalInfoAttributeType:e.personalInfoAttributeType,order:e.order??n,dbAttrs:e.dbAttrs.map(tf)}}function mE(e,n){const{modelId:o,name:i,visibility:a,sourceCode:r,description:l,order:s,personalInfoAttributeType:c,style:d,...u}=e;return{modelId:o,name:i,visibility:a,sourceCode:r,description:l?{ko:l}:void 0,order:s??n,personalInfoAttributeType:c,legacyRaw:Object.keys(u).length?u:void 0}}function fE(e){return{modelId:e.modelId,name:e.name,unique:e.unique,description:e.description,parameters:e.parameters,columns:e.indexColumns.map(n=>({columnRef:n.targetColumn.refId,descending:n.descending}))}}function pE(e){var n,o;return{modelId:e.modelId,name:e.name,stereotype:e.stereotype,packageName:e.packageName,superClass:e.superClass,schema:e.schema,description:e.description,abstractClass:e.abstractClass,hasPersonalInfo:e.hasPersonalInfo,declarationOfInterfaces:e.declarationOfInterfaces,attributes:e.attributes.map(uE),operations:(n=e.operations)==null?void 0:n.map(mE),indexes:(o=e.indexes)==null?void 0:o.map(fE),jpaAttrs:e.jpaAttrs,table:e.dbAttrs?{physicalName:e.dbAttrs.physicalName,logicalName:e.dbAttrs.logicalName}:void 0}}function hE(e){const n={};for(const i of e.attributes)i.style&&(n[i.modelId]=i.style);const o={};for(const i of e.operations??[])i.style&&(o[i.modelId]=i.style);return{entityRef:e.modelId,geo:e.geo??{...ef},style:e.style,attributeStyles:Object.keys(n).length?n:void 0,operationStyles:Object.keys(o).length?o:void 0,collapsed:e.collapsed,locked:e.locked}}function nf(e){return e.jpaAttribute?{fetchType:e.jpaAttribute.fetchType,cascadeTypes:e.jpaAttribute.cascadeTypes,orphanRemoval:e.jpaAttribute.orphanRemoval,orderBy:e.jpaAttribute.orderBy,collectionType:e.jpaAttribute.collectionType,collectionTable:e.jpaAttribute.collectionTable,orderColumn:e.jpaAttribute.orderColumn}:void 0}function ms(e){var n;return{entityRef:e.endModel.refId,multiplicity:e.multiplicity,navigable:e.navigable,composition:e.composition,attributeRef:(n=e.attribute)==null?void 0:n.modelId,jpa:nf(e)}}function yE(e){if(e.end1.endModel.refId===e.end2.endModel.refId)return;const n=o=>fs(o)&&(o==null?void 0:o.identifier)===!0;return n(e.end1.attribute)||n(e.end2.attribute)?!0:void 0}function gE(e){var i,a;const n={modelId:e.modelId,description:e.description,identifying:yE(e),end1:ms(e.end1),end2:ms(e.end2)},o={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:(i=e.end1.attribute)==null?void 0:i.modelId,targetColumnRef:(a=e.end2.attribute)==null?void 0:a.modelId,style:e.style};return{assoc:n,layout:o}}function fs(e){var n;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("RELATION")&&(((n=e.dbAttrs)==null?void 0:n.length)??0)>0}function of(e){var n;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("EMBED")&&(((n=e.dbAttrs)==null?void 0:n.length)??0)>0}function af(e){var o;const n=e.attribute;return(n==null?void 0:n.attrType)==="EMBED_OWN"&&(((o=n.dbAttrs)==null?void 0:o.length)??0)===0&&(e.multiplicity==="ZERO_OR_MORE_INSTANCES"||e.multiplicity==="ONE_OR_MORE_INSTANCES")}function rf(e,n){return{modelId:e.modelId,name:e.name??"",type:e.type??"",customType:e.customType,attrType:e.attrType??"RELATION_OWN",identifier:e.identifier??!1,notNull:e.notNull??!1,transient:e.transient_,naturalId:e.naturalId,naturalIdMutable:e.naturalIdMutable,description:e.description,attributeGroup:e.attributeGroup,groupCode:e.groupCode,defaultValue:e.defaultValue,personalInfoAttributeType:e.personalInfoAttributeType,order:n,dbAttrs:(e.dbAttrs??[]).map(tf)}}function bE(e,n,o){var C,v;const i=fs(e.end1.attribute),a=fs(e.end2.attribute);if(i===a)return gE(e);const r=i?e.end1:e.end2,l=i?e.end2:e.end1,s=r.attribute,c=(v=(C=s.dbAttrs)==null?void 0:C[0])==null?void 0:v.targetModelId,d=c?o.get(c):void 0,u=n.get(l.endModel.refId),m=u?u.attributes.reduce((S,N)=>Math.max(S,N.order),-1)+1:s.order??0,f={...rf(s,m),attrType:"RELATION_OWN",derivedFrom:d?{associationRef:e.modelId,sourceAttributeRef:d}:void 0};u&&u.attributes.push(f);const p=n.get(r.endModel.refId),y=l.attribute;let g;if(y&&p&&r.navigable){const S=Na(l.multiplicity);g={modelId:y.modelId??crypto.randomUUID(),name:po(y.name??Ia((u==null?void 0:u.name)??l.endModel.refId,S),new Set(p.attributes.map(N=>N.name))),type:(u==null?void 0:u.name)??l.endModel.refId,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:p.attributes.reduce((N,A)=>Math.max(N,A.order),-1)+1,dbAttrs:[]},p.attributes.push(g)}const b=(S,N)=>({entityRef:S.endModel.refId,multiplicity:S.multiplicity,navigable:S.navigable,composition:S.composition,attributeRef:N?g==null?void 0:g.modelId:f.modelId,jpa:nf(S)}),k=r.endModel.refId===l.endModel.refId,_={modelId:e.modelId,description:e.description,identifying:!k&&f.identifier===!0?!0:void 0,end1:b(e.end1,i),end2:b(e.end2,a)},h={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:i?d:f.modelId,targetColumnRef:i?f.modelId:d,style:e.style};return{assoc:_,layout:h}}function kE(e,n){const o=e.targetModelId?n.get(e.targetModelId):void 0;return{modelId:e.modelId,physicalName:e.physicalName||(o==null?void 0:o.physicalName)||"",logicalName:e.logicalName??(o==null?void 0:o.logicalName),dataType:e.dataType||(o==null?void 0:o.dataType)||"",length:e.length??(o==null?void 0:o.length),scale:e.scale??(o==null?void 0:o.scale),unique:e.unique??(o==null?void 0:o.unique),autoIncrement:e.autoIncrement??(o==null?void 0:o.autoIncrement),updatable:e.updatable??(o==null?void 0:o.updatable),insertable:e.insertable??(o==null?void 0:o.insertable),notNull:e.notNull??(o==null?void 0:o.notNull)}}function _E(e,n,o){var y;const i=((y=e.end1.attribute)==null?void 0:y.attrType)==="EMBED_OWN",a=i?e.end1:e.end2,r=i?e.end2:e.end1,l=a.attribute,s=n.get(r.endModel.refId),c=s?s.attributes.reduce((g,b)=>Math.max(g,b.order),-1)+1:l.order??0,d={...rf(l,c),attrType:l.attrType??"EMBED_OWN",dbAttrs:(l.dbAttrs??[]).map(g=>kE(g,o)),embedded:{associationRef:e.modelId,embeddableRef:a.endModel.refId}};s&&s.attributes.push(d);const u=g=>({...ms(g),legacyEmbedRaw:g.attribute}),m={modelId:e.modelId,description:e.description,end1:u(e.end1),end2:u(e.end2)},f=!i,p={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:f?d.modelId:void 0,targetColumnRef:f?void 0:d.modelId,style:e.style};return{assoc:m,layout:p}}function EE(e,n){var i,a,r,l;const o=[];for(const s of n){const c=(a=(i=s.end1)==null?void 0:i.endModel)==null?void 0:a.refId,d=(l=(r=s.end2)==null?void 0:r.endModel)==null?void 0:l.refId,u=c===e?d:c;!u||u===e||o.push({targetRef:u,waypoints:s.locations??[]})}return o}function lf(e,n={x:0,y:0}){const{modelId:o,memo:i,geo:a,style:r,connections:l,ownedConnections:s,...c}=e;let d=l;if(!d&&Array.isArray(s)){const u=EE(o,s);u.length&&(d=u)}return{modelId:o,memo:i,geo:{location:{x:a.location.x+n.x,y:a.location.y+n.y},size:a.size},style:r,connections:d,legacyRaw:Object.keys(c).length?c:void 0}}function sf(e,n,o){if(!(o!=null&&o.length))return;const i=new Map(e.map(l=>[l.modelId,l])),a=new Map(n.map(l=>[l.modelId,l])),r=(l,s)=>{var c;return!!s&&!!((c=i.get(l??""))!=null&&c.attributes.some(d=>d.modelId===s))};for(const l of o){const s=a.get(l.associationRef);s&&(l.sourceColumnRef&&!r(s.end1.entityRef,l.sourceColumnRef)&&(l.sourceColumnRef=void 0),l.targetColumnRef&&!r(s.end2.entityRef,l.targetColumnRef)&&(l.targetColumnRef=void 0))}}function cf(e,n){const o=(i,a)=>{if(i==null)return;const r=i[a];if(r==null)return;const l=Yc(r);l!==r&&(l===void 0?delete i[a]:i[a]=l)};for(const i of n)o(i,"name");for(const i of e){o(i,"classLogicalName"),o(i,"description"),o(i.table,"logicalName");for(const a of i.operations??[])o(a,"description");for(const a of i.attributes){o(a,"fieldLogicalName"),o(a,"description");for(const r of a.dbAttrs??[])o(r,"logicalName")}}}function NE(e,n){const o=new Map(e.map(i=>[i.modelId,i]));for(const i of n){if(i.end1.navigable!==!0)continue;const a=o.get(i.end1.entityRef),r=o.get(i.end2.entityRef);if(!a||!r||lt(a.stereotype)||lt(r.stereotype))continue;const l=i.end1.attributeRef?a.attributes.find(f=>f.modelId===i.end1.attributeRef):void 0;if((l==null?void 0:l.attrType)==="RELATION_REF")continue;const s=`nav:${i.modelId}`,c=a.attributes.find(f=>f.modelId===s);if((c==null?void 0:c.attrType)==="RELATION_REF"){i.end1.attributeRef=s;continue}const d=Na(i.end2.multiplicity),u=Ia(r.name,d),m=po(u,new Set(a.attributes.map(f=>f.name)));a.attributes.push({modelId:s,name:m,type:r.name,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:a.attributes.reduce((f,p)=>Math.max(f,p.order),-1)+1,dbAttrs:[]}),i.end1.attributeRef=s}}function wE(e,n){const o=new Map(e.map(i=>[i.modelId,i]));for(const i of n){if(i.identifying===!0||i.end1.entityRef===i.end2.entityRef)continue;const a=o.get(i.end1.entityRef),r=o.get(i.end2.entityRef);if(!a||!r||lt(a.stereotype)||lt(r.stereotype))continue;const l=r.attributes.find(s=>s.modelId===i.end2.attributeRef);l&&l.attrType.startsWith("RELATION")&&l.dbAttrs.length>0&&l.identifier===!0&&(i.identifying=!0)}}function df(e,n){var i;const o=new Map(e.map(a=>[a.modelId,a]));for(const a of n){const r=o.get(a.end2.entityRef);if(!r)continue;const l=o.get(a.end1.entityRef);if(l&<(l.stereotype))continue;const s=a.end1.entityRef===a.end2.entityRef,c=a.identifying===!0||!s&&!Ed(a.end1.multiplicity);for(const d of r.attributes)!d.attrType.startsWith("RELATION")||d.dbAttrs.length===0||!(((i=d.derivedFrom)==null?void 0:i.associationRef)===a.modelId||!d.derivedFrom&&d.modelId===a.end2.attributeRef)||(d.notNull=c)}}function uf(e){const n=JSON.parse(JSON.stringify(e));return(n.schemaVersion??1)>=2&&"logical"in n?IE(n):vE(n)}function IE(e){const n=e.id??e.logical.modelId??"",o={},i=m=>{const{rev:f,...p}=m;return f!=null&&(o[m.modelId]=f),p},a=e.logical.entities.map(i),r=e.logical.associations.map(i),l=e.logical.groups.map(i);NE(a,r),wE(a,r),df(a,r),cf(a,l);const{version:s,...c}=e.layout;sf(a,r,c.associationLayouts);const d={logical:{modelId:e.logical.modelId??n,packageName:e.logical.packageName,entities:a,associations:r,groups:l},layout:{...c,diagramId:c.diagramId??n,logicalModelRef:c.logicalModelRef??n}},u={id:e.id,version:e.version,diagramVersion:e.diagramVersion,size:e.size,packageName:e.packageName,schemaVersion:e.schemaVersion,opWriteEnabled:e.opWriteEnabled,referenceOnly:e.referenceOnly,revSeed:{revs:o,layoutVersion:s??0,logicalVersion:e.logical.version??0}};return{state:d,meta:u}}function vE(e){var k,_;const n=e.id??"",o=[],i=[],a=[],r=[],l=[],s=[],c=[],d=(h,C)=>{o.push(pE(h));const v=hE(h);v.geo={location:{x:v.geo.location.x+C.x,y:v.geo.location.y+C.y},size:v.geo.size},i.push(v);for(const S of h.ownedAssociations??[])c.push(S)},u={x:0,y:0};for(const h of e.entities??[])d(h,u);const m=[];for(const h of e.groups??[]){const C=h.entities??[];l.push({modelId:h.modelId,name:h.name,description:h.description,packageName:h.packageName,excludeDDLGeneration:h.excludeDDLGeneration??!1,memberEntityRefs:C.map(S=>S.modelId)});const v=((k=h.geo)==null?void 0:k.location)??u;if(h.geo){const S=(h.notes??[]).map(N=>N.modelId);s.push({groupRef:h.modelId,geo:h.geo,style:h.style,locked:h.locked,memberNoteRefs:S.length?S:void 0})}for(const S of C)d(S,v);for(const S of h.notes??[])m.push(lf(S,v))}const f=new Map(o.map(h=>[h.modelId,h])),p=new Map,y=new Map;for(const h of o)for(const C of h.attributes)for(const v of C.dbAttrs)p.set(v.modelId,C.modelId),y.set(v.modelId,v);for(const h of c)for(const C of[h.end1,h.end2]){const v=C.attribute;if(v&&(((_=v.dbAttrs)==null?void 0:_.length)??0)>0)for(const S of v.dbAttrs)S.modelId&&p.set(S.modelId,v.modelId)}for(const h of c){const C=of(h.end1.attribute),v=of(h.end2.attribute),S=af(h.end1)||af(h.end2),{assoc:N,layout:A}=C!==v||S?_E(h,f,y):bE(h,f,p);a.push(N),r.push(A)}sf(o,a,r),gu(o),df(o,a),cf(o,l);const g={logical:{modelId:n,packageName:e.packageName,entities:o,associations:a,groups:l},layout:{diagramId:n,logicalModelRef:n,canvasSize:e.size,entityLayouts:i,associationLayouts:r,groupLayouts:s,notes:[...(e.notes??[]).map(h=>lf(h)),...m]}},b={id:e.id,version:e.version,diagramVersion:e.diagramVersion,size:e.size,packageName:e.packageName,schemaVersion:e.schemaVersion??1};return{state:g,meta:b}}function mf(e){return{modelId:e.modelId,physicalName:e.physicalName,logicalName:e.logicalName,dataType:e.dataType,length:e.length,scale:e.scale,unique:e.unique,autoIncrement:e.autoIncrement,updatable:e.updatable,insertable:e.insertable,notNull:e.notNull,sharedColumnRef:e.sharedColumnRef,multiValue:e.multiValue,multiValueSeparator:e.multiValueSeparator,sequenceName:e.sequenceName}}function CE(e,n){return{modelId:e.modelId,name:e.name,type:e.type,customType:e.customType,attrType:e.attrType,identifier:e.identifier,notNull:e.notNull,transient_:e.transient,naturalId:e.naturalId,naturalIdMutable:e.naturalIdMutable,description:e.description,attributeGroup:e.attributeGroup,groupCode:e.groupCode,defaultValue:e.defaultValue,personalInfoAttributeType:e.personalInfoAttributeType,order:e.order,dbAttrs:e.dbAttrs.map(mf),style:n}}function SE(e,n){var o;return{...e.legacyRaw,modelId:e.modelId,name:e.name,visibility:e.visibility,sourceCode:e.sourceCode,description:(o=e.description)==null?void 0:o.ko,order:e.order,personalInfoAttributeType:e.personalInfoAttributeType,style:n}}function RE(e){return{modelId:e.modelId,name:e.name,unique:e.unique,description:e.description,parameters:e.parameters,indexColumns:e.columns.map(n=>({targetColumn:{refId:n.columnRef},descending:n.descending}))}}function Zn(e,n){return{endModel:{refId:e.entityRef},multiplicity:e.multiplicity,navigable:e.navigable,composition:e.composition,jpaAttribute:e.jpa,attribute:n??(e.attributeRef?{modelId:e.attributeRef}:void 0)}}function AE(e,n){const o=n==null?void 0:n.attributes.find(i=>{var a;return i.modelId===((a=e.derivedFrom)==null?void 0:a.sourceAttributeRef)});return{modelId:e.modelId,name:e.name,type:e.type,attrType:"RELATION_REF",identifier:e.identifier,notNull:e.notNull,transient_:e.transient,description:e.description,attributeGroup:e.attributeGroup,groupCode:e.groupCode,order:e.order,dbAttrs:e.dbAttrs.map((i,a)=>{var r;return{...mf(i),targetModelId:(r=o==null?void 0:o.dbAttrs[a])==null?void 0:r.modelId}})}}function xE(e){return{modelId:e.modelId,name:e.name,type:e.type,attrType:"RELATION_OWN",dbAttrs:[]}}function ff(e,n){const o=l=>{if(!l.attributeRef)return;const s=n.logical.entities.find(c=>c.modelId===l.entityRef);return s==null?void 0:s.attributes.find(c=>c.modelId===l.attributeRef)},i=o(e.end1),a=o(e.end2),r=l=>(l==null?void 0:l.attrType)==="RELATION_OWN"?l:void 0;return(i==null?void 0:i.attrType)==="RELATION_REF"?{navEnd:e.end1,fkEnd:e.end2,navAttr:i,fk:r(a)}:(a==null?void 0:a.attrType)==="RELATION_REF"?{navEnd:e.end2,fkEnd:e.end1,navAttr:a,fk:r(i)}:null}function $E(e){const n=new Set;for(const o of e.logical.associations){const i=ff(o,e);i&&(n.add(i.navAttr.modelId),i.fk&&n.add(i.fk.modelId))}return n}function TE(e){const n=new Set;for(const o of e.logical.entities)for(const i of o.attributes)i.embedded&&n.add(i.modelId);return n}function ME(e,n){return e===n||JSON.stringify(e??null)===JSON.stringify(n??null)}function VE(e,n){const o=(i,a)=>i===a?void 0:i;return{modelId:e.modelId,targetModelId:n==null?void 0:n.modelId,physicalName:e.physicalName===((n==null?void 0:n.physicalName)??"")?"":e.physicalName,logicalName:ME(e.logicalName,n==null?void 0:n.logicalName)?void 0:e.logicalName,dataType:e.dataType===((n==null?void 0:n.dataType)??"")?"":e.dataType,length:o(e.length,n==null?void 0:n.length),scale:o(e.scale,n==null?void 0:n.scale),unique:o(e.unique,n==null?void 0:n.unique),autoIncrement:o(e.autoIncrement,n==null?void 0:n.autoIncrement),updatable:o(e.updatable,n==null?void 0:n.updatable),insertable:o(e.insertable,n==null?void 0:n.insertable),notNull:o(e.notNull,n==null?void 0:n.notNull)}}function LE(e,n,o){let i;for(const m of n.logical.entities){const f=m.attributes.find(p=>{var y;return((y=p.embedded)==null?void 0:y.associationRef)===e.modelId});if(f){i=f;break}}if(!i)return;const a=i.embedded.embeddableRef,r=n.logical.entities.find(m=>m.modelId===a);if(!r)return;const l=r.attributes.flatMap(m=>m.dbAttrs),s={modelId:i.modelId,name:i.name,type:i.type,attrType:i.attrType,identifier:i.identifier,notNull:i.notNull,transient_:i.transient,description:i.description,attributeGroup:i.attributeGroup,groupCode:i.groupCode,order:i.order,dbAttrs:i.dbAttrs.map((m,f)=>VE(m,l[f]))},c=e.end1.entityRef===a,d=c?e.end2:e.end1,u=d.attributeRef?{modelId:d.attributeRef,attrType:"EMBED_REF",dbAttrs:[]}:void 0;return{...o,end1:Zn(e.end1,c?s:u),end2:Zn(e.end2,c?u:s)}}function BE(e,n,o){const i={modelId:e.modelId,description:e.description,locations:(o==null?void 0:o.waypoints)??[],style:o==null?void 0:o.style};if(e.end1.legacyEmbedRaw||e.end2.legacyEmbedRaw)return{...i,end1:Zn(e.end1,e.end1.legacyEmbedRaw),end2:Zn(e.end2,e.end2.legacyEmbedRaw)};const a=LE(e,n,i);if(a)return a;const r=ff(e,n);if(r){const l=n.logical.entities.find(d=>d.modelId===r.navEnd.entityRef),s=r.fk?AE(r.fk,l):void 0,c=xE(r.navAttr);return{...i,end1:Zn(e.end1,r.navEnd===e.end1?s:c),end2:Zn(e.end2,r.navEnd===e.end2?s:c)}}return{...i,end1:Zn(e.end1),end2:Zn(e.end2)}}function pf(e,n,o,i,a={x:0,y:0}){var u,m;const r=n.layout.entityLayouts.find(f=>f.entityRef===e.modelId),l=n.logical.associations.filter(f=>f.end1.entityRef===e.modelId),s=f=>n.layout.associationLayouts.find(p=>p.associationRef===f),c=(r==null?void 0:r.geo)??{...ef},d={location:{x:c.location.x-a.x,y:c.location.y-a.y},size:c.size};return{modelId:e.modelId,name:e.name,stereotype:e.stereotype,packageName:e.packageName,superClass:e.superClass,schema:e.schema,description:e.description,abstractClass:e.abstractClass,hasPersonalInfo:e.hasPersonalInfo,declarationOfInterfaces:e.declarationOfInterfaces,attributes:e.attributes.filter(f=>!o.has(f.modelId)&&!i.has(f.modelId)).map(f=>{var p;return CE(f,(p=r==null?void 0:r.attributeStyles)==null?void 0:p[f.modelId])}),operations:(u=e.operations)==null?void 0:u.map(f=>{var p;return SE(f,(p=r==null?void 0:r.operationStyles)==null?void 0:p[f.modelId])}),ownedAssociations:l.map(f=>BE(f,n,s(f.modelId))),indexes:(m=e.indexes)==null?void 0:m.map(RE),jpaAttrs:e.jpaAttrs,dbAttrs:e.table?{physicalName:e.table.physicalName,logicalName:e.table.logicalName}:void 0,geo:d,style:r==null?void 0:r.style,collapsed:r==null?void 0:r.collapsed,locked:r==null?void 0:r.locked}}function DE(e,n,o,i){const a=n.layout.groupLayouts.find(c=>c.groupRef===e.modelId),r=e.memberEntityRefs.map(c=>n.logical.entities.find(d=>d.modelId===c)).filter(c=>!!c),l=(a==null?void 0:a.geo.location)??{x:0,y:0},s=((a==null?void 0:a.memberNoteRefs)??[]).map(c=>n.layout.notes.find(d=>d.modelId===c)).filter(c=>!!c).map(c=>hf(c,l));return{modelId:e.modelId,name:e.name,description:e.description,packageName:e.packageName,excludeDDLGeneration:e.excludeDDLGeneration,entities:r.map(c=>pf(c,n,o,i,l)),notes:s.length?s:void 0,geo:a==null?void 0:a.geo,style:a==null?void 0:a.style,locked:a==null?void 0:a.locked}}function hf(e,n={x:0,y:0}){return{...e.legacyRaw,modelId:e.modelId,memo:e.memo,geo:{location:{x:e.geo.location.x-n.x,y:e.geo.location.y-n.y},size:e.geo.size},style:e.style,connections:e.connections}}function OE(e,n={}){const o=new Set(e.logical.groups.flatMap(s=>s.memberEntityRefs)),i=e.logical.entities.filter(s=>!o.has(s.modelId)),a=$E(e),r=TE(e),l=new Set(e.layout.groupLayouts.flatMap(s=>s.memberNoteRefs??[]));return{id:n.id,diagramVersion:n.diagramVersion,version:n.version,size:n.size??e.layout.canvasSize,packageName:n.packageName??e.logical.packageName,entities:i.map(s=>pf(s,e,a,r)),groups:e.logical.groups.map(s=>DE(s,e,a,r)),notes:e.layout.notes.filter(s=>!l.has(s.modelId)).map(s=>hf(s))}}function PE(e,n={}){var a,r,l;const o=((a=n.revSeed)==null?void 0:a.revs)??{},i=s=>({...s,rev:o[s.modelId]??0});return{id:n.id,schemaVersion:2,opWriteEnabled:n.opWriteEnabled,referenceOnly:n.referenceOnly,version:n.version,diagramVersion:n.diagramVersion,packageName:n.packageName,size:n.size,logical:{version:((r=n.revSeed)==null?void 0:r.logicalVersion)??0,modelId:e.logical.modelId,packageName:e.logical.packageName,entities:e.logical.entities.map(i),associations:e.logical.associations.map(i),groups:e.logical.groups.map(i)},layout:{...e.layout,version:((l=n.revSeed)==null?void 0:l.layoutVersion)??0}}}const zE=["notNull"];function FE(e){var u;const n=()=>({navAdds:0,navRefPatches:0,identifyingPatches:0,attributeFieldPatches:0,attributeFieldsByName:{}});if((e.schemaVersion??1)<2||!("logical"in e))return{ops:[],revs:{},summary:n()};const o=e,{state:i,meta:a}=uf(e),r=((u=a.revSeed)==null?void 0:u.revs)??{},l=[],s=n(),c=new Map(o.logical.entities.map(m=>[m.modelId,new Map(m.attributes.map(f=>[f.modelId,f]))]));for(const m of i.logical.entities){const f=c.get(m.modelId);if(f)for(const p of m.attributes){const y=f.get(p.modelId);if(!y){l.push({kind:"attribute.add",casUnit:"logical",containerRef:m.modelId,entityRef:m.modelId,value:p}),s.navAdds++;continue}const g={};for(const b of zE)p[b]===!0!=(y[b]===!0)&&(g[b]=p[b],s.attributeFieldsByName[b]=(s.attributeFieldsByName[b]??0)+1);Object.keys(g).length!==0&&(l.push({kind:"attribute.update",casUnit:"logical",containerRef:m.modelId,entityRef:m.modelId,attributeRef:p.modelId,patch:g}),s.attributeFieldPatches++)}}const d=new Map(o.logical.associations.map(m=>[m.modelId,m]));for(const m of i.logical.associations){const f=d.get(m.modelId);f&&(m.end1.attributeRef&&m.end1.attributeRef!==f.end1.attributeRef&&(l.push({kind:"associationEnd.update",casUnit:"logical",containerRef:m.modelId,associationRef:m.modelId,end:"end1",patch:{attributeRef:m.end1.attributeRef}}),s.navRefPatches++),m.identifying===!0&&f.identifying!==!0&&(l.push({kind:"association.update",casUnit:"logical",containerRef:m.modelId,associationRef:m.modelId,patch:{identifying:!0}}),s.identifyingPatches++))}return{ops:l,revs:r,summary:s}}function Bi(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function Ln(e){return typeof e=="function"?e():t.unref(e)}const UE=typeof window<"u"&&typeof document<"u",HE=e=>typeof e<"u",jE=Object.prototype.toString,KE=e=>jE.call(e)==="[object Object]",GE=()=>{};function YE(e,n){function o(...i){return new Promise((a,r)=>{Promise.resolve(e(()=>n.apply(this,i),{fn:n,thisArg:this,args:i})).then(a).catch(r)})}return o}const yf=e=>e();function qE(e=yf){const n=t.ref(!0);function o(){n.value=!1}function i(){n.value=!0}const a=(...r)=>{n.value&&e(...r)};return{isActive:t.readonly(n),pause:o,resume:i,eventFilter:a}}function gf(e,n=!1,o="Timeout"){return new Promise((i,a)=>{setTimeout(n?()=>a(o):i,e)})}function WE(e,n,o={}){const{eventFilter:i=yf,...a}=o;return t.watch(e,YE(i,n),a)}function ti(e,n,o={}){const{eventFilter:i,...a}=o,{eventFilter:r,pause:l,resume:s,isActive:c}=qE(i);return{stop:WE(e,n,{...a,eventFilter:r}),pause:l,resume:s,isActive:c}}function JE(e,n={}){if(!t.isRef(e))return t.toRefs(e);const o=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)o[i]=t.customRef(()=>({get(){return e.value[i]},set(a){var r;if((r=Ln(n.replaceRef))!=null?r:!0)if(Array.isArray(e.value)){const s=[...e.value];s[i]=a,e.value=s}else{const s={...e.value,[i]:a};Object.setPrototypeOf(s,Object.getPrototypeOf(e.value)),e.value=s}else e.value[i]=a}}));return o}function ps(e,n=!1){function o(m,{flush:f="sync",deep:p=!1,timeout:y,throwOnTimeout:g}={}){let b=null;const _=[new Promise(h=>{b=t.watch(e,C=>{m(C)!==n&&(b==null||b(),h(C))},{flush:f,deep:p,immediate:!0})})];return y!=null&&_.push(gf(y,g).then(()=>Ln(e)).finally(()=>b==null?void 0:b())),Promise.race(_)}function i(m,f){if(!t.isRef(m))return o(C=>C===m,f);const{flush:p="sync",deep:y=!1,timeout:g,throwOnTimeout:b}=f??{};let k=null;const h=[new Promise(C=>{k=t.watch([e,m],([v,S])=>{n!==(v===S)&&(k==null||k(),C(v))},{flush:p,deep:y,immediate:!0})})];return g!=null&&h.push(gf(g,b).then(()=>Ln(e)).finally(()=>(k==null||k(),Ln(e)))),Promise.race(h)}function a(m){return o(f=>!!f,m)}function r(m){return i(null,m)}function l(m){return i(void 0,m)}function s(m){return o(Number.isNaN,m)}function c(m,f){return o(p=>{const y=Array.from(p);return y.includes(m)||y.includes(Ln(m))},f)}function d(m){return u(1,m)}function u(m=1,f){let p=-1;return o(()=>(p+=1,p>=m),f)}return Array.isArray(Ln(e))?{toMatch:o,toContains:c,changed:d,changedTimes:u,get not(){return ps(e,!n)}}:{toMatch:o,toBe:i,toBeTruthy:a,toBeNull:r,toBeNaN:s,toBeUndefined:l,changed:d,changedTimes:u,get not(){return ps(e,!n)}}}function hs(e){return ps(e)}function XE(e){var n;const o=Ln(e);return(n=o==null?void 0:o.$el)!=null?n:o}const bf=UE?window:void 0;function kf(...e){let n,o,i,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([o,i,a]=e,n=bf):[n,o,i,a]=e,!n)return GE;Array.isArray(o)||(o=[o]),Array.isArray(i)||(i=[i]);const r=[],l=()=>{r.forEach(u=>u()),r.length=0},s=(u,m,f,p)=>(u.addEventListener(m,f,p),()=>u.removeEventListener(m,f,p)),c=t.watch(()=>[XE(n),Ln(a)],([u,m])=>{if(l(),!u)return;const f=KE(m)?{...m}:m;r.push(...o.flatMap(p=>i.map(y=>s(u,p,y,f))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return Bi(d),d}function ZE(e){return typeof e=="function"?e:typeof e=="string"?n=>n.key===e:Array.isArray(e)?n=>e.includes(n.key):()=>!0}function _f(...e){let n,o,i={};e.length===3?(n=e[0],o=e[1],i=e[2]):e.length===2?typeof e[1]=="object"?(n=!0,o=e[0],i=e[1]):(n=e[0],o=e[1]):(n=!0,o=e[0]);const{target:a=bf,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=i,c=ZE(n);return kf(a,r,u=>{u.repeat&&Ln(s)||c(u)&&o(u)},l)}function QE(e){return JSON.parse(JSON.stringify(e))}function ys(e,n,o,i={}){var a,r,l;const{clone:s=!1,passive:c=!1,eventName:d,deep:u=!1,defaultValue:m,shouldEmit:f}=i,p=t.getCurrentInstance(),y=o||(p==null?void 0:p.emit)||((a=p==null?void 0:p.$emit)==null?void 0:a.bind(p))||((l=(r=p==null?void 0:p.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(p==null?void 0:p.proxy));let g=d;n||(n="modelValue"),g=g||`update:${n.toString()}`;const b=h=>s?typeof s=="function"?s(h):QE(h):h,k=()=>HE(e[n])?b(e[n]):m,_=h=>{f?f(h)&&y(g,h):y(g,h)};if(c){const h=k(),C=t.ref(h);let v=!1;return t.watch(()=>e[n],S=>{v||(v=!0,C.value=b(S),t.nextTick(()=>v=!1))}),t.watch(C,S=>{!v&&(S!==e[n]||u)&&_(S)},{deep:u}),C}else return t.computed({get(){return k()},set(h){_(h)}})}var e1={value:()=>{}};function Qa(){for(var e=0,n=arguments.length,o={},i;e<n;++e){if(!(i=arguments[e]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new er(o)}function er(e){this._=e}function t1(e,n){return e.trim().split(/^|\s+/).map(function(o){var i="",a=o.indexOf(".");if(a>=0&&(i=o.slice(a+1),o=o.slice(0,a)),o&&!n.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}er.prototype=Qa.prototype={constructor:er,on:function(e,n){var o=this._,i=t1(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=n1(o[a],e.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++r<l;)if(a=(e=i[r]).type)o[a]=Ef(o[a],e.name,n);else if(n==null)for(a in o)o[a]=Ef(o[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var o in n)e[o]=n[o].slice();return new er(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var o=new Array(a),i=0,a,r;i<a;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(n,o)},apply:function(e,n,o){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],a=0,r=i.length;a<r;++a)i[a].value.apply(n,o)}};function n1(e,n){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===n)return a.value}function Ef(e,n,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=e1,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:n,value:o}),e}var gs="http://www.w3.org/1999/xhtml";const Nf={svg:"http://www.w3.org/2000/svg",xhtml:gs,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function tr(e){var n=e+="",o=n.indexOf(":");return o>=0&&(n=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),Nf.hasOwnProperty(n)?{space:Nf[n],local:e}:e}function o1(e){return function(){var n=this.ownerDocument,o=this.namespaceURI;return o===gs&&n.documentElement.namespaceURI===gs?n.createElement(e):n.createElementNS(o,e)}}function i1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wf(e){var n=tr(e);return(n.local?i1:o1)(n)}function a1(){}function bs(e){return e==null?a1:function(){return this.querySelector(e)}}function r1(e){typeof e!="function"&&(e=bs(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=new Array(l),c,d,u=0;u<l;++u)(c=r[u])&&(d=e.call(c,c.__data__,u,r))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new Yt(i,this._parents)}function l1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function s1(){return[]}function If(e){return e==null?s1:function(){return this.querySelectorAll(e)}}function c1(e){return function(){return l1(e.apply(this,arguments))}}function d1(e){typeof e=="function"?e=c1(e):e=If(e);for(var n=this._groups,o=n.length,i=[],a=[],r=0;r<o;++r)for(var l=n[r],s=l.length,c,d=0;d<s;++d)(c=l[d])&&(i.push(e.call(c,c.__data__,d,l)),a.push(c));return new Yt(i,a)}function vf(e){return function(){return this.matches(e)}}function Cf(e){return function(n){return n.matches(e)}}var u1=Array.prototype.find;function m1(e){return function(){return u1.call(this.children,e)}}function f1(){return this.firstElementChild}function p1(e){return this.select(e==null?f1:m1(typeof e=="function"?e:Cf(e)))}var h1=Array.prototype.filter;function y1(){return Array.from(this.children)}function g1(e){return function(){return h1.call(this.children,e)}}function b1(e){return this.selectAll(e==null?y1:g1(typeof e=="function"?e:Cf(e)))}function k1(e){typeof e!="function"&&(e=vf(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=[],c,d=0;d<l;++d)(c=r[d])&&e.call(c,c.__data__,d,r)&&s.push(c);return new Yt(i,this._parents)}function Sf(e){return new Array(e.length)}function _1(){return new Yt(this._enter||this._groups.map(Sf),this._parents)}function nr(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}nr.prototype={constructor:nr,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function E1(e){return function(){return e}}function N1(e,n,o,i,a,r){for(var l=0,s,c=n.length,d=r.length;l<d;++l)(s=n[l])?(s.__data__=r[l],i[l]=s):o[l]=new nr(e,r[l]);for(;l<c;++l)(s=n[l])&&(a[l]=s)}function w1(e,n,o,i,a,r,l){var s,c,d=new Map,u=n.length,m=r.length,f=new Array(u),p;for(s=0;s<u;++s)(c=n[s])&&(f[s]=p=l.call(c,c.__data__,s,n)+"",d.has(p)?a[s]=c:d.set(p,c));for(s=0;s<m;++s)p=l.call(e,r[s],s,r)+"",(c=d.get(p))?(i[s]=c,c.__data__=r[s],d.delete(p)):o[s]=new nr(e,r[s]);for(s=0;s<u;++s)(c=n[s])&&d.get(f[s])===c&&(a[s]=c)}function I1(e){return e.__data__}function v1(e,n){if(!arguments.length)return Array.from(this,I1);var o=n?w1:N1,i=this._parents,a=this._groups;typeof e!="function"&&(e=E1(e));for(var r=a.length,l=new Array(r),s=new Array(r),c=new Array(r),d=0;d<r;++d){var u=i[d],m=a[d],f=m.length,p=C1(e.call(u,u&&u.__data__,d,i)),y=p.length,g=s[d]=new Array(y),b=l[d]=new Array(y),k=c[d]=new Array(f);o(u,m,g,b,k,p,n);for(var _=0,h=0,C,v;_<y;++_)if(C=g[_]){for(_>=h&&(h=_+1);!(v=b[h])&&++h<y;);C._next=v||null}}return l=new Yt(l,i),l._enter=s,l._exit=c,l}function C1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function S1(){return new Yt(this._exit||this._groups.map(Sf),this._parents)}function R1(e,n,o){var i=this.enter(),a=this,r=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(a=n(a),a&&(a=a.selection())),o==null?r.remove():o(r),i&&a?i.merge(a).order():a}function A1(e){for(var n=e.selection?e.selection():e,o=this._groups,i=n._groups,a=o.length,r=i.length,l=Math.min(a,r),s=new Array(a),c=0;c<l;++c)for(var d=o[c],u=i[c],m=d.length,f=s[c]=new Array(m),p,y=0;y<m;++y)(p=d[y]||u[y])&&(f[y]=p);for(;c<a;++c)s[c]=o[c];return new Yt(s,this._parents)}function x1(){for(var e=this._groups,n=-1,o=e.length;++n<o;)for(var i=e[n],a=i.length-1,r=i[a],l;--a>=0;)(l=i[a])&&(r&&l.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(l,r),r=l);return this}function $1(e){e||(e=T1);function n(m,f){return m&&f?e(m.__data__,f.__data__):!m-!f}for(var o=this._groups,i=o.length,a=new Array(i),r=0;r<i;++r){for(var l=o[r],s=l.length,c=a[r]=new Array(s),d,u=0;u<s;++u)(d=l[u])&&(c[u]=d);c.sort(n)}return new Yt(a,this._parents).order()}function T1(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function M1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function V1(){return Array.from(this)}function L1(){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],a=0,r=i.length;a<r;++a){var l=i[a];if(l)return l}return null}function B1(){let e=0;for(const n of this)++e;return e}function D1(){return!this.node()}function O1(e){for(var n=this._groups,o=0,i=n.length;o<i;++o)for(var a=n[o],r=0,l=a.length,s;r<l;++r)(s=a[r])&&e.call(s,s.__data__,r,a);return this}function P1(e){return function(){this.removeAttribute(e)}}function z1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function F1(e,n){return function(){this.setAttribute(e,n)}}function U1(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function H1(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function j1(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,o)}}function K1(e,n){var o=tr(e);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((n==null?o.local?z1:P1:typeof n=="function"?o.local?j1:H1:o.local?U1:F1)(o,n))}function Rf(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function G1(e){return function(){this.style.removeProperty(e)}}function Y1(e,n,o){return function(){this.style.setProperty(e,n,o)}}function q1(e,n,o){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function W1(e,n,o){return arguments.length>1?this.each((n==null?G1:typeof n=="function"?q1:Y1)(e,n,o??"")):ni(this.node(),e)}function ni(e,n){return e.style.getPropertyValue(n)||Rf(e).getComputedStyle(e,null).getPropertyValue(n)}function J1(e){return function(){delete this[e]}}function X1(e,n){return function(){this[e]=n}}function Z1(e,n){return function(){var o=n.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function Q1(e,n){return arguments.length>1?this.each((n==null?J1:typeof n=="function"?Z1:X1)(e,n)):this.node()[e]}function Af(e){return e.trim().split(/^|\s+/)}function ks(e){return e.classList||new xf(e)}function xf(e){this._node=e,this._names=Af(e.getAttribute("class")||"")}xf.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function $f(e,n){for(var o=ks(e),i=-1,a=n.length;++i<a;)o.add(n[i])}function Tf(e,n){for(var o=ks(e),i=-1,a=n.length;++i<a;)o.remove(n[i])}function eN(e){return function(){$f(this,e)}}function tN(e){return function(){Tf(this,e)}}function nN(e,n){return function(){(n.apply(this,arguments)?$f:Tf)(this,e)}}function oN(e,n){var o=Af(e+"");if(arguments.length<2){for(var i=ks(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof n=="function"?nN:n?eN:tN)(o,n))}function iN(){this.textContent=""}function aN(e){return function(){this.textContent=e}}function rN(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function lN(e){return arguments.length?this.each(e==null?iN:(typeof e=="function"?rN:aN)(e)):this.node().textContent}function sN(){this.innerHTML=""}function cN(e){return function(){this.innerHTML=e}}function dN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function uN(e){return arguments.length?this.each(e==null?sN:(typeof e=="function"?dN:cN)(e)):this.node().innerHTML}function mN(){this.nextSibling&&this.parentNode.appendChild(this)}function fN(){return this.each(mN)}function pN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function hN(){return this.each(pN)}function yN(e){var n=typeof e=="function"?e:wf(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function gN(){return null}function bN(e,n){var o=typeof e=="function"?e:wf(e),i=n==null?gN:typeof n=="function"?n:bs(n);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function kN(){var e=this.parentNode;e&&e.removeChild(this)}function _N(){return this.each(kN)}function EN(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function NN(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function wN(e){return this.select(e?NN:EN)}function IN(e){return arguments.length?this.property("__data__",e):this.node().__data__}function vN(e){return function(n){e.call(this,n,this.__data__)}}function CN(e){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");return i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),{type:n,name:o}})}function SN(e){return function(){var n=this.__on;if(n){for(var o=0,i=-1,a=n.length,r;o<a;++o)r=n[o],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):n[++i]=r;++i?n.length=i:delete this.__on}}}function RN(e,n,o){return function(){var i=this.__on,a,r=vN(n);if(i){for(var l=0,s=i.length;l<s;++l)if((a=i[l]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=r,a.options=o),a.value=n;return}}this.addEventListener(e.type,r,o),a={type:e.type,name:e.name,value:n,listener:r,options:o},i?i.push(a):this.__on=[a]}}function AN(e,n,o){var i=CN(e+""),a,r=i.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,d=s.length,u;c<d;++c)for(a=0,u=s[c];a<r;++a)if((l=i[a]).type===u.type&&l.name===u.name)return u.value}return}for(s=n?RN:SN,a=0;a<r;++a)this.each(s(i[a],n,o));return this}function Mf(e,n,o){var i=Rf(e),a=i.CustomEvent;typeof a=="function"?a=new a(n,o):(a=i.document.createEvent("Event"),o?(a.initEvent(n,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function xN(e,n){return function(){return Mf(this,e,n)}}function $N(e,n){return function(){return Mf(this,e,n.apply(this,arguments))}}function TN(e,n){return this.each((typeof n=="function"?$N:xN)(e,n))}function*MN(){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],a=0,r=i.length,l;a<r;++a)(l=i[a])&&(yield l)}var Vf=[null];function Yt(e,n){this._groups=e,this._parents=n}function Di(){return new Yt([[document.documentElement]],Vf)}function VN(){return this}Yt.prototype=Di.prototype={constructor:Yt,select:r1,selectAll:d1,selectChild:p1,selectChildren:b1,filter:k1,data:v1,enter:_1,exit:S1,join:R1,merge:A1,selection:VN,order:x1,sort:$1,call:M1,nodes:V1,node:L1,size:B1,empty:D1,each:O1,attr:K1,style:W1,property:Q1,classed:oN,text:lN,html:uN,raise:fN,lower:hN,append:yN,insert:bN,remove:_N,clone:wN,datum:IN,on:AN,dispatch:TN,[Symbol.iterator]:MN};function rn(e){return typeof e=="string"?new Yt([[document.querySelector(e)]],[document.documentElement]):new Yt([[e]],Vf)}function LN(e){let n;for(;n=e.sourceEvent;)e=n;return e}function bn(e,n){if(e=LN(e),n===void 0&&(n=e.currentTarget),n){var o=n.ownerSVGElement||n;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}const BN={passive:!1},Oi={capture:!0,passive:!1};function _s(e){e.stopImmediatePropagation()}function oi(e){e.preventDefault(),e.stopImmediatePropagation()}function Lf(e){var n=e.document.documentElement,o=rn(e).on("dragstart.drag",oi,Oi);"onselectstart"in n?o.on("selectstart.drag",oi,Oi):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Bf(e,n){var o=e.document.documentElement,i=rn(e).on("dragstart.drag",null);n&&(i.on("click.drag",oi,Oi),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in o?i.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const or=e=>()=>e;function Es(e,{sourceEvent:n,subject:o,target:i,identifier:a,active:r,x:l,y:s,dx:c,dy:d,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:i,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:r,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:u}})}Es.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function DN(e){return!e.ctrlKey&&!e.button}function ON(){return this.parentNode}function PN(e,n){return n??{x:e.x,y:e.y}}function zN(){return navigator.maxTouchPoints||"ontouchstart"in this}function FN(){var e=DN,n=ON,o=PN,i=zN,a={},r=Qa("start","drag","end"),l=0,s,c,d,u,m=0;function f(C){C.on("mousedown.drag",p).filter(i).on("touchstart.drag",b).on("touchmove.drag",k,BN).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(C,v){if(!(u||!e.call(this,C,v))){var S=h(this,n.call(this,C,v),C,v,"mouse");S&&(rn(C.view).on("mousemove.drag",y,Oi).on("mouseup.drag",g,Oi),Lf(C.view),_s(C),d=!1,s=C.clientX,c=C.clientY,S("start",C))}}function y(C){if(oi(C),!d){var v=C.clientX-s,S=C.clientY-c;d=v*v+S*S>m}a.mouse("drag",C)}function g(C){rn(C.view).on("mousemove.drag mouseup.drag",null),Bf(C.view,d),oi(C),a.mouse("end",C)}function b(C,v){if(e.call(this,C,v)){var S=C.changedTouches,N=n.call(this,C,v),A=S.length,T,O;for(T=0;T<A;++T)(O=h(this,N,C,v,S[T].identifier,S[T]))&&(_s(C),O("start",C,S[T]))}}function k(C){var v=C.changedTouches,S=v.length,N,A;for(N=0;N<S;++N)(A=a[v[N].identifier])&&(oi(C),A("drag",C,v[N]))}function _(C){var v=C.changedTouches,S=v.length,N,A;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),N=0;N<S;++N)(A=a[v[N].identifier])&&(_s(C),A("end",C,v[N]))}function h(C,v,S,N,A,T){var O=r.copy(),z=bn(T||S,v),P,D,E;if((E=o.call(C,new Es("beforestart",{sourceEvent:S,target:f,identifier:A,active:l,x:z[0],y:z[1],dx:0,dy:0,dispatch:O}),N))!=null)return P=E.x-z[0]||0,D=E.y-z[1]||0,function R(I,x,$){var U=z,F;switch(I){case"start":a[A]=R,F=l++;break;case"end":delete a[A],--l;case"drag":z=bn($||x,v),F=l;break}O.call(I,C,new Es(I,{sourceEvent:x,subject:E,target:f,identifier:A,active:F,x:z[0]+P,y:z[1]+D,dx:z[0]-U[0],dy:z[1]-U[1],dispatch:O}),N)}}return f.filter=function(C){return arguments.length?(e=typeof C=="function"?C:or(!!C),f):e},f.container=function(C){return arguments.length?(n=typeof C=="function"?C:or(C),f):n},f.subject=function(C){return arguments.length?(o=typeof C=="function"?C:or(C),f):o},f.touchable=function(C){return arguments.length?(i=typeof C=="function"?C:or(!!C),f):i},f.on=function(){var C=r.on.apply(r,arguments);return C===r?f:C},f.clickDistance=function(C){return arguments.length?(m=(C=+C)*C,f):Math.sqrt(m)},f}function Ns(e,n,o){e.prototype=n.prototype=o,o.constructor=e}function Df(e,n){var o=Object.create(e.prototype);for(var i in n)o[i]=n[i];return o}function Pi(){}var zi=.7,ir=1/zi,ii="\\s*([+-]?\\d+)\\s*",Fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",kn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",UN=/^#([0-9a-f]{3,8})$/,HN=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),jN=new RegExp(`^rgb\\(${kn},${kn},${kn}\\)$`),KN=new RegExp(`^rgba\\(${ii},${ii},${ii},${Fi}\\)$`),GN=new RegExp(`^rgba\\(${kn},${kn},${kn},${Fi}\\)$`),YN=new RegExp(`^hsl\\(${Fi},${kn},${kn}\\)$`),qN=new RegExp(`^hsla\\(${Fi},${kn},${kn},${Fi}\\)$`),Of={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Ns(Pi,Co,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Pf,formatHex:Pf,formatHex8:WN,formatHsl:JN,formatRgb:zf,toString:zf});function Pf(){return this.rgb().formatHex()}function WN(){return this.rgb().formatHex8()}function JN(){return Kf(this).formatHsl()}function zf(){return this.rgb().formatRgb()}function Co(e){var n,o;return e=(e+"").trim().toLowerCase(),(n=UN.exec(e))?(o=n[1].length,n=parseInt(n[1],16),o===6?Ff(n):o===3?new Ut(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):o===8?ar(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):o===4?ar(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=HN.exec(e))?new Ut(n[1],n[2],n[3],1):(n=jN.exec(e))?new Ut(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=KN.exec(e))?ar(n[1],n[2],n[3],n[4]):(n=GN.exec(e))?ar(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=YN.exec(e))?jf(n[1],n[2]/100,n[3]/100,1):(n=qN.exec(e))?jf(n[1],n[2]/100,n[3]/100,n[4]):Of.hasOwnProperty(e)?Ff(Of[e]):e==="transparent"?new Ut(NaN,NaN,NaN,0):null}function Ff(e){return new Ut(e>>16&255,e>>8&255,e&255,1)}function ar(e,n,o,i){return i<=0&&(e=n=o=NaN),new Ut(e,n,o,i)}function XN(e){return e instanceof Pi||(e=Co(e)),e?(e=e.rgb(),new Ut(e.r,e.g,e.b,e.opacity)):new Ut}function ws(e,n,o,i){return arguments.length===1?XN(e):new Ut(e,n,o,i??1)}function Ut(e,n,o,i){this.r=+e,this.g=+n,this.b=+o,this.opacity=+i}Ns(Ut,ws,Df(Pi,{brighter(e){return e=e==null?ir:Math.pow(ir,e),new Ut(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?zi:Math.pow(zi,e),new Ut(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ut(So(this.r),So(this.g),So(this.b),rr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Uf,formatHex:Uf,formatHex8:ZN,formatRgb:Hf,toString:Hf}));function Uf(){return`#${Ro(this.r)}${Ro(this.g)}${Ro(this.b)}`}function ZN(){return`#${Ro(this.r)}${Ro(this.g)}${Ro(this.b)}${Ro((isNaN(this.opacity)?1:this.opacity)*255)}`}function Hf(){const e=rr(this.opacity);return`${e===1?"rgb(":"rgba("}${So(this.r)}, ${So(this.g)}, ${So(this.b)}${e===1?")":`, ${e})`}`}function rr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function So(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ro(e){return e=So(e),(e<16?"0":"")+e.toString(16)}function jf(e,n,o,i){return i<=0?e=n=o=NaN:o<=0||o>=1?e=n=NaN:n<=0&&(e=NaN),new ln(e,n,o,i)}function Kf(e){if(e instanceof ln)return new ln(e.h,e.s,e.l,e.opacity);if(e instanceof Pi||(e=Co(e)),!e)return new ln;if(e instanceof ln)return e;e=e.rgb();var n=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(n,o,i),r=Math.max(n,o,i),l=NaN,s=r-a,c=(r+a)/2;return s?(n===r?l=(o-i)/s+(o<i)*6:o===r?l=(i-n)/s+2:l=(n-o)/s+4,s/=c<.5?r+a:2-r-a,l*=60):s=c>0&&c<1?0:l,new ln(l,s,c,e.opacity)}function QN(e,n,o,i){return arguments.length===1?Kf(e):new ln(e,n,o,i??1)}function ln(e,n,o,i){this.h=+e,this.s=+n,this.l=+o,this.opacity=+i}Ns(ln,QN,Df(Pi,{brighter(e){return e=e==null?ir:Math.pow(ir,e),new ln(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?zi:Math.pow(zi,e),new ln(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,i=o+(o<.5?o:1-o)*n,a=2*o-i;return new Ut(Is(e>=240?e-240:e+120,a,i),Is(e,a,i),Is(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new ln(Gf(this.h),lr(this.s),lr(this.l),rr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=rr(this.opacity);return`${e===1?"hsl(":"hsla("}${Gf(this.h)}, ${lr(this.s)*100}%, ${lr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Gf(e){return e=(e||0)%360,e<0?e+360:e}function lr(e){return Math.max(0,Math.min(1,e||0))}function Is(e,n,o){return(e<60?n+(o-n)*e/60:e<180?o:e<240?n+(o-n)*(240-e)/60:n)*255}const vs=e=>()=>e;function e0(e,n){return function(o){return e+o*n}}function t0(e,n,o){return e=Math.pow(e,o),n=Math.pow(n,o)-e,o=1/o,function(i){return Math.pow(e+i*n,o)}}function n0(e){return(e=+e)==1?Yf:function(n,o){return o-n?t0(n,o,e):vs(isNaN(n)?o:n)}}function Yf(e,n){var o=n-e;return o?e0(e,o):vs(isNaN(e)?n:e)}const sr=(function e(n){var o=n0(n);function i(a,r){var l=o((a=ws(a)).r,(r=ws(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=Yf(a.opacity,r.opacity);return function(u){return a.r=l(u),a.g=s(u),a.b=c(u),a.opacity=d(u),a+""}}return i.gamma=e,i})(1);function o0(e,n){n||(n=[]);var o=e?Math.min(n.length,e.length):0,i=n.slice(),a;return function(r){for(a=0;a<o;++a)i[a]=e[a]*(1-r)+n[a]*r;return i}}function i0(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function a0(e,n){var o=n?n.length:0,i=e?Math.min(o,e.length):0,a=new Array(i),r=new Array(o),l;for(l=0;l<i;++l)a[l]=Ui(e[l],n[l]);for(;l<o;++l)r[l]=n[l];return function(s){for(l=0;l<i;++l)r[l]=a[l](s);return r}}function r0(e,n){var o=new Date;return e=+e,n=+n,function(i){return o.setTime(e*(1-i)+n*i),o}}function _n(e,n){return e=+e,n=+n,function(o){return e*(1-o)+n*o}}function l0(e,n){var o={},i={},a;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(a in n)a in e?o[a]=Ui(e[a],n[a]):i[a]=n[a];return function(r){for(a in o)i[a]=o[a](r);return i}}var Cs=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ss=new RegExp(Cs.source,"g");function s0(e){return function(){return e}}function c0(e){return function(n){return e(n)+""}}function qf(e,n){var o=Cs.lastIndex=Ss.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",n=n+"";(i=Cs.exec(e))&&(a=Ss.exec(n));)(r=a.index)>o&&(r=n.slice(o,r),s[l]?s[l]+=r:s[++l]=r),(i=i[0])===(a=a[0])?s[l]?s[l]+=a:s[++l]=a:(s[++l]=null,c.push({i:l,x:_n(i,a)})),o=Ss.lastIndex;return o<n.length&&(r=n.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?c0(c[0].x):s0(n):(n=c.length,function(d){for(var u=0,m;u<n;++u)s[(m=c[u]).i]=m.x(d);return s.join("")})}function Ui(e,n){var o=typeof n,i;return n==null||o==="boolean"?vs(n):(o==="number"?_n:o==="string"?(i=Co(n))?(n=i,sr):qf:n instanceof Co?sr:n instanceof Date?r0:i0(n)?o0:Array.isArray(n)?a0:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?l0:_n)(e,n)}var Wf=180/Math.PI,Rs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Jf(e,n,o,i,a,r){var l,s,c;return(l=Math.sqrt(e*e+n*n))&&(e/=l,n/=l),(c=e*o+n*i)&&(o-=e*c,i-=n*c),(s=Math.sqrt(o*o+i*i))&&(o/=s,i/=s,c/=s),e*i<n*o&&(e=-e,n=-n,c=-c,l=-l),{translateX:a,translateY:r,rotate:Math.atan2(n,e)*Wf,skewX:Math.atan(c)*Wf,scaleX:l,scaleY:s}}var cr;function d0(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Rs:Jf(n.a,n.b,n.c,n.d,n.e,n.f)}function u0(e){return e==null||(cr||(cr=document.createElementNS("http://www.w3.org/2000/svg","g")),cr.setAttribute("transform",e),!(e=cr.transform.baseVal.consolidate()))?Rs:(e=e.matrix,Jf(e.a,e.b,e.c,e.d,e.e,e.f))}function Xf(e,n,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,f,p,y){if(d!==m||u!==f){var g=p.push("translate(",null,n,null,o);y.push({i:g-4,x:_n(d,m)},{i:g-2,x:_n(u,f)})}else(m||f)&&p.push("translate("+m+n+f+o)}function l(d,u,m,f){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),f.push({i:m.push(a(m)+"rotate(",null,i)-2,x:_n(d,u)})):u&&m.push(a(m)+"rotate("+u+i)}function s(d,u,m,f){d!==u?f.push({i:m.push(a(m)+"skewX(",null,i)-2,x:_n(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,f,p,y){if(d!==m||u!==f){var g=p.push(a(p)+"scale(",null,",",null,")");y.push({i:g-4,x:_n(d,m)},{i:g-2,x:_n(u,f)})}else(m!==1||f!==1)&&p.push(a(p)+"scale("+m+","+f+")")}return function(d,u){var m=[],f=[];return d=e(d),u=e(u),r(d.translateX,d.translateY,u.translateX,u.translateY,m,f),l(d.rotate,u.rotate,m,f),s(d.skewX,u.skewX,m,f),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,m,f),d=u=null,function(p){for(var y=-1,g=f.length,b;++y<g;)m[(b=f[y]).i]=b.x(p);return m.join("")}}}var m0=Xf(d0,"px, ","px)","deg)"),f0=Xf(u0,", ",")",")"),p0=1e-12;function Zf(e){return((e=Math.exp(e))+1/e)/2}function h0(e){return((e=Math.exp(e))-1/e)/2}function y0(e){return((e=Math.exp(2*e))-1)/(e+1)}const dr=(function e(n,o,i){function a(r,l){var s=r[0],c=r[1],d=r[2],u=l[0],m=l[1],f=l[2],p=u-s,y=m-c,g=p*p+y*y,b,k;if(g<p0)k=Math.log(f/d)/n,b=function(N){return[s+N*p,c+N*y,d*Math.exp(n*N*k)]};else{var _=Math.sqrt(g),h=(f*f-d*d+i*g)/(2*d*o*_),C=(f*f-d*d-i*g)/(2*f*o*_),v=Math.log(Math.sqrt(h*h+1)-h),S=Math.log(Math.sqrt(C*C+1)-C);k=(S-v)/n,b=function(N){var A=N*k,T=Zf(v),O=d/(o*_)*(T*y0(n*A+v)-h0(v));return[s+O*p,c+O*y,d*T/Zf(n*A+v)]}}return b.duration=k*1e3*n/Math.SQRT2,b}return a.rho=function(r){var l=Math.max(.001,+r),s=l*l,c=s*s;return e(l,s,c)},a})(Math.SQRT2,2,4);var ai=0,Hi=0,ji=0,Qf=1e3,ur,Ki,mr=0,Ao=0,fr=0,Gi=typeof performance=="object"&&performance.now?performance:Date,ep=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function As(){return Ao||(ep(g0),Ao=Gi.now()+fr)}function g0(){Ao=0}function pr(){this._call=this._time=this._next=null}pr.prototype=tp.prototype={constructor:pr,restart:function(e,n,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?As():+o)+(n==null?0:+n),!this._next&&Ki!==this&&(Ki?Ki._next=this:ur=this,Ki=this),this._call=e,this._time=o,xs()},stop:function(){this._call&&(this._call=null,this._time=1/0,xs())}};function tp(e,n,o){var i=new pr;return i.restart(e,n,o),i}function b0(){As(),++ai;for(var e=ur,n;e;)(n=Ao-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ai}function np(){Ao=(mr=Gi.now())+fr,ai=Hi=0;try{b0()}finally{ai=0,_0(),Ao=0}}function k0(){var e=Gi.now(),n=e-mr;n>Qf&&(fr-=n,mr=e)}function _0(){for(var e,n=ur,o,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(o=n._next,n._next=null,n=e?e._next=o:ur=o);Ki=e,xs(i)}function xs(e){if(!ai){Hi&&(Hi=clearTimeout(Hi));var n=e-Ao;n>24?(e<1/0&&(Hi=setTimeout(np,e-Gi.now()-fr)),ji&&(ji=clearInterval(ji))):(ji||(mr=Gi.now(),ji=setInterval(k0,Qf)),ai=1,ep(np))}}function op(e,n,o){var i=new pr;return n=n==null?0:+n,i.restart(a=>{i.stop(),e(a+n)},n,o),i}var E0=Qa("start","end","cancel","interrupt"),N0=[],ip=0,ap=1,$s=2,hr=3,rp=4,Ts=5,yr=6;function gr(e,n,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;w0(e,o,{name:n,index:i,group:a,on:E0,tween:N0,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:ip})}function Ms(e,n){var o=sn(e,n);if(o.state>ip)throw new Error("too late; already scheduled");return o}function En(e,n){var o=sn(e,n);if(o.state>hr)throw new Error("too late; already running");return o}function sn(e,n){var o=e.__transition;if(!o||!(o=o[n]))throw new Error("transition not found");return o}function w0(e,n,o){var i=e.__transition,a;i[n]=o,o.timer=tp(r,0,o.time);function r(d){o.state=ap,o.timer.restart(l,o.delay,o.time),o.delay<=d&&l(d-o.delay)}function l(d){var u,m,f,p;if(o.state!==ap)return c();for(u in i)if(p=i[u],p.name===o.name){if(p.state===hr)return op(l);p.state===rp?(p.state=yr,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[u]):+u<n&&(p.state=yr,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[u])}if(op(function(){o.state===hr&&(o.state=rp,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=$s,o.on.call("start",e,e.__data__,o.index,o.group),o.state===$s){for(o.state=hr,a=new Array(f=o.tween.length),u=0,m=-1;u<f;++u)(p=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++m]=p);a.length=m+1}}function s(d){for(var u=d<o.duration?o.ease.call(null,d/o.duration):(o.timer.restart(c),o.state=Ts,1),m=-1,f=a.length;++m<f;)a[m].call(e,u);o.state===Ts&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=yr,o.timer.stop(),delete i[n];for(var d in i)return;delete e.__transition}}function br(e,n){var o=e.__transition,i,a,r=!0,l;if(o){n=n==null?null:n+"";for(l in o){if((i=o[l]).name!==n){r=!1;continue}a=i.state>$s&&i.state<Ts,i.state=yr,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function I0(e){return this.each(function(){br(this,e)})}function v0(e,n){var o,i;return function(){var a=En(this,e),r=a.tween;if(r!==o){i=o=r;for(var l=0,s=i.length;l<s;++l)if(i[l].name===n){i=i.slice(),i.splice(l,1);break}}a.tween=i}}function C0(e,n,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=En(this,e),l=r.tween;if(l!==i){a=(i=l).slice();for(var s={name:n,value:o},c=0,d=a.length;c<d;++c)if(a[c].name===n){a[c]=s;break}c===d&&a.push(s)}r.tween=a}}function S0(e,n){var o=this._id;if(e+="",arguments.length<2){for(var i=sn(this.node(),o).tween,a=0,r=i.length,l;a<r;++a)if((l=i[a]).name===e)return l.value;return null}return this.each((n==null?v0:C0)(o,e,n))}function Vs(e,n,o){var i=e._id;return e.each(function(){var a=En(this,i);(a.value||(a.value={}))[n]=o.apply(this,arguments)}),function(a){return sn(a,i).value[n]}}function lp(e,n){var o;return(typeof n=="number"?_n:n instanceof Co?sr:(o=Co(n))?(n=o,sr):qf)(e,n)}function R0(e){return function(){this.removeAttribute(e)}}function A0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function x0(e,n,o){var i,a=o+"",r;return function(){var l=this.getAttribute(e);return l===a?null:l===i?r:r=n(i=l,o)}}function $0(e,n,o){var i,a=o+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===i?r:r=n(i=l,o)}}function T0(e,n,o){var i,a,r;return function(){var l,s=o(this),c;return s==null?void this.removeAttribute(e):(l=this.getAttribute(e),c=s+"",l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s)))}}function M0(e,n,o){var i,a,r;return function(){var l,s=o(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),c=s+"",l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s)))}}function V0(e,n){var o=tr(e),i=o==="transform"?f0:lp;return this.attrTween(e,typeof n=="function"?(o.local?M0:T0)(o,i,Vs(this,"attr."+e,n)):n==null?(o.local?A0:R0)(o):(o.local?$0:x0)(o,i,n))}function L0(e,n){return function(o){this.setAttribute(e,n.call(this,o))}}function B0(e,n){return function(o){this.setAttributeNS(e.space,e.local,n.call(this,o))}}function D0(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&B0(e,r)),o}return a._value=n,a}function O0(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&L0(e,r)),o}return a._value=n,a}function P0(e,n){var o="attr."+e;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(n==null)return this.tween(o,null);if(typeof n!="function")throw new Error;var i=tr(e);return this.tween(o,(i.local?D0:O0)(i,n))}function z0(e,n){return function(){Ms(this,e).delay=+n.apply(this,arguments)}}function F0(e,n){return n=+n,function(){Ms(this,e).delay=n}}function U0(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?z0:F0)(n,e)):sn(this.node(),n).delay}function H0(e,n){return function(){En(this,e).duration=+n.apply(this,arguments)}}function j0(e,n){return n=+n,function(){En(this,e).duration=n}}function K0(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?H0:j0)(n,e)):sn(this.node(),n).duration}function G0(e,n){if(typeof n!="function")throw new Error;return function(){En(this,e).ease=n}}function Y0(e){var n=this._id;return arguments.length?this.each(G0(n,e)):sn(this.node(),n).ease}function q0(e,n){return function(){var o=n.apply(this,arguments);if(typeof o!="function")throw new Error;En(this,e).ease=o}}function W0(e){if(typeof e!="function")throw new Error;return this.each(q0(this._id,e))}function J0(e){typeof e!="function"&&(e=vf(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=[],c,d=0;d<l;++d)(c=r[d])&&e.call(c,c.__data__,d,r)&&s.push(c);return new Bn(i,this._parents,this._name,this._id)}function X0(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,o=e._groups,i=n.length,a=o.length,r=Math.min(i,a),l=new Array(i),s=0;s<r;++s)for(var c=n[s],d=o[s],u=c.length,m=l[s]=new Array(u),f,p=0;p<u;++p)(f=c[p]||d[p])&&(m[p]=f);for(;s<i;++s)l[s]=n[s];return new Bn(l,this._parents,this._name,this._id)}function Z0(e){return(e+"").trim().split(/^|\s+/).every(function(n){var o=n.indexOf(".");return o>=0&&(n=n.slice(0,o)),!n||n==="start"})}function Q0(e,n,o){var i,a,r=Z0(n)?Ms:En;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(n,o),l.on=a}}function ew(e,n){var o=this._id;return arguments.length<2?sn(this.node(),o).on.on(e):this.each(Q0(o,e,n))}function tw(e){return function(){var n=this.parentNode;for(var o in this.__transition)if(+o!==e)return;n&&n.removeChild(this)}}function nw(){return this.on("end.remove",tw(this._id))}function ow(e){var n=this._name,o=this._id;typeof e!="function"&&(e=bs(e));for(var i=this._groups,a=i.length,r=new Array(a),l=0;l<a;++l)for(var s=i[l],c=s.length,d=r[l]=new Array(c),u,m,f=0;f<c;++f)(u=s[f])&&(m=e.call(u,u.__data__,f,s))&&("__data__"in u&&(m.__data__=u.__data__),d[f]=m,gr(d[f],n,o,f,d,sn(u,o)));return new Bn(r,this._parents,n,o)}function iw(e){var n=this._name,o=this._id;typeof e!="function"&&(e=If(e));for(var i=this._groups,a=i.length,r=[],l=[],s=0;s<a;++s)for(var c=i[s],d=c.length,u,m=0;m<d;++m)if(u=c[m]){for(var f=e.call(u,u.__data__,m,c),p,y=sn(u,o),g=0,b=f.length;g<b;++g)(p=f[g])&&gr(p,n,o,g,f,y);r.push(f),l.push(u)}return new Bn(r,l,n,o)}var aw=Di.prototype.constructor;function rw(){return new aw(this._groups,this._parents)}function lw(e,n){var o,i,a;return function(){var r=ni(this,e),l=(this.style.removeProperty(e),ni(this,e));return r===l?null:r===o&&l===i?a:a=n(o=r,i=l)}}function sp(e){return function(){this.style.removeProperty(e)}}function sw(e,n,o){var i,a=o+"",r;return function(){var l=ni(this,e);return l===a?null:l===i?r:r=n(i=l,o)}}function cw(e,n,o){var i,a,r;return function(){var l=ni(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),ni(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s))}}function dw(e,n){var o,i,a,r="style."+n,l="end."+r,s;return function(){var c=En(this,e),d=c.on,u=c.value[r]==null?s||(s=sp(n)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function uw(e,n,o){var i=(e+="")=="transform"?m0:lp;return n==null?this.styleTween(e,lw(e,i)).on("end.style."+e,sp(e)):typeof n=="function"?this.styleTween(e,cw(e,i,Vs(this,"style."+e,n))).each(dw(this._id,e)):this.styleTween(e,sw(e,i,n),o).on("end.style."+e,null)}function mw(e,n,o){return function(i){this.style.setProperty(e,n.call(this,i),o)}}function fw(e,n,o){var i,a;function r(){var l=n.apply(this,arguments);return l!==a&&(i=(a=l)&&mw(e,l,o)),i}return r._value=n,r}function pw(e,n,o){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,fw(e,n,o??""))}function hw(e){return function(){this.textContent=e}}function yw(e){return function(){var n=e(this);this.textContent=n??""}}function gw(e){return this.tween("text",typeof e=="function"?yw(Vs(this,"text",e)):hw(e==null?"":e+""))}function bw(e){return function(n){this.textContent=e.call(this,n)}}function kw(e){var n,o;function i(){var a=e.apply(this,arguments);return a!==o&&(n=(o=a)&&bw(a)),n}return i._value=e,i}function _w(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,kw(e))}function Ew(){for(var e=this._name,n=this._id,o=cp(),i=this._groups,a=i.length,r=0;r<a;++r)for(var l=i[r],s=l.length,c,d=0;d<s;++d)if(c=l[d]){var u=sn(c,n);gr(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Bn(i,this._parents,e,o)}function Nw(){var e,n,o=this,i=o._id,a=o.size();return new Promise(function(r,l){var s={value:l},c={value:function(){--a===0&&r()}};o.each(function(){var d=En(this,i),u=d.on;u!==e&&(n=(e=u).copy(),n._.cancel.push(s),n._.interrupt.push(s),n._.end.push(c)),d.on=n}),a===0&&r()})}var ww=0;function Bn(e,n,o,i){this._groups=e,this._parents=n,this._name=o,this._id=i}function cp(){return++ww}var Dn=Di.prototype;Bn.prototype={constructor:Bn,select:ow,selectAll:iw,selectChild:Dn.selectChild,selectChildren:Dn.selectChildren,filter:J0,merge:X0,selection:rw,transition:Ew,call:Dn.call,nodes:Dn.nodes,node:Dn.node,size:Dn.size,empty:Dn.empty,each:Dn.each,on:ew,attr:V0,attrTween:P0,style:uw,styleTween:pw,text:gw,textTween:_w,remove:nw,tween:S0,delay:U0,duration:K0,ease:Y0,easeVarying:W0,end:Nw,[Symbol.iterator]:Dn[Symbol.iterator]};function Iw(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var vw={time:null,delay:0,duration:250,ease:Iw};function Cw(e,n){for(var o;!(o=e.__transition)||!(o=o[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return o}function Sw(e){var n,o;e instanceof Bn?(n=e._id,e=e._name):(n=cp(),(o=vw).time=As(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,r=0;r<a;++r)for(var l=i[r],s=l.length,c,d=0;d<s;++d)(c=l[d])&&gr(c,e,n,d,l,o||Cw(c,n));return new Bn(i,this._parents,e,n)}Di.prototype.interrupt=I0,Di.prototype.transition=Sw;const kr=e=>()=>e;function Rw(e,{sourceEvent:n,target:o,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function On(e,n,o){this.k=e,this.x=n,this.y=o}On.prototype={constructor:On,scale:function(e){return e===1?this:new On(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new On(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ri=new On(1,0,0);On.prototype;function Ls(e){e.stopImmediatePropagation()}function Yi(e){e.preventDefault(),e.stopImmediatePropagation()}function Aw(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function xw(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function dp(){return this.__zoom||ri}function $w(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Tw(){return navigator.maxTouchPoints||"ontouchstart"in this}function Mw(e,n,o){var i=e.invertX(n[0][0])-o[0][0],a=e.invertX(n[1][0])-o[1][0],r=e.invertY(n[0][1])-o[0][1],l=e.invertY(n[1][1])-o[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),l>r?(r+l)/2:Math.min(0,r)||Math.max(0,l))}function Vw(){var e=Aw,n=xw,o=Mw,i=$w,a=Tw,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=dr,d=Qa("start","zoom","end"),u,m,f,p=500,y=150,g=0,b=10;function k(E){E.property("__zoom",dp).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",O).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(E,R,I,x){var $=E.selection?E.selection():E;$.property("__zoom",dp),E!==$?v(E,R,I,x):$.interrupt().each(function(){S(this,arguments).event(x).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},k.scaleBy=function(E,R,I,x){k.scaleTo(E,function(){var $=this.__zoom.k,U=typeof R=="function"?R.apply(this,arguments):R;return $*U},I,x)},k.scaleTo=function(E,R,I,x){k.transform(E,function(){var $=n.apply(this,arguments),U=this.__zoom,F=I==null?C($):typeof I=="function"?I.apply(this,arguments):I,B=U.invert(F),j=typeof R=="function"?R.apply(this,arguments):R;return o(h(_(U,j),F,B),$,l)},I,x)},k.translateBy=function(E,R,I,x){k.transform(E,function(){return o(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof I=="function"?I.apply(this,arguments):I),n.apply(this,arguments),l)},null,x)},k.translateTo=function(E,R,I,x,$){k.transform(E,function(){var U=n.apply(this,arguments),F=this.__zoom,B=x==null?C(U):typeof x=="function"?x.apply(this,arguments):x;return o(ri.translate(B[0],B[1]).scale(F.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof I=="function"?-I.apply(this,arguments):-I),U,l)},x,$)};function _(E,R){return R=Math.max(r[0],Math.min(r[1],R)),R===E.k?E:new On(R,E.x,E.y)}function h(E,R,I){var x=R[0]-I[0]*E.k,$=R[1]-I[1]*E.k;return x===E.x&&$===E.y?E:new On(E.k,x,$)}function C(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function v(E,R,I,x){E.on("start.zoom",function(){S(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(x).end()}).tween("zoom",function(){var $=this,U=arguments,F=S($,U).event(x),B=n.apply($,U),j=I==null?C(B):typeof I=="function"?I.apply($,U):I,X=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),W=$.__zoom,oe=typeof R=="function"?R.apply($,U):R,de=c(W.invert(j).concat(X/W.k),oe.invert(j).concat(X/oe.k));return function(ie){if(ie===1)ie=oe;else{var Ie=de(ie),Le=X/Ie[2];ie=new On(Le,j[0]-Ie[0]*Le,j[1]-Ie[1]*Le)}F.zoom(null,ie)}})}function S(E,R,I){return!I&&E.__zooming||new N(E,R)}function N(E,R){this.that=E,this.args=R,this.active=0,this.sourceEvent=null,this.extent=n.apply(E,R),this.taps=0}N.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,R){return this.mouse&&E!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var R=rn(this.that).datum();d.call(E,this.that,new Rw(E,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),R)}};function A(E,...R){if(!e.apply(this,arguments))return;var I=S(this,R).event(E),x=this.__zoom,$=Math.max(r[0],Math.min(r[1],x.k*Math.pow(2,i.apply(this,arguments)))),U=bn(E);if(I.wheel)(I.mouse[0][0]!==U[0]||I.mouse[0][1]!==U[1])&&(I.mouse[1]=x.invert(I.mouse[0]=U)),clearTimeout(I.wheel);else{if(x.k===$)return;I.mouse=[U,x.invert(U)],br(this),I.start()}Yi(E),I.wheel=setTimeout(F,y),I.zoom("mouse",o(h(_(x,$),I.mouse[0],I.mouse[1]),I.extent,l));function F(){I.wheel=null,I.end()}}function T(E,...R){if(f||!e.apply(this,arguments))return;var I=E.currentTarget,x=S(this,R,!0).event(E),$=rn(E.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",X,!0),U=bn(E,I),F=E.clientX,B=E.clientY;Lf(E.view),Ls(E),x.mouse=[U,this.__zoom.invert(U)],br(this),x.start();function j(W){if(Yi(W),!x.moved){var oe=W.clientX-F,de=W.clientY-B;x.moved=oe*oe+de*de>g}x.event(W).zoom("mouse",o(h(x.that.__zoom,x.mouse[0]=bn(W,I),x.mouse[1]),x.extent,l))}function X(W){$.on("mousemove.zoom mouseup.zoom",null),Bf(W.view,x.moved),Yi(W),x.event(W).end()}}function O(E,...R){if(e.apply(this,arguments)){var I=this.__zoom,x=bn(E.changedTouches?E.changedTouches[0]:E,this),$=I.invert(x),U=I.k*(E.shiftKey?.5:2),F=o(h(_(I,U),x,$),n.apply(this,R),l);Yi(E),s>0?rn(this).transition().duration(s).call(v,F,x,E):rn(this).call(k.transform,F,x,E)}}function z(E,...R){if(e.apply(this,arguments)){var I=E.touches,x=I.length,$=S(this,R,E.changedTouches.length===x).event(E),U,F,B,j;for(Ls(E),F=0;F<x;++F)B=I[F],j=bn(B,this),j=[j,this.__zoom.invert(j),B.identifier],$.touch0?!$.touch1&&$.touch0[2]!==j[2]&&($.touch1=j,$.taps=0):($.touch0=j,U=!0,$.taps=1+!!u);u&&(u=clearTimeout(u)),U&&($.taps<2&&(m=j[0],u=setTimeout(function(){u=null},p)),br(this),$.start())}}function P(E,...R){if(this.__zooming){var I=S(this,R).event(E),x=E.changedTouches,$=x.length,U,F,B,j;for(Yi(E),U=0;U<$;++U)F=x[U],B=bn(F,this),I.touch0&&I.touch0[2]===F.identifier?I.touch0[0]=B:I.touch1&&I.touch1[2]===F.identifier&&(I.touch1[0]=B);if(F=I.that.__zoom,I.touch1){var X=I.touch0[0],W=I.touch0[1],oe=I.touch1[0],de=I.touch1[1],ie=(ie=oe[0]-X[0])*ie+(ie=oe[1]-X[1])*ie,Ie=(Ie=de[0]-W[0])*Ie+(Ie=de[1]-W[1])*Ie;F=_(F,Math.sqrt(ie/Ie)),B=[(X[0]+oe[0])/2,(X[1]+oe[1])/2],j=[(W[0]+de[0])/2,(W[1]+de[1])/2]}else if(I.touch0)B=I.touch0[0],j=I.touch0[1];else return;I.zoom("touch",o(h(F,B,j),I.extent,l))}}function D(E,...R){if(this.__zooming){var I=S(this,R).event(E),x=E.changedTouches,$=x.length,U,F;for(Ls(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),U=0;U<$;++U)F=x[U],I.touch0&&I.touch0[2]===F.identifier?delete I.touch0:I.touch1&&I.touch1[2]===F.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(F=bn(F,this),Math.hypot(m[0]-F[0],m[1]-F[1])<b)){var B=rn(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return k.wheelDelta=function(E){return arguments.length?(i=typeof E=="function"?E:kr(+E),k):i},k.filter=function(E){return arguments.length?(e=typeof E=="function"?E:kr(!!E),k):e},k.touchable=function(E){return arguments.length?(a=typeof E=="function"?E:kr(!!E),k):a},k.extent=function(E){return arguments.length?(n=typeof E=="function"?E:kr([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),k):n},k.scaleExtent=function(E){return arguments.length?(r[0]=+E[0],r[1]=+E[1],k):[r[0],r[1]]},k.translateExtent=function(E){return arguments.length?(l[0][0]=+E[0][0],l[1][0]=+E[1][0],l[0][1]=+E[0][1],l[1][1]=+E[1][1],k):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},k.constrain=function(E){return arguments.length?(o=E,k):o},k.duration=function(E){return arguments.length?(s=+E,k):s},k.interpolate=function(E){return arguments.length?(c=E,k):c},k.on=function(){var E=d.on.apply(d,arguments);return E===d?k:E},k.clickDistance=function(E){return arguments.length?(g=(E=+E)*E,k):Math.sqrt(g)},k.tapDistance=function(E){return arguments.length?(b=+E,k):b},k}var Ve=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(Ve||{}),Bs=(e=>(e.Partial="partial",e.Full="full",e))(Bs||{}),xo=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(xo||{}),Pn=(e=>(e.Strict="strict",e.Loose="loose",e))(Pn||{}),Ds=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(Ds||{}),qi=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(qi||{}),up=(e=>(e.TopLeft="top-left",e.TopCenter="top-center",e.TopRight="top-right",e.BottomLeft="bottom-left",e.BottomCenter="bottom-center",e.BottomRight="bottom-right",e))(up||{});const Lw=["INPUT","SELECT","TEXTAREA"],Bw=typeof document<"u"?document:null;function Os(e){var n,o;const i=((o=(n=e.composedPath)==null?void 0:n.call(e))==null?void 0:o[0])||e.target,a=typeof(i==null?void 0:i.hasAttribute)=="function"?i.hasAttribute("contenteditable"):!1,r=typeof(i==null?void 0:i.closest)=="function"?i.closest(".nokey"):null;return Lw.includes(i==null?void 0:i.nodeName)||a||!!r}function Dw(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function mp(e,n,o,i){const a=n.replace("+",`
|
|
35
35
|
`).replace(`
|
|
36
36
|
|
|
37
37
|
`,`
|
|
@@ -56,7 +56,7 @@ Edge: ${e}
|
|
|
56
56
|
Source: ${n}
|
|
57
57
|
Target: ${o}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
58
58
|
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
|
59
|
-
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class vt extends Error{constructor(n,...o){var i;super((i=Bp[n])==null?void 0:i.call(Bp,...o)),this.name="VueFlowError",this.code=n,this.args=o}}function js(e){return"clientX"in e}function nI(e){return"sourceEvent"in e}function Nn(e,n){const o=js(e);let i,a;return o?(i=e.clientX,a=e.clientY):"touches"in e&&e.touches.length>0?(i=e.touches[0].clientX,a=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(i=e.changedTouches[0].clientX,a=e.changedTouches[0].clientY):(i=0,a=0),{x:i-((n==null?void 0:n.left)??0),y:a-((n==null?void 0:n.top)??0)}}const ea=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function oI(e){var n,o;return{width:((n=e.dimensions)==null?void 0:n.width)??e.width??0,height:((o=e.dimensions)==null?void 0:o.height)??e.height??0}}function vr(e,n=[1,1]){return{x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}}const iI=()=>!0;function Ks(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function aI(e,n,o){const i=[],a={x:e.x-o,y:e.y-o,width:o*2,height:o*2};for(const r of n.values())Er(a,_r(r))>0&&i.push(r);return i}const rI=250;function lI(e,n,o,i){var a,r;let l=[],s=Number.POSITIVE_INFINITY;const c=aI(e,o,n+rI);for(const d of c){const u=[...((a=d.handleBounds)==null?void 0:a.source)??[],...((r=d.handleBounds)==null?void 0:r.target)??[]];for(const m of u){if(i.nodeId===m.nodeId&&i.type===m.type&&i.id===m.id)continue;const{x:f,y:p}=ci(d,m,m.position,!0),y=Math.sqrt((f-e.x)**2+(p-e.y)**2);y>n||(y<s?(l=[{...m,x:f,y:p}],s=y):y===s&&l.push({...m,x:f,y:p}))}}if(!l.length)return null;if(l.length>1){const d=i.type==="source"?"target":"source";return l.find(u=>u.type===d)??l[0]}return l[0]}function Dp(e,{handle:n,connectionMode:o,fromNodeId:i,fromHandleId:a,fromType:r,doc:l,lib:s,flowId:c,isValidConnection:d=iI},u,m,f,p){const y=r==="target",g=n?l.querySelector(`.${s}-flow__handle[data-id="${c}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:b,y:k}=Nn(e),_=l.elementFromPoint(b,k),h=_!=null&&_.classList.contains(`${s}-flow__handle`)?_:g,C={handleDomNode:h,isValid:!1,connection:null,toHandle:null};if(h){const v=Op(void 0,h),S=h.getAttribute("data-nodeid"),N=h.getAttribute("data-handleid"),A=h.classList.contains("connectable"),T=h.classList.contains("connectableend");if(!S||!v)return C;const O={source:y?S:i,sourceHandle:y?N:a,target:y?i:S,targetHandle:y?a:N};C.connection=O;const P=A&&T&&(o===Pn.Strict?y&&v==="source"||!y&&v==="target":S!==i||N!==a);C.isValid=P&&d(O,{nodes:m,edges:u,sourceNode:f(O.source),targetNode:f(O.target)}),C.toHandle=Pp(S,v,N,p,o,!0)}return C}function Op(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function sI(e,n){let o=null;return n?o="valid":e&&!n&&(o="invalid"),o}function cI(e,n){let o=null;return n?o=!0:e&&!n&&(o=!1),o}function Pp(e,n,o,i,a,r=!1){var l,s,c;const d=i.get(e);if(!d)return null;const u=a===Pn.Strict?(l=d.handleBounds)==null?void 0:l[n]:[...((s=d.handleBounds)==null?void 0:s.source)??[],...((c=d.handleBounds)==null?void 0:c.target)??[]],m=(o?u==null?void 0:u.find(f=>f.id===o):u==null?void 0:u[0])??null;return m&&r?{...m,...ci(d,m,m.position,!0)}:m}const Gs={[Ve.Left]:Ve.Right,[Ve.Right]:Ve.Left,[Ve.Top]:Ve.Bottom,[Ve.Bottom]:Ve.Top},dI=["production","prod"];function ta(e,...n){zp()&&console.warn(`[Vue Flow]: ${e}`,...n)}function zp(){return!dI.includes(process.env.NODE_ENV||"")}function Fp(e,n,o,i,a){const r=n.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(l=>{const s=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:a,position:l.getAttribute("data-handlepos"),x:(s.left-o.left)/i,y:(s.top-o.top)/i,...Nr(l)}}):null}function Ys(e,n,o,i,a,r=!1,l){a.value=!1,e.selected?(r||e.selected&&n)&&(i([e]),t.nextTick(()=>{l.blur()})):o([e])}function Et(e){return typeof t.unref(e)<"u"}function uI(e,n,o,i){if(!e||!e.source||!e.target)return o(new vt(_t.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let a;return Qn(e)?a=e:a={...e,id:_p(e)},a=bp(a,void 0,i),Kw(a,n)?!1:a}function mI(e,n,o,i,a){if(!n.source||!n.target)return a(new vt(_t.EDGE_INVALID,e.id)),!1;if(!o)return a(new vt(_t.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...l}=e;return{...l,id:i?_p(n):r,source:n.source,target:n.target,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle}}function Up(e,n,o){const i={},a=[];for(let r=0;r<e.length;++r){const l=e[r];if(!To(l)){o(new vt(_t.NODE_INVALID,l==null?void 0:l.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const s=Uw(l,n(l.id),l.parentNode);l.parentNode&&(i[l.parentNode]=!0),a[r]=s}for(const r of a){const l=n(r.parentNode)||a.find(s=>s.id===r.parentNode);r.parentNode&&!l&&o(new vt(_t.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||i[r.id])&&(i[r.id]&&(r.isParent=!0),l&&(l.isParent=!0))}return a}function Hp(e,n,o,i,a,r){let l=a;const s=i.get(l)||new Map;i.set(l,s.set(o,n)),l=`${a}-${e}`;const c=i.get(l)||new Map;if(i.set(l,c.set(o,n)),r){l=`${a}-${e}-${r}`;const d=i.get(l)||new Map;i.set(l,d.set(o,n))}}function qs(e,n,o){e.clear();for(const i of o){const{source:a,target:r,sourceHandle:l=null,targetHandle:s=null}=i,c={edgeId:i.id,source:a,target:r,sourceHandle:l,targetHandle:s},d=`${a}-${l}--${r}-${s}`,u=`${r}-${s}--${a}-${l}`;Hp("source",c,u,e,a,l),Hp("target",c,d,e,r,s)}}function jp(e,n){if(e.size!==n.size)return!1;for(const o of e)if(!n.has(o))return!1;return!0}function Ws(e,n,o,i,a,r,l,s){const c=[];for(const d of e){const u=Qn(d)?d:uI(d,s,a,r);if(!u)continue;const m=o(u.source),f=o(u.target);if(!m||!f){a(new vt(_t.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!m){a(new vt(_t.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!f){a(new vt(_t.EDGE_TARGET_MISSING,u.id,u.target));continue}if(n&&!n(u,{edges:s,nodes:l,sourceNode:m,targetNode:f})){a(new vt(_t.EDGE_INVALID,u.id));continue}const p=i(u.id);c.push({...bp(u,p,r),sourceNode:m,targetNode:f})}return c}const Kp=Symbol("vueFlow"),Gp=Symbol("nodeId"),Yp=Symbol("nodeRef"),fI=Symbol("edgeId"),pI=Symbol("edgeRef"),Cr=Symbol("slots");function qp(e){const{vueFlowRef:n,snapToGrid:o,snapGrid:i,noDragClassName:a,nodeLookup:r,nodeExtent:l,nodeDragThreshold:s,viewport:c,autoPanOnNodeDrag:d,autoPanSpeed:u,nodesDraggable:m,panBy:f,findNode:p,multiSelectionActive:y,nodesSelectionActive:g,selectNodesOnDrag:b,removeSelectedElements:k,addSelectedNodes:_,updateNodePositions:h,emits:C}=ot(),{onStart:v,onDrag:S,onStop:N,onClick:A,el:T,disabled:O,id:z,selectable:P,dragHandle:D}=e,E=t.shallowRef(!1);let R=[],I,x=null,$={x:void 0,y:void 0},U={x:0,y:0},F=null,B=!1,j=!1,X=0,W=!1;const oe=gI(),de=({x:pe,y:he})=>{$={x:pe,y:he};let V=!1;if(R=R.map(L=>{const K={x:pe-L.distance.x,y:he-L.distance.y},{computedPosition:Z}=Hs(L,o.value?vr(K,i.value):K,C.error,l.value,L.parentNode?p(L.parentNode):void 0);return V=V||L.position.x!==Z.x||L.position.y!==Z.y,L.position=Z,L}),j=j||V,!!V&&(h(R,!0,!0),E.value=!0,F)){const[L,K]=Us({id:z,dragItems:R,findNode:p});S({event:F,node:L,nodes:K})}},ie=()=>{if(!x)return;const[pe,he]=Sp(U,x,u.value);if(pe!==0||he!==0){const V={x:($.x??0)-pe/c.value.zoom,y:($.y??0)-he/c.value.zoom};f({x:pe,y:he})&&de(V)}X=requestAnimationFrame(ie)},Ie=(pe,he)=>{B=!0;const V=p(z);!b.value&&!y.value&&V&&(V.selected||k()),V&&t.toValue(P)&&b.value&&Ys(V,y.value,_,k,g,!1,he);const L=oe(pe.sourceEvent);if($=L,R=Jw(r.value,m.value,L,z),R.length){const[K,Z]=Us({id:z,dragItems:R,findNode:p});v({event:pe.sourceEvent,node:K,nodes:Z})}},Le=(pe,he)=>{var V;pe.sourceEvent.type==="touchmove"&&pe.sourceEvent.touches.length>1||(j=!1,s.value===0&&Ie(pe,he),$=oe(pe.sourceEvent),x=((V=n.value)==null?void 0:V.getBoundingClientRect())||null,U=Nn(pe.sourceEvent,x))},Se=(pe,he)=>{const V=oe(pe.sourceEvent);if(!W&&B&&d.value&&(W=!0,ie()),!B){const L=V.xSnapped-($.x??0),K=V.ySnapped-($.y??0);Math.sqrt(L*L+K*K)>s.value&&Ie(pe,he)}($.x!==V.xSnapped||$.y!==V.ySnapped)&&R.length&&B&&(F=pe.sourceEvent,U=Nn(pe.sourceEvent,x),de(V))},ce=pe=>{let he=!1;if(!B&&!E.value&&!y.value){const V=pe.sourceEvent,L=oe(V),K=L.xSnapped-($.x??0),Z=L.ySnapped-($.y??0),Q=Math.sqrt(K*K+Z*Z);Q!==0&&Q<=s.value&&(A==null||A(V),he=!0)}if(R.length&&!he){j&&(h(R,!1,!1),j=!1);const[V,L]=Us({id:z,dragItems:R,findNode:p});N({event:pe.sourceEvent,node:V,nodes:L})}R=[],E.value=!1,W=!1,B=!1,$={x:void 0,y:void 0},cancelAnimationFrame(X)};return t.watch([()=>t.toValue(O),T],([pe,he],V,L)=>{if(he){const K=rn(he);pe||(I=FN().on("start",Z=>Le(Z,he)).on("drag",Z=>Se(Z,he)).on("end",Z=>ce(Z)).filter(Z=>{const Q=Z.target,fe=t.toValue(D);return!Z.button&&(!a.value||!Mp(Q,`.${a.value}`,he)&&(!fe||Mp(Q,fe,he)))}),K.call(I)),L(()=>{K.on(".drag",null),I&&(I.on("start",null),I.on("drag",null),I.on("end",null))})}}),E}function hI(){return{doubleClick:Te(),click:Te(),mouseEnter:Te(),mouseMove:Te(),mouseLeave:Te(),contextMenu:Te(),updateStart:Te(),update:Te(),updateEnd:Te()}}function yI(e,n){const o=hI();return o.doubleClick.on(i=>{var a,r;n.edgeDoubleClick(i),(r=(a=e.events)==null?void 0:a.doubleClick)==null||r.call(a,i)}),o.click.on(i=>{var a,r;n.edgeClick(i),(r=(a=e.events)==null?void 0:a.click)==null||r.call(a,i)}),o.mouseEnter.on(i=>{var a,r;n.edgeMouseEnter(i),(r=(a=e.events)==null?void 0:a.mouseEnter)==null||r.call(a,i)}),o.mouseMove.on(i=>{var a,r;n.edgeMouseMove(i),(r=(a=e.events)==null?void 0:a.mouseMove)==null||r.call(a,i)}),o.mouseLeave.on(i=>{var a,r;n.edgeMouseLeave(i),(r=(a=e.events)==null?void 0:a.mouseLeave)==null||r.call(a,i)}),o.contextMenu.on(i=>{var a,r;n.edgeContextMenu(i),(r=(a=e.events)==null?void 0:a.contextMenu)==null||r.call(a,i)}),o.updateStart.on(i=>{var a,r;n.edgeUpdateStart(i),(r=(a=e.events)==null?void 0:a.updateStart)==null||r.call(a,i)}),o.update.on(i=>{var a,r;n.edgeUpdate(i),(r=(a=e.events)==null?void 0:a.update)==null||r.call(a,i)}),o.updateEnd.on(i=>{var a,r;n.edgeUpdateEnd(i),(r=(a=e.events)==null?void 0:a.updateEnd)==null||r.call(a,i)}),Object.entries(o).reduce((i,[a,r])=>(i.emit[a]=r.trigger,i.on[a]=r.on,i),{emit:{},on:{}})}function gI(){const{viewport:e,snapGrid:n,snapToGrid:o,vueFlowRef:i}=ot();return a=>{var r;const l=((r=i.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},s=nI(a)?a.sourceEvent:a,{x:c,y:d}=Nn(s,l),u=Zi({x:c,y:d},e.value),{x:m,y:f}=o.value?vr(u,n.value):u;return{xSnapped:m,ySnapped:f,...u}}}function Sr(){return!0}function Wp({handleId:e,nodeId:n,type:o,isValidConnection:i,edgeUpdaterType:a,onEdgeUpdate:r,onEdgeUpdateEnd:l}){const{id:s,vueFlowRef:c,connectionMode:d,connectionRadius:u,connectOnClick:m,connectionClickStartHandle:f,nodesConnectable:p,autoPanOnConnect:y,autoPanSpeed:g,findNode:b,panBy:k,startConnection:_,updateConnection:h,endConnection:C,emits:v,viewport:S,edges:N,nodes:A,isValidConnection:T,nodeLookup:O}=ot();let z=null,P=!1,D=null;function E(I){var x;const $=t.toValue(o)==="target",U=js(I),F=gp(I.target),B=I.currentTarget;if(B&&(U&&I.button===0||!U)){let j=function(Ne){V=Nn(Ne,ce),de=lI(Zi(V,S.value,!1,[1,1]),u.value,O.value,Z),L||(K(),L=!0);const J=Dp(Ne,{handle:de,connectionMode:d.value,fromNodeId:t.toValue(n),fromHandleId:t.toValue(e),fromType:$?"target":"source",isValidConnection:oe,doc:F,lib:"vue",flowId:s,nodeLookup:O.value},N.value,A.value,b,O.value);D=J.handleDomNode,z=J.connection,P=cI(!!de,J.isValid);const ee={...Ee,isValid:P,to:J.toHandle&&P?Xi({x:J.toHandle.x,y:J.toHandle.y},S.value):V,toHandle:J.toHandle,toPosition:P&&J.toHandle?J.toHandle.position:Gs[Z.position],toNode:J.toHandle?O.value.get(J.toHandle.nodeId):null};if(P&&de&&(Ee!=null&&Ee.toHandle)&&ee.toHandle&&Ee.toHandle.type===ee.toHandle.type&&Ee.toHandle.nodeId===ee.toHandle.nodeId&&Ee.toHandle.id===ee.toHandle.id&&Ee.to.x===ee.to.x&&Ee.to.y===ee.to.y)return;const te=de??J.toHandle;if(h(te&&P?Xi({x:te.x,y:te.y},S.value):V,te,sI(!!te,P)),Ee=ee,!de&&!P&&!D)return Ks(he);z&&z.source!==z.target&&D&&(Ks(he),he=D,D.classList.add("connecting","vue-flow__handle-connecting"),D.classList.toggle("valid",!!P),D.classList.toggle("vue-flow__handle-valid",!!P))},X=function(Ne){"touches"in Ne&&Ne.touches.length>0||((de||D)&&z&&P&&(r?r(Ne,z):v.connect(z)),v.connectEnd(Ne),a&&(l==null||l(Ne)),Ks(he),cancelAnimationFrame(ie),C(Ne),L=!1,P=!1,z=null,D=null,F.removeEventListener("mousemove",j),F.removeEventListener("mouseup",X),F.removeEventListener("touchmove",j),F.removeEventListener("touchend",X))};const W=b(t.toValue(n));let oe=t.toValue(i)||T.value||Sr;!oe&&W&&(oe=($?W.isValidSourcePos:W.isValidTargetPos)||Sr);let de,ie=0;const{x:Ie,y:Le}=Nn(I),Se=Op(t.toValue(a),B),ce=(x=c.value)==null?void 0:x.getBoundingClientRect();if(!ce||!Se)return;const pe=Pp(t.toValue(n),Se,t.toValue(e),O.value,d.value);if(!pe)return;let he,V=Nn(I,ce),L=!1;const K=()=>{if(!y.value)return;const[Ne,J]=Sp(V,ce,g.value);k({x:Ne,y:J}),ie=requestAnimationFrame(K)},Z={...pe,nodeId:t.toValue(n),type:Se,position:pe.position},Q=O.value.get(t.toValue(n)),be={inProgress:!0,isValid:null,from:ci(Q,Z,Ve.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:Q,to:V,toHandle:null,toPosition:Gs[Z.position],toNode:null};_({nodeId:t.toValue(n),id:t.toValue(e),type:Se,position:(B==null?void 0:B.getAttribute("data-handlepos"))||Ve.Top,...V},{x:Ie-ce.left,y:Le-ce.top}),v.connectStart({event:I,nodeId:t.toValue(n),handleId:t.toValue(e),handleType:Se});let Ee=be;F.addEventListener("mousemove",j),F.addEventListener("mouseup",X),F.addEventListener("touchmove",j),F.addEventListener("touchend",X)}}function R(I){var x,$;if(!m.value)return;const U=t.toValue(o)==="target";if(!f.value){v.clickConnectStart({event:I,nodeId:t.toValue(n),handleId:t.toValue(e)}),_({nodeId:t.toValue(n),type:t.toValue(o),id:t.toValue(e),position:Ve.Top,...Nn(I)},void 0,!0);return}let F=t.toValue(i)||T.value||Sr;const B=b(t.toValue(n));if(!F&&B&&(F=(U?B.isValidSourcePos:B.isValidTargetPos)||Sr),B&&(typeof B.connectable>"u"?p.value:B.connectable)===!1)return;const j=gp(I.target),X=Dp(I,{handle:{nodeId:t.toValue(n),id:t.toValue(e),type:t.toValue(o),position:Ve.Top,...Nn(I)},connectionMode:d.value,fromNodeId:f.value.nodeId,fromHandleId:f.value.id??null,fromType:f.value.type,isValidConnection:F,doc:j,lib:"vue",flowId:s,nodeLookup:O.value},N.value,A.value,b,O.value),W=((x=X.connection)==null?void 0:x.source)===(($=X.connection)==null?void 0:$.target);X.isValid&&X.connection&&!W&&v.connect(X.connection),v.clickConnectEnd(I),C(I,!0)}return{handlePointerDown:E,handleClick:R}}function bI(){return t.inject(Gp,"")}function Jp(e){const n=e??bI()??"",o=t.inject(Yp,t.ref(null)),{findNode:i,edges:a,emits:r}=ot(),l=i(n);return l||r.error(new vt(_t.NODE_NOT_FOUND,n)),{id:n,nodeEl:o,node:l,parentNode:t.computed(()=>i(l.parentNode)),connectedEdges:t.computed(()=>Mo([l],a.value))}}function kI(){return{doubleClick:Te(),click:Te(),mouseEnter:Te(),mouseMove:Te(),mouseLeave:Te(),contextMenu:Te(),dragStart:Te(),drag:Te(),dragStop:Te()}}function _I(e,n){const o=kI();return o.doubleClick.on(i=>{var a,r;n.nodeDoubleClick(i),(r=(a=e.events)==null?void 0:a.doubleClick)==null||r.call(a,i)}),o.click.on(i=>{var a,r;n.nodeClick(i),(r=(a=e.events)==null?void 0:a.click)==null||r.call(a,i)}),o.mouseEnter.on(i=>{var a,r;n.nodeMouseEnter(i),(r=(a=e.events)==null?void 0:a.mouseEnter)==null||r.call(a,i)}),o.mouseMove.on(i=>{var a,r;n.nodeMouseMove(i),(r=(a=e.events)==null?void 0:a.mouseMove)==null||r.call(a,i)}),o.mouseLeave.on(i=>{var a,r;n.nodeMouseLeave(i),(r=(a=e.events)==null?void 0:a.mouseLeave)==null||r.call(a,i)}),o.contextMenu.on(i=>{var a,r;n.nodeContextMenu(i),(r=(a=e.events)==null?void 0:a.contextMenu)==null||r.call(a,i)}),o.dragStart.on(i=>{var a,r;n.nodeDragStart(i),(r=(a=e.events)==null?void 0:a.dragStart)==null||r.call(a,i)}),o.drag.on(i=>{var a,r;n.nodeDrag(i),(r=(a=e.events)==null?void 0:a.drag)==null||r.call(a,i)}),o.dragStop.on(i=>{var a,r;n.nodeDragStop(i),(r=(a=e.events)==null?void 0:a.dragStop)==null||r.call(a,i)}),Object.entries(o).reduce((i,[a,r])=>(i.emit[a]=r.trigger,i.on[a]=r.on,i),{emit:{},on:{}})}function Xp(){const{getSelectedNodes:e,nodeExtent:n,updateNodePositions:o,findNode:i,snapGrid:a,snapToGrid:r,nodesDraggable:l,emits:s}=ot();return(c,d=!1)=>{const u=r.value?a.value[0]:5,m=r.value?a.value[1]:5,f=d?4:1,p=c.x*u*f,y=c.y*m*f,g=[];for(const b of e.value)if(b.draggable||l&&typeof b.draggable>"u"){const k={x:b.computedPosition.x+p,y:b.computedPosition.y+y},{position:_}=Hs(b,k,s.error,n.value,b.parentNode?i(b.parentNode):void 0);g.push({id:b.id,position:_,from:b.position,distance:{x:c.x,y:c.y},dimensions:b.dimensions})}o(g,!0,!1)}}const Rr=.1,EI=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function no(){return ta("Viewport not initialized yet."),Promise.resolve(!1)}const NI={zoomIn:no,zoomOut:no,zoomTo:no,fitView:no,setCenter:no,fitBounds:no,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:no,setTransform:no,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function wI(e){function n(i,a){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((a==null?void 0:a.interpolate)==="linear"?Ui:dr).scaleBy(Js(e.d3Selection,a==null?void 0:a.duration,a==null?void 0:a.ease,()=>{r(!0)}),i):r(!1)})}function o(i,a,r,l){return new Promise(s=>{var c;const{x:d,y:u}=yp({x:-i,y:-a},e.translateExtent),m=ri.translate(-d,-u).scale(r);e.d3Selection&&e.d3Zoom?(c=e.d3Zoom)==null||c.interpolate((l==null?void 0:l.interpolate)==="linear"?Ui:dr).transform(Js(e.d3Selection,l==null?void 0:l.duration,l==null?void 0:l.ease,()=>{s(!0)}),m):s(!1)})}return t.computed(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:a=>n(1.2,a),zoomOut:a=>n(1/1.2,a),zoomTo:(a,r)=>new Promise(l=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((r==null?void 0:r.interpolate)==="linear"?Ui:dr).scaleTo(Js(e.d3Selection,r==null?void 0:r.duration,r==null?void 0:r.ease,()=>{l(!0)}),a):l(!1)}),setViewport:(a,r)=>o(a.x,a.y,a.zoom,r),setTransform:(a,r)=>o(a.x,a.y,a.zoom,r),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(a={padding:Rr,includeHiddenNodes:!1,duration:0})=>{var r,l;const s=[];for(const f of e.nodes)f.dimensions.width&&f.dimensions.height&&((a==null?void 0:a.includeHiddenNodes)||!f.hidden)&&(!((r=a.nodes)!=null&&r.length)||(l=a.nodes)!=null&&l.length&&a.nodes.includes(f.id))&&s.push(f);if(!s.length)return Promise.resolve(!1);const c=Ps(s),{x:d,y:u,zoom:m}=Ip(c,e.dimensions.width,e.dimensions.height,a.minZoom??e.minZoom,a.maxZoom??e.maxZoom,a.padding??Rr);return o(d,u,m,a)},setCenter:(a,r,l)=>{const s=typeof(l==null?void 0:l.zoom)<"u"?l.zoom:e.maxZoom,c=e.dimensions.width/2-a*s,d=e.dimensions.height/2-r*s;return o(c,d,s,l)},fitBounds:(a,r={padding:Rr})=>{const{x:l,y:s,zoom:c}=Ip(a,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding??Rr);return o(l,s,c,r)},project:a=>Zi(a,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:a=>{if(e.vueFlowRef){const{x:r,y:l}=e.vueFlowRef.getBoundingClientRect(),s={x:a.x-r,y:a.y-l};return Zi(s,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:a=>{if(e.vueFlowRef){const{x:r,y:l}=e.vueFlowRef.getBoundingClientRect(),s={x:a.x+r,y:a.y+l};return Xi(s,e.viewport)}return{x:0,y:0}}}:NI)}function Js(e,n=0,o=EI,i=()=>{}){const a=typeof n=="number"&&n>0;return a||i(),a?e.transition().duration(n).ease(o).on("end",i):e}function II(e,n,o){const i=t.effectScope(!0);return i.run(()=>{const a=()=>{i.run(()=>{let g,b,k=!!(o.nodes.value.length||o.edges.value.length);g=ti([e.modelValue,()=>{var _,h;return(h=(_=e.modelValue)==null?void 0:_.value)==null?void 0:h.length}],([_])=>{_&&Array.isArray(_)&&(b==null||b.pause(),o.setElements(_),!b&&!k&&_.length?k=!0:b==null||b.resume())}),b=ti([o.nodes,o.edges,()=>o.edges.value.length,()=>o.nodes.value.length],([_,h])=>{var C;(C=e.modelValue)!=null&&C.value&&Array.isArray(e.modelValue.value)&&(g==null||g.pause(),e.modelValue.value=[..._,...h],t.nextTick(()=>{g==null||g.resume()}))},{immediate:k}),t.onScopeDispose(()=>{g==null||g.stop(),b==null||b.stop()})})},r=()=>{i.run(()=>{let g,b,k=!!o.nodes.value.length;g=ti([e.nodes,()=>{var _,h;return(h=(_=e.nodes)==null?void 0:_.value)==null?void 0:h.length}],([_])=>{_&&Array.isArray(_)&&(b==null||b.pause(),o.setNodes(_),!b&&!k&&_.length?k=!0:b==null||b.resume())}),b=ti([o.nodes,()=>o.nodes.value.length],([_])=>{var h;(h=e.nodes)!=null&&h.value&&Array.isArray(e.nodes.value)&&(g==null||g.pause(),e.nodes.value=[..._],t.nextTick(()=>{g==null||g.resume()}))},{immediate:k}),t.onScopeDispose(()=>{g==null||g.stop(),b==null||b.stop()})})},l=()=>{i.run(()=>{let g,b,k=!!o.edges.value.length;g=ti([e.edges,()=>{var _,h;return(h=(_=e.edges)==null?void 0:_.value)==null?void 0:h.length}],([_])=>{_&&Array.isArray(_)&&(b==null||b.pause(),o.setEdges(_),!b&&!k&&_.length?k=!0:b==null||b.resume())}),b=ti([o.edges,()=>o.edges.value.length],([_])=>{var h;(h=e.edges)!=null&&h.value&&Array.isArray(e.edges.value)&&(g==null||g.pause(),e.edges.value=[..._],t.nextTick(()=>{g==null||g.resume()}))},{immediate:k}),t.onScopeDispose(()=>{g==null||g.stop(),b==null||b.stop()})})},s=()=>{i.run(()=>{t.watch(()=>n.maxZoom,()=>{n.maxZoom&&Et(n.maxZoom)&&o.setMaxZoom(n.maxZoom)},{immediate:!0})})},c=()=>{i.run(()=>{t.watch(()=>n.minZoom,()=>{n.minZoom&&Et(n.minZoom)&&o.setMinZoom(n.minZoom)},{immediate:!0})})},d=()=>{i.run(()=>{t.watch(()=>n.translateExtent,()=>{n.translateExtent&&Et(n.translateExtent)&&o.setTranslateExtent(n.translateExtent)},{immediate:!0})})},u=()=>{i.run(()=>{t.watch(()=>n.nodeExtent,()=>{n.nodeExtent&&Et(n.nodeExtent)&&o.setNodeExtent(n.nodeExtent)},{immediate:!0})})},m=()=>{i.run(()=>{t.watch(()=>n.applyDefault,()=>{Et(n.applyDefault)&&(o.applyDefault.value=n.applyDefault)},{immediate:!0})})},f=()=>{i.run(()=>{const g=async b=>{let k=b;typeof n.autoConnect=="function"&&(k=await n.autoConnect(b)),k!==!1&&o.addEdges([k])};t.watch(()=>n.autoConnect,()=>{Et(n.autoConnect)&&(o.autoConnect.value=n.autoConnect)},{immediate:!0}),t.watch(o.autoConnect,(b,k,_)=>{b?o.onConnect(g):o.hooks.value.connect.off(g),_(()=>{o.hooks.value.connect.off(g)})},{immediate:!0})})},p=()=>{const g=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const b of Object.keys(n)){const k=b;if(!g.includes(k)){const _=t.toRef(()=>n[k]),h=o[k];t.isRef(h)&&i.run(()=>{t.watch(_,C=>{Et(C)&&(h.value=C)},{immediate:!0})})}}};(()=>{a(),r(),l(),c(),s(),d(),u(),m(),f(),p()})()}),()=>i.stop()}function vI(){return{edgesChange:Te(),nodesChange:Te(),nodeDoubleClick:Te(),nodeClick:Te(),nodeMouseEnter:Te(),nodeMouseMove:Te(),nodeMouseLeave:Te(),nodeContextMenu:Te(),nodeDragStart:Te(),nodeDrag:Te(),nodeDragStop:Te(),nodesInitialized:Te(),miniMapNodeClick:Te(),miniMapNodeDoubleClick:Te(),miniMapNodeMouseEnter:Te(),miniMapNodeMouseMove:Te(),miniMapNodeMouseLeave:Te(),connect:Te(),connectStart:Te(),connectEnd:Te(),clickConnectStart:Te(),clickConnectEnd:Te(),paneReady:Te(),init:Te(),move:Te(),moveStart:Te(),moveEnd:Te(),selectionDragStart:Te(),selectionDrag:Te(),selectionDragStop:Te(),selectionContextMenu:Te(),selectionStart:Te(),selectionEnd:Te(),viewportChangeStart:Te(),viewportChange:Te(),viewportChangeEnd:Te(),paneScroll:Te(),paneClick:Te(),paneContextMenu:Te(),paneMouseEnter:Te(),paneMouseMove:Te(),paneMouseLeave:Te(),edgeContextMenu:Te(),edgeMouseEnter:Te(),edgeMouseMove:Te(),edgeMouseLeave:Te(),edgeDoubleClick:Te(),edgeClick:Te(),edgeUpdateStart:Te(),edgeUpdate:Te(),edgeUpdateEnd:Te(),updateNodeInternals:Te(),error:Te(e=>ta(e.message))}}function CI(e,n){const o=t.getCurrentInstance();t.onBeforeMount(()=>{for(const[a,r]of Object.entries(n.value)){const l=s=>{e(a,s)};r.setEmitter(l),Bi(r.removeEmitter),r.setHasEmitListeners(()=>i(a)),Bi(r.removeHasEmitListeners)}});function i(a){var r;const l=SI(a);return!!((r=o==null?void 0:o.vnode.props)==null?void 0:r[l])}}function SI(e){const[n,...o]=e.split(":");return`on${n.replace(/(?:^|-)(\w)/g,(a,r)=>r.toUpperCase())}${o.length?`:${o.join(":")}`:""}`}function Zp(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Bs.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:qi.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:xo.Bezier,style:{}},connectionMode:Pn.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:ea()?"Meta":"Control",zoomActivationKeyCode:ea()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:vI(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const RI=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function AI(e,n,o){const i=wI(e),a=V=>{const L=V??[];e.hooks.updateNodeInternals.trigger(L)},r=V=>jw(V,e.nodes,e.edges),l=V=>Hw(V,e.nodes,e.edges),s=V=>Mo(V,e.edges),c=({id:V,type:L,nodeId:K})=>{var Z;const Q=V?`-${L}-${V}`:`-${L}`;return Array.from(((Z=e.connectionLookup.get(`${K}${Q}`))==null?void 0:Z.values())??[])},d=V=>{if(V)return n.value.get(V)},u=V=>{if(V)return o.value.get(V)},m=(V,L,K)=>{var Z,Q;const fe=[];for(const be of V){const Ee={id:be.id,type:"position",dragging:K,from:be.from};if(L&&(Ee.position=be.position,be.parentNode)){const Ne=d(be.parentNode);Ee.position={x:Ee.position.x-(((Z=Ne==null?void 0:Ne.computedPosition)==null?void 0:Z.x)??0),y:Ee.position.y-(((Q=Ne==null?void 0:Ne.computedPosition)==null?void 0:Q.y)??0)}}fe.push(Ee)}fe!=null&&fe.length&&e.hooks.nodesChange.trigger(fe)},f=V=>{if(!e.vueFlowRef)return;const L=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!L)return;const K=window.getComputedStyle(L),{m22:Z}=new window.DOMMatrixReadOnly(K.transform),Q=[];for(const fe of V){const be=fe,Ee=d(be.id);if(Ee){const Ne=Nr(be.nodeElement);if(!!(Ne.width&&Ne.height&&(Ee.dimensions.width!==Ne.width||Ee.dimensions.height!==Ne.height||be.forceUpdate))){const ee=be.nodeElement.getBoundingClientRect();Ee.dimensions=Ne,Ee.handleBounds.source=Fp("source",be.nodeElement,ee,Z,Ee.id),Ee.handleBounds.target=Fp("target",be.nodeElement,ee,Z,Ee.id),Q.push({id:Ee.id,type:"dimensions",dimensions:Ne})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&i.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),Q.length&&e.hooks.nodesChange.trigger(Q)},p=(V,L)=>{const K=new Set,Z=new Set;for(const be of V)To(be)?K.add(be.id):Qn(be)&&Z.add(be.id);const Q=to(n.value,K,!0),fe=to(o.value,Z);if(e.multiSelectionActive){for(const be of K)Q.push(eo(be,L));for(const be of Z)fe.push(eo(be,L))}Q.length&&e.hooks.nodesChange.trigger(Q),fe.length&&e.hooks.edgesChange.trigger(fe)},y=V=>{if(e.multiSelectionActive){const L=V.map(K=>eo(K.id,!0));e.hooks.nodesChange.trigger(L);return}e.hooks.nodesChange.trigger(to(n.value,new Set(V.map(L=>L.id)),!0)),e.hooks.edgesChange.trigger(to(o.value))},g=V=>{if(e.multiSelectionActive){const L=V.map(K=>eo(K.id,!0));e.hooks.edgesChange.trigger(L);return}e.hooks.edgesChange.trigger(to(o.value,new Set(V.map(L=>L.id)))),e.hooks.nodesChange.trigger(to(n.value,new Set,!0))},b=V=>{p(V,!0)},k=V=>{const K=(V||e.nodes).map(Z=>(Z.selected=!1,eo(Z.id,!1)));e.hooks.nodesChange.trigger(K)},_=V=>{const K=(V||e.edges).map(Z=>(Z.selected=!1,eo(Z.id,!1)));e.hooks.edgesChange.trigger(K)},h=V=>{if(!V||!V.length)return p([],!1);const L=V.reduce((K,Z)=>{const Q=eo(Z.id,!1);return To(Z)?K.nodes.push(Q):K.edges.push(Q),K},{nodes:[],edges:[]});L.nodes.length&&e.hooks.nodesChange.trigger(L.nodes),L.edges.length&&e.hooks.edgesChange.trigger(L.edges)},C=V=>{var L;(L=e.d3Zoom)==null||L.scaleExtent([V,e.maxZoom]),e.minZoom=V},v=V=>{var L;(L=e.d3Zoom)==null||L.scaleExtent([e.minZoom,V]),e.maxZoom=V},S=V=>{var L;(L=e.d3Zoom)==null||L.translateExtent(V),e.translateExtent=V},N=V=>{e.nodeExtent=V,a()},A=V=>{var L;(L=e.d3Zoom)==null||L.clickDistance(V)},T=V=>{e.nodesDraggable=V,e.nodesConnectable=V,e.elementsSelectable=V},O=V=>{const L=V instanceof Function?V(e.nodes):V;!e.initialized&&!L.length||(e.nodes=Up(L,d,e.hooks.error.trigger))},z=V=>{const L=V instanceof Function?V(e.edges):V;if(!e.initialized&&!L.length)return;const K=Ws(L,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);qs(e.connectionLookup,o.value,K),e.edges=K},P=V=>{const L=V instanceof Function?V([...e.nodes,...e.edges]):V;!e.initialized&&!L.length||(O(L.filter(To)),z(L.filter(Qn)))},D=V=>{let L=V instanceof Function?V(e.nodes):V;L=Array.isArray(L)?L:[L];const K=Up(L,d,e.hooks.error.trigger),Z=[];for(const Q of K)Z.push(Ap(Q));Z.length&&e.hooks.nodesChange.trigger(Z)},E=V=>{let L=V instanceof Function?V(e.edges):V;L=Array.isArray(L)?L:[L];const K=Ws(L,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),Z=[];for(const Q of K)Z.push(Ap(Q));Z.length&&e.hooks.edgesChange.trigger(Z)},R=(V,L=!0,K=!1)=>{const Z=V instanceof Function?V(e.nodes):V,Q=Array.isArray(Z)?Z:[Z],fe=[],be=[];function Ee(J){const ee=s(J);for(const te of ee)(!Et(te.deletable)||te.deletable)&&be.push($p(te.id,te.source,te.target,te.sourceHandle,te.targetHandle))}function Ne(J){const ee=[];for(const te of e.nodes)te.parentNode===J&&ee.push(te);if(ee.length){for(const te of ee)fe.push(xp(te.id));L&&Ee(ee);for(const te of ee)Ne(te.id)}}for(const J of Q){const ee=typeof J=="string"?d(J):J;ee&&(Et(ee.deletable)&&!ee.deletable||(fe.push(xp(ee.id)),L&&Ee([ee]),K&&Ne(ee.id)))}be.length&&e.hooks.edgesChange.trigger(be),fe.length&&e.hooks.nodesChange.trigger(fe)},I=V=>{const L=V instanceof Function?V(e.edges):V,K=Array.isArray(L)?L:[L],Z=[];for(const Q of K){const fe=typeof Q=="string"?u(Q):Q;fe&&(Et(fe.deletable)&&!fe.deletable||Z.push($p(typeof Q=="string"?Q:Q.id,fe.source,fe.target,fe.sourceHandle,fe.targetHandle)))}e.hooks.edgesChange.trigger(Z)},x=(V,L,K=!0)=>{const Z=u(V.id);if(!Z)return!1;const Q=e.edges.indexOf(Z),fe=mI(V,L,Z,K,e.hooks.error.trigger);if(fe){const[be]=Ws([fe],e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((Ee,Ne)=>Ne===Q?be:Ee),qs(e.connectionLookup,o.value,[be]),be}return!1},$=(V,L,K={replace:!1})=>{const Z=u(V);if(!Z)return;const Q=typeof L=="function"?L(Z):L;Z.data=K.replace?Q:{...Z.data,...Q}},U=V=>Rp(V,e.nodes),F=V=>{const L=Rp(V,e.edges);return qs(e.connectionLookup,o.value,L),L},B=(V,L,K={replace:!1})=>{const Z=d(V);if(!Z)return;const Q=typeof L=="function"?L(Z):L;K.replace?e.nodes.splice(e.nodes.indexOf(Z),1,Q):Object.assign(Z,Q)},j=(V,L,K={replace:!1})=>{const Z=d(V);if(!Z)return;const Q=typeof L=="function"?L(Z):L;Z.data=K.replace?Q:{...Z.data,...Q}},X=(V,L,K=!1)=>{K?e.connectionClickStartHandle=V:e.connectionStartHandle=V,e.connectionEndHandle=null,e.connectionStatus=null,L&&(e.connectionPosition=L)},W=(V,L=null,K=null)=>{e.connectionStartHandle&&(e.connectionPosition=V,e.connectionEndHandle=L,e.connectionStatus=K)},oe=(V,L)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,L?e.connectionClickStartHandle=null:e.connectionStartHandle=null},de=V=>{const L=Fw(V),K=L?null:Ji(V)?V:d(V.id);return!L&&!K?[null,null,L]:[L?V:_r(K),K,L]},ie=(V,L=!0,K=e.nodes)=>{const[Z,Q,fe]=de(V);if(!Z)return[];const be=[];for(const Ee of K||e.nodes){if(!fe&&(Ee.id===Q.id||!Ee.computedPosition))continue;const Ne=_r(Ee),J=Er(Ne,Z);(L&&J>0||J>=Ne.width*Ne.height||J>=Number(Z.width)*Number(Z.height))&&be.push(Ee)}return be},Ie=(V,L,K=!0)=>{const[Z]=de(V);if(!Z)return!1;const Q=Er(Z,L);return K&&Q>0||Q>=Number(Z.width)*Number(Z.height)},Le=V=>{const{viewport:L,dimensions:K,d3Zoom:Z,d3Selection:Q,translateExtent:fe}=e;if(!Z||!Q||!V.x&&!V.y)return!1;const be=ri.translate(L.x+V.x,L.y+V.y).scale(L.zoom),Ee=[[0,0],[K.width,K.height]],Ne=Z.constrain()(be,Ee,fe),J=e.viewport.x!==Ne.x||e.viewport.y!==Ne.y||e.viewport.zoom!==Ne.k;return Z.transform(Q,Ne),J},Se=V=>{const L=V instanceof Function?V(e):V,K=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Et(L.defaultEdgeOptions)&&(e.defaultEdgeOptions=L.defaultEdgeOptions);const Z=L.modelValue||L.nodes||L.edges?[]:void 0;Z&&(L.modelValue&&Z.push(...L.modelValue),L.nodes&&Z.push(...L.nodes),L.edges&&Z.push(...L.edges),P(Z));const Q=()=>{Et(L.maxZoom)&&v(L.maxZoom),Et(L.minZoom)&&C(L.minZoom),Et(L.translateExtent)&&S(L.translateExtent)};for(const fe of Object.keys(L)){const be=fe,Ee=L[be];![...RI,...K].includes(be)&&Et(Ee)&&(e[be]=Ee)}hs(()=>e.d3Zoom).not.toBeNull().then(Q),e.initialized||(e.initialized=!0)};return{updateNodePositions:m,updateNodeDimensions:f,setElements:P,setNodes:O,setEdges:z,addNodes:D,addEdges:E,removeNodes:R,removeEdges:I,findNode:d,findEdge:u,updateEdge:x,updateEdgeData:$,updateNode:B,updateNodeData:j,applyEdgeChanges:F,applyNodeChanges:U,addSelectedElements:b,addSelectedNodes:y,addSelectedEdges:g,setMinZoom:C,setMaxZoom:v,setTranslateExtent:S,setNodeExtent:N,setPaneClickDistance:A,removeSelectedElements:h,removeSelectedNodes:k,removeSelectedEdges:_,startConnection:X,updateConnection:W,endConnection:oe,setInteractive:T,setState:Se,getIntersectingNodes:ie,getIncomers:r,getOutgoers:l,getConnectedEdges:s,getHandleConnections:c,isNodeIntersecting:Ie,panBy:Le,fitView:V=>i.value.fitView(V),zoomIn:V=>i.value.zoomIn(V),zoomOut:V=>i.value.zoomOut(V),zoomTo:(V,L)=>i.value.zoomTo(V,L),setViewport:(V,L)=>i.value.setViewport(V,L),setTransform:(V,L)=>i.value.setTransform(V,L),getViewport:()=>i.value.getViewport(),getTransform:()=>i.value.getTransform(),setCenter:(V,L,K)=>i.value.setCenter(V,L,K),fitBounds:(V,L)=>i.value.fitBounds(V,L),project:V=>i.value.project(V),screenToFlowCoordinate:V=>i.value.screenToFlowCoordinate(V),flowToScreenCoordinate:V=>i.value.flowToScreenCoordinate(V),toObject:()=>{const V=[],L=[];for(const K of e.nodes){const{computedPosition:Z,handleBounds:Q,selected:fe,dimensions:be,isParent:Ee,resizing:Ne,dragging:J,events:ee,...te}=K;V.push(te)}for(const K of e.edges){const{selected:Z,sourceNode:Q,targetNode:fe,events:be,...Ee}=K;L.push(Ee)}return JSON.parse(JSON.stringify({nodes:V,edges:L,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:V=>new Promise(L=>{const{nodes:K,edges:Z,position:Q,zoom:fe,viewport:be}=V;K&&O(K),Z&&z(Z);const[Ee,Ne]=be!=null&&be.x&&(be!=null&&be.y)?[be.x,be.y]:Q??[null,null];if(Ee&&Ne){const J=(be==null?void 0:be.zoom)||fe||e.viewport.zoom;return hs(()=>i.value.viewportInitialized).toBe(!0).then(()=>{i.value.setViewport({x:Ee,y:Ne,zoom:J}).then(()=>{L(!0)})})}else L(!0)}),updateNodeInternals:a,viewportHelper:i,$reset:()=>{const V=Zp();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const L=ri.translate(V.defaultViewport.x??0,V.defaultViewport.y??0).scale($o(V.defaultViewport.zoom??1,V.minZoom,V.maxZoom)),K=e.viewportRef.getBoundingClientRect(),Z=[[0,0],[K.width,K.height]],Q=e.d3Zoom.constrain()(L,Z,V.translateExtent);e.d3Zoom.transform(e.d3Selection,Q)}Se(V)},$destroy:()=>{}}}const xI=["data-id","data-handleid","data-nodeid","data-handlepos"],$I={name:"Handle",compatConfig:{MODE:3}},oo=t.defineComponent({...$I,props:{id:{default:null},type:{},position:{default:()=>Ve.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:n}){const o=t.createPropsRestProxy(e,["position","connectable","connectableStart","connectableEnd","id"]),i=t.toRef(()=>o.type??"source"),a=t.toRef(()=>o.isValidConnection??null),{id:r,connectionStartHandle:l,connectionClickStartHandle:s,connectionEndHandle:c,vueFlowRef:d,nodesConnectable:u,noDragClassName:m,noPanClassName:f}=ot(),{id:p,node:y,nodeEl:g,connectedEdges:b}=Jp(),k=t.ref(),_=t.toRef(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),h=t.toRef(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),C=t.toRef(()=>{var z,P,D,E,R,I;return((z=l.value)==null?void 0:z.nodeId)===p&&((P=l.value)==null?void 0:P.id)===e.id&&((D=l.value)==null?void 0:D.type)===i.value||((E=c.value)==null?void 0:E.nodeId)===p&&((R=c.value)==null?void 0:R.id)===e.id&&((I=c.value)==null?void 0:I.type)===i.value}),v=t.toRef(()=>{var z,P,D;return((z=s.value)==null?void 0:z.nodeId)===p&&((P=s.value)==null?void 0:P.id)===e.id&&((D=s.value)==null?void 0:D.type)===i.value}),{handlePointerDown:S,handleClick:N}=Wp({nodeId:p,handleId:e.id,isValidConnection:a,type:i}),A=t.computed(()=>typeof e.connectable=="string"&&e.connectable==="single"?!b.value.some(z=>{const P=z[`${i.value}Handle`];return z[i.value]!==p?!1:P?P===e.id:!0}):typeof e.connectable=="number"?b.value.filter(z=>{const P=z[`${i.value}Handle`];return z[i.value]!==p?!1:P?P===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(y,b.value):Et(e.connectable)?e.connectable:u.value);t.onMounted(()=>{var z;if(!y.dimensions.width||!y.dimensions.height)return;const P=(z=y.handleBounds[i.value])==null?void 0:z.find(U=>U.id===e.id);if(!d.value||P)return;const D=d.value.querySelector(".vue-flow__transformationpane");if(!g.value||!k.value||!D||!e.id)return;const E=g.value.getBoundingClientRect(),R=k.value.getBoundingClientRect(),I=window.getComputedStyle(D),{m22:x}=new window.DOMMatrixReadOnly(I.transform),$={id:e.id,position:e.position,x:(R.left-E.left)/x,y:(R.top-E.top)/x,type:i.value,nodeId:p,...Nr(k.value)};y.handleBounds[i.value]=[...y.handleBounds[i.value]??[],$]});function T(z){const P=js(z);A.value&&_.value&&(P&&z.button===0||!P)&&S(z)}function O(z){!p||!s.value&&!_.value||A.value&&N(z)}return n({handleClick:N,handlePointerDown:S,onClick:O,onPointerDown:T}),(z,P)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"handle",ref:k,"data-id":`${t.unref(r)}-${t.unref(p)}-${e.id}-${i.value}`,"data-handleid":e.id,"data-nodeid":t.unref(p),"data-handlepos":z.position,class:t.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${z.position}`,`vue-flow__handle-${e.id}`,t.unref(m),t.unref(f),i.value,{connectable:A.value,connecting:v.value,connectablestart:_.value,connectableend:h.value,connectionindicator:A.value&&(_.value&&!C.value||h.value&&C.value)}]]),onMousedown:T,onTouchstartPassive:T,onClick:O},[t.renderSlot(z.$slots,"default",{id:z.id})],42,xI))}}),Ar=function({sourcePosition:e=Ve.Bottom,targetPosition:n=Ve.Top,label:o,connectable:i=!0,isValidTargetPos:a,isValidSourcePos:r,data:l}){const s=l.label??o;return[t.h(oo,{type:"target",position:n,connectable:i,isValidConnection:a}),typeof s!="string"&&s?t.h(s):t.h(t.Fragment,[s]),t.h(oo,{type:"source",position:e,connectable:i,isValidConnection:r})]};Ar.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Ar.inheritAttrs=!1,Ar.compatConfig={MODE:3};const TI=Ar,xr=function({targetPosition:e=Ve.Top,label:n,connectable:o=!0,isValidTargetPos:i,data:a}){const r=a.label??n;return[t.h(oo,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof r!="string"&&r?t.h(r):t.h(t.Fragment,[r])]};xr.props=["targetPosition","label","isValidTargetPos","connectable","data"],xr.inheritAttrs=!1,xr.compatConfig={MODE:3};const MI=xr,$r=function({sourcePosition:e=Ve.Bottom,label:n,connectable:o=!0,isValidSourcePos:i,data:a}){const r=a.label??n;return[typeof r!="string"&&r?t.h(r):t.h(t.Fragment,[r]),t.h(oo,{type:"source",position:e,connectable:o,isValidConnection:i})]};$r.props=["sourcePosition","label","isValidSourcePos","connectable","data"],$r.inheritAttrs=!1,$r.compatConfig={MODE:3};const VI=$r,LI=["transform"],BI=["width","height","x","y","rx","ry"],DI=["y"],OI={name:"EdgeText",compatConfig:{MODE:3}},PI=t.defineComponent({...OI,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const n=t.ref({x:0,y:0,width:0,height:0}),o=t.ref(null),i=t.computed(()=>`translate(${e.x-n.value.width/2} ${e.y-n.value.height/2})`);t.onMounted(a),t.watch([()=>e.x,()=>e.y,o,()=>e.label],a);function a(){if(!o.value)return;const r=o.value.getBBox();(r.width!==n.value.width||r.height!==n.value.height)&&(n.value=r)}return(r,l)=>(t.openBlock(),t.createElementBlock("g",{transform:i.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(t.openBlock(),t.createElementBlock("rect",{key:0,class:"vue-flow__edge-textbg",width:`${n.value.width+2*r.labelBgPadding[0]}px`,height:`${n.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:t.normalizeStyle(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,BI)):t.createCommentVNode("",!0),t.createElementVNode("text",t.mergeProps(r.$attrs,{ref_key:"el",ref:o,class:"vue-flow__edge-text",y:n.value.height/2,dy:"0.3em",style:r.labelStyle}),[t.renderSlot(r.$slots,"default",{},()=>[typeof r.label!="string"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.label),{key:0})):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(r.label),1)],64))])],16,DI)],8,LI))}}),zI=["id","d","marker-end","marker-start"],FI=["d","stroke-width"],UI={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Tr=t.defineComponent({...UI,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:n}){const o=t.ref(null),i=t.ref(null),a=t.ref(null),r=t.useAttrs();return n({pathEl:o,interactionEl:i,labelEl:a}),(l,s)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("path",t.mergeProps(t.unref(r),{id:l.id,ref_key:"pathEl",ref:o,d:l.path,class:"vue-flow__edge-path","marker-end":l.markerEnd,"marker-start":l.markerStart}),null,16,zI),l.interactionWidth?(t.openBlock(),t.createElementBlock("path",{key:0,ref_key:"interactionEl",ref:i,fill:"none",d:l.path,"stroke-width":l.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,FI)):t.createCommentVNode("",!0),l.label&&l.labelX&&l.labelY?(t.openBlock(),t.createBlock(PI,{key:1,ref_key:"labelEl",ref:a,x:l.labelX,y:l.labelY,label:l.label,"label-show-bg":l.labelShowBg,"label-bg-style":l.labelBgStyle,"label-bg-padding":l.labelBgPadding,"label-bg-border-radius":l.labelBgBorderRadius,"label-style":l.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):t.createCommentVNode("",!0)],64))}});function Qp({sourceX:e,sourceY:n,targetX:o,targetY:i}){const a=Math.abs(o-e)/2,r=o<e?o+a:o-a,l=Math.abs(i-n)/2,s=i<n?i+l:i-l;return[r,s,a,l]}function eh({sourceX:e,sourceY:n,targetX:o,targetY:i,sourceControlX:a,sourceControlY:r,targetControlX:l,targetControlY:s}){const c=e*.125+a*.375+l*.375+o*.125,d=n*.125+r*.375+s*.375+i*.125,u=Math.abs(c-e),m=Math.abs(d-n);return[c,d,u,m]}function Mr(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function th({pos:e,x1:n,y1:o,x2:i,y2:a,c:r}){let l,s;switch(e){case Ve.Left:l=n-Mr(n-i,r),s=o;break;case Ve.Right:l=n+Mr(i-n,r),s=o;break;case Ve.Top:l=n,s=o-Mr(o-a,r);break;case Ve.Bottom:l=n,s=o+Mr(a-o,r);break}return[l,s]}function nh(e){const{sourceX:n,sourceY:o,sourcePosition:i=Ve.Bottom,targetX:a,targetY:r,targetPosition:l=Ve.Top,curvature:s=.25}=e,[c,d]=th({pos:i,x1:n,y1:o,x2:a,y2:r,c:s}),[u,m]=th({pos:l,x1:a,y1:r,x2:n,y2:o,c:s}),[f,p,y,g]=eh({sourceX:n,sourceY:o,targetX:a,targetY:r,sourceControlX:c,sourceControlY:d,targetControlX:u,targetControlY:m});return[`M${n},${o} C${c},${d} ${u},${m} ${a},${r}`,f,p,y,g]}function oh({pos:e,x1:n,y1:o,x2:i,y2:a}){let r,l;switch(e){case Ve.Left:case Ve.Right:r=.5*(n+i),l=o;break;case Ve.Top:case Ve.Bottom:r=n,l=.5*(o+a);break}return[r,l]}function ih(e){const{sourceX:n,sourceY:o,sourcePosition:i=Ve.Bottom,targetX:a,targetY:r,targetPosition:l=Ve.Top}=e,[s,c]=oh({pos:i,x1:n,y1:o,x2:a,y2:r}),[d,u]=oh({pos:l,x1:a,y1:r,x2:n,y2:o}),[m,f,p,y]=eh({sourceX:n,sourceY:o,targetX:a,targetY:r,sourceControlX:s,sourceControlY:c,targetControlX:d,targetControlY:u});return[`M${n},${o} C${s},${c} ${d},${u} ${a},${r}`,m,f,p,y]}const ah={[Ve.Left]:{x:-1,y:0},[Ve.Right]:{x:1,y:0},[Ve.Top]:{x:0,y:-1},[Ve.Bottom]:{x:0,y:1}};function HI({source:e,sourcePosition:n=Ve.Bottom,target:o}){return n===Ve.Left||n===Ve.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1}}function rh(e,n){return Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2)}function jI({source:e,sourcePosition:n=Ve.Bottom,target:o,targetPosition:i=Ve.Top,center:a,offset:r}){const l=ah[n],s=ah[i],c={x:e.x+l.x*r,y:e.y+l.y*r},d={x:o.x+s.x*r,y:o.y+s.y*r},u=HI({source:c,sourcePosition:n,target:d}),m=u.x!==0?"x":"y",f=u[m];let p,y,g;const b={x:0,y:0},k={x:0,y:0},[_,h,C,v]=Qp({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(l[m]*s[m]===-1){y=a.x??_,g=a.y??h;const N=[{x:y,y:c.y},{x:y,y:d.y}],A=[{x:c.x,y:g},{x:d.x,y:g}];l[m]===f?p=m==="x"?N:A:p=m==="x"?A:N}else{const N=[{x:c.x,y:d.y}],A=[{x:d.x,y:c.y}];if(m==="x"?p=l.x===f?A:N:p=l.y===f?N:A,n===i){const D=Math.abs(e[m]-o[m]);if(D<=r){const E=Math.min(r-1,r-D);l[m]===f?b[m]=(c[m]>e[m]?-1:1)*E:k[m]=(d[m]>o[m]?-1:1)*E}}if(n!==i){const D=m==="x"?"y":"x",E=l[m]===s[D],R=c[D]>d[D],I=c[D]<d[D];(l[m]===1&&(!E&&R||E&&I)||l[m]!==1&&(!E&&I||E&&R))&&(p=m==="x"?N:A)}const T={x:c.x+b.x,y:c.y+b.y},O={x:d.x+k.x,y:d.y+k.y},z=Math.max(Math.abs(T.x-p[0].x),Math.abs(O.x-p[0].x)),P=Math.max(Math.abs(T.y-p[0].y),Math.abs(O.y-p[0].y));z>=P?(y=(T.x+O.x)/2,g=p[0].y):(y=p[0].x,g=(T.y+O.y)/2)}return[[e,{x:c.x+b.x,y:c.y+b.y},...p,{x:d.x+k.x,y:d.y+k.y},o],y,g,C,v]}function KI(e,n,o,i){const a=Math.min(rh(e,n)/2,rh(n,o)/2,i),{x:r,y:l}=n;if(e.x===r&&r===o.x||e.y===l&&l===o.y)return`L${r} ${l}`;if(e.y===l){const d=e.x<o.x?-1:1,u=e.y<o.y?1:-1;return`L ${r+a*d},${l}Q ${r},${l} ${r},${l+a*u}`}const s=e.x<o.x?1:-1,c=e.y<o.y?-1:1;return`L ${r},${l+a*c}Q ${r},${l} ${r+a*s},${l}`}function Xs(e){const{sourceX:n,sourceY:o,sourcePosition:i=Ve.Bottom,targetX:a,targetY:r,targetPosition:l=Ve.Top,borderRadius:s=5,centerX:c,centerY:d,offset:u=20}=e,[m,f,p,y,g]=jI({source:{x:n,y:o},sourcePosition:i,target:{x:a,y:r},targetPosition:l,center:{x:c,y:d},offset:u});return[m.reduce((k,_,h)=>{let C;return h>0&&h<m.length-1?C=KI(m[h-1],_,m[h+1],s):C=`${h===0?"M":"L"}${_.x} ${_.y}`,k+=C,k},""),f,p,y,g]}function GI(e){const{sourceX:n,sourceY:o,targetX:i,targetY:a}=e,[r,l,s,c]=Qp({sourceX:n,sourceY:o,targetX:i,targetY:a});return[`M ${n},${o}L ${i},${a}`,r,l,s,c]}const YI=t.defineComponent({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:n}){return()=>{const[o,i,a]=GI(e);return t.h(Tr,{path:o,labelX:i,labelY:a,...n,...e})}}}),lh=t.defineComponent({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:n}){return()=>{const[o,i,a]=Xs({...e,sourcePosition:e.sourcePosition??Ve.Bottom,targetPosition:e.targetPosition??Ve.Top});return t.h(Tr,{path:o,labelX:i,labelY:a,...n,...e})}}}),qI=t.defineComponent({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:n}){return()=>t.h(lh,{...e,...n,borderRadius:0})}}),WI=t.defineComponent({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:n}){return()=>{const[o,i,a]=nh({...e,sourcePosition:e.sourcePosition??Ve.Bottom,targetPosition:e.targetPosition??Ve.Top});return t.h(Tr,{path:o,labelX:i,labelY:a,...n,...e})}}}),JI=t.defineComponent({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:n}){return()=>{const[o,i,a]=ih({...e,sourcePosition:e.sourcePosition??Ve.Bottom,targetPosition:e.targetPosition??Ve.Top});return t.h(Tr,{path:o,labelX:i,labelY:a,...n,...e})}}}),XI={input:VI,default:TI,output:MI},ZI={default:WI,straight:YI,step:qI,smoothstep:lh,simplebezier:JI};function QI(e,n,o){const i=t.computed(()=>g=>n.value.get(g)),a=t.computed(()=>g=>o.value.get(g)),r=t.computed(()=>{const g={...ZI,...e.edgeTypes},b=Object.keys(g);for(const k of e.edges)k.type&&!b.includes(k.type)&&(g[k.type]=k.type);return g}),l=t.computed(()=>{const g={...XI,...e.nodeTypes},b=Object.keys(g);for(const k of e.nodes)k.type&&!b.includes(k.type)&&(g[k.type]=k.type);return g}),s=t.computed(()=>e.onlyRenderVisibleElements?wp(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),c=t.computed(()=>{if(e.onlyRenderVisibleElements){const g=[];for(const b of e.edges){const k=n.value.get(b.source),_=n.value.get(b.target);eI({sourcePos:k.computedPosition||{x:0,y:0},targetPos:_.computedPosition||{x:0,y:0},sourceWidth:k.dimensions.width,sourceHeight:k.dimensions.height,targetWidth:_.dimensions.width,targetHeight:_.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&g.push(b)}return g}return e.edges}),d=t.computed(()=>[...s.value,...c.value]),u=t.computed(()=>{const g=[];for(const b of e.nodes)b.selected&&g.push(b);return g}),m=t.computed(()=>{const g=[];for(const b of e.edges)b.selected&&g.push(b);return g}),f=t.computed(()=>[...u.value,...m.value]),p=t.computed(()=>{const g=[];for(const b of e.nodes)b.dimensions.width&&b.dimensions.height&&b.handleBounds!==void 0&&g.push(b);return g}),y=t.computed(()=>s.value.length>0&&p.value.length===s.value.length);return{getNode:i,getEdge:a,getElements:d,getEdgeTypes:r,getNodeTypes:l,getEdges:c,getNodes:s,getSelectedElements:f,getSelectedNodes:u,getSelectedEdges:m,getNodesInitialized:p,areNodesInitialized:y}}class Vo{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var n;const o=(n=t.getCurrentInstance())==null?void 0:n.appContext.app,i=(o==null?void 0:o.config.globalProperties.$vueFlowStorage)??Vo.instance;return Vo.instance=i??new Vo,o&&(o.config.globalProperties.$vueFlowStorage=Vo.instance),Vo.instance}set(n,o){return this.flows.set(n,o)}get(n){return this.flows.get(n)}remove(n){return this.flows.delete(n)}create(n,o){const i=Zp(),a=t.reactive(i),r={};for(const[f,p]of Object.entries(a.hooks)){const y=`on${f.charAt(0).toUpperCase()+f.slice(1)}`;r[y]=p.on}const l={};for(const[f,p]of Object.entries(a.hooks))l[f]=p.trigger;const s=t.computed(()=>{const f=new Map;for(const p of a.nodes)f.set(p.id,p);return f}),c=t.computed(()=>{const f=new Map;for(const p of a.edges)f.set(p.id,p);return f}),d=QI(a,s,c),u=AI(a,s,c);u.setState({...a,...o});const m={...r,...d,...u,...JE(a),nodeLookup:s,edgeLookup:c,emits:l,id:n,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(n)}};return this.set(n,m),m}getId(){return`vue-flow-${this.currentId++}`}}function ot(e){const n=Vo.getInstance(),o=t.getCurrentScope(),i=typeof e=="object",a=i?e:{id:e},r=a.id,l=r??(o==null?void 0:o.vueFlowId);let s;if(o){const c=t.inject(Kp,null);typeof c<"u"&&c!==null&&(!l||c.id===l)&&(s=c)}if(s||l&&(s=n.get(l)),!s||l&&s.id!==l){const c=r??n.getId(),d=n.create(c,a);s=d,(o??t.effectScope(!0)).run(()=>{t.watch(d.applyDefault,(m,f,p)=>{const y=b=>{d.applyNodeChanges(b)},g=b=>{d.applyEdgeChanges(b)};m?(d.onNodesChange(y),d.onEdgesChange(g)):(d.hooks.value.nodesChange.off(y),d.hooks.value.edgesChange.off(g)),p(()=>{d.hooks.value.nodesChange.off(y),d.hooks.value.edgesChange.off(g)})},{immediate:!0}),Bi(()=>{if(s){const m=n.get(s.id);m?m.$destroy():ta(`No store instance found for id ${s.id} in storage.`)}})})}else i&&s.setState(a);if(o&&(t.provide(Kp,s),o.vueFlowId=s.id),i){const c=t.getCurrentInstance();(c==null?void 0:c.type.name)!=="VueFlow"&&s.emits.error(new vt(_t.USEVUEFLOW_OPTIONS))}return s}function ev(e){const{emits:n,dimensions:o}=ot();let i;t.onMounted(()=>{const a=()=>{var r,l;if(!e.value||!(((l=(r=e.value).checkVisibility)==null?void 0:l.call(r))??!0))return;const s=Nr(e.value);(s.width===0||s.height===0)&&n.error(new vt(_t.MISSING_VIEWPORT_DIMENSIONS)),o.value={width:s.width||500,height:s.height||500}};a(),window.addEventListener("resize",a),e.value&&(i=new ResizeObserver(()=>a()),i.observe(e.value)),t.onBeforeUnmount(()=>{window.removeEventListener("resize",a),i&&e.value&&i.unobserve(e.value)})})}const tv={name:"UserSelection",compatConfig:{MODE:3}},nv=t.defineComponent({...tv,props:{userSelectionRect:{}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",{class:"vue-flow__selection vue-flow__container",style:t.normalizeStyle({width:`${n.userSelectionRect.width}px`,height:`${n.userSelectionRect.height}px`,transform:`translate(${n.userSelectionRect.x}px, ${n.userSelectionRect.y}px)`})},null,4))}}),ov=["tabIndex"],iv={name:"NodesSelection",compatConfig:{MODE:3}},av=t.defineComponent({...iv,setup(e){const{emits:n,viewport:o,getSelectedNodes:i,noPanClassName:a,disableKeyboardA11y:r,userSelectionActive:l}=ot(),s=Xp(),c=t.ref(null),d=qp({el:c,onStart(y){n.selectionDragStart(y),n.nodeDragStart(y)},onDrag(y){n.selectionDrag(y),n.nodeDrag(y)},onStop(y){n.selectionDragStop(y),n.nodeDragStop(y)}});t.onMounted(()=>{var y;r.value||(y=c.value)==null||y.focus({preventScroll:!0})});const u=t.computed(()=>Ps(i.value)),m=t.computed(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function f(y){n.selectionContextMenu({event:y,nodes:i.value})}function p(y){r.value||li[y.key]&&(y.preventDefault(),s({x:li[y.key].x,y:li[y.key].y},y.shiftKey))}return(y,g)=>!t.unref(l)&&u.value.width&&u.value.height?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["vue-flow__nodesselection vue-flow__container",t.unref(a)]),style:t.normalizeStyle({transform:`translate(${t.unref(o).x}px,${t.unref(o).y}px) scale(${t.unref(o).zoom})`})},[t.createElementVNode("div",{ref_key:"el",ref:c,class:t.normalizeClass([{dragging:t.unref(d)},"vue-flow__nodesselection-rect"]),style:t.normalizeStyle(m.value),tabIndex:t.unref(r)?void 0:-1,onContextmenu:f,onKeydown:p},null,46,ov)],6)):t.createCommentVNode("",!0)}});function rv(e,n){return{x:e.clientX-n.left,y:e.clientY-n.top}}const lv={name:"Pane",compatConfig:{MODE:3}},sv=t.defineComponent({...lv,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:n,nodes:o,viewport:i,emits:a,userSelectionActive:r,removeSelectedElements:l,userSelectionRect:s,elementsSelectable:c,nodesSelectionActive:d,getSelectedEdges:u,getSelectedNodes:m,removeNodes:f,removeEdges:p,selectionMode:y,deleteKeyCode:g,multiSelectionKeyCode:b,multiSelectionActive:k,edgeLookup:_,nodeLookup:h,connectionLookup:C,defaultEdgeOptions:v,connectionStartHandle:S,panOnDrag:N}=ot(),A=t.shallowRef(null),T=t.shallowRef(new Set),O=t.shallowRef(new Set),z=t.shallowRef(null),P=t.toRef(()=>c.value&&(e.isSelecting||r.value)),D=t.toRef(()=>S.value!==null);let E=!1,R=!1;const I=Wi(g,{actInsideInputWithModifier:!1}),x=Wi(b);t.watch(I,oe=>{oe&&(f(m.value),p(u.value),d.value=!1)}),t.watch(x,oe=>{k.value=oe});function $(oe,de){return ie=>{ie.target===de&&(oe==null||oe(ie))}}function U(oe){if(E||D.value){E=!1;return}a.paneClick(oe),l(),d.value=!1}function F(oe){var de;if(Array.isArray(N.value)&&((de=N.value)!=null&&de.includes(2))){oe.preventDefault();return}a.paneContextMenu(oe)}function B(oe){a.paneScroll(oe)}function j(oe){var de,ie,Ie;if(z.value=((de=n.value)==null?void 0:de.getBoundingClientRect())??null,!c.value||!e.isSelecting||oe.button!==0||oe.target!==A.value||!z.value)return;(Ie=(ie=oe.target)==null?void 0:ie.setPointerCapture)==null||Ie.call(ie,oe.pointerId);const{x:Le,y:Se}=rv(oe,z.value);R=!0,E=!1,l(),s.value={width:0,height:0,startX:Le,startY:Se,x:Le,y:Se},a.selectionStart(oe)}function X(oe){var de;if(!z.value||!s.value)return;E=!0;const{x:ie,y:Ie}=Nn(oe,z.value),{startX:Le=0,startY:Se=0}=s.value,ce={startX:Le,startY:Se,x:ie<Le?ie:Le,y:Ie<Se?Ie:Se,width:Math.abs(ie-Le),height:Math.abs(Ie-Se)},pe=T.value,he=O.value;T.value=new Set(wp(o.value,ce,i.value,y.value===Bs.Partial,!0).map(L=>L.id)),O.value=new Set;const V=((de=v.value)==null?void 0:de.selectable)??!0;for(const L of T.value){const K=C.value.get(L);if(K)for(const{edgeId:Z}of K.values()){const Q=_.value.get(Z);Q&&(Q.selectable??V)&&O.value.add(Z)}}if(!jp(pe,T.value)){const L=to(h.value,T.value,!0);a.nodesChange(L)}if(!jp(he,O.value)){const L=to(_.value,O.value);a.edgesChange(L)}s.value=ce,r.value=!0,d.value=!1}function W(oe){var de;oe.button!==0||!R||((de=oe.target)==null||de.releasePointerCapture(oe.pointerId),!r.value&&s.value&&oe.target===A.value&&U(oe),r.value=!1,s.value=null,d.value=T.value.size>0,a.selectionEnd(oe),e.selectionKeyPressed&&(E=!1),R=!1)}return(oe,de)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"container",ref:A,class:t.normalizeClass(["vue-flow__pane vue-flow__container",{selection:oe.isSelecting}]),onClick:de[0]||(de[0]=ie=>P.value?void 0:$(U,A.value)(ie)),onContextmenu:de[1]||(de[1]=ie=>$(F,A.value)(ie)),onWheelPassive:de[2]||(de[2]=ie=>$(B,A.value)(ie)),onPointerenter:de[3]||(de[3]=ie=>P.value?void 0:t.unref(a).paneMouseEnter(ie)),onPointerdown:de[4]||(de[4]=ie=>P.value?j(ie):t.unref(a).paneMouseMove(ie)),onPointermove:de[5]||(de[5]=ie=>P.value?X(ie):t.unref(a).paneMouseMove(ie)),onPointerup:de[6]||(de[6]=ie=>P.value?W(ie):void 0),onPointerleave:de[7]||(de[7]=ie=>t.unref(a).paneMouseLeave(ie))},[t.renderSlot(oe.$slots,"default"),t.unref(r)&&t.unref(s)?(t.openBlock(),t.createBlock(nv,{key:0,"user-selection-rect":t.unref(s)},null,8,["user-selection-rect"])):t.createCommentVNode("",!0),t.unref(d)&&t.unref(m).length?(t.openBlock(),t.createBlock(av,{key:1})):t.createCommentVNode("",!0)],34))}}),cv={name:"Transform",compatConfig:{MODE:3}},dv=t.defineComponent({...cv,setup(e){const{viewport:n,fitViewOnInit:o,fitViewOnInitDone:i}=ot(),a=t.computed(()=>o.value?!i.value:!1),r=t.computed(()=>`translate(${n.value.x}px,${n.value.y}px) scale(${n.value.zoom})`);return(l,s)=>(t.openBlock(),t.createElementBlock("div",{class:"vue-flow__transformationpane vue-flow__container",style:t.normalizeStyle({transform:r.value,opacity:a.value?0:void 0})},[t.renderSlot(l.$slots,"default")],4))}}),uv={name:"Viewport",compatConfig:{MODE:3}},mv=t.defineComponent({...uv,setup(e){const{minZoom:n,maxZoom:o,defaultViewport:i,translateExtent:a,zoomActivationKeyCode:r,selectionKeyCode:l,panActivationKeyCode:s,panOnScroll:c,panOnScrollMode:d,panOnScrollSpeed:u,panOnDrag:m,zoomOnDoubleClick:f,zoomOnPinch:p,zoomOnScroll:y,preventScrolling:g,noWheelClassName:b,noPanClassName:k,emits:_,connectionStartHandle:h,userSelectionActive:C,paneDragging:v,d3Zoom:S,d3Selection:N,d3ZoomHandler:A,viewport:T,viewportRef:O,paneClickDistance:z}=ot();ev(O);const P=t.shallowRef(!1),D=t.shallowRef(!1);let E=null,R=!1,I=0,x={x:0,y:0,zoom:0};const $=Wi(s),U=Wi(l),F=Wi(r),B=t.toRef(()=>(!U.value||U.value&&l.value===!0)&&($.value||m.value)),j=t.toRef(()=>$.value||c.value),X=t.toRef(()=>l.value===!0&&B.value!==!0),W=t.toRef(()=>U.value&&l.value!==!0||C.value||X.value),oe=t.toRef(()=>h.value!==null);t.onMounted(()=>{if(!O.value){ta("Viewport element is missing");return}const Se=O.value,ce=Se.getBoundingClientRect(),pe=Vw().clickDistance(z.value).scaleExtent([n.value,o.value]).translateExtent(a.value),he=rn(Se).call(pe),V=he.on("wheel.zoom"),L=ri.translate(i.value.x??0,i.value.y??0).scale($o(i.value.zoom??1,n.value,o.value)),K=[[0,0],[ce.width,ce.height]],Z=pe.constrain()(L,K,a.value);pe.transform(he,Z),pe.wheelDelta(zs),S.value=pe,N.value=he,A.value=V,T.value={x:Z.x,y:Z.y,zoom:Z.k},pe.on("start",Q=>{var fe;if(!Q.sourceEvent)return null;I=Q.sourceEvent.button,P.value=!0;const be=Ie(Q.transform);((fe=Q.sourceEvent)==null?void 0:fe.type)==="mousedown"&&(v.value=!0),x=be,_.viewportChangeStart(be),_.moveStart({event:Q,flowTransform:be})}),pe.on("end",Q=>{if(!Q.sourceEvent)return null;if(P.value=!1,v.value=!1,de(B.value,I??0)&&!R&&_.paneContextMenu(Q.sourceEvent),R=!1,ie(x,Q.transform)){const fe=Ie(Q.transform);x=fe,_.viewportChangeEnd(fe),_.moveEnd({event:Q,flowTransform:fe})}}),pe.filter(Q=>{var fe;const be=F.value||y.value,Ee=p.value&&Q.ctrlKey,Ne=Q.button,J=Q.type==="wheel";if(Ne===1&&Q.type==="mousedown"&&(Le(Q,"vue-flow__node")||Le(Q,"vue-flow__edge")))return!0;if(!B.value&&!be&&!j.value&&!f.value&&!p.value||C.value||oe.value&&!J||!f.value&&Q.type==="dblclick"||Le(Q,b.value)&&J||Le(Q,k.value)&&(!J||j.value&&J&&!F.value)||!p.value&&Q.ctrlKey&&J||!be&&!j.value&&!Ee&&J)return!1;if(!p&&Q.type==="touchstart"&&((fe=Q.touches)==null?void 0:fe.length)>1)return Q.preventDefault(),!1;if(!B.value&&(Q.type==="mousedown"||Q.type==="touchstart")||X.value&&Array.isArray(m.value)&&m.value.includes(0)&&Ne===0||Array.isArray(m.value)&&!m.value.includes(Ne)&&(Q.type==="mousedown"||Q.type==="touchstart"))return!1;const ee=Array.isArray(m.value)&&m.value.includes(Ne)||l.value===!0&&Array.isArray(m.value)&&!m.value.includes(0)||!Ne||Ne<=1;return(!Q.ctrlKey||$.value||J)&&ee}),t.watch([C,B],()=>{C.value&&!P.value?pe.on("zoom",null):C.value||pe.on("zoom",Q=>{T.value={x:Q.transform.x,y:Q.transform.y,zoom:Q.transform.k};const fe=Ie(Q.transform);R=de(B.value,I??0),_.viewportChange(fe),_.move({event:Q,flowTransform:fe})})},{immediate:!0}),t.watch([C,j,d,F,p,g,b],()=>{j.value&&!F.value&&!C.value?he.on("wheel.zoom",Q=>{if(Le(Q,b.value))return!1;const fe=F.value||y.value,be=p.value&&Q.ctrlKey;if(!(!g.value||j.value||fe||be))return!1;Q.preventDefault(),Q.stopImmediatePropagation();const Ne=he.property("__zoom").k||1,J=ea();if(!$.value&&Q.ctrlKey&&p.value&&J){const Pe=bn(Q),Me=zs(Q),Qe=Ne*2**Me;pe.scaleTo(he,Qe,Pe,Q);return}const ee=Q.deltaMode===1?20:1;let te=d.value===qi.Vertical?0:Q.deltaX*ee,ge=d.value===qi.Horizontal?0:Q.deltaY*ee;!J&&Q.shiftKey&&d.value!==qi.Vertical&&!te&&ge&&(te=ge,ge=0),pe.translateBy(he,-(te/Ne)*u.value,-(ge/Ne)*u.value);const Re=Ie(he.property("__zoom"));E&&clearTimeout(E),D.value?(_.move({event:Q,flowTransform:Re}),_.viewportChange(Re),E=setTimeout(()=>{_.moveEnd({event:Q,flowTransform:Re}),_.viewportChangeEnd(Re),D.value=!1},150)):(D.value=!0,_.moveStart({event:Q,flowTransform:Re}),_.viewportChangeStart(Re))},{passive:!1}):typeof V<"u"&&he.on("wheel.zoom",function(Q,fe){const be=!g.value&&Q.type==="wheel"&&!Q.ctrlKey,Ee=F.value||y.value,Ne=p.value&&Q.ctrlKey;if(!Ee&&!c.value&&!Ne&&Q.type==="wheel"||be||Le(Q,b.value))return null;Q.preventDefault(),V.call(this,Q,fe)},{passive:!1})},{immediate:!0})});function de(Se,ce){return ce===2&&Array.isArray(Se)&&Se.includes(2)}function ie(Se,ce){return Se.x!==ce.x&&!Number.isNaN(ce.x)||Se.y!==ce.y&&!Number.isNaN(ce.y)||Se.zoom!==ce.k&&!Number.isNaN(ce.k)}function Ie(Se){return{x:Se.x,y:Se.y,zoom:Se.k}}function Le(Se,ce){return Se.target.closest(`.${ce}`)}return(Se,ce)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"viewportRef",ref:O,class:"vue-flow__viewport vue-flow__container"},[t.createVNode(sv,{"is-selecting":W.value,"selection-key-pressed":t.unref(U),class:t.normalizeClass({connecting:oe.value,dragging:t.unref(v),draggable:t.unref(m)===!0||Array.isArray(t.unref(m))&&t.unref(m).includes(0)})},{default:t.withCtx(()=>[t.createVNode(dv,null,{default:t.withCtx(()=>[t.renderSlot(Se.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),fv=["id"],pv=["id"],hv=["id"],yv={name:"A11yDescriptions",compatConfig:{MODE:3}},gv=t.defineComponent({...yv,setup(e){const{id:n,disableKeyboardA11y:o,ariaLiveMessage:i}=ot();return(a,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{id:`${t.unref(fp)}-${t.unref(n)}`,style:{display:"none"}}," Press enter or space to select a node. "+t.toDisplayString(t.unref(o)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,fv),t.createElementVNode("div",{id:`${t.unref(pp)}-${t.unref(n)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,pv),t.unref(o)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,id:`${t.unref(zw)}-${t.unref(n)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},t.toDisplayString(t.unref(i)),9,hv))],64))}});function bv(){const e=ot();t.watch(()=>e.viewportHelper.value.viewportInitialized,n=>{n&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function kv(e,n,o){return o===Ve.Left?e-n:o===Ve.Right?e+n:e}function _v(e,n,o){return o===Ve.Top?e-n:o===Ve.Bottom?e+n:e}const Zs=function({radius:e=10,centerX:n=0,centerY:o=0,position:i=Ve.Top,type:a}){return t.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${a}`,cx:kv(n,e,i),cy:_v(o,e,i),r:e,stroke:"transparent",fill:"transparent"})};Zs.props=["radius","centerX","centerY","position","type"],Zs.compatConfig={MODE:3};const sh=Zs,Ev=t.defineComponent({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:n,addSelectedEdges:o,connectionMode:i,edgeUpdaterRadius:a,emits:r,nodesSelectionActive:l,noPanClassName:s,getEdgeTypes:c,removeSelectedEdges:d,findEdge:u,findNode:m,isValidConnection:f,multiSelectionActive:p,disableKeyboardA11y:y,elementsSelectable:g,edgesUpdatable:b,edgesFocusable:k,hooks:_}=ot(),h=t.computed(()=>u(e.id)),{emit:C,on:v}=yI(h.value,r),S=t.inject(Cr),N=t.getCurrentInstance(),A=t.ref(!1),T=t.ref(!1),O=t.ref(""),z=t.ref(null),P=t.ref("source"),D=t.ref(null),E=t.toRef(()=>typeof h.value.selectable>"u"?g.value:h.value.selectable),R=t.toRef(()=>typeof h.value.updatable>"u"?b.value:h.value.updatable),I=t.toRef(()=>typeof h.value.focusable>"u"?k.value:h.value.focusable);t.provide(fI,e.id),t.provide(pI,D);const x=t.computed(()=>h.value.class instanceof Function?h.value.class(h.value):h.value.class),$=t.computed(()=>h.value.style instanceof Function?h.value.style(h.value):h.value.style),U=t.computed(()=>{const L=h.value.type||"default",K=S==null?void 0:S[`edge-${L}`];if(K)return K;let Z=h.value.template??c.value[L];if(typeof Z=="string"&&N){const Q=Object.keys(N.appContext.components);Q&&Q.includes(L)&&(Z=t.resolveComponent(L,!1))}return Z&&typeof Z!="string"?Z:(r.error(new vt(_t.EDGE_TYPE_MISSING,Z)),!1)}),{handlePointerDown:F}=Wp({nodeId:O,handleId:z,type:P,isValidConnection:f,edgeUpdaterType:P,onEdgeUpdate:X,onEdgeUpdateEnd:W});return()=>{const L=m(h.value.source),K=m(h.value.target),Z="pathOptions"in h.value?h.value.pathOptions:{};if(!L&&!K)return r.error(new vt(_t.EDGE_SOURCE_TARGET_MISSING,h.value.id,h.value.source,h.value.target)),null;if(!L)return r.error(new vt(_t.EDGE_SOURCE_MISSING,h.value.id,h.value.source)),null;if(!K)return r.error(new vt(_t.EDGE_TARGET_MISSING,h.value.id,h.value.target)),null;if(!h.value||h.value.hidden||L.hidden||K.hidden)return null;let Q;i.value===Pn.Strict?Q=L.handleBounds.source:Q=[...L.handleBounds.source||[],...L.handleBounds.target||[]];const fe=Lp(Q,h.value.sourceHandle);let be;i.value===Pn.Strict?be=K.handleBounds.target:be=[...K.handleBounds.target||[],...K.handleBounds.source||[]];const Ee=Lp(be,h.value.targetHandle),Ne=(fe==null?void 0:fe.position)||Ve.Bottom,J=(Ee==null?void 0:Ee.position)||Ve.Top,{x:ee,y:te}=ci(L,fe,Ne),{x:ge,y:Re}=ci(K,Ee,J);return h.value.sourceX=ee,h.value.sourceY=te,h.value.targetX=ge,h.value.targetY=Re,t.h("g",{ref:D,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${U.value===!1?"default":h.value.type||"default"}`,s.value,x.value,{updating:A.value,selected:h.value.selected,animated:h.value.animated,inactive:!E.value&&!_.value.edgeClick.hasListeners()}],tabIndex:I.value?0:void 0,"aria-label":h.value.ariaLabel===null?void 0:h.value.ariaLabel??`Edge from ${h.value.source} to ${h.value.target}`,"aria-describedby":I.value?`${pp}-${n}`:void 0,"aria-roledescription":"edge",role:I.value?"group":"img",...h.value.domAttributes,onClick:de,onContextmenu:ie,onDblclick:Ie,onMouseenter:Le,onMousemove:Se,onMouseleave:ce,onKeyDown:I.value?V:void 0},[T.value?null:t.h(U.value===!1?c.value.default:U.value,{id:e.id,sourceNode:L,targetNode:K,source:h.value.source,target:h.value.target,type:h.value.type,updatable:R.value,selected:h.value.selected,animated:h.value.animated,label:h.value.label,labelStyle:h.value.labelStyle,labelShowBg:h.value.labelShowBg,labelBgStyle:h.value.labelBgStyle,labelBgPadding:h.value.labelBgPadding,labelBgBorderRadius:h.value.labelBgBorderRadius,data:h.value.data,events:{...h.value.events,...v},style:$.value,markerStart:`url('#${Qi(h.value.markerStart,n)}')`,markerEnd:`url('#${Qi(h.value.markerEnd,n)}')`,sourcePosition:Ne,targetPosition:J,sourceX:ee,sourceY:te,targetX:ge,targetY:Re,sourceHandleId:h.value.sourceHandle,targetHandleId:h.value.targetHandle,interactionWidth:h.value.interactionWidth,...Z}),[R.value==="source"||R.value===!0?[t.h("g",{onMousedown:pe,onMouseenter:B,onMouseout:j},t.h(sh,{position:Ne,centerX:ee,centerY:te,radius:a.value,type:"source","data-type":"source"}))]:null,R.value==="target"||R.value===!0?[t.h("g",{onMousedown:he,onMouseenter:B,onMouseout:j},t.h(sh,{position:J,centerX:ge,centerY:Re,radius:a.value,type:"target","data-type":"target"}))]:null]])};function B(){A.value=!0}function j(){A.value=!1}function X(L,K){C.update({event:L,edge:h.value,connection:K})}function W(L){C.updateEnd({event:L,edge:h.value}),T.value=!1}function oe(L,K){L.button===0&&(T.value=!0,O.value=K?h.value.target:h.value.source,z.value=(K?h.value.targetHandle:h.value.sourceHandle)??null,P.value=K?"target":"source",C.updateStart({event:L,edge:h.value}),F(L))}function de(L){var K;const Z={event:L,edge:h.value};E.value&&(l.value=!1,h.value.selected&&p.value?(d([h.value]),(K=D.value)==null||K.blur()):o([h.value])),C.click(Z)}function ie(L){C.contextMenu({event:L,edge:h.value})}function Ie(L){C.doubleClick({event:L,edge:h.value})}function Le(L){C.mouseEnter({event:L,edge:h.value})}function Se(L){C.mouseMove({event:L,edge:h.value})}function ce(L){C.mouseLeave({event:L,edge:h.value})}function pe(L){oe(L,!0)}function he(L){oe(L,!1)}function V(L){var K;!y.value&&hp.includes(L.key)&&E.value&&(L.key==="Escape"?((K=D.value)==null||K.blur(),d([u(e.id)])):o([u(e.id)]))}}}),Nv=t.defineComponent({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:n,connectionMode:o,connectionStartHandle:i,connectionEndHandle:a,connectionPosition:r,connectionLineType:l,connectionLineStyle:s,connectionLineOptions:c,connectionStatus:d,viewport:u,findNode:m}=ot(),f=(e=t.inject(Cr))==null?void 0:e["connection-line"],p=t.computed(()=>{var _;return m((_=i.value)==null?void 0:_.nodeId)}),y=t.computed(()=>{var _;return m((_=a.value)==null?void 0:_.nodeId)??null}),g=t.computed(()=>({x:(r.value.x-u.value.x)/u.value.zoom,y:(r.value.y-u.value.y)/u.value.zoom})),b=t.computed(()=>c.value.markerStart?`url(#${Qi(c.value.markerStart,n)})`:""),k=t.computed(()=>c.value.markerEnd?`url(#${Qi(c.value.markerEnd,n)})`:"");return()=>{var _,h,C;if(!p.value||!i.value)return null;const v=i.value.id,S=i.value.type,N=p.value.handleBounds;let A=(N==null?void 0:N[S])??[];if(o.value===Pn.Loose){const $=(N==null?void 0:N[S==="source"?"target":"source"])??[];A=[...A,...$]}if(!A)return null;const T=(v?A.find($=>$.id===v):A[0])??null,O=(T==null?void 0:T.position)??Ve.Top,{x:z,y:P}=ci(p.value,T,O);let D=null;y.value&&(o.value===Pn.Strict?D=((_=y.value.handleBounds[S==="source"?"target":"source"])==null?void 0:_.find($=>{var U;return $.id===((U=a.value)==null?void 0:U.id)}))||null:D=((h=[...y.value.handleBounds.source??[],...y.value.handleBounds.target??[]])==null?void 0:h.find($=>{var U;return $.id===((U=a.value)==null?void 0:U.id)}))||null);const E=((C=a.value)==null?void 0:C.position)??(O?Gs[O]:null);if(!O||!E)return null;const R=l.value??c.value.type??xo.Bezier;let I="";const x={sourceX:z,sourceY:P,sourcePosition:O,targetX:g.value.x,targetY:g.value.y,targetPosition:E};return R===xo.Bezier?[I]=nh(x):R===xo.Step?[I]=Xs({...x,borderRadius:0}):R===xo.SmoothStep?[I]=Xs(x):R===xo.SimpleBezier?[I]=ih(x):I=`M${z},${P} ${g.value.x},${g.value.y}`,t.h("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},t.h("g",{class:"vue-flow__connection"},f?t.h(f,{sourceX:z,sourceY:P,sourcePosition:O,targetX:g.value.x,targetY:g.value.y,targetPosition:E,sourceNode:p.value,sourceHandle:T,targetNode:y.value,targetHandle:D,markerEnd:k.value,markerStart:b.value,connectionStatus:d.value}):t.h("path",{d:I,class:[c.value.class,d.value,"vue-flow__connection-path"],style:{...s.value,...c.value.style},"marker-end":k.value,"marker-start":b.value})))}}}),wv=["id","markerWidth","markerHeight","markerUnits","orient"],Iv={name:"MarkerType",compatConfig:{MODE:3}},vv=t.defineComponent({...Iv,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("marker",{id:n.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${n.width}`,markerHeight:`${n.height}`,markerUnits:n.markerUnits,orient:n.orient},[n.type===t.unref(Ds).ArrowClosed?(t.openBlock(),t.createElementBlock("polyline",{key:0,style:t.normalizeStyle({stroke:n.color,fill:n.color,strokeWidth:n.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):t.createCommentVNode("",!0),n.type===t.unref(Ds).Arrow?(t.openBlock(),t.createElementBlock("polyline",{key:1,style:t.normalizeStyle({stroke:n.color,strokeWidth:n.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):t.createCommentVNode("",!0)],8,wv))}}),Cv={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Sv={name:"MarkerDefinitions",compatConfig:{MODE:3}},Rv=t.defineComponent({...Sv,setup(e){const{id:n,edges:o,connectionLineOptions:i,defaultMarkerColor:a}=ot(),r=t.computed(()=>{const l=new Set,s=[],c=d=>{if(d){const u=Qi(d,n);l.has(u)||(typeof d=="object"?s.push({...d,id:u,color:d.color||a.value}):s.push({id:u,color:a.value,type:d}),l.add(u))}};for(const d of[i.value.markerEnd,i.value.markerStart])c(d);for(const d of o.value)for(const u of[d.markerStart,d.markerEnd])c(u);return s.sort((d,u)=>d.id.localeCompare(u.id))});return(l,s)=>(t.openBlock(),t.createElementBlock("svg",Cv,[t.createElementVNode("defs",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,c=>(t.openBlock(),t.createBlock(vv,{id:c.id,key:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,"stroke-width":c.strokeWidth,orient:c.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),Av={name:"Edges",compatConfig:{MODE:3}},xv=t.defineComponent({...Av,setup(e){const{findNode:n,getEdges:o,elevateEdgesOnSelect:i}=ot();return(a,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Rv),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o),l=>(t.openBlock(),t.createElementBlock("svg",{key:l.id,class:"vue-flow__edges vue-flow__container",style:t.normalizeStyle({zIndex:t.unref(tI)(l,t.unref(n),t.unref(i))})},[t.createVNode(t.unref(Ev),{id:l.id},null,8,["id"])],4))),128)),t.createVNode(t.unref(Nv))],64))}}),$v=t.defineComponent({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:n,noPanClassName:o,selectNodesOnDrag:i,nodesSelectionActive:a,multiSelectionActive:r,emits:l,removeSelectedNodes:s,addSelectedNodes:c,updateNodeDimensions:d,onUpdateNodeInternals:u,getNodeTypes:m,nodeExtent:f,elevateNodesOnSelect:p,disableKeyboardA11y:y,ariaLiveMessage:g,snapToGrid:b,snapGrid:k,nodeDragThreshold:_,nodesDraggable:h,elementsSelectable:C,nodesConnectable:v,nodesFocusable:S,hooks:N}=ot(),A=t.ref(null);t.provide(Yp,A),t.provide(Gp,e.id);const T=t.inject(Cr),O=t.getCurrentInstance(),z=Xp(),{node:P,parentNode:D}=Jp(e.id),{emit:E,on:R}=_I(P,l),I=t.toRef(()=>typeof P.draggable>"u"?h.value:P.draggable),x=t.toRef(()=>typeof P.selectable>"u"?C.value:P.selectable),$=t.toRef(()=>typeof P.connectable>"u"?v.value:P.connectable),U=t.toRef(()=>typeof P.focusable>"u"?S.value:P.focusable),F=t.computed(()=>x.value||I.value||N.value.nodeClick.hasListeners()||N.value.nodeDoubleClick.hasListeners()||N.value.nodeMouseEnter.hasListeners()||N.value.nodeMouseMove.hasListeners()||N.value.nodeMouseLeave.hasListeners()),B=t.toRef(()=>!!P.dimensions.width&&!!P.dimensions.height),j=t.computed(()=>{const K=P.type||"default",Z=T==null?void 0:T[`node-${K}`];if(Z)return Z;let Q=P.template||m.value[K];if(typeof Q=="string"&&O){const fe=Object.keys(O.appContext.components);fe&&fe.includes(K)&&(Q=t.resolveComponent(K,!1))}return Q&&typeof Q!="string"?Q:(l.error(new vt(_t.NODE_TYPE_MISSING,Q)),!1)}),X=qp({id:e.id,el:A,disabled:()=>!I.value,selectable:x,dragHandle:()=>P.dragHandle,onStart(K){E.dragStart(K)},onDrag(K){E.drag(K)},onStop(K){E.dragStop(K)},onClick(K){V(K)}}),W=t.computed(()=>P.class instanceof Function?P.class(P):P.class),oe=t.computed(()=>{const K=(P.style instanceof Function?P.style(P):P.style)||{},Z=P.width instanceof Function?P.width(P):P.width,Q=P.height instanceof Function?P.height(P):P.height;return!K.width&&Z&&(K.width=typeof Z=="string"?Z:`${Z}px`),!K.height&&Q&&(K.height=typeof Q=="string"?Q:`${Q}px`),K}),de=t.toRef(()=>Number(P.zIndex??oe.value.zIndex??0));return u(K=>{(K.includes(e.id)||!K.length)&&Ie()}),t.onMounted(()=>{t.watch(()=>P.hidden,(K=!1,Z,Q)=>{!K&&A.value&&(e.resizeObserver.observe(A.value),Q(()=>{A.value&&e.resizeObserver.unobserve(A.value)}))},{immediate:!0,flush:"post"})}),t.watch([()=>P.type,()=>P.sourcePosition,()=>P.targetPosition],()=>{t.nextTick(()=>{d([{id:e.id,nodeElement:A.value,forceUpdate:!0}])})}),t.watch([()=>P.position.x,()=>P.position.y,()=>{var K;return(K=D.value)==null?void 0:K.computedPosition.x},()=>{var K;return(K=D.value)==null?void 0:K.computedPosition.y},()=>{var K;return(K=D.value)==null?void 0:K.computedPosition.z},de,()=>P.selected,()=>P.dimensions.height,()=>P.dimensions.width,()=>{var K;return(K=D.value)==null?void 0:K.dimensions.height},()=>{var K;return(K=D.value)==null?void 0:K.dimensions.width}],([K,Z,Q,fe,be,Ee])=>{const Ne={x:K,y:Z,z:Ee+(p.value&&P.selected?1e3:0)};typeof Q<"u"&&typeof fe<"u"?P.computedPosition=Ww({x:Q,y:fe,z:be},Ne):P.computedPosition=Ne},{flush:"post",immediate:!0}),t.watch([()=>P.extent,f],([K,Z],[Q,fe])=>{(K!==Q||Z!==fe)&&ie()}),P.extent==="parent"||typeof P.extent=="object"&&"range"in P.extent&&P.extent.range==="parent"?hs(()=>B).toBe(!0).then(ie):ie(),()=>P.hidden?null:t.h("div",{ref:A,"data-id":P.id,class:["vue-flow__node",`vue-flow__node-${j.value===!1?"default":P.type||"default"}`,{[o.value]:I.value,dragging:X==null?void 0:X.value,draggable:I.value,selected:P.selected,selectable:x.value,parent:P.isParent},W.value],style:{visibility:B.value?"visible":"hidden",zIndex:P.computedPosition.z??de.value,transform:`translate(${P.computedPosition.x}px,${P.computedPosition.y}px)`,pointerEvents:F.value?"all":"none",...oe.value},tabIndex:U.value?0:void 0,role:U.value?"group":void 0,"aria-describedby":y.value?void 0:`${fp}-${n}`,"aria-label":P.ariaLabel,"aria-roledescription":"node",...P.domAttributes,onMouseenter:Le,onMousemove:Se,onMouseleave:ce,onContextmenu:pe,onClick:V,onDblclick:he,onKeydown:L},[t.h(j.value===!1?m.value.default:j.value,{id:P.id,type:P.type,data:P.data,events:{...P.events,...R},selected:P.selected,resizing:P.resizing,dragging:X.value,connectable:$.value,position:P.computedPosition,dimensions:P.dimensions,isValidTargetPos:P.isValidTargetPos,isValidSourcePos:P.isValidSourcePos,parent:P.parentNode,parentNodeId:P.parentNode,zIndex:P.computedPosition.z??de.value,targetPosition:P.targetPosition,sourcePosition:P.sourcePosition,label:P.label,dragHandle:P.dragHandle,onUpdateNodeInternals:Ie})]);function ie(){const K=P.computedPosition,{computedPosition:Z,position:Q}=Hs(P,b.value?vr(K,k.value):K,l.error,f.value,D.value);(P.computedPosition.x!==Z.x||P.computedPosition.y!==Z.y)&&(P.computedPosition={...P.computedPosition,...Z}),(P.position.x!==Q.x||P.position.y!==Q.y)&&(P.position=Q)}function Ie(){A.value&&d([{id:e.id,nodeElement:A.value,forceUpdate:!0}])}function Le(K){X!=null&&X.value||E.mouseEnter({event:K,node:P})}function Se(K){X!=null&&X.value||E.mouseMove({event:K,node:P})}function ce(K){X!=null&&X.value||E.mouseLeave({event:K,node:P})}function pe(K){return E.contextMenu({event:K,node:P})}function he(K){return E.doubleClick({event:K,node:P})}function V(K){x.value&&(!i.value||!I.value||_.value>0)&&Ys(P,r.value,c,s,a,!1,A.value),E.click({event:K,node:P})}function L(K){if(!(Os(K)||y.value))if(hp.includes(K.key)&&x.value){const Z=K.key==="Escape";Ys(P,r.value,c,s,a,Z,A.value)}else I.value&&P.selected&&li[K.key]&&(K.preventDefault(),g.value=`Moved selected node ${K.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~P.position.x}, y: ${~~P.position.y}`,z({x:li[K.key].x,y:li[K.key].y},K.shiftKey))}}});function Tv(e={includeHiddenNodes:!1}){const{nodes:n}=ot();return t.computed(()=>{if(n.value.length===0)return!1;for(const o of n.value)if((e.includeHiddenNodes||!o.hidden)&&((o==null?void 0:o.handleBounds)===void 0||o.dimensions.width===0||o.dimensions.height===0))return!1;return!0})}const Mv={class:"vue-flow__nodes vue-flow__container"},Vv={name:"Nodes",compatConfig:{MODE:3}},Lv=t.defineComponent({...Vv,setup(e){const{getNodes:n,updateNodeDimensions:o,emits:i}=ot(),a=Tv(),r=t.ref();return t.watch(a,l=>{l&&t.nextTick(()=>{i.nodesInitialized(n.value)})},{immediate:!0}),t.onMounted(()=>{r.value=new ResizeObserver(l=>{const s=l.map(c=>({id:c.target.getAttribute("data-id"),nodeElement:c.target,forceUpdate:!0}));t.nextTick(()=>o(s))})}),t.onBeforeUnmount(()=>{var l;return(l=r.value)==null?void 0:l.disconnect()}),(l,s)=>(t.openBlock(),t.createElementBlock("div",Mv,[r.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(n),(c,d,u,m)=>{const f=[c.id];if(m&&m.key===c.id&&t.isMemoSame(m,f))return m;const p=(t.openBlock(),t.createBlock(t.unref($v),{id:c.id,key:c.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return p.memo=f,p},s,0),128)):t.createCommentVNode("",!0)]))}});function Bv(){const{emits:e}=ot();t.onMounted(()=>{if(zp()){const n=document.querySelector(".vue-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.error(new vt(_t.MISSING_STYLES))}})}const Dv=t.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),Ov={name:"VueFlow",compatConfig:{MODE:3}},Pv=t.defineComponent({...Ov,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:n,emit:o}){const i=e,a=t.useSlots(),r=ys(i,"modelValue",o),l=ys(i,"nodes",o),s=ys(i,"edges",o),c=ot(i),d=II({modelValue:r,nodes:l,edges:s},i,c);return CI(o,c.hooks),bv(),Bv(),t.provide(Cr,a),t.onUnmounted(d),n(c),(u,m)=>(t.openBlock(),t.createElementBlock("div",{ref:t.unref(c).vueFlowRef,class:"vue-flow"},[t.createVNode(mv,null,{default:t.withCtx(()=>[t.createVNode(xv),Dv,t.createVNode(Lv),t.renderSlot(u.$slots,"zoom-pane")]),_:3}),t.renderSlot(u.$slots,"default"),t.createVNode(gv)],512))}}),zv={name:"Panel",compatConfig:{MODE:3}},ch=t.defineComponent({...zv,props:{position:{}},setup(e){const n=e,{userSelectionActive:o}=ot(),i=t.computed(()=>`${n.position}`.split("-"));return(a,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["vue-flow__panel",i.value]),style:t.normalizeStyle({pointerEvents:t.unref(o)?"none":"all"})},[t.renderSlot(a.$slots,"default")],6))}}),Fv=["width","height","innerHTML"],Uv=t.defineComponent({__name:"EmIcon",props:{name:{},size:{}},setup(e){const n={network:'<rect x="16" y="16" width="6" height="6" rx="1"/><rect x="2" y="16" width="6" height="6" rx="1"/><rect x="9" y="2" width="6" height="6" rx="1"/><path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"/><path d="M12 12V8"/>',folder:'<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>',table:'<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/><path d="M12 3v18"/>',key:'<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"/><path d="m21 2-9.6 9.6"/><circle cx="7.5" cy="15.5" r="5.5"/>',asterisk:'<path d="M12 6v12"/><path d="M17.196 9 6.804 15"/><path d="m6.804 9 10.392 6"/>',link:'<path d="M9 17H7A5 5 0 0 1 7 7h2"/><path d="M15 7h2a5 5 0 1 1 0 10h-2"/><line x1="8" x2="16" y1="12" y2="12"/>',field:'<circle cx="12" cy="12" r="3"/>',method:'<path d="M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"/><path d="M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"/>',"arrow-lr":'<path d="M8 3 4 7l4 4"/><path d="M4 7h16"/><path d="m16 21 4-4-4-4"/><path d="M20 17H4"/>',note:'<path d="M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11l5-5V5a2 2 0 0 0-2-2Z"/><path d="M15 3v4a2 2 0 0 0 2 2h4"/>',chevron:'<path d="m9 18 6-6-6-6"/>',"expand-all":'<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>',"collapse-all":'<path d="m7 20 5-5 5 5"/><path d="m7 4 5 5 5-5"/>',"panel-close":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/><path d="m16 15-3-3 3-3"/>',"panel-open":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/><path d="m14 9 3 3-3 3"/>',"panel-right-close":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M15 3v18"/><path d="m8 9 3 3-3 3"/>',"panel-right-open":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M15 3v18"/><path d="m10 15-3-3 3-3"/>',eye:'<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/>',pencil:'<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>',undo:'<path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"/>',redo:'<path d="M21 7v6h-6"/><path d="M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7"/>',history:'<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l4 2"/>',"add-entity":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M8 12h8"/><path d="M12 8v8"/>',"auto-layout":'<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>',"file-text":'<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M16 13H8"/><path d="M16 17H8"/><path d="M10 9H8"/>',image:'<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>',camera:'<path d="M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"/><circle cx="12" cy="13" r="3"/>',save:'<path d="M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"/><path d="M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"/><path d="M7 3v4a1 1 0 0 0 1 1h7"/>',route:'<circle cx="6" cy="19" r="3"/><path d="M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"/><circle cx="18" cy="5" r="3"/>',grid:'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/><path d="M9 3v18"/><path d="M15 3v18"/>',map:'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>',copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',clipboard:'<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>',trash:'<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/>',"alert-circle":'<circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/>',"alert-triangle":'<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><line x1="12" x2="12" y1="9" y2="13"/><line x1="12" x2="12.01" y1="17" y2="17"/>',info:'<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>',help:'<circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>',lock:'<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>',unlock:'<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/>',search:'<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',"fit-view":'<path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/>'};return(o,i)=>(t.openBlock(),t.createElementBlock("svg",{class:"em-icon",width:e.size??16,height:e.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",innerHTML:n[e.name]??""},null,8,Fv))}}),tt=(e,n)=>{const o=e.__vccOpts||e;for(const[i,a]of n)o[i]=a;return o},xe=tt(Uv,[["__scopeId","data-v-e3e720fa"]]),Lo=["red","amber","green","teal","blue","indigo","violet","pink"],dh={red:"em.swatch.red",amber:"em.swatch.amber",green:"em.swatch.green",teal:"em.swatch.teal",blue:"em.swatch.blue",indigo:"em.swatch.indigo",violet:"em.swatch.violet",pink:"em.swatch.pink"};function Hv(e){return typeof e=="string"&&e in dh}const jv={red:0,amber:32,green:145,teal:173,blue:221,indigo:244,violet:262,pink:330},Kv=.15;function Gv(e){const n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!n)return null;let o=n[1];o.length===3&&(o=o[0]+o[0]+o[1]+o[1]+o[2]+o[2]);const i=parseInt(o.slice(0,2),16)/255,a=parseInt(o.slice(2,4),16)/255,r=parseInt(o.slice(4,6),16)/255,l=Math.max(i,a,r),s=Math.min(i,a,r),c=l-s,d=(l+s)/2;let u=0,m=0;return c!==0&&(u=c/(1-Math.abs(2*d-1)),l===i?m=(a-r)/c%6:l===a?m=(r-i)/c+2:m=(i-a)/c+4,m*=60,m<0&&(m+=360)),{h:m,s:u,l:d}}function Yv(e){if(typeof e!="string")return null;const n=Gv(e);if(!n||n.s<Kv)return null;let o=null,i=1/0;for(const a of Lo){const r=Math.abs(n.h-jv[a]),l=Math.min(r,360-r);l<i&&(i=l,o=a)}return o}function Bt(e){var i;const n=(i=e==null?void 0:e.properties)==null?void 0:i.swatch;if(Hv(n))return n;const o=e==null?void 0:e.properties;return Yv((o==null?void 0:o["background-color"])??(o==null?void 0:o["font-color"])??(o==null?void 0:o.color))}function Qs(e){return e?{bar:`var(--em-swatch-${e}-bar)`,barOn:`var(--em-swatch-${e}-on)`,text:`var(--em-swatch-${e}-text)`}:null}const qv={red:"var(--em-swatch-red-bar)",amber:"var(--em-swatch-amber-bar)",green:"var(--em-swatch-green-bar)",teal:"var(--em-swatch-teal-bar)",blue:"var(--em-swatch-blue-bar)",indigo:"var(--em-swatch-indigo-bar)",violet:"var(--em-swatch-violet-bar)",pink:"var(--em-swatch-pink-bar)"},Wv={red:"color-mix(in srgb, var(--em-swatch-red-bar) 22%, transparent)",amber:"color-mix(in srgb, var(--em-swatch-amber-bar) 22%, transparent)",green:"color-mix(in srgb, var(--em-swatch-green-bar) 22%, transparent)",teal:"color-mix(in srgb, var(--em-swatch-teal-bar) 22%, transparent)",blue:"color-mix(in srgb, var(--em-swatch-blue-bar) 22%, transparent)",indigo:"color-mix(in srgb, var(--em-swatch-indigo-bar) 22%, transparent)",violet:"color-mix(in srgb, var(--em-swatch-violet-bar) 22%, transparent)",pink:"color-mix(in srgb, var(--em-swatch-pink-bar) 22%, transparent)"};function uh(e,n=!1){return e?n?Wv[e]:qv[e]:null}function Bo(e){return dh[e]}function di(e){return`var(--em-swatch-${e}-bar)`}function Jv(e){switch(e.split("-")[1]){case"NAME":return"em.check.catName";case"JPA":return"em.check.catJpa";case"TYPE":return"em.check.catType";case"DSN":return"em.check.catDsn";default:return null}}function Xv(e,n){const o=Jv(n);return o?e(o):n.split("-")[1]??n}function Zv(e){var o,i,a;const n=r=>e.params!=null&&r in e.params;switch(e.ruleId){case"CHK-NAME-1":return"em.check.name1";case"CHK-NAME-2":return"em.check.name2";case"CHK-NAME-3":return((o=e.params)==null?void 0:o.reason)==="package"?"em.check.name3Package":"em.check.name3Entity";case"CHK-NAME-4":return e.targetKind==="entity"?"em.check.name4Entity":"em.check.name4Attr";case"CHK-NAME-5":return"em.check.name5";case"CHK-NAME-6":return e.targetKind==="entity"?"em.check.name6Table":e.targetKind==="index"?"em.check.name6Index":"em.check.name6Column";case"CHK-NAME-7":return"em.check.name7";case"CHK-NAME-8":return"em.check.name8";case"CHK-NAME-11":return e.targetKind==="entity"?"em.check.name11Entity":"em.check.name11Attr";case"CHK-NAME-9":return"em.check.name9";case"CHK-NAME-10":return"em.check.name10";case"CHK-JPA-1":return"em.check.jpa1";case"CHK-JPA-2":return"em.check.jpa2";case"CHK-JPA-4":return"em.check.jpa4";case"CHK-JPA-5":return"em.check.jpa5";case"CHK-JPA-7":return"em.check.jpa7";case"CHK-JPA-8":return"em.check.jpa8";case"CHK-JPA-9":return"em.check.jpa9";case"CHK-JPA-10":return"em.check.jpa10";case"CHK-JPA-11":return"em.check.jpa11";case"CHK-JPA-12":return"em.check.jpa12";case"CHK-JPA-13":return n("seq")?"em.check.jpa13Sequence":"em.check.jpa13AutoIncrement";case"CHK-JPA-14":return"em.check.jpa14";case"CHK-JPA-15":return"em.check.jpa15";case"CHK-JPA-16":return"em.check.jpa16";case"CHK-JPA-17":return"em.check.jpa17";case"CHK-JPA-18":return"em.check.jpa18";case"CHK-JPA-19":return"em.check.jpa19";case"CHK-JPA-20":return"em.check.jpa20";case"CHK-JPA-21":return Number(((i=e.params)==null?void 0:i.slots)??0)<Number(((a=e.params)==null?void 0:a.declared)??0)?"em.check.jpa21Missing":"em.check.jpa21Extra";case"CHK-TYPE-1":return"em.check.type1";case"CHK-TYPE-2":return"em.check.type2";case"CHK-TYPE-3":return"em.check.type3";case"CHK-TYPE-4":return"em.check.type4";case"CHK-TYPE-6":return"em.check.type6";case"CHK-TYPE-7":return"em.check.type7";case"CHK-TYPE-8":return"em.check.type8";case"CHK-DSN-1":return"em.check.dsn1";case"CHK-DSN-2":return"em.check.dsn2";case"CHK-DSN-3":return"em.check.dsn3";case"CHK-DSN-4":return"em.check.dsn4";case"CHK-DSN-5":return n("field")?"em.check.dsn5Inherited":"em.check.dsn5Missing";case"CHK-DSN-6":return"em.check.dsn6";case"CHK-DSN-7":return"em.check.dsn7";default:return e.ruleId}}function mh(e,n){const o=Zv(n);if(n.ruleId==="CHK-TYPE-4"){const i=e("em.check.unspecified"),a=n.params??{};return e(o,{type:a.type||i,dataType:a.dataType||i})}return e(o,n.params)}function Qv(e){return e.targetKind==="entity"?e.targetRef:e.contextRef}const eC={class:"em-inline-issue__msgs"},Do=tt(t.defineComponent({__name:"InlineIssueBadge",props:{controller:{},refId:{}},setup(e){const n=e,o=n.controller,i={error:{order:0,icon:"alert-circle"},warning:{order:1,icon:"alert-triangle"},info:{order:2,icon:"info"}},a=t.computed(()=>n.refId?n.controller.issuesByRef.value.get(n.refId)??[]:[]),r=t.computed(()=>{let l=null;for(const s of a.value)(l===null||i[s.severity].order<i[l].order)&&(l=s.severity);return l});return(l,s)=>r.value?(t.openBlock(),t.createElementBlock("p",{key:0,class:t.normalizeClass(["em-inline-issue",`is-${r.value}`])},[t.createVNode(xe,{name:i[r.value].icon,size:13,class:"em-inline-issue__icon"},null,8,["name"]),t.createElementVNode("span",eC,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,(c,d)=>(t.openBlock(),t.createElementBlock("span",{key:d},t.toDisplayString(t.unref(mh)(t.unref(o).t,c)),1))),128))])],2)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-9f959cc0"]]),tC=["id","aria-selected","aria-controls","tabindex","onClick","onKeydown"],nC={key:0,class:"em-mlang__dot"},oC=["id","role","aria-labelledby"],iC=["title"],Qt=tt(t.defineComponent({__name:"MultiLangTextField",props:{modelValue:{},name:{},languages:{default:()=>["ko","en","ja","zh"]},defaultLang:{},multiline:{type:Boolean,default:!1},placeholder:{},height:{},activeLang:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,i=n;function a(){const k=o.defaultLang;return k&&o.languages.includes(k)?k:o.languages[0]??"ko"}const r=t.computed(()=>o.activeLang!==void 0),l=t.ref(a()),s=t.computed(()=>{const k=o.activeLang;return k&&o.languages.includes(k)?k:r.value?o.languages[0]??"ko":l.value});t.watch(()=>[o.languages,o.defaultLang],()=>{o.languages.includes(l.value)||(l.value=a())});function c(k){var _,h;return!!((h=(_=o.modelValue)==null?void 0:_[k])!=null&&h.trim())}const d=k=>`${o.name}-tab-${k}`,u=t.computed(()=>`${o.name}-panel`),m=t.ref(null);async function f(k){var C,v;const _=o.languages,h=_[(k+_.length)%_.length];h&&(l.value=h,await t.nextTick(),(v=(C=m.value)==null?void 0:C.querySelectorAll('[role="tab"]')[_.indexOf(h)])==null||v.focus())}function p(k){f(o.languages.indexOf(s.value)+k)}const y=t.computed(()=>o.languages.filter(k=>{var _,h;return k!==s.value&&!!((h=(_=o.modelValue)==null?void 0:_[k])!=null&&h.trim())})),g=t.computed(()=>{var k;return((k=o.modelValue)==null?void 0:k[s.value])??""});function b(k){const _={...o.modelValue};k.trim()===""?delete _[s.value]:_[s.value]=k,i("update:modelValue",_)}return(k,_)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-mlang",{"is-controlled":r.value}])},[r.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"tabsEl",ref:m,class:"em-mlang__tabs",role:"tablist"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.languages,h=>(t.openBlock(),t.createElementBlock("span",{id:d(h),key:h,class:t.normalizeClass(["em-mlang__tab",{"is-active":s.value===h}]),role:"tab","aria-selected":s.value===h,"aria-controls":u.value,tabindex:s.value===h?0:-1,onClick:C=>l.value=h,onKeydown:[t.withKeys(t.withModifiers(C=>l.value=h,["prevent"]),["enter"]),t.withKeys(t.withModifiers(C=>l.value=h,["prevent"]),["space"]),_[0]||(_[0]=t.withKeys(t.withModifiers(C=>p(-1),["prevent"]),["left"])),_[1]||(_[1]=t.withKeys(t.withModifiers(C=>p(1),["prevent"]),["right"])),_[2]||(_[2]=t.withKeys(t.withModifiers(C=>f(0),["prevent"]),["home"])),_[3]||(_[3]=t.withKeys(t.withModifiers(C=>f(e.languages.length-1),["prevent"]),["end"]))]},[t.createTextVNode(t.toDisplayString(h),1),c(h)?(t.openBlock(),t.createElementBlock("span",nC,"•")):t.createCommentVNode("",!0)],42,tC))),128))],512)),t.createElementVNode("div",{id:u.value,role:r.value?void 0:"tabpanel","aria-labelledby":r.value?void 0:d(s.value)},[e.multiline?(t.openBlock(),t.createBlock(t.unref(ne.BSTextArea),{key:0,name:`${e.name}-${s.value}`,width:"100%",height:e.height??"64px",placeholder:e.placeholder,"model-value":g.value,"onUpdate:modelValue":b},null,8,["name","height","placeholder","model-value"])):(t.openBlock(),t.createBlock(t.unref(ne.BSTextInput),{key:1,name:`${e.name}-${s.value}`,width:"100%",placeholder:e.placeholder,"model-value":g.value,"onUpdate:modelValue":b},null,8,["name","placeholder","model-value"]))],8,oC),r.value&&y.value.length?(t.openBlock(),t.createElementBlock("span",{key:1,class:"em-mlang__others",title:y.value.join(", "),"aria-hidden":"true"},"•",8,iC)):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-9cb21667"]]),aC=["disabled"],rC={class:"em-panel__sub-label"},lC={class:"em-field"},sC={class:"em-field"},cC={class:"em-field"},dC={key:0,class:"em-field"},uC={class:"em-field"},mC={class:"em-class"},fC={class:"em-field"},pC={class:"em-field"},hC={key:1,class:"em-attr__navhint"},yC={key:2,class:"em-field"},gC={key:3,class:"em-field"},bC={class:"em-multilang"},kC={class:"em-multilang"},_C={key:4,class:"em-jpa"},EC={class:"em-field"},NC={class:"em-field"},wC={class:"em-field"},IC=["title"],vC={class:"em-swatch"},CC={class:"em-swatch__row"},SC=["title"],RC=["title","onClick"],fh=tt(t.defineComponent({__name:"EntityBasicsSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean},title:{}},emits:["toggle"],setup(e,{emit:n}){const o=e,i=n,a=o.controller,r=t.computed(()=>a.state.logical.entities.find(B=>B.modelId===o.entityId)??null),l=t.computed(()=>r.value?a.state.layout.entityLayouts.find(B=>B.entityRef===r.value.modelId)??null:null),s=t.computed(()=>{var B;return Bt(((B=l.value)==null?void 0:B.style)??void 0)}),c=["JPA_ENTITY","JPA_EMBEDDABLE","SERIALIZED_TYPE","JPA_MULTI_LANGUAGE_ENTITY","UNDEFINED"],d=["none","LIST","SET","MAP"],u=t.computed(()=>{var B,j;return((j=(B=r.value)==null?void 0:B.serialization)==null?void 0:j.collectionType)??"none"});function m(B){return B==="none"?a.t("em.entity.serializedContainerNone"):B}function f(B){var W,oe;const j=B==="none"?void 0:B,X=j==="MAP"?(oe=(W=r.value)==null?void 0:W.serialization)==null?void 0:oe.mapKeyType:void 0;_({serialization:j?{collectionType:j,...X?{mapKeyType:X}:{}}:null})}function p(B){var X,W;((W=(X=r.value)==null?void 0:X.serialization)==null?void 0:W.collectionType)==="MAP"&&_({serialization:{collectionType:"MAP",...B.trim()?{mapKeyType:B.trim()}:{}}})}const y=[{key:"useVersion",label:"@Version"},{key:"useCacheable",label:"@Cacheable"},{key:"useDynamicInsert",label:"@DynamicInsert"},{key:"useDynamicUpdate",label:"@DynamicUpdate"},{key:"useDiscriminator",label:"@Discriminator"}],g=["inherit","STRING","CHAR","INTEGER"],b=B=>B;function k(B){return B==="inherit"?a.t("em.common.inherit"):B}function _(B){r.value&&a.updateEntity(r.value.modelId,B)}function h(B,j,X){var oe;const W=((oe=r.value)==null?void 0:oe.table)??{physicalName:""};_(B==="physicalName"?{table:{...W,physicalName:X}}:{table:{...W,logicalName:{...W.logicalName,[j]:X}}})}const C=t.computed(()=>{var B;return mn(((B=r.value)==null?void 0:B.stereotype)??"UNDEFINED")});function v(B){var X,W,oe;const j=C.value?(X=r.value)==null?void 0:X.classLogicalName:(oe=(W=r.value)==null?void 0:W.table)==null?void 0:oe.logicalName;return(j==null?void 0:j[B])??""}function S(B,j){var oe;if(!C.value)return h("logicalName",B,j);const X={...(oe=r.value)==null?void 0:oe.classLogicalName,[B]:j},W=Object.fromEntries(Object.entries(X).filter(([,de])=>de!=null&&String(de).trim()!==""));_({classLogicalName:Object.keys(W).length?W:void 0})}function N(B){_({description:Object.keys(B).length?B:void 0})}function A(B,j){var X;_({jpaAttrs:{...(X=r.value)==null?void 0:X.jpaAttrs,[B]:j}})}function T(B,j){A(B,j)}const O=t.computed(()=>{var B,j;return((j=(B=r.value)==null?void 0:B.jpaAttrs)==null?void 0:j.discriminatorType)??"inherit"}),z=t.computed(()=>{var B,j;return!((j=(B=r.value)==null?void 0:B.jpaAttrs)!=null&&j.useDiscriminator)});function P(B){A("discriminatorType",B==="inherit"?void 0:B)}function D(B){_({hasPersonalInfo:B})}function E(B){_({referenceOnly:B?!0:void 0})}function R(B){_({superClass:B.trim()||void 0})}function I(B){_({schema:B.trim()||void 0})}function x(B){_({abstractClass:B})}const $=t.computed(()=>{var B,j;return((j=(B=r.value)==null?void 0:B.declarationOfInterfaces)==null?void 0:j.join(", "))??""});function U(B){const j=B.split(",").map(X=>X.trim()).filter(Boolean);_({declarationOfInterfaces:j.length?j:void 0})}function F(B){r.value&&a.setEntitySwatch(r.value.modelId,B)}return(B,j)=>{var X,W,oe,de;return r.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!t.unref(a).editable.value},[e.collapsible?(t.openBlock(),t.createElementBlock("h4",{key:0,class:"em-panel__sub em-panel__sub--toggle",onClick:j[0]||(j[0]=ie=>i("toggle"))},[t.createElementVNode("span",rC,[t.createVNode(xe,{name:"chevron",size:13,class:t.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"]),t.createTextVNode(" "+t.toDisplayString(e.title||r.value.name||t.unref(a).t("em.entity.fallback")),1)])])):t.createCommentVNode("",!0),!e.collapsible||!e.collapsed?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(Do,{controller:t.unref(a),"ref-id":e.entityId,class:"em-section__issues"},null,8,["controller","ref-id"]),t.createElementVNode("label",lC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.name")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-name",width:"100%","model-value":r.value.name,"onUpdate:modelValue":j[1]||(j[1]=ie=>_({name:ie}))},null,8,["model-value"])]),t.createElementVNode("label",sC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.stereotype")),1),t.createVNode(t.unref(ne.BSSelect),{"model-value":r.value.stereotype,items:c,"value-provider":b,"label-provider":t.unref(gi),"onUpdate:modelValue":j[2]||(j[2]=ie=>_({stereotype:ie}))},null,8,["model-value","label-provider"])]),r.value.stereotype==="SERIALIZED_TYPE"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",cC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.serializedContainer")),1),t.createVNode(t.unref(ne.BSSelect),{name:"ent-ser-container","model-value":u.value,items:d,"value-provider":b,"label-provider":m,"onUpdate:modelValue":j[3]||(j[3]=ie=>ie&&f(ie))},null,8,["model-value"])]),u.value==="MAP"?(t.openBlock(),t.createElementBlock("label",dC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.serializedMapKey")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-ser-mapkey",width:"100%",placeholder:t.unref(a).t("em.entity.serializedMapKeyPlaceholder"),"model-value":((X=r.value.serialization)==null?void 0:X.mapKeyType)??"","onUpdate:modelValue":p},null,8,["placeholder","model-value"])])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0),t.createElementVNode("label",uC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.package")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-package",width:"100%","model-value":r.value.packageName??"","onUpdate:modelValue":j[4]||(j[4]=ie=>_({packageName:ie}))},null,8,["model-value"])]),t.createElementVNode("fieldset",mC,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.entity.classLegend")),1),t.createElementVNode("label",fC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.superClass")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-superclass",width:"100%",placeholder:t.unref(a).t("em.entity.superClassPlaceholder"),"model-value":r.value.superClass??"","onUpdate:modelValue":j[5]||(j[5]=ie=>R(ie))},null,8,["placeholder","model-value"])]),t.createElementVNode("label",pC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.interfaces")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-interfaces",width:"100%",placeholder:t.unref(a).t("em.entity.interfacesPlaceholder"),"model-value":$.value,"onUpdate:modelValue":j[6]||(j[6]=ie=>U(ie))},null,8,["placeholder","model-value"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:"ent-abstract",class:"em-check",label:t.unref(a).t("em.entity.abstractClass"),"model-value":!!r.value.abstractClass,"onUpdate:modelValue":j[7]||(j[7]=ie=>x(ie))},null,8,["label","model-value"])]),t.unref(lt)(r.value.stereotype)?(t.openBlock(),t.createElementBlock("p",hC,t.toDisplayString(t.unref(a).t("em.entity.noOwnTableNote")),1)):(t.openBlock(),t.createElementBlock("label",yC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.tablePhysical")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-table",width:"100%","model-value":((W=r.value.table)==null?void 0:W.physicalName)??"","onUpdate:modelValue":j[8]||(j[8]=ie=>h("physicalName",null,ie))},null,8,["model-value"])])),t.unref(mn)(r.value.stereotype)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",gC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.schema")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-schema",width:"100%",placeholder:t.unref(a).t("em.entity.schemaPlaceholder"),"model-value":r.value.schema??"","onUpdate:modelValue":j[9]||(j[9]=ie=>I(ie))},null,8,["placeholder","model-value"])])),t.createElementVNode("fieldset",bC,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t(C.value?"em.entity.classLogicalLegend":"em.entity.tableLogicalLegend")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a).languages.value,ie=>(t.openBlock(),t.createElementBlock("label",{key:ie,class:"em-lang"},[t.createElementVNode("span",null,t.toDisplayString(ie),1),t.createVNode(t.unref(ne.BSTextInput),{name:`ent-logical-${ie}`,width:"100%","model-value":v(ie),"onUpdate:modelValue":Ie=>S(ie,Ie)},null,8,["name","model-value","onUpdate:modelValue"])]))),128))]),t.createElementVNode("fieldset",kC,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:"ent-desc",languages:t.unref(a).languages.value,"default-lang":t.unref(a).userLanguage.value,"model-value":r.value.description,"onUpdate:modelValue":N},null,8,["languages","default-lang","model-value"])]),t.unref(mn)(r.value.stereotype)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("fieldset",_C,[j[14]||(j[14]=t.createElementVNode("legend",null,"JPA",-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(y,ie=>{var Ie;return t.createVNode(t.unref(ne.BSCheckbox),{key:ie.key,name:`jpa-${ie.key}`,class:"em-check",label:ie.label,"model-value":!!((Ie=r.value.jpaAttrs)!=null&&Ie[ie.key]),"onUpdate:modelValue":Le=>T(ie.key,Le)},null,8,["name","label","model-value","onUpdate:modelValue"])}),64)),t.createElementVNode("label",EC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discColumn")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"disc-col",width:"100%",placeholder:t.unref(a).t("em.entity.discColumnPlaceholder"),disabled:z.value,"model-value":((oe=r.value.jpaAttrs)==null?void 0:oe.discriminatorColumnName)??"","onUpdate:modelValue":j[10]||(j[10]=ie=>A("discriminatorColumnName",ie.trim()||void 0))},null,8,["placeholder","disabled","model-value"])]),t.createElementVNode("label",NC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discType")),1),t.createVNode(t.unref(ne.BSSelect),{disabled:z.value,"model-value":O.value,items:g,"value-provider":b,"label-provider":k,"onUpdate:modelValue":j[11]||(j[11]=ie=>ie&&P(ie))},null,8,["disabled","model-value"])]),t.createElementVNode("label",wC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discLength")),1),t.createVNode(t.unref(ne.BSNumberInput),{name:"disc-len",width:"64px",placeholder:"len",disabled:z.value,"model-value":(de=r.value.jpaAttrs)==null?void 0:de.discriminatorLength,"onUpdate:modelValue":j[12]||(j[12]=ie=>A("discriminatorLength",ie||void 0))},null,8,["disabled","model-value"])])])),t.createVNode(t.unref(ne.BSCheckbox),{name:"ent-personalinfo",class:"em-check em-check--block",label:t.unref(a).t("em.entity.hasPersonalInfo"),"model-value":!!r.value.hasPersonalInfo,"onUpdate:modelValue":D},null,8,["label","model-value"]),t.createElementVNode("div",{class:"em-check--block",title:t.unref(a).t("em.entity.referenceOnlyHint"),"data-ref-only-row":""},[t.createVNode(t.unref(ne.BSCheckbox),{name:"ent-reference-only",class:"em-check",label:t.unref(a).t("em.entity.referenceOnly"),"model-value":!!r.value.referenceOnly,"onUpdate:modelValue":E},null,8,["label","model-value"])],8,IC),t.createElementVNode("fieldset",vC,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.entity.headerColor")),1),t.createElementVNode("div",CC,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":s.value===null}]),title:t.unref(a).t("em.swatch.none"),onClick:j[13]||(j[13]=ie=>F(null))},"∅",10,SC),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),ie=>(t.openBlock(),t.createElementBlock("button",{key:ie,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":s.value===ie}]),style:t.normalizeStyle({background:t.unref(di)(ie)}),title:t.unref(a).t(t.unref(Bo)(ie)),onClick:Ie=>F(ie)},null,14,RC))),128))])])],64)):t.createCommentVNode("",!0)],8,aC)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-e5c28fb1"]]),AC=["none","PASSWORD","SOCIAL_SECURITY_NO","PASSPORT_NO","ALIEN_REGISTRATION_NO","DRIVERS_LICENSE_NO","BIOMETRICS","CREDITCARD_NO","ACCOUNT_NO","MEMBERSHIP_CARD_NO","ID","NAME","DATE_OF_BIRTH","PHONE_NO","EMAIL_ADDRESS","ADDRESS","IP_ADDRESS"],ec=["inherit","true","false"],Vr="__OWN__";function ph(e,n){const o=t.computed(()=>e.state.logical.entities.find(G=>G.modelId===n())??null),i=t.computed(()=>{var G;return lt(((G=o.value)==null?void 0:G.stereotype)??"UNDEFINED")}),a=t.computed(()=>{var G;return mn(((G=o.value)==null?void 0:G.stereotype)??"UNDEFINED")}),r=t.computed(()=>new Set(e.selectedAttrIds.value));function l(G){return G==="none"?e.t("em.common.noneParen"):G}const s=G=>G;function c(G,ae){o.value&&e.updateAttribute(o.value.modelId,G.modelId,ae)}const d=t.computed(()=>sl(e.state.logical.associations));function u(G){if(!o.value)return;const ae=Jn(e.state.logical,o.value.modelId,G.modelId);return ae&&Ta(G,ae)?ae:void 0}function m(G){return!!u(G)}function f(G){return m(G)?G.derivedIdFieldName??"":G.name??""}function p(G){const ae=u(G);if(!ae)return e.t("em.attr.namePlaceholder");const De=new Map(e.state.logical.entities.map(je=>[je.modelId,je]));return Hl({...G,derivedIdFieldName:void 0},ae,De)||e.t("em.attr.namePlaceholder")}function y(G,ae){m(G)?c(G,{derivedIdFieldName:ae||void 0}):c(G,{name:ae})}function g(G){return G.name??""}function b(G,ae){c(G,{name:ae})}function k(G){return!!o.value&&cl(G,o.value,d.value)}function _(G){var je,bt;const ae=(je=G.derivedFrom)==null?void 0:je.associationRef,De=(bt=o.value)==null?void 0:bt.attributes.find(Vt=>{var Ye;return Vt.attrType==="RELATION_OWN"&&((Ye=Vt.derivedFrom)==null?void 0:Ye.associationRef)===ae&&d.value.has(Vt.modelId)});return e.t("em.attr.joinColumnOnlyNote",{anchor:(De==null?void 0:De.name)||e.t("em.attr.nameless")})}function h(G){return!!o.value&&!!Jn(e.state.logical,o.value.modelId,G.modelId)}function C(G,ae){c(G,{naturalId:ae||void 0,naturalIdMutable:ae?G.naturalIdMutable:void 0})}function v(){return{naturalId:void 0,naturalIdMutable:void 0}}function S(G,ae){c(G,{identifier:ae,...ae?v():{}})}function N(G,ae){c(G,{transient:ae||void 0,...ae?v():{}})}const A=["none","LIST","SET"];function T(G,ae){c(G,{collectionType:ae==="none"?void 0:ae})}function O(G){return!!G.transient||G.attrType==="RELATION_REF"}function z(G){return ki(G)}function P(G,ae=0){var De;return((De=ga(G,o.value,e.state.logical.entities,e.state.logical.associations,ae))==null?void 0:De.physicalName)||void 0}function D(G){const ae=kl(G);return ae==="association"||ae==="derived"||!!G.groupCode}const E=G=>G.value,R=G=>G.label;function I(G,ae){if(!ae)return;if(o.value&&pd(G,ae,e.embeddableCatalog.value)){e.convertAttributeType(o.value.modelId,G.modelId,ae);return}const De=Le.value.find(je=>je.type===ae);if(De){const je=G.dbAttrs[0]??{modelId:G.modelId+".c",physicalName:G.name,dataType:"VARCHAR"};c(G,{type:ae,customType:void 0,dbAttrs:[hd(je,De)]});return}c(G,ae===pn?{type:ae}:{type:ae,customType:void 0})}function x(G,ae){c(G,{customType:ae.trim()===""?void 0:ae})}function $(G,ae){if(G.attrType==="RELATION_REF")return;const je={...G.dbAttrs[0]??{modelId:G.modelId+".c",physicalName:G.name,dataType:"VARCHAR"},...ae};ae.dataType!==void 0&&!yl.has(je.dataType)&&(je.scale=void 0),c(G,{dbAttrs:[je]})}function U(G){var ae;return yl.has(((ae=G.dbAttrs[0])==null?void 0:ae.dataType)??"")}function F(G){return!U(G)&&!z(G)&&!O(G)?e.t("em.attr.scaleTypeHint"):void 0}function B(G,ae){$(G,{logicalName:Object.keys(ae).length?ae:void 0})}function j(G,ae){c(G,{fieldLogicalName:Object.keys(ae).length?ae:void 0})}function X(G){var ae;return a.value?G.fieldLogicalName:(ae=G.dbAttrs[0])==null?void 0:ae.logicalName}function W(G,ae){a.value?j(G,ae):B(G,ae)}function oe(G,ae){const De=e.t("em.attr.logicalPlaceholder"),je=G.dbAttrs[0];if(a.value||!je)return De;const bt=Lt(G,je,0,o.value??void 0,e.state.logical,{embeddableCatalog:e.embeddableCatalog.value}).logicalName;return Ct(bt,ae)??De}function de(G,ae){c(G,{description:Object.keys(ae).length?ae:void 0})}function ie(G){return G.personalInfoAttributeType??"none"}function Ie(G,ae){c(G,{personalInfoAttributeType:ae==="none"?void 0:ae})}const Le=t.computed(()=>e.predefinedCustomTypeCatalog.value),Se=t.computed(()=>[...Go(e.state.logical).keys()].sort()),ce=t.computed(()=>e.embeddableCatalog.value);function pe(G){return Ct(G.label,e.userLanguage.value)??G.type}const he=t.computed(()=>e.groupCodeCatalog.value);function V(G){var ae;return((ae=he.value.find(De=>De.groupCode===G.groupCode))==null?void 0:ae.codes)??[]}function L(G){return["none",...V(G)]}function K(G){return G==="none"?"none":G.code}function Z(G){if(G==="none")return e.t("em.common.noneParen");const ae=Ct(G.label,e.userLanguage.value);return ae?`${G.code} (${ae})`:G.code}function Q(G,ae){o.value&&e.setAttributeGroupCode(o.value.modelId,G.modelId,ae)}function fe(G,ae){c(G,{defaultValue:ae==="none"?void 0:ae})}function be(G,ae){c(G,{defaultValue:ae.trim()===""?void 0:ae})}function Ee(G){return G.attrType.startsWith("EMBED")&&G.dbAttrs.length>0}const Ne=vn;function J(G){return Ee(G)||Ne(G)}function ee(G,ae,De){const je=G.dbAttrs.map((bt,Vt)=>{if(Vt!==ae)return bt;const Ye={...bt,...De};for(const Ue of Object.keys(De))De[Ue]===void 0&&delete Ye[Ue];return Ye});o.value&&e.setEmbedColumns(o.value.modelId,G.modelId,je)}function te(G,ae,De){ee(G,ae,{logicalName:Object.keys(De).length?De:void 0})}function ge(G,ae){var bt,Vt,Ye;if(Ne(G)){const Ue=ga(G,o.value,e.state.logical.entities,e.state.logical.associations,ae);return Ue?{physicalName:Ue.physicalName,dataType:Ue.dataType,length:Ue.length,scale:Ue.scale,logicalName:Ue.logicalName}:void 0}if(G.attrType==="EMBED_PREDEF"){const Ue=(bt=e.embeddableCatalog.value.find(w=>w.type===G.type))==null?void 0:bt.fields[ae];return Ue?{name:Ue.name,physicalName:Ue.physicalName,dataType:Ue.dataType,length:Ue.length,scale:Ue.scale,shareable:Ue.shareable,logicalName:Ue.logicalName}:void 0}const De=(Vt=G.embedded)==null?void 0:Vt.embeddableRef;if(!De)return;const je=(Ye=e.state.logical.entities.find(Ue=>Ue.modelId===De))==null?void 0:Ye.attributes.flatMap(Ue=>Ue.dbAttrs)[ae];return je?{physicalName:je.physicalName,dataType:je.dataType,length:je.length,scale:je.scale,logicalName:je.logicalName}:void 0}function Re(G,ae){var De,je;return((De=ge(G,ae))==null?void 0:De.dataType)||((je=G.dbAttrs[ae])==null?void 0:je.dataType)||""}function Pe(G,ae){var De,je;return((De=ge(G,ae))==null?void 0:De.length)??((je=G.dbAttrs[ae])==null?void 0:je.length)}function Me(G,ae){var De,je;return((De=ge(G,ae))==null?void 0:De.scale)??((je=G.dbAttrs[ae])==null?void 0:je.scale)}function Qe(G){return e.t(Ne(G)?"em.attr.fkFixedHint":"em.attr.embedFixedHint")}const Ot=ec;function ht(G){return G==="inherit"?e.t("em.common.inherit"):G}function re(G){return(G==null?void 0:G.updatable)===void 0?"inherit":G.updatable?"true":"false"}function ve(G,ae,De){ee(G,ae,{updatable:De==="inherit"?void 0:De==="true"})}function le(G,ae){$(G,{updatable:ae==="inherit"?void 0:ae==="true"})}const me=ec;function ke(G){return G==="inherit"?e.t("em.common.inherit"):G}function Ze(G){return(G==null?void 0:G.notNull)===void 0||(G==null?void 0:G.notNull)===null?"inherit":G.notNull?"true":"false"}function ct(G,ae,De){ee(G,ae,{notNull:De==="inherit"?void 0:De==="true"})}const ft=ec;function qe(G){return G==="inherit"?e.t("em.common.inherit"):G}function Rt(G){return(G==null?void 0:G.insertable)===void 0?"inherit":G.insertable?"true":"false"}function et(G,ae,De){ee(G,ae,{insertable:De==="inherit"?void 0:De==="true"})}function jt(G,ae){$(G,{insertable:ae==="inherit"?void 0:ae==="true"})}const Nt=t.computed(()=>o.value?pl(o.value,e.state.logical.entities):[]),ut=t.computed(()=>mo(Nt.value.flatMap(G=>G.attributes.flatMap(ae=>ae.dbAttrs)))),yt=t.computed(()=>Nt.value.flatMap(G=>G.attributes.filter(ae=>ae.attrType==="NORMAL"&&ae.dbAttrs.length===1&&ae.dbAttrs[0]).map(ae=>{var De;return{modelId:ae.dbAttrs[0].modelId,physical:ae.dbAttrs[0].physicalName||ae.name,isCurrency:ae.type==="Currency",ownerName:G.modelId===((De=o.value)==null?void 0:De.modelId)?void 0:G.name}})));function At(){const G=[...yt.value].sort((ae,De)=>Number(De.isCurrency)-Number(ae.isCurrency));return[Vr,...G.map(ae=>ae.modelId)]}function jn(G){if(G===Vr)return e.t("em.attr.sharedOwn");const ae=yt.value.find(je=>je.modelId===G);if(!ae)return G;const De=ae.ownerName?`${ae.ownerName}.`:"";return e.t("em.attr.sharedRef",{owner:De,physical:ae.physical,mode:ae.isCurrency?e.t("em.attr.currencyMode"):e.t("em.attr.sharedMode")})}function mt(G){return(G==null?void 0:G.sharedColumnRef)??Vr}function ze(G,ae,De){ee(G,ae,{sharedColumnRef:De===Vr?void 0:De})}function Y(G){return(G==null?void 0:G.sharedColumnRef)!=null}function Wt(G){var ae;return((ae=fo(G,ut.value))==null?void 0:ae.physicalName)??""}return{SERIALIZED_FIELD_CONTAINERS:A,setCollectionType:T,entity:o,isValueType:i,isColumnless:a,focusedAttrIds:r,personalInfoItems:AC,piiLabel:l,idn:s,setAttr:c,isDerivedIdRow:m,rowName:f,rowNamePlaceholder:p,setRowName:y,assocFieldName:g,setAssocFieldName:b,nameLocked:k,nameLockedHint:_,isManagedFk:h,setNaturalId:C,clearNaturalIdPatch:v,setIdentifier:S,setTransient:N,dbLocked:O,fkDerived:z,fkOriginPhysical:P,typeLocked:D,typeValueOf:E,typeLabelOf:R,setAttrType:I,setAttrCustomType:x,setDb:$,scaleApplicable:U,scaleHint:F,setDbLogical:B,setAttrLogical:j,logicalNameOf:X,setLogicalName:W,setAttrDescription:de,attrPiiValue:ie,setAttrPii:Ie,predefinedCustomTypeCatalog:Le,serializedTypeNames:Se,embeddableCatalog:ce,predefinedLabel:pe,groupCodeCatalog:he,attrGroupCodes:V,attrCodeItems:L,codeValueOf:K,codeLabelOf:Z,setAttrGroupCode:Q,setAttrCode:fe,setAttrDefaultValue:be,isEmbedExpanded:Ee,isMultiColFk:Ne,hasColumnSlots:J,setDbAt:ee,setDbLogicalAt:te,logicalPlaceholder:oe,colSlotMeta:ge,fixedDataType:Re,fixedLength:Pe,fixedScale:Me,slotFixedHint:Qe,updatableItems:Ot,updatableLabel:ht,updatableValue:re,setUpdatableAt:ve,setUpdatable:le,insertableItems:ft,insertableLabel:qe,insertableValue:Rt,setInsertableAt:et,notNullItems:me,notNullLabel:ke,notNullValue:Ze,setNotNullAt:ct,setInsertable:jt,scopeEntities:Nt,columnsById:ut,sharedCandidates:yt,sharedItems:At,sharedLabel:jn,sharedValue:mt,setSharedAt:ze,isShared:Y,sharedPhysical:Wt}}const hh={"em.mode.view":"View","em.mode.edit":"Edit","em.mode.frozen":"Editing locked (conflict)","em.mode.frozenTitle":"Editing is locked due to a concurrent-edit conflict. Reloading the latest content.","em.mode.readonlyTitle":"This diagram is read-only","em.toolbar.undo":"Undo","em.toolbar.redo":"Redo","em.toolbar.displayLabel":"Show","em.toolbar.routingToggle":"Toggle connector mode","em.toolbar.routingOrthogonal":"Orthogonal","em.toolbar.routingStraight":"Straight","em.toolbar.grid":"Grid","em.toolbar.gridOn":"Show grid","em.toolbar.gridOff":"Hide grid","em.toolbar.minimap":"Minimap","em.toolbar.minimapOn":"Show minimap","em.toolbar.minimapOff":"Hide minimap","em.toolbar.fitView":"Fit to view","em.toolbar.exportText":"Export (Text · Mermaid)","em.toolbar.exportSvg":"Export SVG","em.toolbar.exportPng":"Export PNG","em.toolbar.import":"Import (paste text)","em.toolbar.history":"History","em.toolbar.historyOpen":"Open change history","em.toolbar.historyClose":"Close change history","em.toolbar.shortcuts":"Keyboard shortcuts (?)","em.displayMode.logical":"Logical","em.displayMode.physical":"Physical","em.displayMode.logicalPhysical":"Logical · Physical","em.displayMode.class":"Class","em.panel.resizeWidth":"Resize width","em.panel.collapse":"Collapse","em.panel.expand":"Expand","em.panel.collapseAll":"Collapse all","em.panel.expandAll":"Expand all","em.panel.lockedBanner":"Locked — move, edit, and delete are blocked","em.panel.openNamed":"Open {name}","em.notice.readOnly":"Editing is not available in view mode","em.notice.entityLocked":"This entity is locked — unlock it to edit","em.notice.groupLocked":"This group is locked — unlock it to edit","em.notice.assocLocked":"This association touches a locked entity — unlock it to edit","em.validation.title":"Validation","em.validation.noIssues":"No validation issues.","em.validation.noVisibleIssues":"No issues to show (filter applied).","em.validation.checkOrphanEntities":"Check entities without relations","em.validation.nameless":"(no name)","em.validation.severityError":"Errors","em.validation.severityWarning":"Warnings","em.validation.severityInfo":"Info","em.validation.hideSeverity":"Hide {label}","em.validation.showSeverity":"Show {label}","em.validation.expandPanel":"Expand validation panel","em.validation.quickFix":"Fix","em.validation.quickFixTip":"Apply automatic fix (undoable)","em.common.close":"Close","em.common.save":"Save","em.export.title":"Export","em.export.formatText":"Logical model text","em.export.formatMermaidEr":"Mermaid (ER)","em.export.formatMermaidClass":"Mermaid (Class)","em.export.formatDdl":"SQL DDL (PostgreSQL)","em.export.formatJson":"JSON (backup)","em.export.copy":"Copy","em.export.download":"Download","em.export.copied":"Copied to clipboard.","em.export.copyFailed":"Failed to copy.","em.import.title":"Import","em.import.placeholder":"Paste SQL DDL, Mermaid ER, or a JSON backup.","em.import.formatGroup":"Input format","em.import.formatAuto":"Auto-detect","em.import.formatMermaid":"Mermaid ER","em.import.formatDdl":"SQL DDL","em.import.formatJson":"JSON","em.import.detected":"Detected: {format}","em.import.summary":"{entities} entities · {relations} relations","em.import.warnings":"{n} warning(s) (partial parse)","em.import.error":"Parse failed: {message}","em.import.emptyParse":"No entities recognized.","em.import.unknownFormat":"Could not detect format — pick one above.","em.import.confirm":"Import","em.import.commentLocale":"Comment locale","em.import.commentLocaleUnset":"Unset — logical names skipped","em.import.commentEvidence":"{n} comments — Korean (hangul) {hangul} · Japanese (kana) {kana} · undecidable {undecidable}","em.import.commentCertain":"{locale} confirmed","em.import.commentMixed":"Mixed — import one locale at a time","em.import.commentUnknown":"Undecidable — pick if you know the source language","em.import.commentMarker":"Locale declared by the text: {locale}","em.shortcuts.title":"Keyboard shortcuts","em.shortcuts.groupEdit":"Edit","em.shortcuts.groupMove":"Move · Arrange","em.shortcuts.groupExplorer":"Explorer","em.shortcuts.descExplorerSearch":"Focus explorer search","em.shortcuts.descExplorerNav":"Move through tree (←→ collapse/expand)","em.shortcuts.descExplorerSelect":"Select item + center canvas","em.shortcuts.descExplorerDetail":"Open entity detail editor","em.shortcuts.groupOther":"Other","em.shortcuts.keyArrows":"Arrow keys","em.shortcuts.keyRightClick":"Right-click","em.shortcuts.descUndo":"Undo","em.shortcuts.descRedo":"Redo","em.shortcuts.descCopy":"Copy selection","em.shortcuts.descPaste":"Paste","em.shortcuts.descDelete":"Delete selection (same as Backspace)","em.shortcuts.descMove1":"Move selected node 1px","em.shortcuts.descMove10":"Move selected node 10px","em.shortcuts.descAttrFocus":"Move focus when an attribute is selected","em.shortcuts.descAttrReorder":"Reorder attribute up/down","em.shortcuts.descContextMenu":"Context menu (add entity·note, etc.)","em.shortcuts.descInlineConfirm":"Confirm inline edit","em.shortcuts.descCloseEdit":"Close edit·menu","em.shortcuts.descOpenHelp":"Open this help","em.shortcuts.descCommandPalette":"Command palette (go to · run command)","em.opSource.title":"Body — {name}()","em.opSource.placeholder":"// Java implementation code","em.entity.name":"Name","em.entity.stereotype":"Stereotype","em.entity.package":"Package","em.panel.unlock":"Unlock","em.entity.fallback":"Entity","em.group.fallback":"Group","em.common.description":"Description","em.common.memo":"Memo","em.common.color":"Color","em.common.add":"Add","em.common.inherit":"Default (inherit)","em.common.noneParen":"(none)","em.swatch.none":"None","em.swatch.red":"Red","em.swatch.amber":"Orange","em.swatch.green":"Green","em.swatch.teal":"Teal","em.swatch.blue":"Blue","em.swatch.indigo":"Indigo","em.swatch.violet":"Violet","em.swatch.pink":"Pink","em.inspector.ctxEntityAttrs":"Entity · {name} › Attributes · {n}","em.inspector.ctxEntityDivider":"Entity · {name} › Divider","em.inspector.ctxEntityAttr":"Entity · {name} › Attribute · {attr}","em.inspector.ctxEntity":"Entity · {name}","em.inspector.ctxAssoc":"Relation · {a} — {b}","em.inspector.ctxGroup":"Group · {name}","em.inspector.ctxNote":"Note","em.inspector.ctxNone":"No selection","em.assoc.identifying":"identifying (identifying relation)","em.assoc.selfNoIdentifying":"A self-association cannot be an identifying relation (non-identifying FK enforced).","em.assoc.embedNoIdentifying":"Embedded (@Embedded/@ElementCollection) cannot be an identifying relation (an embeddable has no independent identifier).","em.assoc.multiplicity":"Multiplicity","em.assoc.navFieldName":"Field name (nav)","em.assoc.cascadeAllNote":"ALL already includes every individual cascade (CHK-JPA-5).","em.assoc.orphanRemovalNote":"The opposite end is a collection (@ManyToOne/@ManyToMany), so orphanRemoval has no effect (CHK-JPA-14).","em.assoc.navRequiredNote":"This direction has no nav property (navigable off), so cascade and fetch do not apply.","em.assoc.ownerNavFixed":"The JPA owning-side reference (@ManyToOne) is inherent to the relation and always on — model a reference-less FK as a plain column instead.","em.assoc.orderByPlaceholder":"e.g. name ASC","em.assoc.jpaDetails":"JPA details","em.embed.legend":"Embedded","em.embed.cardinality":"Cardinality","em.embed.card1":"1 (required @Embedded)","em.embed.card01":"0..1 (optional @Embedded)","em.embed.card0N":"0..* (collection @ElementCollection)","em.embed.collectionTablePlaceholder":"Codegen fallback if unset","em.embed.orderColumnPlaceholder":"Order not preserved if unset","em.embed.ownerFixedNote":"An embeddable is flattened into its owner, so the owner-side end (multiplicity·navigable·composition) is structurally fixed and not shown.","em.group.nameLegend":"Group name","em.group.excludeDDL":"Exclude from DDL generation","em.group.members":"{n} member entities","em.entity.classLegend":"Class","em.entity.superClass":"Superclass","em.entity.superClassPlaceholder":"e.g. BaseEntity","em.entity.interfaces":"Implemented interfaces","em.entity.interfacesPlaceholder":"Comma-separated (e.g. Serializable, Cloneable)","em.entity.abstractClass":"Abstract class","em.entity.tablePhysical":"Table (physical)","em.entity.schema":"Schema","em.entity.schemaPlaceholder":"e.g. sales, master","em.entity.tableLogicalLegend":"Table logical name","em.entity.classLogicalLegend":"Class logical name","em.entity.discColumn":"Discriminator column","em.entity.discColumnPlaceholder":"e.g. DTYPE","em.entity.discType":"Discriminator type","em.entity.discLength":"Discriminator length","em.entity.hasPersonalInfo":"Contains personal info (hasPersonalInfo)","em.entity.referenceOnly":"Reference only (not a generation or validation target)","em.entity.referenceOnlyHint":"For entities that are not deliverables — background material, scratch drafts. No DDL, Java code or mermaid is generated and validation skips them (they stay in the AI input text). Different from a group’s “Exclude from DDL generation”, which is for real tables owned by another service and still generates Java classes.","em.entity.headerColor":"Header color","em.attr.section":"Attributes ({n})","em.attr.addEmbeddable":"Add embeddable","em.attr.nameless":"(no name)","em.attr.selectHint":"Select an attribute above to show its edit form.","em.attr.inverseNavHint":"Inverse association field — no physical column (references the target entity).","em.attr.fkDerivedNote":"Derived from a foreign key — its shape follows the parent PK; change it on the association line or identifying relationship.","em.attr.scaleTypeHint":"Scale (fractional digits) applies only to NUMERIC and DECIMAL types.","em.attr.embedFixedHint":"Fixed by the embeddable definition.","em.attr.fkFixedHint":"Inherited from the parent PK column — its shape follows the parent.","em.attr.embedSharedHint":"Currency column shared with another column — derived from the target (read-only).","em.attr.derivedIdField":"Derived @Id field","em.attr.assocField":"Association field (@MapsId)","em.attr.derivedIdNote":"This attribute emits **two Java fields** — the name box above is the scalar @Id field (leave empty to derive it from the parent PK column), and this is the @MapsId association field. The same value is also editable from the relationship inspector.","em.attr.joinColumnOnlyNote":"Sibling column of a composite foreign key — JPA emits one field per association, so this name is never generated. Edit the field name on «{anchor}».","em.attr.namePlaceholder":"Name","em.attr.typePlaceholder":"Type","em.attr.customTypePlaceholder":"Custom type name","em.attr.logicalPlaceholder":"Logical name","em.attr.columnPlaceholder":"Column","em.attr.defaultValue":"Default value","em.attr.codeGroup":"Code group","em.attr.currencyColumn":"Currency column","em.attr.pii":"Personal info","em.attr.colFallback":"Column {n}","em.attr.sharedOwn":"Own column (OWN)","em.attr.sharedRef":"↗ {owner}{physical} ({mode})","em.attr.currencyMode":"currency","em.attr.sharedMode":"shared","em.attr.batchHint":"{n} selected · bulk","em.attr.fkDeleteHint":"Foreign keys are derived from associations — delete the association line instead","em.attr.embedConvertPkBlocked":"An identifier attribute cannot be converted to an embeddable with a different column count — changing the PK shape breaks child FKs that mirror it","em.op.section":"Operations ({n})","em.op.namePlaceholder":"Operation name","em.op.editBodyDirty":"Edit body ●","em.op.editBody":"Edit body","em.index.section":"Indexes ({n})","em.index.inherited":"{field} (inherited)","em.index.namePlaceholder":"Index name","em.index.addColumn":"Column","em.index.condition":"Condition (partial index)","em.index.conditionPlaceholder":"e.g. WHERE status = 'A'","em.groupCode.searchPlaceholder":"Search / select code group","em.groupCode.noMatch":"No matching code group","em.detail.tabBasics":"Basics","em.detail.tabColumns":"Attributes","em.detail.tabIndexes":"Indexes","em.detail.tabOperations":"Operations","em.detail.title":"Entity — {name}","em.attr.addDivider":"Divider","em.attr.columnPhysical":"Column (physical)","em.attr.constraints":"Constraints","em.attr.dividerLabelPlaceholder":"Divider label (optional)","em.attr.dividerNote":"── divider ──","em.attr.detailCollapse":"Collapse details","em.attr.detailExpand":"Expand details","em.attr.semanticLegend":"Semantics","em.attr.embedChildCols":"Embeddable — {n} child columns","em.attr.fkChildCols":"Composite foreign key — {n} columns","em.attr.overrideCollapse":"Collapse overrides","em.attr.overrideExpand":"Expand overrides","em.attr.overrideLegend":"Column overrides","em.attr.empty":"No attributes — create with 'Add'","em.op.body":"Body","em.op.bodyDirty":"Body ●","em.op.empty":"No operations — create with 'Add'","em.index.delete":"Delete index","em.index.empty":"No indexes — create with 'Add'","em.index.conditionPlaceholderWide":"e.g. WHERE status = 'A' AND deleted = false","em.index.inheritedColTitle":"Superclass inherited column","em.index.inheritedBadge":"inherited","em.index.colUnspecified":"{name} (column unspecified of {n})","em.index.multiColumn":"{name} ({n} columns)","em.index.unnamedAttr":"(unnamed)","em.index.availColumns":"Available columns ({n})","em.index.indexColumns":"Index columns ({n})","em.index.allColumnsUsed":"All columns used","em.index.addArrow":"Add →","em.index.moveUp":"Move up","em.index.moveDown":"Move down","em.index.removeColumn":"Remove","em.index.noColumns":"No columns — add from the left","em.index.selectPrompt":"Select or add an index.","em.palette.autoLayout":"Auto layout","em.cmd.title":"Command palette","em.cmd.placeholder":"Jump to an entity or run a command…","em.cmd.sectionGoto":"Go to","em.cmd.sectionActions":"Commands","em.cmd.empty":"No matches","em.cmd.groupTag":"Group","em.canvas.emptyTitle":"This diagram is empty","em.canvas.emptyHint":"<strong>Right-click</strong> the canvas or use the bottom-left <strong>+</strong> button to add your first entity.","em.canvas.emptyConnectHint":"Once you have two or more entities, <strong>drag</strong> from an entity edge to connect them with a relationship.","em.canvas.emptyShortcutHint":"Press <kbd>?</kbd> for keyboard shortcuts","em.canvas.emptyReadonly":"No entities to show","em.canvas.exportFailed":"Export failed","em.conflict.lockedTitle":"Editing is locked","em.conflict.missingDetail":"Your changes could not be saved (server or network error). Reload the latest content.","em.conflict.changedDetail":"This diagram was changed elsewhere, so editing is locked. Reload the latest content.","em.conflict.commandFailedDetail":"The edit could not be processed, so what you see is out of sync. Your saved content is unaffected — reload the latest content.","em.ctx.addEntity":"Add entity","em.ctx.addNote":"Add note","em.ctx.addGroup":"Add group","em.ctx.paste":"Paste","em.ctx.copy":"Copy","em.ctx.copyN":"Copy ({n})","em.ctx.editDetail":"Edit details…","em.ctx.viewDetail":"View details…","em.ctx.lock":"Lock","em.ctx.ungroup":"Ungroup","em.ctx.deleteNote":"Delete note","em.ctx.addAttr":"Add attribute","em.ctx.colorN":"Color ({n})","em.ctx.pasteAttr":"Paste attributes","em.ctx.pasteAttrN":"Paste attributes ({n})","em.ctx.deleteAttr":"Delete attribute","em.ctx.deleteAttrN":"Delete attributes ({n})","em.ctx.addOperation":"Add operation","em.ctx.deleteOperation":"Delete operation","em.ctx.addMethod":"Add method","em.ctx.groupInto":"Group together","em.ctx.addSelfAssoc":"Add self-association","em.ctx.addEmbeddableNamed":"Add embeddable: {label}","em.ctx.ungroupEntity":"Remove from group","em.ctx.deleteEntity":"Delete entity","em.ctx.clearWaypoints":"Clear bends","em.ctx.deleteConnection":"Delete connection","em.ctx.deleteAssociation":"Delete relation","em.node.keyPfk":"PFK (identifying foreign key)","em.node.keyPk":"PK (primary key)","em.node.keyFk":"FK (foreign key)","em.node.required":"Required (NOT NULL)","em.node.logicalMissing":"(logical name)","em.node.editLock":"Editing locked","em.node.connectHint":"Drag to connect a relationship to another entity","em.node.connectHintNode":"Drag to connect a relationship (anchored to the whole entity)","em.node.derivedIdRow":"Scalar @Id field emitted by a derived identifier (@MapsId). The model stores a single association attribute; edit it from that attribute’s inspector.","em.node.embedRepeatedShow":"Show {count} column(s) collapsed as identical within this entity","em.node.embedRepeatedHide":"Collapse columns repeated with the same value","em.node.embedAttrHide":"Collapse this embedded column group","em.node.embedAttrShow":"Show {count} collapsed embedded column(s)","em.node.embedAllHide":"Collapse every sub-column in this entity","em.node.embedAllShow":"Expand all collapsed sub-columns","em.node.embedAllSummary":"{n} sub-column(s) hidden","em.node.opsSummaryTitle":"{n} operations — expanded in Class display mode","em.node.opsSummary":"{n} operations","em.node.addAttr":"+ Attribute","em.node.addDivider":"+ Divider","em.group.ddlExcludeBadge":"DDL excluded","em.toolbar.referenceOnlyBadge":"Reference-only document","em.toolbar.referenceOnlyDocHint":"This entire document is not a generation or validation target. DDL, Java and mermaid exports come out empty and no validation signals appear — because it is out of scope, not because the model is empty (it stays in the AI input text). The dashed node borders on the canvas mean the same thing.","em.explorer.groupFallback":"(group)","em.explorer.associations":"Relations ({n})","em.explorer.notes":"Notes ({n})","em.explorer.emptyNote":"(empty note)","em.explorer.diagram":"Diagram","em.explorer.searchPlaceholder":"Search entities · attributes ( / )","em.explorer.treeAria":"Diagram tree","em.explorer.searchAria":"Search entities and attributes","em.explorer.clearSearchAria":"Clear search","em.explorer.clearSearchTitle":"Clear (Esc)","em.explorer.noMatches":"No matching entities or attributes","em.history.title":"Change history","em.history.refresh":"Refresh","em.history.loading":"Loading history…","em.history.loadError":"Failed to load history.","em.history.emptyLoaded":"No change history to show.","em.history.emptyNotLoaded":"Load history.","em.history.filterAll":"All","em.history.kindEdit":"Edit","em.history.kindRestore":"Restored","em.history.verbAdd":"Added","em.history.verbUpdate":"Updated","em.history.verbRemove":"Removed","em.history.assocFallback":"Relation","em.history.groupSubject":"Group {name}","em.history.noteSubject":"Note {name}","em.history.emptyValue":"(empty)","em.history.noChange":"No changes","em.history.summaryAdd":"{name} added","em.history.summaryRemove":"{name} removed","em.history.summaryFields":"{name} — {n} changes","em.history.summaryMore":"{summary} and {n} more","em.history.restoreFailed":"Restore failed: {reason}","em.history.unknown":"Unknown","em.history.confirmRestore":"Revert to this point.","em.history.doRestore":"Restore","em.history.cancel":"Cancel","em.history.restoreToHere":"Restore to this point","em.history.diff.compare":"Compare with current","em.history.diff.current":"current","em.history.diff.exit":"Exit comparison","em.history.diff.count":"{n} net change(s)","em.history.diff.empty":"No net changes in this range.","em.history.diff.restorePreview":"{n} change(s) will be rolled back","em.history.diff.restorePreviewNone":"Nothing to roll back.","em.history.loadMore":"Show older ({n})","em.history.periodLabel":"Period","em.history.periodFrom":"From","em.history.periodTo":"To","em.history.periodReset":"Clear period","em.check.catName":"Naming","em.check.catJpa":"JPA","em.check.catType":"Type","em.check.catDsn":"Design","em.check.name1":'Duplicate attribute name: "{name}"',"em.check.name2":'Duplicate column physical name: "{name}"',"em.check.name3Entity":'Duplicate entity name: "{name}" — another entity shares this name. JPA registers entity names across the whole persistence unit, so splitting packages (groups) will not resolve it',"em.check.name3Package":'Duplicate entity name: "{name}" — the same name exists in the same package. Rename it, or split the group (package)',"em.check.name4Entity":"Entity name is empty","em.check.name4Attr":"Attribute name is empty","em.check.name11Entity":'entity name "{name}" breaks the Java class convention (PascalCase) — codegen emits this name verbatim as the class name',"em.check.name11Attr":'attribute name "{name}" breaks the Java field convention (lowerCamelCase) — codegen emits this name verbatim as the field name',"em.check.name5":"Physical name exceeds {max} characters ({len}) — it may be truncated in some databases","em.check.name6Column":'Column physical name is a SQL reserved word: "{name}"',"em.check.name6Table":'Table physical name is a SQL reserved word: "{name}"',"em.check.name6Index":'Index name is a SQL reserved word: "{name}"',"em.check.name7":"the relation/embed attribute ({attrType}) has no name — the name is the JPA field name, so codegen omits this relationship entirely. Fill in the attribute name","em.check.name8":'attribute "{name}" has no column physical name — DDL and codegen omit this column entirely. Fill in the physical name',"em.check.name9":'two entities map to the same table "{name}" — their columns collide in one table. Give them distinct table physical names',"em.check.name10":'duplicate index name: "{name}" — index names must be unique across the whole DB schema',"em.entity.valueTypeSwitchEmbedded":'"{name}" is currently embedded by {owners} entit(y/ies), so it cannot be switched directly between a serialized type and an embeddable — remove the embedded attributes first (a serialized type is referenced by type, not by a relation)',"em.attr.serializedNoColumnNote":"A serialized type has no per-field physical columns — it is serialized whole into a single column on the consuming attribute","em.attr.serializedContainer":"Container","em.attr.serializedContainerNone":"None (single value)","em.entity.noOwnTableNote":"A value type has no table of its own — an embeddable is flattened into the owner table, and a serialized type is serialized into a single column on the consuming attribute","em.entity.serializedTypeHasRelations":'"{name}" participates in {count} relationship(s), so it cannot be turned into a serialized type — remove those relationships first (a serialized type is referenced by an attribute type, not by a relationship)',"em.entity.serializedContainer":"Container","em.entity.serializedContainerNone":"none (single value)","em.entity.serializedMapKey":"Map key type","em.entity.serializedMapKeyPlaceholder":"e.g. PromoType (unset → codegen emits a placeholder Object + fill-in)","em.entity.noIndexNote":"A serialized type cannot have indexes — an index is placed on columns, and this type is serialized whole into a single column on the consuming attribute","em.check.jpa1":"JPA entity has no identifier (PK) attribute","em.check.jpa2":'A value type (embeddable / 직렬화 타입) cannot have an identifier attribute: "{name}"',"em.check.jpa4":"Identifying relationship cycle (PK depends on itself infinitely): {path}","em.check.jpa5":"{which}: cascade ALL is redundant with individual cascades (ALL includes them all)","em.check.jpa7":"{which}: EAGER fetch on a collection (to-many) association is a performance risk","em.check.jpa8":"JPA entity has no table physical name set","em.check.jpa9":"{which}: collection metadata (collectionType/collectionTable/orderColumn) is meaningless on a to-one association — @ElementCollection applies only to collections","em.check.jpa10":"{which}: a SET collection does not preserve order, so orderColumn (@OrderColumn) is meaningless","em.check.jpa11":"An embed (@Embedded/@ElementCollection) cannot be an identifying relationship — embeddables have no independent identifier","em.check.jpa12":'An identifier (@Id) attribute cannot be transient (@Transient): "{name}"',"em.check.jpa13AutoIncrement":'Auto increment can only be used on an identifier (@Id) attribute — it is set on non-identifier attribute "{name}"',"em.check.jpa13Sequence":'A sequence ("{seq}") can only be used on an identifier (@Id) attribute — it is set on non-identifier attribute "{name}"',"em.check.jpa14":"{which}: orphanRemoval cannot be applied to a @ManyToOne/@ManyToMany association (the other end is a collection) — it is valid only on @OneToOne/@OneToMany","em.check.jpa15":'An identifier (@Id) attribute cannot be a natural id (@NaturalId) — a natural id is a business key distinct from the PK: "{name}"',"em.check.jpa16":'A natural id (@NaturalId) attribute cannot be transient (@Transient): "{name}"',"em.check.jpa17":'A natural id (@NaturalId) attribute should be not null (business keys are non-null by principle): "{name}"',"em.check.jpa18":"cascade is set on both ends of the relationship, so operations propagate both ways — risk of unintended cascading persist/remove or cascade cycles. cascade is usually placed on one side only","em.check.jpa19":"the parent has a collection/reference field but the child ({child}) has no matching relation attribute, so mappedBy cannot be resolved — codegen skips this relationship. Add an FK attribute on the child or make the relationship unidirectional","em.check.jpa20":'a composite PK (@IdClass/@EmbeddedId) cannot use generation (@GeneratedValue) — it is set on attribute "{name}"',"em.check.jpa21Missing":'embedded "{name}" has fewer columns than the embeddable ({embeddable}) declares — {slots} slots / {declared} declared. Columns added later are not reflected and are dropped from the DDL (JPA maps columns per the embeddable declaration)',"em.check.jpa21Extra":'embedded "{name}" has more columns than the embeddable ({embeddable}) declares — {slots} slots / {declared} declared. Columns removed from the embeddable linger and emit DDL columns that no longer exist',"em.check.type1":'Column type not supported by the target DB: "{dataType}"',"em.check.type2":"No length specified for type {dataType}","em.check.type3":"The shared target column type ({targetType}) differs from the {metaName} definition ({metaType})","em.check.type4":"A Multi-Value attribute gets an auto-generated converter only for the GroupCodeEnum + VARCHAR combination — currently ({type} / {dataType}) only a Set<…> field is generated and the mapping may be incomplete","em.check.type6":'the column of attribute "{name}" has no data type — DDL omits this column',"em.check.type7":"The Java type ({type}) and the column type ({dataType}) are not compatible — the codegen field and the DDL column are emitted with different types","em.check.type8":"A nullable column ({dataType}) is mapped to a primitive type ({type}) — reading a NULL from the DB throws at load time. Mark it NOT NULL or switch to the boxed type ({boxed})","em.check.dsn1":"A both-many (M:N) relationship is connected directly without a join entity — consider introducing an association entity","em.check.dsn2":"Entity has no attributes","em.check.dsn3":"No modeled relationship (not part of any association, inheritance, or embedding — ignore if intentional)","em.check.dsn4":"Has {count} attributes (over the threshold of {threshold}) — consider decomposing","em.check.dsn5Inherited":'Index "{name}" references an inherited column not found in the superclass catalog ({field}).',"em.check.dsn5Missing":'Index "{name}" references a column that does not exist.',"em.check.dsn6":'index "{name}" has no columns — an index without columns is not emitted in DDL or codegen',"em.check.dsn7":'index "{name}" lists the same column more than once — the repeated entries have no effect',"em.check.unspecified":"unspecified"},yh={"em.mode.view":"閲覧","em.mode.edit":"編集","em.mode.frozen":"編集ロック(競合)","em.mode.frozenTitle":"同時編集の競合により編集がロックされています。最新の内容を再読み込み中です。","em.mode.readonlyTitle":"このダイアグラムは閲覧専用です","em.toolbar.undo":"元に戻す","em.toolbar.redo":"やり直し","em.toolbar.displayLabel":"表示","em.toolbar.routingToggle":"接続線モード切替","em.toolbar.routingOrthogonal":"直角","em.toolbar.routingStraight":"直線","em.toolbar.grid":"グリッド","em.toolbar.gridOn":"グリッド表示","em.toolbar.gridOff":"グリッド非表示","em.toolbar.minimap":"ミニマップ","em.toolbar.minimapOn":"ミニマップ表示","em.toolbar.minimapOff":"ミニマップ非表示","em.toolbar.fitView":"全体表示","em.toolbar.exportText":"エクスポート(テキスト · Mermaid)","em.toolbar.exportSvg":"SVG エクスポート","em.toolbar.exportPng":"PNG エクスポート","em.toolbar.import":"インポート(テキスト貼り付け)","em.toolbar.history":"履歴","em.toolbar.historyOpen":"変更履歴を開く","em.toolbar.historyClose":"変更履歴を閉じる","em.toolbar.shortcuts":"キーボードショートカット (?)","em.displayMode.logical":"論理","em.displayMode.physical":"物理","em.displayMode.logicalPhysical":"論理・物理","em.displayMode.class":"クラス","em.panel.resizeWidth":"幅を調整","em.panel.collapse":"折りたたむ","em.panel.expand":"展開","em.panel.collapseAll":"すべて折りたたむ","em.panel.expandAll":"すべて展開","em.panel.lockedBanner":"編集ロック — 移動・編集・削除は不可","em.panel.openNamed":"{name} を開く","em.notice.readOnly":"照会モードでは編集できません","em.notice.entityLocked":"このエンティティはロックされています — 解除してから編集してください","em.notice.groupLocked":"このグループはロックされています — 解除してから編集してください","em.notice.assocLocked":"ロックされたエンティティに接続された関連です — 解除してから編集してください","em.validation.title":"検証","em.validation.noIssues":"検証の問題はありません。","em.validation.noVisibleIssues":"表示する問題はありません(フィルター適用中)。","em.validation.checkOrphanEntities":"関連のないエンティティを検査","em.validation.nameless":"(名前なし)","em.validation.severityError":"エラー","em.validation.severityWarning":"警告","em.validation.severityInfo":"情報","em.validation.hideSeverity":"{label} を非表示","em.validation.showSeverity":"{label} を表示","em.validation.expandPanel":"検証パネルを展開","em.validation.quickFix":"修正","em.validation.quickFixTip":"自動修正を適用(元に戻せます)","em.common.close":"閉じる","em.common.save":"保存","em.export.title":"エクスポート","em.export.formatText":"論理モデルテキスト","em.export.formatMermaidEr":"Mermaid (ER)","em.export.formatMermaidClass":"Mermaid (クラス)","em.export.formatDdl":"SQL DDL (PostgreSQL)","em.export.formatJson":"JSON (バックアップ)","em.export.copy":"コピー","em.export.download":"ダウンロード","em.export.copied":"クリップボードにコピーしました。","em.export.copyFailed":"コピーに失敗しました。","em.import.title":"インポート","em.import.placeholder":"SQL DDL・Mermaid ER・JSON バックアップを貼り付けてください。","em.import.formatGroup":"入力形式","em.import.formatAuto":"自動判定","em.import.formatMermaid":"Mermaid ER","em.import.formatDdl":"SQL DDL","em.import.formatJson":"JSON","em.import.detected":"判定: {format}","em.import.summary":"エンティティ {entities} · 関連 {relations}","em.import.warnings":"警告 {n}件(部分パース)","em.import.error":"パース失敗: {message}","em.import.emptyParse":"認識されたエンティティがありません。","em.import.unknownFormat":"フォーマットを判定できませんでした — 上で選択してください。","em.import.confirm":"インポート","em.import.commentLocale":"コメントロケール","em.import.commentLocaleUnset":"未指定 — 論理名は取り込まない","em.import.commentEvidence":"COMMENT {n}件 — 韓国語(ハングル) {hangul} · 日本語(かな) {kana} · 判別不可 {undecidable}","em.import.commentCertain":"{locale} 確定","em.import.commentMixed":"混在 — ロケールごとに分けて取り込みを推奨","em.import.commentUnknown":"判別不可 — 原文の言語が分かる人が指定","em.import.commentMarker":"テキストが示すロケール: {locale}","em.shortcuts.title":"キーボードショートカット","em.shortcuts.groupEdit":"編集","em.shortcuts.groupMove":"移動・整列","em.shortcuts.groupExplorer":"エクスプローラー","em.shortcuts.descExplorerSearch":"エクスプローラー検索へフォーカス","em.shortcuts.descExplorerNav":"ツリー移動(←→ 折りたたみ・展開)","em.shortcuts.descExplorerSelect":"項目を選択+キャンバス移動","em.shortcuts.descExplorerDetail":"エンティティ詳細編集を開く","em.shortcuts.groupOther":"その他","em.shortcuts.keyArrows":"矢印キー","em.shortcuts.keyRightClick":"右クリック","em.shortcuts.descUndo":"元に戻す","em.shortcuts.descRedo":"やり直し","em.shortcuts.descCopy":"選択をコピー","em.shortcuts.descPaste":"貼り付け","em.shortcuts.descDelete":"選択項目を削除(Backspace と同じ)","em.shortcuts.descMove1":"選択ノードを1px移動","em.shortcuts.descMove10":"選択ノードを10px移動","em.shortcuts.descAttrFocus":"属性選択時にフォーカス移動","em.shortcuts.descAttrReorder":"属性の順序を上下","em.shortcuts.descContextMenu":"コンテキストメニュー(エンティティ・ノート追加など)","em.shortcuts.descInlineConfirm":"インライン編集を確定","em.shortcuts.descCloseEdit":"編集・メニューを閉じる","em.shortcuts.descOpenHelp":"このヘルプを開く","em.shortcuts.descCommandPalette":"コマンドパレット(移動・コマンド実行)","em.opSource.title":"本文 — {name}()","em.opSource.placeholder":"// Java 実装コード","em.entity.name":"名前","em.entity.stereotype":"ステレオタイプ","em.entity.package":"パッケージ","em.panel.unlock":"ロック解除","em.entity.fallback":"エンティティ","em.group.fallback":"グループ","em.common.description":"説明","em.common.memo":"メモ","em.common.color":"色","em.common.add":"追加","em.common.inherit":"デフォルト(継承)","em.common.noneParen":"(なし)","em.swatch.none":"なし","em.swatch.red":"赤","em.swatch.amber":"オレンジ","em.swatch.green":"緑","em.swatch.teal":"青緑","em.swatch.blue":"青","em.swatch.indigo":"藍","em.swatch.violet":"紫","em.swatch.pink":"ピンク","em.inspector.ctxEntityAttrs":"エンティティ · {name} › 属性 · {n}件","em.inspector.ctxEntityDivider":"エンティティ · {name} › 区切り線","em.inspector.ctxEntityAttr":"エンティティ · {name} › 属性 · {attr}","em.inspector.ctxEntity":"エンティティ · {name}","em.inspector.ctxAssoc":"関連 · {a} — {b}","em.inspector.ctxGroup":"グループ · {name}","em.inspector.ctxNote":"ノート","em.inspector.ctxNone":"選択項目なし","em.assoc.identifying":"identifying(識別関連)","em.assoc.selfNoIdentifying":"自己関連は識別関連にできません(非識別 FK を強制)。","em.assoc.embedNoIdentifying":"埋め込み(@Embedded/@ElementCollection)は識別関連にできません(埋め込み可能クラスは独立した識別子を持ちません)。","em.assoc.multiplicity":"多重度","em.assoc.navFieldName":"関連フィールド名(nav)","em.assoc.cascadeAllNote":"ALL は個別の cascade をすべて含みます(CHK-JPA-5)。","em.assoc.orphanRemovalNote":"相手側がコレクション(@ManyToOne/@ManyToMany)のため orphanRemoval は無効です(CHK-JPA-14)。","em.assoc.navRequiredNote":"この方向に nav プロパティがない(navigable オフ)ため cascade・fetch は適用されません。","em.assoc.ownerNavFixed":"JPA 所有側参照(@ManyToOne)はリレーションの存在と同義で常にオンです — 参照なしの FK はリレーションではなく通常のカラムとしてモデリングしてください。","em.assoc.orderByPlaceholder":"例: name ASC","em.assoc.jpaDetails":"JPA 詳細","em.embed.legend":"埋め込み","em.embed.cardinality":"カーディナリティ","em.embed.card1":"1(必須 @Embedded)","em.embed.card01":"0..1(任意 @Embedded)","em.embed.card0N":"0..*(コレクション @ElementCollection)","em.embed.collectionTablePlaceholder":"未指定時はコード生成のフォールバック","em.embed.orderColumnPlaceholder":"未指定時は順序を保持しません","em.embed.ownerFixedNote":"埋め込み可能クラスは所有者にフラット化されるため、所有者側の end(多重度・navigable・composition)は構造的に固定であり表示しません。","em.group.nameLegend":"グループ名","em.group.excludeDDL":"DDL 生成から除外","em.group.members":"メンバーエンティティ {n}件","em.entity.classLegend":"クラス","em.entity.superClass":"親クラス","em.entity.superClassPlaceholder":"例: BaseEntity","em.entity.interfaces":"実装インターフェース","em.entity.interfacesPlaceholder":"カンマ区切り(例: Serializable, Cloneable)","em.entity.abstractClass":"抽象クラス","em.entity.tablePhysical":"テーブル(物理)","em.entity.schema":"スキーマ","em.entity.schemaPlaceholder":"例: sales, master","em.entity.tableLogicalLegend":"テーブル論理名","em.entity.classLogicalLegend":"クラス論理名","em.entity.discColumn":"Discriminator カラム名","em.entity.discColumnPlaceholder":"例: DTYPE","em.entity.discType":"Discriminator タイプ","em.entity.discLength":"Discriminator 長さ","em.entity.hasPersonalInfo":"個人情報を含む(hasPersonalInfo)","em.entity.referenceOnly":"参考専用(生成・検証の対象外)","em.entity.referenceOnlyHint":"成果物ではないエンティティ(理解のための資料・テスト下書きなど)。DDL・Java コード・mermaid を生成せず、検証の対象からも外れます(AI 入力テキストには残ります)。グループの「DDL 生成から除外」とは別です — あちらは他サービスが所有する実在テーブル向けで、Java クラスは生成され続けます。","em.entity.headerColor":"ヘッダー色","em.attr.section":"属性 ({n})","em.attr.addEmbeddable":"埋め込み追加","em.attr.nameless":"(名前なし)","em.attr.selectHint":"上のリストから属性を選択すると編集フォームが表示されます。","em.attr.inverseNavHint":"逆方向の関連フィールド — 物理カラムはありません(対象エンティティを参照)。","em.attr.fkDerivedNote":"外部キー(FK)から派生したカラムです — 形状は親のPKに従います。変更は関連線・識別関連で行ってください。","em.attr.scaleTypeHint":"小数部(scale)はNUMERIC・DECIMAL型にのみ適用されます。","em.attr.embedFixedHint":"埋め込み型の定義で固定された値です。","em.attr.fkFixedHint":"親のPKカラムから継承された値です — 形状は親に従います。","em.attr.embedSharedHint":"他のカラムと共有する通貨カラムです — 対象から派生(読み取り専用)。","em.attr.derivedIdField":"派生識別 @Id フィールド","em.attr.assocField":"関連フィールド名(@MapsId)","em.attr.derivedIdNote":"この属性は**2つの Java フィールド**を出力します — 上の名前欄はスカラー @Id のフィールド名(空欄なら親 PK の物理名から派生)で、こちらは @MapsId 関連フィールド名です。同じ値は関連線のインスペクタからも編集できます。","em.attr.joinColumnOnlyNote":"複合外部キーの兄弟カラムです — JPAのフィールドは関連ごとに1つだけなので、この名前は出力されません。フィールド名は«{anchor}»で編集してください。","em.attr.namePlaceholder":"名前","em.attr.typePlaceholder":"タイプ","em.attr.customTypePlaceholder":"カスタムタイプ名","em.attr.logicalPlaceholder":"論理名","em.attr.columnPlaceholder":"カラム","em.attr.defaultValue":"デフォルト値","em.attr.codeGroup":"コードグループ","em.attr.currencyColumn":"通貨カラム","em.attr.pii":"個人情報","em.attr.colFallback":"カラム {n}","em.attr.sharedOwn":"専用カラム(OWN)","em.attr.sharedRef":"↗ {owner}{physical}({mode})","em.attr.currencyMode":"通貨","em.attr.sharedMode":"共有","em.attr.batchHint":"選択 {n}件 一括","em.attr.fkDeleteHint":"外部キーは関連から派生します — 関連線を削除してください","em.attr.embedConvertPkBlocked":"識別子属性は列数が変わる埋め込み型には変換できません — PK の形が変わると、それを写す子の FK が崩れます","em.op.section":"オペレーション ({n})","em.op.namePlaceholder":"オペレーション名","em.op.editBodyDirty":"本文編集 ●","em.op.editBody":"本文編集","em.index.section":"インデックス ({n})","em.index.inherited":"{field}(継承)","em.index.namePlaceholder":"インデックス名","em.index.addColumn":"カラム","em.index.condition":"条件(partial index)","em.index.conditionPlaceholder":"例: WHERE status = 'A'","em.groupCode.searchPlaceholder":"コードグループ検索/選択","em.groupCode.noMatch":"一致するコードグループがありません","em.detail.tabBasics":"基本","em.detail.tabColumns":"属性","em.detail.tabIndexes":"インデックス","em.detail.tabOperations":"オペレーション","em.detail.title":"エンティティ — {name}","em.attr.addDivider":"区切り線","em.attr.columnPhysical":"カラム(物理)","em.attr.constraints":"制約","em.attr.dividerLabelPlaceholder":"区切り線ラベル(任意)","em.attr.dividerNote":"── 視覚区切り ──","em.attr.detailCollapse":"詳細を折りたたむ","em.attr.detailExpand":"詳細を展開","em.attr.semanticLegend":"意味","em.attr.embedChildCols":"埋め込み可能 — 子カラム {n}件","em.attr.fkChildCols":"複合外部キー — カラム {n}件","em.attr.overrideCollapse":"オーバーライドを折りたたむ","em.attr.overrideExpand":"オーバーライドを展開","em.attr.overrideLegend":"カラムオーバーライド","em.attr.empty":"属性なし — 「追加」で作成","em.op.body":"本文","em.op.bodyDirty":"本文 ●","em.op.empty":"オペレーションなし — 「追加」で作成","em.index.delete":"インデックス削除","em.index.empty":"インデックスなし — 「追加」で作成","em.index.conditionPlaceholderWide":"例: WHERE status = 'A' AND deleted = false","em.index.inheritedColTitle":"スーパークラス継承カラム","em.index.inheritedBadge":"継承","em.index.colUnspecified":"{name} (カラム{n}個のうち未指定)","em.index.multiColumn":"{name} (カラム{n}個)","em.index.unnamedAttr":"(名称なし)","em.index.availColumns":"利用可能カラム ({n})","em.index.indexColumns":"インデックスカラム ({n})","em.index.allColumnsUsed":"全カラム使用済み","em.index.addArrow":"追加 →","em.index.moveUp":"上へ","em.index.moveDown":"下へ","em.index.removeColumn":"削除","em.index.noColumns":"カラムなし — 左から追加","em.index.selectPrompt":"インデックスを選択または追加してください。","em.palette.autoLayout":"自動配置","em.cmd.title":"コマンドパレット","em.cmd.placeholder":"エンティティへ移動、またはコマンド実行…","em.cmd.sectionGoto":"移動","em.cmd.sectionActions":"コマンド","em.cmd.empty":"一致する項目がありません","em.cmd.groupTag":"グループ","em.canvas.emptyTitle":"空のダイアグラムです","em.canvas.emptyHint":"キャンバスを<strong>右クリック</strong>するか、左下の<strong>+</strong>ボタンで最初のエンティティを追加してください。","em.canvas.emptyConnectHint":"エンティティを2つ以上作成すると、エンティティの端から<strong>ドラッグ</strong>して関連を接続できます。","em.canvas.emptyShortcutHint":"ショートカットのヘルプは<kbd>?</kbd>キー","em.canvas.emptyReadonly":"表示するエンティティがありません","em.canvas.exportFailed":"エクスポートに失敗しました","em.conflict.lockedTitle":"編集がロックされました","em.conflict.missingDetail":"変更を保存できませんでした(サーバーまたはネットワークエラー)。最新の内容を再読み込みしてください。","em.conflict.changedDetail":"他の場所で変更されたため、編集がロックされました。最新の内容を再読み込みしてください。","em.conflict.commandFailedDetail":"編集を処理できず、表示内容が食い違っています。保存済みの内容はそのままです。最新の内容を再読み込みしてください。","em.ctx.addEntity":"エンティティ追加","em.ctx.addNote":"ノート追加","em.ctx.addGroup":"グループ追加","em.ctx.paste":"貼り付け","em.ctx.copy":"コピー","em.ctx.copyN":"コピー ({n})","em.ctx.editDetail":"詳細編集…","em.ctx.viewDetail":"詳細表示…","em.ctx.lock":"ロック","em.ctx.ungroup":"グループ解除","em.ctx.deleteNote":"ノート削除","em.ctx.addAttr":"属性追加","em.ctx.colorN":"色 ({n})","em.ctx.pasteAttr":"属性貼り付け","em.ctx.pasteAttrN":"属性貼り付け ({n})","em.ctx.deleteAttr":"属性削除","em.ctx.deleteAttrN":"属性削除 ({n})","em.ctx.addOperation":"オペレーション追加","em.ctx.deleteOperation":"オペレーション削除","em.ctx.addMethod":"メソッド追加","em.ctx.groupInto":"グループ化","em.ctx.addSelfAssoc":"自己関連追加","em.ctx.addEmbeddableNamed":"埋め込み追加: {label}","em.ctx.ungroupEntity":"グループから外す","em.ctx.deleteEntity":"エンティティ削除","em.ctx.clearWaypoints":"折れ線を解除","em.ctx.deleteConnection":"接続削除","em.ctx.deleteAssociation":"関連削除","em.node.keyPfk":"PFK(識別外部キー)","em.node.keyPk":"PK(主キー)","em.node.keyFk":"FK(外部キー)","em.node.required":"必須(NOT NULL)","em.node.logicalMissing":"(論理名)","em.node.editLock":"編集ロック","em.node.connectHint":"ドラッグして他のエンティティと関連を接続","em.node.connectHintNode":"ドラッグして関連を接続(エンティティ全体を始点に)","em.node.derivedIdRow":"派生識別(@MapsId)が出力するスカラー @Id フィールドです — モデルには関連属性ひとつとして保存され、編集はその属性のインスペクタで行います。","em.node.embedRepeatedShow":"このエンティティ内で値が同じため折りたたまれた列 {count} 件を表示","em.node.embedRepeatedHide":"値が同じで繰り返される列を折りたたむ","em.node.embedAttrHide":"この埋め込み列グループを折りたたむ","em.node.embedAttrShow":"折りたたまれた埋め込み列 {count} 件を表示","em.node.embedAllHide":"このエンティティのサブカラムをすべて折りたたむ","em.node.embedAllShow":"折りたたまれたサブカラムをすべて展開","em.node.embedAllSummary":"サブカラム {n} 件を非表示","em.node.opsSummaryTitle":"オペレーション {n}件 — クラス表示モードで展開されます","em.node.opsSummary":"オペレーション {n}件","em.node.addAttr":"+ 属性","em.node.addDivider":"+ 区切り線","em.group.ddlExcludeBadge":"DDL 除外","em.toolbar.referenceOnlyBadge":"参考専用ドキュメント","em.toolbar.referenceOnlyDocHint":"このドキュメント全体が生成・検証の対象ではありません。DDL・Java・mermaid の書き出しは空になり検証シグナルも出ません — モデルが空だからではなく対象外だからです(AI 入力テキストには残ります)。キャンバスの破線枠も同じ意味です。","em.explorer.groupFallback":"(グループ)","em.explorer.associations":"関連 ({n})","em.explorer.notes":"ノート ({n})","em.explorer.emptyNote":"(空のノート)","em.explorer.diagram":"ダイアグラム","em.explorer.searchPlaceholder":"エンティティ・属性検索 ( / )","em.explorer.treeAria":"ダイアグラムツリー","em.explorer.searchAria":"エンティティ・属性検索","em.explorer.clearSearchAria":"検索語をクリア","em.explorer.clearSearchTitle":"クリア (Esc)","em.explorer.noMatches":"一致するエンティティ・属性がありません","em.history.title":"変更履歴","em.history.refresh":"更新","em.history.loading":"履歴を読み込み中…","em.history.loadError":"履歴を読み込めませんでした。","em.history.emptyLoaded":"表示する変更履歴がありません。","em.history.emptyNotLoaded":"履歴を読み込んでください。","em.history.filterAll":"すべて","em.history.kindEdit":"編集","em.history.kindRestore":"復元","em.history.verbAdd":"追加","em.history.verbUpdate":"変更","em.history.verbRemove":"削除","em.history.assocFallback":"関連","em.history.groupSubject":"グループ {name}","em.history.noteSubject":"ノート {name}","em.history.emptyValue":"(空)","em.history.noChange":"変更なし","em.history.summaryAdd":"{name} 追加","em.history.summaryRemove":"{name} 削除","em.history.summaryFields":"{name} {n}件変更","em.history.summaryMore":"{summary} 他 {n}件","em.history.restoreFailed":"復元失敗: {reason}","em.history.unknown":"不明","em.history.confirmRestore":"この時点に戻します。","em.history.doRestore":"復元","em.history.cancel":"キャンセル","em.history.restoreToHere":"この時点に復元","em.history.diff.compare":"現在と比較","em.history.diff.current":"現在","em.history.diff.exit":"比較を解除","em.history.diff.count":"累積変更 {n}件","em.history.diff.empty":"この区間に累積変更はありません。","em.history.diff.restorePreview":"巻き戻される変更 {n}件","em.history.diff.restorePreviewNone":"巻き戻される変更はありません。","em.history.loadMore":"以前の記録をもっと見る ({n})","em.history.periodLabel":"期間","em.history.periodFrom":"開始日","em.history.periodTo":"終了日","em.history.periodReset":"期間クリア","em.check.catName":"名前","em.check.catJpa":"JPA","em.check.catType":"型","em.check.catDsn":"設計","em.check.name1":'属性名が重複しています: "{name}"',"em.check.name2":'カラム物理名が重複しています: "{name}"',"em.check.name3Entity":'エンティティ名が重複しています: "{name}" — 同名のエンティティが他にもあります。JPA はエンティティ名を永続化ユニット全体に登録するため、パッケージ(グループ)を分けても解消しません',"em.check.name3Package":'エンティティ名が重複しています: "{name}" — 同じパッケージに同じ名前があります。名前を変えるか、グループ(パッケージ)を分けると解消します',"em.check.name4Entity":"エンティティ名が空です","em.check.name4Attr":"属性名が空です","em.check.name11Entity":"エンティティ名「{name}」がJavaクラス規約(PascalCase)から外れています — コード生成はこの名前をそのままクラス名として出力します","em.check.name11Attr":"属性名「{name}」がJavaフィールド規約(lowerCamelCase)から外れています — コード生成はこの名前をそのままフィールド名として出力します","em.check.name5":"物理名が{max}文字を超えています({len}文字)— 一部のDBで切り詰められる可能性があります","em.check.name6Column":'カラム物理名がSQL予約語です: "{name}"',"em.check.name6Table":'テーブル物理名がSQL予約語です: "{name}"',"em.check.name6Index":'インデックス名がSQL予約語です: "{name}"',"em.check.name7":"関係/埋め込み属性({attrType})の名前が空です — 名前がそのまま JPA フィールド名になるため、コード生成でこの関係が丸ごと欠落します。属性名を入力してください","em.check.name8":"属性「{name}」のカラム物理名が空です — DDL・コード生成でこのカラムが丸ごと欠落します。物理名を入力してください","em.check.name9":"2つのエンティティが同じテーブル「{name}」にマッピングされています — カラムが1つのテーブルに混在します。テーブル物理名を分けてください","em.check.name10":"インデックス名が重複しています:「{name}」 — インデックス名は DB スキーマ全体で一意である必要があります","em.entity.valueTypeSwitchEmbedded":'"{name}" は現在 {owners} 件のエンティティに組み込まれているため、シリアライズ型と組込み可能の間を直接切り替えられません — 先に組込み属性を整理してください(シリアライズ型は関係ではなく型参照で指定されます)',"em.attr.serializedNoColumnNote":"シリアライズ型はフィールドごとの物理カラムを持ちません — 利用側属性の単一カラムにまとめてシリアライズされます","em.attr.serializedContainer":"コンテナ","em.attr.serializedContainerNone":"なし (単一値)","em.entity.noOwnTableNote":"値型は自身のテーブルを持ちません — 組込み可能は所有者テーブルに展開され、シリアライズ型は利用側属性の単一カラムにシリアライズされます","em.entity.serializedTypeHasRelations":'"{name}" は {count} 件の関連に参加しているためシリアライズ型に変更できません — 先に関連を整理してください(シリアライズ型は関係ではなく属性の型参照で指定されます)',"em.entity.serializedContainer":"コンテナ","em.entity.serializedContainerNone":"なし(単一値)","em.entity.serializedMapKey":"Map キー型","em.entity.serializedMapKeyPlaceholder":"例: PromoType(未指定ならコード生成が仮の Object + 手入力箇所を出す)","em.entity.noIndexNote":"シリアライズ型はインデックスを持てません — インデックスはカラムに張られますが、この型は利用側属性の単一カラムにまとめてシリアライズされます","em.check.jpa1":"JPAエンティティに識別子(PK)属性がありません","em.check.jpa2":'値型(組込み可能・シリアライズ型)は識別子属性を持てません: "{name}"',"em.check.jpa4":"識別関係の循環です(PKが自身に無限依存): {path}","em.check.jpa5":"{which}: cascade ALLが個別のcascadeと重複しています(ALLがすべて含む)","em.check.jpa7":"{which}: コレクション(to-many)関連へのEAGERフェッチは性能リスクがあります","em.check.jpa8":"JPAエンティティにテーブル物理名が設定されていません","em.check.jpa9":"{which}: 単一(to-one)関連にコレクションメタ(collectionType/collectionTable/orderColumn)は無意味です — @ElementCollectionはコレクションにのみ適用されます","em.check.jpa10":"{which}: SETコレクションは順序を保持しないため、orderColumn(@OrderColumn)は無意味です","em.check.jpa11":"組込み(@Embedded/@ElementCollection)は識別関係にできません — 組込み可能型には独立した識別子がありません","em.check.jpa12":'識別子(@Id)属性はtransient(@Transient)にできません: "{name}"',"em.check.jpa13AutoIncrement":'採番(auto increment)は識別子(@Id)属性にのみ使えます — 非識別属性 "{name}" に設定されています',"em.check.jpa13Sequence":'採番(シーケンス "{seq}")は識別子(@Id)属性にのみ使えます — 非識別属性 "{name}" に設定されています',"em.check.jpa14":"{which}: orphanRemovalは@ManyToOne/@ManyToMany(相手側がコレクション)関連には適用できません — @OneToOne/@OneToManyでのみ有効です","em.check.jpa15":'識別子(@Id)属性は自然キー(@NaturalId)にできません — 自然キーはPKとは別のビジネスキーです: "{name}"',"em.check.jpa16":'自然キー(@NaturalId)属性はtransient(@Transient)にできません: "{name}"',"em.check.jpa17":'自然キー(@NaturalId)属性はnot nullが推奨されます(ビジネスキーはnon-nullが原則): "{name}"',"em.check.jpa18":"cascade が関係の両端(親・子)に設定され双方向に伝播します — 意図しない連鎖 persist/remove や伝播サイクルの危険があります。通常 cascade は片側のみに設定します","em.check.jpa19":"親にコレクション/参照フィールドがありますが、子({child})に対応する関係属性がないため mappedBy を解決できません — コード生成はこの関係を出力しません。子に FK 属性を作るか、関係を単方向に整理してください","em.check.jpa20":"複合PK(@IdClass/@EmbeddedId)には採番(@GeneratedValue)を使用できません — 属性「{name}」に設定されています","em.check.jpa21Missing":"埋め込み「{name}」の列が埋め込み可能クラス({embeddable})の宣言より少ないです — スロット {slots} / 宣言 {declared}。後から追加された列が反映されず DDL から漏れます(JPA は埋め込み可能クラスの宣言どおりに列を生成します)","em.check.jpa21Extra":"埋め込み「{name}」の列が埋め込み可能クラス({embeddable})の宣言より多いです — スロット {slots} / 宣言 {declared}。埋め込み可能クラスで削除された列が残り、存在しない列を DDL に出力します","em.check.type1":'ターゲットDBがサポートしないカラム型です: "{dataType}"',"em.check.type2":"{dataType}型にlengthが指定されていません","em.check.type3":"共有先カラムの型({targetType})が{metaName}の定義({metaType})と異なります","em.check.type4":"マルチ値(Multi-Value)属性はGroupCodeEnum + VARCHARの組み合わせでのみコンバータが自動生成されます — 現在({type} / {dataType})ではSet<…>フィールドのみ生成され、マッピングが不完全になる可能性があります","em.check.type6":"属性「{name}」のカラムにデータ型が指定されていません — DDL でこのカラムは出力されません","em.check.type7":"Java型({type})とカラム型({dataType})が互換ではありません — コード生成のフィールドと DDL のカラムが異なる型で出力されます","em.check.type8":"NULL 許容カラム({dataType})がプリミティブ型({type})にマッピングされています — DB の NULL を読み込んだ瞬間に例外が発生します。NOT NULL を指定するか、ボックス型({boxed})に変更してください","em.check.dsn1":"both-many(M:N)関係を結合エンティティなしで直接接続しています — 関連エンティティの導入を検討してください","em.check.dsn2":"属性が一つもないエンティティです","em.check.dsn3":"モデル化された関係がありません(関連・継承・組込みに未参加 — 意図的な省略なら無視)","em.check.dsn4":"属性が{count}個と多いです(しきい値{threshold}超過)— 分解を検討してください","em.check.dsn5Inherited":'インデックス "{name}" が参照する継承カラムがスーパークラスカタログに見つかりません({field})。',"em.check.dsn5Missing":'インデックス "{name}" が存在しないカラムを参照しています。',"em.check.dsn6":"インデックス「{name}」にカラムがありません — カラムのないインデックスは DDL・コード生成で出力されません","em.check.dsn7":"インデックス「{name}」に同じカラムが2回以上含まれています — 後続の重複項目は意味がありません","em.check.unspecified":"未指定"},gh={"em.mode.view":"조회","em.mode.edit":"편집","em.mode.frozen":"편집 잠김 (충돌)","em.mode.frozenTitle":"동시편집 충돌로 편집이 잠겼습니다. 최신 내용을 다시 불러오는 중입니다.","em.mode.readonlyTitle":"이 다이어그램은 조회 전용입니다","em.toolbar.undo":"실행 취소","em.toolbar.redo":"다시 실행","em.toolbar.displayLabel":"표시","em.toolbar.routingToggle":"연결선 모드 전환","em.toolbar.routingOrthogonal":"직각","em.toolbar.routingStraight":"직선","em.toolbar.grid":"그리드","em.toolbar.gridOn":"그리드 켜기","em.toolbar.gridOff":"그리드 끄기","em.toolbar.minimap":"미니맵","em.toolbar.minimapOn":"미니맵 켜기","em.toolbar.minimapOff":"미니맵 끄기","em.toolbar.fitView":"전체 보기","em.toolbar.exportText":"내보내기 (텍스트 · Mermaid)","em.toolbar.exportSvg":"SVG 내보내기","em.toolbar.exportPng":"PNG 내보내기","em.toolbar.import":"가져오기 (텍스트 붙여넣기)","em.toolbar.history":"이력","em.toolbar.historyOpen":"변경 이력 열기","em.toolbar.historyClose":"변경 이력 닫기","em.toolbar.shortcuts":"키보드 단축키 (?)","em.displayMode.logical":"논리","em.displayMode.physical":"물리","em.displayMode.logicalPhysical":"논리·물리","em.displayMode.class":"클래스","em.panel.resizeWidth":"너비 조절","em.panel.collapse":"접기","em.panel.expand":"펼치기","em.panel.collapseAll":"모두 접기","em.panel.expandAll":"모두 펼치기","em.panel.lockedBanner":"편집 잠김 — 이동·수정·삭제 차단","em.panel.openNamed":"{name} 열기","em.notice.readOnly":"조회 모드에서는 편집할 수 없습니다","em.notice.entityLocked":"잠긴 엔티티입니다 — 잠금 해제 후 편집하세요","em.notice.groupLocked":"잠긴 그룹입니다 — 잠금 해제 후 편집하세요","em.notice.assocLocked":"잠긴 엔티티에 연결된 관계입니다 — 잠금 해제 후 편집하세요","em.validation.title":"검증","em.validation.noIssues":"검증 이슈가 없습니다.","em.validation.noVisibleIssues":"표시할 이슈가 없습니다 (필터 적용 중).","em.validation.checkOrphanEntities":"관계 없는 엔티티 검사","em.validation.nameless":"(이름 없음)","em.validation.severityError":"오류","em.validation.severityWarning":"경고","em.validation.severityInfo":"정보","em.validation.hideSeverity":"{label} 숨기기","em.validation.showSeverity":"{label} 표시","em.validation.expandPanel":"검증 패널 펼치기","em.validation.quickFix":"수정","em.validation.quickFixTip":"자동 수정 적용 (되돌리기 가능)","em.common.close":"닫기","em.common.save":"저장","em.export.title":"내보내기","em.export.formatText":"논리 모델 텍스트","em.export.formatMermaidEr":"Mermaid (ER)","em.export.formatMermaidClass":"Mermaid (클래스)","em.export.formatDdl":"SQL DDL (PostgreSQL)","em.export.formatJson":"JSON (백업)","em.export.copy":"복사","em.export.download":"다운로드","em.export.copied":"클립보드에 복사되었습니다.","em.export.copyFailed":"복사에 실패했습니다.","em.import.title":"가져오기","em.import.placeholder":"SQL DDL · Mermaid ER · JSON 백업을 붙여넣으세요.","em.import.formatGroup":"입력 형식","em.import.formatAuto":"자동 감지","em.import.formatMermaid":"Mermaid ER","em.import.formatDdl":"SQL DDL","em.import.formatJson":"JSON","em.import.detected":"감지: {format}","em.import.summary":"엔티티 {entities} · 관계 {relations}","em.import.warnings":"경고 {n}건 (부분 파싱)","em.import.error":"파싱 실패: {message}","em.import.emptyParse":"인식된 엔티티가 없습니다.","em.import.unknownFormat":"포맷을 감지하지 못했습니다 — 위에서 직접 선택하세요.","em.import.confirm":"가져오기","em.import.commentLocale":"주석 로케일","em.import.commentLocaleUnset":"지정 안 함 — 논리명 유보","em.import.commentEvidence":"COMMENT {n}건 — 한국어(한글) {hangul} · 일본어(가나) {kana} · 판별 불가 {undecidable}","em.import.commentCertain":"{locale} 확정","em.import.commentMixed":"혼재 — 로케일별로 나눠 가져오기 권장","em.import.commentUnknown":"판별 불가 — 원본 언어를 아는 사람이 지정","em.import.commentMarker":"텍스트가 밝힌 로케일: {locale}","em.shortcuts.title":"키보드 단축키","em.shortcuts.groupEdit":"편집","em.shortcuts.groupMove":"이동 · 정렬","em.shortcuts.groupExplorer":"탐색기","em.shortcuts.descExplorerSearch":"탐색기 검색으로 포커스","em.shortcuts.descExplorerNav":"트리 이동 (←→ 접기·펼치기)","em.shortcuts.descExplorerSelect":"항목 선택 + 캔버스 이동","em.shortcuts.descExplorerDetail":"엔티티 상세 편집 열기","em.shortcuts.groupOther":"기타","em.shortcuts.keyArrows":"방향키","em.shortcuts.keyRightClick":"우클릭","em.shortcuts.descUndo":"실행 취소","em.shortcuts.descRedo":"다시 실행","em.shortcuts.descCopy":"선택 복사","em.shortcuts.descPaste":"붙여넣기","em.shortcuts.descDelete":"선택 항목 삭제 (Backspace 동일)","em.shortcuts.descMove1":"선택 노드 1px 이동","em.shortcuts.descMove10":"선택 노드 10px 이동","em.shortcuts.descAttrFocus":"속성 선택 시 포커스 이동","em.shortcuts.descAttrReorder":"속성 순서 위/아래로","em.shortcuts.descContextMenu":"컨텍스트 메뉴 (엔티티·노트 추가 등)","em.shortcuts.descInlineConfirm":"인라인 편집 확정","em.shortcuts.descCloseEdit":"편집·메뉴 닫기","em.shortcuts.descOpenHelp":"이 도움말 열기","em.shortcuts.descCommandPalette":"명령 팔레트 (이동·명령 실행)","em.opSource.title":"본문 — {name}()","em.opSource.placeholder":"// Java 구현 코드","em.entity.name":"이름","em.entity.stereotype":"스테레오타입","em.entity.package":"패키지","em.panel.unlock":"잠금 해제","em.entity.fallback":"엔티티","em.group.fallback":"그룹","em.common.description":"설명","em.common.memo":"메모","em.common.color":"색상","em.common.add":"추가","em.common.inherit":"기본(따름)","em.common.noneParen":"(없음)","em.swatch.none":"없음","em.swatch.red":"빨강","em.swatch.amber":"주황","em.swatch.green":"초록","em.swatch.teal":"청록","em.swatch.blue":"파랑","em.swatch.indigo":"남색","em.swatch.violet":"보라","em.swatch.pink":"분홍","em.inspector.ctxEntityAttrs":"엔티티 · {name} › 속성 · {n}개","em.inspector.ctxEntityDivider":"엔티티 · {name} › 구분선","em.inspector.ctxEntityAttr":"엔티티 · {name} › 속성 · {attr}","em.inspector.ctxEntity":"엔티티 · {name}","em.inspector.ctxAssoc":"관계 · {a} — {b}","em.inspector.ctxGroup":"그룹 · {name}","em.inspector.ctxNote":"노트","em.inspector.ctxNone":"선택된 항목 없음","em.assoc.identifying":"identifying (식별 관계)","em.assoc.selfNoIdentifying":"셀프 연관은 식별 관계로 둘 수 없습니다 (비식별 FK 강제).","em.assoc.embedNoIdentifying":"임베드(@Embedded/@ElementCollection)는 식별 관계로 둘 수 없습니다 (임베더블은 독립 식별자가 없음).","em.assoc.multiplicity":"다중성","em.assoc.navFieldName":"연관 필드명(nav)","em.assoc.cascadeAllNote":"ALL이 개별 cascade를 모두 포함합니다 (CHK-JPA-5).","em.assoc.orphanRemovalNote":"반대편이 컬렉션(@ManyToOne/@ManyToMany)이라 orphanRemoval이 무효입니다 (CHK-JPA-14).","em.assoc.navRequiredNote":"이 방향에 nav 속성이 없어(navigable 꺼짐) cascade·fetch가 적용되지 않습니다.","em.assoc.ownerNavFixed":"JPA 소유측 참조(@ManyToOne)는 관계 존재와 동치라 항상 켜집니다 — 참조 없는 FK는 관계 대신 일반 컬럼으로 모델링하세요.","em.assoc.orderByPlaceholder":"예: name ASC","em.assoc.jpaDetails":"JPA 상세","em.embed.legend":"임베드","em.embed.cardinality":"카디널리티","em.embed.card1":"1 (필수 @Embedded)","em.embed.card01":"0..1 (선택 @Embedded)","em.embed.card0N":"0..* (컬렉션 @ElementCollection)","em.embed.collectionTablePlaceholder":"미지정 시 코드젠 폴백","em.embed.orderColumnPlaceholder":"미지정 시 순서 비보존","em.embed.ownerFixedNote":"임베더블은 소유자에 평탄화되므로 소유자 쪽 end(다중성·navigable·composition)는 구조적으로 고정이라 표시하지 않습니다.","em.group.nameLegend":"그룹명","em.group.excludeDDL":"DDL 생성 제외","em.group.members":"멤버 엔티티 {n}개","em.entity.classLegend":"클래스","em.entity.superClass":"부모 클래스","em.entity.superClassPlaceholder":"예: BaseEntity","em.entity.interfaces":"구현 인터페이스","em.entity.interfacesPlaceholder":"콤마로 구분 (예: Serializable, Cloneable)","em.entity.abstractClass":"추상 클래스","em.entity.tablePhysical":"테이블(물리)","em.entity.schema":"스키마","em.entity.schemaPlaceholder":"예: sales, master","em.entity.tableLogicalLegend":"테이블 논리명","em.entity.classLogicalLegend":"클래스 논리명","em.entity.discColumn":"Discriminator 컬럼명","em.entity.discColumnPlaceholder":"예: DTYPE","em.entity.discType":"Discriminator 타입","em.entity.discLength":"Discriminator 길이","em.entity.hasPersonalInfo":"개인정보 포함 (hasPersonalInfo)","em.entity.referenceOnly":"참고 전용 (산출·검증 대상 외)","em.entity.referenceOnlyHint":"문서 이해용 자료·테스트 초안 등 산출물이 아닌 엔티티. DDL·Java 코드·mermaid 를 생성하지 않고 검증 대상에서도 빠집니다(AI 입력 텍스트에는 남습니다). 그룹의 「DDL 생성 제외」와 다릅니다 — 그쪽은 타 서비스가 소유한 실재 테이블용으로 Java 클래스는 계속 생성됩니다.","em.entity.headerColor":"헤더 색상","em.attr.section":"속성 ({n})","em.attr.addEmbeddable":"임베더블 추가","em.attr.nameless":"(이름 없음)","em.attr.selectHint":"위 목록에서 속성을 선택하면 편집 폼이 표시됩니다.","em.attr.inverseNavHint":"역방향 연관관계 필드 — 물리 컬럼이 없습니다(대상 엔티티 참조).","em.attr.fkDerivedNote":"외래키(FK)에서 파생된 컬럼입니다 — 형상은 부모 PK를 따르며, 변경은 관계선·식별관계에서 하세요.","em.attr.scaleTypeHint":"소수부(scale)는 NUMERIC·DECIMAL 타입에만 적용됩니다.","em.attr.embedFixedHint":"임베더블 정의에서 고정된 값입니다.","em.attr.fkFixedHint":"부모 PK 컬럼에서 상속된 값입니다 — 형상은 부모를 따릅니다.","em.attr.embedSharedHint":"다른 컬럼과 공유하는 통화 컬럼입니다 — 대상에서 파생(읽기 전용).","em.attr.derivedIdField":"파생 식별 @Id 필드","em.attr.assocField":"연관 필드명(@MapsId)","em.attr.derivedIdNote":"이 속성은 **두 Java 필드**를 냅니다 — 위 이름 칸은 스칼라 @Id 필드명(비우면 부모 PK 물리명에서 파생)이고, 여기는 @MapsId 연관 필드명입니다. 같은 값을 관계선 인스펙터에서도 편집할 수 있습니다.","em.attr.joinColumnOnlyNote":"복합 외래키의 형제 컬럼입니다 — JPA 필드는 관계당 하나뿐이라 이 이름은 방출되지 않습니다. 필드명은 «{anchor}»에서 편집하세요.","em.attr.namePlaceholder":"이름","em.attr.typePlaceholder":"타입","em.attr.customTypePlaceholder":"커스텀 타입명","em.attr.logicalPlaceholder":"논리명","em.attr.columnPlaceholder":"컬럼","em.attr.defaultValue":"기본값","em.attr.codeGroup":"코드그룹","em.attr.currencyColumn":"통화 컬럼","em.attr.pii":"개인정보","em.attr.colFallback":"컬럼 {n}","em.attr.sharedOwn":"전용 컬럼(OWN)","em.attr.sharedRef":"↗ {owner}{physical} ({mode})","em.attr.currencyMode":"통화","em.attr.sharedMode":"공유","em.attr.batchHint":"선택 {n}개 일괄","em.attr.fkDeleteHint":"외래키는 연관관계에서 파생됩니다 — 연관관계선을 삭제하세요","em.attr.embedConvertPkBlocked":"식별자 속성은 컬럼 개수가 바뀌는 임베더블로 전환할 수 없습니다 — PK 형상이 바뀌면 이 PK를 참조하는 자식 FK가 함께 어긋납니다","em.op.section":"오퍼레이션 ({n})","em.op.namePlaceholder":"오퍼레이션명","em.op.editBodyDirty":"본문 편집 ●","em.op.editBody":"본문 편집","em.index.section":"인덱스 ({n})","em.index.inherited":"{field} (상속)","em.index.namePlaceholder":"인덱스명","em.index.addColumn":"컬럼","em.index.condition":"조건 (partial index)","em.index.conditionPlaceholder":"예: WHERE status = 'A'","em.groupCode.searchPlaceholder":"코드그룹 검색/선택","em.groupCode.noMatch":"일치하는 코드그룹 없음","em.detail.tabBasics":"기본","em.detail.tabColumns":"속성","em.detail.tabIndexes":"인덱스","em.detail.tabOperations":"오퍼레이션","em.detail.title":"엔티티 — {name}","em.attr.addDivider":"구분선","em.attr.columnPhysical":"컬럼(물리)","em.attr.constraints":"제약","em.attr.dividerLabelPlaceholder":"구분선 라벨(선택)","em.attr.dividerNote":"── 시각 구획 ──","em.attr.detailCollapse":"상세 접기","em.attr.detailExpand":"상세 펼치기","em.attr.semanticLegend":"의미","em.attr.embedChildCols":"임베더블 — 하위 컬럼 {n}개","em.attr.fkChildCols":"복합 외래키 — 컬럼 {n}개","em.attr.overrideCollapse":"오버라이드 접기","em.attr.overrideExpand":"오버라이드 펼치기","em.attr.overrideLegend":"컬럼 오버라이드","em.attr.empty":"속성 없음 — '추가'로 생성","em.op.body":"본문","em.op.bodyDirty":"본문 ●","em.op.empty":"오퍼레이션 없음 — '추가'로 생성","em.index.delete":"인덱스 삭제","em.index.empty":"인덱스 없음 — '추가'로 생성","em.index.conditionPlaceholderWide":"예: WHERE status = 'A' AND deleted = false","em.index.inheritedColTitle":"슈퍼클래스 상속 컬럼","em.index.inheritedBadge":"상속","em.index.colUnspecified":"{name} (컬럼 {n}개 중 미지정)","em.index.multiColumn":"{name} (컬럼 {n}개)","em.index.unnamedAttr":"(이름 없음)","em.index.availColumns":"가용 컬럼 ({n})","em.index.indexColumns":"인덱스 컬럼 ({n})","em.index.allColumnsUsed":"모든 컬럼 사용됨","em.index.addArrow":"추가 →","em.index.moveUp":"위로","em.index.moveDown":"아래로","em.index.removeColumn":"제거","em.index.noColumns":"컬럼 없음 — 좌측에서 추가","em.index.selectPrompt":"인덱스를 선택하거나 추가하세요.","em.palette.autoLayout":"자동 배치","em.cmd.title":"명령 팔레트","em.cmd.placeholder":"엔티티로 이동하거나 명령 실행…","em.cmd.sectionGoto":"이동","em.cmd.sectionActions":"명령","em.cmd.empty":"일치하는 항목이 없습니다","em.cmd.groupTag":"그룹","em.canvas.emptyTitle":"빈 다이어그램입니다","em.canvas.emptyHint":"캔버스를 <strong>우클릭</strong>하거나 좌하단 <strong>+</strong> 버튼으로 첫 엔티티를 추가하세요.","em.canvas.emptyConnectHint":"엔티티를 두 개 이상 만들면, 엔티티 가장자리에서 <strong>드래그</strong>해 관계를 연결할 수 있어요.","em.canvas.emptyShortcutHint":"단축키 도움말은 <kbd>?</kbd> 키","em.canvas.emptyReadonly":"표시할 엔티티가 없습니다","em.canvas.exportFailed":"내보내기에 실패했습니다","em.conflict.lockedTitle":"편집이 잠겼습니다","em.conflict.missingDetail":"변경 사항을 저장하지 못했습니다(서버 또는 네트워크 오류). 최신 내용을 다시 불러오세요.","em.conflict.changedDetail":"다른 곳에서 변경되어 편집이 잠겼습니다. 최신 내용을 다시 불러오세요.","em.conflict.commandFailedDetail":"편집을 처리하지 못해 화면 내용이 어긋났습니다. 저장된 내용은 그대로이니 최신 내용을 다시 불러오세요.","em.ctx.addEntity":"엔티티 추가","em.ctx.addNote":"노트 추가","em.ctx.addGroup":"그룹 추가","em.ctx.paste":"붙여넣기","em.ctx.copy":"복사","em.ctx.copyN":"복사 ({n})","em.ctx.editDetail":"상세 편집…","em.ctx.viewDetail":"상세 보기…","em.ctx.lock":"잠금","em.ctx.ungroup":"그룹 해제","em.ctx.deleteNote":"노트 삭제","em.ctx.addAttr":"속성 추가","em.ctx.colorN":"색상 ({n})","em.ctx.pasteAttr":"속성 붙여넣기","em.ctx.pasteAttrN":"속성 붙여넣기 ({n})","em.ctx.deleteAttr":"속성 삭제","em.ctx.deleteAttrN":"속성 삭제 ({n})","em.ctx.addOperation":"오퍼레이션 추가","em.ctx.deleteOperation":"오퍼레이션 삭제","em.ctx.addMethod":"메서드 추가","em.ctx.groupInto":"그룹으로 묶기","em.ctx.addSelfAssoc":"셀프 연관 추가","em.ctx.addEmbeddableNamed":"임베더블 추가: {label}","em.ctx.ungroupEntity":"그룹에서 빼기","em.ctx.deleteEntity":"엔티티 삭제","em.ctx.clearWaypoints":"꺾은선 풀기","em.ctx.deleteConnection":"연결 삭제","em.ctx.deleteAssociation":"관계 삭제","em.node.keyPfk":"PFK (식별 외래키)","em.node.keyPk":"PK (기본키)","em.node.keyFk":"FK (외래키)","em.node.required":"필수 (NOT NULL)","em.node.logicalMissing":"(논리명)","em.node.editLock":"편집 잠금","em.node.connectHint":"드래그해 다른 엔티티와 관계 연결","em.node.connectHintNode":"드래그해 관계 연결 (이 엔티티 전체를 시작점으로)","em.node.derivedIdRow":"파생 식별(@MapsId)이 방출하는 스칼라 @Id 필드입니다 — 모델에는 연관 속성 하나로 저장되며, 편집은 그 속성의 인스펙터에서 합니다.","em.node.embedRepeatedShow":"이 엔티티에서 값이 같아 접힌 컬럼 {count}개 보기","em.node.embedRepeatedHide":"값이 같아 반복되는 컬럼 접기","em.node.embedAttrHide":"이 임베드 컬럼 접기","em.node.embedAttrShow":"접힌 임베드 컬럼 {count}개 보기","em.node.embedAllHide":"이 엔티티의 서브컬럼 모두 접기","em.node.embedAllShow":"접힌 서브컬럼 모두 펼치기","em.node.embedAllSummary":"서브컬럼 {n}개 숨김","em.node.opsSummaryTitle":"오퍼레이션 {n}개 — 클래스 표시 모드에서 펼쳐 보입니다","em.node.opsSummary":"오퍼레이션 {n}개","em.node.addAttr":"+ 속성","em.node.addDivider":"+ 구분선","em.group.ddlExcludeBadge":"DDL 제외","em.toolbar.referenceOnlyBadge":"참고 전용 문서","em.toolbar.referenceOnlyDocHint":"이 문서 전체가 산출·검증 대상이 아닙니다. DDL·Java 코드·mermaid 내보내기가 비고 검증 신호도 나오지 않습니다 — 모델이 비어서가 아니라 대상 외이기 때문입니다(AI 입력 텍스트에는 남습니다). 캔버스의 파선 테두리가 같은 뜻입니다.","em.explorer.groupFallback":"(그룹)","em.explorer.associations":"관계 ({n})","em.explorer.notes":"노트 ({n})","em.explorer.emptyNote":"(빈 노트)","em.explorer.diagram":"다이어그램","em.explorer.searchPlaceholder":"엔티티·속성 검색 ( / )","em.explorer.treeAria":"다이어그램 트리","em.explorer.searchAria":"엔티티·속성 검색","em.explorer.clearSearchAria":"검색어 지우기","em.explorer.clearSearchTitle":"지우기 (Esc)","em.explorer.noMatches":"일치하는 엔티티·속성이 없습니다","em.history.title":"변경 이력","em.history.refresh":"새로고침","em.history.loading":"이력을 불러오는 중…","em.history.loadError":"이력을 불러오지 못했습니다.","em.history.emptyLoaded":"표시할 변경 이력이 없습니다.","em.history.emptyNotLoaded":"이력을 불러오세요.","em.history.filterAll":"전체","em.history.kindEdit":"편집","em.history.kindRestore":"복원","em.history.verbAdd":"추가","em.history.verbUpdate":"수정","em.history.verbRemove":"삭제","em.history.assocFallback":"연관","em.history.groupSubject":"그룹 {name}","em.history.noteSubject":"노트 {name}","em.history.emptyValue":"(비움)","em.history.noChange":"변경 없음","em.history.summaryAdd":"{name} 추가","em.history.summaryRemove":"{name} 삭제","em.history.summaryFields":"{name} {n}개 변경","em.history.summaryMore":"{summary} 외 {n}건","em.history.restoreFailed":"복원 실패: {reason}","em.history.unknown":"알 수 없음","em.history.confirmRestore":"이 시점으로 되돌립니다.","em.history.doRestore":"복원","em.history.cancel":"취소","em.history.restoreToHere":"이 시점으로 복원","em.history.diff.compare":"현재와 비교","em.history.diff.current":"현재","em.history.diff.exit":"비교 해제","em.history.diff.count":"누적 변경 {n}건","em.history.diff.empty":"이 구간의 누적 변경이 없습니다.","em.history.diff.restorePreview":"되돌아갈 변경 {n}건","em.history.diff.restorePreviewNone":"되돌아갈 변경이 없습니다.","em.history.loadMore":"이전 기록 더 보기 ({n})","em.history.periodLabel":"기간","em.history.periodFrom":"시작일","em.history.periodTo":"종료일","em.history.periodReset":"기간 해제","em.check.catName":"이름","em.check.catJpa":"JPA","em.check.catType":"타입","em.check.catDsn":"설계","em.check.name1":'속성 이름이 중복됩니다: "{name}"',"em.check.name2":'컬럼 물리명이 중복됩니다: "{name}"',"em.check.name3Entity":'엔티티 이름이 중복됩니다: "{name}" — 같은 이름의 엔티티가 또 있습니다. JPA는 엔티티 이름을 퍼시스턴스 유닛 전역에 등록하므로 패키지(그룹)를 나눠도 해소되지 않습니다',"em.check.name3Package":'엔티티 이름이 중복됩니다: "{name}" — 같은 패키지에 같은 이름이 있습니다. 이름을 바꾸거나 그룹(패키지)을 나누면 해소됩니다',"em.check.name4Entity":"엔티티 이름이 비어 있습니다","em.check.name4Attr":"속성 이름이 비어 있습니다","em.check.name11Entity":'엔티티 이름 "{name}"이 Java 클래스 관례(PascalCase)를 벗어납니다 — 코드 생성이 이 이름을 그대로 클래스명으로 냅니다',"em.check.name11Attr":'속성 이름 "{name}"이 Java 필드 관례(lowerCamelCase)를 벗어납니다 — 코드 생성이 이 이름을 그대로 필드명으로 냅니다',"em.check.name5":"물리명이 {max}자를 초과했습니다 ({len}자) — 일부 DB에서 잘릴 수 있습니다","em.check.name6Column":'컬럼 물리명이 SQL 예약어입니다: "{name}"',"em.check.name6Table":'테이블 물리명이 SQL 예약어입니다: "{name}"',"em.check.name6Index":'인덱스 이름이 SQL 예약어입니다: "{name}"',"em.check.name7":"관계/임베드 속성({attrType})의 이름이 비어 있습니다 — 이름이 곧 JPA 필드명이라 코드 생성 시 이 관계가 통째로 누락됩니다. 속성명을 채우세요","em.check.name8":'속성 "{name}"의 컬럼 물리명이 비어 있습니다 — DDL·코드 생성에서 이 컬럼이 통째로 누락됩니다. 물리명을 채우세요',"em.check.name9":'두 엔티티가 같은 테이블 "{name}"에 매핑됩니다 — 컬럼이 한 테이블에 뒤섞입니다. 테이블 물리명을 구분하세요',"em.check.name10":'인덱스 이름이 중복됩니다: "{name}" — 인덱스 이름은 DB 스키마 전역에서 유일해야 합니다',"em.entity.valueTypeSwitchEmbedded":'"{name}"은(는) 현재 {owners}개 엔티티에 임베드되어 있어 직렬화 타입/임베더블 사이를 바로 전환할 수 없습니다 — 임베드 속성을 먼저 정리한 뒤 전환하세요(직렬화 타입은 관계가 아니라 타입 참조로 지목됩니다)',"em.attr.serializedNoColumnNote":"직렬화 타입은 필드별 물리 컬럼이 없습니다 — 소비 속성의 컬럼 하나에 통째로 직렬화됩니다","em.attr.serializedContainer":"컨테이너","em.attr.serializedContainerNone":"없음 (단일 값)","em.entity.noOwnTableNote":"값 타입은 자체 테이블이 없습니다 — 임베더블은 소유자 테이블로 펼쳐지고, 직렬화 타입은 소비 속성의 컬럼 하나에 직렬화됩니다","em.entity.serializedTypeHasRelations":'"{name}"은(는) 연관관계 {count}개에 참여 중이라 직렬화 타입으로 바꿀 수 없습니다 — 연관을 먼저 정리하세요(직렬화 타입은 관계가 아니라 소비 속성의 타입 참조로 지목됩니다)',"em.entity.serializedContainer":"컨테이너","em.entity.serializedContainerNone":"없음 (단일 값)","em.entity.serializedMapKey":"Map 키 타입","em.entity.serializedMapKeyPlaceholder":"예: PromoType (미지정 시 코드젠이 임시 Object + 손채움)","em.entity.noIndexNote":"직렬화 타입은 인덱스를 가질 수 없습니다 — 인덱스는 컬럼에 걸리는데 이 타입은 소비 속성의 컬럼 하나에 통째로 직렬화됩니다","em.check.jpa1":"JPA 엔티티에 식별자(PK) 속성이 없습니다","em.check.jpa2":'값 타입(임베더블·직렬화 타입)은 식별자 속성을 가질 수 없습니다: "{name}"',"em.check.jpa4":"식별 관계 사이클입니다 (PK 무한 의존): {path}","em.check.jpa5":"{which}: cascade ALL이 개별 cascade와 중복됩니다 (ALL이 모두 포함)","em.check.jpa7":"{which}: 컬렉션(to-many) 연관에 EAGER 페치는 성능 위험이 있습니다","em.check.jpa8":"JPA 엔티티에 테이블 물리명이 설정되지 않았습니다","em.check.jpa9":"{which}: 단일(to-one) 연관에 컬렉션 메타(collectionType/collectionTable/orderColumn)는 무의미합니다 — @ElementCollection은 컬렉션에서만 적용됩니다","em.check.jpa10":"{which}: SET 컬렉션은 순서를 보존하지 않아 orderColumn(@OrderColumn)이 무의미합니다","em.check.jpa11":"임베드(@Embedded/@ElementCollection)는 식별 관계로 둘 수 없습니다 — 임베더블은 독립 식별자가 없습니다","em.check.jpa12":'식별자(@Id) 속성은 transient(@Transient)일 수 없습니다: "{name}"',"em.check.jpa13AutoIncrement":'채번(auto increment)은 식별자(@Id) 속성에만 쓸 수 있습니다 — 비식별 속성 "{name}"에 설정되어 있습니다',"em.check.jpa13Sequence":'채번(시퀀스 "{seq}")은 식별자(@Id) 속성에만 쓸 수 있습니다 — 비식별 속성 "{name}"에 설정되어 있습니다',"em.check.jpa14":"{which}: orphanRemoval은 @ManyToOne/@ManyToMany(반대편이 컬렉션) 연관에는 적용할 수 없습니다 — @OneToOne·@OneToMany에서만 유효합니다","em.check.jpa15":'식별자(@Id) 속성은 자연키(@NaturalId)일 수 없습니다 — 자연키는 PK와 별개의 비즈니스 키입니다: "{name}"',"em.check.jpa16":'자연키(@NaturalId) 속성은 transient(@Transient)일 수 없습니다: "{name}"',"em.check.jpa17":'자연키(@NaturalId) 속성은 not null이 권장됩니다(비즈니스 키는 non-null이 원칙): "{name}"',"em.check.jpa18":"cascade가 관계 양쪽(부모·자식)에 모두 설정되어 양방향 전파됩니다 — 의도치 않은 연쇄 저장/삭제·전파 사이클 위험. 보통 cascade는 한쪽에만 둡니다","em.check.jpa19":"부모에 컬렉션/참조 필드가 있으나 자식({child})에 대응 관계 속성이 없어 JPA 매핑(mappedBy)을 만들 수 없습니다 — 코드젠이 이 관계를 방출하지 못합니다. 자식에 FK 속성을 만들거나 관계를 단방향으로 정리하세요","em.check.jpa20":'복합 PK(@IdClass/@EmbeddedId)에는 채번(@GeneratedValue)을 쓸 수 없습니다 — 속성 "{name}"에 설정되어 있습니다',"em.check.jpa21Missing":'임베드 "{name}"의 컬럼이 임베더블({embeddable}) 선언보다 적습니다 — 슬롯 {slots} / 선언 {declared}. 뒤에 추가된 컬럼이 반영되지 않아 DDL에서 빠집니다(JPA는 임베더블 선언대로 컬럼을 만듭니다)',"em.check.jpa21Extra":'임베드 "{name}"의 컬럼이 임베더블({embeddable}) 선언보다 많습니다 — 슬롯 {slots} / 선언 {declared}. 임베더블에서 지워진 컬럼이 남아 DDL에 없는 컬럼을 방출합니다',"em.check.type1":'타겟 DB가 지원하지 않는 컬럼 타입입니다: "{dataType}"',"em.check.type2":"{dataType} 타입에 length가 지정되지 않았습니다","em.check.type3":"공유 대상 컬럼의 타입({targetType})이 {metaName} 정의({metaType})와 다릅니다","em.check.type4":"다중값(Multi-Value) 속성은 GroupCodeEnum + VARCHAR 조합에서만 컨버터가 자동 생성됩니다 — 현재({type} / {dataType})에서는 Set<…> 필드만 생성되어 매핑이 불완전할 수 있습니다","em.check.type6":'속성 "{name}"의 컬럼에 데이터 타입이 지정되지 않았습니다 — DDL에서 이 컬럼이 생략됩니다',"em.check.type7":"자바 타입({type})과 컬럼 타입({dataType})이 호환되지 않습니다 — 코드젠 필드와 DDL 컬럼이 서로 다른 타입으로 산출됩니다","em.check.type8":"NULL 허용 컬럼({dataType})이 원시 타입({type})에 매핑됩니다 — DB의 NULL 을 읽는 순간 예외가 납니다. NOT NULL 을 지정하거나 박싱 타입({boxed})으로 바꾸세요","em.check.dsn1":"both-many(M:N) 관계를 조인 엔티티 없이 직접 연결했습니다 — 연관 엔티티 도입을 검토하세요","em.check.dsn2":"속성이 하나도 없는 엔티티입니다","em.check.dsn3":"모델링된 관계가 없습니다 (연관·상속·임베딩 미참여 — 의도적 생략이면 무시)","em.check.dsn4":"속성이 {count}개로 많습니다 (임계치 {threshold} 초과) — 분해를 검토하세요","em.check.dsn5Inherited":'인덱스 "{name}"가 참조하는 상속 컬럼을 슈퍼클래스 카탈로그에서 찾을 수 없습니다({field}).',"em.check.dsn5Missing":'인덱스 "{name}"가 존재하지 않는 컬럼을 참조합니다.',"em.check.dsn6":'인덱스 "{name}"에 컬럼이 없습니다 — 컬럼 없는 인덱스는 DDL·코드 생성에서 산출되지 않습니다',"em.check.dsn7":'인덱스 "{name}"에 같은 컬럼이 두 번 이상 들어 있습니다 — 뒤의 중복 항목은 의미가 없습니다',"em.check.unspecified":"미지정"},xC=["ko","en","ja"],tc={ko:gh,en:hh,ja:yh};function cn(e,n,o){let a=(tc[e]??tc.ko)[n]??tc.ko[n]??n;return o&&(a=a.replace(/\{(\w+)\}/g,(r,l)=>l in o?String(o[l]):r)),a}const bh=["ko","en","ja","zh"];function $C(e){if(e)for(const n of bh){const o=e[n];if(o)return o}}function nc(e){const n=$C(e.label);return n?`${e.groupCode} (${n})`:e.groupCode}function TC(e,n){const o=n.trim().toLowerCase();return o?e.filter(i=>i.groupCode.toLowerCase().includes(o)?!0:bh.some(a=>{var r,l;return(l=(r=i.label)==null?void 0:r[a])==null?void 0:l.toLowerCase().includes(o)})):e}const MC=["aria-expanded","placeholder"],VC=["aria-selected","onClick","onMouseenter"],LC={key:0,class:"gcc__opt gcc__opt--empty"},kh=tt(t.defineComponent({__name:"GroupCodeCombobox",props:{modelValue:{},items:{},locale:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,i=n,a=(T,O)=>cn(o.locale??"ko",T,O),r=t.ref(),l=t.ref(),s=t.ref(),c=t.ref(""),d=t.ref(!1),u=t.ref(-1),m=t.ref({}),f=t.computed(()=>o.items.find(T=>T.groupCode===o.modelValue)),p=t.computed(()=>f.value?nc(f.value):"");t.watch(p,T=>{d.value||(c.value=T)},{immediate:!0});const y=t.computed(()=>c.value===p.value?o.items:TC(o.items,c.value));function g(){var O;const T=(O=r.value)==null?void 0:O.getBoundingClientRect();T&&(m.value={left:`${T.left}px`,top:`${T.bottom}px`,width:`${T.width}px`})}function b(){d.value=!0,g(),u.value=Math.max(0,y.value.findIndex(T=>T.groupCode===o.modelValue)),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),document.addEventListener("mousedown",A)}function k(){d.value=!1,window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),document.removeEventListener("mousedown",A)}t.onBeforeUnmount(k);function _(){b(),t.nextTick(()=>{var T;return(T=l.value)==null?void 0:T.select()})}function h(){d.value||b(),u.value=0}function C(T){i("update:modelValue",T.groupCode),c.value=nc(T),k()}function v(){i("update:modelValue",void 0),c.value="",k()}function S(){c.value.trim()===""?v():(c.value=p.value,k())}function N(T){var O;if(T.key==="ArrowDown")d.value||b(),u.value=Math.min(u.value+1,y.value.length-1),T.preventDefault();else if(T.key==="ArrowUp")u.value=Math.max(u.value-1,0),T.preventDefault();else if(T.key==="Enter"){const z=y.value[u.value];z&&C(z),T.preventDefault()}else T.key==="Escape"&&(c.value=p.value,k(),(O=l.value)==null||O.blur())}function A(T){var z,P;const O=T.target;!((z=r.value)!=null&&z.contains(O))&&!((P=s.value)!=null&&P.contains(O))&&S()}return(T,O)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"root",ref:r,class:"gcc"},[t.withDirectives(t.createElementVNode("input",{ref_key:"inputEl",ref:l,"onUpdate:modelValue":O[0]||(O[0]=z=>c.value=z),class:"gcc__input",type:"text",role:"combobox",autocomplete:"off","aria-expanded":d.value,placeholder:a("em.groupCode.searchPlaceholder"),onFocus:_,onInput:h,onKeydown:N},null,40,MC),[[t.vModelText,c.value]]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[d.value?(t.openBlock(),t.createElementBlock("ul",{key:0,ref_key:"popup",ref:s,class:"gcc__popup",style:t.normalizeStyle(m.value),role:"listbox"},[t.createElementVNode("li",{class:"gcc__opt gcc__opt--none",onMousedown:O[1]||(O[1]=t.withModifiers(()=>{},["prevent"])),onClick:v},t.toDisplayString(a("em.common.noneParen")),33),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value,(z,P)=>(t.openBlock(),t.createElementBlock("li",{key:z.groupCode,class:t.normalizeClass(["gcc__opt",{"is-active":P===u.value,"is-selected":z.groupCode===e.modelValue}]),role:"option","aria-selected":z.groupCode===e.modelValue,onMousedown:O[2]||(O[2]=t.withModifiers(()=>{},["prevent"])),onClick:D=>C(z),onMouseenter:D=>u.value=P},t.toDisplayString(t.unref(nc)(z)),43,VC))),128)),y.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("li",LC,t.toDisplayString(a("em.groupCode.noMatch")),1))],4)):t.createCommentVNode("",!0)]))],512))}}),[["__scopeId","data-v-431f9333"]]),BC=["aria-labelledby"],DC=["aria-checked","tabindex","onClick","onKeydown"],_h=tt(t.defineComponent({__name:"ColumnLangSelect",props:{modelValue:{},languages:{},defaultLang:{},labelledBy:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,i=n;t.watch(()=>[o.languages,o.defaultLang],([l,s])=>{l.includes(s)?o.modelValue!==s&&i("update:modelValue",s):l.includes(o.modelValue)||i("update:modelValue",l[0]??"ko")});const a=t.ref(null);async function r(l){var d,u;const s=o.languages,c=s[(s.indexOf(o.modelValue)+l+s.length)%s.length];c&&(i("update:modelValue",c),await t.nextTick(),(u=(d=a.value)==null?void 0:d.querySelectorAll('[role="radio"]')[s.indexOf(c)])==null||u.focus())}return(l,s)=>(t.openBlock(),t.createElementBlock("span",{ref_key:"rootEl",ref:a,class:"em-langsel",role:"radiogroup","aria-labelledby":e.labelledBy},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.languages,c=>(t.openBlock(),t.createElementBlock("span",{key:c,class:t.normalizeClass(["em-langsel__opt",{"is-active":e.modelValue===c}]),role:"radio","aria-checked":e.modelValue===c,tabindex:e.modelValue===c?0:-1,onClick:d=>i("update:modelValue",c),onKeydown:[t.withKeys(t.withModifiers(d=>i("update:modelValue",c),["prevent"]),["enter"]),t.withKeys(t.withModifiers(d=>i("update:modelValue",c),["prevent"]),["space"]),s[0]||(s[0]=t.withKeys(t.withModifiers(d=>r(-1),["prevent"]),["left"])),s[1]||(s[1]=t.withKeys(t.withModifiers(d=>r(1),["prevent"]),["right"]))]},t.toDisplayString(c),43,DC))),128))],8,BC))}}),[["__scopeId","data-v-5c793bbb"]]),OC=["disabled"],PC={class:"em-aw__toolbar"},zC={class:"em-aw__count"},FC={class:"em-aw__scroll"},UC={class:"em-aw__table"},HC={class:"c-name"},jC={class:"c-type"},KC={class:"c-logical"},GC=["id"],YC={class:"c-col"},qC={class:"c-constraints"},WC={class:"c-del"},JC={class:"c-expand"},XC=["title","onClick","onKeydown"],ZC=["title"],QC=["title"],eS={key:1,class:"em-aw__muted"},tS=["title"],nS=["title"],oS=["title"],iS=["title"],aS={class:"em-aw__cflags"},rS=["title"],lS={key:0,class:"em-aw__embed-col"},sS={class:"em-aw__embed-label"},cS=["title"],dS={colspan:"8"},uS={class:"em-aw__detail"},mS={class:"em-aw__dgroup"},fS=["title"],pS={class:"em-aw__df"},hS={class:"em-aw__df"},yS={class:"em-aw__dgroup"},gS={key:0,class:"em-aw__dgroup"},bS={class:"em-aw__df"},kS={key:0,class:"em-aw__df"},_S={class:"em-aw__df"},ES={class:"em-aw__dgroup em-aw__ddesc"},NS={class:"c-expand"},wS=["title","onClick","onKeydown"],IS={key:1,class:"em-aw__caret is-static","aria-hidden":"true"},vS=["title"],CS=["title"],SS=["colspan"],RS=["title"],AS={class:"em-aw__cflags"},xS=["title"],$S={colspan:"8"},TS={class:"em-aw__detail"},MS={class:"em-aw__dgroup em-aw__ddesc"},VS={class:"c-expand"},LS=["title","onClick","onKeydown"],BS={class:"em-aw__embed-label"},DS=["title"],OS=["title"],PS={class:"em-aw__ro"},zS=["title"],FS={class:"em-aw__ro"},US=["title"],HS={class:"em-aw__ro"},jS={key:0,class:"em-aw__detail-row em-aw__embed-detail"},KS={colspan:"8"},GS={class:"em-aw__detail"},YS={class:"em-aw__dgroup"},qS={key:0,class:"em-aw__df"},WS={class:"em-aw__df"},JS={class:"em-aw__df"},XS={key:0},ZS={colspan:"99",class:"em-aw__empty"},QS=6,Eh=5,eR=tt(t.defineComponent({__name:"EntityAttributesWide",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,{entity:i,isValueType:a,isColumnless:r,focusedAttrIds:l,personalInfoItems:s,piiLabel:c,idn:d,logicalNameOf:u,setLogicalName:m,logicalPlaceholder:f,SERIALIZED_FIELD_CONTAINERS:p,setCollectionType:y,setAttr:g,isDerivedIdRow:b,rowName:k,rowNamePlaceholder:_,setRowName:h,assocFieldName:C,setAssocFieldName:v,nameLocked:S,nameLockedHint:N,isManagedFk:A,setNaturalId:T,setIdentifier:O,setTransient:z,dbLocked:P,fkDerived:D,fkOriginPhysical:E,typeLocked:R,typeValueOf:I,typeLabelOf:x,setAttrType:$,setAttrCustomType:U,setDb:F,scaleApplicable:B,scaleHint:j,attrPiiValue:X,setAttrPii:W,predefinedCustomTypeCatalog:oe,serializedTypeNames:de,embeddableCatalog:ie,predefinedLabel:Ie,groupCodeCatalog:Le,attrGroupCodes:Se,attrCodeItems:ce,codeValueOf:pe,codeLabelOf:he,setAttrGroupCode:V,setAttrCode:L,setAttrDefaultValue:K,setAttrDescription:Z,hasColumnSlots:Q,isMultiColFk:fe,setDbAt:be,setDbLogicalAt:Ee,colSlotMeta:Ne,fixedDataType:J,fixedLength:ee,fixedScale:te,slotFixedHint:ge,updatableItems:Re,updatableLabel:Pe,updatableValue:Me,setUpdatableAt:Qe,setUpdatable:Ot,insertableItems:ht,insertableLabel:re,insertableValue:ve,setInsertableAt:le,setInsertable:me,sharedItems:ke,sharedLabel:Ze,sharedValue:ct,setSharedAt:ft,isShared:qe,sharedPhysical:Rt}=ph(o,()=>n.entityId),et=t.computed(()=>{var mt;return[...((mt=i.value)==null?void 0:mt.attributes)??[]].sort((ze,Y)=>ze.order-Y.order)}),jt=t.computed(()=>{var mt;return(((mt=i.value)==null?void 0:mt.attributes)??[]).filter(ze=>ze.attrType!=="DIVIDER").length}),Nt=t.ref(new Set);function ut(mt){return Nt.value.has(mt)}function yt(mt){const ze=new Set(Nt.value);ze.has(mt)?ze.delete(mt):ze.add(mt),Nt.value=ze}const At=t.ref(o.userLanguage.value);function jn(mt){!mt||!i.value||o.addPredefinedEmbed(i.value.modelId,mt)}return(mt,ze)=>t.unref(i)?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-aw",disabled:!t.unref(o).editable.value},[t.createElementVNode("div",PC,[t.createElementVNode("span",zC,t.toDisplayString(t.unref(o).t("em.attr.section",{n:jt.value})),1),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:ze[0]||(ze[0]=Y=>t.unref(o).addAttribute(t.unref(i).modelId))},null,8,["caption"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t("em.attr.addDivider"),onClick:ze[1]||(ze[1]=Y=>t.unref(o).addDivider(t.unref(i).modelId))},null,8,["caption"]),t.unref(ie).length?(t.openBlock(),t.createBlock(t.unref(ne.BSSelect),{key:0,width:"140px",placeholder:t.unref(o).t("em.attr.addEmbeddable"),"model-value":void 0,items:t.unref(ie),"value-provider":Y=>Y.type,"label-provider":t.unref(Ie),"onUpdate:modelValue":jn},null,8,["placeholder","items","value-provider","label-provider"])):t.createCommentVNode("",!0)]),t.createElementVNode("div",FC,[t.createElementVNode("table",UC,[t.createElementVNode("thead",null,[t.createElementVNode("tr",null,[ze[3]||(ze[3]=t.createElementVNode("th",{class:"c-expand"},null,-1)),t.createElementVNode("th",HC,t.toDisplayString(t.unref(o).t("em.attr.namePlaceholder")),1),t.createElementVNode("th",jC,t.toDisplayString(t.unref(o).t("em.attr.typePlaceholder")),1),t.createElementVNode("th",KC,[t.createElementVNode("span",{id:`aw-logical-head-${t.unref(i).modelId}`},t.toDisplayString(t.unref(o).t("em.attr.logicalPlaceholder")),9,GC),t.createVNode(_h,{modelValue:At.value,"onUpdate:modelValue":ze[2]||(ze[2]=Y=>At.value=Y),languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"labelled-by":`aw-logical-head-${t.unref(i).modelId}`},null,8,["modelValue","languages","default-lang","labelled-by"])]),t.createElementVNode("th",YC,t.toDisplayString(t.unref(o).t("em.attr.columnPhysical")),1),ze[4]||(ze[4]=t.createElementVNode("th",{class:"c-dtype"},"dataType",-1)),ze[5]||(ze[5]=t.createElementVNode("th",{class:"c-len"},"len",-1)),t.createElementVNode("th",qC,t.toDisplayString(t.unref(o).t("em.attr.constraints")),1),ze[6]||(ze[6]=t.createElementVNode("th",{class:"c-del"},null,-1))])]),t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(et.value,Y=>{var Wt,G,ae,De,je,bt,Vt,Ye,Ue;return t.openBlock(),t.createElementBlock(t.Fragment,{key:Y.modelId},[Y.attrType==="DIVIDER"?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["em-aw__divider-row",{"is-focused":t.unref(l).has(Y.modelId)}])},[ze[7]||(ze[7]=t.createElementVNode("td",{class:"c-expand"},null,-1)),t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-divlabel-${Y.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.dividerLabelPlaceholder"),"model-value":Y.name,"onUpdate:modelValue":w=>t.unref(g)(Y,{name:w})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",{colspan:QS,class:"em-aw__divider-note"},t.toDisplayString(t.unref(o).t("em.attr.dividerNote")),1),t.createElementVNode("td",WC,[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:w=>t.unref(o).removeAttribute(t.unref(i).modelId,Y.modelId)},null,8,["onClick"])])],2)):t.unref(Q)(Y)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("tr",{class:t.normalizeClass(["em-aw__embed-parent",{"is-focused":t.unref(l).has(Y.modelId)}])},[t.createElementVNode("td",NS,[t.unref(fe)(Y)?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["em-aw__caret",{"is-open":ut(Y.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ut(Y.modelId)?"em.attr.detailCollapse":"em.attr.detailExpand"),onClick:w=>yt(Y.modelId),onKeydown:[t.withKeys(t.withModifiers(w=>yt(Y.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(w=>yt(Y.modelId),["prevent"]),["space"])]},[t.createVNode(xe,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,wS)):(t.openBlock(),t.createElementBlock("span",IS,[t.createVNode(xe,{name:"chevron",size:14,class:"em-aw__caret-ic"})]))]),t.createElementVNode("td",{title:t.unref(S)(Y)?t.unref(N)(Y):void 0},[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-name-${Y.modelId}`,width:"100%",disabled:t.unref(S)(Y),placeholder:t.unref(_)(Y),"model-value":t.unref(k)(Y),"onUpdate:modelValue":w=>t.unref(h)(Y,w)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])],8,vS),t.createElementVNode("td",{title:t.unref(D)(Y)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-type-${Y.modelId}`,width:"100%",disabled:"","model-value":Y.type},null,8,["name","model-value"])],8,CS),t.createElementVNode("td",{colspan:t.unref(fe)(Y)?Eh-1:Eh,class:"em-aw__embed-note"},t.toDisplayString(t.unref(fe)(Y)?t.unref(o).t("em.attr.fkChildCols",{n:Y.dbAttrs.length}):t.unref(o).t("em.attr.embedChildCols",{n:Y.dbAttrs.length})),9,SS),t.unref(fe)(Y)?(t.openBlock(),t.createElementBlock("td",{key:0,class:"c-constraints",title:t.unref(o).t("em.attr.fkDerivedNote")},[t.createElementVNode("div",AS,[t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-pk-${Y.modelId}`,label:"PK","model-value":Y.identifier,disabled:"","onUpdate:modelValue":w=>t.unref(O)(Y,w)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-nn-${Y.modelId}`,label:"NN","model-value":Y.notNull,disabled:"","onUpdate:modelValue":w=>t.unref(g)(Y,{notNull:w})},null,8,["name","model-value","onUpdate:modelValue"])])],8,RS)):t.createCommentVNode("",!0),t.createElementVNode("td",{class:"c-del",title:t.unref(A)(Y)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:w=>t.unref(o).removeAttribute(t.unref(i).modelId,Y.modelId)},null,8,["onClick"])],8,xS)],2),t.unref(fe)(Y)&&ut(Y.modelId)?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["em-aw__detail-row",{"is-focused":t.unref(l).has(Y.modelId)}])},[ze[15]||(ze[15]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",$S,[t.createElementVNode("div",TS,[t.createElementVNode("fieldset",MS,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`aw-desc-${Y.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":Y.description,"onUpdate:modelValue":w=>t.unref(Z)(Y,w)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])])])],2)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Y.dbAttrs,(w,H)=>{var se,_e,$e,Oe,He;return t.openBlock(),t.createElementBlock(t.Fragment,{key:w.modelId},[t.createElementVNode("tr",{class:t.normalizeClass(["em-aw__embed-col",{"em-aw__open":ut(w.modelId)}])},[t.createElementVNode("td",VS,[t.createElementVNode("span",{class:t.normalizeClass(["em-aw__caret",{"is-open":ut(w.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ut(w.modelId)?"em.attr.overrideCollapse":"em.attr.overrideExpand"),onClick:Ke=>yt(w.modelId),onKeydown:[t.withKeys(t.withModifiers(Ke=>yt(w.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(Ke=>yt(w.modelId),["prevent"]),["space"])]},[t.createVNode(xe,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,LS)]),t.createElementVNode("td",BS,"↳ "+t.toDisplayString(((se=t.unref(Ne)(Y,H))==null?void 0:se.name)??((_e=t.unref(Ne)(Y,H))==null?void 0:_e.physicalName)??t.unref(o).t("em.attr.colFallback",{n:H+1})),1),ze[16]||(ze[16]=t.createElementVNode("td",null,null,-1)),t.createElementVNode("td",null,[t.createVNode(Qt,{name:`aw-embed-logical-${w.modelId}`,languages:t.unref(o).languages.value,"active-lang":At.value,placeholder:t.unref(Ct)(($e=t.unref(Ne)(Y,H))==null?void 0:$e.logicalName,At.value)??t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":w.logicalName,"onUpdate:modelValue":Ke=>t.unref(Ee)(Y,H,Ke)},null,8,["name","languages","active-lang","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",{title:t.unref(qe)(w)?t.unref(o).t("em.attr.embedSharedHint"):void 0},[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-embed-col-${w.modelId}`,width:"100%",disabled:t.unref(qe)(w),placeholder:((Oe=t.unref(Ne)(Y,H))==null?void 0:Oe.physicalName)??t.unref(o).t("em.attr.columnPlaceholder"),"model-value":t.unref(qe)(w)?t.unref(Rt)(w):w.physicalName,"onUpdate:modelValue":Ke=>t.unref(be)(Y,H,{physicalName:Ke})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(Do,{controller:t.unref(o),"ref-id":w.modelId},null,8,["controller","ref-id"])],8,DS),t.createElementVNode("td",{title:t.unref(ge)(Y)},[t.createElementVNode("span",PS,t.toDisplayString(t.unref(J)(Y,H)),1)],8,OS),t.createElementVNode("td",{title:t.unref(ge)(Y)},[t.createElementVNode("span",FS,t.toDisplayString(t.unref(ee)(Y,H)??""),1)],8,zS),t.createElementVNode("td",{class:"c-constraints",title:t.unref(ge)(Y)},[t.createElementVNode("span",HS,t.toDisplayString(t.unref(te)(Y,H)!=null?`scale ${t.unref(te)(Y,H)}`:""),1)],8,US),ze[17]||(ze[17]=t.createElementVNode("td",null,null,-1))],2),ut(w.modelId)?(t.openBlock(),t.createElementBlock("tr",jS,[ze[20]||(ze[20]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",KS,[t.createElementVNode("div",GS,[t.createElementVNode("fieldset",YS,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.attr.overrideLegend")),1),(He=t.unref(Ne)(Y,H))!=null&&He.shareable?(t.openBlock(),t.createElementBlock("label",qS,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.currencyColumn")),1),t.createVNode(t.unref(ne.BSSelect),{width:"150px","model-value":t.unref(ct)(w),items:t.unref(ke)(),"value-provider":t.unref(d),"label-provider":t.unref(Ze),"onUpdate:modelValue":Ke=>Ke&&t.unref(ft)(Y,H,Ke)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.createElementVNode("label",WS,[ze[18]||(ze[18]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"110px",disabled:t.unref(qe)(w),"model-value":t.unref(qe)(w)?"false":t.unref(ve)(w),items:t.unref(ht),"value-provider":t.unref(d),"label-provider":t.unref(re),"onUpdate:modelValue":Ke=>Ke&&t.unref(le)(Y,H,Ke)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",JS,[ze[19]||(ze[19]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"110px",disabled:t.unref(qe)(w),"model-value":t.unref(qe)(w)?"false":t.unref(Me)(w),items:t.unref(Re),"value-provider":t.unref(d),"label-provider":t.unref(Pe),"onUpdate:modelValue":Ke=>Ke&&t.unref(Qe)(Y,H,Ke)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])])])])])])):t.createCommentVNode("",!0)],64)}),128))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("tr",{class:t.normalizeClass({"is-focused":t.unref(l).has(Y.modelId),"em-aw__open":ut(Y.modelId)})},[t.createElementVNode("td",JC,[t.createElementVNode("span",{class:t.normalizeClass(["em-aw__caret",{"is-open":ut(Y.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ut(Y.modelId)?"em.attr.detailCollapse":"em.attr.detailExpand"),onClick:w=>yt(Y.modelId),onKeydown:[t.withKeys(t.withModifiers(w=>yt(Y.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(w=>yt(Y.modelId),["prevent"]),["space"])]},[t.createVNode(xe,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,XC)]),t.createElementVNode("td",{title:t.unref(S)(Y)?t.unref(N)(Y):t.unref(b)(Y)?t.unref(o).t("em.attr.derivedIdNote"):void 0},[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-name-${Y.modelId}`,width:"100%",disabled:t.unref(S)(Y),placeholder:t.unref(_)(Y),"model-value":t.unref(k)(Y),"onUpdate:modelValue":w=>t.unref(h)(Y,w)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])],8,ZC),t.createElementVNode("td",{title:t.unref(D)(Y)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(ne.BSSelect),{name:`aw-type-${Y.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.typePlaceholder"),disabled:t.unref(R)(Y),items:t.unref(fd)(Y.type,t.unref(oe),t.unref(de),t.unref(ie)),"value-provider":t.unref(I),"label-provider":t.unref(x),"model-value":Y.type,"onUpdate:modelValue":w=>t.unref($)(Y,w)},null,8,["name","placeholder","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),Y.type===t.unref(pn)&&!t.unref(D)(Y)?(t.openBlock(),t.createBlock(t.unref(ne.BSTextInput),{key:0,name:`aw-customtype-${Y.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.customTypePlaceholder"),"model-value":Y.customType??"","onUpdate:modelValue":w=>t.unref(U)(Y,w)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])):t.createCommentVNode("",!0)],8,QC),t.createElementVNode("td",null,[Y.attrType!=="RELATION_REF"?(t.openBlock(),t.createBlock(Qt,{key:0,name:`aw-logical-${Y.modelId}`,languages:t.unref(o).languages.value,"active-lang":At.value,placeholder:t.unref(f)(Y,At.value),"model-value":t.unref(u)(Y),"onUpdate:modelValue":w=>t.unref(m)(Y,w)},null,8,["name","languages","active-lang","placeholder","model-value","onUpdate:modelValue"])):(t.openBlock(),t.createElementBlock("span",eS,"—"))]),t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-col-${Y.modelId}`,width:"100%",placeholder:t.unref(E)(Y)??t.unref(o).t("em.attr.columnPlaceholder"),disabled:t.unref(r)||t.unref(P)(Y),"model-value":((Wt=Y.dbAttrs[0])==null?void 0:Wt.physicalName)??"","onUpdate:modelValue":w=>t.unref(F)(Y,{physicalName:w})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),t.createVNode(Do,{controller:t.unref(o),"ref-id":(G=Y.dbAttrs[0])==null?void 0:G.modelId},null,8,["controller","ref-id"])]),t.unref(r)?(t.openBlock(),t.createElementBlock("td",{key:0,title:t.unref(o).t("em.attr.serializedNoColumnNote")},[t.createVNode(t.unref(ne.BSSelect),{name:`aw-container-${Y.modelId}`,width:"100%",items:[...t.unref(p)],"value-provider":t.unref(d),"label-provider":w=>w==="none"?t.unref(o).t("em.attr.serializedContainerNone"):w,"model-value":Y.collectionType??"none","onUpdate:modelValue":w=>w&&t.unref(y)(Y,w)},null,8,["name","items","value-provider","label-provider","model-value","onUpdate:modelValue"])],8,tS)):(t.openBlock(),t.createElementBlock("td",{key:1,title:t.unref(D)(Y)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(ne.BSSelect),{name:`aw-dtype-${Y.modelId}`,width:"100%",placeholder:"dataType",disabled:t.unref(P)(Y)||t.unref(D)(Y),items:t.unref(ld)(((ae=Y.dbAttrs[0])==null?void 0:ae.dataType)??"",t.unref(o).selectableDataTypes.value),"value-provider":t.unref(d),"label-provider":t.unref(hl),"model-value":((De=Y.dbAttrs[0])==null?void 0:De.dataType)??"","onUpdate:modelValue":w=>w&&t.unref(F)(Y,{dataType:w})},null,8,["name","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"])],8,nS)),t.createElementVNode("td",{title:t.unref(D)(Y)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(ne.BSNumberInput),{name:`aw-len-${Y.modelId}`,width:"100%",placeholder:"len",disabled:t.unref(P)(Y)||t.unref(D)(Y),"model-value":(je=Y.dbAttrs[0])==null?void 0:je.length,"onUpdate:modelValue":w=>t.unref(F)(Y,{length:w||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,oS),t.createElementVNode("td",{class:"c-constraints",title:t.unref(D)(Y)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createElementVNode("div",aS,[t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-pk-${Y.modelId}`,label:"PK","model-value":Y.identifier,disabled:t.unref(a)||t.unref(P)(Y)||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(O)(Y,w)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-nn-${Y.modelId}`,label:"NN","model-value":t.unref(r)?!1:Y.notNull,disabled:t.unref(r)||t.unref(P)(Y)||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(g)(Y,{notNull:w})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-uq-${Y.modelId}`,label:"UQ","model-value":!!((bt=Y.dbAttrs[0])!=null&&bt.unique),disabled:t.unref(P)(Y)||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(F)(Y,{unique:w})},null,8,["name","model-value","disabled","onUpdate:modelValue"])])],8,iS),t.createElementVNode("td",{class:"c-del",title:t.unref(A)(Y)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:w=>t.unref(o).removeAttribute(t.unref(i).modelId,Y.modelId)},null,8,["onClick"])],8,rS)],2),t.unref(b)(Y)?(t.openBlock(),t.createElementBlock("tr",lS,[ze[8]||(ze[8]=t.createElementVNode("td",{class:"c-expand"},null,-1)),t.createElementVNode("td",sS,"↳ "+t.toDisplayString(t.unref(o).t("em.attr.assocField")),1),t.createElementVNode("td",{colspan:"7",title:t.unref(o).t("em.attr.derivedIdNote")},[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-assocname-${Y.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.namePlaceholder"),"model-value":t.unref(C)(Y),"onUpdate:modelValue":w=>t.unref(v)(Y,w)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])],8,cS)])):t.createCommentVNode("",!0),ut(Y.modelId)?(t.openBlock(),t.createElementBlock("tr",{key:1,class:t.normalizeClass(["em-aw__detail-row",{"is-focused":t.unref(l).has(Y.modelId)}])},[ze[14]||(ze[14]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",dS,[t.createElementVNode("div",uS,[t.createElementVNode("fieldset",mS,[ze[12]||(ze[12]=t.createElementVNode("legend",null,"DB",-1)),t.createElementVNode("label",{class:"em-aw__df",title:t.unref(j)(Y)},[ze[9]||(ze[9]=t.createElementVNode("span",null,"scale",-1)),t.createVNode(t.unref(ne.BSNumberInput),{name:`aw-scale-${Y.modelId}`,width:"72px",placeholder:"scale",disabled:t.unref(P)(Y)||t.unref(D)(Y)||!t.unref(B)(Y),"model-value":(Vt=Y.dbAttrs[0])==null?void 0:Vt.scale,"onUpdate:modelValue":w=>t.unref(F)(Y,{scale:w||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,fS),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-ai-${Y.modelId}`,label:"Auto Increment","model-value":!!((Ye=Y.dbAttrs[0])!=null&&Ye.autoIncrement),disabled:t.unref(P)(Y)||t.unref(D)(Y)||!Y.identifier,"onUpdate:modelValue":w=>t.unref(F)(Y,{autoIncrement:w})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createElementVNode("label",pS,[ze[10]||(ze[10]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(ne.BSSelect),{name:`aw-ins-${Y.modelId}`,width:"110px",disabled:t.unref(P)(Y),"model-value":t.unref(ve)(Y.dbAttrs[0]),items:t.unref(ht),"value-provider":t.unref(d),"label-provider":t.unref(re),"onUpdate:modelValue":w=>w&&t.unref(me)(Y,w)},null,8,["name","disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",hS,[ze[11]||(ze[11]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(ne.BSSelect),{name:`aw-upd-${Y.modelId}`,width:"110px",disabled:t.unref(P)(Y),"model-value":t.unref(Me)(Y.dbAttrs[0]),items:t.unref(Re),"value-provider":t.unref(d),"label-provider":t.unref(Pe),"onUpdate:modelValue":w=>w&&t.unref(Ot)(Y,w)},null,8,["name","disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])])]),t.createElementVNode("fieldset",yS,[ze[13]||(ze[13]=t.createElementVNode("legend",null,"JPA",-1)),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-tr-${Y.modelId}`,label:"@Transient","model-value":!!Y.transient,disabled:Y.identifier||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(z)(Y,w)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-nid-${Y.modelId}`,label:"@NaturalId","model-value":!!Y.naturalId,disabled:Y.identifier||t.unref(P)(Y)||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(T)(Y,w)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{class:"em-aw__dsub",name:`aw-nidm-${Y.modelId}`,label:"mutable","model-value":!!Y.naturalIdMutable,disabled:t.unref(P)(Y)||!Y.naturalId,"onUpdate:modelValue":w=>t.unref(g)(Y,{naturalIdMutable:w||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-mv-${Y.modelId}`,label:"Multi-Value (Set)","model-value":!!((Ue=Y.dbAttrs[0])!=null&&Ue.multiValue),disabled:t.unref(P)(Y)||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(F)(Y,{multiValue:w||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),t.unref(D)(Y)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("fieldset",gS,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.attr.semanticLegend")),1),t.createElementVNode("label",bS,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createVNode(t.unref(ne.BSSelect),{width:"150px","model-value":t.unref(X)(Y),items:t.unref(s),"value-provider":t.unref(d),"label-provider":t.unref(c),"onUpdate:modelValue":w=>w&&t.unref(W)(Y,w)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.unref(Le).length?(t.openBlock(),t.createElementBlock("label",kS,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.codeGroup")),1),t.createVNode(kh,{"model-value":Y.groupCode,items:t.unref(Le),locale:t.unref(o).uiLocale.value,"onUpdate:modelValue":w=>t.unref(V)(Y,w)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.createElementVNode("label",_S,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.defaultValue")),1),t.unref(Se)(Y).length?(t.openBlock(),t.createBlock(t.unref(ne.BSSelect),{key:0,width:"150px","model-value":Y.defaultValue??"none",items:t.unref(ce)(Y),"value-provider":t.unref(pe),"label-provider":t.unref(he),"onUpdate:modelValue":w=>w&&t.unref(L)(Y,w)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])):(t.openBlock(),t.createBlock(t.unref(ne.BSTextInput),{key:1,name:`aw-default-${Y.modelId}`,width:"150px",placeholder:t.unref(o).t("em.attr.defaultValue"),"model-value":Y.defaultValue??"","onUpdate:modelValue":w=>t.unref(K)(Y,w)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))])])),t.createElementVNode("fieldset",ES,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`aw-desc-${Y.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":Y.description,"onUpdate:modelValue":w=>t.unref(Z)(Y,w)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])])])],2)):t.createCommentVNode("",!0)],64))],64)}),128)),t.unref(i).attributes.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("tr",XS,[t.createElementVNode("td",ZS,t.toDisplayString(t.unref(o).t("em.attr.empty")),1)]))])])])],8,OC)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-472632d9"]]);function oc(e,n){return n&&n!==e?`${e} (${n})`:e}function Nh(e,n,o){const i=e.dbAttrs[n];return i?_i(e,i,n,o.entity,o.logical,{embeddableCatalog:o.embeddableCatalog}):""}function tR(e,n){const o=e.name||n.t("em.index.unnamedAttr");return e.dbAttrs.length>1?n.t("em.index.multiColumn",{name:o,n:e.dbAttrs.length}):oc(o,Nh(e,0,n))}function ic(e,n){var l;if(co(e)){const s=(l=n.inherited)==null?void 0:l.find(c=>c.modelId===e);return s?oc(s.field,s.physicalName):e}const o=n.resolver.attributeOf(e);if(!o)return e;const i=o.name||n.t("em.index.unnamedAttr"),a=n.resolver.columnOf(e);if(!a)return n.t("em.index.colUnspecified",{name:i,n:o.dbAttrs.length});const r=o.dbAttrs.findIndex(s=>s.modelId===a.modelId);return oc(i,Nh(o,r<0?0:r,n))}function wh(e){const n=[];for(const o of e.entity.attributes??[]){const i=o.dbAttrs.filter(a=>!a.sharedColumnRef);if(i.length!==0){if(o.dbAttrs.length===1){n.push({ref:o.modelId,label:tR(o,e)});continue}for(const a of i)n.push({ref:a.modelId,label:ic(a.modelId,e)})}}return n}const nR=["disabled"],oR={class:"em-idxw__list"},iR={class:"em-idxw__list-head"},aR=["aria-label"],rR=["aria-current","onClick","onKeydown"],lR={class:"em-idxw__item-name"},sR={key:0,class:"em-idxw__badge"},cR={class:"em-idxw__item-cnt"},dR={key:0,class:"em-idxw__empty"},uR={key:0,class:"em-idxw__edit"},mR={class:"em-idxw__form"},fR={class:"em-field em-idxw__name"},pR={class:"em-field"},hR=["value","placeholder"],yR={class:"em-idxw__transfer"},gR={class:"em-idxw__pane"},bR={class:"em-idxw__pane-head"},kR=["aria-label"],_R=["aria-pressed","onClick","onKeydown"],ER=["title"],NR={key:0,class:"em-idxw__empty"},wR={class:"em-idxw__arrows"},IR={class:"em-idxw__pane"},vR={class:"em-idxw__pane-head"},CR={class:"em-idxw__col-name"},SR=["title"],RR={class:"em-idxw__col-ops"},AR=["title","disabled","onClick"],xR=["title","disabled","onClick"],$R=["title","onClick"],TR={key:0,class:"em-idxw__empty"},MR={key:1,class:"em-idxw__edit em-idxw__edit--empty"},VR=tt(t.defineComponent({__name:"EntityIndexesWide",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=t.computed(()=>o.state.logical.entities.find(D=>D.modelId===n.entityId)??null),a=t.computed(()=>{var D;return((D=i.value)==null?void 0:D.indexes)??[]}),r=t.computed(()=>{var D;return((D=i.value)==null?void 0:D.attributes)??[]}),l=t.ref(null),s=t.ref(null);t.watch(a,D=>{var E;D.some(R=>R.modelId===s.value)||(s.value=((E=D[0])==null?void 0:E.modelId)??null)},{immediate:!0});const c=t.computed(()=>a.value.find(D=>D.modelId===s.value)??null),d=t.computed(()=>i.value?bi(i.value,o.superClassCatalog.value):[]),u=t.computed(()=>so(r.value)),m=D=>u.value.canon(D),f=t.computed(()=>{var D;return new Set((((D=c.value)==null?void 0:D.columns)??[]).map(E=>m(E.columnRef)))}),p=t.computed(()=>({entity:i.value??{modelId:"",name:"",stereotype:"JPA_ENTITY",attributes:[]},logical:o.state.logical,resolver:u.value,inherited:d.value,embeddableCatalog:o.embeddableCatalog.value,t:o.t}));function y(D){return D.physicalName&&D.physicalName!==D.field?`${D.field} (${D.physicalName})`:D.field}function g(D){return ic(D,p.value)}const b=t.computed(()=>[...wh(p.value).filter(D=>!f.value.has(m(D.ref))).map(D=>({ref:D.ref,label:D.label,inherited:!1})),...d.value.filter(D=>!f.value.has(m(D.modelId))).map(D=>({ref:D.modelId,label:y(D),inherited:!0}))]),k=t.ref(new Set);t.watch(s,()=>k.value=new Set);function _(D){return co(D)}function h(D,E){i.value&&o.updateIndex(i.value.modelId,D,E)}function C(){var E;if(!i.value)return;const D=Fe();o.addIndex(i.value.modelId,{modelId:D,name:`idx_${(((E=i.value.indexes)==null?void 0:E.length)??0)+1}`,unique:!1,columns:[]}),s.value=D}function v(D){i.value&&o.removeIndex(i.value.modelId,D)}function S(D){c.value&&h(c.value.modelId,{parameters:D.trim()===""?void 0:D})}function N(D){const E=new Set(k.value);E.has(D)?E.delete(D):E.add(D),k.value=E}function A(){const D=c.value;if(!D||!k.value.size)return;const E=[...k.value].map(R=>({columnRef:R,descending:!1}));h(D.modelId,{columns:[...D.columns,...E]}),k.value=new Set}function T(D){const E=c.value;E&&h(E.modelId,{columns:E.columns.filter((R,I)=>I!==D)})}function O(D,E){const R=c.value;R&&h(R.modelId,{columns:R.columns.map((I,x)=>x===D?{...I,descending:E}:I)})}function z(D,E){const R=c.value;if(!R)return;const I=D+E;if(I<0||I>=R.columns.length)return;const x=[...R.columns];[x[D],x[I]]=[x[I],x[D]],h(R.modelId,{columns:x}),P(I,E)}async function P(D,E){var U,F;await t.nextTick();const R=(U=l.value)==null?void 0:U.querySelectorAll(".em-idxw__col--idx")[D];if(!R)return;const I=B=>R.querySelector(`[data-move="${B}"]`),x=I(E<0?"up":"down"),$=I(E<0?"down":"up");(F=x&&!x.disabled?x:$)==null||F.focus()}return(D,E)=>i.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-idxw",disabled:!t.unref(o).editable.value},[t.createElementVNode("aside",oR,[t.createElementVNode("div",iR,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.index.section",{n:a.value.length})),1),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:C},null,8,["caption"])]),t.createElementVNode("ul",{role:"group","aria-label":t.unref(o).t("em.index.section",{n:a.value.length})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,R=>(t.openBlock(),t.createElementBlock("li",{key:R.modelId,class:t.normalizeClass(["em-idxw__item",{"is-active":R.modelId===s.value}]),role:"button",tabindex:"0","aria-current":R.modelId===s.value?"true":void 0,onClick:I=>s.value=R.modelId,onKeydown:[t.withKeys(t.withModifiers(I=>s.value=R.modelId,["prevent"]),["enter"]),t.withKeys(t.withModifiers(I=>s.value=R.modelId,["prevent"]),["space"])]},[t.createElementVNode("span",lR,t.toDisplayString(R.name||t.unref(o).t("em.attr.nameless")),1),R.unique?(t.openBlock(),t.createElementBlock("span",sR,"UQ")):t.createCommentVNode("",!0),t.createElementVNode("span",cR,t.toDisplayString(R.columns.length),1)],42,rR))),128))],8,aR),a.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",dR,t.toDisplayString(t.unref(o).t("em.index.empty")),1))]),c.value?(t.openBlock(),t.createElementBlock("section",uR,[t.createElementVNode("div",mR,[t.createElementVNode("label",fR,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.index.namePlaceholder")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"idxw-name",width:"100%","model-value":c.value.name,"onUpdate:modelValue":E[0]||(E[0]=R=>h(c.value.modelId,{name:R}))},null,8,["model-value"]),t.createVNode(Do,{controller:t.unref(o),"ref-id":c.value.modelId},null,8,["controller","ref-id"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:"idxw-uq",class:"em-check em-idxw__uq",label:"unique","model-value":c.value.unique,"onUpdate:modelValue":E[1]||(E[1]=R=>h(c.value.modelId,{unique:R}))},null,8,["model-value"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn em-idxw__del",caption:t.unref(o).t("em.index.delete"),onClick:E[2]||(E[2]=R=>v(c.value.modelId))},null,8,["caption"])]),t.createElementVNode("label",pR,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.index.condition")),1),t.createElementVNode("textarea",{class:"em-textarea",value:c.value.parameters??"",rows:"2",placeholder:t.unref(o).t("em.index.conditionPlaceholderWide"),onChange:E[3]||(E[3]=R=>S(R.target.value))},null,40,hR)]),t.createElementVNode("div",yR,[t.createElementVNode("div",gR,[t.createElementVNode("div",bR,t.toDisplayString(t.unref(o).t("em.index.availColumns",{n:b.value.length})),1),t.createElementVNode("ul",{class:"em-idxw__cols",role:"group","aria-label":t.unref(o).t("em.index.availColumns",{n:b.value.length})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,R=>(t.openBlock(),t.createElementBlock("li",{key:R.ref,class:t.normalizeClass(["em-idxw__col",{"is-sel":k.value.has(R.ref)}]),role:"button",tabindex:"0","aria-pressed":k.value.has(R.ref),onClick:I=>N(R.ref),onKeydown:[t.withKeys(t.withModifiers(I=>N(R.ref),["prevent"]),["enter"]),t.withKeys(t.withModifiers(I=>N(R.ref),["prevent"]),["space"])]},[t.createTextVNode(t.toDisplayString(R.label),1),R.inherited?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-idxw__inh",title:t.unref(o).t("em.index.inheritedColTitle")},t.toDisplayString(t.unref(o).t("em.index.inheritedBadge")),9,ER)):t.createCommentVNode("",!0)],42,_R))),128))],8,kR),b.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",NR,t.toDisplayString(t.unref(o).t("em.index.allColumnsUsed")),1))]),t.createElementVNode("div",wR,[t.createVNode(t.unref(ne.BSButton),{caption:t.unref(o).t("em.index.addArrow"),disabled:!k.value.size,onClick:A},null,8,["caption","disabled"])]),t.createElementVNode("div",IR,[t.createElementVNode("div",vR,t.toDisplayString(t.unref(o).t("em.index.indexColumns",{n:c.value.columns.length})),1),t.createElementVNode("ul",{ref_key:"colsUl",ref:l,class:"em-idxw__cols"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value.columns,(R,I)=>(t.openBlock(),t.createElementBlock("li",{key:I,class:"em-idxw__col em-idxw__col--idx"},[t.createElementVNode("span",CR,[t.createTextVNode(t.toDisplayString(g(R.columnRef)),1),_(R.columnRef)?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-idxw__inh",title:t.unref(o).t("em.index.inheritedColTitle")},t.toDisplayString(t.unref(o).t("em.index.inheritedBadge")),9,SR)):t.createCommentVNode("",!0)]),t.createVNode(t.unref(ne.BSCheckbox),{name:`idxw-desc-${I}`,class:"em-check",label:"DESC","model-value":R.descending,"onUpdate:modelValue":x=>O(I,x)},null,8,["name","model-value","onUpdate:modelValue"]),t.createElementVNode("span",RR,[t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn","data-move":"up",title:t.unref(o).t("em.index.moveUp"),disabled:I===0,onClick:x=>z(I,-1)},"↑",8,AR),t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn","data-move":"down",title:t.unref(o).t("em.index.moveDown"),disabled:I===c.value.columns.length-1,onClick:x=>z(I,1)},"↓",8,xR),t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn em-idxw__opbtn--del",title:t.unref(o).t("em.index.removeColumn"),onClick:x=>T(I)},"✕",8,$R)])]))),128)),c.value.columns.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("li",TR,t.toDisplayString(t.unref(o).t("em.index.noColumns")),1))],512)])])])):(t.openBlock(),t.createElementBlock("section",MR,t.toDisplayString(t.unref(o).t("em.index.selectPrompt")),1))],8,nR)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-76dd7610"]]),LR={class:"em-op-src"},BR=["placeholder"],DR={class:"em-op-src__actions"},Ih=tt(t.defineComponent({__name:"OperationSourceEditor",props:{operationName:{},sourceCode:{},onSave:{type:Function},locale:{}},setup(e){const n=e,o=ne.useModalHandle(),i=(l,s)=>cn(n.locale??"ko",l,s),a=t.ref(n.sourceCode);function r(){n.onSave(a.value),o.close()}return(l,s)=>(t.openBlock(),t.createBlock(t.unref(ne.BSModalFrame),{title:i("em.opSource.title",{name:n.operationName})},{default:t.withCtx(()=>[t.createElementVNode("div",LR,[t.withDirectives(t.createElementVNode("textarea",{"onUpdate:modelValue":s[0]||(s[0]=c=>a.value=c),class:"em-op-src__area",spellcheck:"false",placeholder:i("em.opSource.placeholder")},null,8,BR),[[t.vModelText,a.value]]),t.createElementVNode("div",DR,[t.createVNode(t.unref(ne.BSButton),{caption:i("em.common.save"),onClick:r},null,8,["caption"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:i("em.common.close"),onClick:s[1]||(s[1]=c=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-34c9b822"]]),OR=["disabled"],PR={class:"em-ow__toolbar"},zR={class:"em-ow__count"},FR={class:"em-ow__scroll"},UR={class:"em-ow__table"},HR={class:"c-name"},jR={class:"c-desc"},KR=["id"],GR={class:"c-pii"},YR={class:"c-src"},qR={class:"c-del"},WR={key:0},JR={colspan:"6",class:"em-ow__empty"},XR=tt(t.defineComponent({__name:"EntityOperationsWide",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=ne.useModal(),a=t.computed(()=>o.state.logical.entities.find(b=>b.modelId===n.entityId)??null),r=t.computed(()=>{var b;return[...((b=a.value)==null?void 0:b.operations)??[]].sort((k,_)=>k.order-_.order)}),l=t.ref(o.userLanguage.value),s=["PUBLIC","PROTECTED","PACKAGE","PRIVATE"],c=["none","PASSWORD","SOCIAL_SECURITY_NO","PASSPORT_NO","ALIEN_REGISTRATION_NO","DRIVERS_LICENSE_NO","BIOMETRICS","CREDITCARD_NO","ACCOUNT_NO","MEMBERSHIP_CARD_NO","ID","NAME","DATE_OF_BIRTH","PHONE_NO","EMAIL_ADDRESS","ADDRESS","IP_ADDRESS"];function d(b){return b==="none"?o.t("em.common.noneParen"):b}const u=b=>b;function m(b,k){a.value&&o.updateOperation(a.value.modelId,b.modelId,k)}function f(b,k){m(b,{description:Object.keys(k).length?k:void 0})}function p(b){return b.personalInfoAttributeType??"none"}function y(b,k){m(b,{personalInfoAttributeType:k==="none"?void 0:k})}function g(b){i.openModal({component:Ih,bind:{operationName:b.name,sourceCode:b.sourceCode??"",locale:o.uiLocale.value,onSave:k=>m(b,{sourceCode:k})}})}return(b,k)=>{var _,h;return a.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-ow",disabled:!t.unref(o).editable.value},[t.createElementVNode("div",PR,[t.createElementVNode("span",zR,t.toDisplayString(t.unref(o).t("em.op.section",{n:((_=a.value.operations)==null?void 0:_.length)??0})),1),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:k[0]||(k[0]=C=>t.unref(o).addOperation(a.value.modelId))},null,8,["caption"])]),t.createElementVNode("div",FR,[t.createElementVNode("table",UR,[t.createElementVNode("thead",null,[t.createElementVNode("tr",null,[t.createElementVNode("th",HR,t.toDisplayString(t.unref(o).t("em.attr.namePlaceholder")),1),k[2]||(k[2]=t.createElementVNode("th",{class:"c-vis"},"visibility",-1)),t.createElementVNode("th",jR,[t.createElementVNode("span",{id:`ow-desc-head-${a.value.modelId}`},t.toDisplayString(t.unref(o).t("em.common.description")),9,KR),t.createVNode(_h,{modelValue:l.value,"onUpdate:modelValue":k[1]||(k[1]=C=>l.value=C),languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"labelled-by":`ow-desc-head-${a.value.modelId}`},null,8,["modelValue","languages","default-lang","labelled-by"])]),t.createElementVNode("th",GR,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createElementVNode("th",YR,t.toDisplayString(t.unref(o).t("em.op.body")),1),k[3]||(k[3]=t.createElementVNode("th",{class:"c-del"},null,-1))])]),t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,C=>(t.openBlock(),t.createElementBlock("tr",{key:C.modelId},[t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSTextInput),{name:`ow-name-${C.modelId}`,width:"100%",placeholder:t.unref(o).t("em.op.namePlaceholder"),"model-value":C.name,"onUpdate:modelValue":v=>m(C,{name:v})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSSelect),{width:"100%","model-value":C.visibility??"PACKAGE",items:s,"value-provider":u,"label-provider":u,"onUpdate:modelValue":v=>v&&m(C,{visibility:v})},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(Qt,{name:`ow-desc-${C.modelId}`,languages:t.unref(o).languages.value,"active-lang":l.value,"model-value":C.description,"onUpdate:modelValue":v=>f(C,v)},null,8,["name","languages","active-lang","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSSelect),{width:"100%","model-value":p(C),items:c,"value-provider":u,"label-provider":d,"onUpdate:modelValue":v=>v&&y(C,v)},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t(C.sourceCode?"em.op.bodyDirty":"em.op.body"),onClick:v=>g(C)},null,8,["caption","onClick"])]),t.createElementVNode("td",qR,[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:v=>t.unref(o).removeOperation(a.value.modelId,C.modelId)},null,8,["onClick"])])]))),128)),(h=a.value.operations)!=null&&h.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("tr",WR,[t.createElementVNode("td",JR,t.toDisplayString(t.unref(o).t("em.op.empty")),1)]))])])])],8,OR)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-743b04a6"]]),ZR={class:"em-detail__tabs"},QR=["onClick"],eA={key:0,class:"em-detail__lock"},tA=["disabled"],nA={key:0,class:"em-detail__narrow"},oA=tt(t.defineComponent({__name:"EntityDetailModal",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=ne.useModalHandle(),a=t.computed(()=>o.isEntityLocked(n.entityId)),r=t.computed(()=>o.state.logical.entities.find(c=>c.modelId===n.entityId)??null);t.watch(r,c=>{c||i.close()});const l=[{key:"basics",labelKey:"em.detail.tabBasics"},{key:"columns",labelKey:"em.detail.tabColumns"},{key:"indexes",labelKey:"em.detail.tabIndexes"},{key:"operations",labelKey:"em.detail.tabOperations"}],s=t.ref("basics");return(c,d)=>{var u;return t.openBlock(),t.createBlock(t.unref(ne.BSModalFrame),{title:t.unref(o).t("em.detail.title",{name:((u=r.value)==null?void 0:u.name)??""})},{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["em-detail",{"is-maximized":t.unref(i).maximized}])},[t.createElementVNode("nav",ZR,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(l,m=>t.createElementVNode("button",{key:m.key,type:"button",class:t.normalizeClass(["em-detail__tab",{"is-active":s.value===m.key}]),onClick:f=>s.value=m.key},t.toDisplayString(t.unref(o).t(m.labelKey)),11,QR)),64))]),a.value?(t.openBlock(),t.createElementBlock("div",eA,[t.createVNode(xe,{name:"lock",size:13}),t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.panel.lockedBanner")),1),t.unref(o).editable.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-detail__unlock",onClick:d[0]||(d[0]=m=>t.unref(o).setEntityLocked(e.entityId,!1))},t.toDisplayString(t.unref(o).t("em.panel.unlock")),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("fieldset",{class:t.normalizeClass(["em-detail__body",{"is-readonly":!t.unref(o).editable.value||a.value}]),disabled:!t.unref(o).editable.value||a.value},[s.value==="basics"?(t.openBlock(),t.createElementBlock("div",nA,[t.createVNode(fh,{controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])])):s.value==="columns"?(t.openBlock(),t.createBlock(eR,{key:1,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])):s.value==="indexes"?(t.openBlock(),t.createBlock(VR,{key:2,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])):(t.openBlock(),t.createBlock(XR,{key:3,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"]))],10,tA)],2)):t.createCommentVNode("",!0)]),_:1},8,["title"])}}}),[["__scopeId","data-v-328396cc"]]);function Lr(e,n,o){e.openModal({component:oA,bind:{controller:t.markRaw(n),entityId:o}})}function iA(e){const{state:n,editable:o,run:i,gateEntityLocked:a,gateAssocLocked:r}=e;return{addAssociation(l,s,c,d){if(!o.value||a(l)||a(s))return null;const u=Fe(),m={modelId:u,end1:{entityRef:l,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!1,composition:!1},end2:{entityRef:s,multiplicity:"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:!1}},f={...n.logical,associations:[...n.logical.associations,m]},p=Ci(f,s,Fe),y=p.add[0];y&&(m.end2.attributeRef=y.modelId);const g={associationRef:u,waypoints:[],sourceColumnRef:c,targetColumnRef:(y==null?void 0:y.modelId)??d},b=Ka(m,g),k=Wa(f,s,p,[]);return i(k.length?rt("관계 추가",[b,...k]):b),u},addEmbedAssociation(l,s){if(!o.value||a(l))return null;const c=n.logical.entities.find(S=>S.modelId===l),d=n.logical.entities.find(S=>S.modelId===s);if(!c||!d||d.stereotype!=="JPA_EMBEDDABLE")return null;const u=Fe(),m=Fe(),f=Fe(),p=Jt(c.attributes),y=Sm(d),g=S=>S&&S.charAt(0).toLowerCase()+S.slice(1),b=new Set(c.attributes.map(S=>S.name)),k=g(d.name);let _=k;for(let S=2;b.has(_);S++)_=`${k}${S}`;const h={modelId:m,name:_,type:d.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:p,dbAttrs:y,embedded:{associationRef:u,embeddableRef:s}},C={modelId:u,end1:{entityRef:l,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:f},end2:{entityRef:s,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:m}},v={associationRef:u,waypoints:[],sourceColumnRef:m,targetColumnRef:void 0};return i(rt("임베드 추가",[Xt(l,h),Ka(C,v)])),u},setEmbedCardinality(l,s){var k;if(r(l))return;const c=n.logical.associations.find(_=>_.modelId===l);if(!c)return;let d,u;for(const _ of n.logical.entities){const h=_.attributes.find(C=>{var v;return((v=C.embedded)==null?void 0:v.associationRef)===l&&C.attrType==="EMBED_OWN"});if(h){d=_.modelId,u=h;break}}if(!d||!u)return;const m=u.embedded.embeddableRef,f=c.end2.entityRef===m?"end2":"end1",p=c[f];if(p.multiplicity===s)return;const y=_=>_==="ZERO_OR_MORE_INSTANCES"||_==="ONE_OR_MORE_INSTANCES",g=y(p.multiplicity),b=y(s);if(g===b){i(on(l,f,{multiplicity:s}));return}if(b)i(rt("임베드 컬렉션 전환",[nn(d,u.modelId,{dbAttrs:[]}),on(l,f,{multiplicity:s,jpa:{...p.jpa,collectionType:((k=p.jpa)==null?void 0:k.collectionType)??"LIST"}})]));else{const _=n.logical.entities.find(h=>h.modelId===m);if(!_)return;i(rt("임베드 단일 전환",[nn(d,u.modelId,{dbAttrs:Sm(_)}),on(l,f,{multiplicity:s,jpa:{...p.jpa,collectionType:void 0,collectionTable:void 0,orderColumn:void 0}})]))}},removeAssociation(l){if(r(l))return;const s=n.logical.associations.find(p=>p.modelId===l),c=Yu(l);if(!s){i(c);return}for(const p of n.logical.entities){const y=p.attributes.find(g=>{var b;return((b=g.embedded)==null?void 0:b.associationRef)===l});if(y){const g=[];i(rt("임베드 삭제",[c,...yn(p.modelId,[y.modelId],g),...Zt(n.logical,g)]));return}}const d=s.end2.entityRef,u={...n.logical,associations:n.logical.associations.filter(p=>p.modelId!==l)},m=[],f=Ja(u,[d],m);if(s.end1.attributeRef){const p=n.logical.entities.find(g=>g.modelId===s.end1.entityRef),y=p==null?void 0:p.attributes.find(g=>g.modelId===s.end1.attributeRef&&g.attrType==="RELATION_REF");y&&f.push(...yn(p.modelId,[y.modelId],m))}f.push(...Zt(n.logical,m)),i(f.length?rt("관계 삭제",[c,...f]):c)},setAssociationIdentifying(l,s){if(r(l))return;const c=n.logical.associations.find(y=>y.modelId===l),d=Ga(l,{identifying:s});if(!c||c.identifying===s){i(d);return}const u=c.end2.entityRef,m={...n.logical,associations:n.logical.associations.map(y=>y.modelId===l?{...y,identifying:s}:y)},f=[],p=Ja(m,[u],f);p.push(...Zt(n.logical,f)),i(p.length?rt("식별 관계 변경",[d,...p]):d)},updateAssociationEnd(l,s,c){if(r(l))return;const d=n.logical.associations.find(u=>u.modelId===l);if(d&&s==="end1"&&"navigable"in c&&c.navigable!==d.end1.navigable){const u=Am(n.logical,l,c.navigable===!0);if(u){const m=on(l,"end1",{...c,...u.endPatch}),f=u.endPatch.attributeRef?[...u.cmds,m]:[...u.cmds,m];i(f.length>1?rt(c.navigable===!0?"inverse nav 추가":"inverse nav 제거",f):m);return}}i(on(l,s,c))}}}function aA(e){const{state:n,editable:o,run:i,gateEntityLocked:a,embeddableCatalog:r,predefinedCustomTypeCatalog:l,t:s,emitGateNotice:c,selection:d}=e,u=(m,f,p)=>{if(a(m))return;const y=nn(m,f,p),g=Vn(n.logical,m,_=>_.map(h=>h.modelId===f?{...h,...p}:h)),b=[],k=Li(g,m,b);k.push(...Zt(n.logical,b)),i(k.length?rt("속성 수정",[y,...k]):y)};return{addPredefinedEmbed(m,f){if(!o.value||a(m))return null;const p=r.value.find(h=>h.type===f),y=n.logical.entities.find(h=>h.modelId===m);if(!p||!y)return null;const g=Jt(y.attributes),b=Fe(),k=p.fields.map(()=>({modelId:Fe(),physicalName:"",dataType:""})),_={modelId:b,name:p.defaultName,type:p.type,attrType:"EMBED_PREDEF",identifier:!1,notNull:!1,order:g,dbAttrs:k};return i(Xt(m,_)),b},convertAttributeType(m,f,p){if(!o.value||a(m))return null;const y=n.logical.entities.find(I=>I.modelId===m),g=y==null?void 0:y.attributes.find(I=>I.modelId===f);if(!y||!g||g.attrType!=="NORMAL"&&g.attrType!=="EMBED_PREDEF"||g.groupCode||!p||p===g.type||Jn(n.logical,m,f))return null;const b=r.value.find(I=>I.type===p),k=b?void 0:l.value.find(I=>I.type===p),_=b?b.fields.length:1,h=g.dbAttrs.length===_;if(b&&g.identifier&&!h)return c(s("em.attr.embedConvertPkBlocked")),null;const C=Array.from({length:_},(I,x)=>{const $=h?{...g.dbAttrs[x]}:{modelId:Fe(),physicalName:b?"":g.name,dataType:""};return k?hd($,k):$}),{customType:v,...S}=g,N=Fe(),A={...S,modelId:N,type:p,attrType:b?"EMBED_PREDEF":"NORMAL",identifier:g.identifier,dbAttrs:C};p===pn&&v!==void 0&&(A.customType=v);const T=[],O=yn(m,[f],T),z=Vn(n.logical,m,I=>I.filter(x=>x.modelId!==f)),P=new Map;if(h){for(const I of C)P.set(I.modelId,I.modelId);P.set(f,C.length===1?C[0].modelId:N)}const D=Im(n.logical,m,[f]),E=[...Nm(z,m,T),...Zt(n.logical,T,P),...D.commands],R=Vn(D.projected,m,I=>[...I.filter(x=>x.modelId!==f),A]);return i(rt("속성 타입 전환",[...O,...E,Xt(m,A),...vm(R,m)])),N},addSerializedTypeAttribute(m,f){if(!o.value||a(m))return null;const p=n.logical.entities.find(_=>_.modelId===m),y=n.logical.entities.find(_=>_.modelId===f);if(!p||!y||!mn(y.stereotype)||!y.name)return null;const g=y.name.charAt(0).toLowerCase()+y.name.slice(1),b=po(g,new Set(p.attributes.map(_=>_.name))),k=Fe();return i(Xt(m,{modelId:k,name:b,type:y.name,attrType:"NORMAL",identifier:!1,notNull:!1,order:Jt(p.attributes),dbAttrs:[{modelId:Fe(),physicalName:b,dataType:"CLOB"}]})),k},addAttribute(m,f={}){if(!o.value||a(m))return null;const p=n.logical.entities.find(S=>S.modelId===m),y=p?Jt(p.attributes):0,g=f.modelId??Fe(),b=f.name??`field${y}`,k={modelId:g,name:b,type:f.type??bl,attrType:f.attrType??"NORMAL",identifier:f.identifier??!1,notNull:f.notNull??!1,order:y,dbAttrs:f.dbAttrs??(p&&mn(p.stereotype)?[]:[{modelId:Fe(),physicalName:b,dataType:"VARCHAR"}]),...f},_=Xt(m,k),h=Vn(n.logical,m,S=>[...S,k]),C=[],v=Li(h,m,C);return v.push(...Zt(n.logical,C)),i(v.length?rt("속성 추가",[_,...v]):_),g},addDivider(m){if(!o.value||a(m))return null;const f=n.logical.entities.find(b=>b.modelId===m),p=f?Jt(f.attributes):0,y=Fe();return i(Xt(m,{modelId:y,name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:p,dbAttrs:[]})),y},updateAttribute(m,f,p){u(m,f,p)},setAttributeGroupCode(m,f,p){u(m,f,{groupCode:p,type:p?An:bl})},setEmbedColumns(m,f,p){var h,C;if(a(m))return;const y=nn(m,f,{dbAttrs:p}),g=(h=n.logical.entities.find(v=>v.modelId===m))==null?void 0:h.attributes.find(v=>v.modelId===f),b=(C=g==null?void 0:g.embedded)==null?void 0:C.associationRef,k=b?n.logical.associations.find(v=>v.modelId===b):void 0,_=[];k&&b&&(k.end1.legacyEmbedRaw&&_.push(on(b,"end1",{legacyEmbedRaw:void 0})),k.end2.legacyEmbedRaw&&_.push(on(b,"end2",{legacyEmbedRaw:void 0}))),i(_.length?rt("임베드 컬럼 수정",[y,..._]):y)},removeAttribute(m,f){if(a(m))return;if(Jn(n.logical,m,f)){c(s("em.attr.fkDeleteHint"));return}const p=[],y=yn(m,[f],p),g=Vn(n.logical,m,_=>_.filter(h=>h.modelId!==f)),b=[...Li(g,m,p),...Zt(n.logical,p),...wm(n.logical,m,[f])],k=[...y,...b];i(k.length===1?k[0]:rt("속성 삭제",k))},removeAttributes(m,f){var h;if(!f.length||a(m))return;const p=f.filter(C=>!Jn(n.logical,m,C));if(p.length<f.length&&c(s("em.attr.fkDeleteHint")),!p.length)return;const y=[],g=yn(m,p,y),b=new Set(p),k=Vn(n.logical,m,C=>C.filter(v=>!b.has(v.modelId))),_=[...g,...Li(k,m,y),...Zt(n.logical,y),...wm(n.logical,m,p)];i(_.length===1?_[0]:rt("속성 삭제",_)),((h=d.value)==null?void 0:h.kind)==="attribute"&&d.value.entityId===m&&(d.value=null)},setAttributeSwatch(m,f,p){i(Ua(m,f,p))},setAttributeSwatches(m,f,p){f.length&&(f.length===1?i(Ua(m,f[0],p)):i(rt("속성 색상",f.map(y=>Ua(m,y,p)))))},reorderAttributes(m,f,p){if(!f.length||a(m))return;const y=as(m,f,p),g=n_(n.logical,m,f,p);i(g.length?rt("속성 재정렬",[y,...g]):y)}}}function rA(e){var i;const n=JSON.parse(JSON.stringify(e));n.modelId=Fe(),n.name=`${e.name}_copy`,(i=n.table)!=null&&i.physicalName&&(n.table.physicalName=`${n.table.physicalName}_copy`);const o=new Map;for(const a of n.attributes){const r=Fe();o.set(a.modelId,r),a.modelId=r;for(const l of a.dbAttrs)l.modelId=Fe()}for(const a of n.indexes??[]){a.modelId=Fe();for(const r of a.columns)r.columnRef=o.get(r.columnRef)??r.columnRef}for(const a of n.operations??[]){const r=Fe();o.set(a.modelId,r),a.modelId=r}return{clone:n,idMap:o}}const lA=220;function sA(e,n){let i=-1/0;for(const r of e.entityLayouts)i=Math.max(i,r.geo.location.x+(r.geo.size.width||lA));for(const r of e.groupLayouts)i=Math.max(i,r.geo.location.x+r.geo.size.width);let a=1/0;for(const r of n.entityLayouts)a=Math.min(a,r.geo.location.x);for(const r of n.groupLayouts)a=Math.min(a,r.geo.location.x);return!Number.isFinite(i)||!Number.isFinite(a)?{x:0,y:0}:{x:i+80-a,y:0}}const ac=(e,n)=>({x:e.x+n.x,y:e.y+n.y});function cA(e){const{state:n,clipboard:o,selection:i,inspectedEntityId:a,editable:r,run:l}=e,s={copy(c){if(c&&c.length){const g=c.filter(b=>n.logical.entities.some(k=>k.modelId===b));if(g.length){o.value=JSON.parse(JSON.stringify({kind:"entities",source:{logical:n.logical,layout:n.layout},selectedIds:g}));return}}const d=i.value;if((d==null?void 0:d.kind)==="attribute"){const g=n.logical.entities.find(k=>k.modelId===d.entityId);if(!g)return;const b=[...g.attributes].sort((k,_)=>k.order-_.order).filter(k=>d.ids.includes(k.modelId));if(!b.length)return;o.value=JSON.parse(JSON.stringify({kind:"attribute",attributes:b}));return}const u=a.value;if(!u)return;const m=n.logical.entities.find(g=>g.modelId===u),f=n.layout.entityLayouts.find(g=>g.entityRef===u);if(!m)return;const p=(f==null?void 0:f.geo)??{location:{x:80,y:80},size:{width:220,height:140}};let y;if(f){const{entityRef:g,geo:b,locked:k,..._}=f;Object.keys(_).length&&(y=_)}o.value=JSON.parse(JSON.stringify({kind:"entity",entity:m,geo:p,layoutExtras:y}))},paste(){if(!r.value)return[];const c=o.value;if(!c)return[];if(c.kind==="entities")return s.importEntities(c.source,c.selectedIds,{placement:{offset:{x:40,y:40}},collisionSuffix:"_copy"});if(c.kind==="attribute"){const p=a.value;if(!p)return[];const y=n.logical.entities.find(C=>C.modelId===p);if(!y)return[];const g=new Set(y.attributes.map(C=>C.name)),b=new Set(y.attributes.flatMap(C=>C.dbAttrs.map(v=>v.physicalName))),k=Jt(y.attributes),_=[],h=c.attributes.map((C,v)=>{const S=JSON.parse(JSON.stringify(C));S.modelId=Fe();for(const N of S.dbAttrs)N.modelId=Fe();g.has(S.name)&&(S.name=po(`${S.name}_copy`,g)),g.add(S.name);for(const N of S.dbAttrs)N.physicalName&&b.has(N.physicalName)&&(N.physicalName=po(`${N.physicalName}_copy`,b)),N.physicalName&&b.add(N.physicalName);return S.order=k+v,_.push(S.modelId),Xt(p,S)});return l(h.length===1?h[0]:rt("속성 붙여넣기",h)),i.value={kind:"attribute",entityId:p,ids:_,anchor:_[_.length-1]},[]}const{clone:d,idMap:u}=rA(c.entity),m={location:{x:c.geo.location.x+40,y:c.geo.location.y+40},size:{...c.geo.size}};let f;if(c.layoutExtras){const p={...c.layoutExtras},y=g=>u.get(g);p.attributeStyles&&(p.attributeStyles=Va(p.attributeStyles,y)),p.operationStyles&&(p.operationStyles=Va(p.operationStyles,y)),f=p}return l(za(d,m,f)),i.value={kind:"entity",id:d.modelId},[d.modelId]},importEntities(c,d,u){if(!r.value)return[];const m=bu(c,d,{existing:n.logical,includeRelated:u==null?void 0:u.includeRelated,collisionSuffix:u==null?void 0:u.collisionSuffix});if(m.logical.entities.length===0)return[];const f=(u==null?void 0:u.placement)??"append-right",p=f==="append-right"?sA(n.layout,m.layout):f.offset,y=new Map(m.layout.entityLayouts.map(h=>[h.entityRef,h])),g=new Map(m.layout.associationLayouts.map(h=>[h.associationRef,h])),b=new Map(m.layout.groupLayouts.map(h=>[h.groupRef,h])),k=[];let _=80;for(const h of m.logical.entities){const C=y.get(h.modelId),v=C?{location:ac(C.geo.location,p),size:{...C.geo.size}}:{location:{x:_+=40,y:80},size:{width:220,height:140}};let S;if(C){const{entityRef:N,geo:A,locked:T,...O}=C;S=O}k.push(za(h,v,S))}for(const h of m.logical.associations){const C=g.get(h.modelId),v=C?{...C,waypoints:C.waypoints.map(S=>ac(S,p))}:{associationRef:h.modelId,waypoints:[]};k.push(Ka(h,v))}for(const h of m.logical.groups){const C=b.get(h.modelId),v=C?{location:ac(C.geo.location,p),size:{...C.geo.size}}:{location:{x:80,y:80},size:{width:320,height:200}};let S;if(C){const{groupRef:N,geo:A,locked:T,memberNoteRefs:O,...z}=C;S=z}k.push(Ha(h,v,S))}return l(rt("다이어그램 가져오기",k)),i.value={kind:"entity",id:m.logical.entities[0].modelId},m.logical.entities.map(h=>h.modelId)}};return s}function dA(e){const{state:n,editable:o,run:i,gateEntityLocked:a,isEntityLockedFn:r,isAssocLockedFn:l,t:s,emitGateNotice:c}=e;return{addEntity(d="NewEntity",u={x:80,y:80}){if(!o.value)return null;const m=Fe(),f={modelId:m,name:d,stereotype:"JPA_ENTITY",table:{physicalName:d.toLowerCase()},attributes:[{modelId:Fe(),name:"id",type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:0,dbAttrs:[{modelId:Fe(),physicalName:"id",dataType:"BIGINT"}]}]};return i(za(f,{location:{...u},size:{width:220,height:140}})),m},renameEntity(d,u){a(d)||i(Ru(d,u))},updateEntity(d,u){if(a(d))return;const m=Fa(d,u),f=n.logical.entities.find(_=>_.modelId===d),p=f==null?void 0:f.stereotype,y=u.stereotype,g=!!y&&!!f&&!!p&<(y)&&!lt(p),b=!!y&&!!f&&!!p&&!lt(y)&<(p);if(!!y&&!!f&&!!p&&y!==p&<(y)&<(p)&&f){const _=n.logical.entities.filter(C=>C.attributes.some(v=>{var S;return((S=v.embedded)==null?void 0:S.embeddableRef)===d}));if(_.length>0){c(s("em.entity.valueTypeSwitchEmbedded",{name:f.name,owners:_.length}));return}const h=Cm(f,y);i(h.length?rt("직렬화 타입 변환",[m,...h]):m);return}if(y==="SERIALIZED_TYPE"&&f){const _=n.logical.associations.filter(h=>h.end1.entityRef===d||h.end2.entityRef===d);if(_.length>0){c(s("em.entity.serializedTypeHasRelations",{name:f.name,count:_.length}));return}}if(g&&f&&y){const _=xm(n.logical,d,y),h=[m,..._];i(h.length>1?rt(y==="SERIALIZED_TYPE"?"직렬화 타입 변환":"임베더블 변환",h):m);return}if(b){const _=Rm(n.logical,d),h=[m,..._];i(h.length>1?rt("엔터티 전환",h):m);return}i(m)},moveEntity(d,u){a(d)||i(Qo(d,u))},resizeEntity(d,u){a(d)||i(Au(d,u))},removeEntity(d){if(a(d))return;const u=Su(d);if(!n.logical.entities.find(_=>_.modelId===d)){i(u);return}const f=n.logical.associations.filter(_=>_.end1.entityRef===d||_.end2.entityRef===d),p=new Set(f.map(_=>_.modelId)),y=[],g=[];for(const _ of n.logical.entities)if(_.modelId!==d)for(const h of _.attributes)h.embedded&&p.has(h.embedded.associationRef)&&y.push(...yn(_.modelId,[h.modelId],g));for(const _ of f){if(_.end1.entityRef===d||!_.end1.attributeRef)continue;const h=n.logical.entities.find(v=>v.modelId===_.end1.entityRef),C=h==null?void 0:h.attributes.find(v=>v.modelId===_.end1.attributeRef&&v.attrType==="RELATION_REF");C&&y.push(...yn(h.modelId,[C.modelId],g))}const b={...n.logical,entities:n.logical.entities.filter(_=>_.modelId!==d),associations:n.logical.associations.filter(_=>!p.has(_.modelId))},k=new Set(f.filter(_=>_.end1.entityRef===d&&_.end2.entityRef!==d).map(_=>_.end2.entityRef));y.push(...Ja(b,[...k],g)),y.push(...Zt(n.logical,g.filter(_=>_.entityId!==d))),i(y.length?rt("엔티티 삭제",[u,...y]):u)},setEntitySwatch(d,u){i(xu(d,u))},setEntityCollapsed(d,u){i($u(d,u))},setEntityLocked(d,u){i(Tu(d,u))},isEntityLocked(d){return r(d)},isAssociationLocked(d){return l(d)},collapseAll(){i(is(!0))},expandAll(){i(is(!1))}}}function uA(e){const{state:n,editable:o,run:i,selection:a,gateEntityLocked:r,gateGroupLocked:l,isGroupLockedFn:s}=e;function c(d){const u=d.map(k=>n.layout.entityLayouts.find(_=>_.entityRef===k)).filter(k=>!!k);if(!u.length)return{location:{x:40,y:40},size:{width:400,height:300}};let m=1/0,f=1/0,p=-1/0,y=-1/0;for(const k of u){const _=k.geo.size.width||220,h=k.geo.size.height||140;m=Math.min(m,k.geo.location.x),f=Math.min(f,k.geo.location.y),p=Math.max(p,k.geo.location.x+_),y=Math.max(y,k.geo.location.y+h)}const g=40,b=28;return{location:{x:m-g,y:f-g-b},size:{width:p-m+g*2,height:y-f+g*2+b}}}return{dragGroup(d,u,m){l(d)||i(rt("그룹 이동",$m(n,d,u,m)))},resizeGroup(d,u){l(d)||i(Du(d,u))},setGroupSwatch(d,u){i(Ou(d,u))},setGroupLocked(d,u){i(Pu(d,u))},isGroupLocked(d){return s(d)},updateGroup(d,u){l(d)||i(Mu(d,u))},createGroup(d,u){if(!o.value||!d.length)return null;const m=[];for(const y of n.logical.groups)for(const g of d)y.memberEntityRefs.includes(g)&&m.push(ja(y.modelId,g));const f=Fe(),p={modelId:f,name:u?{ko:u}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[...d]};return m.push(Ha(p,c(d))),i(rt("그룹 생성",m)),a.value=null,f},addEmptyGroup(d,u){if(!o.value)return null;const m=Fe();return i(Ha({modelId:m,name:u?{ko:u}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[]},{location:{...d},size:{width:360,height:260}})),m},removeGroup(d){l(d)||i(Vu(d))},dropEntity(d,u,m){var y;if(r(d))return;const f=((y=n.logical.groups.find(g=>g.memberEntityRefs.includes(d)))==null?void 0:y.modelId)??null,p=[Qo(d,u)];f!==m&&(f&&p.push(ja(f,d)),m&&p.push(Lu(m,d))),i(rt("이동",p))},ungroupEntity(d){const u=n.logical.groups.find(m=>m.memberEntityRefs.includes(d));u&&i(ja(u.modelId,d))},dropNote(d,u,m){var y;const f=((y=n.layout.groupLayouts.find(g=>{var b;return(b=g.memberNoteRefs)==null?void 0:b.includes(d)}))==null?void 0:y.groupRef)??null,p=[Vi(d,u)];f!==m&&(f&&p.push(lm(f,d)),m&&p.push(rm(m,d))),i(rt("이동",p))}}}function mA(e){const{state:n,opMode:o,editable:i,opConflict:a,historyTransport:r,restoreTransport:l}=e;let s=null,c=null;function d(){c==null||c(),c=null,s=null}function u(g,b){if(d(),!o.value||!e.opTransport)return;const k=new hm({diagramId:n.layout.diagramId,state:n,transport:e.opTransport,origin:"gui",onFreeze:_=>{i.value=!1,a.value=_},onError:e.onOpError});k.seed((b==null?void 0:b.revSeed)??{}),c=k.attach(g),s=k}const m=t.computed(()=>o.value&&r!==void 0),f=t.ref(0),p=t.computed(()=>o.value&&i.value&&l!==void 0);async function y(g){if(!l||!i.value)return{ok:!1,reason:"unavailable"};let b;try{b=await l(g)}catch(k){return{ok:!1,reason:k instanceof Error?k.message:String(k)}}return b.ok&&f.value++,b}return{setupOpAdapter:u,teardownOpAdapter:d,flush(){s==null||s.flush()},whenOpsSettled(){return(s==null?void 0:s.whenSettled())??Promise.resolve()},historyTransport:r,historyAvailable:m,restoreTransport:l,restoreAvailable:p,restoreToSeq:y,reloadRequest:f}}function fA(e){const{editable:n,run:o}=e;return{addNote(i="메모",a={x:80,y:80}){if(!n.value)return null;const r=Fe();return o(tm({modelId:r,memo:i,geo:{location:{...a},size:{width:200,height:120}}})),r},removeNote(i){o(nm(i))},moveNote(i,a){o(Vi(i,a))},resizeNote(i,a){o(om(i,a))},setNoteMemo(i,a){o(im(i,a))},setNoteSwatch(i,a){o(am(i,a))},addNoteConnection(i,a){o(sm(i,a))},removeNoteConnection(i,a){o(cm(i,a))},moveNoteConnectionWaypoint(i,a,r,l){o(dm(i,a,r,l))},addNoteConnectionWaypoint(i,a,r,l){o(um(i,a,r,l))},removeNoteConnectionWaypoint(i,a,r){o(mm(i,a,r))},clearNoteConnectionWaypoints(i,a){o(fm(i,a))}}}function pA(e){const{state:n,selection:o,focusRequest:i,run:a,gateEntityLocked:r,isEntityLockedFn:l,isGroupLockedFn:s}=e;let c=0;return{selectAttribute(d,u,m="replace"){const f=o.value,p=(f==null?void 0:f.kind)==="attribute"&&f.entityId===d;if(m==="replace"||!p){o.value={kind:"attribute",entityId:d,ids:[u],anchor:u};return}if(m==="toggle"){const C=f.ids.includes(u),v=C?f.ids.filter(N=>N!==u):[...f.ids,u];if(!v.length){o.value=null;return}const S=C&&f.anchor===u?v[v.length-1]:C?f.anchor:u;o.value={kind:"attribute",entityId:d,ids:v,anchor:S};return}const y=n.logical.entities.find(C=>C.modelId===d),g=[...(y==null?void 0:y.attributes)??[]].sort((C,v)=>C.order-v.order).map(C=>C.modelId),b=g.indexOf(f.anchor),k=g.indexOf(u);if(b<0||k<0){o.value={kind:"attribute",entityId:d,ids:[u],anchor:u};return}const[_,h]=b<=k?[b,k]:[k,b];o.value={kind:"attribute",entityId:d,ids:g.slice(_,h+1),anchor:f.anchor}},moveAttributeFocus(d){const u=o.value;if((u==null?void 0:u.kind)!=="attribute")return!1;const m=n.logical.entities.find(g=>g.modelId===u.entityId);if(!m||!m.attributes.length)return!1;const f=m.attributes.findIndex(g=>g.modelId===u.anchor);if(f<0)return!1;const p=Math.min(Math.max(f+d,0),m.attributes.length-1);if(p===f)return!0;const y=m.attributes[p].modelId;return o.value={kind:"attribute",entityId:u.entityId,ids:[y],anchor:y},!0},nudgeSelectedAttributes(d){const u=o.value;if((u==null?void 0:u.kind)!=="attribute")return!1;const m=n.logical.entities.find(C=>C.modelId===u.entityId);if(!m)return!1;const f=m.attributes,p=new Set(u.ids),y=f.map((C,v)=>p.has(C.modelId)?v:-1).filter(C=>C>=0);if(!y.length)return!1;const g=Math.min(...y),b=f.filter(C=>!p.has(C.modelId)),k=f.slice(0,g).filter(C=>!p.has(C.modelId)).length;let _;if(d<0){if(k<=0)return!0;_=k-1}else{if(b.length-k<=0)return!0;_=k+1}if(r(u.entityId))return!0;const h=f.filter(C=>p.has(C.modelId)).map(C=>C.modelId);return a(as(u.entityId,h,_)),!0},nudgeNodes(d,u,m){if(!d.length||u===0&&m===0)return!1;const f=new Set(n.logical.entities.map(_=>_.modelId)),p=new Set(n.logical.groups.map(_=>_.modelId)),y=new Set(n.layout.notes.map(_=>_.modelId)),g=new Set;for(const _ of d){if(!p.has(_))continue;const h=n.logical.groups.find(C=>C.modelId===_);for(const C of(h==null?void 0:h.memberEntityRefs)??[])g.add(C)}const b=[],k=[];for(const _ of d)if(p.has(_)){if(s(_))continue;const h=n.layout.groupLayouts.find(N=>N.groupRef===_);if(!h)continue;const C=n.logical.groups.find(N=>N.modelId===_),v=((C==null?void 0:C.memberEntityRefs)??[]).map(N=>{var T;const A=((T=n.layout.entityLayouts.find(O=>O.entityRef===N))==null?void 0:T.geo.location)??{x:0,y:0};return{id:N,location:{x:A.x+u,y:A.y+m}}}),S={x:h.geo.location.x+u,y:h.geo.location.y+m};b.push(rt("그룹 이동",$m(n,_,S,v))),k.push("g:"+_)}else if(f.has(_)){if(g.has(_)||l(_))continue;const h=n.layout.entityLayouts.find(C=>C.entityRef===_);if(!h)continue;b.push(Qo(_,{x:h.geo.location.x+u,y:h.geo.location.y+m})),k.push("e:"+_)}else if(y.has(_)){const h=n.layout.notes.find(C=>C.modelId===_);if(!h)continue;b.push(Vi(_,{x:h.geo.location.x+u,y:h.geo.location.y+m})),k.push("n:"+_)}return b.length?(a(rt("이동",b,"nudge:"+k.sort().join(","))),!0):!1},requestFocus(d){i.value={id:d,nonce:++c}}}}const io=Symbol("editorController");function vh(e="m1",n="d1"){return{logical:{modelId:e,entities:[],associations:[],groups:[]},layout:{diagramId:n,logicalModelRef:e,entityLayouts:[],associationLayouts:[],groupLayouts:[],notes:[]}}}function hA(e=vh(),n={}){var ht,re,ve;const o=t.reactive(e);let i=new os(o);const a=t.ref(n.embeddableCatalog??[]),r=t.ref(n.groupCodeCatalog??[]),l=t.ref(n.predefinedCustomTypeCatalog??[]),s=t.ref(n.superClassCatalog??[]),c=t.ref(n.languages??["ko","en","ja","zh"]),d=t.ref(n.userLanguage??"ko"),u=t.ref(n.projectLanguage),m=t.ref(n.uiLocale??"ko"),f=(le,me)=>cn(m.value,le,me),p=t.ref(n.reservedWords),y=t.ref(n.selectableDataTypes),g=t.ref(n.largeEntityThreshold),b=t.ref(n.flagEntitiesWithoutRelations??!1),k=t.ref(!1),_=t.ref(!1),h=t.ref(!1),C=t.ref(0),v=t.ref(null);let S=0;const N=le=>{if(n.onNotice){n.onNotice(le);return}v.value={text:le,id:++S}},A=t.ref(((ht=n.meta)==null?void 0:ht.schemaVersion)??1),T=t.ref(((re=n.meta)==null?void 0:re.opWriteEnabled)??!1),O=t.ref(((ve=n.meta)==null?void 0:ve.referenceOnly)??!1),z=t.computed(()=>A.value>=2&&T.value),P=t.ref(!(A.value>=2&&T.value===!1)),D=t.ref("LOGICAL_PHYSICAL"),E=t.ref("straight"),R=t.ref(!0),I=t.ref(!0),x=t.ref(null),$=t.computed(()=>{var le;return((le=x.value)==null?void 0:le.kind)==="attribute"?{entityId:x.value.entityId,attrId:x.value.anchor}:null}),U=t.computed(()=>{var le;return((le=x.value)==null?void 0:le.kind)==="attribute"?x.value.ids:[]}),F=t.computed(()=>{var le,me;return((le=x.value)==null?void 0:le.kind)==="entity"?x.value.id:((me=x.value)==null?void 0:me.kind)==="attribute"?x.value.entityId:null}),B=t.ref(null),j=t.ref(null),X=t.ref(null),W=t.ref(null),oe=mA({state:o,opMode:z,editable:P,opConflict:X,opTransport:n.opTransport,onOpError:n.onOpError,historyTransport:n.historyTransport,restoreTransport:n.restoreTransport});function de(){i.onChange(()=>{k.value=i.canUndo,_.value=i.canRedo,h.value=i.isDirty,C.value++})}de(),oe.setupOpAdapter(i,n.meta);const ie=t.computed(()=>Dc(o.logical,o.layout)),Ie=t.computed(()=>({reservedWords:p.value,selectableDataTypes:y.value,largeEntityThreshold:g.value,flagEntitiesWithoutRelations:b.value,embeddableCatalog:a.value,superClassCatalog:s.value,predefinedCustomTypes:l.value})),Le=()=>fl(o.logical,O.value),Se=n.validationDebounceMs??250;let ce,pe=()=>{};if(Se>0){const le=t.shallowRef(Aa(Le(),Ie.value));let me;pe=()=>{me!==void 0&&(clearTimeout(me),me=void 0),le.value=Aa(Le(),Ie.value)},t.watch([C,Ie,O],()=>{me!==void 0&&clearTimeout(me),me=setTimeout(pe,Se)},{flush:"sync"}),ce=t.computed(()=>le.value)}else ce=t.computed(()=>Aa(Le(),Ie.value));const he=t.computed(()=>{const le=new Map;for(const me of ce.value){if(!me.targetRef)continue;const ke=le.get(me.targetRef);ke?ke.push(me):le.set(me.targetRef,[me])}return le}),V=1500,L=new Map,K=le=>{const me=Date.now();me-(L.get(le)??0)<V||(L.set(le,me),N(le))},Z=le=>{if(!W.value){if(!P.value){K(f("em.notice.readOnly"));return}try{i.execute(le)}catch(me){console.error(`[command] 적용 실패 — 로컬 상태가 부분 변형됐을 수 있다 (${le.label}):`,me),P.value=!1,W.value={label:le.label}}}},Q=le=>o.layout.entityLayouts.some(me=>me.entityRef===le&&!!me.locked),fe=le=>o.layout.groupLayouts.some(me=>me.groupRef===le&&!!me.locked),be=le=>{const me=o.logical.associations.find(ke=>ke.modelId===le);return!!me&&(Q(me.end1.entityRef)||Q(me.end2.entityRef))},Ee=le=>Q(le)?(K(f("em.notice.entityLocked")),!0):!1,Ne=le=>fe(le)?(K(f("em.notice.groupLocked")),!0):!1,J=le=>be(le)?(K(f("em.notice.assocLocked")),!0):!1,ee=cA({state:o,clipboard:j,selection:x,inspectedEntityId:F,editable:P,run:Z}),te=pA({state:o,selection:x,focusRequest:B,run:Z,gateEntityLocked:Ee,isEntityLockedFn:Q,isGroupLockedFn:fe}),ge=dA({state:o,editable:P,run:Z,gateEntityLocked:Ee,isEntityLockedFn:Q,isAssocLockedFn:be,t:f,emitGateNotice:K}),Re=aA({state:o,editable:P,run:Z,gateEntityLocked:Ee,embeddableCatalog:a,predefinedCustomTypeCatalog:l,t:f,emitGateNotice:K,selection:x}),Pe=uA({state:o,editable:P,run:Z,selection:x,gateEntityLocked:Ee,gateGroupLocked:Ne,isGroupLockedFn:fe}),Me=fA({editable:P,run:Z}),Qe=iA({state:o,editable:P,run:Z,gateEntityLocked:Ee,gateAssocLocked:J});return{state:o,resolved:ie,issues:ce,issuesByRef:he,flagEntitiesWithoutRelations:b,canUndo:k,canRedo:_,dirty:h,revision:C,notice:v,editable:P,schemaVersion:A,opWriteEnabled:T,opMode:z,opConflict:X,commandFailure:W,historyTransport:oe.historyTransport,historyAvailable:oe.historyAvailable,restoreTransport:oe.restoreTransport,restoreAvailable:oe.restoreAvailable,restoreToSeq:oe.restoreToSeq,reloadRequest:oe.reloadRequest,displayMode:D,routingMode:E,showGrid:R,showMinimap:I,selection:x,selectedAttr:$,selectedAttrIds:U,inspectedEntityId:F,focusRequest:B,clipboard:j,embeddableCatalog:a,groupCodeCatalog:r,predefinedCustomTypeCatalog:l,superClassCatalog:s,languages:c,userLanguage:d,projectLanguage:u,referenceOnlyDocument:O,uiLocale:m,t:f,selectableDataTypes:y,setEditable(le){P.value=le&&z.value},setEmbeddableCatalog(le){a.value=le},setGroupCodeCatalog(le){r.value=le},setPredefinedCustomTypeCatalog(le){l.value=le},setSuperClassCatalog(le){s.value=le},selectAttribute:te.selectAttribute,moveAttributeFocus:te.moveAttributeFocus,nudgeSelectedAttributes:te.nudgeSelectedAttributes,nudgeNodes:te.nudgeNodes,requestFocus:te.requestFocus,deleteSelection(){if(!P.value)return!1;const le=x.value;if(!le)return!1;if(le.kind==="attribute"){if(Ee(le.entityId))return!1;const me=le.ids;if(!me.length)return!1;me.length===1?Re.removeAttribute(le.entityId,me[0]):Re.removeAttributes(le.entityId,me)}else if(le.kind==="entity"){if(Ee(le.id))return!1;ge.removeEntity(le.id)}else if(le.kind==="note")Me.removeNote(le.id);else if(le.kind==="group"){if(Ne(le.id))return!1;Pe.removeGroup(le.id)}else Qe.removeAssociation(le.id);return x.value=null,!0},undo:()=>{P.value&&i.undo()},redo:()=>{P.value&&i.redo()},markSaved:()=>{P.value&&(oe.flush(),i.markSavePoint())},loadDiagram(le,me){oe.teardownOpAdapter(),o.logical=le.logical,o.layout=le.layout,i=new os(o),de(),A.value=(me==null?void 0:me.schemaVersion)??1,T.value=(me==null?void 0:me.opWriteEnabled)??!1,O.value=(me==null?void 0:me.referenceOnly)??!1,P.value=!(A.value>=2&&T.value===!1),X.value=null,W.value=null,x.value=null,k.value=i.canUndo,_.value=i.canRedo,h.value=i.isDirty,oe.setupOpAdapter(i,me),pe()},flush:oe.flush,whenOpsSettled:oe.whenOpsSettled,addEntity:ge.addEntity,renameEntity:ge.renameEntity,updateEntity:ge.updateEntity,moveEntity:ge.moveEntity,resizeEntity:ge.resizeEntity,removeEntity:ge.removeEntity,setEntitySwatch:ge.setEntitySwatch,setEntityCollapsed:ge.setEntityCollapsed,setEntityLocked:ge.setEntityLocked,isEntityLocked:ge.isEntityLocked,isAssociationLocked:ge.isAssociationLocked,collapseAll:ge.collapseAll,expandAll:ge.expandAll,setAttributeSwatch:Re.setAttributeSwatch,dragGroup:Pe.dragGroup,resizeGroup:Pe.resizeGroup,setGroupSwatch:Pe.setGroupSwatch,setGroupLocked:Pe.setGroupLocked,isGroupLocked:Pe.isGroupLocked,updateGroup:Pe.updateGroup,createGroup:Pe.createGroup,addEmptyGroup:Pe.addEmptyGroup,removeGroup:Pe.removeGroup,dropEntity:Pe.dropEntity,ungroupEntity:Pe.ungroupEntity,dropNote:Pe.dropNote,addPredefinedEmbed:Re.addPredefinedEmbed,convertAttributeType:Re.convertAttributeType,addSerializedTypeAttribute:Re.addSerializedTypeAttribute,addAttribute:Re.addAttribute,addDivider:Re.addDivider,updateAttribute:Re.updateAttribute,setAttributeGroupCode:Re.setAttributeGroupCode,setEmbedColumns:Re.setEmbedColumns,removeAttribute:Re.removeAttribute,removeAttributes:Re.removeAttributes,setAttributeSwatches:Re.setAttributeSwatches,reorderAttributes:Re.reorderAttributes,addIndex(le,me){Ee(le)||Z(qu(le,me))},updateIndex(le,me,ke){Ee(le)||Z(Ya(le,me,ke))},removeIndex(le,me){Ee(le)||Z(Wu(le,me))},addOperation(le,me={}){if(!P.value||Ee(le))return null;const ke=o.logical.entities.find(qe=>qe.modelId===le),Ze=ke!=null&&ke.operations?Jt(ke.operations):0,ct=me.modelId??Fe(),ft={modelId:ct,name:me.name??`method${Ze}`,visibility:me.visibility??"PACKAGE",order:Ze,...me};return Z(Uu(le,ft)),ct},updateOperation(le,me,ke){Ee(le)||Z(Hu(le,me,ke))},removeOperation(le,me){Ee(le)||Z(ju(le,me))},reorderOperations(le,me,ke){!me.length||Ee(le)||Z(Ku(le,me,ke))},setOperationSwatch(le,me,ke){Z(Gu(le,me,ke))},addAssociation:Qe.addAssociation,addEmbedAssociation:Qe.addEmbedAssociation,setEmbedCardinality:Qe.setEmbedCardinality,removeAssociation:Qe.removeAssociation,setAssociationIdentifying:Qe.setAssociationIdentifying,updateAssociationEnd:Qe.updateAssociationEnd,hasQuickFix(le){if(!P.value)return!1;const me=Ol(le,o.logical);return me?me.kind==="setEndCascades"?!be(me.assocRef):!Q(me.entityRef):!1},applyQuickFix(le){if(!P.value)return!1;const me=Ol(le,o.logical);if(!me)return!1;if(me.kind==="setIndexColumns")return Ee(me.entityRef)?!1:(Z(Ya(me.entityRef,me.indexRef,{columns:me.columns})),!0);if(J(me.assocRef))return!1;const ke=o.logical.associations.find(Ze=>Ze.modelId===me.assocRef);return ke?(Z(on(me.assocRef,me.which,{jpa:{...ke[me.which].jpa,cascadeTypes:me.cascades}})),!0):!1},moveWaypoint(le,me,ke){Z(Ju(le,me,ke))},addWaypoint(le,me,ke){Z(em(le,me,ke))},removeWaypoint(le,me){Z(Xu(le,me))},clearWaypoints(le){Z(Qu(le))},addNote:Me.addNote,removeNote:Me.removeNote,moveNote:Me.moveNote,resizeNote:Me.resizeNote,setNoteMemo:Me.setNoteMemo,setNoteSwatch:Me.setNoteSwatch,addNoteConnection:Me.addNoteConnection,removeNoteConnection:Me.removeNoteConnection,moveNoteConnectionWaypoint:Me.moveNoteConnectionWaypoint,addNoteConnectionWaypoint:Me.addNoteConnectionWaypoint,removeNoteConnectionWaypoint:Me.removeNoteConnectionWaypoint,clearNoteConnectionWaypoints:Me.clearNoteConnectionWaypoints,autoLayout(){const le=Pc(o.logical,o.layout);le.length&&Z(rt("자동 배치",le.map(me=>Qo(me.id,me.location))))},copy:ee.copy,paste:ee.paste,importEntities:ee.importEntities}}const Br=Symbol("groupHover"),Ch=Symbol("groupDrag"),Oo=Symbol("relationHighlight"),Sh=Symbol("diffOverlay"),Rh=Symbol("nodeInternals"),Ah=Symbol("columnResolution");function yA(e,n){const o=Object.keys(e);if(o.length!==Object.keys(n).length)return!1;const i=e,a=n;for(const r of o)if(i[r]!==a[r])return!1;return!0}function xh(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let o=0;o<e.length;o++)if(!yA(e[o],n[o]))return!1;return!0}function gA(e,n){const o=e,i=n;for(const a of Object.keys(o))if(o[a]!==i[a])return!1;return!0}function $h(e,n){if(e===n)return!0;const o=Object.keys(e);if(o.length!==Object.keys(n).length)return!1;const i=e,a=n;for(const r of o)if(r==="dbAttrs"){if(!xh(e.dbAttrs,n.dbAttrs))return!1}else if(i[r]!==a[r])return!1;return!0}function bA(e,n){if(e.size!==n.size)return!1;for(const o of e)if(!n.has(o))return!1;return!0}function kA(e,n){if(e.effectiveAttrs.size!==n.effectiveAttrs.size||e.embedCols.size!==n.embedCols.size||e.collectionTypes.size!==n.collectionTypes.size||e.redundantSlots.size!==n.redundantSlots.size)return!1;for(const[o,i]of e.redundantSlots){const a=n.redundantSlots.get(o);if(!a||!bA(i,a))return!1}for(const[o,i]of e.effectiveAttrs){const a=n.effectiveAttrs.get(o);if(!a||!$h(i,a))return!1}for(const[o,i]of e.embedCols){const a=n.embedCols.get(o);if(!a||!xh(i,a))return!1}for(const[o,i]of e.collectionTypes)if(n.collectionTypes.get(o)!==i)return!1;return!!_A(e.classRows,n.classRows)}function _A(e,n){if(e===n)return!0;if(!e||!n||e.length!==n.length)return!1;for(let o=0;o<e.length;o++){const i=e[o],a=n[o];if(i.synthetic!==a.synthetic||i.sourceAttrId!==a.sourceAttrId||i.targetName!==a.targetName||i.collection!==a.collection||i.attr!==a.attr&&!$h(i.attr,a.attr))return!1}return!0}function EA(){let e;return(n,o)=>e=NA(n,o,e)}function NA(e,n,o){const i=e.entities,a=new Map,r={embeddableCatalog:n};let l=null;const s=()=>l??(l=new Map(i.map(c=>[c.modelId,c])));for(const c of i){const d=new Map,u=new Map,m=new Map;let f=null;const p=()=>f??(f=mo(Rn(c,i)));for(const h of c.attributes){if(ki(h)){const S=h.dbAttrs[0],N=S&&Lt(h,S,0,c,e);S&&N&&!gA(N,S)&&d.set(h.modelId,{...h,dbAttrs:[N,...h.dbAttrs.slice(1)]})}if(h.identifier&&h.attrType==="RELATION_OWN"){const S=Jn(e,c.modelId,h.modelId);if(S&&Ta(h,S)){const N=d.get(h.modelId)??h,A=h.derivedIdFieldName||Hl({...h,derivedIdFieldName:void 0},S,s());A&&d.set(h.modelId,{...N,derivedIdFieldName:A})}}const C=wi(h,e.associations);if(C&&m.set(h.modelId,C),vn(h)){u.set(h.modelId,h.dbAttrs.map((S,N)=>Lt(h,S,N,c,e)));continue}if(!h.attrType.startsWith("EMBED")||h.dbAttrs.length===0||h.attrType==="EMBED_PREDEF"&&!(n!=null&&n.some(S=>S.type===h.type)))continue;const v=p();u.set(h.modelId,h.dbAttrs.map((S,N)=>{const A=Lt(h,S,N,c,e,r),T=fo(A,v);return T?{...A,physicalName:T.physicalName}:A}))}const y=new Map,g=new Map;for(const h of c.attributes){const C=u.get(h.modelId);if(C)for(let v=0;v<C.length;v++){const S=`${h.attrType}\0${h.type??""}\0${v}`,N={attrId:h.modelId,slot:v,name:C[v].physicalName??""},A=g.get(S);A?A.push(N):g.set(S,[N])}}for(const h of g.values()){if(h.length<2)continue;const C=new Map;for(const v of h)C.set(v.name,(C.get(v.name)??0)+1);for(const v of h){if((C.get(v.name)??0)<2)continue;const S=y.get(v.attrId);S?S.add(v.slot):y.set(v.attrId,new Set([v.slot]))}}const b=jl(c,e).fields.map(h=>{var C;return{attr:h.attr,synthetic:h.synthetic,sourceAttrId:h.sourceAttr.modelId,targetName:(C=h.target)==null?void 0:C.name,collection:h.collection}}),k={effectiveAttrs:d,embedCols:u,collectionTypes:m,redundantSlots:y,classRows:b},_=o==null?void 0:o.get(c.modelId);a.set(c.modelId,_&&kA(k,_)?_:k)}return a}const Th=Symbol("embedSlotCollapse"),Mh=(e,n)=>`${e}:${n}`,Vh="all:",Lh="one:",Bh="fk:",Dh=e=>`${Vh}${e}`,wA=(e,n)=>`${Lh}${e}:${n}`,IA=(e,n)=>`${Bh}${e}:${n}`,vA=e=>e.startsWith(Bh)||!e.startsWith(Vh)&&!e.startsWith(Lh),CA=["title"],SA={key:0,class:"em-sel","aria-hidden":"true"},RA=["title","aria-expanded","disabled"],AA={class:"em-entity__stereotype"},xA={key:2,class:"em-entity__name"},$A=["title","aria-expanded"],TA={"aria-hidden":"true"},MA=["data-attr","title","onClick","onPointerdown","onPointermove","onPointerup","onPointercancel"],VA=["onPointerdown"],LA={key:1,class:"em-entity__divider-label"},BA=["title"],DA={class:"em-key-slot"},OA={class:"em-key-slot"},PA=["title","aria-expanded","onClick"],zA=["title","onClick"],FA=["title","aria-expanded","onClick"],UA={key:2,class:"em-entity__type"},HA=["onClick"],jA={class:"em-entity__attrname"},KA={class:"em-entity__type"},GA={key:1,class:"em-entity__embed-summary"},YA=["title"],qA=["data-op"],WA=["onPointerdown"],JA={class:"em-entity__op-vis","aria-hidden":"true"},XA=["title"],ZA={key:4,class:"em-entity__footer"},Oh=tt(t.defineComponent({__name:"EntityNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const n=e,o=t.inject(io,null),i=(M,q)=>o?o.t(M,q):cn("ko",M,q),a=t.computed(()=>(o==null?void 0:o.userLanguage.value)??"ko"),r=ne.useModal();function l(){o&&Lr(r,o,n.id)}const s=t.inject(Br,null),c=t.inject(Oo,null),d=t.inject(Sh,null),u=t.computed(()=>{var M;return((M=d==null?void 0:d.marks.value)==null?void 0:M.get(n.id))??null}),m=t.inject(Ah,null),f=t.computed(()=>m==null?void 0:m.value.get(n.id)),p=t.inject(Th,void 0),y=t.inject(Rh,null);t.onUpdated(()=>y==null?void 0:y.mark(n.id));const g=t.computed(()=>!!o&&o.editable.value);function b(){s&&(s.value=n.data.groupRef??null)}function k(){c==null||c.setEntityHover(n.id)}function _(){c==null||c.setEntityHover(null)}const h=t.computed(()=>!!c&&c.primaryEntityIds.value.has(n.id)),C=t.computed(()=>!!c&&c.relatedEntityIds.value.has(n.id)&&!h.value),v=t.computed(()=>{var M;return((M=o==null?void 0:o.selection.value)==null?void 0:M.kind)==="entity"&&o.selection.value.id===n.id}),S=t.computed(()=>!!n.selected&&!v.value),N=t.computed(()=>{var M;return o&&((M=o.selectedAttr.value)==null?void 0:M.entityId)===n.id?new Set(o.selectedAttrIds.value):new Set}),A=t.computed(()=>N.value.size>0);function T(M,q){const Ce=q.shiftKey?"range":q.metaKey||q.ctrlKey?"toggle":"replace";o==null||o.selectAttribute(n.id,x(M),Ce)}const O=t.computed(()=>!!c&&c.active.value&&!c.relatedEntityIds.value.has(n.id)&&!v.value),z=t.computed(()=>n.data.entity),P=t.computed(()=>gg(z.value,o==null?void 0:o.referenceOnlyDocument.value)),D=t.computed(()=>n.data.displayMode??"LOGICAL_PHYSICAL"),E=t.computed(()=>{var M;if(D.value==="CLASS"){const q=(M=f.value)==null?void 0:M.classRows;if(q)return q.map(Ce=>Ce.attr)}return[...z.value.attributes].sort((q,Ce)=>q.order-Ce.order)}),R=t.computed(()=>{var q;const M=D.value==="CLASS"?(q=f.value)==null?void 0:q.classRows:void 0;return new Set((M??[]).filter(Ce=>Ce.synthetic).map(Ce=>Ce.attr.modelId))});function I(M){return R.value.has(M.modelId)}function x(M){return F.value.get(M.modelId)??M.modelId}function $(M){return N.value.has(x(M))}function U(M){var q;return!!((q=u.value)!=null&&q.changedAttributeIds.has(x(M)))}const F=t.computed(()=>{var q;const M=new Map;if(D.value!=="CLASS")return M;for(const Ce of((q=f.value)==null?void 0:q.classRows)??[])Ce.synthetic&&M.set(Ce.attr.modelId,Ce.sourceAttrId);return M}),B=t.computed(()=>{var Ce;const M=new Map,q=D.value==="CLASS";for(const Be of((Ce=f.value)==null?void 0:Ce.classRows)??[])!q&&!vn(Be.attr)||(Be.targetName||Be.collection)&&M.set(Be.attr.modelId,{targetName:Be.targetName,collection:Be.collection});return M}),j=t.computed(()=>n.data.collapsed??!1),X=t.computed(()=>n.data.locked??!1),W=t.computed(()=>g.value&&!X.value);function oe(){g.value&&(o==null||o.setEntityCollapsed(n.id,!j.value))}const de=t.computed(()=>!j.value&&E.value.some(M=>!ge(M))),ie=[{id:"e-left",pos:Ve.Left},{id:"e-right",pos:Ve.Right}],Ie=t.computed(()=>D.value==="PHYSICAL"||D.value==="LOGICAL_PHYSICAL"),Le=t.computed(()=>{var Ce;const M=D.value==="PHYSICAL"||D.value==="LOGICAL_PHYSICAL",q={};for(const Be of E.value){const ue=Be.attrType.startsWith("RELATION")&&Be.dbAttrs.length>0,Ae=mn(((Ce=z.value)==null?void 0:Ce.stereotype)??"UNDEFINED");q[Be.modelId]={pk:Be.identifier,fk:ue&&M,required:!Ae&&Be.notNull&&!Be.identifier}}return q});function Se(M){if(!M)return"";const q=[];return M.pk&&M.fk?q.push(i("em.node.keyPfk")):M.pk?q.push(i("em.node.keyPk")):M.fk&&q.push(i("em.node.keyFk")),M.required&&q.push(i("em.node.required")),q.join(" · ")}const ce=t.computed(()=>{const M=Qs(Bt(n.data.style)),q={};return M&&(q["--em-header-bg"]=M.bar,q["--em-header-fg"]=M.barOn),q});function pe(M){var q,Ce;return(Ce=Qs(Bt((q=n.data.attributeStyles)==null?void 0:q[M.modelId])))==null?void 0:Ce.text}const he=t.computed(()=>[...z.value.operations??[]].sort((M,q)=>M.order-q.order)),V=t.computed(()=>D.value==="CLASS"&&he.value.length>0),L={PUBLIC:"+",PRIVATE:"-",PROTECTED:"#",PACKAGE:"~"};function K(M){return M?L[M]:"~"}function Z(M){var q,Ce;return(Ce=Qs(Bt((q=n.data.operationStyles)==null?void 0:q[M.modelId])))==null?void 0:Ce.text}function Q(M,q,Ce){switch(D.value){case"CLASS":return[{text:M}];case"PHYSICAL":return[{text:Ce||M}];case"LOGICAL":return[q?{text:q}:{text:i("em.node.logicalMissing"),missing:!0}];default:{const Be=q?{text:q}:{text:i("em.node.logicalMissing"),missing:!0};return Ce?[Be,{text:` · ${Ce}`}]:[Be]}}}function fe(M){var q;return((q=f.value)==null?void 0:q.effectiveAttrs.get(M.modelId))??M}function be(M){var Be;if(ee(M))return[{text:M.name}];const q=fe(M),Ce=jo(q,q.dbAttrs[0]);return Q(Ee(M),Ce==null?void 0:Ce[a.value],((Be=q.dbAttrs[0])==null?void 0:Be.physicalName)??"")}function Ee(M){return D.value==="CLASS"?M.name:fe(M).derivedIdFieldName||M.name}function Ne(M){return M.attrType.startsWith("EMBED")&&M.dbAttrs.length>0}const J=vn;function ee(M){return Ne(M)||J(M)}function te(M){return J(M)?IA(n.id,M.modelId):wA(n.id,M.modelId)}function ge(M){return M.attrType==="DIVIDER"}function Re(M){var q;return((q=f.value)==null?void 0:q.embedCols.get(M.modelId))??M.dbAttrs}function Pe(M){var q;return(q=f.value)==null?void 0:q.redundantSlots.get(M.modelId)}const Me=t.computed(()=>(p==null?void 0:p.isCollapsed(Dh(n.id)))??!1),Qe=t.computed(()=>Me.value&&Ie.value?E.value.reduce((M,q)=>ee(q)?M+Re(q).length:M,0):0),Ot=t.computed(()=>E.value.some(M=>ee(M)));function ht(M){const q=Pe(M);return!q||q.size===0?!1:p?p.isCollapsed(Mh(n.id,M.modelId)):!1}function re(M){var q;return ht(M)?((q=Pe(M))==null?void 0:q.size)??0:0}function ve(M){return p?p.isCollapsed(te(M)):!1}function le(M){var q;return!Ie.value||Me.value?null:ve(M)?"attr":(((q=Pe(M))==null?void 0:q.size)??0)>0?"slot":null}function me(M){return!Me.value&&ee(M)}function ke(M){return ve(M)?Re(M).length:0}function Ze(M){if(Me.value||ve(M))return[];const q=Re(M);if(!ht(M))return q;const Ce=Pe(M);return q.filter((Be,ue)=>!Ce.has(ue))}function ct(M){p==null||p.toggle(Mh(n.id,M.modelId))}function ft(M){p==null||p.toggle(te(M))}function qe(){p==null||p.toggle(Dh(n.id))}function Rt(M){var q;return Q(M.physicalName,(q=M.logicalName)==null?void 0:q[a.value],M.physicalName)}function et(M){var Ae;const q=B.value.get(M.modelId),Ce=(q==null?void 0:q.collection)??((Ae=f.value)==null?void 0:Ae.collectionTypes.get(M.modelId)),Be=o?Ei(M,Go(o.state.logical),z.value,o.state.logical):void 0,ue=(Be==null?void 0:Be.kind)==="resolved"?Be.entity:void 0;return _l(D.value,fe(M),Ce,q==null?void 0:q.targetName,ue)}const jt=t.computed(()=>{const M={};for(const q of E.value)M[q.modelId]=et(q);return M}),Nt=t.computed(()=>{var M,q;return Q(z.value.name,(M=Sn(z.value))==null?void 0:M[a.value],((q=z.value.table)==null?void 0:q.physicalName)??"")}),ut=t.ref(!1),yt=t.ref(""),At=t.ref(null);async function jn(){var M,q;W.value&&(yt.value=z.value.name,ut.value=!0,await t.nextTick(),(M=At.value)==null||M.focus(),(q=At.value)==null||q.select())}function mt(){if(!ut.value)return;ut.value=!1;const M=yt.value.trim();M&&M!==z.value.name&&(o==null||o.renameEntity(n.id,M))}function ze(){o==null||o.addAttribute(n.id)}function Y(){o==null||o.addDivider(n.id)}const{screenToFlowCoordinate:Wt,findNode:G}=ot(),ae=t.ref(null),De=t.computed(()=>{const M=ae.value??n.data.size;return M?{width:`${M.width}px`,minHeight:`${M.height}px`}:void 0});let je=null;function bt(M){var Be,ue,Ae;if(!W.value)return;M.stopPropagation();const q=(Be=G(n.id))==null?void 0:Be.dimensions,Ce=Wt({x:M.clientX,y:M.clientY});je={fx:Ce.x,fy:Ce.y,w:(q==null?void 0:q.width)??((ue=n.data.size)==null?void 0:ue.width)??200,h:(q==null?void 0:q.height)??((Ae=n.data.size)==null?void 0:Ae.height)??120},M.target.setPointerCapture(M.pointerId)}function Vt(M){if(!je)return;const q=Wt({x:M.clientX,y:M.clientY});ae.value={width:Math.max(40,je.w+(q.x-je.fx)),height:Math.max(40,je.h+(q.y-je.fy))}}function Ye(M){var q,Ce,Be;if(je&&ae.value&&o){const ue=(q=G(n.id))==null?void 0:q.dimensions;o.resizeEntity(n.id,{width:Math.round((ue==null?void 0:ue.width)??ae.value.width),height:Math.round((ue==null?void 0:ue.height)??ae.value.height)})}je=null,ae.value=null,(Be=(Ce=M.target).releasePointerCapture)==null||Be.call(Ce,M.pointerId)}const Ue=t.ref(null),w=t.ref(null);function H(M,q){if(!W.value)return;q.stopPropagation(),q.preventDefault();const Ce=N.value,Be=Ce.has(M.modelId)?new Set(Ce):new Set([M.modelId]);w.value={ids:Be,dropIndex:-1,lineY:0},q.target.setPointerCapture(q.pointerId)}function se(M){if(!w.value||!Ue.value)return;const q=Array.from(Ue.value.querySelectorAll(".em-entity__row"));if(!q.length)return;let Ce=q.length;for(let Ae=0;Ae<q.length;Ae++){const it=q[Ae].getBoundingClientRect();if(M.clientY<it.top+it.height/2){Ce=Ae;break}}const Be=q[q.length-1],ue=Ce<q.length?q[Ce].offsetTop:Be.offsetTop+Be.offsetHeight;w.value={...w.value,dropIndex:Ce,lineY:ue}}function _e(){const M=w.value;if(w.value=null,!M||M.dropIndex<0)return;const q=E.value,Ce=q.filter(We=>M.ids.has(We.modelId)).map(We=>We.modelId),Be=q.filter((We,Ho)=>M.ids.has(We.modelId)&&Ho<M.dropIndex).length,ue=M.dropIndex-Be,Ae=q.filter(We=>!M.ids.has(We.modelId)).map(We=>We.modelId);[...Ae.slice(0,ue),...Ce,...Ae.slice(ue)].join(",")!==q.map(We=>We.modelId).join(",")&&(o==null||o.reorderAttributes(n.id,Ce,ue))}function $e(){w.value=null}const Oe=t.ref(null),He=t.ref(null);function Ke(M,q){W.value&&(q.stopPropagation(),q.preventDefault(),He.value={id:M.modelId,dropIndex:-1,lineY:0},q.target.setPointerCapture(q.pointerId))}function we(M){if(!He.value||!Oe.value)return;const q=Array.from(Oe.value.querySelectorAll(".em-entity__op-row"));if(!q.length)return;let Ce=q.length;for(let Ae=0;Ae<q.length;Ae++){const it=q[Ae].getBoundingClientRect();if(M.clientY<it.top+it.height/2){Ce=Ae;break}}const Be=q[q.length-1],ue=Ce<q.length?q[Ce].offsetTop:Be.offsetTop+Be.offsetHeight;He.value={...He.value,dropIndex:Ce,lineY:ue}}function Je(){const M=He.value;if(He.value=null,!M||M.dropIndex<0)return;const Ce=he.value.findIndex(ue=>ue.modelId===M.id);if(Ce<0)return;const Be=M.dropIndex-(Ce<M.dropIndex?1:0);Be!==Ce&&(o==null||o.reorderOperations(n.id,[M.id],Be))}function Xe(){He.value=null}return(M,q)=>{var Ce,Be;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-entity",{"is-hover-origin":h.value,"is-related":C.value,"is-dimmed":O.value,"is-selected":v.value,"is-multi-selected":S.value,"has-focused-attr":A.value,"is-locked":X.value,"is-reference-only":P.value,"is-diff-added":((Ce=u.value)==null?void 0:Ce.verb)==="added","is-diff-modified":((Be=u.value)==null?void 0:Be.verb)==="modified"}]),tabindex:"-1",title:P.value?i("em.entity.referenceOnlyHint"):void 0,style:t.normalizeStyle(De.value),onPointerdown:b,onMouseenter:k,onMouseleave:_,onDblclick:l},[v.value?(t.openBlock(),t.createElementBlock("div",SA,[...q[11]||(q[11]=[t.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):t.createCommentVNode("",!0),t.createElementVNode("header",{class:"em-entity__header",style:t.normalizeStyle(ce.value),onDblclick:t.withModifiers(jn,["stop"])},[de.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},t.renderList(ie,ue=>t.createVNode(t.unref(oo),{id:ue.id,key:ue.id,type:"source",position:ue.pos,class:"em-handle em-handle--node",title:W.value?i("em.node.connectHintNode"):void 0},null,8,["id","position","title"])),64)),t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__caret nodrag",title:i(j.value?"em.panel.expand":"em.panel.collapse"),"aria-expanded":!j.value,disabled:!g.value,onClick:t.withModifiers(oe,["stop"]),onPointerdown:q[0]||(q[0]=t.withModifiers(()=>{},["stop"])),onDblclick:q[1]||(q[1]=t.withModifiers(()=>{},["stop"]))},t.toDisplayString(j.value?"▸":"▾"),41,RA),t.createElementVNode("span",AA,"«"+t.toDisplayString(t.unref(gi)(z.value.stereotype))+"»",1),ut.value?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:1,ref_key:"inputEl",ref:At,"onUpdate:modelValue":q[2]||(q[2]=ue=>yt.value=ue),class:"em-entity__name-input nodrag",onKeyup:[t.withKeys(mt,["enter"]),q[3]||(q[3]=t.withKeys(ue=>ut.value=!1,["esc"]))],onBlur:mt,onPointerdown:q[4]||(q[4]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,yt.value]]):(t.openBlock(),t.createElementBlock("span",xA,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Nt.value,(ue,Ae)=>(t.openBlock(),t.createElementBlock("span",{key:Ae,class:t.normalizeClass({"em-entity__missing":ue.missing})},t.toDisplayString(ue.text),3))),128))])),!j.value&&Ie.value&&Ot.value?(t.openBlock(),t.createElementBlock("button",{key:3,tabindex:"-1",type:"button",class:"em-entity__embed-all nodrag",title:Me.value?i("em.node.embedAllShow"):i("em.node.embedAllHide"),"aria-expanded":!Me.value,onClick:t.withModifiers(qe,["stop"]),onPointerdown:q[5]||(q[5]=t.withModifiers(()=>{},["stop"])),onDblclick:q[6]||(q[6]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(xe,{name:"table",size:11}),t.createElementVNode("span",TA,t.toDisplayString(Me.value?"▸":"▾"),1)],40,$A)):t.createCommentVNode("",!0),X.value?(t.openBlock(),t.createBlock(xe,{key:4,name:"lock",size:12,class:"em-entity__lock",title:i("em.node.editLock")},null,8,["title"])):t.createCommentVNode("",!0),u.value?(t.openBlock(),t.createElementBlock("span",{key:5,class:t.normalizeClass(["em-entity__diff-badge",u.value.verb==="added"?"is-added":"is-modified"]),"aria-hidden":"true"},t.toDisplayString(u.value.verb==="added"?"+":"±"),3)):t.createCommentVNode("",!0)],36),j.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("ul",{key:1,ref_key:"attrsUl",ref:Ue,class:"em-entity__attrs"},[w.value&&w.value.dropIndex>=0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:t.normalizeStyle({top:`${w.value.lineY}px`}),"aria-hidden":"true"},null,4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.value,ue=>{var Ae,it,We,Ho,pa;return t.openBlock(),t.createElementBlock(t.Fragment,{key:ue.modelId},[t.createElementVNode("li",{class:t.normalizeClass(["em-entity__row",{"is-attr-selected":$(ue),"is-dragging":(Ae=w.value)==null?void 0:Ae.ids.has(ue.modelId),"is-embed":ee(ue),"is-divider":ge(ue),"has-embed-badge":!!le(ue),nodrag:ge(ue)&&W.value,"is-diff-changed":U(ue),"is-synthetic":I(ue)}]),"data-attr":ue.modelId,title:I(ue)?i("em.node.derivedIdRow"):void 0,onClick:t.withModifiers(gt=>T(ue,gt),["stop"]),onPointerdown:gt=>ge(ue)?H(ue,gt):void 0,onPointermove:gt=>ge(ue)?se(gt):void 0,onPointerup:gt=>ge(ue)?_e():void 0,onPointercancel:gt=>ge(ue)?$e():void 0},[W.value&&!ge(ue)&&!I(ue)?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:gt=>H(ue,gt),onPointermove:se,onPointerup:_e,onPointercancel:$e,onClick:q[7]||(q[7]=t.withModifiers(()=>{},["stop"]))},"⠿",40,VA)):t.createCommentVNode("",!0),ge(ue)?(t.openBlock(),t.createElementBlock("span",LA,t.toDisplayString(ue.name),1)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createVNode(t.unref(oo),{id:`l:${ue.modelId}`,type:"target",position:t.unref(Ve).Left,class:"em-handle",title:W.value?i("em.node.connectHint"):void 0},null,8,["id","position","title"]),t.createElementVNode("span",{class:"em-entity__keys",title:Se(Le.value[ue.modelId]),"aria-hidden":"true"},[t.createElementVNode("span",DA,[(it=Le.value[ue.modelId])!=null&&it.pk?(t.openBlock(),t.createBlock(xe,{key:0,name:"key",size:12,class:"em-key is-pk"})):(We=Le.value[ue.modelId])!=null&&We.required?(t.openBlock(),t.createBlock(xe,{key:1,name:"asterisk",size:14,class:"em-key is-required"})):t.createCommentVNode("",!0)]),t.createElementVNode("span",OA,[Ie.value&&me(ue)?(t.openBlock(),t.createElementBlock("button",{key:0,tabindex:"-1",type:"button",class:"em-embed-caret nodrag",title:ve(ue)?i("em.node.embedAttrShow",{count:ke(ue)}):i("em.node.embedAttrHide"),"aria-expanded":!ve(ue),onClick:t.withModifiers(gt=>ft(ue),["stop"]),onPointerdown:q[8]||(q[8]=t.withModifiers(()=>{},["stop"])),onDblclick:q[9]||(q[9]=t.withModifiers(()=>{},["stop"]))},t.toDisplayString(ve(ue)?"▸":"▾"),41,PA)):ee(ue)?(t.openBlock(),t.createBlock(xe,{key:1,name:"table",size:11,class:"em-embed-glyph"})):(Ho=Le.value[ue.modelId])!=null&&Ho.fk?(t.openBlock(),t.createBlock(xe,{key:2,name:"key",size:12,class:"em-key is-fk"})):t.createCommentVNode("",!0)])],8,BA),t.createElementVNode("span",{class:"em-entity__attrname",style:t.normalizeStyle({color:pe(ue)})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(be(ue),(gt,Kn)=>(t.openBlock(),t.createElementBlock("span",{key:Kn,class:t.normalizeClass({"em-entity__missing":gt.missing})},t.toDisplayString(gt.text),3))),128))],4),le(ue)==="attr"?(t.openBlock(),t.createElementBlock("button",{key:0,tabindex:"-1",type:"button",class:"em-entity__embed-fold nodrag","data-axis":"attr",title:i("em.node.embedAttrShow",{count:ke(ue)}),onClick:t.withModifiers(gt=>ft(ue),["stop"])},"+"+t.toDisplayString(ke(ue)),9,zA)):le(ue)==="slot"?(t.openBlock(),t.createElementBlock("button",{key:1,tabindex:"-1",type:"button",class:"em-entity__embed-fold nodrag","data-axis":"slot",title:ht(ue)?i("em.node.embedRepeatedShow",{count:((pa=Pe(ue))==null?void 0:pa.size)??0}):i("em.node.embedRepeatedHide"),"aria-expanded":!ht(ue),onClick:t.withModifiers(gt=>ct(ue),["stop"])},t.toDisplayString(ht(ue)?`+${re(ue)}`:"−"),9,FA)):t.createCommentVNode("",!0),jt.value[ue.modelId]?(t.openBlock(),t.createElementBlock("span",UA,t.toDisplayString(jt.value[ue.modelId]),1)):t.createCommentVNode("",!0),t.createVNode(t.unref(oo),{id:`r:${ue.modelId}`,type:"source",position:t.unref(Ve).Right,class:"em-handle",title:W.value?i("em.node.connectHint"):void 0},null,8,["id","position","title"])],64))],42,MA),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ee(ue)&&Ie.value?Ze(ue):[],gt=>(t.openBlock(),t.createElementBlock("li",{key:`${ue.modelId}:${gt.modelId}`,class:t.normalizeClass(["em-entity__embed-col",{"is-group-selected":$(ue)}]),onClick:t.withModifiers(Kn=>T(ue,Kn),["stop"])},[q[12]||(q[12]=t.createElementVNode("span",{class:"em-entity__embed-rail","aria-hidden":"true"},null,-1)),t.createElementVNode("span",jA,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Rt(gt),(Kn,al)=>(t.openBlock(),t.createElementBlock("span",{key:al,class:t.normalizeClass({"em-entity__missing":Kn.missing})},t.toDisplayString(Kn.text),3))),128))]),t.createElementVNode("span",KA,t.toDisplayString(gt.dataType),1)],10,HA))),128))],64)}),128)),Qe.value?(t.openBlock(),t.createElementBlock("li",GA,[t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__embed-summary-btn nodrag",title:i("em.node.embedAllShow"),onClick:t.withModifiers(qe,["stop"])},[t.createVNode(xe,{name:"table",size:11}),t.createElementVNode("span",null,t.toDisplayString(i("em.node.embedAllSummary",{n:Qe.value})),1)],8,YA)])):t.createCommentVNode("",!0)],512)),!j.value&&V.value?(t.openBlock(),t.createElementBlock("ul",{key:2,ref_key:"opsUl",ref:Oe,class:"em-entity__ops"},[He.value&&He.value.dropIndex>=0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:t.normalizeStyle({top:`${He.value.lineY}px`}),"aria-hidden":"true"},null,4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(he.value,ue=>{var Ae,it;return t.openBlock(),t.createElementBlock("li",{key:ue.modelId,class:t.normalizeClass(["em-entity__op-row",{"is-dragging":((Ae=He.value)==null?void 0:Ae.id)===ue.modelId,"is-diff-changed":!!((it=u.value)!=null&&it.changedOperationIds.has(ue.modelId))}]),"data-op":ue.modelId},[W.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:We=>Ke(ue,We),onPointermove:we,onPointerup:Je,onPointercancel:Xe,onClick:q[10]||(q[10]=t.withModifiers(()=>{},["stop"]))},"⠿",40,WA)):t.createCommentVNode("",!0),t.createElementVNode("span",JA,t.toDisplayString(K(ue.visibility)),1),t.createElementVNode("span",{class:"em-entity__op-name",style:t.normalizeStyle({color:Z(ue)})},t.toDisplayString(ue.name)+"()",5)],10,qA)}),128))],512)):he.value.length?(t.openBlock(),t.createElementBlock("div",{key:3,class:"em-entity__ops-summary",title:i("em.node.opsSummaryTitle",{n:he.value.length})},[t.createVNode(xe,{name:"method",size:12}),t.createElementVNode("span",null,t.toDisplayString(i("em.node.opsSummary",{n:he.value.length})),1)],8,XA)):t.createCommentVNode("",!0),W.value?(t.openBlock(),t.createElementBlock("footer",ZA,[t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__add nodrag",onClick:ze},t.toDisplayString(i("em.node.addAttr")),1),q[13]||(q[13]=t.createElementVNode("span",{class:"em-entity__footer-sep","aria-hidden":"true"},null,-1)),t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__add nodrag",onClick:Y},t.toDisplayString(i("em.node.addDivider")),1)])):t.createCommentVNode("",!0),W.value&&!ut.value?(t.openBlock(),t.createElementBlock("div",{key:5,class:"em-entity__resize nodrag nopan",onPointerdown:bt,onPointermove:Vt,onPointerup:Ye},null,32)):t.createCommentVNode("",!0)],46,CA)}}}),[["__scopeId","data-v-0224247e"]]),QA={key:0,class:"em-sel","aria-hidden":"true"},ex={class:"em-group__label"},tx={class:"em-group__name"},nx={key:0,class:"em-group__pkg"},ox={key:1,class:"em-group__flag"},Ph=tt(t.defineComponent({__name:"GroupNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const n=e,o=t.computed(()=>n.data.group),i=t.computed(()=>n.data.locked??!1),a=t.computed(()=>Bt(n.data.style)),r=t.computed(()=>a.value?{"--em-group-fill":`color-mix(in srgb, var(--em-swatch-${a.value}-bar) 14%, transparent)`}:{}),l=t.inject(io,null),s=(z,P)=>l?l.t(z,P):cn("ko",z,P),c=t.computed(()=>!!l&&l.editable.value),d=t.computed(()=>{var z;return!!n.id&&((z=l==null?void 0:l.selection.value)==null?void 0:z.kind)==="group"&&l.selection.value.id===n.id}),u=t.computed(()=>!!n.selected&&!d.value),m=t.inject(Br,null),f=t.computed(()=>!!n.id&&(m==null?void 0:m.value)===n.id),p=t.inject(Oo,null);function y(){n.id&&(p==null||p.setGroupHover(n.id))}function g(){p==null||p.setGroupHover(null)}const b=t.computed(()=>!!p&&p.hoverGroupId.value===n.id),k=t.computed(()=>!!p&&p.hoverGroupId.value!==null&&p.hoverGroupId.value!==n.id),{screenToFlowCoordinate:_,findNode:h}=ot();let C=null,v=null;function S(z){var E;if(!n.id||!c.value)return;z.stopPropagation();const P=((E=h(n.id))==null?void 0:E.dimensions)??{width:400,height:300},D=_({x:z.clientX,y:z.clientY});C={fx:D.x,fy:D.y,w:P.width,h:P.height},z.target.setPointerCapture(z.pointerId)}function N(z){if(!C||!n.id)return;const P=_({x:z.clientX,y:z.clientY});v={width:Math.max(160,C.w+(P.x-C.fx)),height:Math.max(120,C.h+(P.y-C.fy))};const D=h(n.id);D&&(D.style={width:`${v.width}px`,height:`${v.height}px`})}function A(z){var P,D;C&&v&&n.id&&l&&l.resizeGroup(n.id,v),C=null,v=null,(D=(P=z.target).releasePointerCapture)==null||D.call(P,z.pointerId)}const T=t.computed(()=>(l==null?void 0:l.userLanguage.value)??"ko"),O=t.computed(()=>{const z=o.value.name;return Ct(z,T.value)||o.value.packageName||s("em.group.fallback")});return(z,P)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-group",{"is-drop-target":f.value,"is-hover-origin":b.value,"is-dimmed":k.value,"is-selected":d.value,"is-multi-selected":u.value,"is-locked":i.value}]),tabindex:"-1",style:t.normalizeStyle(r.value),onMouseenter:y,onMouseleave:g},[d.value?(t.openBlock(),t.createElementBlock("div",QA,[...P[0]||(P[0]=[t.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):t.createCommentVNode("",!0),t.createElementVNode("div",ex,[t.createElementVNode("span",tx,t.toDisplayString(O.value),1),o.value.packageName?(t.openBlock(),t.createElementBlock("span",nx,t.toDisplayString(o.value.packageName),1)):t.createCommentVNode("",!0),o.value.excludeDDLGeneration?(t.openBlock(),t.createElementBlock("span",ox,t.toDisplayString(s("em.group.ddlExcludeBadge")),1)):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createBlock(xe,{key:2,name:"lock",size:12,class:"em-group__lock",title:s("em.node.editLock")},null,8,["title"])):t.createCommentVNode("",!0)]),c.value&&!i.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"em-group__resize nodrag nopan",onPointerdown:S,onPointermove:N,onPointerup:A},null,32)):t.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-4fd27d62"]]),ix={key:0,class:"em-sel","aria-hidden":"true"},ax={key:2,class:"em-note__text"},zh=tt(t.defineComponent({__name:"NoteNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const n=e,o=t.inject(io,null),i=t.inject(Br,null),a=t.inject(Oo,null),r=t.computed(()=>n.data.note),l=t.computed(()=>!!o&&o.editable.value),s=t.computed(()=>Bt(r.value.style)),c=t.computed(()=>s.value?{"--em-note-fill":`color-mix(in srgb, var(--em-swatch-${s.value}-bar) 16%, var(--em-note-surface))`,"--em-note-stroke":`color-mix(in srgb, var(--em-swatch-${s.value}-bar) 50%, var(--em-note-border))`}:{});function d(){i&&(i.value=n.data.groupRef??null)}function u(){a==null||a.setNoteHover(n.id)}function m(){a==null||a.setNoteHover(null)}const f=t.computed(()=>{var E;return((E=a==null?void 0:a.source.value)==null?void 0:E.kind)==="note"&&a.source.value.id===n.id}),p=t.computed(()=>!!a&&a.relatedNoteIds.value.has(n.id)&&!f.value),y=t.computed(()=>{var E;return((E=o==null?void 0:o.selection.value)==null?void 0:E.kind)==="note"&&o.selection.value.id===n.id}),g=t.computed(()=>!!n.selected&&!y.value),b=t.computed(()=>!!a&&a.active.value&&!a.relatedNoteIds.value.has(n.id)&&!y.value),k=[{id:"n-top",pos:Ve.Top},{id:"n-right",pos:Ve.Right},{id:"n-bottom",pos:Ve.Bottom},{id:"n-left",pos:Ve.Left}],_=t.ref(!1),h=t.ref(""),C=t.ref(null);async function v(){var E;l.value&&(h.value=r.value.memo,_.value=!0,await t.nextTick(),(E=C.value)==null||E.focus())}function S(){_.value&&(_.value=!1,h.value!==r.value.memo&&(o==null||o.setNoteMemo(n.id,h.value)))}const{screenToFlowCoordinate:N,findNode:A}=ot();let T=null,O=null;function z(E){var x;if(!l.value)return;E.stopPropagation();const R=((x=A(n.id))==null?void 0:x.dimensions)??r.value.geo.size,I=N({x:E.clientX,y:E.clientY});T={fx:I.x,fy:I.y,w:R.width,h:R.height},E.target.setPointerCapture(E.pointerId)}function P(E){if(!T)return;const R=N({x:E.clientX,y:E.clientY});O={width:Math.max(140,T.w+(R.x-T.fx)),height:Math.max(60,T.h+(R.y-T.fy))};const I=A(n.id);I&&(I.style={width:`${O.width}px`,height:`${O.height}px`})}function D(E){var R,I;T&&O&&o&&o.resizeNote(n.id,O),T=null,O=null,(I=(R=E.target).releasePointerCapture)==null||I.call(R,E.pointerId)}return(E,R)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-note",{"is-hover-origin":f.value,"is-related":p.value,"is-dimmed":b.value,"is-selected":y.value,"is-multi-selected":g.value}]),tabindex:"-1",style:t.normalizeStyle(c.value),onDblclick:v,onPointerdown:d,onMouseenter:u,onMouseleave:m},[y.value?(t.openBlock(),t.createElementBlock("div",ix,[...R[4]||(R[4]=[t.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):t.createCommentVNode("",!0),_.value?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:1,ref_key:"area",ref:C,"onUpdate:modelValue":R[0]||(R[0]=I=>h.value=I),class:"em-note__edit nodrag",onBlur:S,onKeydown:R[1]||(R[1]=t.withKeys(I=>_.value=!1,["esc"])),onPointerdown:R[2]||(R[2]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,h.value]]):(t.openBlock(),t.createElementBlock("div",ax,t.toDisplayString(r.value.memo),1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(k,I=>t.createVNode(t.unref(oo),{id:I.id,key:I.id,type:"source",position:I.pos,class:"em-note-handle",onPointerdown:R[3]||(R[3]=t.withModifiers(()=>{},["stop"]))},null,8,["id","position"])),64)),l.value&&!_.value?(t.openBlock(),t.createElementBlock("div",{key:3,class:"em-note__resize nodrag nopan",onPointerdown:z,onPointermove:P,onPointerup:D},null,32)):t.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-62a09d8c"]]);function Dr(e){switch(e){case"right":return{x:1,y:0};case"left":return{x:-1,y:0};case"top":return{x:0,y:-1};case"bottom":return{x:0,y:1}}}const ui=.5;function Fh(e,n,o,i,a,r){const l=Dr(n),s=Dr(a),c={x:e.x+l.x*r,y:e.y+l.y*r},d={x:i.x+s.x*r,y:i.y+s.y*r},u=[c,...o,d],m=[];let f=e;const p=(b,k)=>{(Math.abs(b.x-f.x)>=ui||Math.abs(b.y-f.y)>=ui)&&(m.push({a:f,b,seg:k}),f=b)};p(c,0);let y=l.x!==0,g=c;for(let b=1;b<u.length;b++){const k=u[b],_=b<=o.length?b-1:o.length,h=Math.abs(k.x-g.x)<ui,C=Math.abs(k.y-g.y)<ui;h&&C||(h?(p(k,_),y=!1):C?(p(k,_),y=!0):y?(p({x:g.x,y:k.y},_),p(k,_),y=!0):(p({x:k.x,y:g.y},_),p(k,_),y=!1),g=k)}return p(i,o.length),m}function rc(e,n,o,i,a,r=20){const l=Fh(e,n,o,i,a,r);let s=`M ${Dt(e.x)},${Dt(e.y)}`;for(const c of l)s+=` L ${Dt(c.b.x)},${Dt(c.b.y)}`;return s}const rx=14;function Uh(e,n,o,i,a,r=20){return Fh(e,n,o,i,a,r).filter(l=>Math.hypot(l.b.x-l.a.x,l.b.y-l.a.y)>=rx).map(l=>({point:{x:(l.a.x+l.b.x)/2,y:(l.a.y+l.b.y)/2},segIndex:l.seg}))}function Dt(e){return Math.round(e*100)/100}const lx=36;function sx(e,n,o=lx){const i=Math.max(e.x,n.x)+o;return`M ${Dt(e.x)},${Dt(e.y)} L ${Dt(i)},${Dt(e.y)} L ${Dt(i)},${Dt(n.y)} L ${Dt(n.x)},${Dt(n.y)}`}function lc(e,n,o){const i=[e,...n,o];let a=`M ${Dt(i[0].x)},${Dt(i[0].y)}`;for(let r=1;r<i.length;r++)a+=` L ${Dt(i[r].x)},${Dt(i[r].y)}`;return a}function cx(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Hh(e,n){const o=cx(e),i=e.width/2,a=e.height/2,r=n.x-o.x,l=n.y-o.y;if(Math.abs(r)<ui&&Math.abs(l)<ui)return{point:{x:e.x+e.width,y:o.y},side:"right"};const s=r!==0?i/Math.abs(r):1/0,c=l!==0?a/Math.abs(l):1/0,d=Math.min(s,c),u={x:o.x+r*d,y:o.y+l*d},m=s<=c?r>=0?"right":"left":l>=0?"bottom":"top";return{point:u,side:m}}function jh(e,n,o){const i=o>=e.x+e.width/2;return{point:{x:i?e.x+e.width:e.x,y:n},side:i?"right":"left"}}function Kh(e,n,o){const i=[e,...n,o],a=[];for(let r=1;r<i.length;r++){const l=i[r-1],s=i[r];a.push({x:(l.x+s.x)/2,y:(l.y+s.y)/2})}return a}const dx=20,ux=22,mx=7,fx=22,Gh=31,Yh=7,px=20,qh=11,Wh=11,hx=Gh+Yh;function yx(e){return e==="NO_INSTANCE_OR_ONE_INSTANCE"||e==="ZERO_OR_MORE_INSTANCES"}function gx(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function Or(e,n,o){const i=n.x-e.x,a=n.y-e.y,r=Math.hypot(i,a)||1;return{x:e.x+i*o/r,y:e.y+a*o/r}}function Jh(e,n){return Math.atan2(n.y-e.y,n.x-e.x)}function Pr(e,n,o){return{x:Math.cos(o)*n+e.x,y:Math.sin(o)*n+e.y}}function Xh(e,n,o,i){const a=i/2,r=e.x===n.x&&e.y===n.y?Math.PI/2:Jh(e,n);return[Pr(o,a,r-Math.PI/2),Pr(o,a,r+Math.PI/2)]}function Zh(e,n,o,i){const a=n*180/Math.PI,l=(a>=0?i?a-20:a+20:i?a+20:a-20)*Math.PI/180;return{x:Math.sin(l)*o+e.x,y:Math.cos(l)*o+e.y}}function Qh(e,n,o,i){const a=[],r=[],l=[];if(e.x===n.x&&e.y===n.y)return{lines:a,circles:r,polygons:l};if(i==="db"){const c=Or(e,n,dx),[d,u]=Xh(e,n,c,ux);if(a.push({x1:d.x,y1:d.y,x2:u.x,y2:u.y}),a.push({x1:c.x,y1:c.y,x2:e.x,y2:e.y}),yx(o.multiplicity)){const m=Or(e,n,Gh);r.push({cx:m.x,cy:m.y,r:Yh})}if(gx(o.multiplicity)){const m=Or(e,n,mx),[f,p]=Xh(e,n,m,fx);a.push({x1:c.x,y1:c.y,x2:f.x,y2:f.y}),a.push({x1:c.x,y1:c.y,x2:p.x,y2:p.y}),a.push({x1:c.x,y1:c.y,x2:m.x,y2:m.y})}return{lines:a,circles:r,polygons:l}}let s=e;if(o.composition){const c=Or(e,n,px),d={x:(e.x+c.x)/2,y:(e.y+c.y)/2},u=Jh(e,n),m=Pr(d,qh/2,u-Math.PI/2),f=Pr(d,qh/2,u+Math.PI/2);l.push({points:[e,m,c,f]}),s=c}if(o.navigable&&!o.otherNavigable){const c=Math.atan2(n.x-e.x,n.y-e.y),d=Zh(s,c,Wh,!0),u=Zh(s,c,Wh,!1);a.push({x1:s.x,y1:s.y,x2:d.x,y2:d.y}),a.push({x1:s.x,y1:s.y,x2:u.x,y2:u.y})}return{lines:a,circles:r,polygons:l}}const ey=200,ty=120,sc=24;function ny(e){var a,r;if(!e)return{x:0,y:0,width:ey,height:ty};const n=e.computedPosition??e.position??{x:0,y:0},o=((a=e.dimensions)==null?void 0:a.width)||ey,i=((r=e.dimensions)==null?void 0:r.height)||ty;return{x:n.x,y:n.y,width:o,height:i}}function oy(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function cc(e){const n=t.computed(()=>ny(e.sourceNode())),o=t.computed(()=>ny(e.targetNode())),i=t.computed(()=>{const d=e.sourceNode(),u=e.targetNode();return!!d&&!!u&&d.id===u.id}),a=t.computed(()=>{var p,y;const d=n.value,u=d.x+d.width;let m=((p=e.sourceRowY)==null?void 0:p.call(e))??d.y+d.height/3,f=((y=e.targetRowY)==null?void 0:y.call(e))??d.y+d.height*2/3;if(Math.abs(f-m)<sc){const g=(m+f)/2;m=g-sc/2,f=g+sc/2}return{source:{x:u,y:m},target:{x:u,y:f}}}),r=t.computed(()=>e.waypoints()[0]??oy(o.value)),l=t.computed(()=>{const d=e.waypoints();return d[d.length-1]??oy(n.value)}),s=t.computed(()=>{var u;const d=(u=e.sourceRowY)==null?void 0:u.call(e);return d!=null?jh(n.value,d,r.value.x):Hh(n.value,r.value)}),c=t.computed(()=>{var u;const d=(u=e.targetRowY)==null?void 0:u.call(e);return d!=null?jh(o.value,d,l.value.x):Hh(o.value,l.value)});return{source:t.computed(()=>i.value?a.value.source:s.value.point),target:t.computed(()=>i.value?a.value.target:c.value.point),sourceSide:t.computed(()=>i.value?"right":s.value.side),targetSide:t.computed(()=>i.value?"right":c.value.side),isSelf:i}}const dc=Symbol("waypointController"),bx=["d"],kx=["d"],_x=["d"],Ex=["x1","y1","x2","y2"],Nx=["cx","cy","r"],wx=["x","y"],Ix=["x","y"],vx=["cx","cy","onDblclick"],Cx=["x","y","onPointerdown","onDblclick"],iy=tt(t.defineComponent({inheritAttrs:!1,__name:"AssociationEdge",props:{id:{},sourceY:{},targetY:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,{screenToFlowCoordinate:o}=ot(),i=t.inject(dc),a=t.inject(io,null),r=t.computed(()=>!!a&&a.editable.value),l=t.inject(Ch,null),s=t.inject(Oo,null),c=t.computed(()=>!!s&&s.relatedEdgeIds.value.has(n.id)),d=t.computed(()=>{var ce;return((ce=a==null?void 0:a.selection.value)==null?void 0:ce.kind)==="association"&&a.selection.value.id===n.id}),u=t.computed(()=>!!s&&s.active.value&&!s.relatedEdgeIds.value.has(n.id)&&!d.value),m=t.computed(()=>{const ce=l==null?void 0:l.value;if(!ce||!a)return null;const pe=a.resolved.value.entities,he=L=>{var K;return(K=pe.find(Z=>Z.entity.modelId===L))==null?void 0:K.groupRef},V=n.data.association;return he(V.end1.entityRef)===ce.groupId&&he(V.end2.entityRef)===ce.groupId?{dx:ce.dx,dy:ce.dy}:null}),f=t.computed(()=>(i==null?void 0:i.points(n.id))??[]),p=t.ref(-1),y=t.ref({x:0,y:0}),g=t.computed(()=>{const ce=m.value;return f.value.map((pe,he)=>he===p.value?y.value:ce?{x:pe.x+ce.dx,y:pe.y+ce.dy}:pe)}),b=t.computed(()=>{var ce;return!!((ce=n.sourceNode.data)!=null&&ce.collapsed)}),k=t.computed(()=>{var ce;return!!((ce=n.targetNode.data)!=null&&ce.collapsed)}),{source:_,target:h,sourceSide:C,targetSide:v,isSelf:S}=cc({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>g.value,sourceRowY:()=>n.data.sourceColumnRef&&!b.value?n.sourceY:void 0,targetRowY:()=>n.data.targetColumnRef&&!k.value?n.targetY:void 0}),N=hx+4,A=t.computed(()=>S.value?sx(_.value,h.value):(a==null?void 0:a.routingMode.value)==="orthogonal"?rc(_.value,C.value,g.value,h.value,v.value,N):lc(_.value,g.value,h.value)),T=t.computed(()=>S.value||!r.value?[]:(a==null?void 0:a.routingMode.value)==="orthogonal"?Uh(_.value,C.value,g.value,h.value,v.value,N):Kh(_.value,g.value,h.value).map((ce,pe)=>({point:ce,segIndex:pe}))),O=t.computed(()=>S.value||!r.value?[]:g.value),z=wa;function P(ce,pe){p.value=ce,y.value={...f.value[ce]},pe.target.setPointerCapture(pe.pointerId),pe.stopPropagation()}function D(ce){if(p.value<0)return;const pe=o({x:ce.clientX,y:ce.clientY});y.value={x:pe.x,y:pe.y}}function E(ce){var pe,he;p.value>=0&&i&&i.movePoint(n.id,p.value,{...y.value}),p.value=-1,(he=(pe=ce.target).releasePointerCapture)==null||he.call(pe,ce.pointerId)}function R(ce,pe){pe.stopPropagation(),i==null||i.removePoint(n.id,ce)}function I(ce,pe){if(!i)return;const he=o({x:pe.clientX,y:pe.clientY});i.insertPoint(n.id,ce,{x:he.x,y:he.y})}const x=t.computed(()=>z(n.data.association.end1.multiplicity)),$=t.computed(()=>z(n.data.association.end2.multiplicity)),U=t.computed(()=>(a==null?void 0:a.displayMode.value)==="CLASS"?"class":"db"),F=t.computed(()=>U.value==="class"),B=t.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const ce=Dr(C.value);return{x:_.value.x+ce.x*10,y:_.value.y+ce.y*10}}return g.value[0]??h.value}),j=t.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const pe=Dr(v.value);return{x:h.value.x+pe.x*10,y:h.value.y+pe.y*10}}const ce=g.value;return ce[ce.length-1]??_.value}),X=t.computed(()=>{const ce=n.data.association;return{multiplicity:ce.end1.multiplicity,navigable:ce.end1.navigable,composition:ce.end1.composition,otherNavigable:ce.end2.navigable}}),W=t.computed(()=>{const ce=n.data.association;return{multiplicity:ce.end2.multiplicity,navigable:ce.end2.navigable,composition:ce.end2.composition,otherNavigable:ce.end1.navigable}}),oe=t.computed(()=>Qh(_.value,B.value,X.value,U.value)),de=t.computed(()=>Qh(h.value,j.value,W.value,U.value)),ie=t.computed(()=>[...oe.value.lines,...de.value.lines]),Ie=t.computed(()=>[...oe.value.circles,...de.value.circles]),Le=t.computed(()=>[...oe.value.polygons,...de.value.polygons].map(ce=>`M${ce.points.map(pe=>`${pe.x},${pe.y}`).join(" L")} Z`)),Se=t.computed(()=>({"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}));return(ce,pe)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("path",{d:A.value,fill:"none",class:"em-edge__hit"},null,8,bx),t.createElementVNode("path",{d:A.value,fill:"none","stroke-width":"1.5",class:t.normalizeClass(["em-edge__path",{"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}])},null,10,kx),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Le.value,(he,V)=>(t.openBlock(),t.createElementBlock("path",{key:`mpoly-${V}`,d:he,class:t.normalizeClass(["em-edge__marker em-edge__marker--fill",Se.value])},null,10,_x))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ie.value,(he,V)=>(t.openBlock(),t.createElementBlock("line",{key:`mline-${V}`,x1:he.x1,y1:he.y1,x2:he.x2,y2:he.y2,class:t.normalizeClass(["em-edge__marker",Se.value])},null,10,Ex))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Ie.value,(he,V)=>(t.openBlock(),t.createElementBlock("circle",{key:`mcirc-${V}`,cx:he.cx,cy:he.cy,r:he.r,class:t.normalizeClass(["em-edge__marker",Se.value])},null,10,Nx))),128)),F.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("text",{x:t.unref(_).x+8,y:t.unref(_).y-6,class:t.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},t.toDisplayString(x.value),11,wx),t.createElementVNode("text",{x:t.unref(h).x-8,y:t.unref(h).y-6,"text-anchor":"end",class:t.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},t.toDisplayString($.value),11,Ix)],64)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(T.value,(he,V)=>(t.openBlock(),t.createElementBlock("circle",{key:`mid-${V}`,cx:he.point.x,cy:he.point.y,r:"4",class:t.normalizeClass(["em-edge__mid",{"is-dimmed":u.value}]),onDblclick:t.withModifiers(L=>I(he.segIndex,L),["stop"])},null,42,vx))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(O.value,(he,V)=>(t.openBlock(),t.createElementBlock("rect",{key:`wp-${V}`,x:he.x-5,y:he.y-5,width:"10",height:"10",rx:"2",class:t.normalizeClass(["em-edge__waypoint",{"is-dimmed":u.value}]),onPointerdown:L=>P(V,L),onPointermove:D,onPointerup:E,onDblclick:L=>R(V,L)},null,42,Cx))),128))],64))}}),[["__scopeId","data-v-5468806a"]]);var zn=(e=>(e.Lines="lines",e.Dots="dots",e))(zn||{});const ay=function({dimensions:e,size:n,color:o}){return t.h("path",{stroke:o,"stroke-width":n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},ry=function({radius:e,color:n}){return t.h("circle",{cx:e,cy:e,r:e,fill:n})};zn.Lines+"",zn.Dots+"";const Sx={[zn.Dots]:"#81818a",[zn.Lines]:"#eee"},Rx=["id","x","y","width","height","patternTransform"],Ax={key:2,height:"100",width:"100"},xx=["fill"],$x=["x","y","fill"],Tx={name:"Background",compatConfig:{MODE:3}},Mx=t.defineComponent({...Tx,props:{id:{},variant:{default:()=>zn.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:n,viewport:o}=ot(),i=t.computed(()=>{const l=o.value.zoom,[s,c]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],d=[s*l||1,c*l||1],u=e.size*l,[m,f]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],p=[m*l||1+d[0]/2,f*l||1+d[1]/2];return{scaledGap:d,offset:p,size:u}}),a=t.toRef(()=>`pattern-${n}${e.id?`-${e.id}`:""}`),r=t.toRef(()=>e.color||e.patternColor||Sx[e.variant||zn.Dots]);return(l,s)=>(t.openBlock(),t.createElementBlock("svg",{class:"vue-flow__background vue-flow__container",style:t.normalizeStyle({height:`${l.height>100?100:l.height}%`,width:`${l.width>100?100:l.width}%`})},[t.renderSlot(l.$slots,"pattern-container",{id:a.value},()=>[t.createElementVNode("pattern",{id:a.value,x:t.unref(o).x%i.value.scaledGap[0],y:t.unref(o).y%i.value.scaledGap[1],width:i.value.scaledGap[0],height:i.value.scaledGap[1],patternTransform:`translate(-${i.value.offset[0]},-${i.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[t.renderSlot(l.$slots,"pattern",{},()=>[l.variant===t.unref(zn).Lines?(t.openBlock(),t.createBlock(t.unref(ay),{key:0,size:l.lineWidth,color:r.value,dimensions:i.value.scaledGap},null,8,["size","color","dimensions"])):l.variant===t.unref(zn).Dots?(t.openBlock(),t.createBlock(t.unref(ry),{key:1,color:r.value,radius:i.value.size/2},null,8,["color","radius"])):t.createCommentVNode("",!0),l.bgColor?(t.openBlock(),t.createElementBlock("svg",Ax,[t.createElementVNode("rect",{width:"100%",height:"100%",fill:l.bgColor},null,8,xx)])):t.createCommentVNode("",!0)])],8,Rx)]),t.createElementVNode("rect",{x:l.x,y:l.y,width:"100%",height:"100%",fill:`url(#${a.value})`},null,8,$x),t.renderSlot(l.$slots,"default",{id:a.value})],4))}}),Vx={name:"ControlButton",compatConfig:{MODE:3}},Lx=(e,n)=>{const o=e.__vccOpts||e;for(const[i,a]of n)o[i]=a;return o},Bx={type:"button",class:"vue-flow__controls-button"};function Dx(e,n,o,i,a,r){return t.openBlock(),t.createElementBlock("button",Bx,[t.renderSlot(e.$slots,"default")])}const Po=Lx(Vx,[["render",Dx]]),Ox={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Px=[t.createElementVNode("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function zx(e,n){return t.openBlock(),t.createElementBlock("svg",Ox,Px)}const Fx={render:zx},Ux={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Hx=[t.createElementVNode("path",{d:"M0 0h32v4.2H0z"},null,-1)];function jx(e,n){return t.openBlock(),t.createElementBlock("svg",Ux,Hx)}const Kx={render:jx},Gx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Yx=[t.createElementVNode("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1)];function qx(e,n){return t.openBlock(),t.createElementBlock("svg",Gx,Yx)}const Wx={render:qx},Jx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Xx=[t.createElementVNode("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1)];function Zx(e,n){return t.openBlock(),t.createElementBlock("svg",Jx,Xx)}const Qx={render:Zx},e$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},t$=[t.createElementVNode("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1)];function n$(e,n){return t.openBlock(),t.createElementBlock("svg",e$,t$)}const o$={render:n$},i$={name:"Controls",compatConfig:{MODE:3}},a$=t.defineComponent({...i$,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>up.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:n}){const{nodesDraggable:o,nodesConnectable:i,elementsSelectable:a,setInteractive:r,zoomIn:l,zoomOut:s,fitView:c,viewport:d,minZoom:u,maxZoom:m}=ot(),f=t.toRef(()=>o.value||i.value||a.value),p=t.toRef(()=>d.value.zoom<=u.value),y=t.toRef(()=>d.value.zoom>=m.value);function g(){l(),n("zoomIn")}function b(){s(),n("zoomOut")}function k(){c(e.fitViewParams),n("fitView")}function _(){r(!f.value),n("interactionChange",!f.value)}return(h,C)=>(t.openBlock(),t.createBlock(t.unref(ch),{class:"vue-flow__controls",position:h.position},{default:t.withCtx(()=>[t.renderSlot(h.$slots,"top"),h.showZoom?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.renderSlot(h.$slots,"control-zoom-in",{},()=>[t.createVNode(Po,{class:"vue-flow__controls-zoomin",disabled:y.value,onClick:g},{default:t.withCtx(()=>[t.renderSlot(h.$slots,"icon-zoom-in",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(Fx))))])]),_:3},8,["disabled"])]),t.renderSlot(h.$slots,"control-zoom-out",{},()=>[t.createVNode(Po,{class:"vue-flow__controls-zoomout",disabled:p.value,onClick:b},{default:t.withCtx(()=>[t.renderSlot(h.$slots,"icon-zoom-out",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(Kx))))])]),_:3},8,["disabled"])])],64)):t.createCommentVNode("",!0),h.showFitView?t.renderSlot(h.$slots,"control-fit-view",{key:1},()=>[t.createVNode(Po,{class:"vue-flow__controls-fitview",onClick:k},{default:t.withCtx(()=>[t.renderSlot(h.$slots,"icon-fit-view",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(Wx))))])]),_:3})]):t.createCommentVNode("",!0),h.showInteractive?t.renderSlot(h.$slots,"control-interactive",{key:2},()=>[h.showInteractive?(t.openBlock(),t.createBlock(Po,{key:0,class:"vue-flow__controls-interactive",onClick:_},{default:t.withCtx(()=>[f.value?t.renderSlot(h.$slots,"icon-unlock",{key:0},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(o$))))]):t.createCommentVNode("",!0),f.value?t.createCommentVNode("",!0):t.renderSlot(h.$slots,"icon-lock",{key:1},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(Qx))))])]),_:3})):t.createCommentVNode("",!0)]):t.createCommentVNode("",!0),t.renderSlot(h.$slots,"default")]),_:3},8,["position"]))}});var r$={value:()=>{}};function uc(){for(var e=0,n=arguments.length,o={},i;e<n;++e){if(!(i=arguments[e]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new zr(o)}function zr(e){this._=e}function l$(e,n){return e.trim().split(/^|\s+/).map(function(o){var i="",a=o.indexOf(".");if(a>=0&&(i=o.slice(a+1),o=o.slice(0,a)),o&&!n.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}zr.prototype=uc.prototype={constructor:zr,on:function(e,n){var o=this._,i=l$(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=s$(o[a],e.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++r<l;)if(a=(e=i[r]).type)o[a]=ly(o[a],e.name,n);else if(n==null)for(a in o)o[a]=ly(o[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var o in n)e[o]=n[o].slice();return new zr(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var o=new Array(a),i=0,a,r;i<a;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(n,o)},apply:function(e,n,o){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],a=0,r=i.length;a<r;++a)i[a].value.apply(n,o)}};function s$(e,n){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===n)return a.value}function ly(e,n,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=r$,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:n,value:o}),e}var mc="http://www.w3.org/1999/xhtml";const sy={svg:"http://www.w3.org/2000/svg",xhtml:mc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fr(e){var n=e+="",o=n.indexOf(":");return o>=0&&(n=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),sy.hasOwnProperty(n)?{space:sy[n],local:e}:e}function c$(e){return function(){var n=this.ownerDocument,o=this.namespaceURI;return o===mc&&n.documentElement.namespaceURI===mc?n.createElement(e):n.createElementNS(o,e)}}function d$(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function cy(e){var n=Fr(e);return(n.local?d$:c$)(n)}function u$(){}function fc(e){return e==null?u$:function(){return this.querySelector(e)}}function m$(e){typeof e!="function"&&(e=fc(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=new Array(l),c,d,u=0;u<l;++u)(c=r[u])&&(d=e.call(c,c.__data__,u,r))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new qt(i,this._parents)}function f$(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function p$(){return[]}function dy(e){return e==null?p$:function(){return this.querySelectorAll(e)}}function h$(e){return function(){return f$(e.apply(this,arguments))}}function y$(e){typeof e=="function"?e=h$(e):e=dy(e);for(var n=this._groups,o=n.length,i=[],a=[],r=0;r<o;++r)for(var l=n[r],s=l.length,c,d=0;d<s;++d)(c=l[d])&&(i.push(e.call(c,c.__data__,d,l)),a.push(c));return new qt(i,a)}function uy(e){return function(){return this.matches(e)}}function my(e){return function(n){return n.matches(e)}}var g$=Array.prototype.find;function b$(e){return function(){return g$.call(this.children,e)}}function k$(){return this.firstElementChild}function _$(e){return this.select(e==null?k$:b$(typeof e=="function"?e:my(e)))}var E$=Array.prototype.filter;function N$(){return Array.from(this.children)}function w$(e){return function(){return E$.call(this.children,e)}}function I$(e){return this.selectAll(e==null?N$:w$(typeof e=="function"?e:my(e)))}function v$(e){typeof e!="function"&&(e=uy(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=[],c,d=0;d<l;++d)(c=r[d])&&e.call(c,c.__data__,d,r)&&s.push(c);return new qt(i,this._parents)}function fy(e){return new Array(e.length)}function C$(){return new qt(this._enter||this._groups.map(fy),this._parents)}function Ur(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Ur.prototype={constructor:Ur,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function S$(e){return function(){return e}}function R$(e,n,o,i,a,r){for(var l=0,s,c=n.length,d=r.length;l<d;++l)(s=n[l])?(s.__data__=r[l],i[l]=s):o[l]=new Ur(e,r[l]);for(;l<c;++l)(s=n[l])&&(a[l]=s)}function A$(e,n,o,i,a,r,l){var s,c,d=new Map,u=n.length,m=r.length,f=new Array(u),p;for(s=0;s<u;++s)(c=n[s])&&(f[s]=p=l.call(c,c.__data__,s,n)+"",d.has(p)?a[s]=c:d.set(p,c));for(s=0;s<m;++s)p=l.call(e,r[s],s,r)+"",(c=d.get(p))?(i[s]=c,c.__data__=r[s],d.delete(p)):o[s]=new Ur(e,r[s]);for(s=0;s<u;++s)(c=n[s])&&d.get(f[s])===c&&(a[s]=c)}function x$(e){return e.__data__}function $$(e,n){if(!arguments.length)return Array.from(this,x$);var o=n?A$:R$,i=this._parents,a=this._groups;typeof e!="function"&&(e=S$(e));for(var r=a.length,l=new Array(r),s=new Array(r),c=new Array(r),d=0;d<r;++d){var u=i[d],m=a[d],f=m.length,p=T$(e.call(u,u&&u.__data__,d,i)),y=p.length,g=s[d]=new Array(y),b=l[d]=new Array(y),k=c[d]=new Array(f);o(u,m,g,b,k,p,n);for(var _=0,h=0,C,v;_<y;++_)if(C=g[_]){for(_>=h&&(h=_+1);!(v=b[h])&&++h<y;);C._next=v||null}}return l=new qt(l,i),l._enter=s,l._exit=c,l}function T$(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function M$(){return new qt(this._exit||this._groups.map(fy),this._parents)}function V$(e,n,o){var i=this.enter(),a=this,r=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(a=n(a),a&&(a=a.selection())),o==null?r.remove():o(r),i&&a?i.merge(a).order():a}function L$(e){for(var n=e.selection?e.selection():e,o=this._groups,i=n._groups,a=o.length,r=i.length,l=Math.min(a,r),s=new Array(a),c=0;c<l;++c)for(var d=o[c],u=i[c],m=d.length,f=s[c]=new Array(m),p,y=0;y<m;++y)(p=d[y]||u[y])&&(f[y]=p);for(;c<a;++c)s[c]=o[c];return new qt(s,this._parents)}function B$(){for(var e=this._groups,n=-1,o=e.length;++n<o;)for(var i=e[n],a=i.length-1,r=i[a],l;--a>=0;)(l=i[a])&&(r&&l.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(l,r),r=l);return this}function D$(e){e||(e=O$);function n(m,f){return m&&f?e(m.__data__,f.__data__):!m-!f}for(var o=this._groups,i=o.length,a=new Array(i),r=0;r<i;++r){for(var l=o[r],s=l.length,c=a[r]=new Array(s),d,u=0;u<s;++u)(d=l[u])&&(c[u]=d);c.sort(n)}return new qt(a,this._parents).order()}function O$(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function P$(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function z$(){return Array.from(this)}function F$(){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],a=0,r=i.length;a<r;++a){var l=i[a];if(l)return l}return null}function U$(){let e=0;for(const n of this)++e;return e}function H$(){return!this.node()}function j$(e){for(var n=this._groups,o=0,i=n.length;o<i;++o)for(var a=n[o],r=0,l=a.length,s;r<l;++r)(s=a[r])&&e.call(s,s.__data__,r,a);return this}function K$(e){return function(){this.removeAttribute(e)}}function G$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Y$(e,n){return function(){this.setAttribute(e,n)}}function q$(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function W$(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function J$(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,o)}}function X$(e,n){var o=Fr(e);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((n==null?o.local?G$:K$:typeof n=="function"?o.local?J$:W$:o.local?q$:Y$)(o,n))}function py(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Z$(e){return function(){this.style.removeProperty(e)}}function Q$(e,n,o){return function(){this.style.setProperty(e,n,o)}}function eT(e,n,o){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function tT(e,n,o){return arguments.length>1?this.each((n==null?Z$:typeof n=="function"?eT:Q$)(e,n,o??"")):mi(this.node(),e)}function mi(e,n){return e.style.getPropertyValue(n)||py(e).getComputedStyle(e,null).getPropertyValue(n)}function nT(e){return function(){delete this[e]}}function oT(e,n){return function(){this[e]=n}}function iT(e,n){return function(){var o=n.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function aT(e,n){return arguments.length>1?this.each((n==null?nT:typeof n=="function"?iT:oT)(e,n)):this.node()[e]}function hy(e){return e.trim().split(/^|\s+/)}function pc(e){return e.classList||new yy(e)}function yy(e){this._node=e,this._names=hy(e.getAttribute("class")||"")}yy.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function gy(e,n){for(var o=pc(e),i=-1,a=n.length;++i<a;)o.add(n[i])}function by(e,n){for(var o=pc(e),i=-1,a=n.length;++i<a;)o.remove(n[i])}function rT(e){return function(){gy(this,e)}}function lT(e){return function(){by(this,e)}}function sT(e,n){return function(){(n.apply(this,arguments)?gy:by)(this,e)}}function cT(e,n){var o=hy(e+"");if(arguments.length<2){for(var i=pc(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof n=="function"?sT:n?rT:lT)(o,n))}function dT(){this.textContent=""}function uT(e){return function(){this.textContent=e}}function mT(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function fT(e){return arguments.length?this.each(e==null?dT:(typeof e=="function"?mT:uT)(e)):this.node().textContent}function pT(){this.innerHTML=""}function hT(e){return function(){this.innerHTML=e}}function yT(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function gT(e){return arguments.length?this.each(e==null?pT:(typeof e=="function"?yT:hT)(e)):this.node().innerHTML}function bT(){this.nextSibling&&this.parentNode.appendChild(this)}function kT(){return this.each(bT)}function _T(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ET(){return this.each(_T)}function NT(e){var n=typeof e=="function"?e:cy(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function wT(){return null}function IT(e,n){var o=typeof e=="function"?e:cy(e),i=n==null?wT:typeof n=="function"?n:fc(n);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function vT(){var e=this.parentNode;e&&e.removeChild(this)}function CT(){return this.each(vT)}function ST(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function RT(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function AT(e){return this.select(e?RT:ST)}function xT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $T(e){return function(n){e.call(this,n,this.__data__)}}function TT(e){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");return i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),{type:n,name:o}})}function MT(e){return function(){var n=this.__on;if(n){for(var o=0,i=-1,a=n.length,r;o<a;++o)r=n[o],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):n[++i]=r;++i?n.length=i:delete this.__on}}}function VT(e,n,o){return function(){var i=this.__on,a,r=$T(n);if(i){for(var l=0,s=i.length;l<s;++l)if((a=i[l]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=r,a.options=o),a.value=n;return}}this.addEventListener(e.type,r,o),a={type:e.type,name:e.name,value:n,listener:r,options:o},i?i.push(a):this.__on=[a]}}function LT(e,n,o){var i=TT(e+""),a,r=i.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,d=s.length,u;c<d;++c)for(a=0,u=s[c];a<r;++a)if((l=i[a]).type===u.type&&l.name===u.name)return u.value}return}for(s=n?VT:MT,a=0;a<r;++a)this.each(s(i[a],n,o));return this}function ky(e,n,o){var i=py(e),a=i.CustomEvent;typeof a=="function"?a=new a(n,o):(a=i.document.createEvent("Event"),o?(a.initEvent(n,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function BT(e,n){return function(){return ky(this,e,n)}}function DT(e,n){return function(){return ky(this,e,n.apply(this,arguments))}}function OT(e,n){return this.each((typeof n=="function"?DT:BT)(e,n))}function*PT(){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],a=0,r=i.length,l;a<r;++a)(l=i[a])&&(yield l)}var _y=[null];function qt(e,n){this._groups=e,this._parents=n}function na(){return new qt([[document.documentElement]],_y)}function zT(){return this}qt.prototype=na.prototype={constructor:qt,select:m$,selectAll:y$,selectChild:_$,selectChildren:I$,filter:v$,data:$$,enter:C$,exit:M$,join:V$,merge:L$,selection:zT,order:B$,sort:D$,call:P$,nodes:z$,node:F$,size:U$,empty:H$,each:j$,attr:X$,style:tT,property:aT,classed:cT,text:fT,html:gT,raise:kT,lower:ET,append:NT,insert:IT,remove:CT,clone:AT,datum:xT,on:LT,dispatch:OT,[Symbol.iterator]:PT};function ao(e){return typeof e=="string"?new qt([[document.querySelector(e)]],[document.documentElement]):new qt([[e]],_y)}function FT(e){let n;for(;n=e.sourceEvent;)e=n;return e}function ro(e,n){if(e=FT(e),n===void 0&&(n=e.currentTarget),n){var o=n.ownerSVGElement||n;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}const hc={capture:!0,passive:!1};function yc(e){e.preventDefault(),e.stopImmediatePropagation()}function UT(e){var n=e.document.documentElement,o=ao(e).on("dragstart.drag",yc,hc);"onselectstart"in n?o.on("selectstart.drag",yc,hc):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function HT(e,n){var o=e.document.documentElement,i=ao(e).on("dragstart.drag",null);n&&(i.on("click.drag",yc,hc),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in o?i.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}function gc(e,n,o){e.prototype=n.prototype=o,o.constructor=e}function Ey(e,n){var o=Object.create(e.prototype);for(var i in n)o[i]=n[i];return o}function oa(){}var ia=.7,Hr=1/ia,fi="\\s*([+-]?\\d+)\\s*",aa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jT=/^#([0-9a-f]{3,8})$/,KT=new RegExp(`^rgb\\(${fi},${fi},${fi}\\)$`),GT=new RegExp(`^rgb\\(${wn},${wn},${wn}\\)$`),YT=new RegExp(`^rgba\\(${fi},${fi},${fi},${aa}\\)$`),qT=new RegExp(`^rgba\\(${wn},${wn},${wn},${aa}\\)$`),WT=new RegExp(`^hsl\\(${aa},${wn},${wn}\\)$`),JT=new RegExp(`^hsla\\(${aa},${wn},${wn},${aa}\\)$`),Ny={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};gc(oa,ra,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wy,formatHex:wy,formatHex8:XT,formatHsl:ZT,formatRgb:Iy,toString:Iy});function wy(){return this.rgb().formatHex()}function XT(){return this.rgb().formatHex8()}function ZT(){return Ay(this).formatHsl()}function Iy(){return this.rgb().formatRgb()}function ra(e){var n,o;return e=(e+"").trim().toLowerCase(),(n=jT.exec(e))?(o=n[1].length,n=parseInt(n[1],16),o===6?vy(n):o===3?new Ht(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):o===8?jr(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):o===4?jr(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=KT.exec(e))?new Ht(n[1],n[2],n[3],1):(n=GT.exec(e))?new Ht(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=YT.exec(e))?jr(n[1],n[2],n[3],n[4]):(n=qT.exec(e))?jr(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=WT.exec(e))?Ry(n[1],n[2]/100,n[3]/100,1):(n=JT.exec(e))?Ry(n[1],n[2]/100,n[3]/100,n[4]):Ny.hasOwnProperty(e)?vy(Ny[e]):e==="transparent"?new Ht(NaN,NaN,NaN,0):null}function vy(e){return new Ht(e>>16&255,e>>8&255,e&255,1)}function jr(e,n,o,i){return i<=0&&(e=n=o=NaN),new Ht(e,n,o,i)}function QT(e){return e instanceof oa||(e=ra(e)),e?(e=e.rgb(),new Ht(e.r,e.g,e.b,e.opacity)):new Ht}function bc(e,n,o,i){return arguments.length===1?QT(e):new Ht(e,n,o,i??1)}function Ht(e,n,o,i){this.r=+e,this.g=+n,this.b=+o,this.opacity=+i}gc(Ht,bc,Ey(oa,{brighter(e){return e=e==null?Hr:Math.pow(Hr,e),new Ht(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ia:Math.pow(ia,e),new Ht(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ht(zo(this.r),zo(this.g),zo(this.b),Kr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Cy,formatHex:Cy,formatHex8:eM,formatRgb:Sy,toString:Sy}));function Cy(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}`}function eM(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}${Fo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sy(){const e=Kr(this.opacity);return`${e===1?"rgb(":"rgba("}${zo(this.r)}, ${zo(this.g)}, ${zo(this.b)}${e===1?")":`, ${e})`}`}function Kr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fo(e){return e=zo(e),(e<16?"0":"")+e.toString(16)}function Ry(e,n,o,i){return i<=0?e=n=o=NaN:o<=0||o>=1?e=n=NaN:n<=0&&(e=NaN),new dn(e,n,o,i)}function Ay(e){if(e instanceof dn)return new dn(e.h,e.s,e.l,e.opacity);if(e instanceof oa||(e=ra(e)),!e)return new dn;if(e instanceof dn)return e;e=e.rgb();var n=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(n,o,i),r=Math.max(n,o,i),l=NaN,s=r-a,c=(r+a)/2;return s?(n===r?l=(o-i)/s+(o<i)*6:o===r?l=(i-n)/s+2:l=(n-o)/s+4,s/=c<.5?r+a:2-r-a,l*=60):s=c>0&&c<1?0:l,new dn(l,s,c,e.opacity)}function tM(e,n,o,i){return arguments.length===1?Ay(e):new dn(e,n,o,i??1)}function dn(e,n,o,i){this.h=+e,this.s=+n,this.l=+o,this.opacity=+i}gc(dn,tM,Ey(oa,{brighter(e){return e=e==null?Hr:Math.pow(Hr,e),new dn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ia:Math.pow(ia,e),new dn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,i=o+(o<.5?o:1-o)*n,a=2*o-i;return new Ht(kc(e>=240?e-240:e+120,a,i),kc(e,a,i),kc(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new dn(xy(this.h),Gr(this.s),Gr(this.l),Kr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Kr(this.opacity);return`${e===1?"hsl(":"hsla("}${xy(this.h)}, ${Gr(this.s)*100}%, ${Gr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function xy(e){return e=(e||0)%360,e<0?e+360:e}function Gr(e){return Math.max(0,Math.min(1,e||0))}function kc(e,n,o){return(e<60?n+(o-n)*e/60:e<180?o:e<240?n+(o-n)*(240-e)/60:n)*255}const $y=e=>()=>e;function nM(e,n){return function(o){return e+o*n}}function oM(e,n,o){return e=Math.pow(e,o),n=Math.pow(n,o)-e,o=1/o,function(i){return Math.pow(e+i*n,o)}}function iM(e){return(e=+e)==1?Ty:function(n,o){return o-n?oM(n,o,e):$y(isNaN(n)?o:n)}}function Ty(e,n){var o=n-e;return o?nM(e,o):$y(isNaN(e)?n:e)}const My=(function e(n){var o=iM(n);function i(a,r){var l=o((a=bc(a)).r,(r=bc(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=Ty(a.opacity,r.opacity);return function(u){return a.r=l(u),a.g=s(u),a.b=c(u),a.opacity=d(u),a+""}}return i.gamma=e,i})(1);function lo(e,n){return e=+e,n=+n,function(o){return e*(1-o)+n*o}}var _c=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ec=new RegExp(_c.source,"g");function aM(e){return function(){return e}}function rM(e){return function(n){return e(n)+""}}function lM(e,n){var o=_c.lastIndex=Ec.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",n=n+"";(i=_c.exec(e))&&(a=Ec.exec(n));)(r=a.index)>o&&(r=n.slice(o,r),s[l]?s[l]+=r:s[++l]=r),(i=i[0])===(a=a[0])?s[l]?s[l]+=a:s[++l]=a:(s[++l]=null,c.push({i:l,x:lo(i,a)})),o=Ec.lastIndex;return o<n.length&&(r=n.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?rM(c[0].x):aM(n):(n=c.length,function(d){for(var u=0,m;u<n;++u)s[(m=c[u]).i]=m.x(d);return s.join("")})}var Vy=180/Math.PI,Nc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ly(e,n,o,i,a,r){var l,s,c;return(l=Math.sqrt(e*e+n*n))&&(e/=l,n/=l),(c=e*o+n*i)&&(o-=e*c,i-=n*c),(s=Math.sqrt(o*o+i*i))&&(o/=s,i/=s,c/=s),e*i<n*o&&(e=-e,n=-n,c=-c,l=-l),{translateX:a,translateY:r,rotate:Math.atan2(n,e)*Vy,skewX:Math.atan(c)*Vy,scaleX:l,scaleY:s}}var Yr;function sM(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Nc:Ly(n.a,n.b,n.c,n.d,n.e,n.f)}function cM(e){return e==null||(Yr||(Yr=document.createElementNS("http://www.w3.org/2000/svg","g")),Yr.setAttribute("transform",e),!(e=Yr.transform.baseVal.consolidate()))?Nc:(e=e.matrix,Ly(e.a,e.b,e.c,e.d,e.e,e.f))}function By(e,n,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,f,p,y){if(d!==m||u!==f){var g=p.push("translate(",null,n,null,o);y.push({i:g-4,x:lo(d,m)},{i:g-2,x:lo(u,f)})}else(m||f)&&p.push("translate("+m+n+f+o)}function l(d,u,m,f){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),f.push({i:m.push(a(m)+"rotate(",null,i)-2,x:lo(d,u)})):u&&m.push(a(m)+"rotate("+u+i)}function s(d,u,m,f){d!==u?f.push({i:m.push(a(m)+"skewX(",null,i)-2,x:lo(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,f,p,y){if(d!==m||u!==f){var g=p.push(a(p)+"scale(",null,",",null,")");y.push({i:g-4,x:lo(d,m)},{i:g-2,x:lo(u,f)})}else(m!==1||f!==1)&&p.push(a(p)+"scale("+m+","+f+")")}return function(d,u){var m=[],f=[];return d=e(d),u=e(u),r(d.translateX,d.translateY,u.translateX,u.translateY,m,f),l(d.rotate,u.rotate,m,f),s(d.skewX,u.skewX,m,f),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,m,f),d=u=null,function(p){for(var y=-1,g=f.length,b;++y<g;)m[(b=f[y]).i]=b.x(p);return m.join("")}}}var dM=By(sM,"px, ","px)","deg)"),uM=By(cM,", ",")",")"),mM=1e-12;function Dy(e){return((e=Math.exp(e))+1/e)/2}function fM(e){return((e=Math.exp(e))-1/e)/2}function pM(e){return((e=Math.exp(2*e))-1)/(e+1)}const hM=(function e(n,o,i){function a(r,l){var s=r[0],c=r[1],d=r[2],u=l[0],m=l[1],f=l[2],p=u-s,y=m-c,g=p*p+y*y,b,k;if(g<mM)k=Math.log(f/d)/n,b=function(N){return[s+N*p,c+N*y,d*Math.exp(n*N*k)]};else{var _=Math.sqrt(g),h=(f*f-d*d+i*g)/(2*d*o*_),C=(f*f-d*d-i*g)/(2*f*o*_),v=Math.log(Math.sqrt(h*h+1)-h),S=Math.log(Math.sqrt(C*C+1)-C);k=(S-v)/n,b=function(N){var A=N*k,T=Dy(v),O=d/(o*_)*(T*pM(n*A+v)-fM(v));return[s+O*p,c+O*y,d*T/Dy(n*A+v)]}}return b.duration=k*1e3*n/Math.SQRT2,b}return a.rho=function(r){var l=Math.max(.001,+r),s=l*l,c=s*s;return e(l,s,c)},a})(Math.SQRT2,2,4);var pi=0,la=0,sa=0,Oy=1e3,qr,ca,Wr=0,Uo=0,Jr=0,da=typeof performance=="object"&&performance.now?performance:Date,Py=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function wc(){return Uo||(Py(yM),Uo=da.now()+Jr)}function yM(){Uo=0}function Xr(){this._call=this._time=this._next=null}Xr.prototype=zy.prototype={constructor:Xr,restart:function(e,n,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?wc():+o)+(n==null?0:+n),!this._next&&ca!==this&&(ca?ca._next=this:qr=this,ca=this),this._call=e,this._time=o,Ic()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ic())}};function zy(e,n,o){var i=new Xr;return i.restart(e,n,o),i}function gM(){wc(),++pi;for(var e=qr,n;e;)(n=Uo-e._time)>=0&&e._call.call(void 0,n),e=e._next;--pi}function Fy(){Uo=(Wr=da.now())+Jr,pi=la=0;try{gM()}finally{pi=0,kM(),Uo=0}}function bM(){var e=da.now(),n=e-Wr;n>Oy&&(Jr-=n,Wr=e)}function kM(){for(var e,n=qr,o,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(o=n._next,n._next=null,n=e?e._next=o:qr=o);ca=e,Ic(i)}function Ic(e){if(!pi){la&&(la=clearTimeout(la));var n=e-Uo;n>24?(e<1/0&&(la=setTimeout(Fy,e-da.now()-Jr)),sa&&(sa=clearInterval(sa))):(sa||(Wr=da.now(),sa=setInterval(bM,Oy)),pi=1,Py(Fy))}}function Uy(e,n,o){var i=new Xr;return n=n==null?0:+n,i.restart(a=>{i.stop(),e(a+n)},n,o),i}var _M=uc("start","end","cancel","interrupt"),EM=[],Hy=0,jy=1,vc=2,Zr=3,Ky=4,Cc=5,Qr=6;function el(e,n,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;NM(e,o,{name:n,index:i,group:a,on:_M,tween:EM,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Hy})}function Sc(e,n){var o=un(e,n);if(o.state>Hy)throw new Error("too late; already scheduled");return o}function In(e,n){var o=un(e,n);if(o.state>Zr)throw new Error("too late; already running");return o}function un(e,n){var o=e.__transition;if(!o||!(o=o[n]))throw new Error("transition not found");return o}function NM(e,n,o){var i=e.__transition,a;i[n]=o,o.timer=zy(r,0,o.time);function r(d){o.state=jy,o.timer.restart(l,o.delay,o.time),o.delay<=d&&l(d-o.delay)}function l(d){var u,m,f,p;if(o.state!==jy)return c();for(u in i)if(p=i[u],p.name===o.name){if(p.state===Zr)return Uy(l);p.state===Ky?(p.state=Qr,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[u]):+u<n&&(p.state=Qr,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[u])}if(Uy(function(){o.state===Zr&&(o.state=Ky,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=vc,o.on.call("start",e,e.__data__,o.index,o.group),o.state===vc){for(o.state=Zr,a=new Array(f=o.tween.length),u=0,m=-1;u<f;++u)(p=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++m]=p);a.length=m+1}}function s(d){for(var u=d<o.duration?o.ease.call(null,d/o.duration):(o.timer.restart(c),o.state=Cc,1),m=-1,f=a.length;++m<f;)a[m].call(e,u);o.state===Cc&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=Qr,o.timer.stop(),delete i[n];for(var d in i)return;delete e.__transition}}function tl(e,n){var o=e.__transition,i,a,r=!0,l;if(o){n=n==null?null:n+"";for(l in o){if((i=o[l]).name!==n){r=!1;continue}a=i.state>vc&&i.state<Cc,i.state=Qr,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function wM(e){return this.each(function(){tl(this,e)})}function IM(e,n){var o,i;return function(){var a=In(this,e),r=a.tween;if(r!==o){i=o=r;for(var l=0,s=i.length;l<s;++l)if(i[l].name===n){i=i.slice(),i.splice(l,1);break}}a.tween=i}}function vM(e,n,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=In(this,e),l=r.tween;if(l!==i){a=(i=l).slice();for(var s={name:n,value:o},c=0,d=a.length;c<d;++c)if(a[c].name===n){a[c]=s;break}c===d&&a.push(s)}r.tween=a}}function CM(e,n){var o=this._id;if(e+="",arguments.length<2){for(var i=un(this.node(),o).tween,a=0,r=i.length,l;a<r;++a)if((l=i[a]).name===e)return l.value;return null}return this.each((n==null?IM:vM)(o,e,n))}function Rc(e,n,o){var i=e._id;return e.each(function(){var a=In(this,i);(a.value||(a.value={}))[n]=o.apply(this,arguments)}),function(a){return un(a,i).value[n]}}function Gy(e,n){var o;return(typeof n=="number"?lo:n instanceof ra?My:(o=ra(n))?(n=o,My):lM)(e,n)}function SM(e){return function(){this.removeAttribute(e)}}function RM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function AM(e,n,o){var i,a=o+"",r;return function(){var l=this.getAttribute(e);return l===a?null:l===i?r:r=n(i=l,o)}}function xM(e,n,o){var i,a=o+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===i?r:r=n(i=l,o)}}function $M(e,n,o){var i,a,r;return function(){var l,s=o(this),c;return s==null?void this.removeAttribute(e):(l=this.getAttribute(e),c=s+"",l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s)))}}function TM(e,n,o){var i,a,r;return function(){var l,s=o(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),c=s+"",l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s)))}}function MM(e,n){var o=Fr(e),i=o==="transform"?uM:Gy;return this.attrTween(e,typeof n=="function"?(o.local?TM:$M)(o,i,Rc(this,"attr."+e,n)):n==null?(o.local?RM:SM)(o):(o.local?xM:AM)(o,i,n))}function VM(e,n){return function(o){this.setAttribute(e,n.call(this,o))}}function LM(e,n){return function(o){this.setAttributeNS(e.space,e.local,n.call(this,o))}}function BM(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&LM(e,r)),o}return a._value=n,a}function DM(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&VM(e,r)),o}return a._value=n,a}function OM(e,n){var o="attr."+e;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(n==null)return this.tween(o,null);if(typeof n!="function")throw new Error;var i=Fr(e);return this.tween(o,(i.local?BM:DM)(i,n))}function PM(e,n){return function(){Sc(this,e).delay=+n.apply(this,arguments)}}function zM(e,n){return n=+n,function(){Sc(this,e).delay=n}}function FM(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?PM:zM)(n,e)):un(this.node(),n).delay}function UM(e,n){return function(){In(this,e).duration=+n.apply(this,arguments)}}function HM(e,n){return n=+n,function(){In(this,e).duration=n}}function jM(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?UM:HM)(n,e)):un(this.node(),n).duration}function KM(e,n){if(typeof n!="function")throw new Error;return function(){In(this,e).ease=n}}function GM(e){var n=this._id;return arguments.length?this.each(KM(n,e)):un(this.node(),n).ease}function YM(e,n){return function(){var o=n.apply(this,arguments);if(typeof o!="function")throw new Error;In(this,e).ease=o}}function qM(e){if(typeof e!="function")throw new Error;return this.each(YM(this._id,e))}function WM(e){typeof e!="function"&&(e=uy(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=[],c,d=0;d<l;++d)(c=r[d])&&e.call(c,c.__data__,d,r)&&s.push(c);return new Fn(i,this._parents,this._name,this._id)}function JM(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,o=e._groups,i=n.length,a=o.length,r=Math.min(i,a),l=new Array(i),s=0;s<r;++s)for(var c=n[s],d=o[s],u=c.length,m=l[s]=new Array(u),f,p=0;p<u;++p)(f=c[p]||d[p])&&(m[p]=f);for(;s<i;++s)l[s]=n[s];return new Fn(l,this._parents,this._name,this._id)}function XM(e){return(e+"").trim().split(/^|\s+/).every(function(n){var o=n.indexOf(".");return o>=0&&(n=n.slice(0,o)),!n||n==="start"})}function ZM(e,n,o){var i,a,r=XM(n)?Sc:In;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(n,o),l.on=a}}function QM(e,n){var o=this._id;return arguments.length<2?un(this.node(),o).on.on(e):this.each(ZM(o,e,n))}function e2(e){return function(){var n=this.parentNode;for(var o in this.__transition)if(+o!==e)return;n&&n.removeChild(this)}}function t2(){return this.on("end.remove",e2(this._id))}function n2(e){var n=this._name,o=this._id;typeof e!="function"&&(e=fc(e));for(var i=this._groups,a=i.length,r=new Array(a),l=0;l<a;++l)for(var s=i[l],c=s.length,d=r[l]=new Array(c),u,m,f=0;f<c;++f)(u=s[f])&&(m=e.call(u,u.__data__,f,s))&&("__data__"in u&&(m.__data__=u.__data__),d[f]=m,el(d[f],n,o,f,d,un(u,o)));return new Fn(r,this._parents,n,o)}function o2(e){var n=this._name,o=this._id;typeof e!="function"&&(e=dy(e));for(var i=this._groups,a=i.length,r=[],l=[],s=0;s<a;++s)for(var c=i[s],d=c.length,u,m=0;m<d;++m)if(u=c[m]){for(var f=e.call(u,u.__data__,m,c),p,y=un(u,o),g=0,b=f.length;g<b;++g)(p=f[g])&&el(p,n,o,g,f,y);r.push(f),l.push(u)}return new Fn(r,l,n,o)}var i2=na.prototype.constructor;function a2(){return new i2(this._groups,this._parents)}function r2(e,n){var o,i,a;return function(){var r=mi(this,e),l=(this.style.removeProperty(e),mi(this,e));return r===l?null:r===o&&l===i?a:a=n(o=r,i=l)}}function Yy(e){return function(){this.style.removeProperty(e)}}function l2(e,n,o){var i,a=o+"",r;return function(){var l=mi(this,e);return l===a?null:l===i?r:r=n(i=l,o)}}function s2(e,n,o){var i,a,r;return function(){var l=mi(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),mi(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s))}}function c2(e,n){var o,i,a,r="style."+n,l="end."+r,s;return function(){var c=In(this,e),d=c.on,u=c.value[r]==null?s||(s=Yy(n)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function d2(e,n,o){var i=(e+="")=="transform"?dM:Gy;return n==null?this.styleTween(e,r2(e,i)).on("end.style."+e,Yy(e)):typeof n=="function"?this.styleTween(e,s2(e,i,Rc(this,"style."+e,n))).each(c2(this._id,e)):this.styleTween(e,l2(e,i,n),o).on("end.style."+e,null)}function u2(e,n,o){return function(i){this.style.setProperty(e,n.call(this,i),o)}}function m2(e,n,o){var i,a;function r(){var l=n.apply(this,arguments);return l!==a&&(i=(a=l)&&u2(e,l,o)),i}return r._value=n,r}function f2(e,n,o){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,m2(e,n,o??""))}function p2(e){return function(){this.textContent=e}}function h2(e){return function(){var n=e(this);this.textContent=n??""}}function y2(e){return this.tween("text",typeof e=="function"?h2(Rc(this,"text",e)):p2(e==null?"":e+""))}function g2(e){return function(n){this.textContent=e.call(this,n)}}function b2(e){var n,o;function i(){var a=e.apply(this,arguments);return a!==o&&(n=(o=a)&&g2(a)),n}return i._value=e,i}function k2(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,b2(e))}function _2(){for(var e=this._name,n=this._id,o=qy(),i=this._groups,a=i.length,r=0;r<a;++r)for(var l=i[r],s=l.length,c,d=0;d<s;++d)if(c=l[d]){var u=un(c,n);el(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Fn(i,this._parents,e,o)}function E2(){var e,n,o=this,i=o._id,a=o.size();return new Promise(function(r,l){var s={value:l},c={value:function(){--a===0&&r()}};o.each(function(){var d=In(this,i),u=d.on;u!==e&&(n=(e=u).copy(),n._.cancel.push(s),n._.interrupt.push(s),n._.end.push(c)),d.on=n}),a===0&&r()})}var N2=0;function Fn(e,n,o,i){this._groups=e,this._parents=n,this._name=o,this._id=i}function qy(){return++N2}var Un=na.prototype;Fn.prototype={constructor:Fn,select:n2,selectAll:o2,selectChild:Un.selectChild,selectChildren:Un.selectChildren,filter:WM,merge:JM,selection:a2,transition:_2,call:Un.call,nodes:Un.nodes,node:Un.node,size:Un.size,empty:Un.empty,each:Un.each,on:QM,attr:MM,attrTween:OM,style:d2,styleTween:f2,text:y2,textTween:k2,remove:t2,tween:CM,delay:FM,duration:jM,ease:GM,easeVarying:qM,end:E2,[Symbol.iterator]:Un[Symbol.iterator]};function w2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var I2={time:null,delay:0,duration:250,ease:w2};function v2(e,n){for(var o;!(o=e.__transition)||!(o=o[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return o}function C2(e){var n,o;e instanceof Fn?(n=e._id,e=e._name):(n=qy(),(o=I2).time=wc(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,r=0;r<a;++r)for(var l=i[r],s=l.length,c,d=0;d<s;++d)(c=l[d])&&el(c,e,n,d,l,o||v2(c,n));return new Fn(i,this._parents,e,n)}na.prototype.interrupt=wM,na.prototype.transition=C2;const nl=e=>()=>e;function S2(e,{sourceEvent:n,target:o,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function Hn(e,n,o){this.k=e,this.x=n,this.y=o}Hn.prototype={constructor:Hn,scale:function(e){return e===1?this:new Hn(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Hn(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ac=new Hn(1,0,0);Hn.prototype;function xc(e){e.stopImmediatePropagation()}function ua(e){e.preventDefault(),e.stopImmediatePropagation()}function R2(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function A2(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Wy(){return this.__zoom||Ac}function x2(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function $2(){return navigator.maxTouchPoints||"ontouchstart"in this}function T2(e,n,o){var i=e.invertX(n[0][0])-o[0][0],a=e.invertX(n[1][0])-o[1][0],r=e.invertY(n[0][1])-o[0][1],l=e.invertY(n[1][1])-o[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),l>r?(r+l)/2:Math.min(0,r)||Math.max(0,l))}function M2(){var e=R2,n=A2,o=T2,i=x2,a=$2,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=hM,d=uc("start","zoom","end"),u,m,f,p=500,y=150,g=0,b=10;function k(E){E.property("__zoom",Wy).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",O).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(E,R,I,x){var $=E.selection?E.selection():E;$.property("__zoom",Wy),E!==$?v(E,R,I,x):$.interrupt().each(function(){S(this,arguments).event(x).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},k.scaleBy=function(E,R,I,x){k.scaleTo(E,function(){var $=this.__zoom.k,U=typeof R=="function"?R.apply(this,arguments):R;return $*U},I,x)},k.scaleTo=function(E,R,I,x){k.transform(E,function(){var $=n.apply(this,arguments),U=this.__zoom,F=I==null?C($):typeof I=="function"?I.apply(this,arguments):I,B=U.invert(F),j=typeof R=="function"?R.apply(this,arguments):R;return o(h(_(U,j),F,B),$,l)},I,x)},k.translateBy=function(E,R,I,x){k.transform(E,function(){return o(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof I=="function"?I.apply(this,arguments):I),n.apply(this,arguments),l)},null,x)},k.translateTo=function(E,R,I,x,$){k.transform(E,function(){var U=n.apply(this,arguments),F=this.__zoom,B=x==null?C(U):typeof x=="function"?x.apply(this,arguments):x;return o(Ac.translate(B[0],B[1]).scale(F.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof I=="function"?-I.apply(this,arguments):-I),U,l)},x,$)};function _(E,R){return R=Math.max(r[0],Math.min(r[1],R)),R===E.k?E:new Hn(R,E.x,E.y)}function h(E,R,I){var x=R[0]-I[0]*E.k,$=R[1]-I[1]*E.k;return x===E.x&&$===E.y?E:new Hn(E.k,x,$)}function C(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function v(E,R,I,x){E.on("start.zoom",function(){S(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(x).end()}).tween("zoom",function(){var $=this,U=arguments,F=S($,U).event(x),B=n.apply($,U),j=I==null?C(B):typeof I=="function"?I.apply($,U):I,X=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),W=$.__zoom,oe=typeof R=="function"?R.apply($,U):R,de=c(W.invert(j).concat(X/W.k),oe.invert(j).concat(X/oe.k));return function(ie){if(ie===1)ie=oe;else{var Ie=de(ie),Le=X/Ie[2];ie=new Hn(Le,j[0]-Ie[0]*Le,j[1]-Ie[1]*Le)}F.zoom(null,ie)}})}function S(E,R,I){return!I&&E.__zooming||new N(E,R)}function N(E,R){this.that=E,this.args=R,this.active=0,this.sourceEvent=null,this.extent=n.apply(E,R),this.taps=0}N.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,R){return this.mouse&&E!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var R=ao(this.that).datum();d.call(E,this.that,new S2(E,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),R)}};function A(E,...R){if(!e.apply(this,arguments))return;var I=S(this,R).event(E),x=this.__zoom,$=Math.max(r[0],Math.min(r[1],x.k*Math.pow(2,i.apply(this,arguments)))),U=ro(E);if(I.wheel)(I.mouse[0][0]!==U[0]||I.mouse[0][1]!==U[1])&&(I.mouse[1]=x.invert(I.mouse[0]=U)),clearTimeout(I.wheel);else{if(x.k===$)return;I.mouse=[U,x.invert(U)],tl(this),I.start()}ua(E),I.wheel=setTimeout(F,y),I.zoom("mouse",o(h(_(x,$),I.mouse[0],I.mouse[1]),I.extent,l));function F(){I.wheel=null,I.end()}}function T(E,...R){if(f||!e.apply(this,arguments))return;var I=E.currentTarget,x=S(this,R,!0).event(E),$=ao(E.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",X,!0),U=ro(E,I),F=E.clientX,B=E.clientY;UT(E.view),xc(E),x.mouse=[U,this.__zoom.invert(U)],tl(this),x.start();function j(W){if(ua(W),!x.moved){var oe=W.clientX-F,de=W.clientY-B;x.moved=oe*oe+de*de>g}x.event(W).zoom("mouse",o(h(x.that.__zoom,x.mouse[0]=ro(W,I),x.mouse[1]),x.extent,l))}function X(W){$.on("mousemove.zoom mouseup.zoom",null),HT(W.view,x.moved),ua(W),x.event(W).end()}}function O(E,...R){if(e.apply(this,arguments)){var I=this.__zoom,x=ro(E.changedTouches?E.changedTouches[0]:E,this),$=I.invert(x),U=I.k*(E.shiftKey?.5:2),F=o(h(_(I,U),x,$),n.apply(this,R),l);ua(E),s>0?ao(this).transition().duration(s).call(v,F,x,E):ao(this).call(k.transform,F,x,E)}}function z(E,...R){if(e.apply(this,arguments)){var I=E.touches,x=I.length,$=S(this,R,E.changedTouches.length===x).event(E),U,F,B,j;for(xc(E),F=0;F<x;++F)B=I[F],j=ro(B,this),j=[j,this.__zoom.invert(j),B.identifier],$.touch0?!$.touch1&&$.touch0[2]!==j[2]&&($.touch1=j,$.taps=0):($.touch0=j,U=!0,$.taps=1+!!u);u&&(u=clearTimeout(u)),U&&($.taps<2&&(m=j[0],u=setTimeout(function(){u=null},p)),tl(this),$.start())}}function P(E,...R){if(this.__zooming){var I=S(this,R).event(E),x=E.changedTouches,$=x.length,U,F,B,j;for(ua(E),U=0;U<$;++U)F=x[U],B=ro(F,this),I.touch0&&I.touch0[2]===F.identifier?I.touch0[0]=B:I.touch1&&I.touch1[2]===F.identifier&&(I.touch1[0]=B);if(F=I.that.__zoom,I.touch1){var X=I.touch0[0],W=I.touch0[1],oe=I.touch1[0],de=I.touch1[1],ie=(ie=oe[0]-X[0])*ie+(ie=oe[1]-X[1])*ie,Ie=(Ie=de[0]-W[0])*Ie+(Ie=de[1]-W[1])*Ie;F=_(F,Math.sqrt(ie/Ie)),B=[(X[0]+oe[0])/2,(X[1]+oe[1])/2],j=[(W[0]+de[0])/2,(W[1]+de[1])/2]}else if(I.touch0)B=I.touch0[0],j=I.touch0[1];else return;I.zoom("touch",o(h(F,B,j),I.extent,l))}}function D(E,...R){if(this.__zooming){var I=S(this,R).event(E),x=E.changedTouches,$=x.length,U,F;for(xc(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),U=0;U<$;++U)F=x[U],I.touch0&&I.touch0[2]===F.identifier?delete I.touch0:I.touch1&&I.touch1[2]===F.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(F=ro(F,this),Math.hypot(m[0]-F[0],m[1]-F[1])<b)){var B=ao(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return k.wheelDelta=function(E){return arguments.length?(i=typeof E=="function"?E:nl(+E),k):i},k.filter=function(E){return arguments.length?(e=typeof E=="function"?E:nl(!!E),k):e},k.touchable=function(E){return arguments.length?(a=typeof E=="function"?E:nl(!!E),k):a},k.extent=function(E){return arguments.length?(n=typeof E=="function"?E:nl([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),k):n},k.scaleExtent=function(E){return arguments.length?(r[0]=+E[0],r[1]=+E[1],k):[r[0],r[1]]},k.translateExtent=function(E){return arguments.length?(l[0][0]=+E[0][0],l[1][0]=+E[1][0],l[0][1]=+E[0][1],l[1][1]=+E[1][1],k):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},k.constrain=function(E){return arguments.length?(o=E,k):o},k.duration=function(E){return arguments.length?(s=+E,k):s},k.interpolate=function(E){return arguments.length?(c=E,k):c},k.on=function(){var E=d.on.apply(d,arguments);return E===d?k:E},k.clickDistance=function(E){return arguments.length?(g=(E=+E)*E,k):Math.sqrt(g)},k.tapDistance=function(E){return arguments.length?(b=+E,k):b},k}const Jy=Symbol("MiniMapSlots"),V2=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],L2={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},B2=t.defineComponent({...L2,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:["click","dblclick","mouseenter","mousemove","mouseleave"],setup(e,{emit:n}){const o=e,i=t.inject(Jy),a=t.useAttrs(),r=t.toRef(()=>a.style??{});function l(m){n("click",m)}function s(m){n("dblclick",m)}function c(m){n("mouseenter",m)}function d(m){n("mousemove",m)}function u(m){n("mouseleave",m)}return(m,f)=>!m.hidden&&m.dimensions.width!==0&&m.dimensions.height!==0?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.unref(i)[`node-${o.type}`]?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(i)[`node-${o.type}`]),t.normalizeProps(t.mergeProps({key:0},{...o,...m.$attrs})),null,16)):(t.openBlock(),t.createElementBlock("rect",t.mergeProps({key:1,id:m.id},m.$attrs,{class:["vue-flow__minimap-node",{selected:m.selected,dragging:m.dragging}],x:m.position.x,y:m.position.y,rx:m.borderRadius,ry:m.borderRadius,width:m.dimensions.width,height:m.dimensions.height,fill:m.color||r.value.background||r.value.backgroundColor,stroke:m.strokeColor,"stroke-width":m.strokeWidth,"shape-rendering":m.shapeRendering,onClick:l,onDblclick:s,onMouseenter:c,onMousemove:d,onMouseleave:u}),null,16,V2))],64)):t.createCommentVNode("",!0)}}),D2=["width","height","viewBox","aria-labelledby"],O2=["id"],P2=["d","fill","stroke","stroke-width"],z2={name:"MiniMap",compatConfig:{MODE:3}},F2=t.defineComponent({...z2,props:{nodeColor:{type:[String,Function],default:"#e2e2e2"},nodeStrokeColor:{type:[String,Function],default:"transparent"},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:"rgb(240, 240, 240, 0.6)"},maskStrokeColor:{default:"none"},maskStrokeWidth:{default:1},position:{default:"bottom-right"},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:"Vue Flow mini map"},inversePan:{type:Boolean,default:!1},zoomStep:{default:1},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:["click","nodeClick","nodeDblclick","nodeMouseenter","nodeMousemove","nodeMouseleave"],setup(e,{emit:n}){const o=t.useSlots(),i=t.useAttrs(),a=200,r=150,{id:l,edges:s,viewport:c,translateExtent:d,dimensions:u,emits:m,d3Selection:f,d3Zoom:p,getNodesInitialized:y}=ot(),g=t.ref();t.provide(Jy,o);const b=t.toRef(()=>{var $;return e.width??(($=i.style)==null?void 0:$.width)??a}),k=t.toRef(()=>{var $;return e.height??(($=i.style)==null?void 0:$.height)??r}),_=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",h=t.computed(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),C=t.computed(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),v=t.computed(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),S=t.computed(()=>Ps(y.value.filter($=>!$.hidden))),N=t.computed(()=>({x:-c.value.x/c.value.zoom,y:-c.value.y/c.value.zoom,width:u.value.width/c.value.zoom,height:u.value.height/c.value.zoom})),A=t.computed(()=>y.value&&y.value.length?Gw(S.value,N.value):N.value),T=t.computed(()=>{const $=A.value.width/b.value,U=A.value.height/k.value;return Math.max($,U)}),O=t.computed(()=>{const $=T.value*b.value,U=T.value*k.value,F=e.offsetScale*T.value;return{offset:F,x:A.value.x-($-A.value.width)/2-F,y:A.value.y-(U-A.value.height)/2-F,width:$+F*2,height:U+F*2}}),z=t.computed(()=>!O.value.x||!O.value.y?"":`
|
|
59
|
+
Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will be removed in the next major version. Please use the id parameter instead"};class vt extends Error{constructor(n,...o){var i;super((i=Bp[n])==null?void 0:i.call(Bp,...o)),this.name="VueFlowError",this.code=n,this.args=o}}function js(e){return"clientX"in e}function nI(e){return"sourceEvent"in e}function Nn(e,n){const o=js(e);let i,a;return o?(i=e.clientX,a=e.clientY):"touches"in e&&e.touches.length>0?(i=e.touches[0].clientX,a=e.touches[0].clientY):"changedTouches"in e&&e.changedTouches.length>0?(i=e.changedTouches[0].clientX,a=e.changedTouches[0].clientY):(i=0,a=0),{x:i-((n==null?void 0:n.left)??0),y:a-((n==null?void 0:n.top)??0)}}const ea=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function oI(e){var n,o;return{width:((n=e.dimensions)==null?void 0:n.width)??e.width??0,height:((o=e.dimensions)==null?void 0:o.height)??e.height??0}}function vr(e,n=[1,1]){return{x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}}const iI=()=>!0;function Ks(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function aI(e,n,o){const i=[],a={x:e.x-o,y:e.y-o,width:o*2,height:o*2};for(const r of n.values())Er(a,_r(r))>0&&i.push(r);return i}const rI=250;function lI(e,n,o,i){var a,r;let l=[],s=Number.POSITIVE_INFINITY;const c=aI(e,o,n+rI);for(const d of c){const u=[...((a=d.handleBounds)==null?void 0:a.source)??[],...((r=d.handleBounds)==null?void 0:r.target)??[]];for(const m of u){if(i.nodeId===m.nodeId&&i.type===m.type&&i.id===m.id)continue;const{x:f,y:p}=ci(d,m,m.position,!0),y=Math.sqrt((f-e.x)**2+(p-e.y)**2);y>n||(y<s?(l=[{...m,x:f,y:p}],s=y):y===s&&l.push({...m,x:f,y:p}))}}if(!l.length)return null;if(l.length>1){const d=i.type==="source"?"target":"source";return l.find(u=>u.type===d)??l[0]}return l[0]}function Dp(e,{handle:n,connectionMode:o,fromNodeId:i,fromHandleId:a,fromType:r,doc:l,lib:s,flowId:c,isValidConnection:d=iI},u,m,f,p){const y=r==="target",g=n?l.querySelector(`.${s}-flow__handle[data-id="${c}-${n==null?void 0:n.nodeId}-${n==null?void 0:n.id}-${n==null?void 0:n.type}"]`):null,{x:b,y:k}=Nn(e),_=l.elementFromPoint(b,k),h=_!=null&&_.classList.contains(`${s}-flow__handle`)?_:g,C={handleDomNode:h,isValid:!1,connection:null,toHandle:null};if(h){const v=Op(void 0,h),S=h.getAttribute("data-nodeid"),N=h.getAttribute("data-handleid"),A=h.classList.contains("connectable"),T=h.classList.contains("connectableend");if(!S||!v)return C;const O={source:y?S:i,sourceHandle:y?N:a,target:y?i:S,targetHandle:y?a:N};C.connection=O;const P=A&&T&&(o===Pn.Strict?y&&v==="source"||!y&&v==="target":S!==i||N!==a);C.isValid=P&&d(O,{nodes:m,edges:u,sourceNode:f(O.source),targetNode:f(O.target)}),C.toHandle=Pp(S,v,N,p,o,!0)}return C}function Op(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function sI(e,n){let o=null;return n?o="valid":e&&!n&&(o="invalid"),o}function cI(e,n){let o=null;return n?o=!0:e&&!n&&(o=!1),o}function Pp(e,n,o,i,a,r=!1){var l,s,c;const d=i.get(e);if(!d)return null;const u=a===Pn.Strict?(l=d.handleBounds)==null?void 0:l[n]:[...((s=d.handleBounds)==null?void 0:s.source)??[],...((c=d.handleBounds)==null?void 0:c.target)??[]],m=(o?u==null?void 0:u.find(f=>f.id===o):u==null?void 0:u[0])??null;return m&&r?{...m,...ci(d,m,m.position,!0)}:m}const Gs={[Ve.Left]:Ve.Right,[Ve.Right]:Ve.Left,[Ve.Top]:Ve.Bottom,[Ve.Bottom]:Ve.Top},dI=["production","prod"];function ta(e,...n){zp()&&console.warn(`[Vue Flow]: ${e}`,...n)}function zp(){return!dI.includes(process.env.NODE_ENV||"")}function Fp(e,n,o,i,a){const r=n.querySelectorAll(`.vue-flow__handle.${e}`);return r!=null&&r.length?Array.from(r).map(l=>{const s=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:a,position:l.getAttribute("data-handlepos"),x:(s.left-o.left)/i,y:(s.top-o.top)/i,...Nr(l)}}):null}function Ys(e,n,o,i,a,r=!1,l){a.value=!1,e.selected?(r||e.selected&&n)&&(i([e]),t.nextTick(()=>{l.blur()})):o([e])}function Et(e){return typeof t.unref(e)<"u"}function uI(e,n,o,i){if(!e||!e.source||!e.target)return o(new vt(_t.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let a;return Qn(e)?a=e:a={...e,id:_p(e)},a=bp(a,void 0,i),Kw(a,n)?!1:a}function mI(e,n,o,i,a){if(!n.source||!n.target)return a(new vt(_t.EDGE_INVALID,e.id)),!1;if(!o)return a(new vt(_t.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...l}=e;return{...l,id:i?_p(n):r,source:n.source,target:n.target,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle}}function Up(e,n,o){const i={},a=[];for(let r=0;r<e.length;++r){const l=e[r];if(!To(l)){o(new vt(_t.NODE_INVALID,l==null?void 0:l.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const s=Uw(l,n(l.id),l.parentNode);l.parentNode&&(i[l.parentNode]=!0),a[r]=s}for(const r of a){const l=n(r.parentNode)||a.find(s=>s.id===r.parentNode);r.parentNode&&!l&&o(new vt(_t.NODE_MISSING_PARENT,r.id,r.parentNode)),(r.parentNode||i[r.id])&&(i[r.id]&&(r.isParent=!0),l&&(l.isParent=!0))}return a}function Hp(e,n,o,i,a,r){let l=a;const s=i.get(l)||new Map;i.set(l,s.set(o,n)),l=`${a}-${e}`;const c=i.get(l)||new Map;if(i.set(l,c.set(o,n)),r){l=`${a}-${e}-${r}`;const d=i.get(l)||new Map;i.set(l,d.set(o,n))}}function qs(e,n,o){e.clear();for(const i of o){const{source:a,target:r,sourceHandle:l=null,targetHandle:s=null}=i,c={edgeId:i.id,source:a,target:r,sourceHandle:l,targetHandle:s},d=`${a}-${l}--${r}-${s}`,u=`${r}-${s}--${a}-${l}`;Hp("source",c,u,e,a,l),Hp("target",c,d,e,r,s)}}function jp(e,n){if(e.size!==n.size)return!1;for(const o of e)if(!n.has(o))return!1;return!0}function Ws(e,n,o,i,a,r,l,s){const c=[];for(const d of e){const u=Qn(d)?d:uI(d,s,a,r);if(!u)continue;const m=o(u.source),f=o(u.target);if(!m||!f){a(new vt(_t.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!m){a(new vt(_t.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!f){a(new vt(_t.EDGE_TARGET_MISSING,u.id,u.target));continue}if(n&&!n(u,{edges:s,nodes:l,sourceNode:m,targetNode:f})){a(new vt(_t.EDGE_INVALID,u.id));continue}const p=i(u.id);c.push({...bp(u,p,r),sourceNode:m,targetNode:f})}return c}const Kp=Symbol("vueFlow"),Gp=Symbol("nodeId"),Yp=Symbol("nodeRef"),fI=Symbol("edgeId"),pI=Symbol("edgeRef"),Cr=Symbol("slots");function qp(e){const{vueFlowRef:n,snapToGrid:o,snapGrid:i,noDragClassName:a,nodeLookup:r,nodeExtent:l,nodeDragThreshold:s,viewport:c,autoPanOnNodeDrag:d,autoPanSpeed:u,nodesDraggable:m,panBy:f,findNode:p,multiSelectionActive:y,nodesSelectionActive:g,selectNodesOnDrag:b,removeSelectedElements:k,addSelectedNodes:_,updateNodePositions:h,emits:C}=ot(),{onStart:v,onDrag:S,onStop:N,onClick:A,el:T,disabled:O,id:z,selectable:P,dragHandle:D}=e,E=t.shallowRef(!1);let R=[],I,x=null,$={x:void 0,y:void 0},U={x:0,y:0},F=null,B=!1,j=!1,X=0,W=!1;const oe=gI(),de=({x:pe,y:he})=>{$={x:pe,y:he};let V=!1;if(R=R.map(L=>{const K={x:pe-L.distance.x,y:he-L.distance.y},{computedPosition:Z}=Hs(L,o.value?vr(K,i.value):K,C.error,l.value,L.parentNode?p(L.parentNode):void 0);return V=V||L.position.x!==Z.x||L.position.y!==Z.y,L.position=Z,L}),j=j||V,!!V&&(h(R,!0,!0),E.value=!0,F)){const[L,K]=Us({id:z,dragItems:R,findNode:p});S({event:F,node:L,nodes:K})}},ie=()=>{if(!x)return;const[pe,he]=Sp(U,x,u.value);if(pe!==0||he!==0){const V={x:($.x??0)-pe/c.value.zoom,y:($.y??0)-he/c.value.zoom};f({x:pe,y:he})&&de(V)}X=requestAnimationFrame(ie)},Ie=(pe,he)=>{B=!0;const V=p(z);!b.value&&!y.value&&V&&(V.selected||k()),V&&t.toValue(P)&&b.value&&Ys(V,y.value,_,k,g,!1,he);const L=oe(pe.sourceEvent);if($=L,R=Jw(r.value,m.value,L,z),R.length){const[K,Z]=Us({id:z,dragItems:R,findNode:p});v({event:pe.sourceEvent,node:K,nodes:Z})}},Le=(pe,he)=>{var V;pe.sourceEvent.type==="touchmove"&&pe.sourceEvent.touches.length>1||(j=!1,s.value===0&&Ie(pe,he),$=oe(pe.sourceEvent),x=((V=n.value)==null?void 0:V.getBoundingClientRect())||null,U=Nn(pe.sourceEvent,x))},Se=(pe,he)=>{const V=oe(pe.sourceEvent);if(!W&&B&&d.value&&(W=!0,ie()),!B){const L=V.xSnapped-($.x??0),K=V.ySnapped-($.y??0);Math.sqrt(L*L+K*K)>s.value&&Ie(pe,he)}($.x!==V.xSnapped||$.y!==V.ySnapped)&&R.length&&B&&(F=pe.sourceEvent,U=Nn(pe.sourceEvent,x),de(V))},ce=pe=>{let he=!1;if(!B&&!E.value&&!y.value){const V=pe.sourceEvent,L=oe(V),K=L.xSnapped-($.x??0),Z=L.ySnapped-($.y??0),Q=Math.sqrt(K*K+Z*Z);Q!==0&&Q<=s.value&&(A==null||A(V),he=!0)}if(R.length&&!he){j&&(h(R,!1,!1),j=!1);const[V,L]=Us({id:z,dragItems:R,findNode:p});N({event:pe.sourceEvent,node:V,nodes:L})}R=[],E.value=!1,W=!1,B=!1,$={x:void 0,y:void 0},cancelAnimationFrame(X)};return t.watch([()=>t.toValue(O),T],([pe,he],V,L)=>{if(he){const K=rn(he);pe||(I=FN().on("start",Z=>Le(Z,he)).on("drag",Z=>Se(Z,he)).on("end",Z=>ce(Z)).filter(Z=>{const Q=Z.target,fe=t.toValue(D);return!Z.button&&(!a.value||!Mp(Q,`.${a.value}`,he)&&(!fe||Mp(Q,fe,he)))}),K.call(I)),L(()=>{K.on(".drag",null),I&&(I.on("start",null),I.on("drag",null),I.on("end",null))})}}),E}function hI(){return{doubleClick:Te(),click:Te(),mouseEnter:Te(),mouseMove:Te(),mouseLeave:Te(),contextMenu:Te(),updateStart:Te(),update:Te(),updateEnd:Te()}}function yI(e,n){const o=hI();return o.doubleClick.on(i=>{var a,r;n.edgeDoubleClick(i),(r=(a=e.events)==null?void 0:a.doubleClick)==null||r.call(a,i)}),o.click.on(i=>{var a,r;n.edgeClick(i),(r=(a=e.events)==null?void 0:a.click)==null||r.call(a,i)}),o.mouseEnter.on(i=>{var a,r;n.edgeMouseEnter(i),(r=(a=e.events)==null?void 0:a.mouseEnter)==null||r.call(a,i)}),o.mouseMove.on(i=>{var a,r;n.edgeMouseMove(i),(r=(a=e.events)==null?void 0:a.mouseMove)==null||r.call(a,i)}),o.mouseLeave.on(i=>{var a,r;n.edgeMouseLeave(i),(r=(a=e.events)==null?void 0:a.mouseLeave)==null||r.call(a,i)}),o.contextMenu.on(i=>{var a,r;n.edgeContextMenu(i),(r=(a=e.events)==null?void 0:a.contextMenu)==null||r.call(a,i)}),o.updateStart.on(i=>{var a,r;n.edgeUpdateStart(i),(r=(a=e.events)==null?void 0:a.updateStart)==null||r.call(a,i)}),o.update.on(i=>{var a,r;n.edgeUpdate(i),(r=(a=e.events)==null?void 0:a.update)==null||r.call(a,i)}),o.updateEnd.on(i=>{var a,r;n.edgeUpdateEnd(i),(r=(a=e.events)==null?void 0:a.updateEnd)==null||r.call(a,i)}),Object.entries(o).reduce((i,[a,r])=>(i.emit[a]=r.trigger,i.on[a]=r.on,i),{emit:{},on:{}})}function gI(){const{viewport:e,snapGrid:n,snapToGrid:o,vueFlowRef:i}=ot();return a=>{var r;const l=((r=i.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},s=nI(a)?a.sourceEvent:a,{x:c,y:d}=Nn(s,l),u=Zi({x:c,y:d},e.value),{x:m,y:f}=o.value?vr(u,n.value):u;return{xSnapped:m,ySnapped:f,...u}}}function Sr(){return!0}function Wp({handleId:e,nodeId:n,type:o,isValidConnection:i,edgeUpdaterType:a,onEdgeUpdate:r,onEdgeUpdateEnd:l}){const{id:s,vueFlowRef:c,connectionMode:d,connectionRadius:u,connectOnClick:m,connectionClickStartHandle:f,nodesConnectable:p,autoPanOnConnect:y,autoPanSpeed:g,findNode:b,panBy:k,startConnection:_,updateConnection:h,endConnection:C,emits:v,viewport:S,edges:N,nodes:A,isValidConnection:T,nodeLookup:O}=ot();let z=null,P=!1,D=null;function E(I){var x;const $=t.toValue(o)==="target",U=js(I),F=gp(I.target),B=I.currentTarget;if(B&&(U&&I.button===0||!U)){let j=function(Ne){V=Nn(Ne,ce),de=lI(Zi(V,S.value,!1,[1,1]),u.value,O.value,Z),L||(K(),L=!0);const J=Dp(Ne,{handle:de,connectionMode:d.value,fromNodeId:t.toValue(n),fromHandleId:t.toValue(e),fromType:$?"target":"source",isValidConnection:oe,doc:F,lib:"vue",flowId:s,nodeLookup:O.value},N.value,A.value,b,O.value);D=J.handleDomNode,z=J.connection,P=cI(!!de,J.isValid);const ee={...Ee,isValid:P,to:J.toHandle&&P?Xi({x:J.toHandle.x,y:J.toHandle.y},S.value):V,toHandle:J.toHandle,toPosition:P&&J.toHandle?J.toHandle.position:Gs[Z.position],toNode:J.toHandle?O.value.get(J.toHandle.nodeId):null};if(P&&de&&(Ee!=null&&Ee.toHandle)&&ee.toHandle&&Ee.toHandle.type===ee.toHandle.type&&Ee.toHandle.nodeId===ee.toHandle.nodeId&&Ee.toHandle.id===ee.toHandle.id&&Ee.to.x===ee.to.x&&Ee.to.y===ee.to.y)return;const te=de??J.toHandle;if(h(te&&P?Xi({x:te.x,y:te.y},S.value):V,te,sI(!!te,P)),Ee=ee,!de&&!P&&!D)return Ks(he);z&&z.source!==z.target&&D&&(Ks(he),he=D,D.classList.add("connecting","vue-flow__handle-connecting"),D.classList.toggle("valid",!!P),D.classList.toggle("vue-flow__handle-valid",!!P))},X=function(Ne){"touches"in Ne&&Ne.touches.length>0||((de||D)&&z&&P&&(r?r(Ne,z):v.connect(z)),v.connectEnd(Ne),a&&(l==null||l(Ne)),Ks(he),cancelAnimationFrame(ie),C(Ne),L=!1,P=!1,z=null,D=null,F.removeEventListener("mousemove",j),F.removeEventListener("mouseup",X),F.removeEventListener("touchmove",j),F.removeEventListener("touchend",X))};const W=b(t.toValue(n));let oe=t.toValue(i)||T.value||Sr;!oe&&W&&(oe=($?W.isValidSourcePos:W.isValidTargetPos)||Sr);let de,ie=0;const{x:Ie,y:Le}=Nn(I),Se=Op(t.toValue(a),B),ce=(x=c.value)==null?void 0:x.getBoundingClientRect();if(!ce||!Se)return;const pe=Pp(t.toValue(n),Se,t.toValue(e),O.value,d.value);if(!pe)return;let he,V=Nn(I,ce),L=!1;const K=()=>{if(!y.value)return;const[Ne,J]=Sp(V,ce,g.value);k({x:Ne,y:J}),ie=requestAnimationFrame(K)},Z={...pe,nodeId:t.toValue(n),type:Se,position:pe.position},Q=O.value.get(t.toValue(n)),be={inProgress:!0,isValid:null,from:ci(Q,Z,Ve.Left,!0),fromHandle:Z,fromPosition:Z.position,fromNode:Q,to:V,toHandle:null,toPosition:Gs[Z.position],toNode:null};_({nodeId:t.toValue(n),id:t.toValue(e),type:Se,position:(B==null?void 0:B.getAttribute("data-handlepos"))||Ve.Top,...V},{x:Ie-ce.left,y:Le-ce.top}),v.connectStart({event:I,nodeId:t.toValue(n),handleId:t.toValue(e),handleType:Se});let Ee=be;F.addEventListener("mousemove",j),F.addEventListener("mouseup",X),F.addEventListener("touchmove",j),F.addEventListener("touchend",X)}}function R(I){var x,$;if(!m.value)return;const U=t.toValue(o)==="target";if(!f.value){v.clickConnectStart({event:I,nodeId:t.toValue(n),handleId:t.toValue(e)}),_({nodeId:t.toValue(n),type:t.toValue(o),id:t.toValue(e),position:Ve.Top,...Nn(I)},void 0,!0);return}let F=t.toValue(i)||T.value||Sr;const B=b(t.toValue(n));if(!F&&B&&(F=(U?B.isValidSourcePos:B.isValidTargetPos)||Sr),B&&(typeof B.connectable>"u"?p.value:B.connectable)===!1)return;const j=gp(I.target),X=Dp(I,{handle:{nodeId:t.toValue(n),id:t.toValue(e),type:t.toValue(o),position:Ve.Top,...Nn(I)},connectionMode:d.value,fromNodeId:f.value.nodeId,fromHandleId:f.value.id??null,fromType:f.value.type,isValidConnection:F,doc:j,lib:"vue",flowId:s,nodeLookup:O.value},N.value,A.value,b,O.value),W=((x=X.connection)==null?void 0:x.source)===(($=X.connection)==null?void 0:$.target);X.isValid&&X.connection&&!W&&v.connect(X.connection),v.clickConnectEnd(I),C(I,!0)}return{handlePointerDown:E,handleClick:R}}function bI(){return t.inject(Gp,"")}function Jp(e){const n=e??bI()??"",o=t.inject(Yp,t.ref(null)),{findNode:i,edges:a,emits:r}=ot(),l=i(n);return l||r.error(new vt(_t.NODE_NOT_FOUND,n)),{id:n,nodeEl:o,node:l,parentNode:t.computed(()=>i(l.parentNode)),connectedEdges:t.computed(()=>Mo([l],a.value))}}function kI(){return{doubleClick:Te(),click:Te(),mouseEnter:Te(),mouseMove:Te(),mouseLeave:Te(),contextMenu:Te(),dragStart:Te(),drag:Te(),dragStop:Te()}}function _I(e,n){const o=kI();return o.doubleClick.on(i=>{var a,r;n.nodeDoubleClick(i),(r=(a=e.events)==null?void 0:a.doubleClick)==null||r.call(a,i)}),o.click.on(i=>{var a,r;n.nodeClick(i),(r=(a=e.events)==null?void 0:a.click)==null||r.call(a,i)}),o.mouseEnter.on(i=>{var a,r;n.nodeMouseEnter(i),(r=(a=e.events)==null?void 0:a.mouseEnter)==null||r.call(a,i)}),o.mouseMove.on(i=>{var a,r;n.nodeMouseMove(i),(r=(a=e.events)==null?void 0:a.mouseMove)==null||r.call(a,i)}),o.mouseLeave.on(i=>{var a,r;n.nodeMouseLeave(i),(r=(a=e.events)==null?void 0:a.mouseLeave)==null||r.call(a,i)}),o.contextMenu.on(i=>{var a,r;n.nodeContextMenu(i),(r=(a=e.events)==null?void 0:a.contextMenu)==null||r.call(a,i)}),o.dragStart.on(i=>{var a,r;n.nodeDragStart(i),(r=(a=e.events)==null?void 0:a.dragStart)==null||r.call(a,i)}),o.drag.on(i=>{var a,r;n.nodeDrag(i),(r=(a=e.events)==null?void 0:a.drag)==null||r.call(a,i)}),o.dragStop.on(i=>{var a,r;n.nodeDragStop(i),(r=(a=e.events)==null?void 0:a.dragStop)==null||r.call(a,i)}),Object.entries(o).reduce((i,[a,r])=>(i.emit[a]=r.trigger,i.on[a]=r.on,i),{emit:{},on:{}})}function Xp(){const{getSelectedNodes:e,nodeExtent:n,updateNodePositions:o,findNode:i,snapGrid:a,snapToGrid:r,nodesDraggable:l,emits:s}=ot();return(c,d=!1)=>{const u=r.value?a.value[0]:5,m=r.value?a.value[1]:5,f=d?4:1,p=c.x*u*f,y=c.y*m*f,g=[];for(const b of e.value)if(b.draggable||l&&typeof b.draggable>"u"){const k={x:b.computedPosition.x+p,y:b.computedPosition.y+y},{position:_}=Hs(b,k,s.error,n.value,b.parentNode?i(b.parentNode):void 0);g.push({id:b.id,position:_,from:b.position,distance:{x:c.x,y:c.y},dimensions:b.dimensions})}o(g,!0,!1)}}const Rr=.1,EI=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function no(){return ta("Viewport not initialized yet."),Promise.resolve(!1)}const NI={zoomIn:no,zoomOut:no,zoomTo:no,fitView:no,setCenter:no,fitBounds:no,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:no,setTransform:no,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function wI(e){function n(i,a){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((a==null?void 0:a.interpolate)==="linear"?Ui:dr).scaleBy(Js(e.d3Selection,a==null?void 0:a.duration,a==null?void 0:a.ease,()=>{r(!0)}),i):r(!1)})}function o(i,a,r,l){return new Promise(s=>{var c;const{x:d,y:u}=yp({x:-i,y:-a},e.translateExtent),m=ri.translate(-d,-u).scale(r);e.d3Selection&&e.d3Zoom?(c=e.d3Zoom)==null||c.interpolate((l==null?void 0:l.interpolate)==="linear"?Ui:dr).transform(Js(e.d3Selection,l==null?void 0:l.duration,l==null?void 0:l.ease,()=>{s(!0)}),m):s(!1)})}return t.computed(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:a=>n(1.2,a),zoomOut:a=>n(1/1.2,a),zoomTo:(a,r)=>new Promise(l=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((r==null?void 0:r.interpolate)==="linear"?Ui:dr).scaleTo(Js(e.d3Selection,r==null?void 0:r.duration,r==null?void 0:r.ease,()=>{l(!0)}),a):l(!1)}),setViewport:(a,r)=>o(a.x,a.y,a.zoom,r),setTransform:(a,r)=>o(a.x,a.y,a.zoom,r),getViewport:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),getTransform:()=>({x:e.viewport.x,y:e.viewport.y,zoom:e.viewport.zoom}),fitView:(a={padding:Rr,includeHiddenNodes:!1,duration:0})=>{var r,l;const s=[];for(const f of e.nodes)f.dimensions.width&&f.dimensions.height&&((a==null?void 0:a.includeHiddenNodes)||!f.hidden)&&(!((r=a.nodes)!=null&&r.length)||(l=a.nodes)!=null&&l.length&&a.nodes.includes(f.id))&&s.push(f);if(!s.length)return Promise.resolve(!1);const c=Ps(s),{x:d,y:u,zoom:m}=Ip(c,e.dimensions.width,e.dimensions.height,a.minZoom??e.minZoom,a.maxZoom??e.maxZoom,a.padding??Rr);return o(d,u,m,a)},setCenter:(a,r,l)=>{const s=typeof(l==null?void 0:l.zoom)<"u"?l.zoom:e.maxZoom,c=e.dimensions.width/2-a*s,d=e.dimensions.height/2-r*s;return o(c,d,s,l)},fitBounds:(a,r={padding:Rr})=>{const{x:l,y:s,zoom:c}=Ip(a,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding??Rr);return o(l,s,c,r)},project:a=>Zi(a,e.viewport,e.snapToGrid,e.snapGrid),screenToFlowCoordinate:a=>{if(e.vueFlowRef){const{x:r,y:l}=e.vueFlowRef.getBoundingClientRect(),s={x:a.x-r,y:a.y-l};return Zi(s,e.viewport,e.snapToGrid,e.snapGrid)}return{x:0,y:0}},flowToScreenCoordinate:a=>{if(e.vueFlowRef){const{x:r,y:l}=e.vueFlowRef.getBoundingClientRect(),s={x:a.x+r,y:a.y+l};return Xi(s,e.viewport)}return{x:0,y:0}}}:NI)}function Js(e,n=0,o=EI,i=()=>{}){const a=typeof n=="number"&&n>0;return a||i(),a?e.transition().duration(n).ease(o).on("end",i):e}function II(e,n,o){const i=t.effectScope(!0);return i.run(()=>{const a=()=>{i.run(()=>{let g,b,k=!!(o.nodes.value.length||o.edges.value.length);g=ti([e.modelValue,()=>{var _,h;return(h=(_=e.modelValue)==null?void 0:_.value)==null?void 0:h.length}],([_])=>{_&&Array.isArray(_)&&(b==null||b.pause(),o.setElements(_),!b&&!k&&_.length?k=!0:b==null||b.resume())}),b=ti([o.nodes,o.edges,()=>o.edges.value.length,()=>o.nodes.value.length],([_,h])=>{var C;(C=e.modelValue)!=null&&C.value&&Array.isArray(e.modelValue.value)&&(g==null||g.pause(),e.modelValue.value=[..._,...h],t.nextTick(()=>{g==null||g.resume()}))},{immediate:k}),t.onScopeDispose(()=>{g==null||g.stop(),b==null||b.stop()})})},r=()=>{i.run(()=>{let g,b,k=!!o.nodes.value.length;g=ti([e.nodes,()=>{var _,h;return(h=(_=e.nodes)==null?void 0:_.value)==null?void 0:h.length}],([_])=>{_&&Array.isArray(_)&&(b==null||b.pause(),o.setNodes(_),!b&&!k&&_.length?k=!0:b==null||b.resume())}),b=ti([o.nodes,()=>o.nodes.value.length],([_])=>{var h;(h=e.nodes)!=null&&h.value&&Array.isArray(e.nodes.value)&&(g==null||g.pause(),e.nodes.value=[..._],t.nextTick(()=>{g==null||g.resume()}))},{immediate:k}),t.onScopeDispose(()=>{g==null||g.stop(),b==null||b.stop()})})},l=()=>{i.run(()=>{let g,b,k=!!o.edges.value.length;g=ti([e.edges,()=>{var _,h;return(h=(_=e.edges)==null?void 0:_.value)==null?void 0:h.length}],([_])=>{_&&Array.isArray(_)&&(b==null||b.pause(),o.setEdges(_),!b&&!k&&_.length?k=!0:b==null||b.resume())}),b=ti([o.edges,()=>o.edges.value.length],([_])=>{var h;(h=e.edges)!=null&&h.value&&Array.isArray(e.edges.value)&&(g==null||g.pause(),e.edges.value=[..._],t.nextTick(()=>{g==null||g.resume()}))},{immediate:k}),t.onScopeDispose(()=>{g==null||g.stop(),b==null||b.stop()})})},s=()=>{i.run(()=>{t.watch(()=>n.maxZoom,()=>{n.maxZoom&&Et(n.maxZoom)&&o.setMaxZoom(n.maxZoom)},{immediate:!0})})},c=()=>{i.run(()=>{t.watch(()=>n.minZoom,()=>{n.minZoom&&Et(n.minZoom)&&o.setMinZoom(n.minZoom)},{immediate:!0})})},d=()=>{i.run(()=>{t.watch(()=>n.translateExtent,()=>{n.translateExtent&&Et(n.translateExtent)&&o.setTranslateExtent(n.translateExtent)},{immediate:!0})})},u=()=>{i.run(()=>{t.watch(()=>n.nodeExtent,()=>{n.nodeExtent&&Et(n.nodeExtent)&&o.setNodeExtent(n.nodeExtent)},{immediate:!0})})},m=()=>{i.run(()=>{t.watch(()=>n.applyDefault,()=>{Et(n.applyDefault)&&(o.applyDefault.value=n.applyDefault)},{immediate:!0})})},f=()=>{i.run(()=>{const g=async b=>{let k=b;typeof n.autoConnect=="function"&&(k=await n.autoConnect(b)),k!==!1&&o.addEdges([k])};t.watch(()=>n.autoConnect,()=>{Et(n.autoConnect)&&(o.autoConnect.value=n.autoConnect)},{immediate:!0}),t.watch(o.autoConnect,(b,k,_)=>{b?o.onConnect(g):o.hooks.value.connect.off(g),_(()=>{o.hooks.value.connect.off(g)})},{immediate:!0})})},p=()=>{const g=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const b of Object.keys(n)){const k=b;if(!g.includes(k)){const _=t.toRef(()=>n[k]),h=o[k];t.isRef(h)&&i.run(()=>{t.watch(_,C=>{Et(C)&&(h.value=C)},{immediate:!0})})}}};(()=>{a(),r(),l(),c(),s(),d(),u(),m(),f(),p()})()}),()=>i.stop()}function vI(){return{edgesChange:Te(),nodesChange:Te(),nodeDoubleClick:Te(),nodeClick:Te(),nodeMouseEnter:Te(),nodeMouseMove:Te(),nodeMouseLeave:Te(),nodeContextMenu:Te(),nodeDragStart:Te(),nodeDrag:Te(),nodeDragStop:Te(),nodesInitialized:Te(),miniMapNodeClick:Te(),miniMapNodeDoubleClick:Te(),miniMapNodeMouseEnter:Te(),miniMapNodeMouseMove:Te(),miniMapNodeMouseLeave:Te(),connect:Te(),connectStart:Te(),connectEnd:Te(),clickConnectStart:Te(),clickConnectEnd:Te(),paneReady:Te(),init:Te(),move:Te(),moveStart:Te(),moveEnd:Te(),selectionDragStart:Te(),selectionDrag:Te(),selectionDragStop:Te(),selectionContextMenu:Te(),selectionStart:Te(),selectionEnd:Te(),viewportChangeStart:Te(),viewportChange:Te(),viewportChangeEnd:Te(),paneScroll:Te(),paneClick:Te(),paneContextMenu:Te(),paneMouseEnter:Te(),paneMouseMove:Te(),paneMouseLeave:Te(),edgeContextMenu:Te(),edgeMouseEnter:Te(),edgeMouseMove:Te(),edgeMouseLeave:Te(),edgeDoubleClick:Te(),edgeClick:Te(),edgeUpdateStart:Te(),edgeUpdate:Te(),edgeUpdateEnd:Te(),updateNodeInternals:Te(),error:Te(e=>ta(e.message))}}function CI(e,n){const o=t.getCurrentInstance();t.onBeforeMount(()=>{for(const[a,r]of Object.entries(n.value)){const l=s=>{e(a,s)};r.setEmitter(l),Bi(r.removeEmitter),r.setHasEmitListeners(()=>i(a)),Bi(r.removeHasEmitListeners)}});function i(a){var r;const l=SI(a);return!!((r=o==null?void 0:o.vnode.props)==null?void 0:r[l])}}function SI(e){const[n,...o]=e.split(":");return`on${n.replace(/(?:^|-)(\w)/g,(a,r)=>r.toUpperCase())}${o.length?`:${o.join(":")}`:""}`}function Zp(){return{vueFlowRef:null,viewportRef:null,nodes:[],edges:[],connectionLookup:new Map,nodeTypes:{},edgeTypes:{},initialized:!1,dimensions:{width:0,height:0},viewport:{x:0,y:0,zoom:1},d3Zoom:null,d3Selection:null,d3ZoomHandler:null,minZoom:.5,maxZoom:2,translateExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],nodeExtent:[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],selectionMode:Bs.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:qi.Free,paneClickDistance:0,panOnDrag:!0,edgeUpdaterRadius:10,onlyRenderVisibleElements:!1,defaultViewport:{x:0,y:0,zoom:1},nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,defaultMarkerColor:"#b1b1b7",connectionLineStyle:{},connectionLineType:null,connectionLineOptions:{type:xo.Bezier,style:{}},connectionMode:Pn.Loose,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectionPosition:{x:Number.NaN,y:Number.NaN},connectionRadius:20,connectOnClick:!0,connectionStatus:null,isValidConnection:null,snapGrid:[15,15],snapToGrid:!1,edgesUpdatable:!1,edgesFocusable:!0,nodesFocusable:!0,nodesConnectable:!0,nodesDraggable:!0,nodeDragThreshold:1,elementsSelectable:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,selectionKeyCode:"Shift",multiSelectionKeyCode:ea()?"Meta":"Control",zoomActivationKeyCode:ea()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:vI(),applyDefault:!0,autoConnect:!1,fitViewOnInit:!1,fitViewOnInitDone:!1,noDragClassName:"nodrag",noWheelClassName:"nowheel",noPanClassName:"nopan",defaultEdgeOptions:void 0,elevateEdgesOnSelect:!1,elevateNodesOnSelect:!0,autoPanOnNodeDrag:!0,autoPanOnConnect:!0,autoPanSpeed:15,disableKeyboardA11y:!1,ariaLiveMessage:""}}const RI=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function AI(e,n,o){const i=wI(e),a=V=>{const L=V??[];e.hooks.updateNodeInternals.trigger(L)},r=V=>jw(V,e.nodes,e.edges),l=V=>Hw(V,e.nodes,e.edges),s=V=>Mo(V,e.edges),c=({id:V,type:L,nodeId:K})=>{var Z;const Q=V?`-${L}-${V}`:`-${L}`;return Array.from(((Z=e.connectionLookup.get(`${K}${Q}`))==null?void 0:Z.values())??[])},d=V=>{if(V)return n.value.get(V)},u=V=>{if(V)return o.value.get(V)},m=(V,L,K)=>{var Z,Q;const fe=[];for(const be of V){const Ee={id:be.id,type:"position",dragging:K,from:be.from};if(L&&(Ee.position=be.position,be.parentNode)){const Ne=d(be.parentNode);Ee.position={x:Ee.position.x-(((Z=Ne==null?void 0:Ne.computedPosition)==null?void 0:Z.x)??0),y:Ee.position.y-(((Q=Ne==null?void 0:Ne.computedPosition)==null?void 0:Q.y)??0)}}fe.push(Ee)}fe!=null&&fe.length&&e.hooks.nodesChange.trigger(fe)},f=V=>{if(!e.vueFlowRef)return;const L=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!L)return;const K=window.getComputedStyle(L),{m22:Z}=new window.DOMMatrixReadOnly(K.transform),Q=[];for(const fe of V){const be=fe,Ee=d(be.id);if(Ee){const Ne=Nr(be.nodeElement);if(!!(Ne.width&&Ne.height&&(Ee.dimensions.width!==Ne.width||Ee.dimensions.height!==Ne.height||be.forceUpdate))){const ee=be.nodeElement.getBoundingClientRect();Ee.dimensions=Ne,Ee.handleBounds.source=Fp("source",be.nodeElement,ee,Z,Ee.id),Ee.handleBounds.target=Fp("target",be.nodeElement,ee,Z,Ee.id),Q.push({id:Ee.id,type:"dimensions",dimensions:Ne})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&i.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),Q.length&&e.hooks.nodesChange.trigger(Q)},p=(V,L)=>{const K=new Set,Z=new Set;for(const be of V)To(be)?K.add(be.id):Qn(be)&&Z.add(be.id);const Q=to(n.value,K,!0),fe=to(o.value,Z);if(e.multiSelectionActive){for(const be of K)Q.push(eo(be,L));for(const be of Z)fe.push(eo(be,L))}Q.length&&e.hooks.nodesChange.trigger(Q),fe.length&&e.hooks.edgesChange.trigger(fe)},y=V=>{if(e.multiSelectionActive){const L=V.map(K=>eo(K.id,!0));e.hooks.nodesChange.trigger(L);return}e.hooks.nodesChange.trigger(to(n.value,new Set(V.map(L=>L.id)),!0)),e.hooks.edgesChange.trigger(to(o.value))},g=V=>{if(e.multiSelectionActive){const L=V.map(K=>eo(K.id,!0));e.hooks.edgesChange.trigger(L);return}e.hooks.edgesChange.trigger(to(o.value,new Set(V.map(L=>L.id)))),e.hooks.nodesChange.trigger(to(n.value,new Set,!0))},b=V=>{p(V,!0)},k=V=>{const K=(V||e.nodes).map(Z=>(Z.selected=!1,eo(Z.id,!1)));e.hooks.nodesChange.trigger(K)},_=V=>{const K=(V||e.edges).map(Z=>(Z.selected=!1,eo(Z.id,!1)));e.hooks.edgesChange.trigger(K)},h=V=>{if(!V||!V.length)return p([],!1);const L=V.reduce((K,Z)=>{const Q=eo(Z.id,!1);return To(Z)?K.nodes.push(Q):K.edges.push(Q),K},{nodes:[],edges:[]});L.nodes.length&&e.hooks.nodesChange.trigger(L.nodes),L.edges.length&&e.hooks.edgesChange.trigger(L.edges)},C=V=>{var L;(L=e.d3Zoom)==null||L.scaleExtent([V,e.maxZoom]),e.minZoom=V},v=V=>{var L;(L=e.d3Zoom)==null||L.scaleExtent([e.minZoom,V]),e.maxZoom=V},S=V=>{var L;(L=e.d3Zoom)==null||L.translateExtent(V),e.translateExtent=V},N=V=>{e.nodeExtent=V,a()},A=V=>{var L;(L=e.d3Zoom)==null||L.clickDistance(V)},T=V=>{e.nodesDraggable=V,e.nodesConnectable=V,e.elementsSelectable=V},O=V=>{const L=V instanceof Function?V(e.nodes):V;!e.initialized&&!L.length||(e.nodes=Up(L,d,e.hooks.error.trigger))},z=V=>{const L=V instanceof Function?V(e.edges):V;if(!e.initialized&&!L.length)return;const K=Ws(L,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);qs(e.connectionLookup,o.value,K),e.edges=K},P=V=>{const L=V instanceof Function?V([...e.nodes,...e.edges]):V;!e.initialized&&!L.length||(O(L.filter(To)),z(L.filter(Qn)))},D=V=>{let L=V instanceof Function?V(e.nodes):V;L=Array.isArray(L)?L:[L];const K=Up(L,d,e.hooks.error.trigger),Z=[];for(const Q of K)Z.push(Ap(Q));Z.length&&e.hooks.nodesChange.trigger(Z)},E=V=>{let L=V instanceof Function?V(e.edges):V;L=Array.isArray(L)?L:[L];const K=Ws(L,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),Z=[];for(const Q of K)Z.push(Ap(Q));Z.length&&e.hooks.edgesChange.trigger(Z)},R=(V,L=!0,K=!1)=>{const Z=V instanceof Function?V(e.nodes):V,Q=Array.isArray(Z)?Z:[Z],fe=[],be=[];function Ee(J){const ee=s(J);for(const te of ee)(!Et(te.deletable)||te.deletable)&&be.push($p(te.id,te.source,te.target,te.sourceHandle,te.targetHandle))}function Ne(J){const ee=[];for(const te of e.nodes)te.parentNode===J&&ee.push(te);if(ee.length){for(const te of ee)fe.push(xp(te.id));L&&Ee(ee);for(const te of ee)Ne(te.id)}}for(const J of Q){const ee=typeof J=="string"?d(J):J;ee&&(Et(ee.deletable)&&!ee.deletable||(fe.push(xp(ee.id)),L&&Ee([ee]),K&&Ne(ee.id)))}be.length&&e.hooks.edgesChange.trigger(be),fe.length&&e.hooks.nodesChange.trigger(fe)},I=V=>{const L=V instanceof Function?V(e.edges):V,K=Array.isArray(L)?L:[L],Z=[];for(const Q of K){const fe=typeof Q=="string"?u(Q):Q;fe&&(Et(fe.deletable)&&!fe.deletable||Z.push($p(typeof Q=="string"?Q:Q.id,fe.source,fe.target,fe.sourceHandle,fe.targetHandle)))}e.hooks.edgesChange.trigger(Z)},x=(V,L,K=!0)=>{const Z=u(V.id);if(!Z)return!1;const Q=e.edges.indexOf(Z),fe=mI(V,L,Z,K,e.hooks.error.trigger);if(fe){const[be]=Ws([fe],e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((Ee,Ne)=>Ne===Q?be:Ee),qs(e.connectionLookup,o.value,[be]),be}return!1},$=(V,L,K={replace:!1})=>{const Z=u(V);if(!Z)return;const Q=typeof L=="function"?L(Z):L;Z.data=K.replace?Q:{...Z.data,...Q}},U=V=>Rp(V,e.nodes),F=V=>{const L=Rp(V,e.edges);return qs(e.connectionLookup,o.value,L),L},B=(V,L,K={replace:!1})=>{const Z=d(V);if(!Z)return;const Q=typeof L=="function"?L(Z):L;K.replace?e.nodes.splice(e.nodes.indexOf(Z),1,Q):Object.assign(Z,Q)},j=(V,L,K={replace:!1})=>{const Z=d(V);if(!Z)return;const Q=typeof L=="function"?L(Z):L;Z.data=K.replace?Q:{...Z.data,...Q}},X=(V,L,K=!1)=>{K?e.connectionClickStartHandle=V:e.connectionStartHandle=V,e.connectionEndHandle=null,e.connectionStatus=null,L&&(e.connectionPosition=L)},W=(V,L=null,K=null)=>{e.connectionStartHandle&&(e.connectionPosition=V,e.connectionEndHandle=L,e.connectionStatus=K)},oe=(V,L)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,L?e.connectionClickStartHandle=null:e.connectionStartHandle=null},de=V=>{const L=Fw(V),K=L?null:Ji(V)?V:d(V.id);return!L&&!K?[null,null,L]:[L?V:_r(K),K,L]},ie=(V,L=!0,K=e.nodes)=>{const[Z,Q,fe]=de(V);if(!Z)return[];const be=[];for(const Ee of K||e.nodes){if(!fe&&(Ee.id===Q.id||!Ee.computedPosition))continue;const Ne=_r(Ee),J=Er(Ne,Z);(L&&J>0||J>=Ne.width*Ne.height||J>=Number(Z.width)*Number(Z.height))&&be.push(Ee)}return be},Ie=(V,L,K=!0)=>{const[Z]=de(V);if(!Z)return!1;const Q=Er(Z,L);return K&&Q>0||Q>=Number(Z.width)*Number(Z.height)},Le=V=>{const{viewport:L,dimensions:K,d3Zoom:Z,d3Selection:Q,translateExtent:fe}=e;if(!Z||!Q||!V.x&&!V.y)return!1;const be=ri.translate(L.x+V.x,L.y+V.y).scale(L.zoom),Ee=[[0,0],[K.width,K.height]],Ne=Z.constrain()(be,Ee,fe),J=e.viewport.x!==Ne.x||e.viewport.y!==Ne.y||e.viewport.zoom!==Ne.k;return Z.transform(Q,Ne),J},Se=V=>{const L=V instanceof Function?V(e):V,K=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Et(L.defaultEdgeOptions)&&(e.defaultEdgeOptions=L.defaultEdgeOptions);const Z=L.modelValue||L.nodes||L.edges?[]:void 0;Z&&(L.modelValue&&Z.push(...L.modelValue),L.nodes&&Z.push(...L.nodes),L.edges&&Z.push(...L.edges),P(Z));const Q=()=>{Et(L.maxZoom)&&v(L.maxZoom),Et(L.minZoom)&&C(L.minZoom),Et(L.translateExtent)&&S(L.translateExtent)};for(const fe of Object.keys(L)){const be=fe,Ee=L[be];![...RI,...K].includes(be)&&Et(Ee)&&(e[be]=Ee)}hs(()=>e.d3Zoom).not.toBeNull().then(Q),e.initialized||(e.initialized=!0)};return{updateNodePositions:m,updateNodeDimensions:f,setElements:P,setNodes:O,setEdges:z,addNodes:D,addEdges:E,removeNodes:R,removeEdges:I,findNode:d,findEdge:u,updateEdge:x,updateEdgeData:$,updateNode:B,updateNodeData:j,applyEdgeChanges:F,applyNodeChanges:U,addSelectedElements:b,addSelectedNodes:y,addSelectedEdges:g,setMinZoom:C,setMaxZoom:v,setTranslateExtent:S,setNodeExtent:N,setPaneClickDistance:A,removeSelectedElements:h,removeSelectedNodes:k,removeSelectedEdges:_,startConnection:X,updateConnection:W,endConnection:oe,setInteractive:T,setState:Se,getIntersectingNodes:ie,getIncomers:r,getOutgoers:l,getConnectedEdges:s,getHandleConnections:c,isNodeIntersecting:Ie,panBy:Le,fitView:V=>i.value.fitView(V),zoomIn:V=>i.value.zoomIn(V),zoomOut:V=>i.value.zoomOut(V),zoomTo:(V,L)=>i.value.zoomTo(V,L),setViewport:(V,L)=>i.value.setViewport(V,L),setTransform:(V,L)=>i.value.setTransform(V,L),getViewport:()=>i.value.getViewport(),getTransform:()=>i.value.getTransform(),setCenter:(V,L,K)=>i.value.setCenter(V,L,K),fitBounds:(V,L)=>i.value.fitBounds(V,L),project:V=>i.value.project(V),screenToFlowCoordinate:V=>i.value.screenToFlowCoordinate(V),flowToScreenCoordinate:V=>i.value.flowToScreenCoordinate(V),toObject:()=>{const V=[],L=[];for(const K of e.nodes){const{computedPosition:Z,handleBounds:Q,selected:fe,dimensions:be,isParent:Ee,resizing:Ne,dragging:J,events:ee,...te}=K;V.push(te)}for(const K of e.edges){const{selected:Z,sourceNode:Q,targetNode:fe,events:be,...Ee}=K;L.push(Ee)}return JSON.parse(JSON.stringify({nodes:V,edges:L,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:V=>new Promise(L=>{const{nodes:K,edges:Z,position:Q,zoom:fe,viewport:be}=V;K&&O(K),Z&&z(Z);const[Ee,Ne]=be!=null&&be.x&&(be!=null&&be.y)?[be.x,be.y]:Q??[null,null];if(Ee&&Ne){const J=(be==null?void 0:be.zoom)||fe||e.viewport.zoom;return hs(()=>i.value.viewportInitialized).toBe(!0).then(()=>{i.value.setViewport({x:Ee,y:Ne,zoom:J}).then(()=>{L(!0)})})}else L(!0)}),updateNodeInternals:a,viewportHelper:i,$reset:()=>{const V=Zp();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const L=ri.translate(V.defaultViewport.x??0,V.defaultViewport.y??0).scale($o(V.defaultViewport.zoom??1,V.minZoom,V.maxZoom)),K=e.viewportRef.getBoundingClientRect(),Z=[[0,0],[K.width,K.height]],Q=e.d3Zoom.constrain()(L,Z,V.translateExtent);e.d3Zoom.transform(e.d3Selection,Q)}Se(V)},$destroy:()=>{}}}const xI=["data-id","data-handleid","data-nodeid","data-handlepos"],$I={name:"Handle",compatConfig:{MODE:3}},oo=t.defineComponent({...$I,props:{id:{default:null},type:{},position:{default:()=>Ve.Top},isValidConnection:{type:Function},connectable:{type:[Boolean,Number,String,Function],default:void 0},connectableStart:{type:Boolean,default:!0},connectableEnd:{type:Boolean,default:!0}},setup(e,{expose:n}){const o=t.createPropsRestProxy(e,["position","connectable","connectableStart","connectableEnd","id"]),i=t.toRef(()=>o.type??"source"),a=t.toRef(()=>o.isValidConnection??null),{id:r,connectionStartHandle:l,connectionClickStartHandle:s,connectionEndHandle:c,vueFlowRef:d,nodesConnectable:u,noDragClassName:m,noPanClassName:f}=ot(),{id:p,node:y,nodeEl:g,connectedEdges:b}=Jp(),k=t.ref(),_=t.toRef(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),h=t.toRef(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),C=t.toRef(()=>{var z,P,D,E,R,I;return((z=l.value)==null?void 0:z.nodeId)===p&&((P=l.value)==null?void 0:P.id)===e.id&&((D=l.value)==null?void 0:D.type)===i.value||((E=c.value)==null?void 0:E.nodeId)===p&&((R=c.value)==null?void 0:R.id)===e.id&&((I=c.value)==null?void 0:I.type)===i.value}),v=t.toRef(()=>{var z,P,D;return((z=s.value)==null?void 0:z.nodeId)===p&&((P=s.value)==null?void 0:P.id)===e.id&&((D=s.value)==null?void 0:D.type)===i.value}),{handlePointerDown:S,handleClick:N}=Wp({nodeId:p,handleId:e.id,isValidConnection:a,type:i}),A=t.computed(()=>typeof e.connectable=="string"&&e.connectable==="single"?!b.value.some(z=>{const P=z[`${i.value}Handle`];return z[i.value]!==p?!1:P?P===e.id:!0}):typeof e.connectable=="number"?b.value.filter(z=>{const P=z[`${i.value}Handle`];return z[i.value]!==p?!1:P?P===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(y,b.value):Et(e.connectable)?e.connectable:u.value);t.onMounted(()=>{var z;if(!y.dimensions.width||!y.dimensions.height)return;const P=(z=y.handleBounds[i.value])==null?void 0:z.find(U=>U.id===e.id);if(!d.value||P)return;const D=d.value.querySelector(".vue-flow__transformationpane");if(!g.value||!k.value||!D||!e.id)return;const E=g.value.getBoundingClientRect(),R=k.value.getBoundingClientRect(),I=window.getComputedStyle(D),{m22:x}=new window.DOMMatrixReadOnly(I.transform),$={id:e.id,position:e.position,x:(R.left-E.left)/x,y:(R.top-E.top)/x,type:i.value,nodeId:p,...Nr(k.value)};y.handleBounds[i.value]=[...y.handleBounds[i.value]??[],$]});function T(z){const P=js(z);A.value&&_.value&&(P&&z.button===0||!P)&&S(z)}function O(z){!p||!s.value&&!_.value||A.value&&N(z)}return n({handleClick:N,handlePointerDown:S,onClick:O,onPointerDown:T}),(z,P)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"handle",ref:k,"data-id":`${t.unref(r)}-${t.unref(p)}-${e.id}-${i.value}`,"data-handleid":e.id,"data-nodeid":t.unref(p),"data-handlepos":z.position,class:t.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${z.position}`,`vue-flow__handle-${e.id}`,t.unref(m),t.unref(f),i.value,{connectable:A.value,connecting:v.value,connectablestart:_.value,connectableend:h.value,connectionindicator:A.value&&(_.value&&!C.value||h.value&&C.value)}]]),onMousedown:T,onTouchstartPassive:T,onClick:O},[t.renderSlot(z.$slots,"default",{id:z.id})],42,xI))}}),Ar=function({sourcePosition:e=Ve.Bottom,targetPosition:n=Ve.Top,label:o,connectable:i=!0,isValidTargetPos:a,isValidSourcePos:r,data:l}){const s=l.label??o;return[t.h(oo,{type:"target",position:n,connectable:i,isValidConnection:a}),typeof s!="string"&&s?t.h(s):t.h(t.Fragment,[s]),t.h(oo,{type:"source",position:e,connectable:i,isValidConnection:r})]};Ar.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Ar.inheritAttrs=!1,Ar.compatConfig={MODE:3};const TI=Ar,xr=function({targetPosition:e=Ve.Top,label:n,connectable:o=!0,isValidTargetPos:i,data:a}){const r=a.label??n;return[t.h(oo,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof r!="string"&&r?t.h(r):t.h(t.Fragment,[r])]};xr.props=["targetPosition","label","isValidTargetPos","connectable","data"],xr.inheritAttrs=!1,xr.compatConfig={MODE:3};const MI=xr,$r=function({sourcePosition:e=Ve.Bottom,label:n,connectable:o=!0,isValidSourcePos:i,data:a}){const r=a.label??n;return[typeof r!="string"&&r?t.h(r):t.h(t.Fragment,[r]),t.h(oo,{type:"source",position:e,connectable:o,isValidConnection:i})]};$r.props=["sourcePosition","label","isValidSourcePos","connectable","data"],$r.inheritAttrs=!1,$r.compatConfig={MODE:3};const VI=$r,LI=["transform"],BI=["width","height","x","y","rx","ry"],DI=["y"],OI={name:"EdgeText",compatConfig:{MODE:3}},PI=t.defineComponent({...OI,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const n=t.ref({x:0,y:0,width:0,height:0}),o=t.ref(null),i=t.computed(()=>`translate(${e.x-n.value.width/2} ${e.y-n.value.height/2})`);t.onMounted(a),t.watch([()=>e.x,()=>e.y,o,()=>e.label],a);function a(){if(!o.value)return;const r=o.value.getBBox();(r.width!==n.value.width||r.height!==n.value.height)&&(n.value=r)}return(r,l)=>(t.openBlock(),t.createElementBlock("g",{transform:i.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(t.openBlock(),t.createElementBlock("rect",{key:0,class:"vue-flow__edge-textbg",width:`${n.value.width+2*r.labelBgPadding[0]}px`,height:`${n.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:t.normalizeStyle(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,BI)):t.createCommentVNode("",!0),t.createElementVNode("text",t.mergeProps(r.$attrs,{ref_key:"el",ref:o,class:"vue-flow__edge-text",y:n.value.height/2,dy:"0.3em",style:r.labelStyle}),[t.renderSlot(r.$slots,"default",{},()=>[typeof r.label!="string"?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(r.label),{key:0})):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createTextVNode(t.toDisplayString(r.label),1)],64))])],16,DI)],8,LI))}}),zI=["id","d","marker-end","marker-start"],FI=["d","stroke-width"],UI={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},Tr=t.defineComponent({...UI,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:n}){const o=t.ref(null),i=t.ref(null),a=t.ref(null),r=t.useAttrs();return n({pathEl:o,interactionEl:i,labelEl:a}),(l,s)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("path",t.mergeProps(t.unref(r),{id:l.id,ref_key:"pathEl",ref:o,d:l.path,class:"vue-flow__edge-path","marker-end":l.markerEnd,"marker-start":l.markerStart}),null,16,zI),l.interactionWidth?(t.openBlock(),t.createElementBlock("path",{key:0,ref_key:"interactionEl",ref:i,fill:"none",d:l.path,"stroke-width":l.interactionWidth,"stroke-opacity":0,class:"vue-flow__edge-interaction"},null,8,FI)):t.createCommentVNode("",!0),l.label&&l.labelX&&l.labelY?(t.openBlock(),t.createBlock(PI,{key:1,ref_key:"labelEl",ref:a,x:l.labelX,y:l.labelY,label:l.label,"label-show-bg":l.labelShowBg,"label-bg-style":l.labelBgStyle,"label-bg-padding":l.labelBgPadding,"label-bg-border-radius":l.labelBgBorderRadius,"label-style":l.labelStyle},null,8,["x","y","label","label-show-bg","label-bg-style","label-bg-padding","label-bg-border-radius","label-style"])):t.createCommentVNode("",!0)],64))}});function Qp({sourceX:e,sourceY:n,targetX:o,targetY:i}){const a=Math.abs(o-e)/2,r=o<e?o+a:o-a,l=Math.abs(i-n)/2,s=i<n?i+l:i-l;return[r,s,a,l]}function eh({sourceX:e,sourceY:n,targetX:o,targetY:i,sourceControlX:a,sourceControlY:r,targetControlX:l,targetControlY:s}){const c=e*.125+a*.375+l*.375+o*.125,d=n*.125+r*.375+s*.375+i*.125,u=Math.abs(c-e),m=Math.abs(d-n);return[c,d,u,m]}function Mr(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function th({pos:e,x1:n,y1:o,x2:i,y2:a,c:r}){let l,s;switch(e){case Ve.Left:l=n-Mr(n-i,r),s=o;break;case Ve.Right:l=n+Mr(i-n,r),s=o;break;case Ve.Top:l=n,s=o-Mr(o-a,r);break;case Ve.Bottom:l=n,s=o+Mr(a-o,r);break}return[l,s]}function nh(e){const{sourceX:n,sourceY:o,sourcePosition:i=Ve.Bottom,targetX:a,targetY:r,targetPosition:l=Ve.Top,curvature:s=.25}=e,[c,d]=th({pos:i,x1:n,y1:o,x2:a,y2:r,c:s}),[u,m]=th({pos:l,x1:a,y1:r,x2:n,y2:o,c:s}),[f,p,y,g]=eh({sourceX:n,sourceY:o,targetX:a,targetY:r,sourceControlX:c,sourceControlY:d,targetControlX:u,targetControlY:m});return[`M${n},${o} C${c},${d} ${u},${m} ${a},${r}`,f,p,y,g]}function oh({pos:e,x1:n,y1:o,x2:i,y2:a}){let r,l;switch(e){case Ve.Left:case Ve.Right:r=.5*(n+i),l=o;break;case Ve.Top:case Ve.Bottom:r=n,l=.5*(o+a);break}return[r,l]}function ih(e){const{sourceX:n,sourceY:o,sourcePosition:i=Ve.Bottom,targetX:a,targetY:r,targetPosition:l=Ve.Top}=e,[s,c]=oh({pos:i,x1:n,y1:o,x2:a,y2:r}),[d,u]=oh({pos:l,x1:a,y1:r,x2:n,y2:o}),[m,f,p,y]=eh({sourceX:n,sourceY:o,targetX:a,targetY:r,sourceControlX:s,sourceControlY:c,targetControlX:d,targetControlY:u});return[`M${n},${o} C${s},${c} ${d},${u} ${a},${r}`,m,f,p,y]}const ah={[Ve.Left]:{x:-1,y:0},[Ve.Right]:{x:1,y:0},[Ve.Top]:{x:0,y:-1},[Ve.Bottom]:{x:0,y:1}};function HI({source:e,sourcePosition:n=Ve.Bottom,target:o}){return n===Ve.Left||n===Ve.Right?e.x<o.x?{x:1,y:0}:{x:-1,y:0}:e.y<o.y?{x:0,y:1}:{x:0,y:-1}}function rh(e,n){return Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2)}function jI({source:e,sourcePosition:n=Ve.Bottom,target:o,targetPosition:i=Ve.Top,center:a,offset:r}){const l=ah[n],s=ah[i],c={x:e.x+l.x*r,y:e.y+l.y*r},d={x:o.x+s.x*r,y:o.y+s.y*r},u=HI({source:c,sourcePosition:n,target:d}),m=u.x!==0?"x":"y",f=u[m];let p,y,g;const b={x:0,y:0},k={x:0,y:0},[_,h,C,v]=Qp({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(l[m]*s[m]===-1){y=a.x??_,g=a.y??h;const N=[{x:y,y:c.y},{x:y,y:d.y}],A=[{x:c.x,y:g},{x:d.x,y:g}];l[m]===f?p=m==="x"?N:A:p=m==="x"?A:N}else{const N=[{x:c.x,y:d.y}],A=[{x:d.x,y:c.y}];if(m==="x"?p=l.x===f?A:N:p=l.y===f?N:A,n===i){const D=Math.abs(e[m]-o[m]);if(D<=r){const E=Math.min(r-1,r-D);l[m]===f?b[m]=(c[m]>e[m]?-1:1)*E:k[m]=(d[m]>o[m]?-1:1)*E}}if(n!==i){const D=m==="x"?"y":"x",E=l[m]===s[D],R=c[D]>d[D],I=c[D]<d[D];(l[m]===1&&(!E&&R||E&&I)||l[m]!==1&&(!E&&I||E&&R))&&(p=m==="x"?N:A)}const T={x:c.x+b.x,y:c.y+b.y},O={x:d.x+k.x,y:d.y+k.y},z=Math.max(Math.abs(T.x-p[0].x),Math.abs(O.x-p[0].x)),P=Math.max(Math.abs(T.y-p[0].y),Math.abs(O.y-p[0].y));z>=P?(y=(T.x+O.x)/2,g=p[0].y):(y=p[0].x,g=(T.y+O.y)/2)}return[[e,{x:c.x+b.x,y:c.y+b.y},...p,{x:d.x+k.x,y:d.y+k.y},o],y,g,C,v]}function KI(e,n,o,i){const a=Math.min(rh(e,n)/2,rh(n,o)/2,i),{x:r,y:l}=n;if(e.x===r&&r===o.x||e.y===l&&l===o.y)return`L${r} ${l}`;if(e.y===l){const d=e.x<o.x?-1:1,u=e.y<o.y?1:-1;return`L ${r+a*d},${l}Q ${r},${l} ${r},${l+a*u}`}const s=e.x<o.x?1:-1,c=e.y<o.y?-1:1;return`L ${r},${l+a*c}Q ${r},${l} ${r+a*s},${l}`}function Xs(e){const{sourceX:n,sourceY:o,sourcePosition:i=Ve.Bottom,targetX:a,targetY:r,targetPosition:l=Ve.Top,borderRadius:s=5,centerX:c,centerY:d,offset:u=20}=e,[m,f,p,y,g]=jI({source:{x:n,y:o},sourcePosition:i,target:{x:a,y:r},targetPosition:l,center:{x:c,y:d},offset:u});return[m.reduce((k,_,h)=>{let C;return h>0&&h<m.length-1?C=KI(m[h-1],_,m[h+1],s):C=`${h===0?"M":"L"}${_.x} ${_.y}`,k+=C,k},""),f,p,y,g]}function GI(e){const{sourceX:n,sourceY:o,targetX:i,targetY:a}=e,[r,l,s,c]=Qp({sourceX:n,sourceY:o,targetX:i,targetY:a});return[`M ${n},${o}L ${i},${a}`,r,l,s,c]}const YI=t.defineComponent({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:n}){return()=>{const[o,i,a]=GI(e);return t.h(Tr,{path:o,labelX:i,labelY:a,...n,...e})}}}),lh=t.defineComponent({name:"SmoothStepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","borderRadius","markerEnd","markerStart","interactionWidth","offset"],compatConfig:{MODE:3},setup(e,{attrs:n}){return()=>{const[o,i,a]=Xs({...e,sourcePosition:e.sourcePosition??Ve.Bottom,targetPosition:e.targetPosition??Ve.Top});return t.h(Tr,{path:o,labelX:i,labelY:a,...n,...e})}}}),qI=t.defineComponent({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:n}){return()=>t.h(lh,{...e,...n,borderRadius:0})}}),WI=t.defineComponent({name:"BezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","curvature","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:n}){return()=>{const[o,i,a]=nh({...e,sourcePosition:e.sourcePosition??Ve.Bottom,targetPosition:e.targetPosition??Ve.Top});return t.h(Tr,{path:o,labelX:i,labelY:a,...n,...e})}}}),JI=t.defineComponent({name:"SimpleBezierEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:n}){return()=>{const[o,i,a]=ih({...e,sourcePosition:e.sourcePosition??Ve.Bottom,targetPosition:e.targetPosition??Ve.Top});return t.h(Tr,{path:o,labelX:i,labelY:a,...n,...e})}}}),XI={input:VI,default:TI,output:MI},ZI={default:WI,straight:YI,step:qI,smoothstep:lh,simplebezier:JI};function QI(e,n,o){const i=t.computed(()=>g=>n.value.get(g)),a=t.computed(()=>g=>o.value.get(g)),r=t.computed(()=>{const g={...ZI,...e.edgeTypes},b=Object.keys(g);for(const k of e.edges)k.type&&!b.includes(k.type)&&(g[k.type]=k.type);return g}),l=t.computed(()=>{const g={...XI,...e.nodeTypes},b=Object.keys(g);for(const k of e.nodes)k.type&&!b.includes(k.type)&&(g[k.type]=k.type);return g}),s=t.computed(()=>e.onlyRenderVisibleElements?wp(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),c=t.computed(()=>{if(e.onlyRenderVisibleElements){const g=[];for(const b of e.edges){const k=n.value.get(b.source),_=n.value.get(b.target);eI({sourcePos:k.computedPosition||{x:0,y:0},targetPos:_.computedPosition||{x:0,y:0},sourceWidth:k.dimensions.width,sourceHeight:k.dimensions.height,targetWidth:_.dimensions.width,targetHeight:_.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&g.push(b)}return g}return e.edges}),d=t.computed(()=>[...s.value,...c.value]),u=t.computed(()=>{const g=[];for(const b of e.nodes)b.selected&&g.push(b);return g}),m=t.computed(()=>{const g=[];for(const b of e.edges)b.selected&&g.push(b);return g}),f=t.computed(()=>[...u.value,...m.value]),p=t.computed(()=>{const g=[];for(const b of e.nodes)b.dimensions.width&&b.dimensions.height&&b.handleBounds!==void 0&&g.push(b);return g}),y=t.computed(()=>s.value.length>0&&p.value.length===s.value.length);return{getNode:i,getEdge:a,getElements:d,getEdgeTypes:r,getNodeTypes:l,getEdges:c,getNodes:s,getSelectedElements:f,getSelectedNodes:u,getSelectedEdges:m,getNodesInitialized:p,areNodesInitialized:y}}class Vo{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var n;const o=(n=t.getCurrentInstance())==null?void 0:n.appContext.app,i=(o==null?void 0:o.config.globalProperties.$vueFlowStorage)??Vo.instance;return Vo.instance=i??new Vo,o&&(o.config.globalProperties.$vueFlowStorage=Vo.instance),Vo.instance}set(n,o){return this.flows.set(n,o)}get(n){return this.flows.get(n)}remove(n){return this.flows.delete(n)}create(n,o){const i=Zp(),a=t.reactive(i),r={};for(const[f,p]of Object.entries(a.hooks)){const y=`on${f.charAt(0).toUpperCase()+f.slice(1)}`;r[y]=p.on}const l={};for(const[f,p]of Object.entries(a.hooks))l[f]=p.trigger;const s=t.computed(()=>{const f=new Map;for(const p of a.nodes)f.set(p.id,p);return f}),c=t.computed(()=>{const f=new Map;for(const p of a.edges)f.set(p.id,p);return f}),d=QI(a,s,c),u=AI(a,s,c);u.setState({...a,...o});const m={...r,...d,...u,...JE(a),nodeLookup:s,edgeLookup:c,emits:l,id:n,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(n)}};return this.set(n,m),m}getId(){return`vue-flow-${this.currentId++}`}}function ot(e){const n=Vo.getInstance(),o=t.getCurrentScope(),i=typeof e=="object",a=i?e:{id:e},r=a.id,l=r??(o==null?void 0:o.vueFlowId);let s;if(o){const c=t.inject(Kp,null);typeof c<"u"&&c!==null&&(!l||c.id===l)&&(s=c)}if(s||l&&(s=n.get(l)),!s||l&&s.id!==l){const c=r??n.getId(),d=n.create(c,a);s=d,(o??t.effectScope(!0)).run(()=>{t.watch(d.applyDefault,(m,f,p)=>{const y=b=>{d.applyNodeChanges(b)},g=b=>{d.applyEdgeChanges(b)};m?(d.onNodesChange(y),d.onEdgesChange(g)):(d.hooks.value.nodesChange.off(y),d.hooks.value.edgesChange.off(g)),p(()=>{d.hooks.value.nodesChange.off(y),d.hooks.value.edgesChange.off(g)})},{immediate:!0}),Bi(()=>{if(s){const m=n.get(s.id);m?m.$destroy():ta(`No store instance found for id ${s.id} in storage.`)}})})}else i&&s.setState(a);if(o&&(t.provide(Kp,s),o.vueFlowId=s.id),i){const c=t.getCurrentInstance();(c==null?void 0:c.type.name)!=="VueFlow"&&s.emits.error(new vt(_t.USEVUEFLOW_OPTIONS))}return s}function ev(e){const{emits:n,dimensions:o}=ot();let i;t.onMounted(()=>{const a=()=>{var r,l;if(!e.value||!(((l=(r=e.value).checkVisibility)==null?void 0:l.call(r))??!0))return;const s=Nr(e.value);(s.width===0||s.height===0)&&n.error(new vt(_t.MISSING_VIEWPORT_DIMENSIONS)),o.value={width:s.width||500,height:s.height||500}};a(),window.addEventListener("resize",a),e.value&&(i=new ResizeObserver(()=>a()),i.observe(e.value)),t.onBeforeUnmount(()=>{window.removeEventListener("resize",a),i&&e.value&&i.unobserve(e.value)})})}const tv={name:"UserSelection",compatConfig:{MODE:3}},nv=t.defineComponent({...tv,props:{userSelectionRect:{}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("div",{class:"vue-flow__selection vue-flow__container",style:t.normalizeStyle({width:`${n.userSelectionRect.width}px`,height:`${n.userSelectionRect.height}px`,transform:`translate(${n.userSelectionRect.x}px, ${n.userSelectionRect.y}px)`})},null,4))}}),ov=["tabIndex"],iv={name:"NodesSelection",compatConfig:{MODE:3}},av=t.defineComponent({...iv,setup(e){const{emits:n,viewport:o,getSelectedNodes:i,noPanClassName:a,disableKeyboardA11y:r,userSelectionActive:l}=ot(),s=Xp(),c=t.ref(null),d=qp({el:c,onStart(y){n.selectionDragStart(y),n.nodeDragStart(y)},onDrag(y){n.selectionDrag(y),n.nodeDrag(y)},onStop(y){n.selectionDragStop(y),n.nodeDragStop(y)}});t.onMounted(()=>{var y;r.value||(y=c.value)==null||y.focus({preventScroll:!0})});const u=t.computed(()=>Ps(i.value)),m=t.computed(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function f(y){n.selectionContextMenu({event:y,nodes:i.value})}function p(y){r.value||li[y.key]&&(y.preventDefault(),s({x:li[y.key].x,y:li[y.key].y},y.shiftKey))}return(y,g)=>!t.unref(l)&&u.value.width&&u.value.height?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["vue-flow__nodesselection vue-flow__container",t.unref(a)]),style:t.normalizeStyle({transform:`translate(${t.unref(o).x}px,${t.unref(o).y}px) scale(${t.unref(o).zoom})`})},[t.createElementVNode("div",{ref_key:"el",ref:c,class:t.normalizeClass([{dragging:t.unref(d)},"vue-flow__nodesselection-rect"]),style:t.normalizeStyle(m.value),tabIndex:t.unref(r)?void 0:-1,onContextmenu:f,onKeydown:p},null,46,ov)],6)):t.createCommentVNode("",!0)}});function rv(e,n){return{x:e.clientX-n.left,y:e.clientY-n.top}}const lv={name:"Pane",compatConfig:{MODE:3}},sv=t.defineComponent({...lv,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:n,nodes:o,viewport:i,emits:a,userSelectionActive:r,removeSelectedElements:l,userSelectionRect:s,elementsSelectable:c,nodesSelectionActive:d,getSelectedEdges:u,getSelectedNodes:m,removeNodes:f,removeEdges:p,selectionMode:y,deleteKeyCode:g,multiSelectionKeyCode:b,multiSelectionActive:k,edgeLookup:_,nodeLookup:h,connectionLookup:C,defaultEdgeOptions:v,connectionStartHandle:S,panOnDrag:N}=ot(),A=t.shallowRef(null),T=t.shallowRef(new Set),O=t.shallowRef(new Set),z=t.shallowRef(null),P=t.toRef(()=>c.value&&(e.isSelecting||r.value)),D=t.toRef(()=>S.value!==null);let E=!1,R=!1;const I=Wi(g,{actInsideInputWithModifier:!1}),x=Wi(b);t.watch(I,oe=>{oe&&(f(m.value),p(u.value),d.value=!1)}),t.watch(x,oe=>{k.value=oe});function $(oe,de){return ie=>{ie.target===de&&(oe==null||oe(ie))}}function U(oe){if(E||D.value){E=!1;return}a.paneClick(oe),l(),d.value=!1}function F(oe){var de;if(Array.isArray(N.value)&&((de=N.value)!=null&&de.includes(2))){oe.preventDefault();return}a.paneContextMenu(oe)}function B(oe){a.paneScroll(oe)}function j(oe){var de,ie,Ie;if(z.value=((de=n.value)==null?void 0:de.getBoundingClientRect())??null,!c.value||!e.isSelecting||oe.button!==0||oe.target!==A.value||!z.value)return;(Ie=(ie=oe.target)==null?void 0:ie.setPointerCapture)==null||Ie.call(ie,oe.pointerId);const{x:Le,y:Se}=rv(oe,z.value);R=!0,E=!1,l(),s.value={width:0,height:0,startX:Le,startY:Se,x:Le,y:Se},a.selectionStart(oe)}function X(oe){var de;if(!z.value||!s.value)return;E=!0;const{x:ie,y:Ie}=Nn(oe,z.value),{startX:Le=0,startY:Se=0}=s.value,ce={startX:Le,startY:Se,x:ie<Le?ie:Le,y:Ie<Se?Ie:Se,width:Math.abs(ie-Le),height:Math.abs(Ie-Se)},pe=T.value,he=O.value;T.value=new Set(wp(o.value,ce,i.value,y.value===Bs.Partial,!0).map(L=>L.id)),O.value=new Set;const V=((de=v.value)==null?void 0:de.selectable)??!0;for(const L of T.value){const K=C.value.get(L);if(K)for(const{edgeId:Z}of K.values()){const Q=_.value.get(Z);Q&&(Q.selectable??V)&&O.value.add(Z)}}if(!jp(pe,T.value)){const L=to(h.value,T.value,!0);a.nodesChange(L)}if(!jp(he,O.value)){const L=to(_.value,O.value);a.edgesChange(L)}s.value=ce,r.value=!0,d.value=!1}function W(oe){var de;oe.button!==0||!R||((de=oe.target)==null||de.releasePointerCapture(oe.pointerId),!r.value&&s.value&&oe.target===A.value&&U(oe),r.value=!1,s.value=null,d.value=T.value.size>0,a.selectionEnd(oe),e.selectionKeyPressed&&(E=!1),R=!1)}return(oe,de)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"container",ref:A,class:t.normalizeClass(["vue-flow__pane vue-flow__container",{selection:oe.isSelecting}]),onClick:de[0]||(de[0]=ie=>P.value?void 0:$(U,A.value)(ie)),onContextmenu:de[1]||(de[1]=ie=>$(F,A.value)(ie)),onWheelPassive:de[2]||(de[2]=ie=>$(B,A.value)(ie)),onPointerenter:de[3]||(de[3]=ie=>P.value?void 0:t.unref(a).paneMouseEnter(ie)),onPointerdown:de[4]||(de[4]=ie=>P.value?j(ie):t.unref(a).paneMouseMove(ie)),onPointermove:de[5]||(de[5]=ie=>P.value?X(ie):t.unref(a).paneMouseMove(ie)),onPointerup:de[6]||(de[6]=ie=>P.value?W(ie):void 0),onPointerleave:de[7]||(de[7]=ie=>t.unref(a).paneMouseLeave(ie))},[t.renderSlot(oe.$slots,"default"),t.unref(r)&&t.unref(s)?(t.openBlock(),t.createBlock(nv,{key:0,"user-selection-rect":t.unref(s)},null,8,["user-selection-rect"])):t.createCommentVNode("",!0),t.unref(d)&&t.unref(m).length?(t.openBlock(),t.createBlock(av,{key:1})):t.createCommentVNode("",!0)],34))}}),cv={name:"Transform",compatConfig:{MODE:3}},dv=t.defineComponent({...cv,setup(e){const{viewport:n,fitViewOnInit:o,fitViewOnInitDone:i}=ot(),a=t.computed(()=>o.value?!i.value:!1),r=t.computed(()=>`translate(${n.value.x}px,${n.value.y}px) scale(${n.value.zoom})`);return(l,s)=>(t.openBlock(),t.createElementBlock("div",{class:"vue-flow__transformationpane vue-flow__container",style:t.normalizeStyle({transform:r.value,opacity:a.value?0:void 0})},[t.renderSlot(l.$slots,"default")],4))}}),uv={name:"Viewport",compatConfig:{MODE:3}},mv=t.defineComponent({...uv,setup(e){const{minZoom:n,maxZoom:o,defaultViewport:i,translateExtent:a,zoomActivationKeyCode:r,selectionKeyCode:l,panActivationKeyCode:s,panOnScroll:c,panOnScrollMode:d,panOnScrollSpeed:u,panOnDrag:m,zoomOnDoubleClick:f,zoomOnPinch:p,zoomOnScroll:y,preventScrolling:g,noWheelClassName:b,noPanClassName:k,emits:_,connectionStartHandle:h,userSelectionActive:C,paneDragging:v,d3Zoom:S,d3Selection:N,d3ZoomHandler:A,viewport:T,viewportRef:O,paneClickDistance:z}=ot();ev(O);const P=t.shallowRef(!1),D=t.shallowRef(!1);let E=null,R=!1,I=0,x={x:0,y:0,zoom:0};const $=Wi(s),U=Wi(l),F=Wi(r),B=t.toRef(()=>(!U.value||U.value&&l.value===!0)&&($.value||m.value)),j=t.toRef(()=>$.value||c.value),X=t.toRef(()=>l.value===!0&&B.value!==!0),W=t.toRef(()=>U.value&&l.value!==!0||C.value||X.value),oe=t.toRef(()=>h.value!==null);t.onMounted(()=>{if(!O.value){ta("Viewport element is missing");return}const Se=O.value,ce=Se.getBoundingClientRect(),pe=Vw().clickDistance(z.value).scaleExtent([n.value,o.value]).translateExtent(a.value),he=rn(Se).call(pe),V=he.on("wheel.zoom"),L=ri.translate(i.value.x??0,i.value.y??0).scale($o(i.value.zoom??1,n.value,o.value)),K=[[0,0],[ce.width,ce.height]],Z=pe.constrain()(L,K,a.value);pe.transform(he,Z),pe.wheelDelta(zs),S.value=pe,N.value=he,A.value=V,T.value={x:Z.x,y:Z.y,zoom:Z.k},pe.on("start",Q=>{var fe;if(!Q.sourceEvent)return null;I=Q.sourceEvent.button,P.value=!0;const be=Ie(Q.transform);((fe=Q.sourceEvent)==null?void 0:fe.type)==="mousedown"&&(v.value=!0),x=be,_.viewportChangeStart(be),_.moveStart({event:Q,flowTransform:be})}),pe.on("end",Q=>{if(!Q.sourceEvent)return null;if(P.value=!1,v.value=!1,de(B.value,I??0)&&!R&&_.paneContextMenu(Q.sourceEvent),R=!1,ie(x,Q.transform)){const fe=Ie(Q.transform);x=fe,_.viewportChangeEnd(fe),_.moveEnd({event:Q,flowTransform:fe})}}),pe.filter(Q=>{var fe;const be=F.value||y.value,Ee=p.value&&Q.ctrlKey,Ne=Q.button,J=Q.type==="wheel";if(Ne===1&&Q.type==="mousedown"&&(Le(Q,"vue-flow__node")||Le(Q,"vue-flow__edge")))return!0;if(!B.value&&!be&&!j.value&&!f.value&&!p.value||C.value||oe.value&&!J||!f.value&&Q.type==="dblclick"||Le(Q,b.value)&&J||Le(Q,k.value)&&(!J||j.value&&J&&!F.value)||!p.value&&Q.ctrlKey&&J||!be&&!j.value&&!Ee&&J)return!1;if(!p&&Q.type==="touchstart"&&((fe=Q.touches)==null?void 0:fe.length)>1)return Q.preventDefault(),!1;if(!B.value&&(Q.type==="mousedown"||Q.type==="touchstart")||X.value&&Array.isArray(m.value)&&m.value.includes(0)&&Ne===0||Array.isArray(m.value)&&!m.value.includes(Ne)&&(Q.type==="mousedown"||Q.type==="touchstart"))return!1;const ee=Array.isArray(m.value)&&m.value.includes(Ne)||l.value===!0&&Array.isArray(m.value)&&!m.value.includes(0)||!Ne||Ne<=1;return(!Q.ctrlKey||$.value||J)&&ee}),t.watch([C,B],()=>{C.value&&!P.value?pe.on("zoom",null):C.value||pe.on("zoom",Q=>{T.value={x:Q.transform.x,y:Q.transform.y,zoom:Q.transform.k};const fe=Ie(Q.transform);R=de(B.value,I??0),_.viewportChange(fe),_.move({event:Q,flowTransform:fe})})},{immediate:!0}),t.watch([C,j,d,F,p,g,b],()=>{j.value&&!F.value&&!C.value?he.on("wheel.zoom",Q=>{if(Le(Q,b.value))return!1;const fe=F.value||y.value,be=p.value&&Q.ctrlKey;if(!(!g.value||j.value||fe||be))return!1;Q.preventDefault(),Q.stopImmediatePropagation();const Ne=he.property("__zoom").k||1,J=ea();if(!$.value&&Q.ctrlKey&&p.value&&J){const Pe=bn(Q),Me=zs(Q),Qe=Ne*2**Me;pe.scaleTo(he,Qe,Pe,Q);return}const ee=Q.deltaMode===1?20:1;let te=d.value===qi.Vertical?0:Q.deltaX*ee,ge=d.value===qi.Horizontal?0:Q.deltaY*ee;!J&&Q.shiftKey&&d.value!==qi.Vertical&&!te&&ge&&(te=ge,ge=0),pe.translateBy(he,-(te/Ne)*u.value,-(ge/Ne)*u.value);const Re=Ie(he.property("__zoom"));E&&clearTimeout(E),D.value?(_.move({event:Q,flowTransform:Re}),_.viewportChange(Re),E=setTimeout(()=>{_.moveEnd({event:Q,flowTransform:Re}),_.viewportChangeEnd(Re),D.value=!1},150)):(D.value=!0,_.moveStart({event:Q,flowTransform:Re}),_.viewportChangeStart(Re))},{passive:!1}):typeof V<"u"&&he.on("wheel.zoom",function(Q,fe){const be=!g.value&&Q.type==="wheel"&&!Q.ctrlKey,Ee=F.value||y.value,Ne=p.value&&Q.ctrlKey;if(!Ee&&!c.value&&!Ne&&Q.type==="wheel"||be||Le(Q,b.value))return null;Q.preventDefault(),V.call(this,Q,fe)},{passive:!1})},{immediate:!0})});function de(Se,ce){return ce===2&&Array.isArray(Se)&&Se.includes(2)}function ie(Se,ce){return Se.x!==ce.x&&!Number.isNaN(ce.x)||Se.y!==ce.y&&!Number.isNaN(ce.y)||Se.zoom!==ce.k&&!Number.isNaN(ce.k)}function Ie(Se){return{x:Se.x,y:Se.y,zoom:Se.k}}function Le(Se,ce){return Se.target.closest(`.${ce}`)}return(Se,ce)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"viewportRef",ref:O,class:"vue-flow__viewport vue-flow__container"},[t.createVNode(sv,{"is-selecting":W.value,"selection-key-pressed":t.unref(U),class:t.normalizeClass({connecting:oe.value,dragging:t.unref(v),draggable:t.unref(m)===!0||Array.isArray(t.unref(m))&&t.unref(m).includes(0)})},{default:t.withCtx(()=>[t.createVNode(dv,null,{default:t.withCtx(()=>[t.renderSlot(Se.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),fv=["id"],pv=["id"],hv=["id"],yv={name:"A11yDescriptions",compatConfig:{MODE:3}},gv=t.defineComponent({...yv,setup(e){const{id:n,disableKeyboardA11y:o,ariaLiveMessage:i}=ot();return(a,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{id:`${t.unref(fp)}-${t.unref(n)}`,style:{display:"none"}}," Press enter or space to select a node. "+t.toDisplayString(t.unref(o)?"":"You can then use the arrow keys to move the node around.")+" You can then use the arrow keys to move the node around, press delete to remove it and press escape to cancel. ",9,fv),t.createElementVNode("div",{id:`${t.unref(pp)}-${t.unref(n)}`,style:{display:"none"}}," Press enter or space to select an edge. You can then press delete to remove it or press escape to cancel. ",8,pv),t.unref(o)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,id:`${t.unref(zw)}-${t.unref(n)}`,"aria-live":"assertive","aria-atomic":"true",style:{position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(100%)"}},t.toDisplayString(t.unref(i)),9,hv))],64))}});function bv(){const e=ot();t.watch(()=>e.viewportHelper.value.viewportInitialized,n=>{n&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function kv(e,n,o){return o===Ve.Left?e-n:o===Ve.Right?e+n:e}function _v(e,n,o){return o===Ve.Top?e-n:o===Ve.Bottom?e+n:e}const Zs=function({radius:e=10,centerX:n=0,centerY:o=0,position:i=Ve.Top,type:a}){return t.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${a}`,cx:kv(n,e,i),cy:_v(o,e,i),r:e,stroke:"transparent",fill:"transparent"})};Zs.props=["radius","centerX","centerY","position","type"],Zs.compatConfig={MODE:3};const sh=Zs,Ev=t.defineComponent({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:n,addSelectedEdges:o,connectionMode:i,edgeUpdaterRadius:a,emits:r,nodesSelectionActive:l,noPanClassName:s,getEdgeTypes:c,removeSelectedEdges:d,findEdge:u,findNode:m,isValidConnection:f,multiSelectionActive:p,disableKeyboardA11y:y,elementsSelectable:g,edgesUpdatable:b,edgesFocusable:k,hooks:_}=ot(),h=t.computed(()=>u(e.id)),{emit:C,on:v}=yI(h.value,r),S=t.inject(Cr),N=t.getCurrentInstance(),A=t.ref(!1),T=t.ref(!1),O=t.ref(""),z=t.ref(null),P=t.ref("source"),D=t.ref(null),E=t.toRef(()=>typeof h.value.selectable>"u"?g.value:h.value.selectable),R=t.toRef(()=>typeof h.value.updatable>"u"?b.value:h.value.updatable),I=t.toRef(()=>typeof h.value.focusable>"u"?k.value:h.value.focusable);t.provide(fI,e.id),t.provide(pI,D);const x=t.computed(()=>h.value.class instanceof Function?h.value.class(h.value):h.value.class),$=t.computed(()=>h.value.style instanceof Function?h.value.style(h.value):h.value.style),U=t.computed(()=>{const L=h.value.type||"default",K=S==null?void 0:S[`edge-${L}`];if(K)return K;let Z=h.value.template??c.value[L];if(typeof Z=="string"&&N){const Q=Object.keys(N.appContext.components);Q&&Q.includes(L)&&(Z=t.resolveComponent(L,!1))}return Z&&typeof Z!="string"?Z:(r.error(new vt(_t.EDGE_TYPE_MISSING,Z)),!1)}),{handlePointerDown:F}=Wp({nodeId:O,handleId:z,type:P,isValidConnection:f,edgeUpdaterType:P,onEdgeUpdate:X,onEdgeUpdateEnd:W});return()=>{const L=m(h.value.source),K=m(h.value.target),Z="pathOptions"in h.value?h.value.pathOptions:{};if(!L&&!K)return r.error(new vt(_t.EDGE_SOURCE_TARGET_MISSING,h.value.id,h.value.source,h.value.target)),null;if(!L)return r.error(new vt(_t.EDGE_SOURCE_MISSING,h.value.id,h.value.source)),null;if(!K)return r.error(new vt(_t.EDGE_TARGET_MISSING,h.value.id,h.value.target)),null;if(!h.value||h.value.hidden||L.hidden||K.hidden)return null;let Q;i.value===Pn.Strict?Q=L.handleBounds.source:Q=[...L.handleBounds.source||[],...L.handleBounds.target||[]];const fe=Lp(Q,h.value.sourceHandle);let be;i.value===Pn.Strict?be=K.handleBounds.target:be=[...K.handleBounds.target||[],...K.handleBounds.source||[]];const Ee=Lp(be,h.value.targetHandle),Ne=(fe==null?void 0:fe.position)||Ve.Bottom,J=(Ee==null?void 0:Ee.position)||Ve.Top,{x:ee,y:te}=ci(L,fe,Ne),{x:ge,y:Re}=ci(K,Ee,J);return h.value.sourceX=ee,h.value.sourceY=te,h.value.targetX=ge,h.value.targetY=Re,t.h("g",{ref:D,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${U.value===!1?"default":h.value.type||"default"}`,s.value,x.value,{updating:A.value,selected:h.value.selected,animated:h.value.animated,inactive:!E.value&&!_.value.edgeClick.hasListeners()}],tabIndex:I.value?0:void 0,"aria-label":h.value.ariaLabel===null?void 0:h.value.ariaLabel??`Edge from ${h.value.source} to ${h.value.target}`,"aria-describedby":I.value?`${pp}-${n}`:void 0,"aria-roledescription":"edge",role:I.value?"group":"img",...h.value.domAttributes,onClick:de,onContextmenu:ie,onDblclick:Ie,onMouseenter:Le,onMousemove:Se,onMouseleave:ce,onKeyDown:I.value?V:void 0},[T.value?null:t.h(U.value===!1?c.value.default:U.value,{id:e.id,sourceNode:L,targetNode:K,source:h.value.source,target:h.value.target,type:h.value.type,updatable:R.value,selected:h.value.selected,animated:h.value.animated,label:h.value.label,labelStyle:h.value.labelStyle,labelShowBg:h.value.labelShowBg,labelBgStyle:h.value.labelBgStyle,labelBgPadding:h.value.labelBgPadding,labelBgBorderRadius:h.value.labelBgBorderRadius,data:h.value.data,events:{...h.value.events,...v},style:$.value,markerStart:`url('#${Qi(h.value.markerStart,n)}')`,markerEnd:`url('#${Qi(h.value.markerEnd,n)}')`,sourcePosition:Ne,targetPosition:J,sourceX:ee,sourceY:te,targetX:ge,targetY:Re,sourceHandleId:h.value.sourceHandle,targetHandleId:h.value.targetHandle,interactionWidth:h.value.interactionWidth,...Z}),[R.value==="source"||R.value===!0?[t.h("g",{onMousedown:pe,onMouseenter:B,onMouseout:j},t.h(sh,{position:Ne,centerX:ee,centerY:te,radius:a.value,type:"source","data-type":"source"}))]:null,R.value==="target"||R.value===!0?[t.h("g",{onMousedown:he,onMouseenter:B,onMouseout:j},t.h(sh,{position:J,centerX:ge,centerY:Re,radius:a.value,type:"target","data-type":"target"}))]:null]])};function B(){A.value=!0}function j(){A.value=!1}function X(L,K){C.update({event:L,edge:h.value,connection:K})}function W(L){C.updateEnd({event:L,edge:h.value}),T.value=!1}function oe(L,K){L.button===0&&(T.value=!0,O.value=K?h.value.target:h.value.source,z.value=(K?h.value.targetHandle:h.value.sourceHandle)??null,P.value=K?"target":"source",C.updateStart({event:L,edge:h.value}),F(L))}function de(L){var K;const Z={event:L,edge:h.value};E.value&&(l.value=!1,h.value.selected&&p.value?(d([h.value]),(K=D.value)==null||K.blur()):o([h.value])),C.click(Z)}function ie(L){C.contextMenu({event:L,edge:h.value})}function Ie(L){C.doubleClick({event:L,edge:h.value})}function Le(L){C.mouseEnter({event:L,edge:h.value})}function Se(L){C.mouseMove({event:L,edge:h.value})}function ce(L){C.mouseLeave({event:L,edge:h.value})}function pe(L){oe(L,!0)}function he(L){oe(L,!1)}function V(L){var K;!y.value&&hp.includes(L.key)&&E.value&&(L.key==="Escape"?((K=D.value)==null||K.blur(),d([u(e.id)])):o([u(e.id)]))}}}),Nv=t.defineComponent({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:n,connectionMode:o,connectionStartHandle:i,connectionEndHandle:a,connectionPosition:r,connectionLineType:l,connectionLineStyle:s,connectionLineOptions:c,connectionStatus:d,viewport:u,findNode:m}=ot(),f=(e=t.inject(Cr))==null?void 0:e["connection-line"],p=t.computed(()=>{var _;return m((_=i.value)==null?void 0:_.nodeId)}),y=t.computed(()=>{var _;return m((_=a.value)==null?void 0:_.nodeId)??null}),g=t.computed(()=>({x:(r.value.x-u.value.x)/u.value.zoom,y:(r.value.y-u.value.y)/u.value.zoom})),b=t.computed(()=>c.value.markerStart?`url(#${Qi(c.value.markerStart,n)})`:""),k=t.computed(()=>c.value.markerEnd?`url(#${Qi(c.value.markerEnd,n)})`:"");return()=>{var _,h,C;if(!p.value||!i.value)return null;const v=i.value.id,S=i.value.type,N=p.value.handleBounds;let A=(N==null?void 0:N[S])??[];if(o.value===Pn.Loose){const $=(N==null?void 0:N[S==="source"?"target":"source"])??[];A=[...A,...$]}if(!A)return null;const T=(v?A.find($=>$.id===v):A[0])??null,O=(T==null?void 0:T.position)??Ve.Top,{x:z,y:P}=ci(p.value,T,O);let D=null;y.value&&(o.value===Pn.Strict?D=((_=y.value.handleBounds[S==="source"?"target":"source"])==null?void 0:_.find($=>{var U;return $.id===((U=a.value)==null?void 0:U.id)}))||null:D=((h=[...y.value.handleBounds.source??[],...y.value.handleBounds.target??[]])==null?void 0:h.find($=>{var U;return $.id===((U=a.value)==null?void 0:U.id)}))||null);const E=((C=a.value)==null?void 0:C.position)??(O?Gs[O]:null);if(!O||!E)return null;const R=l.value??c.value.type??xo.Bezier;let I="";const x={sourceX:z,sourceY:P,sourcePosition:O,targetX:g.value.x,targetY:g.value.y,targetPosition:E};return R===xo.Bezier?[I]=nh(x):R===xo.Step?[I]=Xs({...x,borderRadius:0}):R===xo.SmoothStep?[I]=Xs(x):R===xo.SimpleBezier?[I]=ih(x):I=`M${z},${P} ${g.value.x},${g.value.y}`,t.h("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},t.h("g",{class:"vue-flow__connection"},f?t.h(f,{sourceX:z,sourceY:P,sourcePosition:O,targetX:g.value.x,targetY:g.value.y,targetPosition:E,sourceNode:p.value,sourceHandle:T,targetNode:y.value,targetHandle:D,markerEnd:k.value,markerStart:b.value,connectionStatus:d.value}):t.h("path",{d:I,class:[c.value.class,d.value,"vue-flow__connection-path"],style:{...s.value,...c.value.style},"marker-end":k.value,"marker-start":b.value})))}}}),wv=["id","markerWidth","markerHeight","markerUnits","orient"],Iv={name:"MarkerType",compatConfig:{MODE:3}},vv=t.defineComponent({...Iv,props:{id:{},type:{},color:{default:"none"},width:{default:12.5},height:{default:12.5},markerUnits:{default:"strokeWidth"},orient:{default:"auto-start-reverse"},strokeWidth:{default:1}},setup(e){return(n,o)=>(t.openBlock(),t.createElementBlock("marker",{id:n.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${n.width}`,markerHeight:`${n.height}`,markerUnits:n.markerUnits,orient:n.orient},[n.type===t.unref(Ds).ArrowClosed?(t.openBlock(),t.createElementBlock("polyline",{key:0,style:t.normalizeStyle({stroke:n.color,fill:n.color,strokeWidth:n.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):t.createCommentVNode("",!0),n.type===t.unref(Ds).Arrow?(t.openBlock(),t.createElementBlock("polyline",{key:1,style:t.normalizeStyle({stroke:n.color,strokeWidth:n.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):t.createCommentVNode("",!0)],8,wv))}}),Cv={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Sv={name:"MarkerDefinitions",compatConfig:{MODE:3}},Rv=t.defineComponent({...Sv,setup(e){const{id:n,edges:o,connectionLineOptions:i,defaultMarkerColor:a}=ot(),r=t.computed(()=>{const l=new Set,s=[],c=d=>{if(d){const u=Qi(d,n);l.has(u)||(typeof d=="object"?s.push({...d,id:u,color:d.color||a.value}):s.push({id:u,color:a.value,type:d}),l.add(u))}};for(const d of[i.value.markerEnd,i.value.markerStart])c(d);for(const d of o.value)for(const u of[d.markerStart,d.markerEnd])c(u);return s.sort((d,u)=>d.id.localeCompare(u.id))});return(l,s)=>(t.openBlock(),t.createElementBlock("svg",Cv,[t.createElementVNode("defs",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,c=>(t.openBlock(),t.createBlock(vv,{id:c.id,key:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,"stroke-width":c.strokeWidth,orient:c.orient},null,8,["id","type","color","width","height","markerUnits","stroke-width","orient"]))),128))])]))}}),Av={name:"Edges",compatConfig:{MODE:3}},xv=t.defineComponent({...Av,setup(e){const{findNode:n,getEdges:o,elevateEdgesOnSelect:i}=ot();return(a,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Rv),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(o),l=>(t.openBlock(),t.createElementBlock("svg",{key:l.id,class:"vue-flow__edges vue-flow__container",style:t.normalizeStyle({zIndex:t.unref(tI)(l,t.unref(n),t.unref(i))})},[t.createVNode(t.unref(Ev),{id:l.id},null,8,["id"])],4))),128)),t.createVNode(t.unref(Nv))],64))}}),$v=t.defineComponent({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:n,noPanClassName:o,selectNodesOnDrag:i,nodesSelectionActive:a,multiSelectionActive:r,emits:l,removeSelectedNodes:s,addSelectedNodes:c,updateNodeDimensions:d,onUpdateNodeInternals:u,getNodeTypes:m,nodeExtent:f,elevateNodesOnSelect:p,disableKeyboardA11y:y,ariaLiveMessage:g,snapToGrid:b,snapGrid:k,nodeDragThreshold:_,nodesDraggable:h,elementsSelectable:C,nodesConnectable:v,nodesFocusable:S,hooks:N}=ot(),A=t.ref(null);t.provide(Yp,A),t.provide(Gp,e.id);const T=t.inject(Cr),O=t.getCurrentInstance(),z=Xp(),{node:P,parentNode:D}=Jp(e.id),{emit:E,on:R}=_I(P,l),I=t.toRef(()=>typeof P.draggable>"u"?h.value:P.draggable),x=t.toRef(()=>typeof P.selectable>"u"?C.value:P.selectable),$=t.toRef(()=>typeof P.connectable>"u"?v.value:P.connectable),U=t.toRef(()=>typeof P.focusable>"u"?S.value:P.focusable),F=t.computed(()=>x.value||I.value||N.value.nodeClick.hasListeners()||N.value.nodeDoubleClick.hasListeners()||N.value.nodeMouseEnter.hasListeners()||N.value.nodeMouseMove.hasListeners()||N.value.nodeMouseLeave.hasListeners()),B=t.toRef(()=>!!P.dimensions.width&&!!P.dimensions.height),j=t.computed(()=>{const K=P.type||"default",Z=T==null?void 0:T[`node-${K}`];if(Z)return Z;let Q=P.template||m.value[K];if(typeof Q=="string"&&O){const fe=Object.keys(O.appContext.components);fe&&fe.includes(K)&&(Q=t.resolveComponent(K,!1))}return Q&&typeof Q!="string"?Q:(l.error(new vt(_t.NODE_TYPE_MISSING,Q)),!1)}),X=qp({id:e.id,el:A,disabled:()=>!I.value,selectable:x,dragHandle:()=>P.dragHandle,onStart(K){E.dragStart(K)},onDrag(K){E.drag(K)},onStop(K){E.dragStop(K)},onClick(K){V(K)}}),W=t.computed(()=>P.class instanceof Function?P.class(P):P.class),oe=t.computed(()=>{const K=(P.style instanceof Function?P.style(P):P.style)||{},Z=P.width instanceof Function?P.width(P):P.width,Q=P.height instanceof Function?P.height(P):P.height;return!K.width&&Z&&(K.width=typeof Z=="string"?Z:`${Z}px`),!K.height&&Q&&(K.height=typeof Q=="string"?Q:`${Q}px`),K}),de=t.toRef(()=>Number(P.zIndex??oe.value.zIndex??0));return u(K=>{(K.includes(e.id)||!K.length)&&Ie()}),t.onMounted(()=>{t.watch(()=>P.hidden,(K=!1,Z,Q)=>{!K&&A.value&&(e.resizeObserver.observe(A.value),Q(()=>{A.value&&e.resizeObserver.unobserve(A.value)}))},{immediate:!0,flush:"post"})}),t.watch([()=>P.type,()=>P.sourcePosition,()=>P.targetPosition],()=>{t.nextTick(()=>{d([{id:e.id,nodeElement:A.value,forceUpdate:!0}])})}),t.watch([()=>P.position.x,()=>P.position.y,()=>{var K;return(K=D.value)==null?void 0:K.computedPosition.x},()=>{var K;return(K=D.value)==null?void 0:K.computedPosition.y},()=>{var K;return(K=D.value)==null?void 0:K.computedPosition.z},de,()=>P.selected,()=>P.dimensions.height,()=>P.dimensions.width,()=>{var K;return(K=D.value)==null?void 0:K.dimensions.height},()=>{var K;return(K=D.value)==null?void 0:K.dimensions.width}],([K,Z,Q,fe,be,Ee])=>{const Ne={x:K,y:Z,z:Ee+(p.value&&P.selected?1e3:0)};typeof Q<"u"&&typeof fe<"u"?P.computedPosition=Ww({x:Q,y:fe,z:be},Ne):P.computedPosition=Ne},{flush:"post",immediate:!0}),t.watch([()=>P.extent,f],([K,Z],[Q,fe])=>{(K!==Q||Z!==fe)&&ie()}),P.extent==="parent"||typeof P.extent=="object"&&"range"in P.extent&&P.extent.range==="parent"?hs(()=>B).toBe(!0).then(ie):ie(),()=>P.hidden?null:t.h("div",{ref:A,"data-id":P.id,class:["vue-flow__node",`vue-flow__node-${j.value===!1?"default":P.type||"default"}`,{[o.value]:I.value,dragging:X==null?void 0:X.value,draggable:I.value,selected:P.selected,selectable:x.value,parent:P.isParent},W.value],style:{visibility:B.value?"visible":"hidden",zIndex:P.computedPosition.z??de.value,transform:`translate(${P.computedPosition.x}px,${P.computedPosition.y}px)`,pointerEvents:F.value?"all":"none",...oe.value},tabIndex:U.value?0:void 0,role:U.value?"group":void 0,"aria-describedby":y.value?void 0:`${fp}-${n}`,"aria-label":P.ariaLabel,"aria-roledescription":"node",...P.domAttributes,onMouseenter:Le,onMousemove:Se,onMouseleave:ce,onContextmenu:pe,onClick:V,onDblclick:he,onKeydown:L},[t.h(j.value===!1?m.value.default:j.value,{id:P.id,type:P.type,data:P.data,events:{...P.events,...R},selected:P.selected,resizing:P.resizing,dragging:X.value,connectable:$.value,position:P.computedPosition,dimensions:P.dimensions,isValidTargetPos:P.isValidTargetPos,isValidSourcePos:P.isValidSourcePos,parent:P.parentNode,parentNodeId:P.parentNode,zIndex:P.computedPosition.z??de.value,targetPosition:P.targetPosition,sourcePosition:P.sourcePosition,label:P.label,dragHandle:P.dragHandle,onUpdateNodeInternals:Ie})]);function ie(){const K=P.computedPosition,{computedPosition:Z,position:Q}=Hs(P,b.value?vr(K,k.value):K,l.error,f.value,D.value);(P.computedPosition.x!==Z.x||P.computedPosition.y!==Z.y)&&(P.computedPosition={...P.computedPosition,...Z}),(P.position.x!==Q.x||P.position.y!==Q.y)&&(P.position=Q)}function Ie(){A.value&&d([{id:e.id,nodeElement:A.value,forceUpdate:!0}])}function Le(K){X!=null&&X.value||E.mouseEnter({event:K,node:P})}function Se(K){X!=null&&X.value||E.mouseMove({event:K,node:P})}function ce(K){X!=null&&X.value||E.mouseLeave({event:K,node:P})}function pe(K){return E.contextMenu({event:K,node:P})}function he(K){return E.doubleClick({event:K,node:P})}function V(K){x.value&&(!i.value||!I.value||_.value>0)&&Ys(P,r.value,c,s,a,!1,A.value),E.click({event:K,node:P})}function L(K){if(!(Os(K)||y.value))if(hp.includes(K.key)&&x.value){const Z=K.key==="Escape";Ys(P,r.value,c,s,a,Z,A.value)}else I.value&&P.selected&&li[K.key]&&(K.preventDefault(),g.value=`Moved selected node ${K.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~P.position.x}, y: ${~~P.position.y}`,z({x:li[K.key].x,y:li[K.key].y},K.shiftKey))}}});function Tv(e={includeHiddenNodes:!1}){const{nodes:n}=ot();return t.computed(()=>{if(n.value.length===0)return!1;for(const o of n.value)if((e.includeHiddenNodes||!o.hidden)&&((o==null?void 0:o.handleBounds)===void 0||o.dimensions.width===0||o.dimensions.height===0))return!1;return!0})}const Mv={class:"vue-flow__nodes vue-flow__container"},Vv={name:"Nodes",compatConfig:{MODE:3}},Lv=t.defineComponent({...Vv,setup(e){const{getNodes:n,updateNodeDimensions:o,emits:i}=ot(),a=Tv(),r=t.ref();return t.watch(a,l=>{l&&t.nextTick(()=>{i.nodesInitialized(n.value)})},{immediate:!0}),t.onMounted(()=>{r.value=new ResizeObserver(l=>{const s=l.map(c=>({id:c.target.getAttribute("data-id"),nodeElement:c.target,forceUpdate:!0}));t.nextTick(()=>o(s))})}),t.onBeforeUnmount(()=>{var l;return(l=r.value)==null?void 0:l.disconnect()}),(l,s)=>(t.openBlock(),t.createElementBlock("div",Mv,[r.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(n),(c,d,u,m)=>{const f=[c.id];if(m&&m.key===c.id&&t.isMemoSame(m,f))return m;const p=(t.openBlock(),t.createBlock(t.unref($v),{id:c.id,key:c.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return p.memo=f,p},s,0),128)):t.createCommentVNode("",!0)]))}});function Bv(){const{emits:e}=ot();t.onMounted(()=>{if(zp()){const n=document.querySelector(".vue-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.error(new vt(_t.MISSING_STYLES))}})}const Dv=t.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),Ov={name:"VueFlow",compatConfig:{MODE:3}},Pv=t.defineComponent({...Ov,props:{id:{},modelValue:{},nodes:{},edges:{},edgeTypes:{},nodeTypes:{},connectionMode:{},connectionLineType:{},connectionLineStyle:{default:void 0},connectionLineOptions:{default:void 0},connectionRadius:{},isValidConnection:{type:[Function,null],default:void 0},deleteKeyCode:{default:void 0},selectionKeyCode:{type:[Boolean,null],default:void 0},multiSelectionKeyCode:{default:void 0},zoomActivationKeyCode:{default:void 0},panActivationKeyCode:{default:void 0},snapToGrid:{type:Boolean,default:void 0},snapGrid:{},onlyRenderVisibleElements:{type:Boolean,default:void 0},edgesUpdatable:{type:[Boolean,String],default:void 0},nodesDraggable:{type:Boolean,default:void 0},nodesConnectable:{type:Boolean,default:void 0},nodeDragThreshold:{},elementsSelectable:{type:Boolean,default:void 0},selectNodesOnDrag:{type:Boolean,default:void 0},panOnDrag:{type:[Boolean,Array],default:void 0},minZoom:{},maxZoom:{},defaultViewport:{},translateExtent:{},nodeExtent:{},defaultMarkerColor:{},zoomOnScroll:{type:Boolean,default:void 0},zoomOnPinch:{type:Boolean,default:void 0},panOnScroll:{type:Boolean,default:void 0},panOnScrollSpeed:{},panOnScrollMode:{},paneClickDistance:{},zoomOnDoubleClick:{type:Boolean,default:void 0},preventScrolling:{type:Boolean,default:void 0},selectionMode:{},edgeUpdaterRadius:{},fitViewOnInit:{type:Boolean,default:void 0},connectOnClick:{type:Boolean,default:void 0},applyDefault:{type:Boolean,default:void 0},autoConnect:{type:[Boolean,Function],default:void 0},noDragClassName:{},noWheelClassName:{},noPanClassName:{},defaultEdgeOptions:{},elevateEdgesOnSelect:{type:Boolean,default:void 0},elevateNodesOnSelect:{type:Boolean,default:void 0},disableKeyboardA11y:{type:Boolean,default:void 0},edgesFocusable:{type:Boolean,default:void 0},nodesFocusable:{type:Boolean,default:void 0},autoPanOnConnect:{type:Boolean,default:void 0},autoPanOnNodeDrag:{type:Boolean,default:void 0},autoPanSpeed:{}},emits:["nodesChange","edgesChange","nodesInitialized","paneReady","init","updateNodeInternals","error","connect","connectStart","connectEnd","clickConnectStart","clickConnectEnd","moveStart","move","moveEnd","selectionDragStart","selectionDrag","selectionDragStop","selectionContextMenu","selectionStart","selectionEnd","viewportChangeStart","viewportChange","viewportChangeEnd","paneScroll","paneClick","paneContextMenu","paneMouseEnter","paneMouseMove","paneMouseLeave","edgeUpdate","edgeContextMenu","edgeMouseEnter","edgeMouseMove","edgeMouseLeave","edgeDoubleClick","edgeClick","edgeUpdateStart","edgeUpdateEnd","nodeContextMenu","nodeMouseEnter","nodeMouseMove","nodeMouseLeave","nodeDoubleClick","nodeClick","nodeDragStart","nodeDrag","nodeDragStop","miniMapNodeClick","miniMapNodeDoubleClick","miniMapNodeMouseEnter","miniMapNodeMouseMove","miniMapNodeMouseLeave","update:modelValue","update:nodes","update:edges"],setup(e,{expose:n,emit:o}){const i=e,a=t.useSlots(),r=ys(i,"modelValue",o),l=ys(i,"nodes",o),s=ys(i,"edges",o),c=ot(i),d=II({modelValue:r,nodes:l,edges:s},i,c);return CI(o,c.hooks),bv(),Bv(),t.provide(Cr,a),t.onUnmounted(d),n(c),(u,m)=>(t.openBlock(),t.createElementBlock("div",{ref:t.unref(c).vueFlowRef,class:"vue-flow"},[t.createVNode(mv,null,{default:t.withCtx(()=>[t.createVNode(xv),Dv,t.createVNode(Lv),t.renderSlot(u.$slots,"zoom-pane")]),_:3}),t.renderSlot(u.$slots,"default"),t.createVNode(gv)],512))}}),zv={name:"Panel",compatConfig:{MODE:3}},ch=t.defineComponent({...zv,props:{position:{}},setup(e){const n=e,{userSelectionActive:o}=ot(),i=t.computed(()=>`${n.position}`.split("-"));return(a,r)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["vue-flow__panel",i.value]),style:t.normalizeStyle({pointerEvents:t.unref(o)?"none":"all"})},[t.renderSlot(a.$slots,"default")],6))}}),Fv=["width","height","innerHTML"],Uv=t.defineComponent({__name:"EmIcon",props:{name:{},size:{}},setup(e){const n={network:'<rect x="16" y="16" width="6" height="6" rx="1"/><rect x="2" y="16" width="6" height="6" rx="1"/><rect x="9" y="2" width="6" height="6" rx="1"/><path d="M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3"/><path d="M12 12V8"/>',folder:'<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>',table:'<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/><path d="M12 3v18"/>',key:'<path d="m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4"/><path d="m21 2-9.6 9.6"/><circle cx="7.5" cy="15.5" r="5.5"/>',asterisk:'<path d="M12 6v12"/><path d="M17.196 9 6.804 15"/><path d="m6.804 9 10.392 6"/>',link:'<path d="M9 17H7A5 5 0 0 1 7 7h2"/><path d="M15 7h2a5 5 0 1 1 0 10h-2"/><line x1="8" x2="16" y1="12" y2="12"/>',field:'<circle cx="12" cy="12" r="3"/>',method:'<path d="M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1"/><path d="M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1"/>',"arrow-lr":'<path d="M8 3 4 7l4 4"/><path d="M4 7h16"/><path d="m16 21 4-4-4-4"/><path d="M20 17H4"/>',note:'<path d="M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h11l5-5V5a2 2 0 0 0-2-2Z"/><path d="M15 3v4a2 2 0 0 0 2 2h4"/>',chevron:'<path d="m9 18 6-6-6-6"/>',"expand-all":'<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>',"collapse-all":'<path d="m7 20 5-5 5 5"/><path d="m7 4 5 5 5-5"/>',"panel-close":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/><path d="m16 15-3-3 3-3"/>',"panel-open":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M9 3v18"/><path d="m14 9 3 3-3 3"/>',"panel-right-close":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M15 3v18"/><path d="m8 9 3 3-3 3"/>',"panel-right-open":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M15 3v18"/><path d="m10 15-3-3 3-3"/>',eye:'<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"/><circle cx="12" cy="12" r="3"/>',pencil:'<path d="M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"/><path d="m15 5 4 4"/>',undo:'<path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"/>',redo:'<path d="M21 7v6h-6"/><path d="M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7"/>',history:'<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"/><path d="M3 3v5h5"/><path d="M12 7v5l4 2"/>',"add-entity":'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M8 12h8"/><path d="M12 8v8"/>',"auto-layout":'<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>',"file-text":'<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M16 13H8"/><path d="M16 17H8"/><path d="M10 9H8"/>',image:'<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/>',camera:'<path d="M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z"/><circle cx="12" cy="13" r="3"/>',save:'<path d="M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z"/><path d="M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7"/><path d="M7 3v4a1 1 0 0 0 1 1h7"/>',route:'<circle cx="6" cy="19" r="3"/><path d="M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15"/><circle cx="18" cy="5" r="3"/>',grid:'<rect width="18" height="18" x="3" y="3" rx="2"/><path d="M3 9h18"/><path d="M3 15h18"/><path d="M9 3v18"/><path d="M15 3v18"/>',map:'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>',copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',clipboard:'<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>',trash:'<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/>',"alert-circle":'<circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/>',"alert-triangle":'<path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><line x1="12" x2="12" y1="9" y2="13"/><line x1="12" x2="12.01" y1="17" y2="17"/>',info:'<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>',help:'<circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>',lock:'<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/>',unlock:'<rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/>',search:'<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',x:'<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',"fit-view":'<path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/>'};return(o,i)=>(t.openBlock(),t.createElementBlock("svg",{class:"em-icon",width:e.size??16,height:e.size??16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",innerHTML:n[e.name]??""},null,8,Fv))}}),tt=(e,n)=>{const o=e.__vccOpts||e;for(const[i,a]of n)o[i]=a;return o},xe=tt(Uv,[["__scopeId","data-v-e3e720fa"]]),Lo=["red","amber","green","teal","blue","indigo","violet","pink"],dh={red:"em.swatch.red",amber:"em.swatch.amber",green:"em.swatch.green",teal:"em.swatch.teal",blue:"em.swatch.blue",indigo:"em.swatch.indigo",violet:"em.swatch.violet",pink:"em.swatch.pink"};function Hv(e){return typeof e=="string"&&e in dh}const jv={red:0,amber:32,green:145,teal:173,blue:221,indigo:244,violet:262,pink:330},Kv=.15;function Gv(e){const n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!n)return null;let o=n[1];o.length===3&&(o=o[0]+o[0]+o[1]+o[1]+o[2]+o[2]);const i=parseInt(o.slice(0,2),16)/255,a=parseInt(o.slice(2,4),16)/255,r=parseInt(o.slice(4,6),16)/255,l=Math.max(i,a,r),s=Math.min(i,a,r),c=l-s,d=(l+s)/2;let u=0,m=0;return c!==0&&(u=c/(1-Math.abs(2*d-1)),l===i?m=(a-r)/c%6:l===a?m=(r-i)/c+2:m=(i-a)/c+4,m*=60,m<0&&(m+=360)),{h:m,s:u,l:d}}function Yv(e){if(typeof e!="string")return null;const n=Gv(e);if(!n||n.s<Kv)return null;let o=null,i=1/0;for(const a of Lo){const r=Math.abs(n.h-jv[a]),l=Math.min(r,360-r);l<i&&(i=l,o=a)}return o}function Bt(e){var i;const n=(i=e==null?void 0:e.properties)==null?void 0:i.swatch;if(Hv(n))return n;const o=e==null?void 0:e.properties;return Yv((o==null?void 0:o["background-color"])??(o==null?void 0:o["font-color"])??(o==null?void 0:o.color))}function Qs(e){return e?{bar:`var(--em-swatch-${e}-bar)`,barOn:`var(--em-swatch-${e}-on)`,text:`var(--em-swatch-${e}-text)`}:null}const qv={red:"var(--em-swatch-red-bar)",amber:"var(--em-swatch-amber-bar)",green:"var(--em-swatch-green-bar)",teal:"var(--em-swatch-teal-bar)",blue:"var(--em-swatch-blue-bar)",indigo:"var(--em-swatch-indigo-bar)",violet:"var(--em-swatch-violet-bar)",pink:"var(--em-swatch-pink-bar)"},Wv={red:"color-mix(in srgb, var(--em-swatch-red-bar) 22%, transparent)",amber:"color-mix(in srgb, var(--em-swatch-amber-bar) 22%, transparent)",green:"color-mix(in srgb, var(--em-swatch-green-bar) 22%, transparent)",teal:"color-mix(in srgb, var(--em-swatch-teal-bar) 22%, transparent)",blue:"color-mix(in srgb, var(--em-swatch-blue-bar) 22%, transparent)",indigo:"color-mix(in srgb, var(--em-swatch-indigo-bar) 22%, transparent)",violet:"color-mix(in srgb, var(--em-swatch-violet-bar) 22%, transparent)",pink:"color-mix(in srgb, var(--em-swatch-pink-bar) 22%, transparent)"};function uh(e,n=!1){return e?n?Wv[e]:qv[e]:null}function Bo(e){return dh[e]}function di(e){return`var(--em-swatch-${e}-bar)`}function Jv(e){switch(e.split("-")[1]){case"NAME":return"em.check.catName";case"JPA":return"em.check.catJpa";case"TYPE":return"em.check.catType";case"DSN":return"em.check.catDsn";default:return null}}function Xv(e,n){const o=Jv(n);return o?e(o):n.split("-")[1]??n}function Zv(e){var o,i,a;const n=r=>e.params!=null&&r in e.params;switch(e.ruleId){case"CHK-NAME-1":return"em.check.name1";case"CHK-NAME-2":return"em.check.name2";case"CHK-NAME-3":return((o=e.params)==null?void 0:o.reason)==="package"?"em.check.name3Package":"em.check.name3Entity";case"CHK-NAME-4":return e.targetKind==="entity"?"em.check.name4Entity":"em.check.name4Attr";case"CHK-NAME-5":return"em.check.name5";case"CHK-NAME-6":return e.targetKind==="entity"?"em.check.name6Table":e.targetKind==="index"?"em.check.name6Index":"em.check.name6Column";case"CHK-NAME-7":return"em.check.name7";case"CHK-NAME-8":return"em.check.name8";case"CHK-NAME-11":return e.targetKind==="entity"?"em.check.name11Entity":"em.check.name11Attr";case"CHK-NAME-9":return"em.check.name9";case"CHK-NAME-10":return"em.check.name10";case"CHK-JPA-1":return"em.check.jpa1";case"CHK-JPA-2":return"em.check.jpa2";case"CHK-JPA-4":return"em.check.jpa4";case"CHK-JPA-5":return"em.check.jpa5";case"CHK-JPA-7":return"em.check.jpa7";case"CHK-JPA-8":return"em.check.jpa8";case"CHK-JPA-9":return"em.check.jpa9";case"CHK-JPA-10":return"em.check.jpa10";case"CHK-JPA-11":return"em.check.jpa11";case"CHK-JPA-12":return"em.check.jpa12";case"CHK-JPA-13":return n("seq")?"em.check.jpa13Sequence":"em.check.jpa13AutoIncrement";case"CHK-JPA-14":return"em.check.jpa14";case"CHK-JPA-15":return"em.check.jpa15";case"CHK-JPA-16":return"em.check.jpa16";case"CHK-JPA-17":return"em.check.jpa17";case"CHK-JPA-18":return"em.check.jpa18";case"CHK-JPA-19":return"em.check.jpa19";case"CHK-JPA-20":return"em.check.jpa20";case"CHK-JPA-21":return Number(((i=e.params)==null?void 0:i.slots)??0)<Number(((a=e.params)==null?void 0:a.declared)??0)?"em.check.jpa21Missing":"em.check.jpa21Extra";case"CHK-TYPE-1":return"em.check.type1";case"CHK-TYPE-2":return"em.check.type2";case"CHK-TYPE-3":return"em.check.type3";case"CHK-TYPE-4":return"em.check.type4";case"CHK-TYPE-6":return"em.check.type6";case"CHK-TYPE-7":return"em.check.type7";case"CHK-TYPE-8":return"em.check.type8";case"CHK-DSN-1":return"em.check.dsn1";case"CHK-DSN-2":return"em.check.dsn2";case"CHK-DSN-3":return"em.check.dsn3";case"CHK-DSN-4":return"em.check.dsn4";case"CHK-DSN-5":return n("field")?"em.check.dsn5Inherited":"em.check.dsn5Missing";case"CHK-DSN-6":return"em.check.dsn6";case"CHK-DSN-7":return"em.check.dsn7";default:return e.ruleId}}function mh(e,n){const o=Zv(n);if(n.ruleId==="CHK-TYPE-4"){const i=e("em.check.unspecified"),a=n.params??{};return e(o,{type:a.type||i,dataType:a.dataType||i})}return e(o,n.params)}function Qv(e){return e.targetKind==="entity"?e.targetRef:e.contextRef}const eC={class:"em-inline-issue__msgs"},Do=tt(t.defineComponent({__name:"InlineIssueBadge",props:{controller:{},refId:{}},setup(e){const n=e,o=n.controller,i={error:{order:0,icon:"alert-circle"},warning:{order:1,icon:"alert-triangle"},info:{order:2,icon:"info"}},a=t.computed(()=>n.refId?n.controller.issuesByRef.value.get(n.refId)??[]:[]),r=t.computed(()=>{let l=null;for(const s of a.value)(l===null||i[s.severity].order<i[l].order)&&(l=s.severity);return l});return(l,s)=>r.value?(t.openBlock(),t.createElementBlock("p",{key:0,class:t.normalizeClass(["em-inline-issue",`is-${r.value}`])},[t.createVNode(xe,{name:i[r.value].icon,size:13,class:"em-inline-issue__icon"},null,8,["name"]),t.createElementVNode("span",eC,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,(c,d)=>(t.openBlock(),t.createElementBlock("span",{key:d},t.toDisplayString(t.unref(mh)(t.unref(o).t,c)),1))),128))])],2)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-9f959cc0"]]),tC=["id","aria-selected","aria-controls","tabindex","onClick","onKeydown"],nC={key:0,class:"em-mlang__dot"},oC=["id","role","aria-labelledby"],iC=["title"],Qt=tt(t.defineComponent({__name:"MultiLangTextField",props:{modelValue:{},name:{},languages:{default:()=>["ko","en","ja","zh"]},defaultLang:{},multiline:{type:Boolean,default:!1},placeholder:{},height:{},activeLang:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,i=n;function a(){const k=o.defaultLang;return k&&o.languages.includes(k)?k:o.languages[0]??"ko"}const r=t.computed(()=>o.activeLang!==void 0),l=t.ref(a()),s=t.computed(()=>{const k=o.activeLang;return k&&o.languages.includes(k)?k:r.value?o.languages[0]??"ko":l.value});t.watch(()=>[o.languages,o.defaultLang],()=>{o.languages.includes(l.value)||(l.value=a())});function c(k){var _,h;return!!((h=(_=o.modelValue)==null?void 0:_[k])!=null&&h.trim())}const d=k=>`${o.name}-tab-${k}`,u=t.computed(()=>`${o.name}-panel`),m=t.ref(null);async function f(k){var C,v;const _=o.languages,h=_[(k+_.length)%_.length];h&&(l.value=h,await t.nextTick(),(v=(C=m.value)==null?void 0:C.querySelectorAll('[role="tab"]')[_.indexOf(h)])==null||v.focus())}function p(k){f(o.languages.indexOf(s.value)+k)}const y=t.computed(()=>o.languages.filter(k=>{var _,h;return k!==s.value&&!!((h=(_=o.modelValue)==null?void 0:_[k])!=null&&h.trim())})),g=t.computed(()=>{var k;return((k=o.modelValue)==null?void 0:k[s.value])??""});function b(k){const _={...o.modelValue};k.trim()===""?delete _[s.value]:_[s.value]=k,i("update:modelValue",_)}return(k,_)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-mlang",{"is-controlled":r.value}])},[r.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"tabsEl",ref:m,class:"em-mlang__tabs",role:"tablist"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.languages,h=>(t.openBlock(),t.createElementBlock("span",{id:d(h),key:h,class:t.normalizeClass(["em-mlang__tab",{"is-active":s.value===h}]),role:"tab","aria-selected":s.value===h,"aria-controls":u.value,tabindex:s.value===h?0:-1,onClick:C=>l.value=h,onKeydown:[t.withKeys(t.withModifiers(C=>l.value=h,["prevent"]),["enter"]),t.withKeys(t.withModifiers(C=>l.value=h,["prevent"]),["space"]),_[0]||(_[0]=t.withKeys(t.withModifiers(C=>p(-1),["prevent"]),["left"])),_[1]||(_[1]=t.withKeys(t.withModifiers(C=>p(1),["prevent"]),["right"])),_[2]||(_[2]=t.withKeys(t.withModifiers(C=>f(0),["prevent"]),["home"])),_[3]||(_[3]=t.withKeys(t.withModifiers(C=>f(e.languages.length-1),["prevent"]),["end"]))]},[t.createTextVNode(t.toDisplayString(h),1),c(h)?(t.openBlock(),t.createElementBlock("span",nC,"•")):t.createCommentVNode("",!0)],42,tC))),128))],512)),t.createElementVNode("div",{id:u.value,role:r.value?void 0:"tabpanel","aria-labelledby":r.value?void 0:d(s.value)},[e.multiline?(t.openBlock(),t.createBlock(t.unref(ne.BSTextArea),{key:0,name:`${e.name}-${s.value}`,width:"100%",height:e.height??"64px",placeholder:e.placeholder,"model-value":g.value,"onUpdate:modelValue":b},null,8,["name","height","placeholder","model-value"])):(t.openBlock(),t.createBlock(t.unref(ne.BSTextInput),{key:1,name:`${e.name}-${s.value}`,width:"100%",placeholder:e.placeholder,"model-value":g.value,"onUpdate:modelValue":b},null,8,["name","placeholder","model-value"]))],8,oC),r.value&&y.value.length?(t.openBlock(),t.createElementBlock("span",{key:1,class:"em-mlang__others",title:y.value.join(", "),"aria-hidden":"true"},"•",8,iC)):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-9cb21667"]]),aC=["disabled"],rC={class:"em-panel__sub-label"},lC={class:"em-field"},sC={class:"em-field"},cC={class:"em-field"},dC={key:0,class:"em-field"},uC={class:"em-field"},mC={class:"em-class"},fC={class:"em-field"},pC={class:"em-field"},hC={key:1,class:"em-attr__navhint"},yC={key:2,class:"em-field"},gC={key:3,class:"em-field"},bC={class:"em-multilang"},kC={class:"em-multilang"},_C={key:4,class:"em-jpa"},EC={class:"em-field"},NC={class:"em-field"},wC={class:"em-field"},IC=["title"],vC={class:"em-swatch"},CC={class:"em-swatch__row"},SC=["title"],RC=["title","onClick"],fh=tt(t.defineComponent({__name:"EntityBasicsSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean},title:{}},emits:["toggle"],setup(e,{emit:n}){const o=e,i=n,a=o.controller,r=t.computed(()=>a.state.logical.entities.find(B=>B.modelId===o.entityId)??null),l=t.computed(()=>r.value?a.state.layout.entityLayouts.find(B=>B.entityRef===r.value.modelId)??null:null),s=t.computed(()=>{var B;return Bt(((B=l.value)==null?void 0:B.style)??void 0)}),c=["JPA_ENTITY","JPA_EMBEDDABLE","SERIALIZED_TYPE","JPA_MULTI_LANGUAGE_ENTITY","UNDEFINED"],d=["none","LIST","SET","MAP"],u=t.computed(()=>{var B,j;return((j=(B=r.value)==null?void 0:B.serialization)==null?void 0:j.collectionType)??"none"});function m(B){return B==="none"?a.t("em.entity.serializedContainerNone"):B}function f(B){var W,oe;const j=B==="none"?void 0:B,X=j==="MAP"?(oe=(W=r.value)==null?void 0:W.serialization)==null?void 0:oe.mapKeyType:void 0;_({serialization:j?{collectionType:j,...X?{mapKeyType:X}:{}}:null})}function p(B){var X,W;((W=(X=r.value)==null?void 0:X.serialization)==null?void 0:W.collectionType)==="MAP"&&_({serialization:{collectionType:"MAP",...B.trim()?{mapKeyType:B.trim()}:{}}})}const y=[{key:"useVersion",label:"@Version"},{key:"useCacheable",label:"@Cacheable"},{key:"useDynamicInsert",label:"@DynamicInsert"},{key:"useDynamicUpdate",label:"@DynamicUpdate"},{key:"useDiscriminator",label:"@Discriminator"}],g=["inherit","STRING","CHAR","INTEGER"],b=B=>B;function k(B){return B==="inherit"?a.t("em.common.inherit"):B}function _(B){r.value&&a.updateEntity(r.value.modelId,B)}function h(B,j,X){var oe;const W=((oe=r.value)==null?void 0:oe.table)??{physicalName:""};_(B==="physicalName"?{table:{...W,physicalName:X}}:{table:{...W,logicalName:{...W.logicalName,[j]:X}}})}const C=t.computed(()=>{var B;return mn(((B=r.value)==null?void 0:B.stereotype)??"UNDEFINED")});function v(B){var X,W,oe;const j=C.value?(X=r.value)==null?void 0:X.classLogicalName:(oe=(W=r.value)==null?void 0:W.table)==null?void 0:oe.logicalName;return(j==null?void 0:j[B])??""}function S(B,j){var oe;if(!C.value)return h("logicalName",B,j);const X={...(oe=r.value)==null?void 0:oe.classLogicalName,[B]:j},W=Object.fromEntries(Object.entries(X).filter(([,de])=>de!=null&&String(de).trim()!==""));_({classLogicalName:Object.keys(W).length?W:void 0})}function N(B){_({description:Object.keys(B).length?B:void 0})}function A(B,j){var X;_({jpaAttrs:{...(X=r.value)==null?void 0:X.jpaAttrs,[B]:j}})}function T(B,j){A(B,j)}const O=t.computed(()=>{var B,j;return((j=(B=r.value)==null?void 0:B.jpaAttrs)==null?void 0:j.discriminatorType)??"inherit"}),z=t.computed(()=>{var B,j;return!((j=(B=r.value)==null?void 0:B.jpaAttrs)!=null&&j.useDiscriminator)});function P(B){A("discriminatorType",B==="inherit"?void 0:B)}function D(B){_({hasPersonalInfo:B})}function E(B){_({referenceOnly:B?!0:void 0})}function R(B){_({superClass:B.trim()||void 0})}function I(B){_({schema:B.trim()||void 0})}function x(B){_({abstractClass:B})}const $=t.computed(()=>{var B,j;return((j=(B=r.value)==null?void 0:B.declarationOfInterfaces)==null?void 0:j.join(", "))??""});function U(B){const j=B.split(",").map(X=>X.trim()).filter(Boolean);_({declarationOfInterfaces:j.length?j:void 0})}function F(B){r.value&&a.setEntitySwatch(r.value.modelId,B)}return(B,j)=>{var X,W,oe,de;return r.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!t.unref(a).editable.value},[e.collapsible?(t.openBlock(),t.createElementBlock("h4",{key:0,class:"em-panel__sub em-panel__sub--toggle",onClick:j[0]||(j[0]=ie=>i("toggle"))},[t.createElementVNode("span",rC,[t.createVNode(xe,{name:"chevron",size:13,class:t.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"]),t.createTextVNode(" "+t.toDisplayString(e.title||r.value.name||t.unref(a).t("em.entity.fallback")),1)])])):t.createCommentVNode("",!0),!e.collapsible||!e.collapsed?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(Do,{controller:t.unref(a),"ref-id":e.entityId,class:"em-section__issues"},null,8,["controller","ref-id"]),t.createElementVNode("label",lC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.name")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-name",width:"100%","model-value":r.value.name,"onUpdate:modelValue":j[1]||(j[1]=ie=>_({name:ie}))},null,8,["model-value"])]),t.createElementVNode("label",sC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.stereotype")),1),t.createVNode(t.unref(ne.BSSelect),{"model-value":r.value.stereotype,items:c,"value-provider":b,"label-provider":t.unref(gi),"onUpdate:modelValue":j[2]||(j[2]=ie=>_({stereotype:ie}))},null,8,["model-value","label-provider"])]),r.value.stereotype==="SERIALIZED_TYPE"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",cC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.serializedContainer")),1),t.createVNode(t.unref(ne.BSSelect),{name:"ent-ser-container","model-value":u.value,items:d,"value-provider":b,"label-provider":m,"onUpdate:modelValue":j[3]||(j[3]=ie=>ie&&f(ie))},null,8,["model-value"])]),u.value==="MAP"?(t.openBlock(),t.createElementBlock("label",dC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.serializedMapKey")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-ser-mapkey",width:"100%",placeholder:t.unref(a).t("em.entity.serializedMapKeyPlaceholder"),"model-value":((X=r.value.serialization)==null?void 0:X.mapKeyType)??"","onUpdate:modelValue":p},null,8,["placeholder","model-value"])])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0),t.createElementVNode("label",uC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.package")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-package",width:"100%","model-value":r.value.packageName??"","onUpdate:modelValue":j[4]||(j[4]=ie=>_({packageName:ie}))},null,8,["model-value"])]),t.createElementVNode("fieldset",mC,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.entity.classLegend")),1),t.createElementVNode("label",fC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.superClass")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-superclass",width:"100%",placeholder:t.unref(a).t("em.entity.superClassPlaceholder"),"model-value":r.value.superClass??"","onUpdate:modelValue":j[5]||(j[5]=ie=>R(ie))},null,8,["placeholder","model-value"])]),t.createElementVNode("label",pC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.interfaces")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-interfaces",width:"100%",placeholder:t.unref(a).t("em.entity.interfacesPlaceholder"),"model-value":$.value,"onUpdate:modelValue":j[6]||(j[6]=ie=>U(ie))},null,8,["placeholder","model-value"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:"ent-abstract",class:"em-check",label:t.unref(a).t("em.entity.abstractClass"),"model-value":!!r.value.abstractClass,"onUpdate:modelValue":j[7]||(j[7]=ie=>x(ie))},null,8,["label","model-value"])]),t.unref(lt)(r.value.stereotype)?(t.openBlock(),t.createElementBlock("p",hC,t.toDisplayString(t.unref(a).t("em.entity.noOwnTableNote")),1)):(t.openBlock(),t.createElementBlock("label",yC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.tablePhysical")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-table",width:"100%","model-value":((W=r.value.table)==null?void 0:W.physicalName)??"","onUpdate:modelValue":j[8]||(j[8]=ie=>h("physicalName",null,ie))},null,8,["model-value"])])),t.unref(mn)(r.value.stereotype)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",gC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.schema")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"ent-schema",width:"100%",placeholder:t.unref(a).t("em.entity.schemaPlaceholder"),"model-value":r.value.schema??"","onUpdate:modelValue":j[9]||(j[9]=ie=>I(ie))},null,8,["placeholder","model-value"])])),t.createElementVNode("fieldset",bC,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t(C.value?"em.entity.classLogicalLegend":"em.entity.tableLogicalLegend")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a).languages.value,ie=>(t.openBlock(),t.createElementBlock("label",{key:ie,class:"em-lang"},[t.createElementVNode("span",null,t.toDisplayString(ie),1),t.createVNode(t.unref(ne.BSTextInput),{name:`ent-logical-${ie}`,width:"100%","model-value":v(ie),"onUpdate:modelValue":Ie=>S(ie,Ie)},null,8,["name","model-value","onUpdate:modelValue"])]))),128))]),t.createElementVNode("fieldset",kC,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:"ent-desc",languages:t.unref(a).languages.value,"default-lang":t.unref(a).userLanguage.value,"model-value":r.value.description,"onUpdate:modelValue":N},null,8,["languages","default-lang","model-value"])]),t.unref(mn)(r.value.stereotype)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("fieldset",_C,[j[14]||(j[14]=t.createElementVNode("legend",null,"JPA",-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(y,ie=>{var Ie;return t.createVNode(t.unref(ne.BSCheckbox),{key:ie.key,name:`jpa-${ie.key}`,class:"em-check",label:ie.label,"model-value":!!((Ie=r.value.jpaAttrs)!=null&&Ie[ie.key]),"onUpdate:modelValue":Le=>T(ie.key,Le)},null,8,["name","label","model-value","onUpdate:modelValue"])}),64)),t.createElementVNode("label",EC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discColumn")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"disc-col",width:"100%",placeholder:t.unref(a).t("em.entity.discColumnPlaceholder"),disabled:z.value,"model-value":((oe=r.value.jpaAttrs)==null?void 0:oe.discriminatorColumnName)??"","onUpdate:modelValue":j[10]||(j[10]=ie=>A("discriminatorColumnName",ie.trim()||void 0))},null,8,["placeholder","disabled","model-value"])]),t.createElementVNode("label",NC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discType")),1),t.createVNode(t.unref(ne.BSSelect),{disabled:z.value,"model-value":O.value,items:g,"value-provider":b,"label-provider":k,"onUpdate:modelValue":j[11]||(j[11]=ie=>ie&&P(ie))},null,8,["disabled","model-value"])]),t.createElementVNode("label",wC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discLength")),1),t.createVNode(t.unref(ne.BSNumberInput),{name:"disc-len",width:"64px",placeholder:"len",disabled:z.value,"model-value":(de=r.value.jpaAttrs)==null?void 0:de.discriminatorLength,"onUpdate:modelValue":j[12]||(j[12]=ie=>A("discriminatorLength",ie||void 0))},null,8,["disabled","model-value"])])])),t.createVNode(t.unref(ne.BSCheckbox),{name:"ent-personalinfo",class:"em-check em-check--block",label:t.unref(a).t("em.entity.hasPersonalInfo"),"model-value":!!r.value.hasPersonalInfo,"onUpdate:modelValue":D},null,8,["label","model-value"]),t.createElementVNode("div",{class:"em-check--block",title:t.unref(a).t("em.entity.referenceOnlyHint"),"data-ref-only-row":""},[t.createVNode(t.unref(ne.BSCheckbox),{name:"ent-reference-only",class:"em-check",label:t.unref(a).t("em.entity.referenceOnly"),"model-value":!!r.value.referenceOnly,"onUpdate:modelValue":E},null,8,["label","model-value"])],8,IC),t.createElementVNode("fieldset",vC,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.entity.headerColor")),1),t.createElementVNode("div",CC,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":s.value===null}]),title:t.unref(a).t("em.swatch.none"),onClick:j[13]||(j[13]=ie=>F(null))},"∅",10,SC),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),ie=>(t.openBlock(),t.createElementBlock("button",{key:ie,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":s.value===ie}]),style:t.normalizeStyle({background:t.unref(di)(ie)}),title:t.unref(a).t(t.unref(Bo)(ie)),onClick:Ie=>F(ie)},null,14,RC))),128))])])],64)):t.createCommentVNode("",!0)],8,aC)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-e5c28fb1"]]),AC=["none","PASSWORD","SOCIAL_SECURITY_NO","PASSPORT_NO","ALIEN_REGISTRATION_NO","DRIVERS_LICENSE_NO","BIOMETRICS","CREDITCARD_NO","ACCOUNT_NO","MEMBERSHIP_CARD_NO","ID","NAME","DATE_OF_BIRTH","PHONE_NO","EMAIL_ADDRESS","ADDRESS","IP_ADDRESS"],ec=["inherit","true","false"],Vr="__OWN__";function ph(e,n){const o=t.computed(()=>e.state.logical.entities.find(G=>G.modelId===n())??null),i=t.computed(()=>{var G;return lt(((G=o.value)==null?void 0:G.stereotype)??"UNDEFINED")}),a=t.computed(()=>{var G;return mn(((G=o.value)==null?void 0:G.stereotype)??"UNDEFINED")}),r=t.computed(()=>new Set(e.selectedAttrIds.value));function l(G){return G==="none"?e.t("em.common.noneParen"):G}const s=G=>G;function c(G,ae){o.value&&e.updateAttribute(o.value.modelId,G.modelId,ae)}const d=t.computed(()=>sl(e.state.logical.associations));function u(G){if(!o.value)return;const ae=Jn(e.state.logical,o.value.modelId,G.modelId);return ae&&Ta(G,ae)?ae:void 0}function m(G){return!!u(G)}function f(G){return m(G)?G.derivedIdFieldName??"":G.name??""}function p(G){const ae=u(G);if(!ae)return e.t("em.attr.namePlaceholder");const De=new Map(e.state.logical.entities.map(je=>[je.modelId,je]));return Hl({...G,derivedIdFieldName:void 0},ae,De)||e.t("em.attr.namePlaceholder")}function y(G,ae){m(G)?c(G,{derivedIdFieldName:ae||void 0}):c(G,{name:ae})}function g(G){return G.name??""}function b(G,ae){c(G,{name:ae})}function k(G){return!!o.value&&cl(G,o.value,d.value)}function _(G){var je,bt;const ae=(je=G.derivedFrom)==null?void 0:je.associationRef,De=(bt=o.value)==null?void 0:bt.attributes.find(Vt=>{var Ye;return Vt.attrType==="RELATION_OWN"&&((Ye=Vt.derivedFrom)==null?void 0:Ye.associationRef)===ae&&d.value.has(Vt.modelId)});return e.t("em.attr.joinColumnOnlyNote",{anchor:(De==null?void 0:De.name)||e.t("em.attr.nameless")})}function h(G){return!!o.value&&!!Jn(e.state.logical,o.value.modelId,G.modelId)}function C(G,ae){c(G,{naturalId:ae||void 0,naturalIdMutable:ae?G.naturalIdMutable:void 0})}function v(){return{naturalId:void 0,naturalIdMutable:void 0}}function S(G,ae){c(G,{identifier:ae,...ae?v():{}})}function N(G,ae){c(G,{transient:ae||void 0,...ae?v():{}})}const A=["none","LIST","SET"];function T(G,ae){c(G,{collectionType:ae==="none"?void 0:ae})}function O(G){return!!G.transient||G.attrType==="RELATION_REF"}function z(G){return ki(G)}function P(G,ae=0){var De;return((De=ga(G,o.value,e.state.logical.entities,e.state.logical.associations,ae))==null?void 0:De.physicalName)||void 0}function D(G){const ae=kl(G);return ae==="association"||ae==="derived"||!!G.groupCode}const E=G=>G.value,R=G=>G.label;function I(G,ae){if(!ae)return;if(o.value&&pd(G,ae,e.embeddableCatalog.value)){e.convertAttributeType(o.value.modelId,G.modelId,ae);return}const De=Le.value.find(je=>je.type===ae);if(De){const je=G.dbAttrs[0]??{modelId:G.modelId+".c",physicalName:G.name,dataType:"VARCHAR"};c(G,{type:ae,customType:void 0,dbAttrs:[hd(je,De)]});return}c(G,ae===pn?{type:ae}:{type:ae,customType:void 0})}function x(G,ae){c(G,{customType:ae.trim()===""?void 0:ae})}function $(G,ae){if(G.attrType==="RELATION_REF")return;const je={...G.dbAttrs[0]??{modelId:G.modelId+".c",physicalName:G.name,dataType:"VARCHAR"},...ae};ae.dataType!==void 0&&!yl.has(je.dataType)&&(je.scale=void 0),c(G,{dbAttrs:[je]})}function U(G){var ae;return yl.has(((ae=G.dbAttrs[0])==null?void 0:ae.dataType)??"")}function F(G){return!U(G)&&!z(G)&&!O(G)?e.t("em.attr.scaleTypeHint"):void 0}function B(G,ae){$(G,{logicalName:Object.keys(ae).length?ae:void 0})}function j(G,ae){c(G,{fieldLogicalName:Object.keys(ae).length?ae:void 0})}function X(G){var ae;return a.value?G.fieldLogicalName:(ae=G.dbAttrs[0])==null?void 0:ae.logicalName}function W(G,ae){a.value?j(G,ae):B(G,ae)}function oe(G,ae){const De=e.t("em.attr.logicalPlaceholder"),je=G.dbAttrs[0];if(a.value||!je)return De;const bt=Lt(G,je,0,o.value??void 0,e.state.logical,{embeddableCatalog:e.embeddableCatalog.value}).logicalName;return Ct(bt,ae)??De}function de(G,ae){c(G,{description:Object.keys(ae).length?ae:void 0})}function ie(G){return G.personalInfoAttributeType??"none"}function Ie(G,ae){c(G,{personalInfoAttributeType:ae==="none"?void 0:ae})}const Le=t.computed(()=>e.predefinedCustomTypeCatalog.value),Se=t.computed(()=>[...Go(e.state.logical).keys()].sort()),ce=t.computed(()=>e.embeddableCatalog.value);function pe(G){return Ct(G.label,e.userLanguage.value)??G.type}const he=t.computed(()=>e.groupCodeCatalog.value);function V(G){var ae;return((ae=he.value.find(De=>De.groupCode===G.groupCode))==null?void 0:ae.codes)??[]}function L(G){return["none",...V(G)]}function K(G){return G==="none"?"none":G.code}function Z(G){if(G==="none")return e.t("em.common.noneParen");const ae=Ct(G.label,e.userLanguage.value);return ae?`${G.code} (${ae})`:G.code}function Q(G,ae){o.value&&e.setAttributeGroupCode(o.value.modelId,G.modelId,ae)}function fe(G,ae){c(G,{defaultValue:ae==="none"?void 0:ae})}function be(G,ae){c(G,{defaultValue:ae.trim()===""?void 0:ae})}function Ee(G){return G.attrType.startsWith("EMBED")&&G.dbAttrs.length>0}const Ne=vn;function J(G){return Ee(G)||Ne(G)}function ee(G,ae,De){const je=G.dbAttrs.map((bt,Vt)=>{if(Vt!==ae)return bt;const Ye={...bt,...De};for(const Ue of Object.keys(De))De[Ue]===void 0&&delete Ye[Ue];return Ye});o.value&&e.setEmbedColumns(o.value.modelId,G.modelId,je)}function te(G,ae,De){ee(G,ae,{logicalName:Object.keys(De).length?De:void 0})}function ge(G,ae){var bt,Vt,Ye;if(Ne(G)){const Ue=ga(G,o.value,e.state.logical.entities,e.state.logical.associations,ae);return Ue?{physicalName:Ue.physicalName,dataType:Ue.dataType,length:Ue.length,scale:Ue.scale,logicalName:Ue.logicalName}:void 0}if(G.attrType==="EMBED_PREDEF"){const Ue=(bt=e.embeddableCatalog.value.find(w=>w.type===G.type))==null?void 0:bt.fields[ae];return Ue?{name:Ue.name,physicalName:Ue.physicalName,dataType:Ue.dataType,length:Ue.length,scale:Ue.scale,shareable:Ue.shareable,logicalName:Ue.logicalName}:void 0}const De=(Vt=G.embedded)==null?void 0:Vt.embeddableRef;if(!De)return;const je=(Ye=e.state.logical.entities.find(Ue=>Ue.modelId===De))==null?void 0:Ye.attributes.flatMap(Ue=>Ue.dbAttrs)[ae];return je?{physicalName:je.physicalName,dataType:je.dataType,length:je.length,scale:je.scale,logicalName:je.logicalName}:void 0}function Re(G,ae){var De,je;return((De=ge(G,ae))==null?void 0:De.dataType)||((je=G.dbAttrs[ae])==null?void 0:je.dataType)||""}function Pe(G,ae){var De,je;return((De=ge(G,ae))==null?void 0:De.length)??((je=G.dbAttrs[ae])==null?void 0:je.length)}function Me(G,ae){var De,je;return((De=ge(G,ae))==null?void 0:De.scale)??((je=G.dbAttrs[ae])==null?void 0:je.scale)}function Qe(G){return e.t(Ne(G)?"em.attr.fkFixedHint":"em.attr.embedFixedHint")}const Ot=ec;function ht(G){return G==="inherit"?e.t("em.common.inherit"):G}function re(G){return(G==null?void 0:G.updatable)===void 0?"inherit":G.updatable?"true":"false"}function ve(G,ae,De){ee(G,ae,{updatable:De==="inherit"?void 0:De==="true"})}function le(G,ae){$(G,{updatable:ae==="inherit"?void 0:ae==="true"})}const me=ec;function ke(G){return G==="inherit"?e.t("em.common.inherit"):G}function Ze(G){return(G==null?void 0:G.notNull)===void 0||(G==null?void 0:G.notNull)===null?"inherit":G.notNull?"true":"false"}function ct(G,ae,De){ee(G,ae,{notNull:De==="inherit"?void 0:De==="true"})}const ft=ec;function qe(G){return G==="inherit"?e.t("em.common.inherit"):G}function Rt(G){return(G==null?void 0:G.insertable)===void 0?"inherit":G.insertable?"true":"false"}function et(G,ae,De){ee(G,ae,{insertable:De==="inherit"?void 0:De==="true"})}function jt(G,ae){$(G,{insertable:ae==="inherit"?void 0:ae==="true"})}const Nt=t.computed(()=>o.value?pl(o.value,e.state.logical.entities):[]),ut=t.computed(()=>mo(Nt.value.flatMap(G=>G.attributes.flatMap(ae=>ae.dbAttrs)))),yt=t.computed(()=>Nt.value.flatMap(G=>G.attributes.filter(ae=>ae.attrType==="NORMAL"&&ae.dbAttrs.length===1&&ae.dbAttrs[0]).map(ae=>{var De;return{modelId:ae.dbAttrs[0].modelId,physical:ae.dbAttrs[0].physicalName||ae.name,isCurrency:ae.type==="Currency",ownerName:G.modelId===((De=o.value)==null?void 0:De.modelId)?void 0:G.name}})));function At(){const G=[...yt.value].sort((ae,De)=>Number(De.isCurrency)-Number(ae.isCurrency));return[Vr,...G.map(ae=>ae.modelId)]}function jn(G){if(G===Vr)return e.t("em.attr.sharedOwn");const ae=yt.value.find(je=>je.modelId===G);if(!ae)return G;const De=ae.ownerName?`${ae.ownerName}.`:"";return e.t("em.attr.sharedRef",{owner:De,physical:ae.physical,mode:ae.isCurrency?e.t("em.attr.currencyMode"):e.t("em.attr.sharedMode")})}function mt(G){return(G==null?void 0:G.sharedColumnRef)??Vr}function ze(G,ae,De){ee(G,ae,{sharedColumnRef:De===Vr?void 0:De})}function Y(G){return(G==null?void 0:G.sharedColumnRef)!=null}function Wt(G){var ae;return((ae=fo(G,ut.value))==null?void 0:ae.physicalName)??""}return{SERIALIZED_FIELD_CONTAINERS:A,setCollectionType:T,entity:o,isValueType:i,isColumnless:a,focusedAttrIds:r,personalInfoItems:AC,piiLabel:l,idn:s,setAttr:c,isDerivedIdRow:m,rowName:f,rowNamePlaceholder:p,setRowName:y,assocFieldName:g,setAssocFieldName:b,nameLocked:k,nameLockedHint:_,isManagedFk:h,setNaturalId:C,clearNaturalIdPatch:v,setIdentifier:S,setTransient:N,dbLocked:O,fkDerived:z,fkOriginPhysical:P,typeLocked:D,typeValueOf:E,typeLabelOf:R,setAttrType:I,setAttrCustomType:x,setDb:$,scaleApplicable:U,scaleHint:F,setDbLogical:B,setAttrLogical:j,logicalNameOf:X,setLogicalName:W,setAttrDescription:de,attrPiiValue:ie,setAttrPii:Ie,predefinedCustomTypeCatalog:Le,serializedTypeNames:Se,embeddableCatalog:ce,predefinedLabel:pe,groupCodeCatalog:he,attrGroupCodes:V,attrCodeItems:L,codeValueOf:K,codeLabelOf:Z,setAttrGroupCode:Q,setAttrCode:fe,setAttrDefaultValue:be,isEmbedExpanded:Ee,isMultiColFk:Ne,hasColumnSlots:J,setDbAt:ee,setDbLogicalAt:te,logicalPlaceholder:oe,colSlotMeta:ge,fixedDataType:Re,fixedLength:Pe,fixedScale:Me,slotFixedHint:Qe,updatableItems:Ot,updatableLabel:ht,updatableValue:re,setUpdatableAt:ve,setUpdatable:le,insertableItems:ft,insertableLabel:qe,insertableValue:Rt,setInsertableAt:et,notNullItems:me,notNullLabel:ke,notNullValue:Ze,setNotNullAt:ct,setInsertable:jt,scopeEntities:Nt,columnsById:ut,sharedCandidates:yt,sharedItems:At,sharedLabel:jn,sharedValue:mt,setSharedAt:ze,isShared:Y,sharedPhysical:Wt}}const hh={"em.mode.view":"View","em.mode.edit":"Edit","em.mode.frozen":"Editing locked (conflict)","em.mode.frozenTitle":"Editing is locked due to a concurrent-edit conflict. Reloading the latest content.","em.mode.readonlyTitle":"This diagram is read-only","em.toolbar.undo":"Undo","em.toolbar.redo":"Redo","em.toolbar.displayLabel":"Show","em.toolbar.routingToggle":"Toggle connector mode","em.toolbar.routingOrthogonal":"Orthogonal","em.toolbar.routingStraight":"Straight","em.toolbar.grid":"Grid","em.toolbar.gridOn":"Show grid","em.toolbar.gridOff":"Hide grid","em.toolbar.minimap":"Minimap","em.toolbar.minimapOn":"Show minimap","em.toolbar.minimapOff":"Hide minimap","em.toolbar.fitView":"Fit to view","em.toolbar.exportText":"Export (Text · Mermaid)","em.toolbar.exportSvg":"Export SVG","em.toolbar.exportPng":"Export PNG","em.toolbar.import":"Import (paste text)","em.toolbar.history":"History","em.toolbar.historyOpen":"Open change history","em.toolbar.historyClose":"Close change history","em.toolbar.shortcuts":"Keyboard shortcuts (?)","em.displayMode.logical":"Logical","em.displayMode.physical":"Physical","em.displayMode.logicalPhysical":"Logical · Physical","em.displayMode.class":"Class","em.panel.resizeWidth":"Resize width","em.panel.collapse":"Collapse","em.panel.expand":"Expand","em.panel.collapseAll":"Collapse all","em.panel.expandAll":"Expand all","em.panel.lockedBanner":"Locked — move, edit, and delete are blocked","em.panel.openNamed":"Open {name}","em.notice.readOnly":"Editing is not available in view mode","em.notice.entityLocked":"This entity is locked — unlock it to edit","em.notice.groupLocked":"This group is locked — unlock it to edit","em.notice.assocLocked":"This association touches a locked entity — unlock it to edit","em.validation.title":"Validation","em.validation.noIssues":"No validation issues.","em.validation.noVisibleIssues":"No issues to show (filter applied).","em.validation.checkOrphanEntities":"Check entities without relations","em.validation.nameless":"(no name)","em.validation.severityError":"Errors","em.validation.severityWarning":"Warnings","em.validation.severityInfo":"Info","em.validation.hideSeverity":"Hide {label}","em.validation.showSeverity":"Show {label}","em.validation.expandPanel":"Expand validation panel","em.validation.quickFix":"Fix","em.validation.quickFixTip":"Apply automatic fix (undoable)","em.common.close":"Close","em.common.save":"Save","em.export.title":"Export","em.export.formatText":"Logical model text","em.export.formatMermaidEr":"Mermaid (ER)","em.export.formatMermaidClass":"Mermaid (Class)","em.export.formatDdl":"SQL DDL (PostgreSQL)","em.export.formatJson":"JSON (backup)","em.export.copy":"Copy","em.export.download":"Download","em.export.copied":"Copied to clipboard.","em.export.copyFailed":"Failed to copy.","em.import.title":"Import","em.import.placeholder":"Paste SQL DDL, Mermaid ER, or a JSON backup.","em.import.formatGroup":"Input format","em.import.formatAuto":"Auto-detect","em.import.formatMermaid":"Mermaid ER","em.import.formatDdl":"SQL DDL","em.import.formatJson":"JSON","em.import.detected":"Detected: {format}","em.import.summary":"{entities} entities · {relations} relations","em.import.warnings":"{n} warning(s) (partial parse)","em.import.error":"Parse failed: {message}","em.import.emptyParse":"No entities recognized.","em.import.unknownFormat":"Could not detect format — pick one above.","em.import.confirm":"Import","em.import.commentLocale":"Comment locale","em.import.commentLocaleUnset":"Unset — logical names skipped","em.import.commentEvidence":"{n} comments — Korean (hangul) {hangul} · Japanese (kana) {kana} · undecidable {undecidable}","em.import.commentCertain":"{locale} confirmed","em.import.commentMixed":"Mixed — import one locale at a time","em.import.commentUnknown":"Undecidable — pick if you know the source language","em.import.commentMarker":"Locale declared by the text: {locale}","em.shortcuts.title":"Keyboard shortcuts","em.shortcuts.groupEdit":"Edit","em.shortcuts.groupMove":"Move · Arrange","em.shortcuts.groupExplorer":"Explorer","em.shortcuts.descExplorerSearch":"Focus explorer search","em.shortcuts.descExplorerNav":"Move through tree (←→ collapse/expand)","em.shortcuts.descExplorerSelect":"Select item + center canvas","em.shortcuts.descExplorerDetail":"Open entity detail editor","em.shortcuts.groupOther":"Other","em.shortcuts.keyArrows":"Arrow keys","em.shortcuts.keyRightClick":"Right-click","em.shortcuts.descUndo":"Undo","em.shortcuts.descRedo":"Redo","em.shortcuts.descCopy":"Copy selection","em.shortcuts.descPaste":"Paste","em.shortcuts.descDelete":"Delete selection (same as Backspace)","em.shortcuts.descMove1":"Move selected node 1px","em.shortcuts.descMove10":"Move selected node 10px","em.shortcuts.descAttrFocus":"Move focus when an attribute is selected","em.shortcuts.descAttrReorder":"Reorder attribute up/down","em.shortcuts.descContextMenu":"Context menu (add entity·note, etc.)","em.shortcuts.descInlineConfirm":"Confirm inline edit","em.shortcuts.descCloseEdit":"Close edit·menu","em.shortcuts.descOpenHelp":"Open this help","em.shortcuts.descCommandPalette":"Command palette (go to · run command)","em.opSource.title":"Body — {name}()","em.opSource.placeholder":"// Java implementation code","em.entity.name":"Name","em.entity.stereotype":"Stereotype","em.entity.package":"Package","em.panel.unlock":"Unlock","em.entity.fallback":"Entity","em.group.fallback":"Group","em.common.description":"Description","em.common.memo":"Memo","em.common.color":"Color","em.common.add":"Add","em.common.inherit":"Default (inherit)","em.common.noneParen":"(none)","em.swatch.none":"None","em.swatch.red":"Red","em.swatch.amber":"Orange","em.swatch.green":"Green","em.swatch.teal":"Teal","em.swatch.blue":"Blue","em.swatch.indigo":"Indigo","em.swatch.violet":"Violet","em.swatch.pink":"Pink","em.inspector.ctxEntityAttrs":"Entity · {name} › Attributes · {n}","em.inspector.ctxEntityDivider":"Entity · {name} › Divider","em.inspector.ctxEntityAttr":"Entity · {name} › Attribute · {attr}","em.inspector.ctxEntity":"Entity · {name}","em.inspector.ctxAssoc":"Relation · {a} — {b}","em.inspector.ctxGroup":"Group · {name}","em.inspector.ctxNote":"Note","em.inspector.ctxNone":"No selection","em.assoc.identifying":"identifying (identifying relation)","em.assoc.selfNoIdentifying":"A self-association cannot be an identifying relation (non-identifying FK enforced).","em.assoc.embedNoIdentifying":"Embedded (@Embedded/@ElementCollection) cannot be an identifying relation (an embeddable has no independent identifier).","em.assoc.multiplicity":"Multiplicity","em.assoc.navFieldName":"Field name (nav)","em.assoc.cascadeAllNote":"ALL already includes every individual cascade (CHK-JPA-5).","em.assoc.orphanRemovalNote":"The opposite end is a collection (@ManyToOne/@ManyToMany), so orphanRemoval has no effect (CHK-JPA-14).","em.assoc.navRequiredNote":"This direction has no nav property (navigable off), so cascade and fetch do not apply.","em.assoc.ownerNavFixed":"The JPA owning-side reference (@ManyToOne) is inherent to the relation and always on — model a reference-less FK as a plain column instead.","em.assoc.orderByPlaceholder":"e.g. name ASC","em.assoc.jpaDetails":"JPA details","em.embed.legend":"Embedded","em.embed.cardinality":"Cardinality","em.embed.card1":"1 (required @Embedded)","em.embed.card01":"0..1 (optional @Embedded)","em.embed.card0N":"0..* (collection @ElementCollection)","em.embed.collectionTablePlaceholder":"Codegen fallback if unset","em.embed.orderColumnPlaceholder":"Order not preserved if unset","em.embed.ownerFixedNote":"An embeddable is flattened into its owner, so the owner-side end (multiplicity·navigable·composition) is structurally fixed and not shown.","em.group.nameLegend":"Group name","em.group.excludeDDL":"Exclude from DDL generation","em.group.members":"{n} member entities","em.entity.classLegend":"Class","em.entity.superClass":"Superclass","em.entity.superClassPlaceholder":"e.g. BaseEntity","em.entity.interfaces":"Implemented interfaces","em.entity.interfacesPlaceholder":"Comma-separated (e.g. Serializable, Cloneable)","em.entity.abstractClass":"Abstract class","em.entity.tablePhysical":"Table (physical)","em.entity.schema":"Schema","em.entity.schemaPlaceholder":"e.g. sales, master","em.entity.tableLogicalLegend":"Table logical name","em.entity.classLogicalLegend":"Class logical name","em.entity.discColumn":"Discriminator column","em.entity.discColumnPlaceholder":"e.g. DTYPE","em.entity.discType":"Discriminator type","em.entity.discLength":"Discriminator length","em.entity.hasPersonalInfo":"Contains personal info (hasPersonalInfo)","em.entity.referenceOnly":"Reference only (not a generation or validation target)","em.entity.referenceOnlyHint":"For entities that are not deliverables — background material, scratch drafts. No DDL, Java code or mermaid is generated and validation skips them (they stay in the AI input text). Different from a group’s “Exclude from DDL generation”, which is for real tables owned by another service and still generates Java classes.","em.entity.headerColor":"Header color","em.attr.section":"Attributes ({n})","em.attr.addEmbeddable":"Add embeddable","em.attr.nameless":"(no name)","em.attr.selectHint":"Select an attribute above to show its edit form.","em.attr.inverseNavHint":"Inverse association field — no physical column (references the target entity).","em.attr.fkDerivedNote":"Derived from a foreign key — its shape follows the parent PK; change it on the association line or identifying relationship.","em.attr.scaleTypeHint":"Scale (fractional digits) applies only to NUMERIC and DECIMAL types.","em.attr.embedFixedHint":"Fixed by the embeddable definition.","em.attr.fkFixedHint":"Inherited from the parent PK column — its shape follows the parent.","em.attr.embedSharedHint":"Currency column shared with another column — derived from the target (read-only).","em.attr.derivedIdField":"Derived @Id field","em.attr.assocField":"Association field (@MapsId)","em.attr.derivedIdNote":"This attribute emits **two Java fields** — the name box above is the scalar @Id field (leave empty to derive it from the parent PK column), and this is the @MapsId association field. The same value is also editable from the relationship inspector.","em.attr.joinColumnOnlyNote":"Sibling column of a composite foreign key — JPA emits one field per association, so this name is never generated. Edit the field name on «{anchor}».","em.attr.namePlaceholder":"Name","em.attr.typePlaceholder":"Type","em.attr.customTypePlaceholder":"Custom type name","em.attr.logicalPlaceholder":"Logical name","em.attr.columnPlaceholder":"Column","em.attr.defaultValue":"Default value","em.attr.codeGroup":"Code group","em.attr.currencyColumn":"Currency column","em.attr.pii":"Personal info","em.attr.colFallback":"Column {n}","em.attr.sharedOwn":"Own column (OWN)","em.attr.sharedRef":"↗ {owner}{physical} ({mode})","em.attr.currencyMode":"currency","em.attr.sharedMode":"shared","em.attr.batchHint":"{n} selected · bulk","em.attr.fkDeleteHint":"Foreign keys are derived from associations — delete the association line instead","em.attr.embedConvertPkBlocked":"An identifier attribute cannot be converted to an embeddable with a different column count — changing the PK shape breaks child FKs that mirror it","em.op.section":"Operations ({n})","em.op.namePlaceholder":"Operation name","em.op.editBodyDirty":"Edit body ●","em.op.editBody":"Edit body","em.index.section":"Indexes ({n})","em.index.inherited":"{field} (inherited)","em.index.namePlaceholder":"Index name","em.index.addColumn":"Column","em.index.condition":"Condition (partial index)","em.index.conditionPlaceholder":"e.g. WHERE status = 'A'","em.groupCode.searchPlaceholder":"Search / select code group","em.groupCode.noMatch":"No matching code group","em.detail.tabBasics":"Basics","em.detail.tabColumns":"Attributes","em.detail.tabIndexes":"Indexes","em.detail.tabOperations":"Operations","em.detail.title":"Entity — {name}","em.attr.addDivider":"Divider","em.attr.columnPhysical":"Column (physical)","em.attr.constraints":"Constraints","em.attr.dividerLabelPlaceholder":"Divider label (optional)","em.attr.dividerNote":"── divider ──","em.attr.detailCollapse":"Collapse details","em.attr.detailExpand":"Expand details","em.attr.semanticLegend":"Semantics","em.attr.embedChildCols":"Embeddable — {n} child columns","em.attr.fkChildCols":"Composite foreign key — {n} columns","em.attr.overrideCollapse":"Collapse overrides","em.attr.overrideExpand":"Expand overrides","em.attr.overrideLegend":"Column overrides","em.attr.empty":"No attributes — create with 'Add'","em.op.body":"Body","em.op.bodyDirty":"Body ●","em.op.empty":"No operations — create with 'Add'","em.index.delete":"Delete index","em.index.empty":"No indexes — create with 'Add'","em.index.conditionPlaceholderWide":"e.g. WHERE status = 'A' AND deleted = false","em.index.inheritedColTitle":"Superclass inherited column","em.index.inheritedBadge":"inherited","em.index.colUnspecified":"{name} (column unspecified of {n})","em.index.multiColumn":"{name} ({n} columns)","em.index.unnamedAttr":"(unnamed)","em.index.availColumns":"Available columns ({n})","em.index.indexColumns":"Index columns ({n})","em.index.allColumnsUsed":"All columns used","em.index.addArrow":"Add →","em.index.moveUp":"Move up","em.index.moveDown":"Move down","em.index.removeColumn":"Remove","em.index.noColumns":"No columns — add from the left","em.index.selectPrompt":"Select or add an index.","em.palette.autoLayout":"Auto layout","em.cmd.title":"Command palette","em.cmd.placeholder":"Jump to an entity or run a command…","em.cmd.sectionGoto":"Go to","em.cmd.sectionActions":"Commands","em.cmd.empty":"No matches","em.cmd.groupTag":"Group","em.canvas.emptyTitle":"This diagram is empty","em.canvas.emptyHint":"<strong>Right-click</strong> the canvas or use the bottom-left <strong>+</strong> button to add your first entity.","em.canvas.emptyConnectHint":"Once you have two or more entities, <strong>drag</strong> from an entity edge to connect them with a relationship.","em.canvas.emptyShortcutHint":"Press <kbd>?</kbd> for keyboard shortcuts","em.canvas.emptyReadonly":"No entities to show","em.canvas.exportFailed":"Export failed","em.conflict.lockedTitle":"Editing is locked","em.conflict.missingDetail":"Your changes could not be saved (server or network error). Reload the latest content.","em.conflict.changedDetail":"This diagram was changed elsewhere, so editing is locked. Reload the latest content.","em.conflict.commandFailedDetail":"The edit could not be processed, so what you see is out of sync. Your saved content is unaffected — reload the latest content.","em.conflict.reloadingDetail":"Reloading the latest content. Please wait.","em.ctx.addEntity":"Add entity","em.ctx.addNote":"Add note","em.ctx.addGroup":"Add group","em.ctx.paste":"Paste","em.ctx.copy":"Copy","em.ctx.copyN":"Copy ({n})","em.ctx.editDetail":"Edit details…","em.ctx.viewDetail":"View details…","em.ctx.lock":"Lock","em.ctx.ungroup":"Ungroup","em.ctx.deleteNote":"Delete note","em.ctx.addAttr":"Add attribute","em.ctx.colorN":"Color ({n})","em.ctx.pasteAttr":"Paste attributes","em.ctx.pasteAttrN":"Paste attributes ({n})","em.ctx.deleteAttr":"Delete attribute","em.ctx.deleteAttrN":"Delete attributes ({n})","em.ctx.addOperation":"Add operation","em.ctx.deleteOperation":"Delete operation","em.ctx.addMethod":"Add method","em.ctx.groupInto":"Group together","em.ctx.addSelfAssoc":"Add self-association","em.ctx.addEmbeddableNamed":"Add embeddable: {label}","em.ctx.ungroupEntity":"Remove from group","em.ctx.deleteEntity":"Delete entity","em.ctx.clearWaypoints":"Clear bends","em.ctx.deleteConnection":"Delete connection","em.ctx.deleteAssociation":"Delete relation","em.node.keyPfk":"PFK (identifying foreign key)","em.node.keyPk":"PK (primary key)","em.node.keyFk":"FK (foreign key)","em.node.required":"Required (NOT NULL)","em.node.logicalMissing":"(logical name)","em.node.editLock":"Editing locked","em.node.connectHint":"Drag to connect a relationship to another entity","em.node.connectHintNode":"Drag to connect a relationship (anchored to the whole entity)","em.node.derivedIdRow":"Scalar @Id field emitted by a derived identifier (@MapsId). The model stores a single association attribute; edit it from that attribute’s inspector.","em.node.embedRepeatedShow":"Show {count} column(s) collapsed as identical within this entity","em.node.embedRepeatedHide":"Collapse columns repeated with the same value","em.node.embedAttrHide":"Collapse this embedded column group","em.node.embedAttrShow":"Show {count} collapsed embedded column(s)","em.node.embedAllHide":"Collapse every sub-column in this entity","em.node.embedAllShow":"Expand all collapsed sub-columns","em.node.embedAllSummary":"{n} sub-column(s) hidden","em.node.opsSummaryTitle":"{n} operations — expanded in Class display mode","em.node.opsSummary":"{n} operations","em.node.addAttr":"+ Attribute","em.node.addDivider":"+ Divider","em.group.ddlExcludeBadge":"DDL excluded","em.toolbar.referenceOnlyBadge":"Reference-only document","em.toolbar.referenceOnlyDocHint":"This entire document is not a generation or validation target. DDL, Java and mermaid exports come out empty and no validation signals appear — because it is out of scope, not because the model is empty (it stays in the AI input text). The dashed node borders on the canvas mean the same thing.","em.explorer.groupFallback":"(group)","em.explorer.associations":"Relations ({n})","em.explorer.notes":"Notes ({n})","em.explorer.emptyNote":"(empty note)","em.explorer.diagram":"Diagram","em.explorer.searchPlaceholder":"Search entities · attributes ( / )","em.explorer.treeAria":"Diagram tree","em.explorer.searchAria":"Search entities and attributes","em.explorer.clearSearchAria":"Clear search","em.explorer.clearSearchTitle":"Clear (Esc)","em.explorer.noMatches":"No matching entities or attributes","em.history.title":"Change history","em.history.refresh":"Refresh","em.history.loading":"Loading history…","em.history.loadError":"Failed to load history.","em.history.emptyLoaded":"No change history to show.","em.history.emptyNotLoaded":"Load history.","em.history.filterAll":"All","em.history.kindEdit":"Edit","em.history.kindRestore":"Restored","em.history.verbAdd":"Added","em.history.verbUpdate":"Updated","em.history.verbRemove":"Removed","em.history.assocFallback":"Relation","em.history.groupSubject":"Group {name}","em.history.noteSubject":"Note {name}","em.history.emptyValue":"(empty)","em.history.noChange":"No changes","em.history.summaryAdd":"{name} added","em.history.summaryRemove":"{name} removed","em.history.summaryFields":"{name} — {n} changes","em.history.summaryMore":"{summary} and {n} more","em.history.restoreFailed":"Restore failed: {reason}","em.history.unknown":"Unknown","em.history.confirmRestore":"Revert to this point.","em.history.doRestore":"Restore","em.history.cancel":"Cancel","em.history.restoreToHere":"Restore to this point","em.history.diff.compare":"Compare with current","em.history.diff.current":"current","em.history.diff.exit":"Exit comparison","em.history.diff.count":"{n} net change(s)","em.history.diff.empty":"No net changes in this range.","em.history.diff.restorePreview":"{n} change(s) will be rolled back","em.history.diff.restorePreviewNone":"Nothing to roll back.","em.history.loadMore":"Show older ({n})","em.history.periodLabel":"Period","em.history.periodFrom":"From","em.history.periodTo":"To","em.history.periodReset":"Clear period","em.check.catName":"Naming","em.check.catJpa":"JPA","em.check.catType":"Type","em.check.catDsn":"Design","em.check.name1":'Duplicate attribute name: "{name}"',"em.check.name2":'Duplicate column physical name: "{name}"',"em.check.name3Entity":'Duplicate entity name: "{name}" — another entity shares this name. JPA registers entity names across the whole persistence unit, so splitting packages (groups) will not resolve it',"em.check.name3Package":'Duplicate entity name: "{name}" — the same name exists in the same package. Rename it, or split the group (package)',"em.check.name4Entity":"Entity name is empty","em.check.name4Attr":"Attribute name is empty","em.check.name11Entity":'entity name "{name}" breaks the Java class convention (PascalCase) — codegen emits this name verbatim as the class name',"em.check.name11Attr":'attribute name "{name}" breaks the Java field convention (lowerCamelCase) — codegen emits this name verbatim as the field name',"em.check.name5":"Physical name exceeds {max} characters ({len}) — it may be truncated in some databases","em.check.name6Column":'Column physical name is a SQL reserved word: "{name}"',"em.check.name6Table":'Table physical name is a SQL reserved word: "{name}"',"em.check.name6Index":'Index name is a SQL reserved word: "{name}"',"em.check.name7":"the relation/embed attribute ({attrType}) has no name — the name is the JPA field name, so codegen omits this relationship entirely. Fill in the attribute name","em.check.name8":'attribute "{name}" has no column physical name — DDL and codegen omit this column entirely. Fill in the physical name',"em.check.name9":'two entities map to the same table "{name}" — their columns collide in one table. Give them distinct table physical names',"em.check.name10":'duplicate index name: "{name}" — index names must be unique across the whole DB schema',"em.entity.valueTypeSwitchEmbedded":'"{name}" is currently embedded by {owners} entit(y/ies), so it cannot be switched directly between a serialized type and an embeddable — remove the embedded attributes first (a serialized type is referenced by type, not by a relation)',"em.attr.serializedNoColumnNote":"A serialized type has no per-field physical columns — it is serialized whole into a single column on the consuming attribute","em.attr.serializedContainer":"Container","em.attr.serializedContainerNone":"None (single value)","em.entity.noOwnTableNote":"A value type has no table of its own — an embeddable is flattened into the owner table, and a serialized type is serialized into a single column on the consuming attribute","em.entity.serializedTypeHasRelations":'"{name}" participates in {count} relationship(s), so it cannot be turned into a serialized type — remove those relationships first (a serialized type is referenced by an attribute type, not by a relationship)',"em.entity.serializedContainer":"Container","em.entity.serializedContainerNone":"none (single value)","em.entity.serializedMapKey":"Map key type","em.entity.serializedMapKeyPlaceholder":"e.g. PromoType (unset → codegen emits a placeholder Object + fill-in)","em.entity.noIndexNote":"A serialized type cannot have indexes — an index is placed on columns, and this type is serialized whole into a single column on the consuming attribute","em.check.jpa1":"JPA entity has no identifier (PK) attribute","em.check.jpa2":'A value type (embeddable / 직렬화 타입) cannot have an identifier attribute: "{name}"',"em.check.jpa4":"Identifying relationship cycle (PK depends on itself infinitely): {path}","em.check.jpa5":"{which}: cascade ALL is redundant with individual cascades (ALL includes them all)","em.check.jpa7":"{which}: EAGER fetch on a collection (to-many) association is a performance risk","em.check.jpa8":"JPA entity has no table physical name set","em.check.jpa9":"{which}: collection metadata (collectionType/collectionTable/orderColumn) is meaningless on a to-one association — @ElementCollection applies only to collections","em.check.jpa10":"{which}: a SET collection does not preserve order, so orderColumn (@OrderColumn) is meaningless","em.check.jpa11":"An embed (@Embedded/@ElementCollection) cannot be an identifying relationship — embeddables have no independent identifier","em.check.jpa12":'An identifier (@Id) attribute cannot be transient (@Transient): "{name}"',"em.check.jpa13AutoIncrement":'Auto increment can only be used on an identifier (@Id) attribute — it is set on non-identifier attribute "{name}"',"em.check.jpa13Sequence":'A sequence ("{seq}") can only be used on an identifier (@Id) attribute — it is set on non-identifier attribute "{name}"',"em.check.jpa14":"{which}: orphanRemoval cannot be applied to a @ManyToOne/@ManyToMany association (the other end is a collection) — it is valid only on @OneToOne/@OneToMany","em.check.jpa15":'An identifier (@Id) attribute cannot be a natural id (@NaturalId) — a natural id is a business key distinct from the PK: "{name}"',"em.check.jpa16":'A natural id (@NaturalId) attribute cannot be transient (@Transient): "{name}"',"em.check.jpa17":'A natural id (@NaturalId) attribute should be not null (business keys are non-null by principle): "{name}"',"em.check.jpa18":"cascade is set on both ends of the relationship, so operations propagate both ways — risk of unintended cascading persist/remove or cascade cycles. cascade is usually placed on one side only","em.check.jpa19":"the parent has a collection/reference field but the child ({child}) has no matching relation attribute, so mappedBy cannot be resolved — codegen skips this relationship. Add an FK attribute on the child or make the relationship unidirectional","em.check.jpa20":'a composite PK (@IdClass/@EmbeddedId) cannot use generation (@GeneratedValue) — it is set on attribute "{name}"',"em.check.jpa21Missing":'embedded "{name}" has fewer columns than the embeddable ({embeddable}) declares — {slots} slots / {declared} declared. Columns added later are not reflected and are dropped from the DDL (JPA maps columns per the embeddable declaration)',"em.check.jpa21Extra":'embedded "{name}" has more columns than the embeddable ({embeddable}) declares — {slots} slots / {declared} declared. Columns removed from the embeddable linger and emit DDL columns that no longer exist',"em.check.type1":'Column type not supported by the target DB: "{dataType}"',"em.check.type2":"No length specified for type {dataType}","em.check.type3":"The shared target column type ({targetType}) differs from the {metaName} definition ({metaType})","em.check.type4":"A Multi-Value attribute gets an auto-generated converter only for the GroupCodeEnum + VARCHAR combination — currently ({type} / {dataType}) only a Set<…> field is generated and the mapping may be incomplete","em.check.type6":'the column of attribute "{name}" has no data type — DDL omits this column',"em.check.type7":"The Java type ({type}) and the column type ({dataType}) are not compatible — the codegen field and the DDL column are emitted with different types","em.check.type8":"A nullable column ({dataType}) is mapped to a primitive type ({type}) — reading a NULL from the DB throws at load time. Mark it NOT NULL or switch to the boxed type ({boxed})","em.check.dsn1":"A both-many (M:N) relationship is connected directly without a join entity — consider introducing an association entity","em.check.dsn2":"Entity has no attributes","em.check.dsn3":"No modeled relationship (not part of any association, inheritance, or embedding — ignore if intentional)","em.check.dsn4":"Has {count} attributes (over the threshold of {threshold}) — consider decomposing","em.check.dsn5Inherited":'Index "{name}" references an inherited column not found in the superclass catalog ({field}).',"em.check.dsn5Missing":'Index "{name}" references a column that does not exist.',"em.check.dsn6":'index "{name}" has no columns — an index without columns is not emitted in DDL or codegen',"em.check.dsn7":'index "{name}" lists the same column more than once — the repeated entries have no effect',"em.check.unspecified":"unspecified"},yh={"em.mode.view":"閲覧","em.mode.edit":"編集","em.mode.frozen":"編集ロック(競合)","em.mode.frozenTitle":"同時編集の競合により編集がロックされています。最新の内容を再読み込み中です。","em.mode.readonlyTitle":"このダイアグラムは閲覧専用です","em.toolbar.undo":"元に戻す","em.toolbar.redo":"やり直し","em.toolbar.displayLabel":"表示","em.toolbar.routingToggle":"接続線モード切替","em.toolbar.routingOrthogonal":"直角","em.toolbar.routingStraight":"直線","em.toolbar.grid":"グリッド","em.toolbar.gridOn":"グリッド表示","em.toolbar.gridOff":"グリッド非表示","em.toolbar.minimap":"ミニマップ","em.toolbar.minimapOn":"ミニマップ表示","em.toolbar.minimapOff":"ミニマップ非表示","em.toolbar.fitView":"全体表示","em.toolbar.exportText":"エクスポート(テキスト · Mermaid)","em.toolbar.exportSvg":"SVG エクスポート","em.toolbar.exportPng":"PNG エクスポート","em.toolbar.import":"インポート(テキスト貼り付け)","em.toolbar.history":"履歴","em.toolbar.historyOpen":"変更履歴を開く","em.toolbar.historyClose":"変更履歴を閉じる","em.toolbar.shortcuts":"キーボードショートカット (?)","em.displayMode.logical":"論理","em.displayMode.physical":"物理","em.displayMode.logicalPhysical":"論理・物理","em.displayMode.class":"クラス","em.panel.resizeWidth":"幅を調整","em.panel.collapse":"折りたたむ","em.panel.expand":"展開","em.panel.collapseAll":"すべて折りたたむ","em.panel.expandAll":"すべて展開","em.panel.lockedBanner":"編集ロック — 移動・編集・削除は不可","em.panel.openNamed":"{name} を開く","em.notice.readOnly":"照会モードでは編集できません","em.notice.entityLocked":"このエンティティはロックされています — 解除してから編集してください","em.notice.groupLocked":"このグループはロックされています — 解除してから編集してください","em.notice.assocLocked":"ロックされたエンティティに接続された関連です — 解除してから編集してください","em.validation.title":"検証","em.validation.noIssues":"検証の問題はありません。","em.validation.noVisibleIssues":"表示する問題はありません(フィルター適用中)。","em.validation.checkOrphanEntities":"関連のないエンティティを検査","em.validation.nameless":"(名前なし)","em.validation.severityError":"エラー","em.validation.severityWarning":"警告","em.validation.severityInfo":"情報","em.validation.hideSeverity":"{label} を非表示","em.validation.showSeverity":"{label} を表示","em.validation.expandPanel":"検証パネルを展開","em.validation.quickFix":"修正","em.validation.quickFixTip":"自動修正を適用(元に戻せます)","em.common.close":"閉じる","em.common.save":"保存","em.export.title":"エクスポート","em.export.formatText":"論理モデルテキスト","em.export.formatMermaidEr":"Mermaid (ER)","em.export.formatMermaidClass":"Mermaid (クラス)","em.export.formatDdl":"SQL DDL (PostgreSQL)","em.export.formatJson":"JSON (バックアップ)","em.export.copy":"コピー","em.export.download":"ダウンロード","em.export.copied":"クリップボードにコピーしました。","em.export.copyFailed":"コピーに失敗しました。","em.import.title":"インポート","em.import.placeholder":"SQL DDL・Mermaid ER・JSON バックアップを貼り付けてください。","em.import.formatGroup":"入力形式","em.import.formatAuto":"自動判定","em.import.formatMermaid":"Mermaid ER","em.import.formatDdl":"SQL DDL","em.import.formatJson":"JSON","em.import.detected":"判定: {format}","em.import.summary":"エンティティ {entities} · 関連 {relations}","em.import.warnings":"警告 {n}件(部分パース)","em.import.error":"パース失敗: {message}","em.import.emptyParse":"認識されたエンティティがありません。","em.import.unknownFormat":"フォーマットを判定できませんでした — 上で選択してください。","em.import.confirm":"インポート","em.import.commentLocale":"コメントロケール","em.import.commentLocaleUnset":"未指定 — 論理名は取り込まない","em.import.commentEvidence":"COMMENT {n}件 — 韓国語(ハングル) {hangul} · 日本語(かな) {kana} · 判別不可 {undecidable}","em.import.commentCertain":"{locale} 確定","em.import.commentMixed":"混在 — ロケールごとに分けて取り込みを推奨","em.import.commentUnknown":"判別不可 — 原文の言語が分かる人が指定","em.import.commentMarker":"テキストが示すロケール: {locale}","em.shortcuts.title":"キーボードショートカット","em.shortcuts.groupEdit":"編集","em.shortcuts.groupMove":"移動・整列","em.shortcuts.groupExplorer":"エクスプローラー","em.shortcuts.descExplorerSearch":"エクスプローラー検索へフォーカス","em.shortcuts.descExplorerNav":"ツリー移動(←→ 折りたたみ・展開)","em.shortcuts.descExplorerSelect":"項目を選択+キャンバス移動","em.shortcuts.descExplorerDetail":"エンティティ詳細編集を開く","em.shortcuts.groupOther":"その他","em.shortcuts.keyArrows":"矢印キー","em.shortcuts.keyRightClick":"右クリック","em.shortcuts.descUndo":"元に戻す","em.shortcuts.descRedo":"やり直し","em.shortcuts.descCopy":"選択をコピー","em.shortcuts.descPaste":"貼り付け","em.shortcuts.descDelete":"選択項目を削除(Backspace と同じ)","em.shortcuts.descMove1":"選択ノードを1px移動","em.shortcuts.descMove10":"選択ノードを10px移動","em.shortcuts.descAttrFocus":"属性選択時にフォーカス移動","em.shortcuts.descAttrReorder":"属性の順序を上下","em.shortcuts.descContextMenu":"コンテキストメニュー(エンティティ・ノート追加など)","em.shortcuts.descInlineConfirm":"インライン編集を確定","em.shortcuts.descCloseEdit":"編集・メニューを閉じる","em.shortcuts.descOpenHelp":"このヘルプを開く","em.shortcuts.descCommandPalette":"コマンドパレット(移動・コマンド実行)","em.opSource.title":"本文 — {name}()","em.opSource.placeholder":"// Java 実装コード","em.entity.name":"名前","em.entity.stereotype":"ステレオタイプ","em.entity.package":"パッケージ","em.panel.unlock":"ロック解除","em.entity.fallback":"エンティティ","em.group.fallback":"グループ","em.common.description":"説明","em.common.memo":"メモ","em.common.color":"色","em.common.add":"追加","em.common.inherit":"デフォルト(継承)","em.common.noneParen":"(なし)","em.swatch.none":"なし","em.swatch.red":"赤","em.swatch.amber":"オレンジ","em.swatch.green":"緑","em.swatch.teal":"青緑","em.swatch.blue":"青","em.swatch.indigo":"藍","em.swatch.violet":"紫","em.swatch.pink":"ピンク","em.inspector.ctxEntityAttrs":"エンティティ · {name} › 属性 · {n}件","em.inspector.ctxEntityDivider":"エンティティ · {name} › 区切り線","em.inspector.ctxEntityAttr":"エンティティ · {name} › 属性 · {attr}","em.inspector.ctxEntity":"エンティティ · {name}","em.inspector.ctxAssoc":"関連 · {a} — {b}","em.inspector.ctxGroup":"グループ · {name}","em.inspector.ctxNote":"ノート","em.inspector.ctxNone":"選択項目なし","em.assoc.identifying":"identifying(識別関連)","em.assoc.selfNoIdentifying":"自己関連は識別関連にできません(非識別 FK を強制)。","em.assoc.embedNoIdentifying":"埋め込み(@Embedded/@ElementCollection)は識別関連にできません(埋め込み可能クラスは独立した識別子を持ちません)。","em.assoc.multiplicity":"多重度","em.assoc.navFieldName":"関連フィールド名(nav)","em.assoc.cascadeAllNote":"ALL は個別の cascade をすべて含みます(CHK-JPA-5)。","em.assoc.orphanRemovalNote":"相手側がコレクション(@ManyToOne/@ManyToMany)のため orphanRemoval は無効です(CHK-JPA-14)。","em.assoc.navRequiredNote":"この方向に nav プロパティがない(navigable オフ)ため cascade・fetch は適用されません。","em.assoc.ownerNavFixed":"JPA 所有側参照(@ManyToOne)はリレーションの存在と同義で常にオンです — 参照なしの FK はリレーションではなく通常のカラムとしてモデリングしてください。","em.assoc.orderByPlaceholder":"例: name ASC","em.assoc.jpaDetails":"JPA 詳細","em.embed.legend":"埋め込み","em.embed.cardinality":"カーディナリティ","em.embed.card1":"1(必須 @Embedded)","em.embed.card01":"0..1(任意 @Embedded)","em.embed.card0N":"0..*(コレクション @ElementCollection)","em.embed.collectionTablePlaceholder":"未指定時はコード生成のフォールバック","em.embed.orderColumnPlaceholder":"未指定時は順序を保持しません","em.embed.ownerFixedNote":"埋め込み可能クラスは所有者にフラット化されるため、所有者側の end(多重度・navigable・composition)は構造的に固定であり表示しません。","em.group.nameLegend":"グループ名","em.group.excludeDDL":"DDL 生成から除外","em.group.members":"メンバーエンティティ {n}件","em.entity.classLegend":"クラス","em.entity.superClass":"親クラス","em.entity.superClassPlaceholder":"例: BaseEntity","em.entity.interfaces":"実装インターフェース","em.entity.interfacesPlaceholder":"カンマ区切り(例: Serializable, Cloneable)","em.entity.abstractClass":"抽象クラス","em.entity.tablePhysical":"テーブル(物理)","em.entity.schema":"スキーマ","em.entity.schemaPlaceholder":"例: sales, master","em.entity.tableLogicalLegend":"テーブル論理名","em.entity.classLogicalLegend":"クラス論理名","em.entity.discColumn":"Discriminator カラム名","em.entity.discColumnPlaceholder":"例: DTYPE","em.entity.discType":"Discriminator タイプ","em.entity.discLength":"Discriminator 長さ","em.entity.hasPersonalInfo":"個人情報を含む(hasPersonalInfo)","em.entity.referenceOnly":"参考専用(生成・検証の対象外)","em.entity.referenceOnlyHint":"成果物ではないエンティティ(理解のための資料・テスト下書きなど)。DDL・Java コード・mermaid を生成せず、検証の対象からも外れます(AI 入力テキストには残ります)。グループの「DDL 生成から除外」とは別です — あちらは他サービスが所有する実在テーブル向けで、Java クラスは生成され続けます。","em.entity.headerColor":"ヘッダー色","em.attr.section":"属性 ({n})","em.attr.addEmbeddable":"埋め込み追加","em.attr.nameless":"(名前なし)","em.attr.selectHint":"上のリストから属性を選択すると編集フォームが表示されます。","em.attr.inverseNavHint":"逆方向の関連フィールド — 物理カラムはありません(対象エンティティを参照)。","em.attr.fkDerivedNote":"外部キー(FK)から派生したカラムです — 形状は親のPKに従います。変更は関連線・識別関連で行ってください。","em.attr.scaleTypeHint":"小数部(scale)はNUMERIC・DECIMAL型にのみ適用されます。","em.attr.embedFixedHint":"埋め込み型の定義で固定された値です。","em.attr.fkFixedHint":"親のPKカラムから継承された値です — 形状は親に従います。","em.attr.embedSharedHint":"他のカラムと共有する通貨カラムです — 対象から派生(読み取り専用)。","em.attr.derivedIdField":"派生識別 @Id フィールド","em.attr.assocField":"関連フィールド名(@MapsId)","em.attr.derivedIdNote":"この属性は**2つの Java フィールド**を出力します — 上の名前欄はスカラー @Id のフィールド名(空欄なら親 PK の物理名から派生)で、こちらは @MapsId 関連フィールド名です。同じ値は関連線のインスペクタからも編集できます。","em.attr.joinColumnOnlyNote":"複合外部キーの兄弟カラムです — JPAのフィールドは関連ごとに1つだけなので、この名前は出力されません。フィールド名は«{anchor}»で編集してください。","em.attr.namePlaceholder":"名前","em.attr.typePlaceholder":"タイプ","em.attr.customTypePlaceholder":"カスタムタイプ名","em.attr.logicalPlaceholder":"論理名","em.attr.columnPlaceholder":"カラム","em.attr.defaultValue":"デフォルト値","em.attr.codeGroup":"コードグループ","em.attr.currencyColumn":"通貨カラム","em.attr.pii":"個人情報","em.attr.colFallback":"カラム {n}","em.attr.sharedOwn":"専用カラム(OWN)","em.attr.sharedRef":"↗ {owner}{physical}({mode})","em.attr.currencyMode":"通貨","em.attr.sharedMode":"共有","em.attr.batchHint":"選択 {n}件 一括","em.attr.fkDeleteHint":"外部キーは関連から派生します — 関連線を削除してください","em.attr.embedConvertPkBlocked":"識別子属性は列数が変わる埋め込み型には変換できません — PK の形が変わると、それを写す子の FK が崩れます","em.op.section":"オペレーション ({n})","em.op.namePlaceholder":"オペレーション名","em.op.editBodyDirty":"本文編集 ●","em.op.editBody":"本文編集","em.index.section":"インデックス ({n})","em.index.inherited":"{field}(継承)","em.index.namePlaceholder":"インデックス名","em.index.addColumn":"カラム","em.index.condition":"条件(partial index)","em.index.conditionPlaceholder":"例: WHERE status = 'A'","em.groupCode.searchPlaceholder":"コードグループ検索/選択","em.groupCode.noMatch":"一致するコードグループがありません","em.detail.tabBasics":"基本","em.detail.tabColumns":"属性","em.detail.tabIndexes":"インデックス","em.detail.tabOperations":"オペレーション","em.detail.title":"エンティティ — {name}","em.attr.addDivider":"区切り線","em.attr.columnPhysical":"カラム(物理)","em.attr.constraints":"制約","em.attr.dividerLabelPlaceholder":"区切り線ラベル(任意)","em.attr.dividerNote":"── 視覚区切り ──","em.attr.detailCollapse":"詳細を折りたたむ","em.attr.detailExpand":"詳細を展開","em.attr.semanticLegend":"意味","em.attr.embedChildCols":"埋め込み可能 — 子カラム {n}件","em.attr.fkChildCols":"複合外部キー — カラム {n}件","em.attr.overrideCollapse":"オーバーライドを折りたたむ","em.attr.overrideExpand":"オーバーライドを展開","em.attr.overrideLegend":"カラムオーバーライド","em.attr.empty":"属性なし — 「追加」で作成","em.op.body":"本文","em.op.bodyDirty":"本文 ●","em.op.empty":"オペレーションなし — 「追加」で作成","em.index.delete":"インデックス削除","em.index.empty":"インデックスなし — 「追加」で作成","em.index.conditionPlaceholderWide":"例: WHERE status = 'A' AND deleted = false","em.index.inheritedColTitle":"スーパークラス継承カラム","em.index.inheritedBadge":"継承","em.index.colUnspecified":"{name} (カラム{n}個のうち未指定)","em.index.multiColumn":"{name} (カラム{n}個)","em.index.unnamedAttr":"(名称なし)","em.index.availColumns":"利用可能カラム ({n})","em.index.indexColumns":"インデックスカラム ({n})","em.index.allColumnsUsed":"全カラム使用済み","em.index.addArrow":"追加 →","em.index.moveUp":"上へ","em.index.moveDown":"下へ","em.index.removeColumn":"削除","em.index.noColumns":"カラムなし — 左から追加","em.index.selectPrompt":"インデックスを選択または追加してください。","em.palette.autoLayout":"自動配置","em.cmd.title":"コマンドパレット","em.cmd.placeholder":"エンティティへ移動、またはコマンド実行…","em.cmd.sectionGoto":"移動","em.cmd.sectionActions":"コマンド","em.cmd.empty":"一致する項目がありません","em.cmd.groupTag":"グループ","em.canvas.emptyTitle":"空のダイアグラムです","em.canvas.emptyHint":"キャンバスを<strong>右クリック</strong>するか、左下の<strong>+</strong>ボタンで最初のエンティティを追加してください。","em.canvas.emptyConnectHint":"エンティティを2つ以上作成すると、エンティティの端から<strong>ドラッグ</strong>して関連を接続できます。","em.canvas.emptyShortcutHint":"ショートカットのヘルプは<kbd>?</kbd>キー","em.canvas.emptyReadonly":"表示するエンティティがありません","em.canvas.exportFailed":"エクスポートに失敗しました","em.conflict.lockedTitle":"編集がロックされました","em.conflict.missingDetail":"変更を保存できませんでした(サーバーまたはネットワークエラー)。最新の内容を再読み込みしてください。","em.conflict.changedDetail":"他の場所で変更されたため、編集がロックされました。最新の内容を再読み込みしてください。","em.conflict.commandFailedDetail":"編集を処理できず、表示内容が食い違っています。保存済みの内容はそのままです。最新の内容を再読み込みしてください。","em.conflict.reloadingDetail":"最新の内容を再読み込みしています。しばらくお待ちください。","em.ctx.addEntity":"エンティティ追加","em.ctx.addNote":"ノート追加","em.ctx.addGroup":"グループ追加","em.ctx.paste":"貼り付け","em.ctx.copy":"コピー","em.ctx.copyN":"コピー ({n})","em.ctx.editDetail":"詳細編集…","em.ctx.viewDetail":"詳細表示…","em.ctx.lock":"ロック","em.ctx.ungroup":"グループ解除","em.ctx.deleteNote":"ノート削除","em.ctx.addAttr":"属性追加","em.ctx.colorN":"色 ({n})","em.ctx.pasteAttr":"属性貼り付け","em.ctx.pasteAttrN":"属性貼り付け ({n})","em.ctx.deleteAttr":"属性削除","em.ctx.deleteAttrN":"属性削除 ({n})","em.ctx.addOperation":"オペレーション追加","em.ctx.deleteOperation":"オペレーション削除","em.ctx.addMethod":"メソッド追加","em.ctx.groupInto":"グループ化","em.ctx.addSelfAssoc":"自己関連追加","em.ctx.addEmbeddableNamed":"埋め込み追加: {label}","em.ctx.ungroupEntity":"グループから外す","em.ctx.deleteEntity":"エンティティ削除","em.ctx.clearWaypoints":"折れ線を解除","em.ctx.deleteConnection":"接続削除","em.ctx.deleteAssociation":"関連削除","em.node.keyPfk":"PFK(識別外部キー)","em.node.keyPk":"PK(主キー)","em.node.keyFk":"FK(外部キー)","em.node.required":"必須(NOT NULL)","em.node.logicalMissing":"(論理名)","em.node.editLock":"編集ロック","em.node.connectHint":"ドラッグして他のエンティティと関連を接続","em.node.connectHintNode":"ドラッグして関連を接続(エンティティ全体を始点に)","em.node.derivedIdRow":"派生識別(@MapsId)が出力するスカラー @Id フィールドです — モデルには関連属性ひとつとして保存され、編集はその属性のインスペクタで行います。","em.node.embedRepeatedShow":"このエンティティ内で値が同じため折りたたまれた列 {count} 件を表示","em.node.embedRepeatedHide":"値が同じで繰り返される列を折りたたむ","em.node.embedAttrHide":"この埋め込み列グループを折りたたむ","em.node.embedAttrShow":"折りたたまれた埋め込み列 {count} 件を表示","em.node.embedAllHide":"このエンティティのサブカラムをすべて折りたたむ","em.node.embedAllShow":"折りたたまれたサブカラムをすべて展開","em.node.embedAllSummary":"サブカラム {n} 件を非表示","em.node.opsSummaryTitle":"オペレーション {n}件 — クラス表示モードで展開されます","em.node.opsSummary":"オペレーション {n}件","em.node.addAttr":"+ 属性","em.node.addDivider":"+ 区切り線","em.group.ddlExcludeBadge":"DDL 除外","em.toolbar.referenceOnlyBadge":"参考専用ドキュメント","em.toolbar.referenceOnlyDocHint":"このドキュメント全体が生成・検証の対象ではありません。DDL・Java・mermaid の書き出しは空になり検証シグナルも出ません — モデルが空だからではなく対象外だからです(AI 入力テキストには残ります)。キャンバスの破線枠も同じ意味です。","em.explorer.groupFallback":"(グループ)","em.explorer.associations":"関連 ({n})","em.explorer.notes":"ノート ({n})","em.explorer.emptyNote":"(空のノート)","em.explorer.diagram":"ダイアグラム","em.explorer.searchPlaceholder":"エンティティ・属性検索 ( / )","em.explorer.treeAria":"ダイアグラムツリー","em.explorer.searchAria":"エンティティ・属性検索","em.explorer.clearSearchAria":"検索語をクリア","em.explorer.clearSearchTitle":"クリア (Esc)","em.explorer.noMatches":"一致するエンティティ・属性がありません","em.history.title":"変更履歴","em.history.refresh":"更新","em.history.loading":"履歴を読み込み中…","em.history.loadError":"履歴を読み込めませんでした。","em.history.emptyLoaded":"表示する変更履歴がありません。","em.history.emptyNotLoaded":"履歴を読み込んでください。","em.history.filterAll":"すべて","em.history.kindEdit":"編集","em.history.kindRestore":"復元","em.history.verbAdd":"追加","em.history.verbUpdate":"変更","em.history.verbRemove":"削除","em.history.assocFallback":"関連","em.history.groupSubject":"グループ {name}","em.history.noteSubject":"ノート {name}","em.history.emptyValue":"(空)","em.history.noChange":"変更なし","em.history.summaryAdd":"{name} 追加","em.history.summaryRemove":"{name} 削除","em.history.summaryFields":"{name} {n}件変更","em.history.summaryMore":"{summary} 他 {n}件","em.history.restoreFailed":"復元失敗: {reason}","em.history.unknown":"不明","em.history.confirmRestore":"この時点に戻します。","em.history.doRestore":"復元","em.history.cancel":"キャンセル","em.history.restoreToHere":"この時点に復元","em.history.diff.compare":"現在と比較","em.history.diff.current":"現在","em.history.diff.exit":"比較を解除","em.history.diff.count":"累積変更 {n}件","em.history.diff.empty":"この区間に累積変更はありません。","em.history.diff.restorePreview":"巻き戻される変更 {n}件","em.history.diff.restorePreviewNone":"巻き戻される変更はありません。","em.history.loadMore":"以前の記録をもっと見る ({n})","em.history.periodLabel":"期間","em.history.periodFrom":"開始日","em.history.periodTo":"終了日","em.history.periodReset":"期間クリア","em.check.catName":"名前","em.check.catJpa":"JPA","em.check.catType":"型","em.check.catDsn":"設計","em.check.name1":'属性名が重複しています: "{name}"',"em.check.name2":'カラム物理名が重複しています: "{name}"',"em.check.name3Entity":'エンティティ名が重複しています: "{name}" — 同名のエンティティが他にもあります。JPA はエンティティ名を永続化ユニット全体に登録するため、パッケージ(グループ)を分けても解消しません',"em.check.name3Package":'エンティティ名が重複しています: "{name}" — 同じパッケージに同じ名前があります。名前を変えるか、グループ(パッケージ)を分けると解消します',"em.check.name4Entity":"エンティティ名が空です","em.check.name4Attr":"属性名が空です","em.check.name11Entity":"エンティティ名「{name}」がJavaクラス規約(PascalCase)から外れています — コード生成はこの名前をそのままクラス名として出力します","em.check.name11Attr":"属性名「{name}」がJavaフィールド規約(lowerCamelCase)から外れています — コード生成はこの名前をそのままフィールド名として出力します","em.check.name5":"物理名が{max}文字を超えています({len}文字)— 一部のDBで切り詰められる可能性があります","em.check.name6Column":'カラム物理名がSQL予約語です: "{name}"',"em.check.name6Table":'テーブル物理名がSQL予約語です: "{name}"',"em.check.name6Index":'インデックス名がSQL予約語です: "{name}"',"em.check.name7":"関係/埋め込み属性({attrType})の名前が空です — 名前がそのまま JPA フィールド名になるため、コード生成でこの関係が丸ごと欠落します。属性名を入力してください","em.check.name8":"属性「{name}」のカラム物理名が空です — DDL・コード生成でこのカラムが丸ごと欠落します。物理名を入力してください","em.check.name9":"2つのエンティティが同じテーブル「{name}」にマッピングされています — カラムが1つのテーブルに混在します。テーブル物理名を分けてください","em.check.name10":"インデックス名が重複しています:「{name}」 — インデックス名は DB スキーマ全体で一意である必要があります","em.entity.valueTypeSwitchEmbedded":'"{name}" は現在 {owners} 件のエンティティに組み込まれているため、シリアライズ型と組込み可能の間を直接切り替えられません — 先に組込み属性を整理してください(シリアライズ型は関係ではなく型参照で指定されます)',"em.attr.serializedNoColumnNote":"シリアライズ型はフィールドごとの物理カラムを持ちません — 利用側属性の単一カラムにまとめてシリアライズされます","em.attr.serializedContainer":"コンテナ","em.attr.serializedContainerNone":"なし (単一値)","em.entity.noOwnTableNote":"値型は自身のテーブルを持ちません — 組込み可能は所有者テーブルに展開され、シリアライズ型は利用側属性の単一カラムにシリアライズされます","em.entity.serializedTypeHasRelations":'"{name}" は {count} 件の関連に参加しているためシリアライズ型に変更できません — 先に関連を整理してください(シリアライズ型は関係ではなく属性の型参照で指定されます)',"em.entity.serializedContainer":"コンテナ","em.entity.serializedContainerNone":"なし(単一値)","em.entity.serializedMapKey":"Map キー型","em.entity.serializedMapKeyPlaceholder":"例: PromoType(未指定ならコード生成が仮の Object + 手入力箇所を出す)","em.entity.noIndexNote":"シリアライズ型はインデックスを持てません — インデックスはカラムに張られますが、この型は利用側属性の単一カラムにまとめてシリアライズされます","em.check.jpa1":"JPAエンティティに識別子(PK)属性がありません","em.check.jpa2":'値型(組込み可能・シリアライズ型)は識別子属性を持てません: "{name}"',"em.check.jpa4":"識別関係の循環です(PKが自身に無限依存): {path}","em.check.jpa5":"{which}: cascade ALLが個別のcascadeと重複しています(ALLがすべて含む)","em.check.jpa7":"{which}: コレクション(to-many)関連へのEAGERフェッチは性能リスクがあります","em.check.jpa8":"JPAエンティティにテーブル物理名が設定されていません","em.check.jpa9":"{which}: 単一(to-one)関連にコレクションメタ(collectionType/collectionTable/orderColumn)は無意味です — @ElementCollectionはコレクションにのみ適用されます","em.check.jpa10":"{which}: SETコレクションは順序を保持しないため、orderColumn(@OrderColumn)は無意味です","em.check.jpa11":"組込み(@Embedded/@ElementCollection)は識別関係にできません — 組込み可能型には独立した識別子がありません","em.check.jpa12":'識別子(@Id)属性はtransient(@Transient)にできません: "{name}"',"em.check.jpa13AutoIncrement":'採番(auto increment)は識別子(@Id)属性にのみ使えます — 非識別属性 "{name}" に設定されています',"em.check.jpa13Sequence":'採番(シーケンス "{seq}")は識別子(@Id)属性にのみ使えます — 非識別属性 "{name}" に設定されています',"em.check.jpa14":"{which}: orphanRemovalは@ManyToOne/@ManyToMany(相手側がコレクション)関連には適用できません — @OneToOne/@OneToManyでのみ有効です","em.check.jpa15":'識別子(@Id)属性は自然キー(@NaturalId)にできません — 自然キーはPKとは別のビジネスキーです: "{name}"',"em.check.jpa16":'自然キー(@NaturalId)属性はtransient(@Transient)にできません: "{name}"',"em.check.jpa17":'自然キー(@NaturalId)属性はnot nullが推奨されます(ビジネスキーはnon-nullが原則): "{name}"',"em.check.jpa18":"cascade が関係の両端(親・子)に設定され双方向に伝播します — 意図しない連鎖 persist/remove や伝播サイクルの危険があります。通常 cascade は片側のみに設定します","em.check.jpa19":"親にコレクション/参照フィールドがありますが、子({child})に対応する関係属性がないため mappedBy を解決できません — コード生成はこの関係を出力しません。子に FK 属性を作るか、関係を単方向に整理してください","em.check.jpa20":"複合PK(@IdClass/@EmbeddedId)には採番(@GeneratedValue)を使用できません — 属性「{name}」に設定されています","em.check.jpa21Missing":"埋め込み「{name}」の列が埋め込み可能クラス({embeddable})の宣言より少ないです — スロット {slots} / 宣言 {declared}。後から追加された列が反映されず DDL から漏れます(JPA は埋め込み可能クラスの宣言どおりに列を生成します)","em.check.jpa21Extra":"埋め込み「{name}」の列が埋め込み可能クラス({embeddable})の宣言より多いです — スロット {slots} / 宣言 {declared}。埋め込み可能クラスで削除された列が残り、存在しない列を DDL に出力します","em.check.type1":'ターゲットDBがサポートしないカラム型です: "{dataType}"',"em.check.type2":"{dataType}型にlengthが指定されていません","em.check.type3":"共有先カラムの型({targetType})が{metaName}の定義({metaType})と異なります","em.check.type4":"マルチ値(Multi-Value)属性はGroupCodeEnum + VARCHARの組み合わせでのみコンバータが自動生成されます — 現在({type} / {dataType})ではSet<…>フィールドのみ生成され、マッピングが不完全になる可能性があります","em.check.type6":"属性「{name}」のカラムにデータ型が指定されていません — DDL でこのカラムは出力されません","em.check.type7":"Java型({type})とカラム型({dataType})が互換ではありません — コード生成のフィールドと DDL のカラムが異なる型で出力されます","em.check.type8":"NULL 許容カラム({dataType})がプリミティブ型({type})にマッピングされています — DB の NULL を読み込んだ瞬間に例外が発生します。NOT NULL を指定するか、ボックス型({boxed})に変更してください","em.check.dsn1":"both-many(M:N)関係を結合エンティティなしで直接接続しています — 関連エンティティの導入を検討してください","em.check.dsn2":"属性が一つもないエンティティです","em.check.dsn3":"モデル化された関係がありません(関連・継承・組込みに未参加 — 意図的な省略なら無視)","em.check.dsn4":"属性が{count}個と多いです(しきい値{threshold}超過)— 分解を検討してください","em.check.dsn5Inherited":'インデックス "{name}" が参照する継承カラムがスーパークラスカタログに見つかりません({field})。',"em.check.dsn5Missing":'インデックス "{name}" が存在しないカラムを参照しています。',"em.check.dsn6":"インデックス「{name}」にカラムがありません — カラムのないインデックスは DDL・コード生成で出力されません","em.check.dsn7":"インデックス「{name}」に同じカラムが2回以上含まれています — 後続の重複項目は意味がありません","em.check.unspecified":"未指定"},gh={"em.mode.view":"조회","em.mode.edit":"편집","em.mode.frozen":"편집 잠김 (충돌)","em.mode.frozenTitle":"동시편집 충돌로 편집이 잠겼습니다. 최신 내용을 다시 불러오는 중입니다.","em.mode.readonlyTitle":"이 다이어그램은 조회 전용입니다","em.toolbar.undo":"실행 취소","em.toolbar.redo":"다시 실행","em.toolbar.displayLabel":"표시","em.toolbar.routingToggle":"연결선 모드 전환","em.toolbar.routingOrthogonal":"직각","em.toolbar.routingStraight":"직선","em.toolbar.grid":"그리드","em.toolbar.gridOn":"그리드 켜기","em.toolbar.gridOff":"그리드 끄기","em.toolbar.minimap":"미니맵","em.toolbar.minimapOn":"미니맵 켜기","em.toolbar.minimapOff":"미니맵 끄기","em.toolbar.fitView":"전체 보기","em.toolbar.exportText":"내보내기 (텍스트 · Mermaid)","em.toolbar.exportSvg":"SVG 내보내기","em.toolbar.exportPng":"PNG 내보내기","em.toolbar.import":"가져오기 (텍스트 붙여넣기)","em.toolbar.history":"이력","em.toolbar.historyOpen":"변경 이력 열기","em.toolbar.historyClose":"변경 이력 닫기","em.toolbar.shortcuts":"키보드 단축키 (?)","em.displayMode.logical":"논리","em.displayMode.physical":"물리","em.displayMode.logicalPhysical":"논리·물리","em.displayMode.class":"클래스","em.panel.resizeWidth":"너비 조절","em.panel.collapse":"접기","em.panel.expand":"펼치기","em.panel.collapseAll":"모두 접기","em.panel.expandAll":"모두 펼치기","em.panel.lockedBanner":"편집 잠김 — 이동·수정·삭제 차단","em.panel.openNamed":"{name} 열기","em.notice.readOnly":"조회 모드에서는 편집할 수 없습니다","em.notice.entityLocked":"잠긴 엔티티입니다 — 잠금 해제 후 편집하세요","em.notice.groupLocked":"잠긴 그룹입니다 — 잠금 해제 후 편집하세요","em.notice.assocLocked":"잠긴 엔티티에 연결된 관계입니다 — 잠금 해제 후 편집하세요","em.validation.title":"검증","em.validation.noIssues":"검증 이슈가 없습니다.","em.validation.noVisibleIssues":"표시할 이슈가 없습니다 (필터 적용 중).","em.validation.checkOrphanEntities":"관계 없는 엔티티 검사","em.validation.nameless":"(이름 없음)","em.validation.severityError":"오류","em.validation.severityWarning":"경고","em.validation.severityInfo":"정보","em.validation.hideSeverity":"{label} 숨기기","em.validation.showSeverity":"{label} 표시","em.validation.expandPanel":"검증 패널 펼치기","em.validation.quickFix":"수정","em.validation.quickFixTip":"자동 수정 적용 (되돌리기 가능)","em.common.close":"닫기","em.common.save":"저장","em.export.title":"내보내기","em.export.formatText":"논리 모델 텍스트","em.export.formatMermaidEr":"Mermaid (ER)","em.export.formatMermaidClass":"Mermaid (클래스)","em.export.formatDdl":"SQL DDL (PostgreSQL)","em.export.formatJson":"JSON (백업)","em.export.copy":"복사","em.export.download":"다운로드","em.export.copied":"클립보드에 복사되었습니다.","em.export.copyFailed":"복사에 실패했습니다.","em.import.title":"가져오기","em.import.placeholder":"SQL DDL · Mermaid ER · JSON 백업을 붙여넣으세요.","em.import.formatGroup":"입력 형식","em.import.formatAuto":"자동 감지","em.import.formatMermaid":"Mermaid ER","em.import.formatDdl":"SQL DDL","em.import.formatJson":"JSON","em.import.detected":"감지: {format}","em.import.summary":"엔티티 {entities} · 관계 {relations}","em.import.warnings":"경고 {n}건 (부분 파싱)","em.import.error":"파싱 실패: {message}","em.import.emptyParse":"인식된 엔티티가 없습니다.","em.import.unknownFormat":"포맷을 감지하지 못했습니다 — 위에서 직접 선택하세요.","em.import.confirm":"가져오기","em.import.commentLocale":"주석 로케일","em.import.commentLocaleUnset":"지정 안 함 — 논리명 유보","em.import.commentEvidence":"COMMENT {n}건 — 한국어(한글) {hangul} · 일본어(가나) {kana} · 판별 불가 {undecidable}","em.import.commentCertain":"{locale} 확정","em.import.commentMixed":"혼재 — 로케일별로 나눠 가져오기 권장","em.import.commentUnknown":"판별 불가 — 원본 언어를 아는 사람이 지정","em.import.commentMarker":"텍스트가 밝힌 로케일: {locale}","em.shortcuts.title":"키보드 단축키","em.shortcuts.groupEdit":"편집","em.shortcuts.groupMove":"이동 · 정렬","em.shortcuts.groupExplorer":"탐색기","em.shortcuts.descExplorerSearch":"탐색기 검색으로 포커스","em.shortcuts.descExplorerNav":"트리 이동 (←→ 접기·펼치기)","em.shortcuts.descExplorerSelect":"항목 선택 + 캔버스 이동","em.shortcuts.descExplorerDetail":"엔티티 상세 편집 열기","em.shortcuts.groupOther":"기타","em.shortcuts.keyArrows":"방향키","em.shortcuts.keyRightClick":"우클릭","em.shortcuts.descUndo":"실행 취소","em.shortcuts.descRedo":"다시 실행","em.shortcuts.descCopy":"선택 복사","em.shortcuts.descPaste":"붙여넣기","em.shortcuts.descDelete":"선택 항목 삭제 (Backspace 동일)","em.shortcuts.descMove1":"선택 노드 1px 이동","em.shortcuts.descMove10":"선택 노드 10px 이동","em.shortcuts.descAttrFocus":"속성 선택 시 포커스 이동","em.shortcuts.descAttrReorder":"속성 순서 위/아래로","em.shortcuts.descContextMenu":"컨텍스트 메뉴 (엔티티·노트 추가 등)","em.shortcuts.descInlineConfirm":"인라인 편집 확정","em.shortcuts.descCloseEdit":"편집·메뉴 닫기","em.shortcuts.descOpenHelp":"이 도움말 열기","em.shortcuts.descCommandPalette":"명령 팔레트 (이동·명령 실행)","em.opSource.title":"본문 — {name}()","em.opSource.placeholder":"// Java 구현 코드","em.entity.name":"이름","em.entity.stereotype":"스테레오타입","em.entity.package":"패키지","em.panel.unlock":"잠금 해제","em.entity.fallback":"엔티티","em.group.fallback":"그룹","em.common.description":"설명","em.common.memo":"메모","em.common.color":"색상","em.common.add":"추가","em.common.inherit":"기본(따름)","em.common.noneParen":"(없음)","em.swatch.none":"없음","em.swatch.red":"빨강","em.swatch.amber":"주황","em.swatch.green":"초록","em.swatch.teal":"청록","em.swatch.blue":"파랑","em.swatch.indigo":"남색","em.swatch.violet":"보라","em.swatch.pink":"분홍","em.inspector.ctxEntityAttrs":"엔티티 · {name} › 속성 · {n}개","em.inspector.ctxEntityDivider":"엔티티 · {name} › 구분선","em.inspector.ctxEntityAttr":"엔티티 · {name} › 속성 · {attr}","em.inspector.ctxEntity":"엔티티 · {name}","em.inspector.ctxAssoc":"관계 · {a} — {b}","em.inspector.ctxGroup":"그룹 · {name}","em.inspector.ctxNote":"노트","em.inspector.ctxNone":"선택된 항목 없음","em.assoc.identifying":"identifying (식별 관계)","em.assoc.selfNoIdentifying":"셀프 연관은 식별 관계로 둘 수 없습니다 (비식별 FK 강제).","em.assoc.embedNoIdentifying":"임베드(@Embedded/@ElementCollection)는 식별 관계로 둘 수 없습니다 (임베더블은 독립 식별자가 없음).","em.assoc.multiplicity":"다중성","em.assoc.navFieldName":"연관 필드명(nav)","em.assoc.cascadeAllNote":"ALL이 개별 cascade를 모두 포함합니다 (CHK-JPA-5).","em.assoc.orphanRemovalNote":"반대편이 컬렉션(@ManyToOne/@ManyToMany)이라 orphanRemoval이 무효입니다 (CHK-JPA-14).","em.assoc.navRequiredNote":"이 방향에 nav 속성이 없어(navigable 꺼짐) cascade·fetch가 적용되지 않습니다.","em.assoc.ownerNavFixed":"JPA 소유측 참조(@ManyToOne)는 관계 존재와 동치라 항상 켜집니다 — 참조 없는 FK는 관계 대신 일반 컬럼으로 모델링하세요.","em.assoc.orderByPlaceholder":"예: name ASC","em.assoc.jpaDetails":"JPA 상세","em.embed.legend":"임베드","em.embed.cardinality":"카디널리티","em.embed.card1":"1 (필수 @Embedded)","em.embed.card01":"0..1 (선택 @Embedded)","em.embed.card0N":"0..* (컬렉션 @ElementCollection)","em.embed.collectionTablePlaceholder":"미지정 시 코드젠 폴백","em.embed.orderColumnPlaceholder":"미지정 시 순서 비보존","em.embed.ownerFixedNote":"임베더블은 소유자에 평탄화되므로 소유자 쪽 end(다중성·navigable·composition)는 구조적으로 고정이라 표시하지 않습니다.","em.group.nameLegend":"그룹명","em.group.excludeDDL":"DDL 생성 제외","em.group.members":"멤버 엔티티 {n}개","em.entity.classLegend":"클래스","em.entity.superClass":"부모 클래스","em.entity.superClassPlaceholder":"예: BaseEntity","em.entity.interfaces":"구현 인터페이스","em.entity.interfacesPlaceholder":"콤마로 구분 (예: Serializable, Cloneable)","em.entity.abstractClass":"추상 클래스","em.entity.tablePhysical":"테이블(물리)","em.entity.schema":"스키마","em.entity.schemaPlaceholder":"예: sales, master","em.entity.tableLogicalLegend":"테이블 논리명","em.entity.classLogicalLegend":"클래스 논리명","em.entity.discColumn":"Discriminator 컬럼명","em.entity.discColumnPlaceholder":"예: DTYPE","em.entity.discType":"Discriminator 타입","em.entity.discLength":"Discriminator 길이","em.entity.hasPersonalInfo":"개인정보 포함 (hasPersonalInfo)","em.entity.referenceOnly":"참고 전용 (산출·검증 대상 외)","em.entity.referenceOnlyHint":"문서 이해용 자료·테스트 초안 등 산출물이 아닌 엔티티. DDL·Java 코드·mermaid 를 생성하지 않고 검증 대상에서도 빠집니다(AI 입력 텍스트에는 남습니다). 그룹의 「DDL 생성 제외」와 다릅니다 — 그쪽은 타 서비스가 소유한 실재 테이블용으로 Java 클래스는 계속 생성됩니다.","em.entity.headerColor":"헤더 색상","em.attr.section":"속성 ({n})","em.attr.addEmbeddable":"임베더블 추가","em.attr.nameless":"(이름 없음)","em.attr.selectHint":"위 목록에서 속성을 선택하면 편집 폼이 표시됩니다.","em.attr.inverseNavHint":"역방향 연관관계 필드 — 물리 컬럼이 없습니다(대상 엔티티 참조).","em.attr.fkDerivedNote":"외래키(FK)에서 파생된 컬럼입니다 — 형상은 부모 PK를 따르며, 변경은 관계선·식별관계에서 하세요.","em.attr.scaleTypeHint":"소수부(scale)는 NUMERIC·DECIMAL 타입에만 적용됩니다.","em.attr.embedFixedHint":"임베더블 정의에서 고정된 값입니다.","em.attr.fkFixedHint":"부모 PK 컬럼에서 상속된 값입니다 — 형상은 부모를 따릅니다.","em.attr.embedSharedHint":"다른 컬럼과 공유하는 통화 컬럼입니다 — 대상에서 파생(읽기 전용).","em.attr.derivedIdField":"파생 식별 @Id 필드","em.attr.assocField":"연관 필드명(@MapsId)","em.attr.derivedIdNote":"이 속성은 **두 Java 필드**를 냅니다 — 위 이름 칸은 스칼라 @Id 필드명(비우면 부모 PK 물리명에서 파생)이고, 여기는 @MapsId 연관 필드명입니다. 같은 값을 관계선 인스펙터에서도 편집할 수 있습니다.","em.attr.joinColumnOnlyNote":"복합 외래키의 형제 컬럼입니다 — JPA 필드는 관계당 하나뿐이라 이 이름은 방출되지 않습니다. 필드명은 «{anchor}»에서 편집하세요.","em.attr.namePlaceholder":"이름","em.attr.typePlaceholder":"타입","em.attr.customTypePlaceholder":"커스텀 타입명","em.attr.logicalPlaceholder":"논리명","em.attr.columnPlaceholder":"컬럼","em.attr.defaultValue":"기본값","em.attr.codeGroup":"코드그룹","em.attr.currencyColumn":"통화 컬럼","em.attr.pii":"개인정보","em.attr.colFallback":"컬럼 {n}","em.attr.sharedOwn":"전용 컬럼(OWN)","em.attr.sharedRef":"↗ {owner}{physical} ({mode})","em.attr.currencyMode":"통화","em.attr.sharedMode":"공유","em.attr.batchHint":"선택 {n}개 일괄","em.attr.fkDeleteHint":"외래키는 연관관계에서 파생됩니다 — 연관관계선을 삭제하세요","em.attr.embedConvertPkBlocked":"식별자 속성은 컬럼 개수가 바뀌는 임베더블로 전환할 수 없습니다 — PK 형상이 바뀌면 이 PK를 참조하는 자식 FK가 함께 어긋납니다","em.op.section":"오퍼레이션 ({n})","em.op.namePlaceholder":"오퍼레이션명","em.op.editBodyDirty":"본문 편집 ●","em.op.editBody":"본문 편집","em.index.section":"인덱스 ({n})","em.index.inherited":"{field} (상속)","em.index.namePlaceholder":"인덱스명","em.index.addColumn":"컬럼","em.index.condition":"조건 (partial index)","em.index.conditionPlaceholder":"예: WHERE status = 'A'","em.groupCode.searchPlaceholder":"코드그룹 검색/선택","em.groupCode.noMatch":"일치하는 코드그룹 없음","em.detail.tabBasics":"기본","em.detail.tabColumns":"속성","em.detail.tabIndexes":"인덱스","em.detail.tabOperations":"오퍼레이션","em.detail.title":"엔티티 — {name}","em.attr.addDivider":"구분선","em.attr.columnPhysical":"컬럼(물리)","em.attr.constraints":"제약","em.attr.dividerLabelPlaceholder":"구분선 라벨(선택)","em.attr.dividerNote":"── 시각 구획 ──","em.attr.detailCollapse":"상세 접기","em.attr.detailExpand":"상세 펼치기","em.attr.semanticLegend":"의미","em.attr.embedChildCols":"임베더블 — 하위 컬럼 {n}개","em.attr.fkChildCols":"복합 외래키 — 컬럼 {n}개","em.attr.overrideCollapse":"오버라이드 접기","em.attr.overrideExpand":"오버라이드 펼치기","em.attr.overrideLegend":"컬럼 오버라이드","em.attr.empty":"속성 없음 — '추가'로 생성","em.op.body":"본문","em.op.bodyDirty":"본문 ●","em.op.empty":"오퍼레이션 없음 — '추가'로 생성","em.index.delete":"인덱스 삭제","em.index.empty":"인덱스 없음 — '추가'로 생성","em.index.conditionPlaceholderWide":"예: WHERE status = 'A' AND deleted = false","em.index.inheritedColTitle":"슈퍼클래스 상속 컬럼","em.index.inheritedBadge":"상속","em.index.colUnspecified":"{name} (컬럼 {n}개 중 미지정)","em.index.multiColumn":"{name} (컬럼 {n}개)","em.index.unnamedAttr":"(이름 없음)","em.index.availColumns":"가용 컬럼 ({n})","em.index.indexColumns":"인덱스 컬럼 ({n})","em.index.allColumnsUsed":"모든 컬럼 사용됨","em.index.addArrow":"추가 →","em.index.moveUp":"위로","em.index.moveDown":"아래로","em.index.removeColumn":"제거","em.index.noColumns":"컬럼 없음 — 좌측에서 추가","em.index.selectPrompt":"인덱스를 선택하거나 추가하세요.","em.palette.autoLayout":"자동 배치","em.cmd.title":"명령 팔레트","em.cmd.placeholder":"엔티티로 이동하거나 명령 실행…","em.cmd.sectionGoto":"이동","em.cmd.sectionActions":"명령","em.cmd.empty":"일치하는 항목이 없습니다","em.cmd.groupTag":"그룹","em.canvas.emptyTitle":"빈 다이어그램입니다","em.canvas.emptyHint":"캔버스를 <strong>우클릭</strong>하거나 좌하단 <strong>+</strong> 버튼으로 첫 엔티티를 추가하세요.","em.canvas.emptyConnectHint":"엔티티를 두 개 이상 만들면, 엔티티 가장자리에서 <strong>드래그</strong>해 관계를 연결할 수 있어요.","em.canvas.emptyShortcutHint":"단축키 도움말은 <kbd>?</kbd> 키","em.canvas.emptyReadonly":"표시할 엔티티가 없습니다","em.canvas.exportFailed":"내보내기에 실패했습니다","em.conflict.lockedTitle":"편집이 잠겼습니다","em.conflict.missingDetail":"변경 사항을 저장하지 못했습니다(서버 또는 네트워크 오류). 최신 내용을 다시 불러오세요.","em.conflict.changedDetail":"다른 곳에서 변경되어 편집이 잠겼습니다. 최신 내용을 다시 불러오세요.","em.conflict.commandFailedDetail":"편집을 처리하지 못해 화면 내용이 어긋났습니다. 저장된 내용은 그대로이니 최신 내용을 다시 불러오세요.","em.conflict.reloadingDetail":"최신 내용을 다시 불러오는 중입니다. 잠시만 기다려 주세요.","em.ctx.addEntity":"엔티티 추가","em.ctx.addNote":"노트 추가","em.ctx.addGroup":"그룹 추가","em.ctx.paste":"붙여넣기","em.ctx.copy":"복사","em.ctx.copyN":"복사 ({n})","em.ctx.editDetail":"상세 편집…","em.ctx.viewDetail":"상세 보기…","em.ctx.lock":"잠금","em.ctx.ungroup":"그룹 해제","em.ctx.deleteNote":"노트 삭제","em.ctx.addAttr":"속성 추가","em.ctx.colorN":"색상 ({n})","em.ctx.pasteAttr":"속성 붙여넣기","em.ctx.pasteAttrN":"속성 붙여넣기 ({n})","em.ctx.deleteAttr":"속성 삭제","em.ctx.deleteAttrN":"속성 삭제 ({n})","em.ctx.addOperation":"오퍼레이션 추가","em.ctx.deleteOperation":"오퍼레이션 삭제","em.ctx.addMethod":"메서드 추가","em.ctx.groupInto":"그룹으로 묶기","em.ctx.addSelfAssoc":"셀프 연관 추가","em.ctx.addEmbeddableNamed":"임베더블 추가: {label}","em.ctx.ungroupEntity":"그룹에서 빼기","em.ctx.deleteEntity":"엔티티 삭제","em.ctx.clearWaypoints":"꺾은선 풀기","em.ctx.deleteConnection":"연결 삭제","em.ctx.deleteAssociation":"관계 삭제","em.node.keyPfk":"PFK (식별 외래키)","em.node.keyPk":"PK (기본키)","em.node.keyFk":"FK (외래키)","em.node.required":"필수 (NOT NULL)","em.node.logicalMissing":"(논리명)","em.node.editLock":"편집 잠금","em.node.connectHint":"드래그해 다른 엔티티와 관계 연결","em.node.connectHintNode":"드래그해 관계 연결 (이 엔티티 전체를 시작점으로)","em.node.derivedIdRow":"파생 식별(@MapsId)이 방출하는 스칼라 @Id 필드입니다 — 모델에는 연관 속성 하나로 저장되며, 편집은 그 속성의 인스펙터에서 합니다.","em.node.embedRepeatedShow":"이 엔티티에서 값이 같아 접힌 컬럼 {count}개 보기","em.node.embedRepeatedHide":"값이 같아 반복되는 컬럼 접기","em.node.embedAttrHide":"이 임베드 컬럼 접기","em.node.embedAttrShow":"접힌 임베드 컬럼 {count}개 보기","em.node.embedAllHide":"이 엔티티의 서브컬럼 모두 접기","em.node.embedAllShow":"접힌 서브컬럼 모두 펼치기","em.node.embedAllSummary":"서브컬럼 {n}개 숨김","em.node.opsSummaryTitle":"오퍼레이션 {n}개 — 클래스 표시 모드에서 펼쳐 보입니다","em.node.opsSummary":"오퍼레이션 {n}개","em.node.addAttr":"+ 속성","em.node.addDivider":"+ 구분선","em.group.ddlExcludeBadge":"DDL 제외","em.toolbar.referenceOnlyBadge":"참고 전용 문서","em.toolbar.referenceOnlyDocHint":"이 문서 전체가 산출·검증 대상이 아닙니다. DDL·Java 코드·mermaid 내보내기가 비고 검증 신호도 나오지 않습니다 — 모델이 비어서가 아니라 대상 외이기 때문입니다(AI 입력 텍스트에는 남습니다). 캔버스의 파선 테두리가 같은 뜻입니다.","em.explorer.groupFallback":"(그룹)","em.explorer.associations":"관계 ({n})","em.explorer.notes":"노트 ({n})","em.explorer.emptyNote":"(빈 노트)","em.explorer.diagram":"다이어그램","em.explorer.searchPlaceholder":"엔티티·속성 검색 ( / )","em.explorer.treeAria":"다이어그램 트리","em.explorer.searchAria":"엔티티·속성 검색","em.explorer.clearSearchAria":"검색어 지우기","em.explorer.clearSearchTitle":"지우기 (Esc)","em.explorer.noMatches":"일치하는 엔티티·속성이 없습니다","em.history.title":"변경 이력","em.history.refresh":"새로고침","em.history.loading":"이력을 불러오는 중…","em.history.loadError":"이력을 불러오지 못했습니다.","em.history.emptyLoaded":"표시할 변경 이력이 없습니다.","em.history.emptyNotLoaded":"이력을 불러오세요.","em.history.filterAll":"전체","em.history.kindEdit":"편집","em.history.kindRestore":"복원","em.history.verbAdd":"추가","em.history.verbUpdate":"수정","em.history.verbRemove":"삭제","em.history.assocFallback":"연관","em.history.groupSubject":"그룹 {name}","em.history.noteSubject":"노트 {name}","em.history.emptyValue":"(비움)","em.history.noChange":"변경 없음","em.history.summaryAdd":"{name} 추가","em.history.summaryRemove":"{name} 삭제","em.history.summaryFields":"{name} {n}개 변경","em.history.summaryMore":"{summary} 외 {n}건","em.history.restoreFailed":"복원 실패: {reason}","em.history.unknown":"알 수 없음","em.history.confirmRestore":"이 시점으로 되돌립니다.","em.history.doRestore":"복원","em.history.cancel":"취소","em.history.restoreToHere":"이 시점으로 복원","em.history.diff.compare":"현재와 비교","em.history.diff.current":"현재","em.history.diff.exit":"비교 해제","em.history.diff.count":"누적 변경 {n}건","em.history.diff.empty":"이 구간의 누적 변경이 없습니다.","em.history.diff.restorePreview":"되돌아갈 변경 {n}건","em.history.diff.restorePreviewNone":"되돌아갈 변경이 없습니다.","em.history.loadMore":"이전 기록 더 보기 ({n})","em.history.periodLabel":"기간","em.history.periodFrom":"시작일","em.history.periodTo":"종료일","em.history.periodReset":"기간 해제","em.check.catName":"이름","em.check.catJpa":"JPA","em.check.catType":"타입","em.check.catDsn":"설계","em.check.name1":'속성 이름이 중복됩니다: "{name}"',"em.check.name2":'컬럼 물리명이 중복됩니다: "{name}"',"em.check.name3Entity":'엔티티 이름이 중복됩니다: "{name}" — 같은 이름의 엔티티가 또 있습니다. JPA는 엔티티 이름을 퍼시스턴스 유닛 전역에 등록하므로 패키지(그룹)를 나눠도 해소되지 않습니다',"em.check.name3Package":'엔티티 이름이 중복됩니다: "{name}" — 같은 패키지에 같은 이름이 있습니다. 이름을 바꾸거나 그룹(패키지)을 나누면 해소됩니다',"em.check.name4Entity":"엔티티 이름이 비어 있습니다","em.check.name4Attr":"속성 이름이 비어 있습니다","em.check.name11Entity":'엔티티 이름 "{name}"이 Java 클래스 관례(PascalCase)를 벗어납니다 — 코드 생성이 이 이름을 그대로 클래스명으로 냅니다',"em.check.name11Attr":'속성 이름 "{name}"이 Java 필드 관례(lowerCamelCase)를 벗어납니다 — 코드 생성이 이 이름을 그대로 필드명으로 냅니다',"em.check.name5":"물리명이 {max}자를 초과했습니다 ({len}자) — 일부 DB에서 잘릴 수 있습니다","em.check.name6Column":'컬럼 물리명이 SQL 예약어입니다: "{name}"',"em.check.name6Table":'테이블 물리명이 SQL 예약어입니다: "{name}"',"em.check.name6Index":'인덱스 이름이 SQL 예약어입니다: "{name}"',"em.check.name7":"관계/임베드 속성({attrType})의 이름이 비어 있습니다 — 이름이 곧 JPA 필드명이라 코드 생성 시 이 관계가 통째로 누락됩니다. 속성명을 채우세요","em.check.name8":'속성 "{name}"의 컬럼 물리명이 비어 있습니다 — DDL·코드 생성에서 이 컬럼이 통째로 누락됩니다. 물리명을 채우세요',"em.check.name9":'두 엔티티가 같은 테이블 "{name}"에 매핑됩니다 — 컬럼이 한 테이블에 뒤섞입니다. 테이블 물리명을 구분하세요',"em.check.name10":'인덱스 이름이 중복됩니다: "{name}" — 인덱스 이름은 DB 스키마 전역에서 유일해야 합니다',"em.entity.valueTypeSwitchEmbedded":'"{name}"은(는) 현재 {owners}개 엔티티에 임베드되어 있어 직렬화 타입/임베더블 사이를 바로 전환할 수 없습니다 — 임베드 속성을 먼저 정리한 뒤 전환하세요(직렬화 타입은 관계가 아니라 타입 참조로 지목됩니다)',"em.attr.serializedNoColumnNote":"직렬화 타입은 필드별 물리 컬럼이 없습니다 — 소비 속성의 컬럼 하나에 통째로 직렬화됩니다","em.attr.serializedContainer":"컨테이너","em.attr.serializedContainerNone":"없음 (단일 값)","em.entity.noOwnTableNote":"값 타입은 자체 테이블이 없습니다 — 임베더블은 소유자 테이블로 펼쳐지고, 직렬화 타입은 소비 속성의 컬럼 하나에 직렬화됩니다","em.entity.serializedTypeHasRelations":'"{name}"은(는) 연관관계 {count}개에 참여 중이라 직렬화 타입으로 바꿀 수 없습니다 — 연관을 먼저 정리하세요(직렬화 타입은 관계가 아니라 소비 속성의 타입 참조로 지목됩니다)',"em.entity.serializedContainer":"컨테이너","em.entity.serializedContainerNone":"없음 (단일 값)","em.entity.serializedMapKey":"Map 키 타입","em.entity.serializedMapKeyPlaceholder":"예: PromoType (미지정 시 코드젠이 임시 Object + 손채움)","em.entity.noIndexNote":"직렬화 타입은 인덱스를 가질 수 없습니다 — 인덱스는 컬럼에 걸리는데 이 타입은 소비 속성의 컬럼 하나에 통째로 직렬화됩니다","em.check.jpa1":"JPA 엔티티에 식별자(PK) 속성이 없습니다","em.check.jpa2":'값 타입(임베더블·직렬화 타입)은 식별자 속성을 가질 수 없습니다: "{name}"',"em.check.jpa4":"식별 관계 사이클입니다 (PK 무한 의존): {path}","em.check.jpa5":"{which}: cascade ALL이 개별 cascade와 중복됩니다 (ALL이 모두 포함)","em.check.jpa7":"{which}: 컬렉션(to-many) 연관에 EAGER 페치는 성능 위험이 있습니다","em.check.jpa8":"JPA 엔티티에 테이블 물리명이 설정되지 않았습니다","em.check.jpa9":"{which}: 단일(to-one) 연관에 컬렉션 메타(collectionType/collectionTable/orderColumn)는 무의미합니다 — @ElementCollection은 컬렉션에서만 적용됩니다","em.check.jpa10":"{which}: SET 컬렉션은 순서를 보존하지 않아 orderColumn(@OrderColumn)이 무의미합니다","em.check.jpa11":"임베드(@Embedded/@ElementCollection)는 식별 관계로 둘 수 없습니다 — 임베더블은 독립 식별자가 없습니다","em.check.jpa12":'식별자(@Id) 속성은 transient(@Transient)일 수 없습니다: "{name}"',"em.check.jpa13AutoIncrement":'채번(auto increment)은 식별자(@Id) 속성에만 쓸 수 있습니다 — 비식별 속성 "{name}"에 설정되어 있습니다',"em.check.jpa13Sequence":'채번(시퀀스 "{seq}")은 식별자(@Id) 속성에만 쓸 수 있습니다 — 비식별 속성 "{name}"에 설정되어 있습니다',"em.check.jpa14":"{which}: orphanRemoval은 @ManyToOne/@ManyToMany(반대편이 컬렉션) 연관에는 적용할 수 없습니다 — @OneToOne·@OneToMany에서만 유효합니다","em.check.jpa15":'식별자(@Id) 속성은 자연키(@NaturalId)일 수 없습니다 — 자연키는 PK와 별개의 비즈니스 키입니다: "{name}"',"em.check.jpa16":'자연키(@NaturalId) 속성은 transient(@Transient)일 수 없습니다: "{name}"',"em.check.jpa17":'자연키(@NaturalId) 속성은 not null이 권장됩니다(비즈니스 키는 non-null이 원칙): "{name}"',"em.check.jpa18":"cascade가 관계 양쪽(부모·자식)에 모두 설정되어 양방향 전파됩니다 — 의도치 않은 연쇄 저장/삭제·전파 사이클 위험. 보통 cascade는 한쪽에만 둡니다","em.check.jpa19":"부모에 컬렉션/참조 필드가 있으나 자식({child})에 대응 관계 속성이 없어 JPA 매핑(mappedBy)을 만들 수 없습니다 — 코드젠이 이 관계를 방출하지 못합니다. 자식에 FK 속성을 만들거나 관계를 단방향으로 정리하세요","em.check.jpa20":'복합 PK(@IdClass/@EmbeddedId)에는 채번(@GeneratedValue)을 쓸 수 없습니다 — 속성 "{name}"에 설정되어 있습니다',"em.check.jpa21Missing":'임베드 "{name}"의 컬럼이 임베더블({embeddable}) 선언보다 적습니다 — 슬롯 {slots} / 선언 {declared}. 뒤에 추가된 컬럼이 반영되지 않아 DDL에서 빠집니다(JPA는 임베더블 선언대로 컬럼을 만듭니다)',"em.check.jpa21Extra":'임베드 "{name}"의 컬럼이 임베더블({embeddable}) 선언보다 많습니다 — 슬롯 {slots} / 선언 {declared}. 임베더블에서 지워진 컬럼이 남아 DDL에 없는 컬럼을 방출합니다',"em.check.type1":'타겟 DB가 지원하지 않는 컬럼 타입입니다: "{dataType}"',"em.check.type2":"{dataType} 타입에 length가 지정되지 않았습니다","em.check.type3":"공유 대상 컬럼의 타입({targetType})이 {metaName} 정의({metaType})와 다릅니다","em.check.type4":"다중값(Multi-Value) 속성은 GroupCodeEnum + VARCHAR 조합에서만 컨버터가 자동 생성됩니다 — 현재({type} / {dataType})에서는 Set<…> 필드만 생성되어 매핑이 불완전할 수 있습니다","em.check.type6":'속성 "{name}"의 컬럼에 데이터 타입이 지정되지 않았습니다 — DDL에서 이 컬럼이 생략됩니다',"em.check.type7":"자바 타입({type})과 컬럼 타입({dataType})이 호환되지 않습니다 — 코드젠 필드와 DDL 컬럼이 서로 다른 타입으로 산출됩니다","em.check.type8":"NULL 허용 컬럼({dataType})이 원시 타입({type})에 매핑됩니다 — DB의 NULL 을 읽는 순간 예외가 납니다. NOT NULL 을 지정하거나 박싱 타입({boxed})으로 바꾸세요","em.check.dsn1":"both-many(M:N) 관계를 조인 엔티티 없이 직접 연결했습니다 — 연관 엔티티 도입을 검토하세요","em.check.dsn2":"속성이 하나도 없는 엔티티입니다","em.check.dsn3":"모델링된 관계가 없습니다 (연관·상속·임베딩 미참여 — 의도적 생략이면 무시)","em.check.dsn4":"속성이 {count}개로 많습니다 (임계치 {threshold} 초과) — 분해를 검토하세요","em.check.dsn5Inherited":'인덱스 "{name}"가 참조하는 상속 컬럼을 슈퍼클래스 카탈로그에서 찾을 수 없습니다({field}).',"em.check.dsn5Missing":'인덱스 "{name}"가 존재하지 않는 컬럼을 참조합니다.',"em.check.dsn6":'인덱스 "{name}"에 컬럼이 없습니다 — 컬럼 없는 인덱스는 DDL·코드 생성에서 산출되지 않습니다',"em.check.dsn7":'인덱스 "{name}"에 같은 컬럼이 두 번 이상 들어 있습니다 — 뒤의 중복 항목은 의미가 없습니다',"em.check.unspecified":"미지정"},xC=["ko","en","ja"],tc={ko:gh,en:hh,ja:yh};function cn(e,n,o){let a=(tc[e]??tc.ko)[n]??tc.ko[n]??n;return o&&(a=a.replace(/\{(\w+)\}/g,(r,l)=>l in o?String(o[l]):r)),a}const bh=["ko","en","ja","zh"];function $C(e){if(e)for(const n of bh){const o=e[n];if(o)return o}}function nc(e){const n=$C(e.label);return n?`${e.groupCode} (${n})`:e.groupCode}function TC(e,n){const o=n.trim().toLowerCase();return o?e.filter(i=>i.groupCode.toLowerCase().includes(o)?!0:bh.some(a=>{var r,l;return(l=(r=i.label)==null?void 0:r[a])==null?void 0:l.toLowerCase().includes(o)})):e}const MC=["aria-expanded","placeholder"],VC=["aria-selected","onClick","onMouseenter"],LC={key:0,class:"gcc__opt gcc__opt--empty"},kh=tt(t.defineComponent({__name:"GroupCodeCombobox",props:{modelValue:{},items:{},locale:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,i=n,a=(T,O)=>cn(o.locale??"ko",T,O),r=t.ref(),l=t.ref(),s=t.ref(),c=t.ref(""),d=t.ref(!1),u=t.ref(-1),m=t.ref({}),f=t.computed(()=>o.items.find(T=>T.groupCode===o.modelValue)),p=t.computed(()=>f.value?nc(f.value):"");t.watch(p,T=>{d.value||(c.value=T)},{immediate:!0});const y=t.computed(()=>c.value===p.value?o.items:TC(o.items,c.value));function g(){var O;const T=(O=r.value)==null?void 0:O.getBoundingClientRect();T&&(m.value={left:`${T.left}px`,top:`${T.bottom}px`,width:`${T.width}px`})}function b(){d.value=!0,g(),u.value=Math.max(0,y.value.findIndex(T=>T.groupCode===o.modelValue)),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),document.addEventListener("mousedown",A)}function k(){d.value=!1,window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),document.removeEventListener("mousedown",A)}t.onBeforeUnmount(k);function _(){b(),t.nextTick(()=>{var T;return(T=l.value)==null?void 0:T.select()})}function h(){d.value||b(),u.value=0}function C(T){i("update:modelValue",T.groupCode),c.value=nc(T),k()}function v(){i("update:modelValue",void 0),c.value="",k()}function S(){c.value.trim()===""?v():(c.value=p.value,k())}function N(T){var O;if(T.key==="ArrowDown")d.value||b(),u.value=Math.min(u.value+1,y.value.length-1),T.preventDefault();else if(T.key==="ArrowUp")u.value=Math.max(u.value-1,0),T.preventDefault();else if(T.key==="Enter"){const z=y.value[u.value];z&&C(z),T.preventDefault()}else T.key==="Escape"&&(c.value=p.value,k(),(O=l.value)==null||O.blur())}function A(T){var z,P;const O=T.target;!((z=r.value)!=null&&z.contains(O))&&!((P=s.value)!=null&&P.contains(O))&&S()}return(T,O)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"root",ref:r,class:"gcc"},[t.withDirectives(t.createElementVNode("input",{ref_key:"inputEl",ref:l,"onUpdate:modelValue":O[0]||(O[0]=z=>c.value=z),class:"gcc__input",type:"text",role:"combobox",autocomplete:"off","aria-expanded":d.value,placeholder:a("em.groupCode.searchPlaceholder"),onFocus:_,onInput:h,onKeydown:N},null,40,MC),[[t.vModelText,c.value]]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[d.value?(t.openBlock(),t.createElementBlock("ul",{key:0,ref_key:"popup",ref:s,class:"gcc__popup",style:t.normalizeStyle(m.value),role:"listbox"},[t.createElementVNode("li",{class:"gcc__opt gcc__opt--none",onMousedown:O[1]||(O[1]=t.withModifiers(()=>{},["prevent"])),onClick:v},t.toDisplayString(a("em.common.noneParen")),33),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value,(z,P)=>(t.openBlock(),t.createElementBlock("li",{key:z.groupCode,class:t.normalizeClass(["gcc__opt",{"is-active":P===u.value,"is-selected":z.groupCode===e.modelValue}]),role:"option","aria-selected":z.groupCode===e.modelValue,onMousedown:O[2]||(O[2]=t.withModifiers(()=>{},["prevent"])),onClick:D=>C(z),onMouseenter:D=>u.value=P},t.toDisplayString(t.unref(nc)(z)),43,VC))),128)),y.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("li",LC,t.toDisplayString(a("em.groupCode.noMatch")),1))],4)):t.createCommentVNode("",!0)]))],512))}}),[["__scopeId","data-v-431f9333"]]),BC=["aria-labelledby"],DC=["aria-checked","tabindex","onClick","onKeydown"],_h=tt(t.defineComponent({__name:"ColumnLangSelect",props:{modelValue:{},languages:{},defaultLang:{},labelledBy:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,i=n;t.watch(()=>[o.languages,o.defaultLang],([l,s])=>{l.includes(s)?o.modelValue!==s&&i("update:modelValue",s):l.includes(o.modelValue)||i("update:modelValue",l[0]??"ko")});const a=t.ref(null);async function r(l){var d,u;const s=o.languages,c=s[(s.indexOf(o.modelValue)+l+s.length)%s.length];c&&(i("update:modelValue",c),await t.nextTick(),(u=(d=a.value)==null?void 0:d.querySelectorAll('[role="radio"]')[s.indexOf(c)])==null||u.focus())}return(l,s)=>(t.openBlock(),t.createElementBlock("span",{ref_key:"rootEl",ref:a,class:"em-langsel",role:"radiogroup","aria-labelledby":e.labelledBy},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.languages,c=>(t.openBlock(),t.createElementBlock("span",{key:c,class:t.normalizeClass(["em-langsel__opt",{"is-active":e.modelValue===c}]),role:"radio","aria-checked":e.modelValue===c,tabindex:e.modelValue===c?0:-1,onClick:d=>i("update:modelValue",c),onKeydown:[t.withKeys(t.withModifiers(d=>i("update:modelValue",c),["prevent"]),["enter"]),t.withKeys(t.withModifiers(d=>i("update:modelValue",c),["prevent"]),["space"]),s[0]||(s[0]=t.withKeys(t.withModifiers(d=>r(-1),["prevent"]),["left"])),s[1]||(s[1]=t.withKeys(t.withModifiers(d=>r(1),["prevent"]),["right"]))]},t.toDisplayString(c),43,DC))),128))],8,BC))}}),[["__scopeId","data-v-5c793bbb"]]),OC=["disabled"],PC={class:"em-aw__toolbar"},zC={class:"em-aw__count"},FC={class:"em-aw__scroll"},UC={class:"em-aw__table"},HC={class:"c-name"},jC={class:"c-type"},KC={class:"c-logical"},GC=["id"],YC={class:"c-col"},qC={class:"c-constraints"},WC={class:"c-del"},JC={class:"c-expand"},XC=["title","onClick","onKeydown"],ZC=["title"],QC=["title"],eS={key:1,class:"em-aw__muted"},tS=["title"],nS=["title"],oS=["title"],iS=["title"],aS={class:"em-aw__cflags"},rS=["title"],lS={key:0,class:"em-aw__embed-col"},sS={class:"em-aw__embed-label"},cS=["title"],dS={colspan:"8"},uS={class:"em-aw__detail"},mS={class:"em-aw__dgroup"},fS=["title"],pS={class:"em-aw__df"},hS={class:"em-aw__df"},yS={class:"em-aw__dgroup"},gS={key:0,class:"em-aw__dgroup"},bS={class:"em-aw__df"},kS={key:0,class:"em-aw__df"},_S={class:"em-aw__df"},ES={class:"em-aw__dgroup em-aw__ddesc"},NS={class:"c-expand"},wS=["title","onClick","onKeydown"],IS={key:1,class:"em-aw__caret is-static","aria-hidden":"true"},vS=["title"],CS=["title"],SS=["colspan"],RS=["title"],AS={class:"em-aw__cflags"},xS=["title"],$S={colspan:"8"},TS={class:"em-aw__detail"},MS={class:"em-aw__dgroup em-aw__ddesc"},VS={class:"c-expand"},LS=["title","onClick","onKeydown"],BS={class:"em-aw__embed-label"},DS=["title"],OS=["title"],PS={class:"em-aw__ro"},zS=["title"],FS={class:"em-aw__ro"},US=["title"],HS={class:"em-aw__ro"},jS={key:0,class:"em-aw__detail-row em-aw__embed-detail"},KS={colspan:"8"},GS={class:"em-aw__detail"},YS={class:"em-aw__dgroup"},qS={key:0,class:"em-aw__df"},WS={class:"em-aw__df"},JS={class:"em-aw__df"},XS={key:0},ZS={colspan:"99",class:"em-aw__empty"},QS=6,Eh=5,eR=tt(t.defineComponent({__name:"EntityAttributesWide",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,{entity:i,isValueType:a,isColumnless:r,focusedAttrIds:l,personalInfoItems:s,piiLabel:c,idn:d,logicalNameOf:u,setLogicalName:m,logicalPlaceholder:f,SERIALIZED_FIELD_CONTAINERS:p,setCollectionType:y,setAttr:g,isDerivedIdRow:b,rowName:k,rowNamePlaceholder:_,setRowName:h,assocFieldName:C,setAssocFieldName:v,nameLocked:S,nameLockedHint:N,isManagedFk:A,setNaturalId:T,setIdentifier:O,setTransient:z,dbLocked:P,fkDerived:D,fkOriginPhysical:E,typeLocked:R,typeValueOf:I,typeLabelOf:x,setAttrType:$,setAttrCustomType:U,setDb:F,scaleApplicable:B,scaleHint:j,attrPiiValue:X,setAttrPii:W,predefinedCustomTypeCatalog:oe,serializedTypeNames:de,embeddableCatalog:ie,predefinedLabel:Ie,groupCodeCatalog:Le,attrGroupCodes:Se,attrCodeItems:ce,codeValueOf:pe,codeLabelOf:he,setAttrGroupCode:V,setAttrCode:L,setAttrDefaultValue:K,setAttrDescription:Z,hasColumnSlots:Q,isMultiColFk:fe,setDbAt:be,setDbLogicalAt:Ee,colSlotMeta:Ne,fixedDataType:J,fixedLength:ee,fixedScale:te,slotFixedHint:ge,updatableItems:Re,updatableLabel:Pe,updatableValue:Me,setUpdatableAt:Qe,setUpdatable:Ot,insertableItems:ht,insertableLabel:re,insertableValue:ve,setInsertableAt:le,setInsertable:me,sharedItems:ke,sharedLabel:Ze,sharedValue:ct,setSharedAt:ft,isShared:qe,sharedPhysical:Rt}=ph(o,()=>n.entityId),et=t.computed(()=>{var mt;return[...((mt=i.value)==null?void 0:mt.attributes)??[]].sort((ze,Y)=>ze.order-Y.order)}),jt=t.computed(()=>{var mt;return(((mt=i.value)==null?void 0:mt.attributes)??[]).filter(ze=>ze.attrType!=="DIVIDER").length}),Nt=t.ref(new Set);function ut(mt){return Nt.value.has(mt)}function yt(mt){const ze=new Set(Nt.value);ze.has(mt)?ze.delete(mt):ze.add(mt),Nt.value=ze}const At=t.ref(o.userLanguage.value);function jn(mt){!mt||!i.value||o.addPredefinedEmbed(i.value.modelId,mt)}return(mt,ze)=>t.unref(i)?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-aw",disabled:!t.unref(o).editable.value},[t.createElementVNode("div",PC,[t.createElementVNode("span",zC,t.toDisplayString(t.unref(o).t("em.attr.section",{n:jt.value})),1),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:ze[0]||(ze[0]=Y=>t.unref(o).addAttribute(t.unref(i).modelId))},null,8,["caption"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t("em.attr.addDivider"),onClick:ze[1]||(ze[1]=Y=>t.unref(o).addDivider(t.unref(i).modelId))},null,8,["caption"]),t.unref(ie).length?(t.openBlock(),t.createBlock(t.unref(ne.BSSelect),{key:0,width:"140px",placeholder:t.unref(o).t("em.attr.addEmbeddable"),"model-value":void 0,items:t.unref(ie),"value-provider":Y=>Y.type,"label-provider":t.unref(Ie),"onUpdate:modelValue":jn},null,8,["placeholder","items","value-provider","label-provider"])):t.createCommentVNode("",!0)]),t.createElementVNode("div",FC,[t.createElementVNode("table",UC,[t.createElementVNode("thead",null,[t.createElementVNode("tr",null,[ze[3]||(ze[3]=t.createElementVNode("th",{class:"c-expand"},null,-1)),t.createElementVNode("th",HC,t.toDisplayString(t.unref(o).t("em.attr.namePlaceholder")),1),t.createElementVNode("th",jC,t.toDisplayString(t.unref(o).t("em.attr.typePlaceholder")),1),t.createElementVNode("th",KC,[t.createElementVNode("span",{id:`aw-logical-head-${t.unref(i).modelId}`},t.toDisplayString(t.unref(o).t("em.attr.logicalPlaceholder")),9,GC),t.createVNode(_h,{modelValue:At.value,"onUpdate:modelValue":ze[2]||(ze[2]=Y=>At.value=Y),languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"labelled-by":`aw-logical-head-${t.unref(i).modelId}`},null,8,["modelValue","languages","default-lang","labelled-by"])]),t.createElementVNode("th",YC,t.toDisplayString(t.unref(o).t("em.attr.columnPhysical")),1),ze[4]||(ze[4]=t.createElementVNode("th",{class:"c-dtype"},"dataType",-1)),ze[5]||(ze[5]=t.createElementVNode("th",{class:"c-len"},"len",-1)),t.createElementVNode("th",qC,t.toDisplayString(t.unref(o).t("em.attr.constraints")),1),ze[6]||(ze[6]=t.createElementVNode("th",{class:"c-del"},null,-1))])]),t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(et.value,Y=>{var Wt,G,ae,De,je,bt,Vt,Ye,Ue;return t.openBlock(),t.createElementBlock(t.Fragment,{key:Y.modelId},[Y.attrType==="DIVIDER"?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["em-aw__divider-row",{"is-focused":t.unref(l).has(Y.modelId)}])},[ze[7]||(ze[7]=t.createElementVNode("td",{class:"c-expand"},null,-1)),t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-divlabel-${Y.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.dividerLabelPlaceholder"),"model-value":Y.name,"onUpdate:modelValue":w=>t.unref(g)(Y,{name:w})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",{colspan:QS,class:"em-aw__divider-note"},t.toDisplayString(t.unref(o).t("em.attr.dividerNote")),1),t.createElementVNode("td",WC,[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:w=>t.unref(o).removeAttribute(t.unref(i).modelId,Y.modelId)},null,8,["onClick"])])],2)):t.unref(Q)(Y)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("tr",{class:t.normalizeClass(["em-aw__embed-parent",{"is-focused":t.unref(l).has(Y.modelId)}])},[t.createElementVNode("td",NS,[t.unref(fe)(Y)?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["em-aw__caret",{"is-open":ut(Y.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ut(Y.modelId)?"em.attr.detailCollapse":"em.attr.detailExpand"),onClick:w=>yt(Y.modelId),onKeydown:[t.withKeys(t.withModifiers(w=>yt(Y.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(w=>yt(Y.modelId),["prevent"]),["space"])]},[t.createVNode(xe,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,wS)):(t.openBlock(),t.createElementBlock("span",IS,[t.createVNode(xe,{name:"chevron",size:14,class:"em-aw__caret-ic"})]))]),t.createElementVNode("td",{title:t.unref(S)(Y)?t.unref(N)(Y):void 0},[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-name-${Y.modelId}`,width:"100%",disabled:t.unref(S)(Y),placeholder:t.unref(_)(Y),"model-value":t.unref(k)(Y),"onUpdate:modelValue":w=>t.unref(h)(Y,w)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])],8,vS),t.createElementVNode("td",{title:t.unref(D)(Y)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-type-${Y.modelId}`,width:"100%",disabled:"","model-value":Y.type},null,8,["name","model-value"])],8,CS),t.createElementVNode("td",{colspan:t.unref(fe)(Y)?Eh-1:Eh,class:"em-aw__embed-note"},t.toDisplayString(t.unref(fe)(Y)?t.unref(o).t("em.attr.fkChildCols",{n:Y.dbAttrs.length}):t.unref(o).t("em.attr.embedChildCols",{n:Y.dbAttrs.length})),9,SS),t.unref(fe)(Y)?(t.openBlock(),t.createElementBlock("td",{key:0,class:"c-constraints",title:t.unref(o).t("em.attr.fkDerivedNote")},[t.createElementVNode("div",AS,[t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-pk-${Y.modelId}`,label:"PK","model-value":Y.identifier,disabled:"","onUpdate:modelValue":w=>t.unref(O)(Y,w)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-nn-${Y.modelId}`,label:"NN","model-value":Y.notNull,disabled:"","onUpdate:modelValue":w=>t.unref(g)(Y,{notNull:w})},null,8,["name","model-value","onUpdate:modelValue"])])],8,RS)):t.createCommentVNode("",!0),t.createElementVNode("td",{class:"c-del",title:t.unref(A)(Y)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:w=>t.unref(o).removeAttribute(t.unref(i).modelId,Y.modelId)},null,8,["onClick"])],8,xS)],2),t.unref(fe)(Y)&&ut(Y.modelId)?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["em-aw__detail-row",{"is-focused":t.unref(l).has(Y.modelId)}])},[ze[15]||(ze[15]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",$S,[t.createElementVNode("div",TS,[t.createElementVNode("fieldset",MS,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`aw-desc-${Y.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":Y.description,"onUpdate:modelValue":w=>t.unref(Z)(Y,w)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])])])],2)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Y.dbAttrs,(w,H)=>{var se,_e,$e,Oe,He;return t.openBlock(),t.createElementBlock(t.Fragment,{key:w.modelId},[t.createElementVNode("tr",{class:t.normalizeClass(["em-aw__embed-col",{"em-aw__open":ut(w.modelId)}])},[t.createElementVNode("td",VS,[t.createElementVNode("span",{class:t.normalizeClass(["em-aw__caret",{"is-open":ut(w.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ut(w.modelId)?"em.attr.overrideCollapse":"em.attr.overrideExpand"),onClick:Ke=>yt(w.modelId),onKeydown:[t.withKeys(t.withModifiers(Ke=>yt(w.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(Ke=>yt(w.modelId),["prevent"]),["space"])]},[t.createVNode(xe,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,LS)]),t.createElementVNode("td",BS,"↳ "+t.toDisplayString(((se=t.unref(Ne)(Y,H))==null?void 0:se.name)??((_e=t.unref(Ne)(Y,H))==null?void 0:_e.physicalName)??t.unref(o).t("em.attr.colFallback",{n:H+1})),1),ze[16]||(ze[16]=t.createElementVNode("td",null,null,-1)),t.createElementVNode("td",null,[t.createVNode(Qt,{name:`aw-embed-logical-${w.modelId}`,languages:t.unref(o).languages.value,"active-lang":At.value,placeholder:t.unref(Ct)(($e=t.unref(Ne)(Y,H))==null?void 0:$e.logicalName,At.value)??t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":w.logicalName,"onUpdate:modelValue":Ke=>t.unref(Ee)(Y,H,Ke)},null,8,["name","languages","active-lang","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",{title:t.unref(qe)(w)?t.unref(o).t("em.attr.embedSharedHint"):void 0},[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-embed-col-${w.modelId}`,width:"100%",disabled:t.unref(qe)(w),placeholder:((Oe=t.unref(Ne)(Y,H))==null?void 0:Oe.physicalName)??t.unref(o).t("em.attr.columnPlaceholder"),"model-value":t.unref(qe)(w)?t.unref(Rt)(w):w.physicalName,"onUpdate:modelValue":Ke=>t.unref(be)(Y,H,{physicalName:Ke})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(Do,{controller:t.unref(o),"ref-id":w.modelId},null,8,["controller","ref-id"])],8,DS),t.createElementVNode("td",{title:t.unref(ge)(Y)},[t.createElementVNode("span",PS,t.toDisplayString(t.unref(J)(Y,H)),1)],8,OS),t.createElementVNode("td",{title:t.unref(ge)(Y)},[t.createElementVNode("span",FS,t.toDisplayString(t.unref(ee)(Y,H)??""),1)],8,zS),t.createElementVNode("td",{class:"c-constraints",title:t.unref(ge)(Y)},[t.createElementVNode("span",HS,t.toDisplayString(t.unref(te)(Y,H)!=null?`scale ${t.unref(te)(Y,H)}`:""),1)],8,US),ze[17]||(ze[17]=t.createElementVNode("td",null,null,-1))],2),ut(w.modelId)?(t.openBlock(),t.createElementBlock("tr",jS,[ze[20]||(ze[20]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",KS,[t.createElementVNode("div",GS,[t.createElementVNode("fieldset",YS,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.attr.overrideLegend")),1),(He=t.unref(Ne)(Y,H))!=null&&He.shareable?(t.openBlock(),t.createElementBlock("label",qS,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.currencyColumn")),1),t.createVNode(t.unref(ne.BSSelect),{width:"150px","model-value":t.unref(ct)(w),items:t.unref(ke)(),"value-provider":t.unref(d),"label-provider":t.unref(Ze),"onUpdate:modelValue":Ke=>Ke&&t.unref(ft)(Y,H,Ke)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.createElementVNode("label",WS,[ze[18]||(ze[18]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"110px",disabled:t.unref(qe)(w),"model-value":t.unref(qe)(w)?"false":t.unref(ve)(w),items:t.unref(ht),"value-provider":t.unref(d),"label-provider":t.unref(re),"onUpdate:modelValue":Ke=>Ke&&t.unref(le)(Y,H,Ke)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",JS,[ze[19]||(ze[19]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"110px",disabled:t.unref(qe)(w),"model-value":t.unref(qe)(w)?"false":t.unref(Me)(w),items:t.unref(Re),"value-provider":t.unref(d),"label-provider":t.unref(Pe),"onUpdate:modelValue":Ke=>Ke&&t.unref(Qe)(Y,H,Ke)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])])])])])])):t.createCommentVNode("",!0)],64)}),128))],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("tr",{class:t.normalizeClass({"is-focused":t.unref(l).has(Y.modelId),"em-aw__open":ut(Y.modelId)})},[t.createElementVNode("td",JC,[t.createElementVNode("span",{class:t.normalizeClass(["em-aw__caret",{"is-open":ut(Y.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ut(Y.modelId)?"em.attr.detailCollapse":"em.attr.detailExpand"),onClick:w=>yt(Y.modelId),onKeydown:[t.withKeys(t.withModifiers(w=>yt(Y.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(w=>yt(Y.modelId),["prevent"]),["space"])]},[t.createVNode(xe,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,XC)]),t.createElementVNode("td",{title:t.unref(S)(Y)?t.unref(N)(Y):t.unref(b)(Y)?t.unref(o).t("em.attr.derivedIdNote"):void 0},[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-name-${Y.modelId}`,width:"100%",disabled:t.unref(S)(Y),placeholder:t.unref(_)(Y),"model-value":t.unref(k)(Y),"onUpdate:modelValue":w=>t.unref(h)(Y,w)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])],8,ZC),t.createElementVNode("td",{title:t.unref(D)(Y)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(ne.BSSelect),{name:`aw-type-${Y.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.typePlaceholder"),disabled:t.unref(R)(Y),items:t.unref(fd)(Y.type,t.unref(oe),t.unref(de),t.unref(ie)),"value-provider":t.unref(I),"label-provider":t.unref(x),"model-value":Y.type,"onUpdate:modelValue":w=>t.unref($)(Y,w)},null,8,["name","placeholder","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),Y.type===t.unref(pn)&&!t.unref(D)(Y)?(t.openBlock(),t.createBlock(t.unref(ne.BSTextInput),{key:0,name:`aw-customtype-${Y.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.customTypePlaceholder"),"model-value":Y.customType??"","onUpdate:modelValue":w=>t.unref(U)(Y,w)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])):t.createCommentVNode("",!0)],8,QC),t.createElementVNode("td",null,[Y.attrType!=="RELATION_REF"?(t.openBlock(),t.createBlock(Qt,{key:0,name:`aw-logical-${Y.modelId}`,languages:t.unref(o).languages.value,"active-lang":At.value,placeholder:t.unref(f)(Y,At.value),"model-value":t.unref(u)(Y),"onUpdate:modelValue":w=>t.unref(m)(Y,w)},null,8,["name","languages","active-lang","placeholder","model-value","onUpdate:modelValue"])):(t.openBlock(),t.createElementBlock("span",eS,"—"))]),t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-col-${Y.modelId}`,width:"100%",placeholder:t.unref(E)(Y)??t.unref(o).t("em.attr.columnPlaceholder"),disabled:t.unref(r)||t.unref(P)(Y),"model-value":((Wt=Y.dbAttrs[0])==null?void 0:Wt.physicalName)??"","onUpdate:modelValue":w=>t.unref(F)(Y,{physicalName:w})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),t.createVNode(Do,{controller:t.unref(o),"ref-id":(G=Y.dbAttrs[0])==null?void 0:G.modelId},null,8,["controller","ref-id"])]),t.unref(r)?(t.openBlock(),t.createElementBlock("td",{key:0,title:t.unref(o).t("em.attr.serializedNoColumnNote")},[t.createVNode(t.unref(ne.BSSelect),{name:`aw-container-${Y.modelId}`,width:"100%",items:[...t.unref(p)],"value-provider":t.unref(d),"label-provider":w=>w==="none"?t.unref(o).t("em.attr.serializedContainerNone"):w,"model-value":Y.collectionType??"none","onUpdate:modelValue":w=>w&&t.unref(y)(Y,w)},null,8,["name","items","value-provider","label-provider","model-value","onUpdate:modelValue"])],8,tS)):(t.openBlock(),t.createElementBlock("td",{key:1,title:t.unref(D)(Y)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(ne.BSSelect),{name:`aw-dtype-${Y.modelId}`,width:"100%",placeholder:"dataType",disabled:t.unref(P)(Y)||t.unref(D)(Y),items:t.unref(ld)(((ae=Y.dbAttrs[0])==null?void 0:ae.dataType)??"",t.unref(o).selectableDataTypes.value),"value-provider":t.unref(d),"label-provider":t.unref(hl),"model-value":((De=Y.dbAttrs[0])==null?void 0:De.dataType)??"","onUpdate:modelValue":w=>w&&t.unref(F)(Y,{dataType:w})},null,8,["name","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"])],8,nS)),t.createElementVNode("td",{title:t.unref(D)(Y)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(ne.BSNumberInput),{name:`aw-len-${Y.modelId}`,width:"100%",placeholder:"len",disabled:t.unref(P)(Y)||t.unref(D)(Y),"model-value":(je=Y.dbAttrs[0])==null?void 0:je.length,"onUpdate:modelValue":w=>t.unref(F)(Y,{length:w||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,oS),t.createElementVNode("td",{class:"c-constraints",title:t.unref(D)(Y)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createElementVNode("div",aS,[t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-pk-${Y.modelId}`,label:"PK","model-value":Y.identifier,disabled:t.unref(a)||t.unref(P)(Y)||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(O)(Y,w)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-nn-${Y.modelId}`,label:"NN","model-value":t.unref(r)?!1:Y.notNull,disabled:t.unref(r)||t.unref(P)(Y)||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(g)(Y,{notNull:w})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-uq-${Y.modelId}`,label:"UQ","model-value":!!((bt=Y.dbAttrs[0])!=null&&bt.unique),disabled:t.unref(P)(Y)||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(F)(Y,{unique:w})},null,8,["name","model-value","disabled","onUpdate:modelValue"])])],8,iS),t.createElementVNode("td",{class:"c-del",title:t.unref(A)(Y)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:w=>t.unref(o).removeAttribute(t.unref(i).modelId,Y.modelId)},null,8,["onClick"])],8,rS)],2),t.unref(b)(Y)?(t.openBlock(),t.createElementBlock("tr",lS,[ze[8]||(ze[8]=t.createElementVNode("td",{class:"c-expand"},null,-1)),t.createElementVNode("td",sS,"↳ "+t.toDisplayString(t.unref(o).t("em.attr.assocField")),1),t.createElementVNode("td",{colspan:"7",title:t.unref(o).t("em.attr.derivedIdNote")},[t.createVNode(t.unref(ne.BSTextInput),{name:`aw-assocname-${Y.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.namePlaceholder"),"model-value":t.unref(C)(Y),"onUpdate:modelValue":w=>t.unref(v)(Y,w)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])],8,cS)])):t.createCommentVNode("",!0),ut(Y.modelId)?(t.openBlock(),t.createElementBlock("tr",{key:1,class:t.normalizeClass(["em-aw__detail-row",{"is-focused":t.unref(l).has(Y.modelId)}])},[ze[14]||(ze[14]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",dS,[t.createElementVNode("div",uS,[t.createElementVNode("fieldset",mS,[ze[12]||(ze[12]=t.createElementVNode("legend",null,"DB",-1)),t.createElementVNode("label",{class:"em-aw__df",title:t.unref(j)(Y)},[ze[9]||(ze[9]=t.createElementVNode("span",null,"scale",-1)),t.createVNode(t.unref(ne.BSNumberInput),{name:`aw-scale-${Y.modelId}`,width:"72px",placeholder:"scale",disabled:t.unref(P)(Y)||t.unref(D)(Y)||!t.unref(B)(Y),"model-value":(Vt=Y.dbAttrs[0])==null?void 0:Vt.scale,"onUpdate:modelValue":w=>t.unref(F)(Y,{scale:w||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,fS),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-ai-${Y.modelId}`,label:"Auto Increment","model-value":!!((Ye=Y.dbAttrs[0])!=null&&Ye.autoIncrement),disabled:t.unref(P)(Y)||t.unref(D)(Y)||!Y.identifier,"onUpdate:modelValue":w=>t.unref(F)(Y,{autoIncrement:w})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createElementVNode("label",pS,[ze[10]||(ze[10]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(ne.BSSelect),{name:`aw-ins-${Y.modelId}`,width:"110px",disabled:t.unref(P)(Y),"model-value":t.unref(ve)(Y.dbAttrs[0]),items:t.unref(ht),"value-provider":t.unref(d),"label-provider":t.unref(re),"onUpdate:modelValue":w=>w&&t.unref(me)(Y,w)},null,8,["name","disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",hS,[ze[11]||(ze[11]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(ne.BSSelect),{name:`aw-upd-${Y.modelId}`,width:"110px",disabled:t.unref(P)(Y),"model-value":t.unref(Me)(Y.dbAttrs[0]),items:t.unref(Re),"value-provider":t.unref(d),"label-provider":t.unref(Pe),"onUpdate:modelValue":w=>w&&t.unref(Ot)(Y,w)},null,8,["name","disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])])]),t.createElementVNode("fieldset",yS,[ze[13]||(ze[13]=t.createElementVNode("legend",null,"JPA",-1)),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-tr-${Y.modelId}`,label:"@Transient","model-value":!!Y.transient,disabled:Y.identifier||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(z)(Y,w)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-nid-${Y.modelId}`,label:"@NaturalId","model-value":!!Y.naturalId,disabled:Y.identifier||t.unref(P)(Y)||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(T)(Y,w)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{class:"em-aw__dsub",name:`aw-nidm-${Y.modelId}`,label:"mutable","model-value":!!Y.naturalIdMutable,disabled:t.unref(P)(Y)||!Y.naturalId,"onUpdate:modelValue":w=>t.unref(g)(Y,{naturalIdMutable:w||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`aw-mv-${Y.modelId}`,label:"Multi-Value (Set)","model-value":!!((Ue=Y.dbAttrs[0])!=null&&Ue.multiValue),disabled:t.unref(P)(Y)||t.unref(D)(Y),"onUpdate:modelValue":w=>t.unref(F)(Y,{multiValue:w||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),t.unref(D)(Y)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("fieldset",gS,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.attr.semanticLegend")),1),t.createElementVNode("label",bS,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createVNode(t.unref(ne.BSSelect),{width:"150px","model-value":t.unref(X)(Y),items:t.unref(s),"value-provider":t.unref(d),"label-provider":t.unref(c),"onUpdate:modelValue":w=>w&&t.unref(W)(Y,w)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.unref(Le).length?(t.openBlock(),t.createElementBlock("label",kS,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.codeGroup")),1),t.createVNode(kh,{"model-value":Y.groupCode,items:t.unref(Le),locale:t.unref(o).uiLocale.value,"onUpdate:modelValue":w=>t.unref(V)(Y,w)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.createElementVNode("label",_S,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.defaultValue")),1),t.unref(Se)(Y).length?(t.openBlock(),t.createBlock(t.unref(ne.BSSelect),{key:0,width:"150px","model-value":Y.defaultValue??"none",items:t.unref(ce)(Y),"value-provider":t.unref(pe),"label-provider":t.unref(he),"onUpdate:modelValue":w=>w&&t.unref(L)(Y,w)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])):(t.openBlock(),t.createBlock(t.unref(ne.BSTextInput),{key:1,name:`aw-default-${Y.modelId}`,width:"150px",placeholder:t.unref(o).t("em.attr.defaultValue"),"model-value":Y.defaultValue??"","onUpdate:modelValue":w=>t.unref(K)(Y,w)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))])])),t.createElementVNode("fieldset",ES,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`aw-desc-${Y.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":Y.description,"onUpdate:modelValue":w=>t.unref(Z)(Y,w)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])])])],2)):t.createCommentVNode("",!0)],64))],64)}),128)),t.unref(i).attributes.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("tr",XS,[t.createElementVNode("td",ZS,t.toDisplayString(t.unref(o).t("em.attr.empty")),1)]))])])])],8,OC)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-472632d9"]]);function oc(e,n){return n&&n!==e?`${e} (${n})`:e}function Nh(e,n,o){const i=e.dbAttrs[n];return i?_i(e,i,n,o.entity,o.logical,{embeddableCatalog:o.embeddableCatalog}):""}function tR(e,n){const o=e.name||n.t("em.index.unnamedAttr");return e.dbAttrs.length>1?n.t("em.index.multiColumn",{name:o,n:e.dbAttrs.length}):oc(o,Nh(e,0,n))}function ic(e,n){var l;if(co(e)){const s=(l=n.inherited)==null?void 0:l.find(c=>c.modelId===e);return s?oc(s.field,s.physicalName):e}const o=n.resolver.attributeOf(e);if(!o)return e;const i=o.name||n.t("em.index.unnamedAttr"),a=n.resolver.columnOf(e);if(!a)return n.t("em.index.colUnspecified",{name:i,n:o.dbAttrs.length});const r=o.dbAttrs.findIndex(s=>s.modelId===a.modelId);return oc(i,Nh(o,r<0?0:r,n))}function wh(e){const n=[];for(const o of e.entity.attributes??[]){const i=o.dbAttrs.filter(a=>!a.sharedColumnRef);if(i.length!==0){if(o.dbAttrs.length===1){n.push({ref:o.modelId,label:tR(o,e)});continue}for(const a of i)n.push({ref:a.modelId,label:ic(a.modelId,e)})}}return n}const nR=["disabled"],oR={class:"em-idxw__list"},iR={class:"em-idxw__list-head"},aR=["aria-label"],rR=["aria-current","onClick","onKeydown"],lR={class:"em-idxw__item-name"},sR={key:0,class:"em-idxw__badge"},cR={class:"em-idxw__item-cnt"},dR={key:0,class:"em-idxw__empty"},uR={key:0,class:"em-idxw__edit"},mR={class:"em-idxw__form"},fR={class:"em-field em-idxw__name"},pR={class:"em-field"},hR=["value","placeholder"],yR={class:"em-idxw__transfer"},gR={class:"em-idxw__pane"},bR={class:"em-idxw__pane-head"},kR=["aria-label"],_R=["aria-pressed","onClick","onKeydown"],ER=["title"],NR={key:0,class:"em-idxw__empty"},wR={class:"em-idxw__arrows"},IR={class:"em-idxw__pane"},vR={class:"em-idxw__pane-head"},CR={class:"em-idxw__col-name"},SR=["title"],RR={class:"em-idxw__col-ops"},AR=["title","disabled","onClick"],xR=["title","disabled","onClick"],$R=["title","onClick"],TR={key:0,class:"em-idxw__empty"},MR={key:1,class:"em-idxw__edit em-idxw__edit--empty"},VR=tt(t.defineComponent({__name:"EntityIndexesWide",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=t.computed(()=>o.state.logical.entities.find(D=>D.modelId===n.entityId)??null),a=t.computed(()=>{var D;return((D=i.value)==null?void 0:D.indexes)??[]}),r=t.computed(()=>{var D;return((D=i.value)==null?void 0:D.attributes)??[]}),l=t.ref(null),s=t.ref(null);t.watch(a,D=>{var E;D.some(R=>R.modelId===s.value)||(s.value=((E=D[0])==null?void 0:E.modelId)??null)},{immediate:!0});const c=t.computed(()=>a.value.find(D=>D.modelId===s.value)??null),d=t.computed(()=>i.value?bi(i.value,o.superClassCatalog.value):[]),u=t.computed(()=>so(r.value)),m=D=>u.value.canon(D),f=t.computed(()=>{var D;return new Set((((D=c.value)==null?void 0:D.columns)??[]).map(E=>m(E.columnRef)))}),p=t.computed(()=>({entity:i.value??{modelId:"",name:"",stereotype:"JPA_ENTITY",attributes:[]},logical:o.state.logical,resolver:u.value,inherited:d.value,embeddableCatalog:o.embeddableCatalog.value,t:o.t}));function y(D){return D.physicalName&&D.physicalName!==D.field?`${D.field} (${D.physicalName})`:D.field}function g(D){return ic(D,p.value)}const b=t.computed(()=>[...wh(p.value).filter(D=>!f.value.has(m(D.ref))).map(D=>({ref:D.ref,label:D.label,inherited:!1})),...d.value.filter(D=>!f.value.has(m(D.modelId))).map(D=>({ref:D.modelId,label:y(D),inherited:!0}))]),k=t.ref(new Set);t.watch(s,()=>k.value=new Set);function _(D){return co(D)}function h(D,E){i.value&&o.updateIndex(i.value.modelId,D,E)}function C(){var E;if(!i.value)return;const D=Fe();o.addIndex(i.value.modelId,{modelId:D,name:`idx_${(((E=i.value.indexes)==null?void 0:E.length)??0)+1}`,unique:!1,columns:[]}),s.value=D}function v(D){i.value&&o.removeIndex(i.value.modelId,D)}function S(D){c.value&&h(c.value.modelId,{parameters:D.trim()===""?void 0:D})}function N(D){const E=new Set(k.value);E.has(D)?E.delete(D):E.add(D),k.value=E}function A(){const D=c.value;if(!D||!k.value.size)return;const E=[...k.value].map(R=>({columnRef:R,descending:!1}));h(D.modelId,{columns:[...D.columns,...E]}),k.value=new Set}function T(D){const E=c.value;E&&h(E.modelId,{columns:E.columns.filter((R,I)=>I!==D)})}function O(D,E){const R=c.value;R&&h(R.modelId,{columns:R.columns.map((I,x)=>x===D?{...I,descending:E}:I)})}function z(D,E){const R=c.value;if(!R)return;const I=D+E;if(I<0||I>=R.columns.length)return;const x=[...R.columns];[x[D],x[I]]=[x[I],x[D]],h(R.modelId,{columns:x}),P(I,E)}async function P(D,E){var U,F;await t.nextTick();const R=(U=l.value)==null?void 0:U.querySelectorAll(".em-idxw__col--idx")[D];if(!R)return;const I=B=>R.querySelector(`[data-move="${B}"]`),x=I(E<0?"up":"down"),$=I(E<0?"down":"up");(F=x&&!x.disabled?x:$)==null||F.focus()}return(D,E)=>i.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-idxw",disabled:!t.unref(o).editable.value},[t.createElementVNode("aside",oR,[t.createElementVNode("div",iR,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.index.section",{n:a.value.length})),1),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:C},null,8,["caption"])]),t.createElementVNode("ul",{role:"group","aria-label":t.unref(o).t("em.index.section",{n:a.value.length})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,R=>(t.openBlock(),t.createElementBlock("li",{key:R.modelId,class:t.normalizeClass(["em-idxw__item",{"is-active":R.modelId===s.value}]),role:"button",tabindex:"0","aria-current":R.modelId===s.value?"true":void 0,onClick:I=>s.value=R.modelId,onKeydown:[t.withKeys(t.withModifiers(I=>s.value=R.modelId,["prevent"]),["enter"]),t.withKeys(t.withModifiers(I=>s.value=R.modelId,["prevent"]),["space"])]},[t.createElementVNode("span",lR,t.toDisplayString(R.name||t.unref(o).t("em.attr.nameless")),1),R.unique?(t.openBlock(),t.createElementBlock("span",sR,"UQ")):t.createCommentVNode("",!0),t.createElementVNode("span",cR,t.toDisplayString(R.columns.length),1)],42,rR))),128))],8,aR),a.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",dR,t.toDisplayString(t.unref(o).t("em.index.empty")),1))]),c.value?(t.openBlock(),t.createElementBlock("section",uR,[t.createElementVNode("div",mR,[t.createElementVNode("label",fR,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.index.namePlaceholder")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"idxw-name",width:"100%","model-value":c.value.name,"onUpdate:modelValue":E[0]||(E[0]=R=>h(c.value.modelId,{name:R}))},null,8,["model-value"]),t.createVNode(Do,{controller:t.unref(o),"ref-id":c.value.modelId},null,8,["controller","ref-id"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:"idxw-uq",class:"em-check em-idxw__uq",label:"unique","model-value":c.value.unique,"onUpdate:modelValue":E[1]||(E[1]=R=>h(c.value.modelId,{unique:R}))},null,8,["model-value"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn em-idxw__del",caption:t.unref(o).t("em.index.delete"),onClick:E[2]||(E[2]=R=>v(c.value.modelId))},null,8,["caption"])]),t.createElementVNode("label",pR,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.index.condition")),1),t.createElementVNode("textarea",{class:"em-textarea",value:c.value.parameters??"",rows:"2",placeholder:t.unref(o).t("em.index.conditionPlaceholderWide"),onChange:E[3]||(E[3]=R=>S(R.target.value))},null,40,hR)]),t.createElementVNode("div",yR,[t.createElementVNode("div",gR,[t.createElementVNode("div",bR,t.toDisplayString(t.unref(o).t("em.index.availColumns",{n:b.value.length})),1),t.createElementVNode("ul",{class:"em-idxw__cols",role:"group","aria-label":t.unref(o).t("em.index.availColumns",{n:b.value.length})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,R=>(t.openBlock(),t.createElementBlock("li",{key:R.ref,class:t.normalizeClass(["em-idxw__col",{"is-sel":k.value.has(R.ref)}]),role:"button",tabindex:"0","aria-pressed":k.value.has(R.ref),onClick:I=>N(R.ref),onKeydown:[t.withKeys(t.withModifiers(I=>N(R.ref),["prevent"]),["enter"]),t.withKeys(t.withModifiers(I=>N(R.ref),["prevent"]),["space"])]},[t.createTextVNode(t.toDisplayString(R.label),1),R.inherited?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-idxw__inh",title:t.unref(o).t("em.index.inheritedColTitle")},t.toDisplayString(t.unref(o).t("em.index.inheritedBadge")),9,ER)):t.createCommentVNode("",!0)],42,_R))),128))],8,kR),b.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",NR,t.toDisplayString(t.unref(o).t("em.index.allColumnsUsed")),1))]),t.createElementVNode("div",wR,[t.createVNode(t.unref(ne.BSButton),{caption:t.unref(o).t("em.index.addArrow"),disabled:!k.value.size,onClick:A},null,8,["caption","disabled"])]),t.createElementVNode("div",IR,[t.createElementVNode("div",vR,t.toDisplayString(t.unref(o).t("em.index.indexColumns",{n:c.value.columns.length})),1),t.createElementVNode("ul",{ref_key:"colsUl",ref:l,class:"em-idxw__cols"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value.columns,(R,I)=>(t.openBlock(),t.createElementBlock("li",{key:I,class:"em-idxw__col em-idxw__col--idx"},[t.createElementVNode("span",CR,[t.createTextVNode(t.toDisplayString(g(R.columnRef)),1),_(R.columnRef)?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-idxw__inh",title:t.unref(o).t("em.index.inheritedColTitle")},t.toDisplayString(t.unref(o).t("em.index.inheritedBadge")),9,SR)):t.createCommentVNode("",!0)]),t.createVNode(t.unref(ne.BSCheckbox),{name:`idxw-desc-${I}`,class:"em-check",label:"DESC","model-value":R.descending,"onUpdate:modelValue":x=>O(I,x)},null,8,["name","model-value","onUpdate:modelValue"]),t.createElementVNode("span",RR,[t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn","data-move":"up",title:t.unref(o).t("em.index.moveUp"),disabled:I===0,onClick:x=>z(I,-1)},"↑",8,AR),t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn","data-move":"down",title:t.unref(o).t("em.index.moveDown"),disabled:I===c.value.columns.length-1,onClick:x=>z(I,1)},"↓",8,xR),t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn em-idxw__opbtn--del",title:t.unref(o).t("em.index.removeColumn"),onClick:x=>T(I)},"✕",8,$R)])]))),128)),c.value.columns.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("li",TR,t.toDisplayString(t.unref(o).t("em.index.noColumns")),1))],512)])])])):(t.openBlock(),t.createElementBlock("section",MR,t.toDisplayString(t.unref(o).t("em.index.selectPrompt")),1))],8,nR)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-76dd7610"]]),LR={class:"em-op-src"},BR=["placeholder"],DR={class:"em-op-src__actions"},Ih=tt(t.defineComponent({__name:"OperationSourceEditor",props:{operationName:{},sourceCode:{},onSave:{type:Function},locale:{}},setup(e){const n=e,o=ne.useModalHandle(),i=(l,s)=>cn(n.locale??"ko",l,s),a=t.ref(n.sourceCode);function r(){n.onSave(a.value),o.close()}return(l,s)=>(t.openBlock(),t.createBlock(t.unref(ne.BSModalFrame),{title:i("em.opSource.title",{name:n.operationName})},{default:t.withCtx(()=>[t.createElementVNode("div",LR,[t.withDirectives(t.createElementVNode("textarea",{"onUpdate:modelValue":s[0]||(s[0]=c=>a.value=c),class:"em-op-src__area",spellcheck:"false",placeholder:i("em.opSource.placeholder")},null,8,BR),[[t.vModelText,a.value]]),t.createElementVNode("div",DR,[t.createVNode(t.unref(ne.BSButton),{caption:i("em.common.save"),onClick:r},null,8,["caption"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:i("em.common.close"),onClick:s[1]||(s[1]=c=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-34c9b822"]]),OR=["disabled"],PR={class:"em-ow__toolbar"},zR={class:"em-ow__count"},FR={class:"em-ow__scroll"},UR={class:"em-ow__table"},HR={class:"c-name"},jR={class:"c-desc"},KR=["id"],GR={class:"c-pii"},YR={class:"c-src"},qR={class:"c-del"},WR={key:0},JR={colspan:"6",class:"em-ow__empty"},XR=tt(t.defineComponent({__name:"EntityOperationsWide",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=ne.useModal(),a=t.computed(()=>o.state.logical.entities.find(b=>b.modelId===n.entityId)??null),r=t.computed(()=>{var b;return[...((b=a.value)==null?void 0:b.operations)??[]].sort((k,_)=>k.order-_.order)}),l=t.ref(o.userLanguage.value),s=["PUBLIC","PROTECTED","PACKAGE","PRIVATE"],c=["none","PASSWORD","SOCIAL_SECURITY_NO","PASSPORT_NO","ALIEN_REGISTRATION_NO","DRIVERS_LICENSE_NO","BIOMETRICS","CREDITCARD_NO","ACCOUNT_NO","MEMBERSHIP_CARD_NO","ID","NAME","DATE_OF_BIRTH","PHONE_NO","EMAIL_ADDRESS","ADDRESS","IP_ADDRESS"];function d(b){return b==="none"?o.t("em.common.noneParen"):b}const u=b=>b;function m(b,k){a.value&&o.updateOperation(a.value.modelId,b.modelId,k)}function f(b,k){m(b,{description:Object.keys(k).length?k:void 0})}function p(b){return b.personalInfoAttributeType??"none"}function y(b,k){m(b,{personalInfoAttributeType:k==="none"?void 0:k})}function g(b){i.openModal({component:Ih,bind:{operationName:b.name,sourceCode:b.sourceCode??"",locale:o.uiLocale.value,onSave:k=>m(b,{sourceCode:k})}})}return(b,k)=>{var _,h;return a.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-ow",disabled:!t.unref(o).editable.value},[t.createElementVNode("div",PR,[t.createElementVNode("span",zR,t.toDisplayString(t.unref(o).t("em.op.section",{n:((_=a.value.operations)==null?void 0:_.length)??0})),1),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:k[0]||(k[0]=C=>t.unref(o).addOperation(a.value.modelId))},null,8,["caption"])]),t.createElementVNode("div",FR,[t.createElementVNode("table",UR,[t.createElementVNode("thead",null,[t.createElementVNode("tr",null,[t.createElementVNode("th",HR,t.toDisplayString(t.unref(o).t("em.attr.namePlaceholder")),1),k[2]||(k[2]=t.createElementVNode("th",{class:"c-vis"},"visibility",-1)),t.createElementVNode("th",jR,[t.createElementVNode("span",{id:`ow-desc-head-${a.value.modelId}`},t.toDisplayString(t.unref(o).t("em.common.description")),9,KR),t.createVNode(_h,{modelValue:l.value,"onUpdate:modelValue":k[1]||(k[1]=C=>l.value=C),languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"labelled-by":`ow-desc-head-${a.value.modelId}`},null,8,["modelValue","languages","default-lang","labelled-by"])]),t.createElementVNode("th",GR,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createElementVNode("th",YR,t.toDisplayString(t.unref(o).t("em.op.body")),1),k[3]||(k[3]=t.createElementVNode("th",{class:"c-del"},null,-1))])]),t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,C=>(t.openBlock(),t.createElementBlock("tr",{key:C.modelId},[t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSTextInput),{name:`ow-name-${C.modelId}`,width:"100%",placeholder:t.unref(o).t("em.op.namePlaceholder"),"model-value":C.name,"onUpdate:modelValue":v=>m(C,{name:v})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSSelect),{width:"100%","model-value":C.visibility??"PACKAGE",items:s,"value-provider":u,"label-provider":u,"onUpdate:modelValue":v=>v&&m(C,{visibility:v})},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(Qt,{name:`ow-desc-${C.modelId}`,languages:t.unref(o).languages.value,"active-lang":l.value,"model-value":C.description,"onUpdate:modelValue":v=>f(C,v)},null,8,["name","languages","active-lang","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSSelect),{width:"100%","model-value":p(C),items:c,"value-provider":u,"label-provider":d,"onUpdate:modelValue":v=>v&&y(C,v)},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t(C.sourceCode?"em.op.bodyDirty":"em.op.body"),onClick:v=>g(C)},null,8,["caption","onClick"])]),t.createElementVNode("td",qR,[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:v=>t.unref(o).removeOperation(a.value.modelId,C.modelId)},null,8,["onClick"])])]))),128)),(h=a.value.operations)!=null&&h.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("tr",WR,[t.createElementVNode("td",JR,t.toDisplayString(t.unref(o).t("em.op.empty")),1)]))])])])],8,OR)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-743b04a6"]]),ZR={class:"em-detail__tabs"},QR=["onClick"],eA={key:0,class:"em-detail__lock"},tA=["disabled"],nA={key:0,class:"em-detail__narrow"},oA=tt(t.defineComponent({__name:"EntityDetailModal",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=ne.useModalHandle(),a=t.computed(()=>o.isEntityLocked(n.entityId)),r=t.computed(()=>o.state.logical.entities.find(c=>c.modelId===n.entityId)??null);t.watch(r,c=>{c||i.close()});const l=[{key:"basics",labelKey:"em.detail.tabBasics"},{key:"columns",labelKey:"em.detail.tabColumns"},{key:"indexes",labelKey:"em.detail.tabIndexes"},{key:"operations",labelKey:"em.detail.tabOperations"}],s=t.ref("basics");return(c,d)=>{var u;return t.openBlock(),t.createBlock(t.unref(ne.BSModalFrame),{title:t.unref(o).t("em.detail.title",{name:((u=r.value)==null?void 0:u.name)??""})},{default:t.withCtx(()=>[r.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["em-detail",{"is-maximized":t.unref(i).maximized}])},[t.createElementVNode("nav",ZR,[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(l,m=>t.createElementVNode("button",{key:m.key,type:"button",class:t.normalizeClass(["em-detail__tab",{"is-active":s.value===m.key}]),onClick:f=>s.value=m.key},t.toDisplayString(t.unref(o).t(m.labelKey)),11,QR)),64))]),a.value?(t.openBlock(),t.createElementBlock("div",eA,[t.createVNode(xe,{name:"lock",size:13}),t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.panel.lockedBanner")),1),t.unref(o).editable.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-detail__unlock",onClick:d[0]||(d[0]=m=>t.unref(o).setEntityLocked(e.entityId,!1))},t.toDisplayString(t.unref(o).t("em.panel.unlock")),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("fieldset",{class:t.normalizeClass(["em-detail__body",{"is-readonly":!t.unref(o).editable.value||a.value}]),disabled:!t.unref(o).editable.value||a.value},[s.value==="basics"?(t.openBlock(),t.createElementBlock("div",nA,[t.createVNode(fh,{controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])])):s.value==="columns"?(t.openBlock(),t.createBlock(eR,{key:1,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])):s.value==="indexes"?(t.openBlock(),t.createBlock(VR,{key:2,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])):(t.openBlock(),t.createBlock(XR,{key:3,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"]))],10,tA)],2)):t.createCommentVNode("",!0)]),_:1},8,["title"])}}}),[["__scopeId","data-v-328396cc"]]);function Lr(e,n,o){e.openModal({component:oA,bind:{controller:t.markRaw(n),entityId:o}})}function iA(e){const{state:n,editable:o,run:i,gateEntityLocked:a,gateAssocLocked:r}=e;return{addAssociation(l,s,c,d){if(!o.value||a(l)||a(s))return null;const u=Fe(),m={modelId:u,end1:{entityRef:l,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!1,composition:!1},end2:{entityRef:s,multiplicity:"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:!1}},f={...n.logical,associations:[...n.logical.associations,m]},p=Ci(f,s,Fe),y=p.add[0];y&&(m.end2.attributeRef=y.modelId);const g={associationRef:u,waypoints:[],sourceColumnRef:c,targetColumnRef:(y==null?void 0:y.modelId)??d},b=Ka(m,g),k=Wa(f,s,p,[]);return i(k.length?rt("관계 추가",[b,...k]):b),u},addEmbedAssociation(l,s){if(!o.value||a(l))return null;const c=n.logical.entities.find(S=>S.modelId===l),d=n.logical.entities.find(S=>S.modelId===s);if(!c||!d||d.stereotype!=="JPA_EMBEDDABLE")return null;const u=Fe(),m=Fe(),f=Fe(),p=Jt(c.attributes),y=Sm(d),g=S=>S&&S.charAt(0).toLowerCase()+S.slice(1),b=new Set(c.attributes.map(S=>S.name)),k=g(d.name);let _=k;for(let S=2;b.has(_);S++)_=`${k}${S}`;const h={modelId:m,name:_,type:d.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:p,dbAttrs:y,embedded:{associationRef:u,embeddableRef:s}},C={modelId:u,end1:{entityRef:l,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:f},end2:{entityRef:s,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:m}},v={associationRef:u,waypoints:[],sourceColumnRef:m,targetColumnRef:void 0};return i(rt("임베드 추가",[Xt(l,h),Ka(C,v)])),u},setEmbedCardinality(l,s){var k;if(r(l))return;const c=n.logical.associations.find(_=>_.modelId===l);if(!c)return;let d,u;for(const _ of n.logical.entities){const h=_.attributes.find(C=>{var v;return((v=C.embedded)==null?void 0:v.associationRef)===l&&C.attrType==="EMBED_OWN"});if(h){d=_.modelId,u=h;break}}if(!d||!u)return;const m=u.embedded.embeddableRef,f=c.end2.entityRef===m?"end2":"end1",p=c[f];if(p.multiplicity===s)return;const y=_=>_==="ZERO_OR_MORE_INSTANCES"||_==="ONE_OR_MORE_INSTANCES",g=y(p.multiplicity),b=y(s);if(g===b){i(on(l,f,{multiplicity:s}));return}if(b)i(rt("임베드 컬렉션 전환",[nn(d,u.modelId,{dbAttrs:[]}),on(l,f,{multiplicity:s,jpa:{...p.jpa,collectionType:((k=p.jpa)==null?void 0:k.collectionType)??"LIST"}})]));else{const _=n.logical.entities.find(h=>h.modelId===m);if(!_)return;i(rt("임베드 단일 전환",[nn(d,u.modelId,{dbAttrs:Sm(_)}),on(l,f,{multiplicity:s,jpa:{...p.jpa,collectionType:void 0,collectionTable:void 0,orderColumn:void 0}})]))}},removeAssociation(l){if(r(l))return;const s=n.logical.associations.find(p=>p.modelId===l),c=Yu(l);if(!s){i(c);return}for(const p of n.logical.entities){const y=p.attributes.find(g=>{var b;return((b=g.embedded)==null?void 0:b.associationRef)===l});if(y){const g=[];i(rt("임베드 삭제",[c,...yn(p.modelId,[y.modelId],g),...Zt(n.logical,g)]));return}}const d=s.end2.entityRef,u={...n.logical,associations:n.logical.associations.filter(p=>p.modelId!==l)},m=[],f=Ja(u,[d],m);if(s.end1.attributeRef){const p=n.logical.entities.find(g=>g.modelId===s.end1.entityRef),y=p==null?void 0:p.attributes.find(g=>g.modelId===s.end1.attributeRef&&g.attrType==="RELATION_REF");y&&f.push(...yn(p.modelId,[y.modelId],m))}f.push(...Zt(n.logical,m)),i(f.length?rt("관계 삭제",[c,...f]):c)},setAssociationIdentifying(l,s){if(r(l))return;const c=n.logical.associations.find(y=>y.modelId===l),d=Ga(l,{identifying:s});if(!c||c.identifying===s){i(d);return}const u=c.end2.entityRef,m={...n.logical,associations:n.logical.associations.map(y=>y.modelId===l?{...y,identifying:s}:y)},f=[],p=Ja(m,[u],f);p.push(...Zt(n.logical,f)),i(p.length?rt("식별 관계 변경",[d,...p]):d)},updateAssociationEnd(l,s,c){if(r(l))return;const d=n.logical.associations.find(u=>u.modelId===l);if(d&&s==="end1"&&"navigable"in c&&c.navigable!==d.end1.navigable){const u=Am(n.logical,l,c.navigable===!0);if(u){const m=on(l,"end1",{...c,...u.endPatch}),f=u.endPatch.attributeRef?[...u.cmds,m]:[...u.cmds,m];i(f.length>1?rt(c.navigable===!0?"inverse nav 추가":"inverse nav 제거",f):m);return}}i(on(l,s,c))}}}function aA(e){const{state:n,editable:o,run:i,gateEntityLocked:a,embeddableCatalog:r,predefinedCustomTypeCatalog:l,t:s,emitGateNotice:c,selection:d}=e,u=(m,f,p)=>{if(a(m))return;const y=nn(m,f,p),g=Vn(n.logical,m,_=>_.map(h=>h.modelId===f?{...h,...p}:h)),b=[],k=Li(g,m,b);k.push(...Zt(n.logical,b)),i(k.length?rt("속성 수정",[y,...k]):y)};return{addPredefinedEmbed(m,f){if(!o.value||a(m))return null;const p=r.value.find(h=>h.type===f),y=n.logical.entities.find(h=>h.modelId===m);if(!p||!y)return null;const g=Jt(y.attributes),b=Fe(),k=p.fields.map(()=>({modelId:Fe(),physicalName:"",dataType:""})),_={modelId:b,name:p.defaultName,type:p.type,attrType:"EMBED_PREDEF",identifier:!1,notNull:!1,order:g,dbAttrs:k};return i(Xt(m,_)),b},convertAttributeType(m,f,p){if(!o.value||a(m))return null;const y=n.logical.entities.find(I=>I.modelId===m),g=y==null?void 0:y.attributes.find(I=>I.modelId===f);if(!y||!g||g.attrType!=="NORMAL"&&g.attrType!=="EMBED_PREDEF"||g.groupCode||!p||p===g.type||Jn(n.logical,m,f))return null;const b=r.value.find(I=>I.type===p),k=b?void 0:l.value.find(I=>I.type===p),_=b?b.fields.length:1,h=g.dbAttrs.length===_;if(b&&g.identifier&&!h)return c(s("em.attr.embedConvertPkBlocked")),null;const C=Array.from({length:_},(I,x)=>{const $=h?{...g.dbAttrs[x]}:{modelId:Fe(),physicalName:b?"":g.name,dataType:""};return k?hd($,k):$}),{customType:v,...S}=g,N=Fe(),A={...S,modelId:N,type:p,attrType:b?"EMBED_PREDEF":"NORMAL",identifier:g.identifier,dbAttrs:C};p===pn&&v!==void 0&&(A.customType=v);const T=[],O=yn(m,[f],T),z=Vn(n.logical,m,I=>I.filter(x=>x.modelId!==f)),P=new Map;if(h){for(const I of C)P.set(I.modelId,I.modelId);P.set(f,C.length===1?C[0].modelId:N)}const D=Im(n.logical,m,[f]),E=[...Nm(z,m,T),...Zt(n.logical,T,P),...D.commands],R=Vn(D.projected,m,I=>[...I.filter(x=>x.modelId!==f),A]);return i(rt("속성 타입 전환",[...O,...E,Xt(m,A),...vm(R,m)])),N},addSerializedTypeAttribute(m,f){if(!o.value||a(m))return null;const p=n.logical.entities.find(_=>_.modelId===m),y=n.logical.entities.find(_=>_.modelId===f);if(!p||!y||!mn(y.stereotype)||!y.name)return null;const g=y.name.charAt(0).toLowerCase()+y.name.slice(1),b=po(g,new Set(p.attributes.map(_=>_.name))),k=Fe();return i(Xt(m,{modelId:k,name:b,type:y.name,attrType:"NORMAL",identifier:!1,notNull:!1,order:Jt(p.attributes),dbAttrs:[{modelId:Fe(),physicalName:b,dataType:"CLOB"}]})),k},addAttribute(m,f={}){if(!o.value||a(m))return null;const p=n.logical.entities.find(S=>S.modelId===m),y=p?Jt(p.attributes):0,g=f.modelId??Fe(),b=f.name??`field${y}`,k={modelId:g,name:b,type:f.type??bl,attrType:f.attrType??"NORMAL",identifier:f.identifier??!1,notNull:f.notNull??!1,order:y,dbAttrs:f.dbAttrs??(p&&mn(p.stereotype)?[]:[{modelId:Fe(),physicalName:b,dataType:"VARCHAR"}]),...f},_=Xt(m,k),h=Vn(n.logical,m,S=>[...S,k]),C=[],v=Li(h,m,C);return v.push(...Zt(n.logical,C)),i(v.length?rt("속성 추가",[_,...v]):_),g},addDivider(m){if(!o.value||a(m))return null;const f=n.logical.entities.find(b=>b.modelId===m),p=f?Jt(f.attributes):0,y=Fe();return i(Xt(m,{modelId:y,name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:p,dbAttrs:[]})),y},updateAttribute(m,f,p){u(m,f,p)},setAttributeGroupCode(m,f,p){u(m,f,{groupCode:p,type:p?An:bl})},setEmbedColumns(m,f,p){var h,C;if(a(m))return;const y=nn(m,f,{dbAttrs:p}),g=(h=n.logical.entities.find(v=>v.modelId===m))==null?void 0:h.attributes.find(v=>v.modelId===f),b=(C=g==null?void 0:g.embedded)==null?void 0:C.associationRef,k=b?n.logical.associations.find(v=>v.modelId===b):void 0,_=[];k&&b&&(k.end1.legacyEmbedRaw&&_.push(on(b,"end1",{legacyEmbedRaw:void 0})),k.end2.legacyEmbedRaw&&_.push(on(b,"end2",{legacyEmbedRaw:void 0}))),i(_.length?rt("임베드 컬럼 수정",[y,..._]):y)},removeAttribute(m,f){if(a(m))return;if(Jn(n.logical,m,f)){c(s("em.attr.fkDeleteHint"));return}const p=[],y=yn(m,[f],p),g=Vn(n.logical,m,_=>_.filter(h=>h.modelId!==f)),b=[...Li(g,m,p),...Zt(n.logical,p),...wm(n.logical,m,[f])],k=[...y,...b];i(k.length===1?k[0]:rt("속성 삭제",k))},removeAttributes(m,f){var h;if(!f.length||a(m))return;const p=f.filter(C=>!Jn(n.logical,m,C));if(p.length<f.length&&c(s("em.attr.fkDeleteHint")),!p.length)return;const y=[],g=yn(m,p,y),b=new Set(p),k=Vn(n.logical,m,C=>C.filter(v=>!b.has(v.modelId))),_=[...g,...Li(k,m,y),...Zt(n.logical,y),...wm(n.logical,m,p)];i(_.length===1?_[0]:rt("속성 삭제",_)),((h=d.value)==null?void 0:h.kind)==="attribute"&&d.value.entityId===m&&(d.value=null)},setAttributeSwatch(m,f,p){i(Ua(m,f,p))},setAttributeSwatches(m,f,p){f.length&&(f.length===1?i(Ua(m,f[0],p)):i(rt("속성 색상",f.map(y=>Ua(m,y,p)))))},reorderAttributes(m,f,p){if(!f.length||a(m))return;const y=as(m,f,p),g=n_(n.logical,m,f,p);i(g.length?rt("속성 재정렬",[y,...g]):y)}}}function rA(e){var i;const n=JSON.parse(JSON.stringify(e));n.modelId=Fe(),n.name=`${e.name}_copy`,(i=n.table)!=null&&i.physicalName&&(n.table.physicalName=`${n.table.physicalName}_copy`);const o=new Map;for(const a of n.attributes){const r=Fe();o.set(a.modelId,r),a.modelId=r;for(const l of a.dbAttrs)l.modelId=Fe()}for(const a of n.indexes??[]){a.modelId=Fe();for(const r of a.columns)r.columnRef=o.get(r.columnRef)??r.columnRef}for(const a of n.operations??[]){const r=Fe();o.set(a.modelId,r),a.modelId=r}return{clone:n,idMap:o}}const lA=220;function sA(e,n){let i=-1/0;for(const r of e.entityLayouts)i=Math.max(i,r.geo.location.x+(r.geo.size.width||lA));for(const r of e.groupLayouts)i=Math.max(i,r.geo.location.x+r.geo.size.width);let a=1/0;for(const r of n.entityLayouts)a=Math.min(a,r.geo.location.x);for(const r of n.groupLayouts)a=Math.min(a,r.geo.location.x);return!Number.isFinite(i)||!Number.isFinite(a)?{x:0,y:0}:{x:i+80-a,y:0}}const ac=(e,n)=>({x:e.x+n.x,y:e.y+n.y});function cA(e){const{state:n,clipboard:o,selection:i,inspectedEntityId:a,editable:r,run:l}=e,s={copy(c){if(c&&c.length){const g=c.filter(b=>n.logical.entities.some(k=>k.modelId===b));if(g.length){o.value=JSON.parse(JSON.stringify({kind:"entities",source:{logical:n.logical,layout:n.layout},selectedIds:g}));return}}const d=i.value;if((d==null?void 0:d.kind)==="attribute"){const g=n.logical.entities.find(k=>k.modelId===d.entityId);if(!g)return;const b=[...g.attributes].sort((k,_)=>k.order-_.order).filter(k=>d.ids.includes(k.modelId));if(!b.length)return;o.value=JSON.parse(JSON.stringify({kind:"attribute",attributes:b}));return}const u=a.value;if(!u)return;const m=n.logical.entities.find(g=>g.modelId===u),f=n.layout.entityLayouts.find(g=>g.entityRef===u);if(!m)return;const p=(f==null?void 0:f.geo)??{location:{x:80,y:80},size:{width:220,height:140}};let y;if(f){const{entityRef:g,geo:b,locked:k,..._}=f;Object.keys(_).length&&(y=_)}o.value=JSON.parse(JSON.stringify({kind:"entity",entity:m,geo:p,layoutExtras:y}))},paste(){if(!r.value)return[];const c=o.value;if(!c)return[];if(c.kind==="entities")return s.importEntities(c.source,c.selectedIds,{placement:{offset:{x:40,y:40}},collisionSuffix:"_copy"});if(c.kind==="attribute"){const p=a.value;if(!p)return[];const y=n.logical.entities.find(C=>C.modelId===p);if(!y)return[];const g=new Set(y.attributes.map(C=>C.name)),b=new Set(y.attributes.flatMap(C=>C.dbAttrs.map(v=>v.physicalName))),k=Jt(y.attributes),_=[],h=c.attributes.map((C,v)=>{const S=JSON.parse(JSON.stringify(C));S.modelId=Fe();for(const N of S.dbAttrs)N.modelId=Fe();g.has(S.name)&&(S.name=po(`${S.name}_copy`,g)),g.add(S.name);for(const N of S.dbAttrs)N.physicalName&&b.has(N.physicalName)&&(N.physicalName=po(`${N.physicalName}_copy`,b)),N.physicalName&&b.add(N.physicalName);return S.order=k+v,_.push(S.modelId),Xt(p,S)});return l(h.length===1?h[0]:rt("속성 붙여넣기",h)),i.value={kind:"attribute",entityId:p,ids:_,anchor:_[_.length-1]},[]}const{clone:d,idMap:u}=rA(c.entity),m={location:{x:c.geo.location.x+40,y:c.geo.location.y+40},size:{...c.geo.size}};let f;if(c.layoutExtras){const p={...c.layoutExtras},y=g=>u.get(g);p.attributeStyles&&(p.attributeStyles=Va(p.attributeStyles,y)),p.operationStyles&&(p.operationStyles=Va(p.operationStyles,y)),f=p}return l(za(d,m,f)),i.value={kind:"entity",id:d.modelId},[d.modelId]},importEntities(c,d,u){if(!r.value)return[];const m=bu(c,d,{existing:n.logical,includeRelated:u==null?void 0:u.includeRelated,collisionSuffix:u==null?void 0:u.collisionSuffix});if(m.logical.entities.length===0)return[];const f=(u==null?void 0:u.placement)??"append-right",p=f==="append-right"?sA(n.layout,m.layout):f.offset,y=new Map(m.layout.entityLayouts.map(h=>[h.entityRef,h])),g=new Map(m.layout.associationLayouts.map(h=>[h.associationRef,h])),b=new Map(m.layout.groupLayouts.map(h=>[h.groupRef,h])),k=[];let _=80;for(const h of m.logical.entities){const C=y.get(h.modelId),v=C?{location:ac(C.geo.location,p),size:{...C.geo.size}}:{location:{x:_+=40,y:80},size:{width:220,height:140}};let S;if(C){const{entityRef:N,geo:A,locked:T,...O}=C;S=O}k.push(za(h,v,S))}for(const h of m.logical.associations){const C=g.get(h.modelId),v=C?{...C,waypoints:C.waypoints.map(S=>ac(S,p))}:{associationRef:h.modelId,waypoints:[]};k.push(Ka(h,v))}for(const h of m.logical.groups){const C=b.get(h.modelId),v=C?{location:ac(C.geo.location,p),size:{...C.geo.size}}:{location:{x:80,y:80},size:{width:320,height:200}};let S;if(C){const{groupRef:N,geo:A,locked:T,memberNoteRefs:O,...z}=C;S=z}k.push(Ha(h,v,S))}return l(rt("다이어그램 가져오기",k)),i.value={kind:"entity",id:m.logical.entities[0].modelId},m.logical.entities.map(h=>h.modelId)}};return s}function dA(e){const{state:n,editable:o,run:i,gateEntityLocked:a,isEntityLockedFn:r,isAssocLockedFn:l,t:s,emitGateNotice:c}=e;return{addEntity(d="NewEntity",u={x:80,y:80}){if(!o.value)return null;const m=Fe(),f={modelId:m,name:d,stereotype:"JPA_ENTITY",table:{physicalName:d.toLowerCase()},attributes:[{modelId:Fe(),name:"id",type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:0,dbAttrs:[{modelId:Fe(),physicalName:"id",dataType:"BIGINT"}]}]};return i(za(f,{location:{...u},size:{width:220,height:140}})),m},renameEntity(d,u){a(d)||i(Ru(d,u))},updateEntity(d,u){if(a(d))return;const m=Fa(d,u),f=n.logical.entities.find(_=>_.modelId===d),p=f==null?void 0:f.stereotype,y=u.stereotype,g=!!y&&!!f&&!!p&<(y)&&!lt(p),b=!!y&&!!f&&!!p&&!lt(y)&<(p);if(!!y&&!!f&&!!p&&y!==p&<(y)&<(p)&&f){const _=n.logical.entities.filter(C=>C.attributes.some(v=>{var S;return((S=v.embedded)==null?void 0:S.embeddableRef)===d}));if(_.length>0){c(s("em.entity.valueTypeSwitchEmbedded",{name:f.name,owners:_.length}));return}const h=Cm(f,y);i(h.length?rt("직렬화 타입 변환",[m,...h]):m);return}if(y==="SERIALIZED_TYPE"&&f){const _=n.logical.associations.filter(h=>h.end1.entityRef===d||h.end2.entityRef===d);if(_.length>0){c(s("em.entity.serializedTypeHasRelations",{name:f.name,count:_.length}));return}}if(g&&f&&y){const _=xm(n.logical,d,y),h=[m,..._];i(h.length>1?rt(y==="SERIALIZED_TYPE"?"직렬화 타입 변환":"임베더블 변환",h):m);return}if(b){const _=Rm(n.logical,d),h=[m,..._];i(h.length>1?rt("엔터티 전환",h):m);return}i(m)},moveEntity(d,u){a(d)||i(Qo(d,u))},resizeEntity(d,u){a(d)||i(Au(d,u))},removeEntity(d){if(a(d))return;const u=Su(d);if(!n.logical.entities.find(_=>_.modelId===d)){i(u);return}const f=n.logical.associations.filter(_=>_.end1.entityRef===d||_.end2.entityRef===d),p=new Set(f.map(_=>_.modelId)),y=[],g=[];for(const _ of n.logical.entities)if(_.modelId!==d)for(const h of _.attributes)h.embedded&&p.has(h.embedded.associationRef)&&y.push(...yn(_.modelId,[h.modelId],g));for(const _ of f){if(_.end1.entityRef===d||!_.end1.attributeRef)continue;const h=n.logical.entities.find(v=>v.modelId===_.end1.entityRef),C=h==null?void 0:h.attributes.find(v=>v.modelId===_.end1.attributeRef&&v.attrType==="RELATION_REF");C&&y.push(...yn(h.modelId,[C.modelId],g))}const b={...n.logical,entities:n.logical.entities.filter(_=>_.modelId!==d),associations:n.logical.associations.filter(_=>!p.has(_.modelId))},k=new Set(f.filter(_=>_.end1.entityRef===d&&_.end2.entityRef!==d).map(_=>_.end2.entityRef));y.push(...Ja(b,[...k],g)),y.push(...Zt(n.logical,g.filter(_=>_.entityId!==d))),i(y.length?rt("엔티티 삭제",[u,...y]):u)},setEntitySwatch(d,u){i(xu(d,u))},setEntityCollapsed(d,u){i($u(d,u))},setEntityLocked(d,u){i(Tu(d,u))},isEntityLocked(d){return r(d)},isAssociationLocked(d){return l(d)},collapseAll(){i(is(!0))},expandAll(){i(is(!1))}}}function uA(e){const{state:n,editable:o,run:i,selection:a,gateEntityLocked:r,gateGroupLocked:l,isGroupLockedFn:s}=e;function c(d){const u=d.map(k=>n.layout.entityLayouts.find(_=>_.entityRef===k)).filter(k=>!!k);if(!u.length)return{location:{x:40,y:40},size:{width:400,height:300}};let m=1/0,f=1/0,p=-1/0,y=-1/0;for(const k of u){const _=k.geo.size.width||220,h=k.geo.size.height||140;m=Math.min(m,k.geo.location.x),f=Math.min(f,k.geo.location.y),p=Math.max(p,k.geo.location.x+_),y=Math.max(y,k.geo.location.y+h)}const g=40,b=28;return{location:{x:m-g,y:f-g-b},size:{width:p-m+g*2,height:y-f+g*2+b}}}return{dragGroup(d,u,m){l(d)||i(rt("그룹 이동",$m(n,d,u,m)))},resizeGroup(d,u){l(d)||i(Du(d,u))},setGroupSwatch(d,u){i(Ou(d,u))},setGroupLocked(d,u){i(Pu(d,u))},isGroupLocked(d){return s(d)},updateGroup(d,u){l(d)||i(Mu(d,u))},createGroup(d,u){if(!o.value||!d.length)return null;const m=[];for(const y of n.logical.groups)for(const g of d)y.memberEntityRefs.includes(g)&&m.push(ja(y.modelId,g));const f=Fe(),p={modelId:f,name:u?{ko:u}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[...d]};return m.push(Ha(p,c(d))),i(rt("그룹 생성",m)),a.value=null,f},addEmptyGroup(d,u){if(!o.value)return null;const m=Fe();return i(Ha({modelId:m,name:u?{ko:u}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[]},{location:{...d},size:{width:360,height:260}})),m},removeGroup(d){l(d)||i(Vu(d))},dropEntity(d,u,m){var y;if(r(d))return;const f=((y=n.logical.groups.find(g=>g.memberEntityRefs.includes(d)))==null?void 0:y.modelId)??null,p=[Qo(d,u)];f!==m&&(f&&p.push(ja(f,d)),m&&p.push(Lu(m,d))),i(rt("이동",p))},ungroupEntity(d){const u=n.logical.groups.find(m=>m.memberEntityRefs.includes(d));u&&i(ja(u.modelId,d))},dropNote(d,u,m){var y;const f=((y=n.layout.groupLayouts.find(g=>{var b;return(b=g.memberNoteRefs)==null?void 0:b.includes(d)}))==null?void 0:y.groupRef)??null,p=[Vi(d,u)];f!==m&&(f&&p.push(lm(f,d)),m&&p.push(rm(m,d))),i(rt("이동",p))}}}function mA(e){const{state:n,opMode:o,editable:i,opConflict:a,historyTransport:r,restoreTransport:l}=e;let s=null,c=null;function d(){c==null||c(),c=null,s=null}function u(b,k){if(d(),!o.value||!e.opTransport)return;const _=new hm({diagramId:n.layout.diagramId,state:n,transport:e.opTransport,origin:"gui",onFreeze:h=>{i.value=!1,a.value=h},onError:e.onOpError});_.seed((k==null?void 0:k.revSeed)??{}),c=_.attach(b),s=_}const m=t.computed(()=>o.value&&r!==void 0),f=t.ref(0),p=t.ref(!1),y=t.computed(()=>o.value&&i.value&&l!==void 0);async function g(b){if(!l||!i.value)return{ok:!1,reason:"unavailable"};let k;try{k=await l(b)}catch(_){return{ok:!1,reason:_ instanceof Error?_.message:String(_)}}return k.ok&&f.value++,k}return{setupOpAdapter:u,teardownOpAdapter:d,flush(){s==null||s.flush()},whenOpsSettled(){return(s==null?void 0:s.whenSettled())??Promise.resolve()},historyTransport:r,historyAvailable:m,restoreTransport:l,restoreAvailable:y,restoreToSeq:g,reloadRequest:f,reloadInFlight:p}}function fA(e){const{editable:n,run:o}=e;return{addNote(i="메모",a={x:80,y:80}){if(!n.value)return null;const r=Fe();return o(tm({modelId:r,memo:i,geo:{location:{...a},size:{width:200,height:120}}})),r},removeNote(i){o(nm(i))},moveNote(i,a){o(Vi(i,a))},resizeNote(i,a){o(om(i,a))},setNoteMemo(i,a){o(im(i,a))},setNoteSwatch(i,a){o(am(i,a))},addNoteConnection(i,a){o(sm(i,a))},removeNoteConnection(i,a){o(cm(i,a))},moveNoteConnectionWaypoint(i,a,r,l){o(dm(i,a,r,l))},addNoteConnectionWaypoint(i,a,r,l){o(um(i,a,r,l))},removeNoteConnectionWaypoint(i,a,r){o(mm(i,a,r))},clearNoteConnectionWaypoints(i,a){o(fm(i,a))}}}function pA(e){const{state:n,selection:o,focusRequest:i,run:a,gateEntityLocked:r,isEntityLockedFn:l,isGroupLockedFn:s}=e;let c=0;return{selectAttribute(d,u,m="replace"){const f=o.value,p=(f==null?void 0:f.kind)==="attribute"&&f.entityId===d;if(m==="replace"||!p){o.value={kind:"attribute",entityId:d,ids:[u],anchor:u};return}if(m==="toggle"){const C=f.ids.includes(u),v=C?f.ids.filter(N=>N!==u):[...f.ids,u];if(!v.length){o.value=null;return}const S=C&&f.anchor===u?v[v.length-1]:C?f.anchor:u;o.value={kind:"attribute",entityId:d,ids:v,anchor:S};return}const y=n.logical.entities.find(C=>C.modelId===d),g=[...(y==null?void 0:y.attributes)??[]].sort((C,v)=>C.order-v.order).map(C=>C.modelId),b=g.indexOf(f.anchor),k=g.indexOf(u);if(b<0||k<0){o.value={kind:"attribute",entityId:d,ids:[u],anchor:u};return}const[_,h]=b<=k?[b,k]:[k,b];o.value={kind:"attribute",entityId:d,ids:g.slice(_,h+1),anchor:f.anchor}},moveAttributeFocus(d){const u=o.value;if((u==null?void 0:u.kind)!=="attribute")return!1;const m=n.logical.entities.find(g=>g.modelId===u.entityId);if(!m||!m.attributes.length)return!1;const f=m.attributes.findIndex(g=>g.modelId===u.anchor);if(f<0)return!1;const p=Math.min(Math.max(f+d,0),m.attributes.length-1);if(p===f)return!0;const y=m.attributes[p].modelId;return o.value={kind:"attribute",entityId:u.entityId,ids:[y],anchor:y},!0},nudgeSelectedAttributes(d){const u=o.value;if((u==null?void 0:u.kind)!=="attribute")return!1;const m=n.logical.entities.find(C=>C.modelId===u.entityId);if(!m)return!1;const f=m.attributes,p=new Set(u.ids),y=f.map((C,v)=>p.has(C.modelId)?v:-1).filter(C=>C>=0);if(!y.length)return!1;const g=Math.min(...y),b=f.filter(C=>!p.has(C.modelId)),k=f.slice(0,g).filter(C=>!p.has(C.modelId)).length;let _;if(d<0){if(k<=0)return!0;_=k-1}else{if(b.length-k<=0)return!0;_=k+1}if(r(u.entityId))return!0;const h=f.filter(C=>p.has(C.modelId)).map(C=>C.modelId);return a(as(u.entityId,h,_)),!0},nudgeNodes(d,u,m){if(!d.length||u===0&&m===0)return!1;const f=new Set(n.logical.entities.map(_=>_.modelId)),p=new Set(n.logical.groups.map(_=>_.modelId)),y=new Set(n.layout.notes.map(_=>_.modelId)),g=new Set;for(const _ of d){if(!p.has(_))continue;const h=n.logical.groups.find(C=>C.modelId===_);for(const C of(h==null?void 0:h.memberEntityRefs)??[])g.add(C)}const b=[],k=[];for(const _ of d)if(p.has(_)){if(s(_))continue;const h=n.layout.groupLayouts.find(N=>N.groupRef===_);if(!h)continue;const C=n.logical.groups.find(N=>N.modelId===_),v=((C==null?void 0:C.memberEntityRefs)??[]).map(N=>{var T;const A=((T=n.layout.entityLayouts.find(O=>O.entityRef===N))==null?void 0:T.geo.location)??{x:0,y:0};return{id:N,location:{x:A.x+u,y:A.y+m}}}),S={x:h.geo.location.x+u,y:h.geo.location.y+m};b.push(rt("그룹 이동",$m(n,_,S,v))),k.push("g:"+_)}else if(f.has(_)){if(g.has(_)||l(_))continue;const h=n.layout.entityLayouts.find(C=>C.entityRef===_);if(!h)continue;b.push(Qo(_,{x:h.geo.location.x+u,y:h.geo.location.y+m})),k.push("e:"+_)}else if(y.has(_)){const h=n.layout.notes.find(C=>C.modelId===_);if(!h)continue;b.push(Vi(_,{x:h.geo.location.x+u,y:h.geo.location.y+m})),k.push("n:"+_)}return b.length?(a(rt("이동",b,"nudge:"+k.sort().join(","))),!0):!1},requestFocus(d){i.value={id:d,nonce:++c}}}}const io=Symbol("editorController");function vh(e="m1",n="d1"){return{logical:{modelId:e,entities:[],associations:[],groups:[]},layout:{diagramId:n,logicalModelRef:e,entityLayouts:[],associationLayouts:[],groupLayouts:[],notes:[]}}}function hA(e=vh(),n={}){var ht,re,ve;const o=t.reactive(e);let i=new os(o);const a=t.ref(n.embeddableCatalog??[]),r=t.ref(n.groupCodeCatalog??[]),l=t.ref(n.predefinedCustomTypeCatalog??[]),s=t.ref(n.superClassCatalog??[]),c=t.ref(n.languages??["ko","en","ja","zh"]),d=t.ref(n.userLanguage??"ko"),u=t.ref(n.projectLanguage),m=t.ref(n.uiLocale??"ko"),f=(le,me)=>cn(m.value,le,me),p=t.ref(n.reservedWords),y=t.ref(n.selectableDataTypes),g=t.ref(n.largeEntityThreshold),b=t.ref(n.flagEntitiesWithoutRelations??!1),k=t.ref(!1),_=t.ref(!1),h=t.ref(!1),C=t.ref(0),v=t.ref(null);let S=0;const N=le=>{if(n.onNotice){n.onNotice(le);return}v.value={text:le,id:++S}},A=t.ref(((ht=n.meta)==null?void 0:ht.schemaVersion)??1),T=t.ref(((re=n.meta)==null?void 0:re.opWriteEnabled)??!1),O=t.ref(((ve=n.meta)==null?void 0:ve.referenceOnly)??!1),z=t.computed(()=>A.value>=2&&T.value),P=t.ref(!(A.value>=2&&T.value===!1)),D=t.ref("LOGICAL_PHYSICAL"),E=t.ref("straight"),R=t.ref(!0),I=t.ref(!0),x=t.ref(null),$=t.computed(()=>{var le;return((le=x.value)==null?void 0:le.kind)==="attribute"?{entityId:x.value.entityId,attrId:x.value.anchor}:null}),U=t.computed(()=>{var le;return((le=x.value)==null?void 0:le.kind)==="attribute"?x.value.ids:[]}),F=t.computed(()=>{var le,me;return((le=x.value)==null?void 0:le.kind)==="entity"?x.value.id:((me=x.value)==null?void 0:me.kind)==="attribute"?x.value.entityId:null}),B=t.ref(null),j=t.ref(null),X=t.ref(null),W=t.ref(null),oe=mA({state:o,opMode:z,editable:P,opConflict:X,opTransport:n.opTransport,onOpError:n.onOpError,historyTransport:n.historyTransport,restoreTransport:n.restoreTransport});function de(){i.onChange(()=>{k.value=i.canUndo,_.value=i.canRedo,h.value=i.isDirty,C.value++})}de(),oe.setupOpAdapter(i,n.meta);const ie=t.computed(()=>Dc(o.logical,o.layout)),Ie=t.computed(()=>({reservedWords:p.value,selectableDataTypes:y.value,largeEntityThreshold:g.value,flagEntitiesWithoutRelations:b.value,embeddableCatalog:a.value,superClassCatalog:s.value,predefinedCustomTypes:l.value})),Le=()=>fl(o.logical,O.value),Se=n.validationDebounceMs??250;let ce,pe=()=>{};if(Se>0){const le=t.shallowRef(Aa(Le(),Ie.value));let me;pe=()=>{me!==void 0&&(clearTimeout(me),me=void 0),le.value=Aa(Le(),Ie.value)},t.watch([C,Ie,O],()=>{me!==void 0&&clearTimeout(me),me=setTimeout(pe,Se)},{flush:"sync"}),ce=t.computed(()=>le.value)}else ce=t.computed(()=>Aa(Le(),Ie.value));const he=t.computed(()=>{const le=new Map;for(const me of ce.value){if(!me.targetRef)continue;const ke=le.get(me.targetRef);ke?ke.push(me):le.set(me.targetRef,[me])}return le}),V=1500,L=new Map,K=le=>{const me=Date.now();me-(L.get(le)??0)<V||(L.set(le,me),N(le))},Z=le=>{if(!W.value){if(!P.value){K(f("em.notice.readOnly"));return}try{i.execute(le)}catch(me){console.error(`[command] 적용 실패 — 로컬 상태가 부분 변형됐을 수 있다 (${le.label}):`,me),P.value=!1,W.value={label:le.label}}}},Q=le=>o.layout.entityLayouts.some(me=>me.entityRef===le&&!!me.locked),fe=le=>o.layout.groupLayouts.some(me=>me.groupRef===le&&!!me.locked),be=le=>{const me=o.logical.associations.find(ke=>ke.modelId===le);return!!me&&(Q(me.end1.entityRef)||Q(me.end2.entityRef))},Ee=le=>Q(le)?(K(f("em.notice.entityLocked")),!0):!1,Ne=le=>fe(le)?(K(f("em.notice.groupLocked")),!0):!1,J=le=>be(le)?(K(f("em.notice.assocLocked")),!0):!1,ee=cA({state:o,clipboard:j,selection:x,inspectedEntityId:F,editable:P,run:Z}),te=pA({state:o,selection:x,focusRequest:B,run:Z,gateEntityLocked:Ee,isEntityLockedFn:Q,isGroupLockedFn:fe}),ge=dA({state:o,editable:P,run:Z,gateEntityLocked:Ee,isEntityLockedFn:Q,isAssocLockedFn:be,t:f,emitGateNotice:K}),Re=aA({state:o,editable:P,run:Z,gateEntityLocked:Ee,embeddableCatalog:a,predefinedCustomTypeCatalog:l,t:f,emitGateNotice:K,selection:x}),Pe=uA({state:o,editable:P,run:Z,selection:x,gateEntityLocked:Ee,gateGroupLocked:Ne,isGroupLockedFn:fe}),Me=fA({editable:P,run:Z}),Qe=iA({state:o,editable:P,run:Z,gateEntityLocked:Ee,gateAssocLocked:J});return{state:o,resolved:ie,issues:ce,issuesByRef:he,flagEntitiesWithoutRelations:b,canUndo:k,canRedo:_,dirty:h,revision:C,notice:v,editable:P,schemaVersion:A,opWriteEnabled:T,opMode:z,opConflict:X,commandFailure:W,historyTransport:oe.historyTransport,historyAvailable:oe.historyAvailable,restoreTransport:oe.restoreTransport,restoreAvailable:oe.restoreAvailable,restoreToSeq:oe.restoreToSeq,reloadRequest:oe.reloadRequest,reloadInFlight:oe.reloadInFlight,displayMode:D,routingMode:E,showGrid:R,showMinimap:I,selection:x,selectedAttr:$,selectedAttrIds:U,inspectedEntityId:F,focusRequest:B,clipboard:j,embeddableCatalog:a,groupCodeCatalog:r,predefinedCustomTypeCatalog:l,superClassCatalog:s,languages:c,userLanguage:d,projectLanguage:u,referenceOnlyDocument:O,uiLocale:m,t:f,selectableDataTypes:y,setEditable(le){P.value=le&&z.value},setEmbeddableCatalog(le){a.value=le},setGroupCodeCatalog(le){r.value=le},setPredefinedCustomTypeCatalog(le){l.value=le},setSuperClassCatalog(le){s.value=le},selectAttribute:te.selectAttribute,moveAttributeFocus:te.moveAttributeFocus,nudgeSelectedAttributes:te.nudgeSelectedAttributes,nudgeNodes:te.nudgeNodes,requestFocus:te.requestFocus,deleteSelection(){if(!P.value)return!1;const le=x.value;if(!le)return!1;if(le.kind==="attribute"){if(Ee(le.entityId))return!1;const me=le.ids;if(!me.length)return!1;me.length===1?Re.removeAttribute(le.entityId,me[0]):Re.removeAttributes(le.entityId,me)}else if(le.kind==="entity"){if(Ee(le.id))return!1;ge.removeEntity(le.id)}else if(le.kind==="note")Me.removeNote(le.id);else if(le.kind==="group"){if(Ne(le.id))return!1;Pe.removeGroup(le.id)}else Qe.removeAssociation(le.id);return x.value=null,!0},undo:()=>{P.value&&i.undo()},redo:()=>{P.value&&i.redo()},markSaved:()=>{P.value&&(oe.flush(),i.markSavePoint())},loadDiagram(le,me){oe.teardownOpAdapter(),o.logical=le.logical,o.layout=le.layout,i=new os(o),de(),A.value=(me==null?void 0:me.schemaVersion)??1,T.value=(me==null?void 0:me.opWriteEnabled)??!1,O.value=(me==null?void 0:me.referenceOnly)??!1,P.value=!(A.value>=2&&T.value===!1),X.value=null,W.value=null,oe.reloadInFlight.value=!1,x.value=null,k.value=i.canUndo,_.value=i.canRedo,h.value=i.isDirty,oe.setupOpAdapter(i,me),pe()},flush:oe.flush,whenOpsSettled:oe.whenOpsSettled,addEntity:ge.addEntity,renameEntity:ge.renameEntity,updateEntity:ge.updateEntity,moveEntity:ge.moveEntity,resizeEntity:ge.resizeEntity,removeEntity:ge.removeEntity,setEntitySwatch:ge.setEntitySwatch,setEntityCollapsed:ge.setEntityCollapsed,setEntityLocked:ge.setEntityLocked,isEntityLocked:ge.isEntityLocked,isAssociationLocked:ge.isAssociationLocked,collapseAll:ge.collapseAll,expandAll:ge.expandAll,setAttributeSwatch:Re.setAttributeSwatch,dragGroup:Pe.dragGroup,resizeGroup:Pe.resizeGroup,setGroupSwatch:Pe.setGroupSwatch,setGroupLocked:Pe.setGroupLocked,isGroupLocked:Pe.isGroupLocked,updateGroup:Pe.updateGroup,createGroup:Pe.createGroup,addEmptyGroup:Pe.addEmptyGroup,removeGroup:Pe.removeGroup,dropEntity:Pe.dropEntity,ungroupEntity:Pe.ungroupEntity,dropNote:Pe.dropNote,addPredefinedEmbed:Re.addPredefinedEmbed,convertAttributeType:Re.convertAttributeType,addSerializedTypeAttribute:Re.addSerializedTypeAttribute,addAttribute:Re.addAttribute,addDivider:Re.addDivider,updateAttribute:Re.updateAttribute,setAttributeGroupCode:Re.setAttributeGroupCode,setEmbedColumns:Re.setEmbedColumns,removeAttribute:Re.removeAttribute,removeAttributes:Re.removeAttributes,setAttributeSwatches:Re.setAttributeSwatches,reorderAttributes:Re.reorderAttributes,addIndex(le,me){Ee(le)||Z(qu(le,me))},updateIndex(le,me,ke){Ee(le)||Z(Ya(le,me,ke))},removeIndex(le,me){Ee(le)||Z(Wu(le,me))},addOperation(le,me={}){if(!P.value||Ee(le))return null;const ke=o.logical.entities.find(qe=>qe.modelId===le),Ze=ke!=null&&ke.operations?Jt(ke.operations):0,ct=me.modelId??Fe(),ft={modelId:ct,name:me.name??`method${Ze}`,visibility:me.visibility??"PACKAGE",order:Ze,...me};return Z(Uu(le,ft)),ct},updateOperation(le,me,ke){Ee(le)||Z(Hu(le,me,ke))},removeOperation(le,me){Ee(le)||Z(ju(le,me))},reorderOperations(le,me,ke){!me.length||Ee(le)||Z(Ku(le,me,ke))},setOperationSwatch(le,me,ke){Z(Gu(le,me,ke))},addAssociation:Qe.addAssociation,addEmbedAssociation:Qe.addEmbedAssociation,setEmbedCardinality:Qe.setEmbedCardinality,removeAssociation:Qe.removeAssociation,setAssociationIdentifying:Qe.setAssociationIdentifying,updateAssociationEnd:Qe.updateAssociationEnd,hasQuickFix(le){if(!P.value)return!1;const me=Ol(le,o.logical);return me?me.kind==="setEndCascades"?!be(me.assocRef):!Q(me.entityRef):!1},applyQuickFix(le){if(!P.value)return!1;const me=Ol(le,o.logical);if(!me)return!1;if(me.kind==="setIndexColumns")return Ee(me.entityRef)?!1:(Z(Ya(me.entityRef,me.indexRef,{columns:me.columns})),!0);if(J(me.assocRef))return!1;const ke=o.logical.associations.find(Ze=>Ze.modelId===me.assocRef);return ke?(Z(on(me.assocRef,me.which,{jpa:{...ke[me.which].jpa,cascadeTypes:me.cascades}})),!0):!1},moveWaypoint(le,me,ke){Z(Ju(le,me,ke))},addWaypoint(le,me,ke){Z(em(le,me,ke))},removeWaypoint(le,me){Z(Xu(le,me))},clearWaypoints(le){Z(Qu(le))},addNote:Me.addNote,removeNote:Me.removeNote,moveNote:Me.moveNote,resizeNote:Me.resizeNote,setNoteMemo:Me.setNoteMemo,setNoteSwatch:Me.setNoteSwatch,addNoteConnection:Me.addNoteConnection,removeNoteConnection:Me.removeNoteConnection,moveNoteConnectionWaypoint:Me.moveNoteConnectionWaypoint,addNoteConnectionWaypoint:Me.addNoteConnectionWaypoint,removeNoteConnectionWaypoint:Me.removeNoteConnectionWaypoint,clearNoteConnectionWaypoints:Me.clearNoteConnectionWaypoints,autoLayout(){const le=Pc(o.logical,o.layout);le.length&&Z(rt("자동 배치",le.map(me=>Qo(me.id,me.location))))},copy:ee.copy,paste:ee.paste,importEntities:ee.importEntities}}const Br=Symbol("groupHover"),Ch=Symbol("groupDrag"),Oo=Symbol("relationHighlight"),Sh=Symbol("diffOverlay"),Rh=Symbol("nodeInternals"),Ah=Symbol("columnResolution");function yA(e,n){const o=Object.keys(e);if(o.length!==Object.keys(n).length)return!1;const i=e,a=n;for(const r of o)if(i[r]!==a[r])return!1;return!0}function xh(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let o=0;o<e.length;o++)if(!yA(e[o],n[o]))return!1;return!0}function gA(e,n){const o=e,i=n;for(const a of Object.keys(o))if(o[a]!==i[a])return!1;return!0}function $h(e,n){if(e===n)return!0;const o=Object.keys(e);if(o.length!==Object.keys(n).length)return!1;const i=e,a=n;for(const r of o)if(r==="dbAttrs"){if(!xh(e.dbAttrs,n.dbAttrs))return!1}else if(i[r]!==a[r])return!1;return!0}function bA(e,n){if(e.size!==n.size)return!1;for(const o of e)if(!n.has(o))return!1;return!0}function kA(e,n){if(e.effectiveAttrs.size!==n.effectiveAttrs.size||e.embedCols.size!==n.embedCols.size||e.collectionTypes.size!==n.collectionTypes.size||e.redundantSlots.size!==n.redundantSlots.size)return!1;for(const[o,i]of e.redundantSlots){const a=n.redundantSlots.get(o);if(!a||!bA(i,a))return!1}for(const[o,i]of e.effectiveAttrs){const a=n.effectiveAttrs.get(o);if(!a||!$h(i,a))return!1}for(const[o,i]of e.embedCols){const a=n.embedCols.get(o);if(!a||!xh(i,a))return!1}for(const[o,i]of e.collectionTypes)if(n.collectionTypes.get(o)!==i)return!1;return!!_A(e.classRows,n.classRows)}function _A(e,n){if(e===n)return!0;if(!e||!n||e.length!==n.length)return!1;for(let o=0;o<e.length;o++){const i=e[o],a=n[o];if(i.synthetic!==a.synthetic||i.sourceAttrId!==a.sourceAttrId||i.targetName!==a.targetName||i.collection!==a.collection||i.attr!==a.attr&&!$h(i.attr,a.attr))return!1}return!0}function EA(){let e;return(n,o)=>e=NA(n,o,e)}function NA(e,n,o){const i=e.entities,a=new Map,r={embeddableCatalog:n};let l=null;const s=()=>l??(l=new Map(i.map(c=>[c.modelId,c])));for(const c of i){const d=new Map,u=new Map,m=new Map;let f=null;const p=()=>f??(f=mo(Rn(c,i)));for(const h of c.attributes){if(ki(h)){const S=h.dbAttrs[0],N=S&&Lt(h,S,0,c,e);S&&N&&!gA(N,S)&&d.set(h.modelId,{...h,dbAttrs:[N,...h.dbAttrs.slice(1)]})}if(h.identifier&&h.attrType==="RELATION_OWN"){const S=Jn(e,c.modelId,h.modelId);if(S&&Ta(h,S)){const N=d.get(h.modelId)??h,A=h.derivedIdFieldName||Hl({...h,derivedIdFieldName:void 0},S,s());A&&d.set(h.modelId,{...N,derivedIdFieldName:A})}}const C=wi(h,e.associations);if(C&&m.set(h.modelId,C),vn(h)){u.set(h.modelId,h.dbAttrs.map((S,N)=>Lt(h,S,N,c,e)));continue}if(!h.attrType.startsWith("EMBED")||h.dbAttrs.length===0||h.attrType==="EMBED_PREDEF"&&!(n!=null&&n.some(S=>S.type===h.type)))continue;const v=p();u.set(h.modelId,h.dbAttrs.map((S,N)=>{const A=Lt(h,S,N,c,e,r),T=fo(A,v);return T?{...A,physicalName:T.physicalName}:A}))}const y=new Map,g=new Map;for(const h of c.attributes){const C=u.get(h.modelId);if(C)for(let v=0;v<C.length;v++){const S=`${h.attrType}\0${h.type??""}\0${v}`,N={attrId:h.modelId,slot:v,name:C[v].physicalName??""},A=g.get(S);A?A.push(N):g.set(S,[N])}}for(const h of g.values()){if(h.length<2)continue;const C=new Map;for(const v of h)C.set(v.name,(C.get(v.name)??0)+1);for(const v of h){if((C.get(v.name)??0)<2)continue;const S=y.get(v.attrId);S?S.add(v.slot):y.set(v.attrId,new Set([v.slot]))}}const b=jl(c,e).fields.map(h=>{var C;return{attr:h.attr,synthetic:h.synthetic,sourceAttrId:h.sourceAttr.modelId,targetName:(C=h.target)==null?void 0:C.name,collection:h.collection}}),k={effectiveAttrs:d,embedCols:u,collectionTypes:m,redundantSlots:y,classRows:b},_=o==null?void 0:o.get(c.modelId);a.set(c.modelId,_&&kA(k,_)?_:k)}return a}const Th=Symbol("embedSlotCollapse"),Mh=(e,n)=>`${e}:${n}`,Vh="all:",Lh="one:",Bh="fk:",Dh=e=>`${Vh}${e}`,wA=(e,n)=>`${Lh}${e}:${n}`,IA=(e,n)=>`${Bh}${e}:${n}`,vA=e=>e.startsWith(Bh)||!e.startsWith(Vh)&&!e.startsWith(Lh),CA=["title"],SA={key:0,class:"em-sel","aria-hidden":"true"},RA=["title","aria-expanded","disabled"],AA={class:"em-entity__stereotype"},xA={key:2,class:"em-entity__name"},$A=["title","aria-expanded"],TA={"aria-hidden":"true"},MA=["data-attr","title","onClick","onPointerdown","onPointermove","onPointerup","onPointercancel"],VA=["onPointerdown"],LA={key:1,class:"em-entity__divider-label"},BA=["title"],DA={class:"em-key-slot"},OA={class:"em-key-slot"},PA=["title","aria-expanded","onClick"],zA=["title","onClick"],FA=["title","aria-expanded","onClick"],UA={key:2,class:"em-entity__type"},HA=["onClick"],jA={class:"em-entity__attrname"},KA={class:"em-entity__type"},GA={key:1,class:"em-entity__embed-summary"},YA=["title"],qA=["data-op"],WA=["onPointerdown"],JA={class:"em-entity__op-vis","aria-hidden":"true"},XA=["title"],ZA={key:4,class:"em-entity__footer"},Oh=tt(t.defineComponent({__name:"EntityNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const n=e,o=t.inject(io,null),i=(M,q)=>o?o.t(M,q):cn("ko",M,q),a=t.computed(()=>(o==null?void 0:o.userLanguage.value)??"ko"),r=ne.useModal();function l(){o&&Lr(r,o,n.id)}const s=t.inject(Br,null),c=t.inject(Oo,null),d=t.inject(Sh,null),u=t.computed(()=>{var M;return((M=d==null?void 0:d.marks.value)==null?void 0:M.get(n.id))??null}),m=t.inject(Ah,null),f=t.computed(()=>m==null?void 0:m.value.get(n.id)),p=t.inject(Th,void 0),y=t.inject(Rh,null);t.onUpdated(()=>y==null?void 0:y.mark(n.id));const g=t.computed(()=>!!o&&o.editable.value);function b(){s&&(s.value=n.data.groupRef??null)}function k(){c==null||c.setEntityHover(n.id)}function _(){c==null||c.setEntityHover(null)}const h=t.computed(()=>!!c&&c.primaryEntityIds.value.has(n.id)),C=t.computed(()=>!!c&&c.relatedEntityIds.value.has(n.id)&&!h.value),v=t.computed(()=>{var M;return((M=o==null?void 0:o.selection.value)==null?void 0:M.kind)==="entity"&&o.selection.value.id===n.id}),S=t.computed(()=>!!n.selected&&!v.value),N=t.computed(()=>{var M;return o&&((M=o.selectedAttr.value)==null?void 0:M.entityId)===n.id?new Set(o.selectedAttrIds.value):new Set}),A=t.computed(()=>N.value.size>0);function T(M,q){const Ce=q.shiftKey?"range":q.metaKey||q.ctrlKey?"toggle":"replace";o==null||o.selectAttribute(n.id,x(M),Ce)}const O=t.computed(()=>!!c&&c.active.value&&!c.relatedEntityIds.value.has(n.id)&&!v.value),z=t.computed(()=>n.data.entity),P=t.computed(()=>gg(z.value,o==null?void 0:o.referenceOnlyDocument.value)),D=t.computed(()=>n.data.displayMode??"LOGICAL_PHYSICAL"),E=t.computed(()=>{var M;if(D.value==="CLASS"){const q=(M=f.value)==null?void 0:M.classRows;if(q)return q.map(Ce=>Ce.attr)}return[...z.value.attributes].sort((q,Ce)=>q.order-Ce.order)}),R=t.computed(()=>{var q;const M=D.value==="CLASS"?(q=f.value)==null?void 0:q.classRows:void 0;return new Set((M??[]).filter(Ce=>Ce.synthetic).map(Ce=>Ce.attr.modelId))});function I(M){return R.value.has(M.modelId)}function x(M){return F.value.get(M.modelId)??M.modelId}function $(M){return N.value.has(x(M))}function U(M){var q;return!!((q=u.value)!=null&&q.changedAttributeIds.has(x(M)))}const F=t.computed(()=>{var q;const M=new Map;if(D.value!=="CLASS")return M;for(const Ce of((q=f.value)==null?void 0:q.classRows)??[])Ce.synthetic&&M.set(Ce.attr.modelId,Ce.sourceAttrId);return M}),B=t.computed(()=>{var Ce;const M=new Map,q=D.value==="CLASS";for(const Be of((Ce=f.value)==null?void 0:Ce.classRows)??[])!q&&!vn(Be.attr)||(Be.targetName||Be.collection)&&M.set(Be.attr.modelId,{targetName:Be.targetName,collection:Be.collection});return M}),j=t.computed(()=>n.data.collapsed??!1),X=t.computed(()=>n.data.locked??!1),W=t.computed(()=>g.value&&!X.value);function oe(){g.value&&(o==null||o.setEntityCollapsed(n.id,!j.value))}const de=t.computed(()=>!j.value&&E.value.some(M=>!ge(M))),ie=[{id:"e-left",pos:Ve.Left},{id:"e-right",pos:Ve.Right}],Ie=t.computed(()=>D.value==="PHYSICAL"||D.value==="LOGICAL_PHYSICAL"),Le=t.computed(()=>{var Ce;const M=D.value==="PHYSICAL"||D.value==="LOGICAL_PHYSICAL",q={};for(const Be of E.value){const ue=Be.attrType.startsWith("RELATION")&&Be.dbAttrs.length>0,Ae=mn(((Ce=z.value)==null?void 0:Ce.stereotype)??"UNDEFINED");q[Be.modelId]={pk:Be.identifier,fk:ue&&M,required:!Ae&&Be.notNull&&!Be.identifier}}return q});function Se(M){if(!M)return"";const q=[];return M.pk&&M.fk?q.push(i("em.node.keyPfk")):M.pk?q.push(i("em.node.keyPk")):M.fk&&q.push(i("em.node.keyFk")),M.required&&q.push(i("em.node.required")),q.join(" · ")}const ce=t.computed(()=>{const M=Qs(Bt(n.data.style)),q={};return M&&(q["--em-header-bg"]=M.bar,q["--em-header-fg"]=M.barOn),q});function pe(M){var q,Ce;return(Ce=Qs(Bt((q=n.data.attributeStyles)==null?void 0:q[M.modelId])))==null?void 0:Ce.text}const he=t.computed(()=>[...z.value.operations??[]].sort((M,q)=>M.order-q.order)),V=t.computed(()=>D.value==="CLASS"&&he.value.length>0),L={PUBLIC:"+",PRIVATE:"-",PROTECTED:"#",PACKAGE:"~"};function K(M){return M?L[M]:"~"}function Z(M){var q,Ce;return(Ce=Qs(Bt((q=n.data.operationStyles)==null?void 0:q[M.modelId])))==null?void 0:Ce.text}function Q(M,q,Ce){switch(D.value){case"CLASS":return[{text:M}];case"PHYSICAL":return[{text:Ce||M}];case"LOGICAL":return[q?{text:q}:{text:i("em.node.logicalMissing"),missing:!0}];default:{const Be=q?{text:q}:{text:i("em.node.logicalMissing"),missing:!0};return Ce?[Be,{text:` · ${Ce}`}]:[Be]}}}function fe(M){var q;return((q=f.value)==null?void 0:q.effectiveAttrs.get(M.modelId))??M}function be(M){var Be;if(ee(M))return[{text:M.name}];const q=fe(M),Ce=jo(q,q.dbAttrs[0]);return Q(Ee(M),Ce==null?void 0:Ce[a.value],((Be=q.dbAttrs[0])==null?void 0:Be.physicalName)??"")}function Ee(M){return D.value==="CLASS"?M.name:fe(M).derivedIdFieldName||M.name}function Ne(M){return M.attrType.startsWith("EMBED")&&M.dbAttrs.length>0}const J=vn;function ee(M){return Ne(M)||J(M)}function te(M){return J(M)?IA(n.id,M.modelId):wA(n.id,M.modelId)}function ge(M){return M.attrType==="DIVIDER"}function Re(M){var q;return((q=f.value)==null?void 0:q.embedCols.get(M.modelId))??M.dbAttrs}function Pe(M){var q;return(q=f.value)==null?void 0:q.redundantSlots.get(M.modelId)}const Me=t.computed(()=>(p==null?void 0:p.isCollapsed(Dh(n.id)))??!1),Qe=t.computed(()=>Me.value&&Ie.value?E.value.reduce((M,q)=>ee(q)?M+Re(q).length:M,0):0),Ot=t.computed(()=>E.value.some(M=>ee(M)));function ht(M){const q=Pe(M);return!q||q.size===0?!1:p?p.isCollapsed(Mh(n.id,M.modelId)):!1}function re(M){var q;return ht(M)?((q=Pe(M))==null?void 0:q.size)??0:0}function ve(M){return p?p.isCollapsed(te(M)):!1}function le(M){var q;return!Ie.value||Me.value?null:ve(M)?"attr":(((q=Pe(M))==null?void 0:q.size)??0)>0?"slot":null}function me(M){return!Me.value&&ee(M)}function ke(M){return ve(M)?Re(M).length:0}function Ze(M){if(Me.value||ve(M))return[];const q=Re(M);if(!ht(M))return q;const Ce=Pe(M);return q.filter((Be,ue)=>!Ce.has(ue))}function ct(M){p==null||p.toggle(Mh(n.id,M.modelId))}function ft(M){p==null||p.toggle(te(M))}function qe(){p==null||p.toggle(Dh(n.id))}function Rt(M){var q;return Q(M.physicalName,(q=M.logicalName)==null?void 0:q[a.value],M.physicalName)}function et(M){var Ae;const q=B.value.get(M.modelId),Ce=(q==null?void 0:q.collection)??((Ae=f.value)==null?void 0:Ae.collectionTypes.get(M.modelId)),Be=o?Ei(M,Go(o.state.logical),z.value,o.state.logical):void 0,ue=(Be==null?void 0:Be.kind)==="resolved"?Be.entity:void 0;return _l(D.value,fe(M),Ce,q==null?void 0:q.targetName,ue)}const jt=t.computed(()=>{const M={};for(const q of E.value)M[q.modelId]=et(q);return M}),Nt=t.computed(()=>{var M,q;return Q(z.value.name,(M=Sn(z.value))==null?void 0:M[a.value],((q=z.value.table)==null?void 0:q.physicalName)??"")}),ut=t.ref(!1),yt=t.ref(""),At=t.ref(null);async function jn(){var M,q;W.value&&(yt.value=z.value.name,ut.value=!0,await t.nextTick(),(M=At.value)==null||M.focus(),(q=At.value)==null||q.select())}function mt(){if(!ut.value)return;ut.value=!1;const M=yt.value.trim();M&&M!==z.value.name&&(o==null||o.renameEntity(n.id,M))}function ze(){o==null||o.addAttribute(n.id)}function Y(){o==null||o.addDivider(n.id)}const{screenToFlowCoordinate:Wt,findNode:G}=ot(),ae=t.ref(null),De=t.computed(()=>{const M=ae.value??n.data.size;return M?{width:`${M.width}px`,minHeight:`${M.height}px`}:void 0});let je=null;function bt(M){var Be,ue,Ae;if(!W.value)return;M.stopPropagation();const q=(Be=G(n.id))==null?void 0:Be.dimensions,Ce=Wt({x:M.clientX,y:M.clientY});je={fx:Ce.x,fy:Ce.y,w:(q==null?void 0:q.width)??((ue=n.data.size)==null?void 0:ue.width)??200,h:(q==null?void 0:q.height)??((Ae=n.data.size)==null?void 0:Ae.height)??120},M.target.setPointerCapture(M.pointerId)}function Vt(M){if(!je)return;const q=Wt({x:M.clientX,y:M.clientY});ae.value={width:Math.max(40,je.w+(q.x-je.fx)),height:Math.max(40,je.h+(q.y-je.fy))}}function Ye(M){var q,Ce,Be;if(je&&ae.value&&o){const ue=(q=G(n.id))==null?void 0:q.dimensions;o.resizeEntity(n.id,{width:Math.round((ue==null?void 0:ue.width)??ae.value.width),height:Math.round((ue==null?void 0:ue.height)??ae.value.height)})}je=null,ae.value=null,(Be=(Ce=M.target).releasePointerCapture)==null||Be.call(Ce,M.pointerId)}const Ue=t.ref(null),w=t.ref(null);function H(M,q){if(!W.value)return;q.stopPropagation(),q.preventDefault();const Ce=N.value,Be=Ce.has(M.modelId)?new Set(Ce):new Set([M.modelId]);w.value={ids:Be,dropIndex:-1,lineY:0},q.target.setPointerCapture(q.pointerId)}function se(M){if(!w.value||!Ue.value)return;const q=Array.from(Ue.value.querySelectorAll(".em-entity__row"));if(!q.length)return;let Ce=q.length;for(let Ae=0;Ae<q.length;Ae++){const it=q[Ae].getBoundingClientRect();if(M.clientY<it.top+it.height/2){Ce=Ae;break}}const Be=q[q.length-1],ue=Ce<q.length?q[Ce].offsetTop:Be.offsetTop+Be.offsetHeight;w.value={...w.value,dropIndex:Ce,lineY:ue}}function _e(){const M=w.value;if(w.value=null,!M||M.dropIndex<0)return;const q=E.value,Ce=q.filter(We=>M.ids.has(We.modelId)).map(We=>We.modelId),Be=q.filter((We,Ho)=>M.ids.has(We.modelId)&&Ho<M.dropIndex).length,ue=M.dropIndex-Be,Ae=q.filter(We=>!M.ids.has(We.modelId)).map(We=>We.modelId);[...Ae.slice(0,ue),...Ce,...Ae.slice(ue)].join(",")!==q.map(We=>We.modelId).join(",")&&(o==null||o.reorderAttributes(n.id,Ce,ue))}function $e(){w.value=null}const Oe=t.ref(null),He=t.ref(null);function Ke(M,q){W.value&&(q.stopPropagation(),q.preventDefault(),He.value={id:M.modelId,dropIndex:-1,lineY:0},q.target.setPointerCapture(q.pointerId))}function we(M){if(!He.value||!Oe.value)return;const q=Array.from(Oe.value.querySelectorAll(".em-entity__op-row"));if(!q.length)return;let Ce=q.length;for(let Ae=0;Ae<q.length;Ae++){const it=q[Ae].getBoundingClientRect();if(M.clientY<it.top+it.height/2){Ce=Ae;break}}const Be=q[q.length-1],ue=Ce<q.length?q[Ce].offsetTop:Be.offsetTop+Be.offsetHeight;He.value={...He.value,dropIndex:Ce,lineY:ue}}function Je(){const M=He.value;if(He.value=null,!M||M.dropIndex<0)return;const Ce=he.value.findIndex(ue=>ue.modelId===M.id);if(Ce<0)return;const Be=M.dropIndex-(Ce<M.dropIndex?1:0);Be!==Ce&&(o==null||o.reorderOperations(n.id,[M.id],Be))}function Xe(){He.value=null}return(M,q)=>{var Ce,Be;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-entity",{"is-hover-origin":h.value,"is-related":C.value,"is-dimmed":O.value,"is-selected":v.value,"is-multi-selected":S.value,"has-focused-attr":A.value,"is-locked":X.value,"is-reference-only":P.value,"is-diff-added":((Ce=u.value)==null?void 0:Ce.verb)==="added","is-diff-modified":((Be=u.value)==null?void 0:Be.verb)==="modified"}]),tabindex:"-1",title:P.value?i("em.entity.referenceOnlyHint"):void 0,style:t.normalizeStyle(De.value),onPointerdown:b,onMouseenter:k,onMouseleave:_,onDblclick:l},[v.value?(t.openBlock(),t.createElementBlock("div",SA,[...q[11]||(q[11]=[t.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):t.createCommentVNode("",!0),t.createElementVNode("header",{class:"em-entity__header",style:t.normalizeStyle(ce.value),onDblclick:t.withModifiers(jn,["stop"])},[de.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},t.renderList(ie,ue=>t.createVNode(t.unref(oo),{id:ue.id,key:ue.id,type:"source",position:ue.pos,class:"em-handle em-handle--node",title:W.value?i("em.node.connectHintNode"):void 0},null,8,["id","position","title"])),64)),t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__caret nodrag",title:i(j.value?"em.panel.expand":"em.panel.collapse"),"aria-expanded":!j.value,disabled:!g.value,onClick:t.withModifiers(oe,["stop"]),onPointerdown:q[0]||(q[0]=t.withModifiers(()=>{},["stop"])),onDblclick:q[1]||(q[1]=t.withModifiers(()=>{},["stop"]))},t.toDisplayString(j.value?"▸":"▾"),41,RA),t.createElementVNode("span",AA,"«"+t.toDisplayString(t.unref(gi)(z.value.stereotype))+"»",1),ut.value?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:1,ref_key:"inputEl",ref:At,"onUpdate:modelValue":q[2]||(q[2]=ue=>yt.value=ue),class:"em-entity__name-input nodrag",onKeyup:[t.withKeys(mt,["enter"]),q[3]||(q[3]=t.withKeys(ue=>ut.value=!1,["esc"]))],onBlur:mt,onPointerdown:q[4]||(q[4]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,yt.value]]):(t.openBlock(),t.createElementBlock("span",xA,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Nt.value,(ue,Ae)=>(t.openBlock(),t.createElementBlock("span",{key:Ae,class:t.normalizeClass({"em-entity__missing":ue.missing})},t.toDisplayString(ue.text),3))),128))])),!j.value&&Ie.value&&Ot.value?(t.openBlock(),t.createElementBlock("button",{key:3,tabindex:"-1",type:"button",class:"em-entity__embed-all nodrag",title:Me.value?i("em.node.embedAllShow"):i("em.node.embedAllHide"),"aria-expanded":!Me.value,onClick:t.withModifiers(qe,["stop"]),onPointerdown:q[5]||(q[5]=t.withModifiers(()=>{},["stop"])),onDblclick:q[6]||(q[6]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(xe,{name:"table",size:11}),t.createElementVNode("span",TA,t.toDisplayString(Me.value?"▸":"▾"),1)],40,$A)):t.createCommentVNode("",!0),X.value?(t.openBlock(),t.createBlock(xe,{key:4,name:"lock",size:12,class:"em-entity__lock",title:i("em.node.editLock")},null,8,["title"])):t.createCommentVNode("",!0),u.value?(t.openBlock(),t.createElementBlock("span",{key:5,class:t.normalizeClass(["em-entity__diff-badge",u.value.verb==="added"?"is-added":"is-modified"]),"aria-hidden":"true"},t.toDisplayString(u.value.verb==="added"?"+":"±"),3)):t.createCommentVNode("",!0)],36),j.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("ul",{key:1,ref_key:"attrsUl",ref:Ue,class:"em-entity__attrs"},[w.value&&w.value.dropIndex>=0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:t.normalizeStyle({top:`${w.value.lineY}px`}),"aria-hidden":"true"},null,4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(E.value,ue=>{var Ae,it,We,Ho,pa;return t.openBlock(),t.createElementBlock(t.Fragment,{key:ue.modelId},[t.createElementVNode("li",{class:t.normalizeClass(["em-entity__row",{"is-attr-selected":$(ue),"is-dragging":(Ae=w.value)==null?void 0:Ae.ids.has(ue.modelId),"is-embed":ee(ue),"is-divider":ge(ue),"has-embed-badge":!!le(ue),nodrag:ge(ue)&&W.value,"is-diff-changed":U(ue),"is-synthetic":I(ue)}]),"data-attr":ue.modelId,title:I(ue)?i("em.node.derivedIdRow"):void 0,onClick:t.withModifiers(gt=>T(ue,gt),["stop"]),onPointerdown:gt=>ge(ue)?H(ue,gt):void 0,onPointermove:gt=>ge(ue)?se(gt):void 0,onPointerup:gt=>ge(ue)?_e():void 0,onPointercancel:gt=>ge(ue)?$e():void 0},[W.value&&!ge(ue)&&!I(ue)?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:gt=>H(ue,gt),onPointermove:se,onPointerup:_e,onPointercancel:$e,onClick:q[7]||(q[7]=t.withModifiers(()=>{},["stop"]))},"⠿",40,VA)):t.createCommentVNode("",!0),ge(ue)?(t.openBlock(),t.createElementBlock("span",LA,t.toDisplayString(ue.name),1)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createVNode(t.unref(oo),{id:`l:${ue.modelId}`,type:"target",position:t.unref(Ve).Left,class:"em-handle",title:W.value?i("em.node.connectHint"):void 0},null,8,["id","position","title"]),t.createElementVNode("span",{class:"em-entity__keys",title:Se(Le.value[ue.modelId]),"aria-hidden":"true"},[t.createElementVNode("span",DA,[(it=Le.value[ue.modelId])!=null&&it.pk?(t.openBlock(),t.createBlock(xe,{key:0,name:"key",size:12,class:"em-key is-pk"})):(We=Le.value[ue.modelId])!=null&&We.required?(t.openBlock(),t.createBlock(xe,{key:1,name:"asterisk",size:14,class:"em-key is-required"})):t.createCommentVNode("",!0)]),t.createElementVNode("span",OA,[Ie.value&&me(ue)?(t.openBlock(),t.createElementBlock("button",{key:0,tabindex:"-1",type:"button",class:"em-embed-caret nodrag",title:ve(ue)?i("em.node.embedAttrShow",{count:ke(ue)}):i("em.node.embedAttrHide"),"aria-expanded":!ve(ue),onClick:t.withModifiers(gt=>ft(ue),["stop"]),onPointerdown:q[8]||(q[8]=t.withModifiers(()=>{},["stop"])),onDblclick:q[9]||(q[9]=t.withModifiers(()=>{},["stop"]))},t.toDisplayString(ve(ue)?"▸":"▾"),41,PA)):ee(ue)?(t.openBlock(),t.createBlock(xe,{key:1,name:"table",size:11,class:"em-embed-glyph"})):(Ho=Le.value[ue.modelId])!=null&&Ho.fk?(t.openBlock(),t.createBlock(xe,{key:2,name:"key",size:12,class:"em-key is-fk"})):t.createCommentVNode("",!0)])],8,BA),t.createElementVNode("span",{class:"em-entity__attrname",style:t.normalizeStyle({color:pe(ue)})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(be(ue),(gt,Kn)=>(t.openBlock(),t.createElementBlock("span",{key:Kn,class:t.normalizeClass({"em-entity__missing":gt.missing})},t.toDisplayString(gt.text),3))),128))],4),le(ue)==="attr"?(t.openBlock(),t.createElementBlock("button",{key:0,tabindex:"-1",type:"button",class:"em-entity__embed-fold nodrag","data-axis":"attr",title:i("em.node.embedAttrShow",{count:ke(ue)}),onClick:t.withModifiers(gt=>ft(ue),["stop"])},"+"+t.toDisplayString(ke(ue)),9,zA)):le(ue)==="slot"?(t.openBlock(),t.createElementBlock("button",{key:1,tabindex:"-1",type:"button",class:"em-entity__embed-fold nodrag","data-axis":"slot",title:ht(ue)?i("em.node.embedRepeatedShow",{count:((pa=Pe(ue))==null?void 0:pa.size)??0}):i("em.node.embedRepeatedHide"),"aria-expanded":!ht(ue),onClick:t.withModifiers(gt=>ct(ue),["stop"])},t.toDisplayString(ht(ue)?`+${re(ue)}`:"−"),9,FA)):t.createCommentVNode("",!0),jt.value[ue.modelId]?(t.openBlock(),t.createElementBlock("span",UA,t.toDisplayString(jt.value[ue.modelId]),1)):t.createCommentVNode("",!0),t.createVNode(t.unref(oo),{id:`r:${ue.modelId}`,type:"source",position:t.unref(Ve).Right,class:"em-handle",title:W.value?i("em.node.connectHint"):void 0},null,8,["id","position","title"])],64))],42,MA),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ee(ue)&&Ie.value?Ze(ue):[],gt=>(t.openBlock(),t.createElementBlock("li",{key:`${ue.modelId}:${gt.modelId}`,class:t.normalizeClass(["em-entity__embed-col",{"is-group-selected":$(ue)}]),onClick:t.withModifiers(Kn=>T(ue,Kn),["stop"])},[q[12]||(q[12]=t.createElementVNode("span",{class:"em-entity__embed-rail","aria-hidden":"true"},null,-1)),t.createElementVNode("span",jA,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Rt(gt),(Kn,al)=>(t.openBlock(),t.createElementBlock("span",{key:al,class:t.normalizeClass({"em-entity__missing":Kn.missing})},t.toDisplayString(Kn.text),3))),128))]),t.createElementVNode("span",KA,t.toDisplayString(gt.dataType),1)],10,HA))),128))],64)}),128)),Qe.value?(t.openBlock(),t.createElementBlock("li",GA,[t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__embed-summary-btn nodrag",title:i("em.node.embedAllShow"),onClick:t.withModifiers(qe,["stop"])},[t.createVNode(xe,{name:"table",size:11}),t.createElementVNode("span",null,t.toDisplayString(i("em.node.embedAllSummary",{n:Qe.value})),1)],8,YA)])):t.createCommentVNode("",!0)],512)),!j.value&&V.value?(t.openBlock(),t.createElementBlock("ul",{key:2,ref_key:"opsUl",ref:Oe,class:"em-entity__ops"},[He.value&&He.value.dropIndex>=0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:t.normalizeStyle({top:`${He.value.lineY}px`}),"aria-hidden":"true"},null,4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(he.value,ue=>{var Ae,it;return t.openBlock(),t.createElementBlock("li",{key:ue.modelId,class:t.normalizeClass(["em-entity__op-row",{"is-dragging":((Ae=He.value)==null?void 0:Ae.id)===ue.modelId,"is-diff-changed":!!((it=u.value)!=null&&it.changedOperationIds.has(ue.modelId))}]),"data-op":ue.modelId},[W.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:We=>Ke(ue,We),onPointermove:we,onPointerup:Je,onPointercancel:Xe,onClick:q[10]||(q[10]=t.withModifiers(()=>{},["stop"]))},"⠿",40,WA)):t.createCommentVNode("",!0),t.createElementVNode("span",JA,t.toDisplayString(K(ue.visibility)),1),t.createElementVNode("span",{class:"em-entity__op-name",style:t.normalizeStyle({color:Z(ue)})},t.toDisplayString(ue.name)+"()",5)],10,qA)}),128))],512)):he.value.length?(t.openBlock(),t.createElementBlock("div",{key:3,class:"em-entity__ops-summary",title:i("em.node.opsSummaryTitle",{n:he.value.length})},[t.createVNode(xe,{name:"method",size:12}),t.createElementVNode("span",null,t.toDisplayString(i("em.node.opsSummary",{n:he.value.length})),1)],8,XA)):t.createCommentVNode("",!0),W.value?(t.openBlock(),t.createElementBlock("footer",ZA,[t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__add nodrag",onClick:ze},t.toDisplayString(i("em.node.addAttr")),1),q[13]||(q[13]=t.createElementVNode("span",{class:"em-entity__footer-sep","aria-hidden":"true"},null,-1)),t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__add nodrag",onClick:Y},t.toDisplayString(i("em.node.addDivider")),1)])):t.createCommentVNode("",!0),W.value&&!ut.value?(t.openBlock(),t.createElementBlock("div",{key:5,class:"em-entity__resize nodrag nopan",onPointerdown:bt,onPointermove:Vt,onPointerup:Ye},null,32)):t.createCommentVNode("",!0)],46,CA)}}}),[["__scopeId","data-v-0224247e"]]),QA={key:0,class:"em-sel","aria-hidden":"true"},ex={class:"em-group__label"},tx={class:"em-group__name"},nx={key:0,class:"em-group__pkg"},ox={key:1,class:"em-group__flag"},Ph=tt(t.defineComponent({__name:"GroupNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const n=e,o=t.computed(()=>n.data.group),i=t.computed(()=>n.data.locked??!1),a=t.computed(()=>Bt(n.data.style)),r=t.computed(()=>a.value?{"--em-group-fill":`color-mix(in srgb, var(--em-swatch-${a.value}-bar) 14%, transparent)`}:{}),l=t.inject(io,null),s=(z,P)=>l?l.t(z,P):cn("ko",z,P),c=t.computed(()=>!!l&&l.editable.value),d=t.computed(()=>{var z;return!!n.id&&((z=l==null?void 0:l.selection.value)==null?void 0:z.kind)==="group"&&l.selection.value.id===n.id}),u=t.computed(()=>!!n.selected&&!d.value),m=t.inject(Br,null),f=t.computed(()=>!!n.id&&(m==null?void 0:m.value)===n.id),p=t.inject(Oo,null);function y(){n.id&&(p==null||p.setGroupHover(n.id))}function g(){p==null||p.setGroupHover(null)}const b=t.computed(()=>!!p&&p.hoverGroupId.value===n.id),k=t.computed(()=>!!p&&p.hoverGroupId.value!==null&&p.hoverGroupId.value!==n.id),{screenToFlowCoordinate:_,findNode:h}=ot();let C=null,v=null;function S(z){var E;if(!n.id||!c.value)return;z.stopPropagation();const P=((E=h(n.id))==null?void 0:E.dimensions)??{width:400,height:300},D=_({x:z.clientX,y:z.clientY});C={fx:D.x,fy:D.y,w:P.width,h:P.height},z.target.setPointerCapture(z.pointerId)}function N(z){if(!C||!n.id)return;const P=_({x:z.clientX,y:z.clientY});v={width:Math.max(160,C.w+(P.x-C.fx)),height:Math.max(120,C.h+(P.y-C.fy))};const D=h(n.id);D&&(D.style={width:`${v.width}px`,height:`${v.height}px`})}function A(z){var P,D;C&&v&&n.id&&l&&l.resizeGroup(n.id,v),C=null,v=null,(D=(P=z.target).releasePointerCapture)==null||D.call(P,z.pointerId)}const T=t.computed(()=>(l==null?void 0:l.userLanguage.value)??"ko"),O=t.computed(()=>{const z=o.value.name;return Ct(z,T.value)||o.value.packageName||s("em.group.fallback")});return(z,P)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-group",{"is-drop-target":f.value,"is-hover-origin":b.value,"is-dimmed":k.value,"is-selected":d.value,"is-multi-selected":u.value,"is-locked":i.value}]),tabindex:"-1",style:t.normalizeStyle(r.value),onMouseenter:y,onMouseleave:g},[d.value?(t.openBlock(),t.createElementBlock("div",QA,[...P[0]||(P[0]=[t.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):t.createCommentVNode("",!0),t.createElementVNode("div",ex,[t.createElementVNode("span",tx,t.toDisplayString(O.value),1),o.value.packageName?(t.openBlock(),t.createElementBlock("span",nx,t.toDisplayString(o.value.packageName),1)):t.createCommentVNode("",!0),o.value.excludeDDLGeneration?(t.openBlock(),t.createElementBlock("span",ox,t.toDisplayString(s("em.group.ddlExcludeBadge")),1)):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createBlock(xe,{key:2,name:"lock",size:12,class:"em-group__lock",title:s("em.node.editLock")},null,8,["title"])):t.createCommentVNode("",!0)]),c.value&&!i.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"em-group__resize nodrag nopan",onPointerdown:S,onPointermove:N,onPointerup:A},null,32)):t.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-4fd27d62"]]),ix={key:0,class:"em-sel","aria-hidden":"true"},ax={key:2,class:"em-note__text"},zh=tt(t.defineComponent({__name:"NoteNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const n=e,o=t.inject(io,null),i=t.inject(Br,null),a=t.inject(Oo,null),r=t.computed(()=>n.data.note),l=t.computed(()=>!!o&&o.editable.value),s=t.computed(()=>Bt(r.value.style)),c=t.computed(()=>s.value?{"--em-note-fill":`color-mix(in srgb, var(--em-swatch-${s.value}-bar) 16%, var(--em-note-surface))`,"--em-note-stroke":`color-mix(in srgb, var(--em-swatch-${s.value}-bar) 50%, var(--em-note-border))`}:{});function d(){i&&(i.value=n.data.groupRef??null)}function u(){a==null||a.setNoteHover(n.id)}function m(){a==null||a.setNoteHover(null)}const f=t.computed(()=>{var E;return((E=a==null?void 0:a.source.value)==null?void 0:E.kind)==="note"&&a.source.value.id===n.id}),p=t.computed(()=>!!a&&a.relatedNoteIds.value.has(n.id)&&!f.value),y=t.computed(()=>{var E;return((E=o==null?void 0:o.selection.value)==null?void 0:E.kind)==="note"&&o.selection.value.id===n.id}),g=t.computed(()=>!!n.selected&&!y.value),b=t.computed(()=>!!a&&a.active.value&&!a.relatedNoteIds.value.has(n.id)&&!y.value),k=[{id:"n-top",pos:Ve.Top},{id:"n-right",pos:Ve.Right},{id:"n-bottom",pos:Ve.Bottom},{id:"n-left",pos:Ve.Left}],_=t.ref(!1),h=t.ref(""),C=t.ref(null);async function v(){var E;l.value&&(h.value=r.value.memo,_.value=!0,await t.nextTick(),(E=C.value)==null||E.focus())}function S(){_.value&&(_.value=!1,h.value!==r.value.memo&&(o==null||o.setNoteMemo(n.id,h.value)))}const{screenToFlowCoordinate:N,findNode:A}=ot();let T=null,O=null;function z(E){var x;if(!l.value)return;E.stopPropagation();const R=((x=A(n.id))==null?void 0:x.dimensions)??r.value.geo.size,I=N({x:E.clientX,y:E.clientY});T={fx:I.x,fy:I.y,w:R.width,h:R.height},E.target.setPointerCapture(E.pointerId)}function P(E){if(!T)return;const R=N({x:E.clientX,y:E.clientY});O={width:Math.max(140,T.w+(R.x-T.fx)),height:Math.max(60,T.h+(R.y-T.fy))};const I=A(n.id);I&&(I.style={width:`${O.width}px`,height:`${O.height}px`})}function D(E){var R,I;T&&O&&o&&o.resizeNote(n.id,O),T=null,O=null,(I=(R=E.target).releasePointerCapture)==null||I.call(R,E.pointerId)}return(E,R)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-note",{"is-hover-origin":f.value,"is-related":p.value,"is-dimmed":b.value,"is-selected":y.value,"is-multi-selected":g.value}]),tabindex:"-1",style:t.normalizeStyle(c.value),onDblclick:v,onPointerdown:d,onMouseenter:u,onMouseleave:m},[y.value?(t.openBlock(),t.createElementBlock("div",ix,[...R[4]||(R[4]=[t.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),t.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):t.createCommentVNode("",!0),_.value?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:1,ref_key:"area",ref:C,"onUpdate:modelValue":R[0]||(R[0]=I=>h.value=I),class:"em-note__edit nodrag",onBlur:S,onKeydown:R[1]||(R[1]=t.withKeys(I=>_.value=!1,["esc"])),onPointerdown:R[2]||(R[2]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,h.value]]):(t.openBlock(),t.createElementBlock("div",ax,t.toDisplayString(r.value.memo),1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(k,I=>t.createVNode(t.unref(oo),{id:I.id,key:I.id,type:"source",position:I.pos,class:"em-note-handle",onPointerdown:R[3]||(R[3]=t.withModifiers(()=>{},["stop"]))},null,8,["id","position"])),64)),l.value&&!_.value?(t.openBlock(),t.createElementBlock("div",{key:3,class:"em-note__resize nodrag nopan",onPointerdown:z,onPointermove:P,onPointerup:D},null,32)):t.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-62a09d8c"]]);function Dr(e){switch(e){case"right":return{x:1,y:0};case"left":return{x:-1,y:0};case"top":return{x:0,y:-1};case"bottom":return{x:0,y:1}}}const ui=.5;function Fh(e,n,o,i,a,r){const l=Dr(n),s=Dr(a),c={x:e.x+l.x*r,y:e.y+l.y*r},d={x:i.x+s.x*r,y:i.y+s.y*r},u=[c,...o,d],m=[];let f=e;const p=(b,k)=>{(Math.abs(b.x-f.x)>=ui||Math.abs(b.y-f.y)>=ui)&&(m.push({a:f,b,seg:k}),f=b)};p(c,0);let y=l.x!==0,g=c;for(let b=1;b<u.length;b++){const k=u[b],_=b<=o.length?b-1:o.length,h=Math.abs(k.x-g.x)<ui,C=Math.abs(k.y-g.y)<ui;h&&C||(h?(p(k,_),y=!1):C?(p(k,_),y=!0):y?(p({x:g.x,y:k.y},_),p(k,_),y=!0):(p({x:k.x,y:g.y},_),p(k,_),y=!1),g=k)}return p(i,o.length),m}function rc(e,n,o,i,a,r=20){const l=Fh(e,n,o,i,a,r);let s=`M ${Dt(e.x)},${Dt(e.y)}`;for(const c of l)s+=` L ${Dt(c.b.x)},${Dt(c.b.y)}`;return s}const rx=14;function Uh(e,n,o,i,a,r=20){return Fh(e,n,o,i,a,r).filter(l=>Math.hypot(l.b.x-l.a.x,l.b.y-l.a.y)>=rx).map(l=>({point:{x:(l.a.x+l.b.x)/2,y:(l.a.y+l.b.y)/2},segIndex:l.seg}))}function Dt(e){return Math.round(e*100)/100}const lx=36;function sx(e,n,o=lx){const i=Math.max(e.x,n.x)+o;return`M ${Dt(e.x)},${Dt(e.y)} L ${Dt(i)},${Dt(e.y)} L ${Dt(i)},${Dt(n.y)} L ${Dt(n.x)},${Dt(n.y)}`}function lc(e,n,o){const i=[e,...n,o];let a=`M ${Dt(i[0].x)},${Dt(i[0].y)}`;for(let r=1;r<i.length;r++)a+=` L ${Dt(i[r].x)},${Dt(i[r].y)}`;return a}function cx(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Hh(e,n){const o=cx(e),i=e.width/2,a=e.height/2,r=n.x-o.x,l=n.y-o.y;if(Math.abs(r)<ui&&Math.abs(l)<ui)return{point:{x:e.x+e.width,y:o.y},side:"right"};const s=r!==0?i/Math.abs(r):1/0,c=l!==0?a/Math.abs(l):1/0,d=Math.min(s,c),u={x:o.x+r*d,y:o.y+l*d},m=s<=c?r>=0?"right":"left":l>=0?"bottom":"top";return{point:u,side:m}}function jh(e,n,o){const i=o>=e.x+e.width/2;return{point:{x:i?e.x+e.width:e.x,y:n},side:i?"right":"left"}}function Kh(e,n,o){const i=[e,...n,o],a=[];for(let r=1;r<i.length;r++){const l=i[r-1],s=i[r];a.push({x:(l.x+s.x)/2,y:(l.y+s.y)/2})}return a}const dx=20,ux=22,mx=7,fx=22,Gh=31,Yh=7,px=20,qh=11,Wh=11,hx=Gh+Yh;function yx(e){return e==="NO_INSTANCE_OR_ONE_INSTANCE"||e==="ZERO_OR_MORE_INSTANCES"}function gx(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function Or(e,n,o){const i=n.x-e.x,a=n.y-e.y,r=Math.hypot(i,a)||1;return{x:e.x+i*o/r,y:e.y+a*o/r}}function Jh(e,n){return Math.atan2(n.y-e.y,n.x-e.x)}function Pr(e,n,o){return{x:Math.cos(o)*n+e.x,y:Math.sin(o)*n+e.y}}function Xh(e,n,o,i){const a=i/2,r=e.x===n.x&&e.y===n.y?Math.PI/2:Jh(e,n);return[Pr(o,a,r-Math.PI/2),Pr(o,a,r+Math.PI/2)]}function Zh(e,n,o,i){const a=n*180/Math.PI,l=(a>=0?i?a-20:a+20:i?a+20:a-20)*Math.PI/180;return{x:Math.sin(l)*o+e.x,y:Math.cos(l)*o+e.y}}function Qh(e,n,o,i){const a=[],r=[],l=[];if(e.x===n.x&&e.y===n.y)return{lines:a,circles:r,polygons:l};if(i==="db"){const c=Or(e,n,dx),[d,u]=Xh(e,n,c,ux);if(a.push({x1:d.x,y1:d.y,x2:u.x,y2:u.y}),a.push({x1:c.x,y1:c.y,x2:e.x,y2:e.y}),yx(o.multiplicity)){const m=Or(e,n,Gh);r.push({cx:m.x,cy:m.y,r:Yh})}if(gx(o.multiplicity)){const m=Or(e,n,mx),[f,p]=Xh(e,n,m,fx);a.push({x1:c.x,y1:c.y,x2:f.x,y2:f.y}),a.push({x1:c.x,y1:c.y,x2:p.x,y2:p.y}),a.push({x1:c.x,y1:c.y,x2:m.x,y2:m.y})}return{lines:a,circles:r,polygons:l}}let s=e;if(o.composition){const c=Or(e,n,px),d={x:(e.x+c.x)/2,y:(e.y+c.y)/2},u=Jh(e,n),m=Pr(d,qh/2,u-Math.PI/2),f=Pr(d,qh/2,u+Math.PI/2);l.push({points:[e,m,c,f]}),s=c}if(o.navigable&&!o.otherNavigable){const c=Math.atan2(n.x-e.x,n.y-e.y),d=Zh(s,c,Wh,!0),u=Zh(s,c,Wh,!1);a.push({x1:s.x,y1:s.y,x2:d.x,y2:d.y}),a.push({x1:s.x,y1:s.y,x2:u.x,y2:u.y})}return{lines:a,circles:r,polygons:l}}const ey=200,ty=120,sc=24;function ny(e){var a,r;if(!e)return{x:0,y:0,width:ey,height:ty};const n=e.computedPosition??e.position??{x:0,y:0},o=((a=e.dimensions)==null?void 0:a.width)||ey,i=((r=e.dimensions)==null?void 0:r.height)||ty;return{x:n.x,y:n.y,width:o,height:i}}function oy(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function cc(e){const n=t.computed(()=>ny(e.sourceNode())),o=t.computed(()=>ny(e.targetNode())),i=t.computed(()=>{const d=e.sourceNode(),u=e.targetNode();return!!d&&!!u&&d.id===u.id}),a=t.computed(()=>{var p,y;const d=n.value,u=d.x+d.width;let m=((p=e.sourceRowY)==null?void 0:p.call(e))??d.y+d.height/3,f=((y=e.targetRowY)==null?void 0:y.call(e))??d.y+d.height*2/3;if(Math.abs(f-m)<sc){const g=(m+f)/2;m=g-sc/2,f=g+sc/2}return{source:{x:u,y:m},target:{x:u,y:f}}}),r=t.computed(()=>e.waypoints()[0]??oy(o.value)),l=t.computed(()=>{const d=e.waypoints();return d[d.length-1]??oy(n.value)}),s=t.computed(()=>{var u;const d=(u=e.sourceRowY)==null?void 0:u.call(e);return d!=null?jh(n.value,d,r.value.x):Hh(n.value,r.value)}),c=t.computed(()=>{var u;const d=(u=e.targetRowY)==null?void 0:u.call(e);return d!=null?jh(o.value,d,l.value.x):Hh(o.value,l.value)});return{source:t.computed(()=>i.value?a.value.source:s.value.point),target:t.computed(()=>i.value?a.value.target:c.value.point),sourceSide:t.computed(()=>i.value?"right":s.value.side),targetSide:t.computed(()=>i.value?"right":c.value.side),isSelf:i}}const dc=Symbol("waypointController"),bx=["d"],kx=["d"],_x=["d"],Ex=["x1","y1","x2","y2"],Nx=["cx","cy","r"],wx=["x","y"],Ix=["x","y"],vx=["cx","cy","onDblclick"],Cx=["x","y","onPointerdown","onDblclick"],iy=tt(t.defineComponent({inheritAttrs:!1,__name:"AssociationEdge",props:{id:{},sourceY:{},targetY:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,{screenToFlowCoordinate:o}=ot(),i=t.inject(dc),a=t.inject(io,null),r=t.computed(()=>!!a&&a.editable.value),l=t.inject(Ch,null),s=t.inject(Oo,null),c=t.computed(()=>!!s&&s.relatedEdgeIds.value.has(n.id)),d=t.computed(()=>{var ce;return((ce=a==null?void 0:a.selection.value)==null?void 0:ce.kind)==="association"&&a.selection.value.id===n.id}),u=t.computed(()=>!!s&&s.active.value&&!s.relatedEdgeIds.value.has(n.id)&&!d.value),m=t.computed(()=>{const ce=l==null?void 0:l.value;if(!ce||!a)return null;const pe=a.resolved.value.entities,he=L=>{var K;return(K=pe.find(Z=>Z.entity.modelId===L))==null?void 0:K.groupRef},V=n.data.association;return he(V.end1.entityRef)===ce.groupId&&he(V.end2.entityRef)===ce.groupId?{dx:ce.dx,dy:ce.dy}:null}),f=t.computed(()=>(i==null?void 0:i.points(n.id))??[]),p=t.ref(-1),y=t.ref({x:0,y:0}),g=t.computed(()=>{const ce=m.value;return f.value.map((pe,he)=>he===p.value?y.value:ce?{x:pe.x+ce.dx,y:pe.y+ce.dy}:pe)}),b=t.computed(()=>{var ce;return!!((ce=n.sourceNode.data)!=null&&ce.collapsed)}),k=t.computed(()=>{var ce;return!!((ce=n.targetNode.data)!=null&&ce.collapsed)}),{source:_,target:h,sourceSide:C,targetSide:v,isSelf:S}=cc({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>g.value,sourceRowY:()=>n.data.sourceColumnRef&&!b.value?n.sourceY:void 0,targetRowY:()=>n.data.targetColumnRef&&!k.value?n.targetY:void 0}),N=hx+4,A=t.computed(()=>S.value?sx(_.value,h.value):(a==null?void 0:a.routingMode.value)==="orthogonal"?rc(_.value,C.value,g.value,h.value,v.value,N):lc(_.value,g.value,h.value)),T=t.computed(()=>S.value||!r.value?[]:(a==null?void 0:a.routingMode.value)==="orthogonal"?Uh(_.value,C.value,g.value,h.value,v.value,N):Kh(_.value,g.value,h.value).map((ce,pe)=>({point:ce,segIndex:pe}))),O=t.computed(()=>S.value||!r.value?[]:g.value),z=wa;function P(ce,pe){p.value=ce,y.value={...f.value[ce]},pe.target.setPointerCapture(pe.pointerId),pe.stopPropagation()}function D(ce){if(p.value<0)return;const pe=o({x:ce.clientX,y:ce.clientY});y.value={x:pe.x,y:pe.y}}function E(ce){var pe,he;p.value>=0&&i&&i.movePoint(n.id,p.value,{...y.value}),p.value=-1,(he=(pe=ce.target).releasePointerCapture)==null||he.call(pe,ce.pointerId)}function R(ce,pe){pe.stopPropagation(),i==null||i.removePoint(n.id,ce)}function I(ce,pe){if(!i)return;const he=o({x:pe.clientX,y:pe.clientY});i.insertPoint(n.id,ce,{x:he.x,y:he.y})}const x=t.computed(()=>z(n.data.association.end1.multiplicity)),$=t.computed(()=>z(n.data.association.end2.multiplicity)),U=t.computed(()=>(a==null?void 0:a.displayMode.value)==="CLASS"?"class":"db"),F=t.computed(()=>U.value==="class"),B=t.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const ce=Dr(C.value);return{x:_.value.x+ce.x*10,y:_.value.y+ce.y*10}}return g.value[0]??h.value}),j=t.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const pe=Dr(v.value);return{x:h.value.x+pe.x*10,y:h.value.y+pe.y*10}}const ce=g.value;return ce[ce.length-1]??_.value}),X=t.computed(()=>{const ce=n.data.association;return{multiplicity:ce.end1.multiplicity,navigable:ce.end1.navigable,composition:ce.end1.composition,otherNavigable:ce.end2.navigable}}),W=t.computed(()=>{const ce=n.data.association;return{multiplicity:ce.end2.multiplicity,navigable:ce.end2.navigable,composition:ce.end2.composition,otherNavigable:ce.end1.navigable}}),oe=t.computed(()=>Qh(_.value,B.value,X.value,U.value)),de=t.computed(()=>Qh(h.value,j.value,W.value,U.value)),ie=t.computed(()=>[...oe.value.lines,...de.value.lines]),Ie=t.computed(()=>[...oe.value.circles,...de.value.circles]),Le=t.computed(()=>[...oe.value.polygons,...de.value.polygons].map(ce=>`M${ce.points.map(pe=>`${pe.x},${pe.y}`).join(" L")} Z`)),Se=t.computed(()=>({"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}));return(ce,pe)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("path",{d:A.value,fill:"none",class:"em-edge__hit"},null,8,bx),t.createElementVNode("path",{d:A.value,fill:"none","stroke-width":"1.5",class:t.normalizeClass(["em-edge__path",{"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}])},null,10,kx),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Le.value,(he,V)=>(t.openBlock(),t.createElementBlock("path",{key:`mpoly-${V}`,d:he,class:t.normalizeClass(["em-edge__marker em-edge__marker--fill",Se.value])},null,10,_x))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ie.value,(he,V)=>(t.openBlock(),t.createElementBlock("line",{key:`mline-${V}`,x1:he.x1,y1:he.y1,x2:he.x2,y2:he.y2,class:t.normalizeClass(["em-edge__marker",Se.value])},null,10,Ex))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Ie.value,(he,V)=>(t.openBlock(),t.createElementBlock("circle",{key:`mcirc-${V}`,cx:he.cx,cy:he.cy,r:he.r,class:t.normalizeClass(["em-edge__marker",Se.value])},null,10,Nx))),128)),F.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("text",{x:t.unref(_).x+8,y:t.unref(_).y-6,class:t.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},t.toDisplayString(x.value),11,wx),t.createElementVNode("text",{x:t.unref(h).x-8,y:t.unref(h).y-6,"text-anchor":"end",class:t.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},t.toDisplayString($.value),11,Ix)],64)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(T.value,(he,V)=>(t.openBlock(),t.createElementBlock("circle",{key:`mid-${V}`,cx:he.point.x,cy:he.point.y,r:"4",class:t.normalizeClass(["em-edge__mid",{"is-dimmed":u.value}]),onDblclick:t.withModifiers(L=>I(he.segIndex,L),["stop"])},null,42,vx))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(O.value,(he,V)=>(t.openBlock(),t.createElementBlock("rect",{key:`wp-${V}`,x:he.x-5,y:he.y-5,width:"10",height:"10",rx:"2",class:t.normalizeClass(["em-edge__waypoint",{"is-dimmed":u.value}]),onPointerdown:L=>P(V,L),onPointermove:D,onPointerup:E,onDblclick:L=>R(V,L)},null,42,Cx))),128))],64))}}),[["__scopeId","data-v-5468806a"]]);var zn=(e=>(e.Lines="lines",e.Dots="dots",e))(zn||{});const ay=function({dimensions:e,size:n,color:o}){return t.h("path",{stroke:o,"stroke-width":n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},ry=function({radius:e,color:n}){return t.h("circle",{cx:e,cy:e,r:e,fill:n})};zn.Lines+"",zn.Dots+"";const Sx={[zn.Dots]:"#81818a",[zn.Lines]:"#eee"},Rx=["id","x","y","width","height","patternTransform"],Ax={key:2,height:"100",width:"100"},xx=["fill"],$x=["x","y","fill"],Tx={name:"Background",compatConfig:{MODE:3}},Mx=t.defineComponent({...Tx,props:{id:{},variant:{default:()=>zn.Dots},gap:{default:20},size:{default:1},lineWidth:{default:1},patternColor:{},color:{},bgColor:{},height:{default:100},width:{default:100},x:{default:0},y:{default:0},offset:{default:0}},setup(e){const{id:n,viewport:o}=ot(),i=t.computed(()=>{const l=o.value.zoom,[s,c]=Array.isArray(e.gap)?e.gap:[e.gap,e.gap],d=[s*l||1,c*l||1],u=e.size*l,[m,f]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],p=[m*l||1+d[0]/2,f*l||1+d[1]/2];return{scaledGap:d,offset:p,size:u}}),a=t.toRef(()=>`pattern-${n}${e.id?`-${e.id}`:""}`),r=t.toRef(()=>e.color||e.patternColor||Sx[e.variant||zn.Dots]);return(l,s)=>(t.openBlock(),t.createElementBlock("svg",{class:"vue-flow__background vue-flow__container",style:t.normalizeStyle({height:`${l.height>100?100:l.height}%`,width:`${l.width>100?100:l.width}%`})},[t.renderSlot(l.$slots,"pattern-container",{id:a.value},()=>[t.createElementVNode("pattern",{id:a.value,x:t.unref(o).x%i.value.scaledGap[0],y:t.unref(o).y%i.value.scaledGap[1],width:i.value.scaledGap[0],height:i.value.scaledGap[1],patternTransform:`translate(-${i.value.offset[0]},-${i.value.offset[1]})`,patternUnits:"userSpaceOnUse"},[t.renderSlot(l.$slots,"pattern",{},()=>[l.variant===t.unref(zn).Lines?(t.openBlock(),t.createBlock(t.unref(ay),{key:0,size:l.lineWidth,color:r.value,dimensions:i.value.scaledGap},null,8,["size","color","dimensions"])):l.variant===t.unref(zn).Dots?(t.openBlock(),t.createBlock(t.unref(ry),{key:1,color:r.value,radius:i.value.size/2},null,8,["color","radius"])):t.createCommentVNode("",!0),l.bgColor?(t.openBlock(),t.createElementBlock("svg",Ax,[t.createElementVNode("rect",{width:"100%",height:"100%",fill:l.bgColor},null,8,xx)])):t.createCommentVNode("",!0)])],8,Rx)]),t.createElementVNode("rect",{x:l.x,y:l.y,width:"100%",height:"100%",fill:`url(#${a.value})`},null,8,$x),t.renderSlot(l.$slots,"default",{id:a.value})],4))}}),Vx={name:"ControlButton",compatConfig:{MODE:3}},Lx=(e,n)=>{const o=e.__vccOpts||e;for(const[i,a]of n)o[i]=a;return o},Bx={type:"button",class:"vue-flow__controls-button"};function Dx(e,n,o,i,a,r){return t.openBlock(),t.createElementBlock("button",Bx,[t.renderSlot(e.$slots,"default")])}const Po=Lx(Vx,[["render",Dx]]),Ox={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},Px=[t.createElementVNode("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function zx(e,n){return t.openBlock(),t.createElementBlock("svg",Ox,Px)}const Fx={render:zx},Ux={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},Hx=[t.createElementVNode("path",{d:"M0 0h32v4.2H0z"},null,-1)];function jx(e,n){return t.openBlock(),t.createElementBlock("svg",Ux,Hx)}const Kx={render:jx},Gx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},Yx=[t.createElementVNode("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0 0 27.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94a.919.919 0 0 1-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"},null,-1)];function qx(e,n){return t.openBlock(),t.createElementBlock("svg",Gx,Yx)}const Wx={render:qx},Jx={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},Xx=[t.createElementVNode("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"},null,-1)];function Zx(e,n){return t.openBlock(),t.createElementBlock("svg",Jx,Xx)}const Qx={render:Zx},e$={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},t$=[t.createElementVNode("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 0 0 0 13.714v15.238A3.056 3.056 0 0 0 3.048 32h18.285a3.056 3.056 0 0 0 3.048-3.048V13.714a3.056 3.056 0 0 0-3.048-3.047zM12.19 24.533a3.056 3.056 0 0 1-3.047-3.047 3.056 3.056 0 0 1 3.047-3.048 3.056 3.056 0 0 1 3.048 3.048 3.056 3.056 0 0 1-3.048 3.047z"},null,-1)];function n$(e,n){return t.openBlock(),t.createElementBlock("svg",e$,t$)}const o$={render:n$},i$={name:"Controls",compatConfig:{MODE:3}},a$=t.defineComponent({...i$,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>up.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:n}){const{nodesDraggable:o,nodesConnectable:i,elementsSelectable:a,setInteractive:r,zoomIn:l,zoomOut:s,fitView:c,viewport:d,minZoom:u,maxZoom:m}=ot(),f=t.toRef(()=>o.value||i.value||a.value),p=t.toRef(()=>d.value.zoom<=u.value),y=t.toRef(()=>d.value.zoom>=m.value);function g(){l(),n("zoomIn")}function b(){s(),n("zoomOut")}function k(){c(e.fitViewParams),n("fitView")}function _(){r(!f.value),n("interactionChange",!f.value)}return(h,C)=>(t.openBlock(),t.createBlock(t.unref(ch),{class:"vue-flow__controls",position:h.position},{default:t.withCtx(()=>[t.renderSlot(h.$slots,"top"),h.showZoom?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.renderSlot(h.$slots,"control-zoom-in",{},()=>[t.createVNode(Po,{class:"vue-flow__controls-zoomin",disabled:y.value,onClick:g},{default:t.withCtx(()=>[t.renderSlot(h.$slots,"icon-zoom-in",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(Fx))))])]),_:3},8,["disabled"])]),t.renderSlot(h.$slots,"control-zoom-out",{},()=>[t.createVNode(Po,{class:"vue-flow__controls-zoomout",disabled:p.value,onClick:b},{default:t.withCtx(()=>[t.renderSlot(h.$slots,"icon-zoom-out",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(Kx))))])]),_:3},8,["disabled"])])],64)):t.createCommentVNode("",!0),h.showFitView?t.renderSlot(h.$slots,"control-fit-view",{key:1},()=>[t.createVNode(Po,{class:"vue-flow__controls-fitview",onClick:k},{default:t.withCtx(()=>[t.renderSlot(h.$slots,"icon-fit-view",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(Wx))))])]),_:3})]):t.createCommentVNode("",!0),h.showInteractive?t.renderSlot(h.$slots,"control-interactive",{key:2},()=>[h.showInteractive?(t.openBlock(),t.createBlock(Po,{key:0,class:"vue-flow__controls-interactive",onClick:_},{default:t.withCtx(()=>[f.value?t.renderSlot(h.$slots,"icon-unlock",{key:0},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(o$))))]):t.createCommentVNode("",!0),f.value?t.createCommentVNode("",!0):t.renderSlot(h.$slots,"icon-lock",{key:1},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(Qx))))])]),_:3})):t.createCommentVNode("",!0)]):t.createCommentVNode("",!0),t.renderSlot(h.$slots,"default")]),_:3},8,["position"]))}});var r$={value:()=>{}};function uc(){for(var e=0,n=arguments.length,o={},i;e<n;++e){if(!(i=arguments[e]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new zr(o)}function zr(e){this._=e}function l$(e,n){return e.trim().split(/^|\s+/).map(function(o){var i="",a=o.indexOf(".");if(a>=0&&(i=o.slice(a+1),o=o.slice(0,a)),o&&!n.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}zr.prototype=uc.prototype={constructor:zr,on:function(e,n){var o=this._,i=l$(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=s$(o[a],e.name)))return a;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++r<l;)if(a=(e=i[r]).type)o[a]=ly(o[a],e.name,n);else if(n==null)for(a in o)o[a]=ly(o[a],e.name,null);return this},copy:function(){var e={},n=this._;for(var o in n)e[o]=n[o].slice();return new zr(e)},call:function(e,n){if((a=arguments.length-2)>0)for(var o=new Array(a),i=0,a,r;i<a;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(n,o)},apply:function(e,n,o){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var i=this._[e],a=0,r=i.length;a<r;++a)i[a].value.apply(n,o)}};function s$(e,n){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===n)return a.value}function ly(e,n,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=r$,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:n,value:o}),e}var mc="http://www.w3.org/1999/xhtml";const sy={svg:"http://www.w3.org/2000/svg",xhtml:mc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Fr(e){var n=e+="",o=n.indexOf(":");return o>=0&&(n=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),sy.hasOwnProperty(n)?{space:sy[n],local:e}:e}function c$(e){return function(){var n=this.ownerDocument,o=this.namespaceURI;return o===mc&&n.documentElement.namespaceURI===mc?n.createElement(e):n.createElementNS(o,e)}}function d$(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function cy(e){var n=Fr(e);return(n.local?d$:c$)(n)}function u$(){}function fc(e){return e==null?u$:function(){return this.querySelector(e)}}function m$(e){typeof e!="function"&&(e=fc(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=new Array(l),c,d,u=0;u<l;++u)(c=r[u])&&(d=e.call(c,c.__data__,u,r))&&("__data__"in c&&(d.__data__=c.__data__),s[u]=d);return new qt(i,this._parents)}function f$(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function p$(){return[]}function dy(e){return e==null?p$:function(){return this.querySelectorAll(e)}}function h$(e){return function(){return f$(e.apply(this,arguments))}}function y$(e){typeof e=="function"?e=h$(e):e=dy(e);for(var n=this._groups,o=n.length,i=[],a=[],r=0;r<o;++r)for(var l=n[r],s=l.length,c,d=0;d<s;++d)(c=l[d])&&(i.push(e.call(c,c.__data__,d,l)),a.push(c));return new qt(i,a)}function uy(e){return function(){return this.matches(e)}}function my(e){return function(n){return n.matches(e)}}var g$=Array.prototype.find;function b$(e){return function(){return g$.call(this.children,e)}}function k$(){return this.firstElementChild}function _$(e){return this.select(e==null?k$:b$(typeof e=="function"?e:my(e)))}var E$=Array.prototype.filter;function N$(){return Array.from(this.children)}function w$(e){return function(){return E$.call(this.children,e)}}function I$(e){return this.selectAll(e==null?N$:w$(typeof e=="function"?e:my(e)))}function v$(e){typeof e!="function"&&(e=uy(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=[],c,d=0;d<l;++d)(c=r[d])&&e.call(c,c.__data__,d,r)&&s.push(c);return new qt(i,this._parents)}function fy(e){return new Array(e.length)}function C$(){return new qt(this._enter||this._groups.map(fy),this._parents)}function Ur(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Ur.prototype={constructor:Ur,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function S$(e){return function(){return e}}function R$(e,n,o,i,a,r){for(var l=0,s,c=n.length,d=r.length;l<d;++l)(s=n[l])?(s.__data__=r[l],i[l]=s):o[l]=new Ur(e,r[l]);for(;l<c;++l)(s=n[l])&&(a[l]=s)}function A$(e,n,o,i,a,r,l){var s,c,d=new Map,u=n.length,m=r.length,f=new Array(u),p;for(s=0;s<u;++s)(c=n[s])&&(f[s]=p=l.call(c,c.__data__,s,n)+"",d.has(p)?a[s]=c:d.set(p,c));for(s=0;s<m;++s)p=l.call(e,r[s],s,r)+"",(c=d.get(p))?(i[s]=c,c.__data__=r[s],d.delete(p)):o[s]=new Ur(e,r[s]);for(s=0;s<u;++s)(c=n[s])&&d.get(f[s])===c&&(a[s]=c)}function x$(e){return e.__data__}function $$(e,n){if(!arguments.length)return Array.from(this,x$);var o=n?A$:R$,i=this._parents,a=this._groups;typeof e!="function"&&(e=S$(e));for(var r=a.length,l=new Array(r),s=new Array(r),c=new Array(r),d=0;d<r;++d){var u=i[d],m=a[d],f=m.length,p=T$(e.call(u,u&&u.__data__,d,i)),y=p.length,g=s[d]=new Array(y),b=l[d]=new Array(y),k=c[d]=new Array(f);o(u,m,g,b,k,p,n);for(var _=0,h=0,C,v;_<y;++_)if(C=g[_]){for(_>=h&&(h=_+1);!(v=b[h])&&++h<y;);C._next=v||null}}return l=new qt(l,i),l._enter=s,l._exit=c,l}function T$(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function M$(){return new qt(this._exit||this._groups.map(fy),this._parents)}function V$(e,n,o){var i=this.enter(),a=this,r=this.exit();return typeof e=="function"?(i=e(i),i&&(i=i.selection())):i=i.append(e+""),n!=null&&(a=n(a),a&&(a=a.selection())),o==null?r.remove():o(r),i&&a?i.merge(a).order():a}function L$(e){for(var n=e.selection?e.selection():e,o=this._groups,i=n._groups,a=o.length,r=i.length,l=Math.min(a,r),s=new Array(a),c=0;c<l;++c)for(var d=o[c],u=i[c],m=d.length,f=s[c]=new Array(m),p,y=0;y<m;++y)(p=d[y]||u[y])&&(f[y]=p);for(;c<a;++c)s[c]=o[c];return new qt(s,this._parents)}function B$(){for(var e=this._groups,n=-1,o=e.length;++n<o;)for(var i=e[n],a=i.length-1,r=i[a],l;--a>=0;)(l=i[a])&&(r&&l.compareDocumentPosition(r)^4&&r.parentNode.insertBefore(l,r),r=l);return this}function D$(e){e||(e=O$);function n(m,f){return m&&f?e(m.__data__,f.__data__):!m-!f}for(var o=this._groups,i=o.length,a=new Array(i),r=0;r<i;++r){for(var l=o[r],s=l.length,c=a[r]=new Array(s),d,u=0;u<s;++u)(d=l[u])&&(c[u]=d);c.sort(n)}return new qt(a,this._parents).order()}function O$(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function P$(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function z$(){return Array.from(this)}function F$(){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],a=0,r=i.length;a<r;++a){var l=i[a];if(l)return l}return null}function U$(){let e=0;for(const n of this)++e;return e}function H$(){return!this.node()}function j$(e){for(var n=this._groups,o=0,i=n.length;o<i;++o)for(var a=n[o],r=0,l=a.length,s;r<l;++r)(s=a[r])&&e.call(s,s.__data__,r,a);return this}function K$(e){return function(){this.removeAttribute(e)}}function G$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Y$(e,n){return function(){this.setAttribute(e,n)}}function q$(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function W$(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function J$(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,o)}}function X$(e,n){var o=Fr(e);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((n==null?o.local?G$:K$:typeof n=="function"?o.local?J$:W$:o.local?q$:Y$)(o,n))}function py(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Z$(e){return function(){this.style.removeProperty(e)}}function Q$(e,n,o){return function(){this.style.setProperty(e,n,o)}}function eT(e,n,o){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function tT(e,n,o){return arguments.length>1?this.each((n==null?Z$:typeof n=="function"?eT:Q$)(e,n,o??"")):mi(this.node(),e)}function mi(e,n){return e.style.getPropertyValue(n)||py(e).getComputedStyle(e,null).getPropertyValue(n)}function nT(e){return function(){delete this[e]}}function oT(e,n){return function(){this[e]=n}}function iT(e,n){return function(){var o=n.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function aT(e,n){return arguments.length>1?this.each((n==null?nT:typeof n=="function"?iT:oT)(e,n)):this.node()[e]}function hy(e){return e.trim().split(/^|\s+/)}function pc(e){return e.classList||new yy(e)}function yy(e){this._node=e,this._names=hy(e.getAttribute("class")||"")}yy.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function gy(e,n){for(var o=pc(e),i=-1,a=n.length;++i<a;)o.add(n[i])}function by(e,n){for(var o=pc(e),i=-1,a=n.length;++i<a;)o.remove(n[i])}function rT(e){return function(){gy(this,e)}}function lT(e){return function(){by(this,e)}}function sT(e,n){return function(){(n.apply(this,arguments)?gy:by)(this,e)}}function cT(e,n){var o=hy(e+"");if(arguments.length<2){for(var i=pc(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof n=="function"?sT:n?rT:lT)(o,n))}function dT(){this.textContent=""}function uT(e){return function(){this.textContent=e}}function mT(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function fT(e){return arguments.length?this.each(e==null?dT:(typeof e=="function"?mT:uT)(e)):this.node().textContent}function pT(){this.innerHTML=""}function hT(e){return function(){this.innerHTML=e}}function yT(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function gT(e){return arguments.length?this.each(e==null?pT:(typeof e=="function"?yT:hT)(e)):this.node().innerHTML}function bT(){this.nextSibling&&this.parentNode.appendChild(this)}function kT(){return this.each(bT)}function _T(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function ET(){return this.each(_T)}function NT(e){var n=typeof e=="function"?e:cy(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function wT(){return null}function IT(e,n){var o=typeof e=="function"?e:cy(e),i=n==null?wT:typeof n=="function"?n:fc(n);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function vT(){var e=this.parentNode;e&&e.removeChild(this)}function CT(){return this.each(vT)}function ST(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function RT(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function AT(e){return this.select(e?RT:ST)}function xT(e){return arguments.length?this.property("__data__",e):this.node().__data__}function $T(e){return function(n){e.call(this,n,this.__data__)}}function TT(e){return e.trim().split(/^|\s+/).map(function(n){var o="",i=n.indexOf(".");return i>=0&&(o=n.slice(i+1),n=n.slice(0,i)),{type:n,name:o}})}function MT(e){return function(){var n=this.__on;if(n){for(var o=0,i=-1,a=n.length,r;o<a;++o)r=n[o],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):n[++i]=r;++i?n.length=i:delete this.__on}}}function VT(e,n,o){return function(){var i=this.__on,a,r=$T(n);if(i){for(var l=0,s=i.length;l<s;++l)if((a=i[l]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=r,a.options=o),a.value=n;return}}this.addEventListener(e.type,r,o),a={type:e.type,name:e.name,value:n,listener:r,options:o},i?i.push(a):this.__on=[a]}}function LT(e,n,o){var i=TT(e+""),a,r=i.length,l;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,d=s.length,u;c<d;++c)for(a=0,u=s[c];a<r;++a)if((l=i[a]).type===u.type&&l.name===u.name)return u.value}return}for(s=n?VT:MT,a=0;a<r;++a)this.each(s(i[a],n,o));return this}function ky(e,n,o){var i=py(e),a=i.CustomEvent;typeof a=="function"?a=new a(n,o):(a=i.document.createEvent("Event"),o?(a.initEvent(n,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(n,!1,!1)),e.dispatchEvent(a)}function BT(e,n){return function(){return ky(this,e,n)}}function DT(e,n){return function(){return ky(this,e,n.apply(this,arguments))}}function OT(e,n){return this.each((typeof n=="function"?DT:BT)(e,n))}function*PT(){for(var e=this._groups,n=0,o=e.length;n<o;++n)for(var i=e[n],a=0,r=i.length,l;a<r;++a)(l=i[a])&&(yield l)}var _y=[null];function qt(e,n){this._groups=e,this._parents=n}function na(){return new qt([[document.documentElement]],_y)}function zT(){return this}qt.prototype=na.prototype={constructor:qt,select:m$,selectAll:y$,selectChild:_$,selectChildren:I$,filter:v$,data:$$,enter:C$,exit:M$,join:V$,merge:L$,selection:zT,order:B$,sort:D$,call:P$,nodes:z$,node:F$,size:U$,empty:H$,each:j$,attr:X$,style:tT,property:aT,classed:cT,text:fT,html:gT,raise:kT,lower:ET,append:NT,insert:IT,remove:CT,clone:AT,datum:xT,on:LT,dispatch:OT,[Symbol.iterator]:PT};function ao(e){return typeof e=="string"?new qt([[document.querySelector(e)]],[document.documentElement]):new qt([[e]],_y)}function FT(e){let n;for(;n=e.sourceEvent;)e=n;return e}function ro(e,n){if(e=FT(e),n===void 0&&(n=e.currentTarget),n){var o=n.ownerSVGElement||n;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(n.getScreenCTM().inverse()),[i.x,i.y]}if(n.getBoundingClientRect){var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}}return[e.pageX,e.pageY]}const hc={capture:!0,passive:!1};function yc(e){e.preventDefault(),e.stopImmediatePropagation()}function UT(e){var n=e.document.documentElement,o=ao(e).on("dragstart.drag",yc,hc);"onselectstart"in n?o.on("selectstart.drag",yc,hc):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function HT(e,n){var o=e.document.documentElement,i=ao(e).on("dragstart.drag",null);n&&(i.on("click.drag",yc,hc),setTimeout(function(){i.on("click.drag",null)},0)),"onselectstart"in o?i.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}function gc(e,n,o){e.prototype=n.prototype=o,o.constructor=e}function Ey(e,n){var o=Object.create(e.prototype);for(var i in n)o[i]=n[i];return o}function oa(){}var ia=.7,Hr=1/ia,fi="\\s*([+-]?\\d+)\\s*",aa="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",wn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",jT=/^#([0-9a-f]{3,8})$/,KT=new RegExp(`^rgb\\(${fi},${fi},${fi}\\)$`),GT=new RegExp(`^rgb\\(${wn},${wn},${wn}\\)$`),YT=new RegExp(`^rgba\\(${fi},${fi},${fi},${aa}\\)$`),qT=new RegExp(`^rgba\\(${wn},${wn},${wn},${aa}\\)$`),WT=new RegExp(`^hsl\\(${aa},${wn},${wn}\\)$`),JT=new RegExp(`^hsla\\(${aa},${wn},${wn},${aa}\\)$`),Ny={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};gc(oa,ra,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:wy,formatHex:wy,formatHex8:XT,formatHsl:ZT,formatRgb:Iy,toString:Iy});function wy(){return this.rgb().formatHex()}function XT(){return this.rgb().formatHex8()}function ZT(){return Ay(this).formatHsl()}function Iy(){return this.rgb().formatRgb()}function ra(e){var n,o;return e=(e+"").trim().toLowerCase(),(n=jT.exec(e))?(o=n[1].length,n=parseInt(n[1],16),o===6?vy(n):o===3?new Ht(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):o===8?jr(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):o===4?jr(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=KT.exec(e))?new Ht(n[1],n[2],n[3],1):(n=GT.exec(e))?new Ht(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=YT.exec(e))?jr(n[1],n[2],n[3],n[4]):(n=qT.exec(e))?jr(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=WT.exec(e))?Ry(n[1],n[2]/100,n[3]/100,1):(n=JT.exec(e))?Ry(n[1],n[2]/100,n[3]/100,n[4]):Ny.hasOwnProperty(e)?vy(Ny[e]):e==="transparent"?new Ht(NaN,NaN,NaN,0):null}function vy(e){return new Ht(e>>16&255,e>>8&255,e&255,1)}function jr(e,n,o,i){return i<=0&&(e=n=o=NaN),new Ht(e,n,o,i)}function QT(e){return e instanceof oa||(e=ra(e)),e?(e=e.rgb(),new Ht(e.r,e.g,e.b,e.opacity)):new Ht}function bc(e,n,o,i){return arguments.length===1?QT(e):new Ht(e,n,o,i??1)}function Ht(e,n,o,i){this.r=+e,this.g=+n,this.b=+o,this.opacity=+i}gc(Ht,bc,Ey(oa,{brighter(e){return e=e==null?Hr:Math.pow(Hr,e),new Ht(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ia:Math.pow(ia,e),new Ht(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ht(zo(this.r),zo(this.g),zo(this.b),Kr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Cy,formatHex:Cy,formatHex8:eM,formatRgb:Sy,toString:Sy}));function Cy(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}`}function eM(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}${Fo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Sy(){const e=Kr(this.opacity);return`${e===1?"rgb(":"rgba("}${zo(this.r)}, ${zo(this.g)}, ${zo(this.b)}${e===1?")":`, ${e})`}`}function Kr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function zo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fo(e){return e=zo(e),(e<16?"0":"")+e.toString(16)}function Ry(e,n,o,i){return i<=0?e=n=o=NaN:o<=0||o>=1?e=n=NaN:n<=0&&(e=NaN),new dn(e,n,o,i)}function Ay(e){if(e instanceof dn)return new dn(e.h,e.s,e.l,e.opacity);if(e instanceof oa||(e=ra(e)),!e)return new dn;if(e instanceof dn)return e;e=e.rgb();var n=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(n,o,i),r=Math.max(n,o,i),l=NaN,s=r-a,c=(r+a)/2;return s?(n===r?l=(o-i)/s+(o<i)*6:o===r?l=(i-n)/s+2:l=(n-o)/s+4,s/=c<.5?r+a:2-r-a,l*=60):s=c>0&&c<1?0:l,new dn(l,s,c,e.opacity)}function tM(e,n,o,i){return arguments.length===1?Ay(e):new dn(e,n,o,i??1)}function dn(e,n,o,i){this.h=+e,this.s=+n,this.l=+o,this.opacity=+i}gc(dn,tM,Ey(oa,{brighter(e){return e=e==null?Hr:Math.pow(Hr,e),new dn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ia:Math.pow(ia,e),new dn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,i=o+(o<.5?o:1-o)*n,a=2*o-i;return new Ht(kc(e>=240?e-240:e+120,a,i),kc(e,a,i),kc(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new dn(xy(this.h),Gr(this.s),Gr(this.l),Kr(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Kr(this.opacity);return`${e===1?"hsl(":"hsla("}${xy(this.h)}, ${Gr(this.s)*100}%, ${Gr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function xy(e){return e=(e||0)%360,e<0?e+360:e}function Gr(e){return Math.max(0,Math.min(1,e||0))}function kc(e,n,o){return(e<60?n+(o-n)*e/60:e<180?o:e<240?n+(o-n)*(240-e)/60:n)*255}const $y=e=>()=>e;function nM(e,n){return function(o){return e+o*n}}function oM(e,n,o){return e=Math.pow(e,o),n=Math.pow(n,o)-e,o=1/o,function(i){return Math.pow(e+i*n,o)}}function iM(e){return(e=+e)==1?Ty:function(n,o){return o-n?oM(n,o,e):$y(isNaN(n)?o:n)}}function Ty(e,n){var o=n-e;return o?nM(e,o):$y(isNaN(e)?n:e)}const My=(function e(n){var o=iM(n);function i(a,r){var l=o((a=bc(a)).r,(r=bc(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=Ty(a.opacity,r.opacity);return function(u){return a.r=l(u),a.g=s(u),a.b=c(u),a.opacity=d(u),a+""}}return i.gamma=e,i})(1);function lo(e,n){return e=+e,n=+n,function(o){return e*(1-o)+n*o}}var _c=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ec=new RegExp(_c.source,"g");function aM(e){return function(){return e}}function rM(e){return function(n){return e(n)+""}}function lM(e,n){var o=_c.lastIndex=Ec.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",n=n+"";(i=_c.exec(e))&&(a=Ec.exec(n));)(r=a.index)>o&&(r=n.slice(o,r),s[l]?s[l]+=r:s[++l]=r),(i=i[0])===(a=a[0])?s[l]?s[l]+=a:s[++l]=a:(s[++l]=null,c.push({i:l,x:lo(i,a)})),o=Ec.lastIndex;return o<n.length&&(r=n.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?rM(c[0].x):aM(n):(n=c.length,function(d){for(var u=0,m;u<n;++u)s[(m=c[u]).i]=m.x(d);return s.join("")})}var Vy=180/Math.PI,Nc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ly(e,n,o,i,a,r){var l,s,c;return(l=Math.sqrt(e*e+n*n))&&(e/=l,n/=l),(c=e*o+n*i)&&(o-=e*c,i-=n*c),(s=Math.sqrt(o*o+i*i))&&(o/=s,i/=s,c/=s),e*i<n*o&&(e=-e,n=-n,c=-c,l=-l),{translateX:a,translateY:r,rotate:Math.atan2(n,e)*Vy,skewX:Math.atan(c)*Vy,scaleX:l,scaleY:s}}var Yr;function sM(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Nc:Ly(n.a,n.b,n.c,n.d,n.e,n.f)}function cM(e){return e==null||(Yr||(Yr=document.createElementNS("http://www.w3.org/2000/svg","g")),Yr.setAttribute("transform",e),!(e=Yr.transform.baseVal.consolidate()))?Nc:(e=e.matrix,Ly(e.a,e.b,e.c,e.d,e.e,e.f))}function By(e,n,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,f,p,y){if(d!==m||u!==f){var g=p.push("translate(",null,n,null,o);y.push({i:g-4,x:lo(d,m)},{i:g-2,x:lo(u,f)})}else(m||f)&&p.push("translate("+m+n+f+o)}function l(d,u,m,f){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),f.push({i:m.push(a(m)+"rotate(",null,i)-2,x:lo(d,u)})):u&&m.push(a(m)+"rotate("+u+i)}function s(d,u,m,f){d!==u?f.push({i:m.push(a(m)+"skewX(",null,i)-2,x:lo(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,f,p,y){if(d!==m||u!==f){var g=p.push(a(p)+"scale(",null,",",null,")");y.push({i:g-4,x:lo(d,m)},{i:g-2,x:lo(u,f)})}else(m!==1||f!==1)&&p.push(a(p)+"scale("+m+","+f+")")}return function(d,u){var m=[],f=[];return d=e(d),u=e(u),r(d.translateX,d.translateY,u.translateX,u.translateY,m,f),l(d.rotate,u.rotate,m,f),s(d.skewX,u.skewX,m,f),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,m,f),d=u=null,function(p){for(var y=-1,g=f.length,b;++y<g;)m[(b=f[y]).i]=b.x(p);return m.join("")}}}var dM=By(sM,"px, ","px)","deg)"),uM=By(cM,", ",")",")"),mM=1e-12;function Dy(e){return((e=Math.exp(e))+1/e)/2}function fM(e){return((e=Math.exp(e))-1/e)/2}function pM(e){return((e=Math.exp(2*e))-1)/(e+1)}const hM=(function e(n,o,i){function a(r,l){var s=r[0],c=r[1],d=r[2],u=l[0],m=l[1],f=l[2],p=u-s,y=m-c,g=p*p+y*y,b,k;if(g<mM)k=Math.log(f/d)/n,b=function(N){return[s+N*p,c+N*y,d*Math.exp(n*N*k)]};else{var _=Math.sqrt(g),h=(f*f-d*d+i*g)/(2*d*o*_),C=(f*f-d*d-i*g)/(2*f*o*_),v=Math.log(Math.sqrt(h*h+1)-h),S=Math.log(Math.sqrt(C*C+1)-C);k=(S-v)/n,b=function(N){var A=N*k,T=Dy(v),O=d/(o*_)*(T*pM(n*A+v)-fM(v));return[s+O*p,c+O*y,d*T/Dy(n*A+v)]}}return b.duration=k*1e3*n/Math.SQRT2,b}return a.rho=function(r){var l=Math.max(.001,+r),s=l*l,c=s*s;return e(l,s,c)},a})(Math.SQRT2,2,4);var pi=0,la=0,sa=0,Oy=1e3,qr,ca,Wr=0,Uo=0,Jr=0,da=typeof performance=="object"&&performance.now?performance:Date,Py=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function wc(){return Uo||(Py(yM),Uo=da.now()+Jr)}function yM(){Uo=0}function Xr(){this._call=this._time=this._next=null}Xr.prototype=zy.prototype={constructor:Xr,restart:function(e,n,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?wc():+o)+(n==null?0:+n),!this._next&&ca!==this&&(ca?ca._next=this:qr=this,ca=this),this._call=e,this._time=o,Ic()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ic())}};function zy(e,n,o){var i=new Xr;return i.restart(e,n,o),i}function gM(){wc(),++pi;for(var e=qr,n;e;)(n=Uo-e._time)>=0&&e._call.call(void 0,n),e=e._next;--pi}function Fy(){Uo=(Wr=da.now())+Jr,pi=la=0;try{gM()}finally{pi=0,kM(),Uo=0}}function bM(){var e=da.now(),n=e-Wr;n>Oy&&(Jr-=n,Wr=e)}function kM(){for(var e,n=qr,o,i=1/0;n;)n._call?(i>n._time&&(i=n._time),e=n,n=n._next):(o=n._next,n._next=null,n=e?e._next=o:qr=o);ca=e,Ic(i)}function Ic(e){if(!pi){la&&(la=clearTimeout(la));var n=e-Uo;n>24?(e<1/0&&(la=setTimeout(Fy,e-da.now()-Jr)),sa&&(sa=clearInterval(sa))):(sa||(Wr=da.now(),sa=setInterval(bM,Oy)),pi=1,Py(Fy))}}function Uy(e,n,o){var i=new Xr;return n=n==null?0:+n,i.restart(a=>{i.stop(),e(a+n)},n,o),i}var _M=uc("start","end","cancel","interrupt"),EM=[],Hy=0,jy=1,vc=2,Zr=3,Ky=4,Cc=5,Qr=6;function el(e,n,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;NM(e,o,{name:n,index:i,group:a,on:_M,tween:EM,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Hy})}function Sc(e,n){var o=un(e,n);if(o.state>Hy)throw new Error("too late; already scheduled");return o}function In(e,n){var o=un(e,n);if(o.state>Zr)throw new Error("too late; already running");return o}function un(e,n){var o=e.__transition;if(!o||!(o=o[n]))throw new Error("transition not found");return o}function NM(e,n,o){var i=e.__transition,a;i[n]=o,o.timer=zy(r,0,o.time);function r(d){o.state=jy,o.timer.restart(l,o.delay,o.time),o.delay<=d&&l(d-o.delay)}function l(d){var u,m,f,p;if(o.state!==jy)return c();for(u in i)if(p=i[u],p.name===o.name){if(p.state===Zr)return Uy(l);p.state===Ky?(p.state=Qr,p.timer.stop(),p.on.call("interrupt",e,e.__data__,p.index,p.group),delete i[u]):+u<n&&(p.state=Qr,p.timer.stop(),p.on.call("cancel",e,e.__data__,p.index,p.group),delete i[u])}if(Uy(function(){o.state===Zr&&(o.state=Ky,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=vc,o.on.call("start",e,e.__data__,o.index,o.group),o.state===vc){for(o.state=Zr,a=new Array(f=o.tween.length),u=0,m=-1;u<f;++u)(p=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++m]=p);a.length=m+1}}function s(d){for(var u=d<o.duration?o.ease.call(null,d/o.duration):(o.timer.restart(c),o.state=Cc,1),m=-1,f=a.length;++m<f;)a[m].call(e,u);o.state===Cc&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=Qr,o.timer.stop(),delete i[n];for(var d in i)return;delete e.__transition}}function tl(e,n){var o=e.__transition,i,a,r=!0,l;if(o){n=n==null?null:n+"";for(l in o){if((i=o[l]).name!==n){r=!1;continue}a=i.state>vc&&i.state<Cc,i.state=Qr,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function wM(e){return this.each(function(){tl(this,e)})}function IM(e,n){var o,i;return function(){var a=In(this,e),r=a.tween;if(r!==o){i=o=r;for(var l=0,s=i.length;l<s;++l)if(i[l].name===n){i=i.slice(),i.splice(l,1);break}}a.tween=i}}function vM(e,n,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=In(this,e),l=r.tween;if(l!==i){a=(i=l).slice();for(var s={name:n,value:o},c=0,d=a.length;c<d;++c)if(a[c].name===n){a[c]=s;break}c===d&&a.push(s)}r.tween=a}}function CM(e,n){var o=this._id;if(e+="",arguments.length<2){for(var i=un(this.node(),o).tween,a=0,r=i.length,l;a<r;++a)if((l=i[a]).name===e)return l.value;return null}return this.each((n==null?IM:vM)(o,e,n))}function Rc(e,n,o){var i=e._id;return e.each(function(){var a=In(this,i);(a.value||(a.value={}))[n]=o.apply(this,arguments)}),function(a){return un(a,i).value[n]}}function Gy(e,n){var o;return(typeof n=="number"?lo:n instanceof ra?My:(o=ra(n))?(n=o,My):lM)(e,n)}function SM(e){return function(){this.removeAttribute(e)}}function RM(e){return function(){this.removeAttributeNS(e.space,e.local)}}function AM(e,n,o){var i,a=o+"",r;return function(){var l=this.getAttribute(e);return l===a?null:l===i?r:r=n(i=l,o)}}function xM(e,n,o){var i,a=o+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===i?r:r=n(i=l,o)}}function $M(e,n,o){var i,a,r;return function(){var l,s=o(this),c;return s==null?void this.removeAttribute(e):(l=this.getAttribute(e),c=s+"",l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s)))}}function TM(e,n,o){var i,a,r;return function(){var l,s=o(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),c=s+"",l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s)))}}function MM(e,n){var o=Fr(e),i=o==="transform"?uM:Gy;return this.attrTween(e,typeof n=="function"?(o.local?TM:$M)(o,i,Rc(this,"attr."+e,n)):n==null?(o.local?RM:SM)(o):(o.local?xM:AM)(o,i,n))}function VM(e,n){return function(o){this.setAttribute(e,n.call(this,o))}}function LM(e,n){return function(o){this.setAttributeNS(e.space,e.local,n.call(this,o))}}function BM(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&LM(e,r)),o}return a._value=n,a}function DM(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&VM(e,r)),o}return a._value=n,a}function OM(e,n){var o="attr."+e;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(n==null)return this.tween(o,null);if(typeof n!="function")throw new Error;var i=Fr(e);return this.tween(o,(i.local?BM:DM)(i,n))}function PM(e,n){return function(){Sc(this,e).delay=+n.apply(this,arguments)}}function zM(e,n){return n=+n,function(){Sc(this,e).delay=n}}function FM(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?PM:zM)(n,e)):un(this.node(),n).delay}function UM(e,n){return function(){In(this,e).duration=+n.apply(this,arguments)}}function HM(e,n){return n=+n,function(){In(this,e).duration=n}}function jM(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?UM:HM)(n,e)):un(this.node(),n).duration}function KM(e,n){if(typeof n!="function")throw new Error;return function(){In(this,e).ease=n}}function GM(e){var n=this._id;return arguments.length?this.each(KM(n,e)):un(this.node(),n).ease}function YM(e,n){return function(){var o=n.apply(this,arguments);if(typeof o!="function")throw new Error;In(this,e).ease=o}}function qM(e){if(typeof e!="function")throw new Error;return this.each(YM(this._id,e))}function WM(e){typeof e!="function"&&(e=uy(e));for(var n=this._groups,o=n.length,i=new Array(o),a=0;a<o;++a)for(var r=n[a],l=r.length,s=i[a]=[],c,d=0;d<l;++d)(c=r[d])&&e.call(c,c.__data__,d,r)&&s.push(c);return new Fn(i,this._parents,this._name,this._id)}function JM(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,o=e._groups,i=n.length,a=o.length,r=Math.min(i,a),l=new Array(i),s=0;s<r;++s)for(var c=n[s],d=o[s],u=c.length,m=l[s]=new Array(u),f,p=0;p<u;++p)(f=c[p]||d[p])&&(m[p]=f);for(;s<i;++s)l[s]=n[s];return new Fn(l,this._parents,this._name,this._id)}function XM(e){return(e+"").trim().split(/^|\s+/).every(function(n){var o=n.indexOf(".");return o>=0&&(n=n.slice(0,o)),!n||n==="start"})}function ZM(e,n,o){var i,a,r=XM(n)?Sc:In;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(n,o),l.on=a}}function QM(e,n){var o=this._id;return arguments.length<2?un(this.node(),o).on.on(e):this.each(ZM(o,e,n))}function e2(e){return function(){var n=this.parentNode;for(var o in this.__transition)if(+o!==e)return;n&&n.removeChild(this)}}function t2(){return this.on("end.remove",e2(this._id))}function n2(e){var n=this._name,o=this._id;typeof e!="function"&&(e=fc(e));for(var i=this._groups,a=i.length,r=new Array(a),l=0;l<a;++l)for(var s=i[l],c=s.length,d=r[l]=new Array(c),u,m,f=0;f<c;++f)(u=s[f])&&(m=e.call(u,u.__data__,f,s))&&("__data__"in u&&(m.__data__=u.__data__),d[f]=m,el(d[f],n,o,f,d,un(u,o)));return new Fn(r,this._parents,n,o)}function o2(e){var n=this._name,o=this._id;typeof e!="function"&&(e=dy(e));for(var i=this._groups,a=i.length,r=[],l=[],s=0;s<a;++s)for(var c=i[s],d=c.length,u,m=0;m<d;++m)if(u=c[m]){for(var f=e.call(u,u.__data__,m,c),p,y=un(u,o),g=0,b=f.length;g<b;++g)(p=f[g])&&el(p,n,o,g,f,y);r.push(f),l.push(u)}return new Fn(r,l,n,o)}var i2=na.prototype.constructor;function a2(){return new i2(this._groups,this._parents)}function r2(e,n){var o,i,a;return function(){var r=mi(this,e),l=(this.style.removeProperty(e),mi(this,e));return r===l?null:r===o&&l===i?a:a=n(o=r,i=l)}}function Yy(e){return function(){this.style.removeProperty(e)}}function l2(e,n,o){var i,a=o+"",r;return function(){var l=mi(this,e);return l===a?null:l===i?r:r=n(i=l,o)}}function s2(e,n,o){var i,a,r;return function(){var l=mi(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),mi(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s))}}function c2(e,n){var o,i,a,r="style."+n,l="end."+r,s;return function(){var c=In(this,e),d=c.on,u=c.value[r]==null?s||(s=Yy(n)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function d2(e,n,o){var i=(e+="")=="transform"?dM:Gy;return n==null?this.styleTween(e,r2(e,i)).on("end.style."+e,Yy(e)):typeof n=="function"?this.styleTween(e,s2(e,i,Rc(this,"style."+e,n))).each(c2(this._id,e)):this.styleTween(e,l2(e,i,n),o).on("end.style."+e,null)}function u2(e,n,o){return function(i){this.style.setProperty(e,n.call(this,i),o)}}function m2(e,n,o){var i,a;function r(){var l=n.apply(this,arguments);return l!==a&&(i=(a=l)&&u2(e,l,o)),i}return r._value=n,r}function f2(e,n,o){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(n==null)return this.tween(i,null);if(typeof n!="function")throw new Error;return this.tween(i,m2(e,n,o??""))}function p2(e){return function(){this.textContent=e}}function h2(e){return function(){var n=e(this);this.textContent=n??""}}function y2(e){return this.tween("text",typeof e=="function"?h2(Rc(this,"text",e)):p2(e==null?"":e+""))}function g2(e){return function(n){this.textContent=e.call(this,n)}}function b2(e){var n,o;function i(){var a=e.apply(this,arguments);return a!==o&&(n=(o=a)&&g2(a)),n}return i._value=e,i}function k2(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,b2(e))}function _2(){for(var e=this._name,n=this._id,o=qy(),i=this._groups,a=i.length,r=0;r<a;++r)for(var l=i[r],s=l.length,c,d=0;d<s;++d)if(c=l[d]){var u=un(c,n);el(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Fn(i,this._parents,e,o)}function E2(){var e,n,o=this,i=o._id,a=o.size();return new Promise(function(r,l){var s={value:l},c={value:function(){--a===0&&r()}};o.each(function(){var d=In(this,i),u=d.on;u!==e&&(n=(e=u).copy(),n._.cancel.push(s),n._.interrupt.push(s),n._.end.push(c)),d.on=n}),a===0&&r()})}var N2=0;function Fn(e,n,o,i){this._groups=e,this._parents=n,this._name=o,this._id=i}function qy(){return++N2}var Un=na.prototype;Fn.prototype={constructor:Fn,select:n2,selectAll:o2,selectChild:Un.selectChild,selectChildren:Un.selectChildren,filter:WM,merge:JM,selection:a2,transition:_2,call:Un.call,nodes:Un.nodes,node:Un.node,size:Un.size,empty:Un.empty,each:Un.each,on:QM,attr:MM,attrTween:OM,style:d2,styleTween:f2,text:y2,textTween:k2,remove:t2,tween:CM,delay:FM,duration:jM,ease:GM,easeVarying:qM,end:E2,[Symbol.iterator]:Un[Symbol.iterator]};function w2(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var I2={time:null,delay:0,duration:250,ease:w2};function v2(e,n){for(var o;!(o=e.__transition)||!(o=o[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return o}function C2(e){var n,o;e instanceof Fn?(n=e._id,e=e._name):(n=qy(),(o=I2).time=wc(),e=e==null?null:e+"");for(var i=this._groups,a=i.length,r=0;r<a;++r)for(var l=i[r],s=l.length,c,d=0;d<s;++d)(c=l[d])&&el(c,e,n,d,l,o||v2(c,n));return new Fn(i,this._parents,e,n)}na.prototype.interrupt=wM,na.prototype.transition=C2;const nl=e=>()=>e;function S2(e,{sourceEvent:n,target:o,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function Hn(e,n,o){this.k=e,this.x=n,this.y=o}Hn.prototype={constructor:Hn,scale:function(e){return e===1?this:new Hn(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Hn(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ac=new Hn(1,0,0);Hn.prototype;function xc(e){e.stopImmediatePropagation()}function ua(e){e.preventDefault(),e.stopImmediatePropagation()}function R2(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function A2(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Wy(){return this.__zoom||Ac}function x2(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function $2(){return navigator.maxTouchPoints||"ontouchstart"in this}function T2(e,n,o){var i=e.invertX(n[0][0])-o[0][0],a=e.invertX(n[1][0])-o[1][0],r=e.invertY(n[0][1])-o[0][1],l=e.invertY(n[1][1])-o[1][1];return e.translate(a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a),l>r?(r+l)/2:Math.min(0,r)||Math.max(0,l))}function M2(){var e=R2,n=A2,o=T2,i=x2,a=$2,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=hM,d=uc("start","zoom","end"),u,m,f,p=500,y=150,g=0,b=10;function k(E){E.property("__zoom",Wy).on("wheel.zoom",A,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",O).filter(a).on("touchstart.zoom",z).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",D).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(E,R,I,x){var $=E.selection?E.selection():E;$.property("__zoom",Wy),E!==$?v(E,R,I,x):$.interrupt().each(function(){S(this,arguments).event(x).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},k.scaleBy=function(E,R,I,x){k.scaleTo(E,function(){var $=this.__zoom.k,U=typeof R=="function"?R.apply(this,arguments):R;return $*U},I,x)},k.scaleTo=function(E,R,I,x){k.transform(E,function(){var $=n.apply(this,arguments),U=this.__zoom,F=I==null?C($):typeof I=="function"?I.apply(this,arguments):I,B=U.invert(F),j=typeof R=="function"?R.apply(this,arguments):R;return o(h(_(U,j),F,B),$,l)},I,x)},k.translateBy=function(E,R,I,x){k.transform(E,function(){return o(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof I=="function"?I.apply(this,arguments):I),n.apply(this,arguments),l)},null,x)},k.translateTo=function(E,R,I,x,$){k.transform(E,function(){var U=n.apply(this,arguments),F=this.__zoom,B=x==null?C(U):typeof x=="function"?x.apply(this,arguments):x;return o(Ac.translate(B[0],B[1]).scale(F.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof I=="function"?-I.apply(this,arguments):-I),U,l)},x,$)};function _(E,R){return R=Math.max(r[0],Math.min(r[1],R)),R===E.k?E:new Hn(R,E.x,E.y)}function h(E,R,I){var x=R[0]-I[0]*E.k,$=R[1]-I[1]*E.k;return x===E.x&&$===E.y?E:new Hn(E.k,x,$)}function C(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function v(E,R,I,x){E.on("start.zoom",function(){S(this,arguments).event(x).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(x).end()}).tween("zoom",function(){var $=this,U=arguments,F=S($,U).event(x),B=n.apply($,U),j=I==null?C(B):typeof I=="function"?I.apply($,U):I,X=Math.max(B[1][0]-B[0][0],B[1][1]-B[0][1]),W=$.__zoom,oe=typeof R=="function"?R.apply($,U):R,de=c(W.invert(j).concat(X/W.k),oe.invert(j).concat(X/oe.k));return function(ie){if(ie===1)ie=oe;else{var Ie=de(ie),Le=X/Ie[2];ie=new Hn(Le,j[0]-Ie[0]*Le,j[1]-Ie[1]*Le)}F.zoom(null,ie)}})}function S(E,R,I){return!I&&E.__zooming||new N(E,R)}function N(E,R){this.that=E,this.args=R,this.active=0,this.sourceEvent=null,this.extent=n.apply(E,R),this.taps=0}N.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,R){return this.mouse&&E!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var R=ao(this.that).datum();d.call(E,this.that,new S2(E,{sourceEvent:this.sourceEvent,target:k,transform:this.that.__zoom,dispatch:d}),R)}};function A(E,...R){if(!e.apply(this,arguments))return;var I=S(this,R).event(E),x=this.__zoom,$=Math.max(r[0],Math.min(r[1],x.k*Math.pow(2,i.apply(this,arguments)))),U=ro(E);if(I.wheel)(I.mouse[0][0]!==U[0]||I.mouse[0][1]!==U[1])&&(I.mouse[1]=x.invert(I.mouse[0]=U)),clearTimeout(I.wheel);else{if(x.k===$)return;I.mouse=[U,x.invert(U)],tl(this),I.start()}ua(E),I.wheel=setTimeout(F,y),I.zoom("mouse",o(h(_(x,$),I.mouse[0],I.mouse[1]),I.extent,l));function F(){I.wheel=null,I.end()}}function T(E,...R){if(f||!e.apply(this,arguments))return;var I=E.currentTarget,x=S(this,R,!0).event(E),$=ao(E.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",X,!0),U=ro(E,I),F=E.clientX,B=E.clientY;UT(E.view),xc(E),x.mouse=[U,this.__zoom.invert(U)],tl(this),x.start();function j(W){if(ua(W),!x.moved){var oe=W.clientX-F,de=W.clientY-B;x.moved=oe*oe+de*de>g}x.event(W).zoom("mouse",o(h(x.that.__zoom,x.mouse[0]=ro(W,I),x.mouse[1]),x.extent,l))}function X(W){$.on("mousemove.zoom mouseup.zoom",null),HT(W.view,x.moved),ua(W),x.event(W).end()}}function O(E,...R){if(e.apply(this,arguments)){var I=this.__zoom,x=ro(E.changedTouches?E.changedTouches[0]:E,this),$=I.invert(x),U=I.k*(E.shiftKey?.5:2),F=o(h(_(I,U),x,$),n.apply(this,R),l);ua(E),s>0?ao(this).transition().duration(s).call(v,F,x,E):ao(this).call(k.transform,F,x,E)}}function z(E,...R){if(e.apply(this,arguments)){var I=E.touches,x=I.length,$=S(this,R,E.changedTouches.length===x).event(E),U,F,B,j;for(xc(E),F=0;F<x;++F)B=I[F],j=ro(B,this),j=[j,this.__zoom.invert(j),B.identifier],$.touch0?!$.touch1&&$.touch0[2]!==j[2]&&($.touch1=j,$.taps=0):($.touch0=j,U=!0,$.taps=1+!!u);u&&(u=clearTimeout(u)),U&&($.taps<2&&(m=j[0],u=setTimeout(function(){u=null},p)),tl(this),$.start())}}function P(E,...R){if(this.__zooming){var I=S(this,R).event(E),x=E.changedTouches,$=x.length,U,F,B,j;for(ua(E),U=0;U<$;++U)F=x[U],B=ro(F,this),I.touch0&&I.touch0[2]===F.identifier?I.touch0[0]=B:I.touch1&&I.touch1[2]===F.identifier&&(I.touch1[0]=B);if(F=I.that.__zoom,I.touch1){var X=I.touch0[0],W=I.touch0[1],oe=I.touch1[0],de=I.touch1[1],ie=(ie=oe[0]-X[0])*ie+(ie=oe[1]-X[1])*ie,Ie=(Ie=de[0]-W[0])*Ie+(Ie=de[1]-W[1])*Ie;F=_(F,Math.sqrt(ie/Ie)),B=[(X[0]+oe[0])/2,(X[1]+oe[1])/2],j=[(W[0]+de[0])/2,(W[1]+de[1])/2]}else if(I.touch0)B=I.touch0[0],j=I.touch0[1];else return;I.zoom("touch",o(h(F,B,j),I.extent,l))}}function D(E,...R){if(this.__zooming){var I=S(this,R).event(E),x=E.changedTouches,$=x.length,U,F;for(xc(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),U=0;U<$;++U)F=x[U],I.touch0&&I.touch0[2]===F.identifier?delete I.touch0:I.touch1&&I.touch1[2]===F.identifier&&delete I.touch1;if(I.touch1&&!I.touch0&&(I.touch0=I.touch1,delete I.touch1),I.touch0)I.touch0[1]=this.__zoom.invert(I.touch0[0]);else if(I.end(),I.taps===2&&(F=ro(F,this),Math.hypot(m[0]-F[0],m[1]-F[1])<b)){var B=ao(this).on("dblclick.zoom");B&&B.apply(this,arguments)}}}return k.wheelDelta=function(E){return arguments.length?(i=typeof E=="function"?E:nl(+E),k):i},k.filter=function(E){return arguments.length?(e=typeof E=="function"?E:nl(!!E),k):e},k.touchable=function(E){return arguments.length?(a=typeof E=="function"?E:nl(!!E),k):a},k.extent=function(E){return arguments.length?(n=typeof E=="function"?E:nl([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),k):n},k.scaleExtent=function(E){return arguments.length?(r[0]=+E[0],r[1]=+E[1],k):[r[0],r[1]]},k.translateExtent=function(E){return arguments.length?(l[0][0]=+E[0][0],l[1][0]=+E[1][0],l[0][1]=+E[0][1],l[1][1]=+E[1][1],k):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},k.constrain=function(E){return arguments.length?(o=E,k):o},k.duration=function(E){return arguments.length?(s=+E,k):s},k.interpolate=function(E){return arguments.length?(c=E,k):c},k.on=function(){var E=d.on.apply(d,arguments);return E===d?k:E},k.clickDistance=function(E){return arguments.length?(g=(E=+E)*E,k):Math.sqrt(g)},k.tapDistance=function(E){return arguments.length?(b=+E,k):b},k}const Jy=Symbol("MiniMapSlots"),V2=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],L2={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},B2=t.defineComponent({...L2,props:{id:{},type:{},selected:{type:Boolean},dragging:{type:Boolean},position:{},dimensions:{},borderRadius:{},color:{},shapeRendering:{},strokeColor:{},strokeWidth:{},hidden:{type:Boolean}},emits:["click","dblclick","mouseenter","mousemove","mouseleave"],setup(e,{emit:n}){const o=e,i=t.inject(Jy),a=t.useAttrs(),r=t.toRef(()=>a.style??{});function l(m){n("click",m)}function s(m){n("dblclick",m)}function c(m){n("mouseenter",m)}function d(m){n("mousemove",m)}function u(m){n("mouseleave",m)}return(m,f)=>!m.hidden&&m.dimensions.width!==0&&m.dimensions.height!==0?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.unref(i)[`node-${o.type}`]?(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(i)[`node-${o.type}`]),t.normalizeProps(t.mergeProps({key:0},{...o,...m.$attrs})),null,16)):(t.openBlock(),t.createElementBlock("rect",t.mergeProps({key:1,id:m.id},m.$attrs,{class:["vue-flow__minimap-node",{selected:m.selected,dragging:m.dragging}],x:m.position.x,y:m.position.y,rx:m.borderRadius,ry:m.borderRadius,width:m.dimensions.width,height:m.dimensions.height,fill:m.color||r.value.background||r.value.backgroundColor,stroke:m.strokeColor,"stroke-width":m.strokeWidth,"shape-rendering":m.shapeRendering,onClick:l,onDblclick:s,onMouseenter:c,onMousemove:d,onMouseleave:u}),null,16,V2))],64)):t.createCommentVNode("",!0)}}),D2=["width","height","viewBox","aria-labelledby"],O2=["id"],P2=["d","fill","stroke","stroke-width"],z2={name:"MiniMap",compatConfig:{MODE:3}},F2=t.defineComponent({...z2,props:{nodeColor:{type:[String,Function],default:"#e2e2e2"},nodeStrokeColor:{type:[String,Function],default:"transparent"},nodeClassName:{type:[String,Function]},nodeBorderRadius:{default:5},nodeStrokeWidth:{default:2},maskColor:{default:"rgb(240, 240, 240, 0.6)"},maskStrokeColor:{default:"none"},maskStrokeWidth:{default:1},position:{default:"bottom-right"},pannable:{type:Boolean,default:!1},zoomable:{type:Boolean,default:!1},width:{},height:{},ariaLabel:{default:"Vue Flow mini map"},inversePan:{type:Boolean,default:!1},zoomStep:{default:1},offsetScale:{default:5},maskBorderRadius:{default:0}},emits:["click","nodeClick","nodeDblclick","nodeMouseenter","nodeMousemove","nodeMouseleave"],setup(e,{emit:n}){const o=t.useSlots(),i=t.useAttrs(),a=200,r=150,{id:l,edges:s,viewport:c,translateExtent:d,dimensions:u,emits:m,d3Selection:f,d3Zoom:p,getNodesInitialized:y}=ot(),g=t.ref();t.provide(Jy,o);const b=t.toRef(()=>{var $;return e.width??(($=i.style)==null?void 0:$.width)??a}),k=t.toRef(()=>{var $;return e.height??(($=i.style)==null?void 0:$.height)??r}),_=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",h=t.computed(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),C=t.computed(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),v=t.computed(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),S=t.computed(()=>Ps(y.value.filter($=>!$.hidden))),N=t.computed(()=>({x:-c.value.x/c.value.zoom,y:-c.value.y/c.value.zoom,width:u.value.width/c.value.zoom,height:u.value.height/c.value.zoom})),A=t.computed(()=>y.value&&y.value.length?Gw(S.value,N.value):N.value),T=t.computed(()=>{const $=A.value.width/b.value,U=A.value.height/k.value;return Math.max($,U)}),O=t.computed(()=>{const $=T.value*b.value,U=T.value*k.value,F=e.offsetScale*T.value;return{offset:F,x:A.value.x-($-A.value.width)/2-F,y:A.value.y-(U-A.value.height)/2-F,width:$+F*2,height:U+F*2}}),z=t.computed(()=>!O.value.x||!O.value.y?"":`
|
|
60
60
|
M${O.value.x-O.value.offset},${O.value.y-O.value.offset}
|
|
61
61
|
h${O.value.width+O.value.offset*2}
|
|
62
62
|
v${O.value.height+O.value.offset*2}
|
|
@@ -69,6 +69,6 @@ Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will
|
|
|
69
69
|
h${-(N.value.width-2*e.maskBorderRadius)}
|
|
70
70
|
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
|
|
71
71
|
v${-(N.value.height-2*e.maskBorderRadius)}
|
|
72
|
-
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);t.watchEffect($=>{if(g.value){const U=ao(g.value),F=X=>{if(X.sourceEvent.type!=="wheel"||!f.value||!p.value)return;const W=X.sourceEvent.ctrlKey&&ea()?10:1,oe=-X.sourceEvent.deltaY*(X.sourceEvent.deltaMode===1?.05:X.sourceEvent.deltaMode?1:.002)*e.zoomStep,de=c.value.zoom*2**(oe*W);p.value.scaleTo(f.value,de)},B=X=>{if(X.sourceEvent.type!=="mousemove"||!f.value||!p.value)return;const W=T.value*Math.max(1,c.value.zoom)*(e.inversePan?-1:1),oe={x:c.value.x-X.sourceEvent.movementX*W,y:c.value.y-X.sourceEvent.movementY*W},de=[[0,0],[u.value.width,u.value.height]],ie=Ac.translate(oe.x,oe.y).scale(c.value.zoom),Ie=p.value.constrain()(ie,de,d.value);p.value.transform(f.value,Ie)},j=M2().wheelDelta(X=>zs(X)*(e.zoomStep/10)).on("zoom",e.pannable?B:()=>{}).on("zoom.wheel",e.zoomable?F:()=>{});U.call(j),$(()=>{U.on("zoom",null)})}},{flush:"post"});function P($){const[U,F]=ro($);n("click",{event:$,position:{x:U,y:F}})}function D($,U){const F={event:$,node:U,connectedEdges:Mo([U],s.value)};m.miniMapNodeClick(F),n("nodeClick",F)}function E($,U){const F={event:$,node:U,connectedEdges:Mo([U],s.value)};m.miniMapNodeDoubleClick(F),n("nodeDblclick",F)}function R($,U){const F={event:$,node:U,connectedEdges:Mo([U],s.value)};m.miniMapNodeMouseEnter(F),n("nodeMouseenter",F)}function I($,U){const F={event:$,node:U,connectedEdges:Mo([U],s.value)};m.miniMapNodeMouseMove(F),n("nodeMousemove",F)}function x($,U){const F={event:$,node:U,connectedEdges:Mo([U],s.value)};m.miniMapNodeMouseLeave(F),n("nodeMouseleave",F)}return($,U)=>(t.openBlock(),t.createBlock(t.unref(ch),{position:$.position,class:t.normalizeClass(["vue-flow__minimap",{pannable:$.pannable,zoomable:$.zoomable}])},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{ref_key:"el",ref:g,width:b.value,height:k.value,viewBox:[O.value.x,O.value.y,O.value.width,O.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${t.unref(l)}`,onClick:P},[$.ariaLabel?(t.openBlock(),t.createElementBlock("title",{key:0,id:`vue-flow__minimap-${t.unref(l)}`},t.toDisplayString($.ariaLabel),9,O2)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(y),F=>(t.openBlock(),t.createBlock(B2,{id:F.id,key:F.id,f:"",position:F.computedPosition,dimensions:F.dimensions,selected:F.selected,dragging:F.dragging,style:t.normalizeStyle(F.style),class:t.normalizeClass(v.value(F)),color:h.value(F),"border-radius":$.nodeBorderRadius,"stroke-color":C.value(F),"stroke-width":$.nodeStrokeWidth,"shape-rendering":t.unref(_),type:F.type,hidden:F.hidden,onClick:B=>D(B,F),onDblclick:B=>E(B,F),onMouseenter:B=>R(B,F),onMousemove:B=>I(B,F),onMouseleave:B=>x(B,F)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),t.createElementVNode("path",{class:"vue-flow__minimap-mask",d:z.value,fill:$.maskColor,stroke:$.maskStrokeColor,"stroke-width":$.maskStrokeWidth,"fill-rule":"evenodd"},null,8,P2)],8,D2))]),_:1},8,["position","class"]))}}),U2=["d"],H2=["cx","cy","onDblclick"],j2=["x","y","onPointerdown","onDblclick"],K2=tt(t.defineComponent({inheritAttrs:!1,__name:"NoteConnectionEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,{screenToFlowCoordinate:o}=ot(),i=t.inject(dc),a=t.inject(io,null),r=t.computed(()=>!!a&&a.editable.value),l=t.inject(Oo,null),s=t.computed(()=>!!l&&l.active.value&&(!l.relatedEntityIds.value.has(n.data.targetRef)||!l.relatedNoteIds.value.has(n.data.noteRef))),c=t.computed(()=>(i==null?void 0:i.points(n.id))??[]),d=t.ref(-1),u=t.ref({x:0,y:0}),m=t.computed(()=>c.value.map((A,T)=>T===d.value?u.value:A)),{source:f,target:p,sourceSide:y,targetSide:g}=cc({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>m.value}),b=t.computed(()=>(a==null?void 0:a.routingMode.value)==="orthogonal"?rc(f.value,y.value,m.value,p.value,g.value):lc(f.value,m.value,p.value)),k=t.computed(()=>r.value?(a==null?void 0:a.routingMode.value)==="orthogonal"?Uh(f.value,y.value,m.value,p.value,g.value):Kh(f.value,m.value,p.value).map((A,T)=>({point:A,segIndex:T})):[]),_=t.computed(()=>r.value?m.value:[]);function h(A,T){d.value=A,u.value={...c.value[A]},T.target.setPointerCapture(T.pointerId),T.stopPropagation()}function C(A){if(d.value<0)return;const T=o({x:A.clientX,y:A.clientY});u.value={x:T.x,y:T.y}}function v(A){var T,O;d.value>=0&&i&&i.movePoint(n.id,d.value,{...u.value}),d.value=-1,(O=(T=A.target).releasePointerCapture)==null||O.call(T,A.pointerId)}function S(A,T){T.stopPropagation(),i==null||i.removePoint(n.id,A)}function N(A,T){if(!i)return;const O=o({x:T.clientX,y:T.clientY});i.insertPoint(n.id,A,{x:O.x,y:O.y})}return(A,T)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("path",{d:b.value,fill:"none","stroke-width":"1.5","stroke-dasharray":"6 4",class:t.normalizeClass(["em-note-edge__path",{"is-dimmed":s.value}])},null,10,U2),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.value,(O,z)=>(t.openBlock(),t.createElementBlock("circle",{key:`mid-${z}`,cx:O.point.x,cy:O.point.y,r:"4",class:t.normalizeClass(["em-note-edge__mid",{"is-dimmed":s.value}]),onDblclick:t.withModifiers(P=>N(O.segIndex,P),["stop"])},null,42,H2))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(O,z)=>(t.openBlock(),t.createElementBlock("rect",{key:`wp-${z}`,x:O.x-5,y:O.y-5,width:"10",height:"10",rx:"2",class:t.normalizeClass(["em-note-edge__waypoint",{"is-dimmed":s.value}]),onPointerdown:P=>h(z,P),onPointermove:C,onPointerup:v,onDblclick:P=>S(z,P)},null,42,j2))),128))],64))}}),[["__scopeId","data-v-8515def1"]]),G2=["d"],Y2=tt(t.defineComponent({inheritAttrs:!1,__name:"SerializedTypeEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,o=t.inject(io,null),i=t.inject(Oo,null),a=t.computed(()=>!!i&&i.active.value&&(!i.relatedEntityIds.value.has(n.data.consumerRef)||!i.relatedEntityIds.value.has(n.data.typeRef))),{source:r,target:l,sourceSide:s,targetSide:c}=cc({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>[]}),d=t.computed(()=>(o==null?void 0:o.routingMode.value)==="orthogonal"?rc(r.value,s.value,[],l.value,c.value):lc(r.value,[],l.value));return(u,m)=>(t.openBlock(),t.createElementBlock("path",{d:d.value,fill:"none","stroke-width":"1.5","stroke-dasharray":"2 5","stroke-linecap":"round",class:t.normalizeClass(["em-serialized-edge__path",{"is-dimmed":a.value}])},null,10,G2))}}),[["__scopeId","data-v-67430658"]]),q2=["data-theme"],W2={key:0,class:"em-ctx__sep",role:"separator"},J2=["aria-label"],X2={class:"em-ctx__swatches-label","aria-hidden":"true"},Z2={class:"em-ctx__chips",role:"none"},Q2=["aria-checked","aria-label","title","onClick"],eV=["aria-checked","aria-label","title","onClick"],tV=["disabled","onClick"],nV={class:"em-ctx__icon"},oV={class:"em-ctx__caption"},iV=tt(t.defineComponent({__name:"EmContextMenu",props:{locale:{}},setup(e,{expose:n}){const o=e,i=(h,C)=>cn(o.locale??"ko",h,C),a=t.ref(!1),r=t.ref([]),l=t.ref(void 0),s=t.ref(null),c=t.reactive({x:0,y:0});let d=null;const u=8;async function m(h,C){var N,A;r.value=C,l.value=(N=h.target)!=null&&N.closest('[data-theme="dark"]')?"dark":void 0,d=document.activeElement,c.x=h.clientX,c.y=h.clientY,a.value=!0,window.addEventListener("keydown",b),window.addEventListener("resize",f),await t.nextTick();const v=s.value;if(!v)return;const S=v.getBoundingClientRect();c.x+S.width>window.innerWidth-u&&(c.x=Math.max(u,window.innerWidth-u-S.width)),c.y+S.height>window.innerHeight-u&&(c.y=Math.max(u,window.innerHeight-u-S.height)),(A=p()[0])==null||A.focus()}function f(){if(!a.value)return;a.value=!1,r.value=[],window.removeEventListener("keydown",b),window.removeEventListener("resize",f);const h=d;d=null,h!=null&&h.isConnected&&h.focus()}function p(){const h=s.value;if(!h)return[];const C=[];for(const v of Array.from(h.children))if(v.classList.contains("em-ctx__item"))v.disabled||C.push(v);else if(v.classList.contains("em-ctx__swatches")){const S=Array.from(v.querySelectorAll(".em-ctx__chip"));S.length&&C.push(S.find(N=>N===document.activeElement)??S[0])}return C}function y(h){var N;const C=p();if(!C.length)return;const v=C.indexOf(document.activeElement),S=v<0?h>0?0:C.length-1:(v+h+C.length)%C.length;(N=C[S])==null||N.focus()}function g(h){var N,A;const C=(N=document.activeElement)==null?void 0:N.closest(".em-ctx__swatches");if(!C)return!1;const v=Array.from(C.querySelectorAll(".em-ctx__chip")),S=v.indexOf(document.activeElement);return S<0?!1:((A=v[(S+h+v.length)%v.length])==null||A.focus(),!0)}function b(h){var C,v;switch(h.key){case"Escape":h.stopPropagation(),f();return;case"ArrowDown":h.preventDefault(),y(1);return;case"ArrowUp":h.preventDefault(),y(-1);return;case"ArrowRight":g(1)&&h.preventDefault();return;case"ArrowLeft":g(-1)&&h.preventDefault();return;case"Home":h.preventDefault(),(C=p()[0])==null||C.focus();return;case"End":{h.preventDefault();const S=p();(v=S[S.length-1])==null||v.focus();return}case"Tab":h.preventDefault(),y(h.shiftKey?-1:1)}}function k(h){h.disabled||(h.handler(),f())}function _(h,C){h.onPick(C),f()}return t.onBeforeUnmount(f),n({open:m,close:f}),(h,C)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-ctx-layer","data-theme":l.value},[t.createElementVNode("div",{class:"em-ctx__scrim",onPointerdown:f,onContextmenu:t.withModifiers(f,["prevent"])},null,32),t.createElementVNode("div",{ref_key:"menuEl",ref:s,class:"em-ctx",style:t.normalizeStyle({left:c.x+"px",top:c.y+"px"}),role:"menu",onContextmenu:C[0]||(C[0]=t.withModifiers(()=>{},["prevent"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,(v,S)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:S},[v.type==="separator"?(t.openBlock(),t.createElementBlock("div",W2)):v.type==="swatches"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"em-ctx__swatches",role:"group","aria-label":v.caption},[t.createElementVNode("span",X2,t.toDisplayString(v.caption),1),t.createElementVNode("div",Z2,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-ctx__chip em-ctx__chip--none",{"is-on":v.current===null}]),role:"menuitemradio","aria-checked":v.current===null,"aria-label":i("em.swatch.none"),title:i("em.swatch.none"),onClick:N=>_(v,null)},null,10,Q2),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),N=>(t.openBlock(),t.createElementBlock("button",{key:N,type:"button",class:t.normalizeClass(["em-ctx__chip",{"is-on":v.current===N}]),style:t.normalizeStyle({background:t.unref(di)(N)}),role:"menuitemradio","aria-checked":v.current===N,"aria-label":i(t.unref(Bo)(N)),title:i(t.unref(Bo)(N)),onClick:A=>_(v,N)},null,14,eV))),128))])],8,J2)):(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:t.normalizeClass(["em-ctx__item",{"is-danger":v.danger,"is-disabled":v.disabled}]),disabled:v.disabled,role:"menuitem",onClick:N=>k(v)},[t.createElementVNode("span",nV,[v.icon?(t.openBlock(),t.createBlock(xe,{key:0,name:v.icon,size:15},null,8,["name"])):t.createCommentVNode("",!0)]),t.createElementVNode("span",oV,t.toDisplayString(v.caption),1)],10,tV))],64))),128))],36)],8,q2)):t.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-2f05239a"]]);function $c(e,n){return`serialized:${e}:${n}`}function Xy(e){const n=Go(e);if(n.size===0)return[];const o=new Map;for(const i of e.entities)for(const a of i.attributes){if(a.attrType!=="NORMAL")continue;const r=Ei(a,n,i,e);if(r.kind!=="resolved")continue;const l=r.entity;if(l.modelId===i.modelId)continue;const s=$c(i.modelId,l.modelId),c=o.get(s);c?c.usageCount++:o.set(s,{consumerRef:i.modelId,typeRef:l.modelId,usageCount:1})}return[...o.values()]}function Zy(e,n){return n?`${e}:${n}`:e}function Qy(e,n){var o;if(!e||typeof window>"u")return{};try{const i=(o=window.sessionStorage)==null?void 0:o.getItem(Zy(e,n));if(!i)return{};const a=JSON.parse(i);if(!a||typeof a!="object"||Array.isArray(a))return{};const r={};for(const[l,s]of Object.entries(a))typeof s=="boolean"&&(r[l]=s);return r}catch{return{}}}function aV(e,n,o){var i,a;if(!(!e||typeof window>"u"))try{const r=Zy(e,n);Object.keys(o).length?(a=window.sessionStorage)==null||a.setItem(r,JSON.stringify(o)):(i=window.sessionStorage)==null||i.removeItem(r)}catch{}}function eg(e){const n=()=>{var s;return(s=e.scope)==null?void 0:s.call(e)},o=t.ref(Qy(e.storageKey,n()));e.scope&&t.watch(()=>e.scope(),s=>o.value=Qy(e.storageKey,s)),t.watch(o,s=>aV(e.storageKey,n(),s),{deep:!0});const i=s=>o.value[s]??e.defaultCollapsed(s);function a(s){o.value={...o.value,[s]:!i(s)}}const r=t.computed(()=>!e.expandableKeys().some(s=>i(s)));function l(){const s=r.value,c={...o.value};for(const d of e.expandableKeys())c[d]=s;o.value=c}return{isCollapsed:i,toggle:a,toggleAll:l,allExpanded:r}}const Tc=[".em-entity__grip",".em-entity__add",".em-entity__footer",".em-sel",".em-handle",".em-note-handle",".vue-flow__handle",".em-group__resize",".em-note__resize",".em-edge__waypoint",".em-edge__mid",".em-note-edge__waypoint",".em-note-edge__mid"].join(",");function hi(e){const n=getComputedStyle(e);return!(n.display==="none"||n.visibility==="hidden"||parseFloat(n.opacity)===0)}function rV(e){return e.childElementCount>0?!1:(e.textContent??"").trim().length>0}function lV(e,n){const o=getComputedStyle(e),i={fill:o.color,fontSize:parseFloat(o.fontSize),fontFamily:o.fontFamily,fontWeight:o.fontWeight,fontStyle:o.fontStyle},a=document.createRange();a.selectNodeContents(e);const r=e.firstChild,l=a.getClientRects();if(!r||r.nodeType!==3||l.length<=1){const y=l.length?a.getBoundingClientRect():e.getBoundingClientRect();if(y.width===0&&y.height===0)return[];const g=n(y.left,y.top+y.height/2);return[{...i,x:g.x,y:g.y,text:(e.textContent??"").trim()}]}const s=r.textContent??"",c=[];let d="",u=null,m=0,f=0;const p=()=>{const y=d.trim();if(y){const g=n(m,(u+f)/2);c.push({...i,x:g.x,y:g.y,text:y})}d=""};for(let y=0;y<s.length;y++){a.setStart(r,y),a.setEnd(r,y+1);const g=a.getBoundingClientRect();u===null||Math.abs(g.top-u)>1?(p(),u=g.top,m=g.left,f=g.bottom,d=s[y]):(d+=s[y],f=Math.max(f,g.bottom))}return p(),c}function ol(e,n){const o=[];for(const i of e.querySelectorAll("*"))rV(i)&&(i.closest(Tc)||hi(i)&&o.push(...lV(i,n)));return o}function ma(e){return Math.round(e*100)/100}function sV(e,n){const o=[];for(const i of e.querySelectorAll("svg.em-icon")){if(i.closest(Tc)||!hi(i))continue;const a=i.getBoundingClientRect();if(a.width===0||a.height===0)continue;const r=n(a.left,a.top),l=n(a.right,a.bottom),s=getComputedStyle(i),c=i.getAttribute("viewBox")??"0 0 24 24",d=parseFloat(s.strokeWidth)||1.75;o.push(`<svg x="${ma(r.x)}" y="${ma(r.y)}" width="${ma(l.x-r.x)}" height="${ma(l.y-r.y)}" viewBox="${c}" fill="none" stroke="${s.color}" stroke-width="${d}" stroke-linecap="round" stroke-linejoin="round">${i.innerHTML}</svg>`)}return o}function cV(e){const n=[];for(const o of e.querySelectorAll(".em-edge__marker")){if(!hi(o))continue;const i=getComputedStyle(o),a=i.stroke,r=parseFloat(i.strokeWidth)||1.5,l=i.fill&&i.fill!=="none"?i.fill:"none",s=o.tagName.toLowerCase(),c=d=>ma(parseFloat(o.getAttribute(d)??"0"));s==="line"?n.push(`<line x1="${c("x1")}" y1="${c("y1")}" x2="${c("x2")}" y2="${c("y2")}" stroke="${a}" stroke-width="${r}" stroke-linecap="round" />`):s==="circle"?n.push(`<circle cx="${c("cx")}" cy="${c("cy")}" r="${c("r")}" fill="none" stroke="${a}" stroke-width="${r}" />`):s==="path"&&n.push(`<path d="${o.getAttribute("d")}" fill="${l}" stroke="${a}" stroke-width="${r}" stroke-linejoin="round" />`)}return n}function tg(e,n,o){const i=[];for(const a of e.querySelectorAll("*")){if(a===n||a.closest(Tc)||!hi(a))continue;const r=getComputedStyle(a),l=parseFloat(r.borderTopWidth);if(!l)continue;const s=a.getBoundingClientRect();if(s.width===0)continue;const c=o(s.left,s.top),d=o(s.right,s.top);i.push({x1:c.x,x2:d.x,y:c.y,stroke:r.borderTopColor,strokeWidth:l})}return i}function fa(e,n){const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=n(o.left,o.top),r=n(o.right,o.bottom),l=i.borderTopStyle==="dashed",s={tl:parseFloat(i.borderTopLeftRadius)||0,tr:parseFloat(i.borderTopRightRadius)||0,br:parseFloat(i.borderBottomRightRadius)||0,bl:parseFloat(i.borderBottomLeftRadius)||0};return{x:a.x,y:a.y,w:r.x-a.x,h:r.y-a.y,fill:i.backgroundColor,stroke:i.borderTopColor,strokeWidth:parseFloat(i.borderTopWidth)||void 0,strokeDasharray:l?"6 4":void 0,radius:s}}function Mc(e,n){e.minX=Math.min(e.minX,n.x),e.minY=Math.min(e.minY,n.y),e.maxX=Math.max(e.maxX,n.x+n.w),e.maxY=Math.max(e.maxY,n.y+n.h)}function dV(e){const n=e.vueFlowRef.value;if(!n)throw new Error("캔버스가 렌더되지 않아 SVG로 내보낼 수 없습니다.");const o=(p,y)=>e.screenToFlowCoordinate({x:p,y}),i=[],a=[],r=[],l=[],s={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(const p of e.nodes.value){const y=n.querySelector(`.vue-flow__node[data-id="${CSS.escape(p.id)}"]`);if(!y||!hi(y))continue;const g=y.firstElementChild;if(g)if(p.type==="group"){const b=fa(g,o);Mc(s,b),i.push({...b,texts:[]});const k=g.querySelector(".em-group__label");k&&i.push({...fa(k,o),stroke:"none",texts:[]}),i.push({...b,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:ol(g,o)})}else if(p.type==="note"){const b={...fa(g,o),texts:ol(g,o),lines:tg(g,g,o)};Mc(s,b),r.push(b)}else{const b=fa(g,o);Mc(s,b);const k=b.radius??{tl:0,tr:0};a.push({...b,stroke:"none",texts:[]});const _=g.querySelector(".em-entity__header");if(_){const h=fa(_,o);a.push({x:b.x,y:b.y,w:b.w,h:h.y+h.h-b.y,fill:h.fill,stroke:"none",radius:{tl:k.tl,tr:k.tr,br:0,bl:0},texts:[]})}a.push({...b,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:ol(g,o),lines:tg(g,g,o),icons:sV(g,o)}),a.push({...b,fill:"none",texts:[]})}}for(const p of n.querySelectorAll(".vue-flow__edge")){const y=p.querySelector("path.em-edge__path, path.em-note-edge__path");if(!y||!hi(y))continue;const g=y.getAttribute("d");if(!g)continue;const b=getComputedStyle(y),k=b.strokeDasharray,_=cV(p);l.push({d:g,stroke:b.stroke,strokeWidth:parseFloat(b.strokeWidth)||1.5,strokeDasharray:k&&k!=="none"?k:void 0,labels:ol(p,o),markers:_.length?_:void 0})}const c=n.closest(".em-canvas")??n,d=getComputedStyle(c).backgroundColor,u=24;return{viewBox:Number.isFinite(s.minX)?{x:s.minX-u,y:s.minY-u,w:s.maxX-s.minX+u*2,h:s.maxY-s.minY+u*2}:{x:0,y:0,w:100,h:100},background:d,groups:i,edges:l,entities:a,notes:r}}function Vc(e){return jd(dV(e))}function ng(e,n){const o=URL.createObjectURL(e);try{const i=document.createElement("a");i.href=o,i.download=n,document.body.appendChild(i),i.click(),i.remove()}finally{URL.revokeObjectURL(o)}}function og(e,n="diagram.svg"){const o=Vc(e);ng(new Blob([o],{type:"image/svg+xml;charset=utf-8"}),n)}function uV(e){var i,a;const n=Number((i=e.match(/width="([\d.]+)"/))==null?void 0:i[1]),o=Number((a=e.match(/height="([\d.]+)"/))==null?void 0:a[1]);return{w:n>0?n:1,h:o>0?o:1}}async function ig(e,n="diagram.png",o=2){const i=Vc(e),{w:a,h:r}=uV(i),l=URL.createObjectURL(new Blob([i],{type:"image/svg+xml;charset=utf-8"}));try{const s=new Image;s.width=a,s.height=r,await new Promise((m,f)=>{s.onload=()=>m(),s.onerror=()=>f(new Error("SVG 이미지 로드 실패")),s.src=l});const c=document.createElement("canvas");c.width=Math.max(1,Math.round(a*o)),c.height=Math.max(1,Math.round(r*o));const d=c.getContext("2d");if(!d)throw new Error("2D 캔버스 컨텍스트를 얻을 수 없습니다");d.scale(o,o),d.drawImage(s,0,0,a,r);const u=await new Promise(m=>c.toBlob(m,"image/png"));if(!u)throw new Error("PNG 변환 실패");ng(u,n)}finally{URL.revokeObjectURL(l)}}const mV={class:"em-shortcuts"},fV={class:"em-shortcuts__list"},pV={class:"em-shortcuts__title"},hV={class:"em-shortcuts__keys"},yV={class:"em-shortcuts__kbd"},gV={key:0,class:"em-shortcuts__plus"},bV={class:"em-shortcuts__desc"},kV={class:"em-shortcuts__actions"},ag=tt(t.defineComponent({__name:"ShortcutHelpModal",props:{locale:{}},setup(e){const n=e,o=ne.useModalHandle(),i=(s,c)=>cn(n.locale??"ko",s,c),r=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?"⌘":"Ctrl",l=t.computed(()=>[{title:i("em.shortcuts.groupEdit"),items:[{keys:[r,"Z"],desc:i("em.shortcuts.descUndo")},{keys:[r,"Shift","Z"],desc:i("em.shortcuts.descRedo")},{keys:[r,"C"],desc:i("em.shortcuts.descCopy")},{keys:[r,"V"],desc:i("em.shortcuts.descPaste")},{keys:["Delete"],desc:i("em.shortcuts.descDelete")}]},{title:i("em.shortcuts.groupMove"),items:[{keys:["←","↑","→","↓"],desc:i("em.shortcuts.descMove1")},{keys:["Shift",i("em.shortcuts.keyArrows")],desc:i("em.shortcuts.descMove10")},{keys:["↑","↓"],desc:i("em.shortcuts.descAttrFocus")},{keys:["Alt","↑","↓"],desc:i("em.shortcuts.descAttrReorder")}]},{title:i("em.shortcuts.groupExplorer"),items:[{keys:["/"],desc:i("em.shortcuts.descExplorerSearch")},{keys:[i("em.shortcuts.keyArrows")],desc:i("em.shortcuts.descExplorerNav")},{keys:["Enter"],desc:i("em.shortcuts.descExplorerSelect")},{keys:["F2"],desc:i("em.shortcuts.descExplorerDetail")}]},{title:i("em.shortcuts.groupOther"),items:[{keys:[r,"K"],desc:i("em.shortcuts.descCommandPalette")},{keys:[i("em.shortcuts.keyRightClick")],desc:i("em.shortcuts.descContextMenu")},{keys:["Enter"],desc:i("em.shortcuts.descInlineConfirm")},{keys:["Esc"],desc:i("em.shortcuts.descCloseEdit")},{keys:["?"],desc:i("em.shortcuts.descOpenHelp")}]}]);return(s,c)=>(t.openBlock(),t.createBlock(t.unref(ne.BSModalFrame),{title:i("em.shortcuts.title")},{default:t.withCtx(()=>[t.createElementVNode("div",mV,[t.createElementVNode("div",fV,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,d=>(t.openBlock(),t.createElementBlock("section",{key:d.title,class:"em-shortcuts__group"},[t.createElementVNode("h4",pV,t.toDisplayString(d.title),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.items,u=>(t.openBlock(),t.createElementBlock("div",{key:u.desc,class:"em-shortcuts__row"},[t.createElementVNode("span",hV,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.keys,(m,f)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m+f},[t.createElementVNode("kbd",yV,t.toDisplayString(m),1),f<u.keys.length-1?(t.openBlock(),t.createElementBlock("span",gV,"+")):t.createCommentVNode("",!0)],64))),128))]),t.createElementVNode("span",bV,t.toDisplayString(u.desc),1)]))),128))]))),128))]),t.createElementVNode("div",kV,[t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:i("em.common.close"),onClick:c[0]||(c[0]=d=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-38f2450f"]]);function yi(...e){return e.filter(o=>!!o).join(" ").toLowerCase().trim()||void 0}function _V(e,n){const o=new Set,i=a=>{const r=!!a.matchText&&a.matchText.includes(n);let l=!1;for(const c of a.children)i(c)&&(l=!0);const s=r||l;return s&&o.add(a.key),s};return i(e),o}const EV=["aria-label"],NV=["aria-activedescendant","aria-label","placeholder"],wV={id:"em-cmdk-listbox",class:"em-cmdk__results",role:"listbox"},IV=["aria-label"],vV={class:"em-cmdk__section","aria-hidden":"true"},CV=["id","aria-selected","onMouseenter","onClick"],SV={class:"em-cmdk__label"},RV={key:0,class:"em-cmdk__tag"},AV={key:1,class:"em-cmdk__sub"},xV=["aria-label"],$V={class:"em-cmdk__section","aria-hidden":"true"},TV=["id","aria-selected","aria-disabled","onMouseenter","onClick"],MV={class:"em-cmdk__label"},VV={key:1,class:"em-cmdk__empty"},LV=tt(t.defineComponent({__name:"CommandPalette",props:{controller:{}},emits:["close"],setup(e,{emit:n}){const o=e,i=n,a=o.controller,r=t.ref(""),l=t.ref(0),s=t.ref(null),c=t.computed(()=>a.userLanguage.value),d=t.computed(()=>{const v=c.value,S=a.state.logical.entities.map(A=>{var T,O,z,P;return{type:"goto",kind:"entity",id:A.modelId,label:((T=Sn(A))==null?void 0:T[v])||A.name,sub:(O=A.table)==null?void 0:O.physicalName,match:yi(A.name,(z=Sn(A))==null?void 0:z[v],(P=A.table)==null?void 0:P.physicalName)??""}}),N=a.state.logical.groups.map(A=>{var T,O;return{type:"goto",kind:"group",id:A.modelId,label:Ct(A.name,v)||A.packageName||a.t("em.cmd.groupTag"),tag:a.t("em.cmd.groupTag"),match:yi((T=A.name)==null?void 0:T[v],(O=A.name)==null?void 0:O.ko,A.packageName)??""}});return[...S,...N]}),u={LOGICAL:"em.displayMode.logical",PHYSICAL:"em.displayMode.physical",LOGICAL_PHYSICAL:"em.displayMode.logicalPhysical",CLASS:"em.displayMode.class"},m=t.computed(()=>{const v=[];a.editable.value&&(v.push({type:"action",id:"undo",label:a.t("em.toolbar.undo"),run:()=>a.undo(),disabled:!a.canUndo.value}),v.push({type:"action",id:"redo",label:a.t("em.toolbar.redo"),run:()=>a.redo(),disabled:!a.canRedo.value}),v.push({type:"action",id:"autolayout",label:a.t("em.palette.autoLayout"),run:()=>a.autoLayout()}),v.push({type:"action",id:"collapseAll",label:a.t("em.panel.collapseAll"),run:()=>a.collapseAll()}),v.push({type:"action",id:"expandAll",label:a.t("em.panel.expandAll"),run:()=>a.expandAll()})),v.push({type:"action",id:"grid",label:a.t("em.toolbar.grid"),run:()=>a.showGrid.value=!a.showGrid.value}),v.push({type:"action",id:"minimap",label:a.t("em.toolbar.minimap"),run:()=>a.showMinimap.value=!a.showMinimap.value}),v.push({type:"action",id:"routing",label:a.t("em.toolbar.routingToggle"),run:()=>a.routingMode.value=a.routingMode.value==="straight"?"orthogonal":"straight"});for(const S of["LOGICAL","PHYSICAL","LOGICAL_PHYSICAL","CLASS"])v.push({type:"action",id:`dm-${S}`,label:a.t(u[S]),run:()=>a.displayMode.value=S});return v});function f(v,S){return v.label.toLowerCase().includes(S)}const p=t.computed(()=>{const v=r.value.trim().toLowerCase();return v?d.value.filter(S=>S.match.includes(v)):d.value}),y=t.computed(()=>{const v=r.value.trim().toLowerCase();return v?m.value.filter(S=>f(S,v)):m.value}),g=t.computed(()=>[...p.value,...y.value]);t.watch([p,y],()=>{l.value=0});function b(v){return g.value.indexOf(v)}const k=v=>`em-cmdk-opt-${v}`,_=t.computed(()=>g.value[l.value]?k(l.value):void 0);t.watch(l,async()=>{var S;await t.nextTick();const v=_.value;v&&((S=document.getElementById(v))==null||S.scrollIntoView({block:"nearest"}))});function h(v){if(v.type==="goto")a.selection.value={kind:v.kind,id:v.id},a.requestFocus(v.id);else{if(v.disabled)return;v.run()}i("close")}function C(v){if(v.key==="Escape"){i("close"),v.preventDefault();return}if(v.key==="ArrowDown"){l.value=Math.min(l.value+1,g.value.length-1),v.preventDefault();return}if(v.key==="ArrowUp"){l.value=Math.max(l.value-1,0),v.preventDefault();return}if(v.key==="Enter"){const S=g.value[l.value];S&&h(S),v.preventDefault();return}v.key==="Tab"&&v.preventDefault()}return t.nextTick(()=>{var v;return(v=s.value)==null?void 0:v.focus()}),(v,S)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createElementVNode("div",{class:"em-cmdk__backdrop",onPointerdown:S[1]||(S[1]=t.withModifiers(N=>i("close"),["self"]))},[t.createElementVNode("div",{class:"em-cmdk",role:"dialog","aria-modal":"true","aria-label":t.unref(a).t("em.cmd.title")},[t.withDirectives(t.createElementVNode("input",{ref_key:"inputEl",ref:s,"onUpdate:modelValue":S[0]||(S[0]=N=>r.value=N),class:"em-cmdk__input",type:"text",role:"combobox","aria-expanded":"true","aria-autocomplete":"list",autocomplete:"off","aria-controls":"em-cmdk-listbox","aria-activedescendant":_.value,"aria-label":t.unref(a).t("em.cmd.placeholder"),placeholder:t.unref(a).t("em.cmd.placeholder"),onKeydown:C},null,40,NV),[[t.vModelText,r.value]]),t.createElementVNode("div",wV,[g.value.length?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[p.value.length?(t.openBlock(),t.createElementBlock("div",{key:0,role:"group","aria-label":t.unref(a).t("em.cmd.sectionGoto")},[t.createElementVNode("div",vV,t.toDisplayString(t.unref(a).t("em.cmd.sectionGoto")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,N=>(t.openBlock(),t.createElementBlock("button",{id:k(b(N)),key:N.id,type:"button",tabindex:"-1",class:t.normalizeClass(["em-cmdk__item",{"is-active":b(N)===l.value}]),role:"option","aria-selected":b(N)===l.value,onMouseenter:A=>l.value=b(N),onClick:A=>h(N)},[t.createElementVNode("span",SV,t.toDisplayString(N.label),1),N.tag?(t.openBlock(),t.createElementBlock("span",RV,t.toDisplayString(N.tag),1)):N.sub?(t.openBlock(),t.createElementBlock("span",AV,t.toDisplayString(N.sub),1)):t.createCommentVNode("",!0)],42,CV))),128))],8,IV)):t.createCommentVNode("",!0),y.value.length?(t.openBlock(),t.createElementBlock("div",{key:1,role:"group","aria-label":t.unref(a).t("em.cmd.sectionActions")},[t.createElementVNode("div",$V,t.toDisplayString(t.unref(a).t("em.cmd.sectionActions")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value,N=>(t.openBlock(),t.createElementBlock("button",{id:k(b(N)),key:N.id,type:"button",tabindex:"-1",class:t.normalizeClass(["em-cmdk__item",{"is-active":b(N)===l.value,"is-disabled":N.disabled}]),role:"option","aria-selected":b(N)===l.value,"aria-disabled":N.disabled||void 0,onMouseenter:A=>l.value=b(N),onClick:A=>h(N)},[t.createElementVNode("span",MV,t.toDisplayString(N.label),1)],42,TV))),128))],8,xV)):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock("div",VV,t.toDisplayString(t.unref(a).t("em.cmd.empty")),1))])],8,EV)],32)]))}}),[["__scopeId","data-v-92971c73"]]);function BV(e){return e?e.kind==="missing"?{titleKey:"em.conflict.lockedTitle",detailKey:"em.conflict.missingDetail"}:{titleKey:"em.conflict.lockedTitle",detailKey:"em.conflict.changedDetail"}:null}const DV={key:0,class:"em-canvas__empty","aria-hidden":"true"},OV={class:"em-canvas__empty-title"},PV=["innerHTML"],zV=["innerHTML"],FV=["innerHTML"],UV={key:1,class:"em-canvas__empty-title"},HV={key:0,class:"em-conflict-banner",role:"alert","aria-live":"assertive"},jV={class:"em-conflict-banner__body"},KV={class:"em-conflict-banner__title"},GV={class:"em-conflict-banner__detail"},YV={key:0,class:"em-toast",role:"status","aria-live":"polite"},Lc="nc:",rg=tt(t.defineComponent({__name:"DiagramCanvas",props:{controller:{},diffMarks:{},embedCollapseStorageKey:{}},setup(e,{expose:n}){const o=e,i=o.controller,a=ne.useModal(),r=t.ref(!1),l=t.ref(null);let s;function c(w){l.value=w,s&&clearTimeout(s),s=setTimeout(()=>l.value=null,3200)}t.watch(()=>i.notice.value,w=>{w&&c(w.text)}),t.onBeforeUnmount(()=>s&&clearTimeout(s));const d=t.computed(()=>{if(i.commandFailure.value)return{title:i.t("em.conflict.lockedTitle"),detail:i.t("em.conflict.commandFailedDetail")};const w=BV(i.opConflict.value);return w?{title:i.t(w.titleKey),detail:i.t(w.detailKey)}:null}),u=t.ref(!1),m=t.ref(!1),f={x:0,y:0};function p(w){f.x=w.clientX,f.y=w.clientY}const y=t.ref(null);t.provide(Br,y);const g=t.ref(null);t.provide(Ch,g);const b=t.ref(null),k=t.computed(()=>{const w=b.value,H=new Set;if(!w)return H;if(w.kind==="entity")H.add(w.id);else if(w.kind==="group"){const se=i.resolved.value.groups.find(_e=>_e.group.modelId===w.id);for(const _e of(se==null?void 0:se.group.memberEntityRefs)??[])H.add(_e)}return H}),_=t.computed(()=>{const w=b.value,H=new Set(k.value),se=new Set,_e=new Set;if(!w)return{related:H,edges:se,notes:_e};if(w.kind==="note"){_e.add(w.id);for(const Oe of i.resolved.value.noteConnections)Oe.noteRef===w.id&&H.add(Oe.targetRef);return{related:H,edges:se,notes:_e}}const $e=k.value;if(!$e.size)return{related:H,edges:se,notes:_e};for(const Oe of i.resolved.value.associations){const{end1:He,end2:Ke}=Oe.association;($e.has(He.entityRef)||$e.has(Ke.entityRef))&&(se.add(Oe.association.modelId),H.add(He.entityRef),H.add(Ke.entityRef))}for(const Oe of i.resolved.value.noteConnections)H.has(Oe.targetRef)&&_e.add(Oe.noteRef);return{related:H,edges:se,notes:_e}});t.provide(Oo,{source:b,active:t.computed(()=>b.value!==null),primaryEntityIds:k,relatedEntityIds:t.computed(()=>_.value.related),relatedEdgeIds:t.computed(()=>_.value.edges),relatedNoteIds:t.computed(()=>_.value.notes),hoverGroupId:t.computed(()=>{var w;return((w=b.value)==null?void 0:w.kind)==="group"?b.value.id:null}),setEntityHover:w=>{g.value||m.value||(b.value=w?{kind:"entity",id:w}:null)},setGroupHover:w=>{g.value||m.value||(b.value=w?{kind:"group",id:w}:null)},setNoteHover:w=>{g.value||m.value||(b.value=w?{kind:"note",id:w}:null)}}),t.provide(io,i);const h=EA(),C=t.computed(()=>h(i.state.logical,i.embeddableCatalog.value));t.provide(Ah,C);const v=eg({expandableKeys:()=>[],defaultCollapsed:vA,storageKey:o.embedCollapseStorageKey,scope:()=>i.state.layout.diagramId});t.provide(Th,{isCollapsed:v.isCollapsed,toggle:v.toggle}),t.provide(Sh,{marks:t.toRef(o,"diffMarks")});function S(w,H){return`${Lc}${w}:${H}`}function N(w){if(!w.startsWith(Lc))return null;const[H,se]=w.slice(Lc.length).split(":");return H&&se?{noteRef:H,targetRef:se}:null}t.provide(dc,{points:w=>{var se,_e;const H=N(w);return H?((se=i.resolved.value.noteConnections.find($e=>$e.noteRef===H.noteRef&&$e.targetRef===H.targetRef))==null?void 0:se.waypoints)??[]:((_e=i.resolved.value.associations.find($e=>$e.association.modelId===w))==null?void 0:_e.waypoints)??[]},movePoint:(w,H,se)=>{const _e=N(w);_e?i.moveNoteConnectionWaypoint(_e.noteRef,_e.targetRef,H,se):i.moveWaypoint(w,H,se)},insertPoint:(w,H,se)=>{const _e=N(w);_e?i.addNoteConnectionWaypoint(_e.noteRef,_e.targetRef,H,se):i.addWaypoint(w,H,se)},removePoint:(w,H)=>{const se=N(w);se?i.removeNoteConnectionWaypoint(se.noteRef,se.targetRef,H):i.removeWaypoint(w,H)}});const A=ot(),{nodes:T,edges:O,findNode:z,findEdge:P,addNodes:D,addEdges:E,removeNodes:R,removeEdges:I,fitView:x,setCenter:$,getViewport:U,screenToFlowCoordinate:F,getSelectedNodes:B,updateNodeInternals:j}=A,X=t.ref(!1);async function W(w){X.value=!0,await t.nextTick(),await new Promise(H=>requestAnimationFrame(()=>H(null)));try{return await w()}finally{X.value=!1}}async function oe(){try{await W(()=>og(A))}catch(w){console.error("[entity-modeler] SVG export failed",w),c(i.t("em.canvas.exportFailed"))}}async function de(){try{await W(()=>ig(A))}catch(w){console.error("[entity-modeler] PNG export failed",w),c(i.t("em.canvas.exportFailed"))}}n({exportSvg:oe,exportPng:de,fitView:x});const ie=t.computed(()=>i.resolved.value.entities.length===0);function Ie(){const w=U(),{width:H,height:se}=A.dimensions.value;return{x:(H/2-w.x)/w.zoom,y:(se/2-w.y)/w.zoom}}function Le(){return T.value.map(w=>w.computedPosition??w.position)}function Se(){i.addEntity("NewEntity",Fc(Ie(),Le()))}function ce(){i.addNote("메모",Fc(Ie(),Le()))}function pe(w){for(const H of i.resolved.value.groups){const{location:se,size:_e}=H.geo;if(w.x>=se.x&&w.x<=se.x+_e.width&&w.y>=se.y&&w.y<=se.y+_e.height)return H.group.modelId}return null}function he(w,H){return w.x===H.x&&w.y===H.y}function V(w,H){return(w==null?void 0:w.width)===(H==null?void 0:H.width)&&(w==null?void 0:w.height)===(H==null?void 0:H.height)}function L(w,H){return w.entity===H.entity&&w.displayMode===H.displayMode&&w.collapsed===H.collapsed&&w.locked===H.locked&&w.groupRef===H.groupRef&&V(w.size,H.size)&&w.style===H.style&&w.attributeStyles===H.attributeStyles&&w.operationStyles===H.operationStyles}function K(w,H){const se=Object.keys(w);if(se.length!==Object.keys(H).length)return!1;for(const _e of se)if(_e==="geo"){const $e=w.geo,Oe=H.geo;if(!he($e.location,Oe.location)||!V($e.size,Oe.size))return!1}else if(w[_e]!==H[_e])return!1;return!0}function Z(){const w=i.resolved.value,H=new Map(w.groups.map(we=>[we.group.modelId,we.geo])),se=new Set(w.groups.map(we=>we.group.modelId)),_e=new Set([...se,...w.entities.map(we=>we.entity.modelId),...w.notes.map(we=>we.note.modelId)]);for(const we of[...T.value])_e.has(we.id)||R([we.id]);for(const we of w.groups){const Je=we.group.modelId,Xe={width:`${we.geo.size.width}px`,height:`${we.geo.size.height}px`},M={group:we.group,style:we.style,locked:we.locked},q=we.locked?!1:void 0,Ce=z(Je);if(Ce){he(Ce.position,we.geo.location)||(Ce.position={...we.geo.location});const Be=Ce.data;(Be.group!==M.group||Be.style!==M.style||Be.locked!==M.locked)&&(Ce.data=M);const ue=Ce.style;((ue==null?void 0:ue.width)!==Xe.width||(ue==null?void 0:ue.height)!==Xe.height)&&(Ce.style=Xe),Ce.draggable!==q&&(Ce.draggable=q)}else D([{id:Je,type:"group",position:{...we.geo.location},draggable:q,style:Xe,data:M}])}for(const we of w.entities){const Je=we.entity.modelId,Xe=we.groupRef&&se.has(we.groupRef)?we.groupRef:void 0,M={entity:we.entity,displayMode:i.displayMode.value,collapsed:we.collapsed,locked:we.locked,groupRef:Xe,size:we.geo.size,style:we.style,attributeStyles:we.attributeStyles,operationStyles:we.operationStyles},q=we.locked?!1:void 0,Ce=we.locked?!1:void 0,Be=Xe?H.get(Xe):void 0,ue=Be?{x:we.geo.location.x-Be.location.x,y:we.geo.location.y-Be.location.y}:{...we.geo.location},Ae=z(Je);Ae?(he(Ae.position,ue)||(Ae.position=ue),L(Ae.data,M)||(Ae.data=M),Ae.parentNode!==Xe&&(Ae.parentNode=Xe),Ae.draggable!==q&&(Ae.draggable=q),Ae.connectable!==Ce&&(Ae.connectable=Ce)):D([{id:Je,type:"entity",position:ue,parentNode:Xe,draggable:q,connectable:Ce,data:M}])}for(const we of w.notes){const Je=we.note,Xe=Je.modelId,M=we.groupRef&&se.has(we.groupRef)?we.groupRef:void 0,q={note:Je,groupRef:M},Ce={width:`${Je.geo.size.width}px`,height:`${Je.geo.size.height}px`},Be=M?H.get(M):void 0,ue=Be?{x:Je.geo.location.x-Be.location.x,y:Je.geo.location.y-Be.location.y}:{...Je.geo.location},Ae=z(Xe);if(Ae){he(Ae.position,ue)||(Ae.position=ue);const it=Ae.data;(it.groupRef!==M||!K(it.note,Je))&&(Ae.data=q);const We=Ae.style;((We==null?void 0:We.width)!==Ce.width||(We==null?void 0:We.height)!==Ce.height)&&(Ae.style=Ce),Ae.parentNode!==M&&(Ae.parentNode=M)}else D([{id:Xe,type:"note",position:ue,parentNode:M,style:Ce,data:q}])}const $e=new Map(w.associations.map(we=>[we.association.modelId,we])),Oe=new Set(w.noteConnections.map(we=>S(we.noteRef,we.targetRef))),He=Xy(i.state.logical).filter(we=>z(we.consumerRef)&&z(we.typeRef)),Ke=new Set(He.map(we=>$c(we.consumerRef,we.typeRef)));for(const we of[...O.value])!$e.has(we.id)&&!Oe.has(we.id)&&!Ke.has(we.id)&&I([we.id]);for(const[we,Je]of $e){const Xe={id:we,type:"association",source:Je.association.end1.entityRef,target:Je.association.end2.entityRef,sourceHandle:Je.sourceColumnRef?`r:${Je.sourceColumnRef}`:void 0,targetHandle:Je.targetColumnRef?`l:${Je.targetColumnRef}`:void 0,data:{association:Je.association,sourceColumnRef:Je.sourceColumnRef,targetColumnRef:Je.targetColumnRef}},M=P(we);if(M){const q=M.data;(q.association!==Xe.data.association||q.sourceColumnRef!==Xe.data.sourceColumnRef||q.targetColumnRef!==Xe.data.targetColumnRef)&&(M.data=Xe.data),M.sourceHandle!==Xe.sourceHandle&&(M.sourceHandle=Xe.sourceHandle),M.targetHandle!==Xe.targetHandle&&(M.targetHandle=Xe.targetHandle)}else E([Xe])}for(const we of w.noteConnections){const Je=S(we.noteRef,we.targetRef),Xe={noteRef:we.noteRef,targetRef:we.targetRef};P(Je)||E([{id:Je,type:"note-connection",source:we.noteRef,target:we.targetRef,data:Xe}])}for(const we of He){const Je=$c(we.consumerRef,we.typeRef),Xe={consumerRef:we.consumerRef,typeRef:we.typeRef,usageCount:we.usageCount},M=P(Je);M?M.data.usageCount!==Xe.usageCount&&(M.data=Xe):E([{id:Je,type:"serialized-type",source:we.consumerRef,target:we.typeRef,data:Xe}])}}const Q=new Set;let fe=!1,be=!1;const Ee=new Map;function Ne(w){const H=document.querySelector(`.vue-flow__node[data-id="${CSS.escape(w)}"]`);if(!H)return null;let se=`${H.offsetHeight}`;for(const _e of H.querySelectorAll(".em-entity__row"))se+=`|${_e.dataset.attr}:${_e.offsetTop}`;return se}function J(){be=!1;const w=fe;fe=!1;const H=[...Q];if(Q.clear(),w){j();for(const _e of T.value){const $e=Ne(_e.id);$e!==null&&Ee.set(_e.id,$e)}return}const se=[];for(const _e of H){const $e=Ne(_e);if($e===null){Ee.delete(_e);continue}Ee.get(_e)!==$e&&(Ee.set(_e,$e),se.push(_e))}se.length&&j(se)}function ee(w){if(w)for(const H of w)Q.add(H);else fe=!0;be||(be=!0,t.nextTick(()=>requestAnimationFrame(J)))}t.provide(Rh,{mark:w=>ee([w])});function te(){const w=B.value.map(se=>se.id);if(w.length)return w;const H=i.selection.value;return H&&(H.kind==="entity"||H.kind==="note"||H.kind==="group")?[H.id]:[]}function ge(){return B.value.filter(w=>w.type==="entity").map(w=>w.id)}function Re(){return B.value.filter(w=>w.type==="group").map(w=>w.id)}function Pe(w){var H;return[...((H=i.state.logical.groups.find(se=>se.modelId===w))==null?void 0:H.memberEntityRefs)??[]]}function Me(){const w=Re().flatMap(Pe);return[...new Set([...ge(),...w])]}function Qe(){return Re().length>0||ge().length>1}function Ot(){Qe()?i.copy(Me()):i.copy()}async function ht(w){if(!w.length)return;await t.nextTick();const H=B.value;H.length&&A.removeSelectedNodes(H);const se=w.map(_e=>z(_e)).filter(_e=>!!_e);se.length&&A.addSelectedNodes(se)}function re(w){if(Qe()&&ge().includes(w)){const H=Me();return{caption:i.t("em.ctx.copyN",{n:H.length}),icon:"copy",handler:()=>i.copy(H)}}return{caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:w},i.copy()}}}function ve(w){var $e;const H=w.target;if(H&&(H.tagName==="INPUT"||H.tagName==="TEXTAREA"||H.isContentEditable))return;if(w.key==="?"){a.openModal({component:ag,bind:{locale:i.uiLocale.value}}),w.preventDefault();return}if((w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="k"){r.value=!0,w.preventDefault();return}if(!i.editable.value){(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="c"&&(Ot(),w.preventDefault());return}if(w.key==="Delete"||w.key==="Backspace"){i.deleteSelection()&&w.preventDefault();return}if(w.key==="ArrowUp"||w.key==="ArrowDown"||w.key==="ArrowLeft"||w.key==="ArrowRight"){if((($e=i.selection.value)==null?void 0:$e.kind)==="attribute"){if(w.key==="ArrowUp"||w.key==="ArrowDown"){const we=w.key==="ArrowDown"?1:-1;(w.altKey?i.nudgeSelectedAttributes(we):i.moveAttributeFocus(we))&&w.preventDefault()}return}const Oe=w.shiftKey?10:1,He=w.key==="ArrowLeft"?-Oe:w.key==="ArrowRight"?Oe:0,Ke=w.key==="ArrowUp"?-Oe:w.key==="ArrowDown"?Oe:0;i.nudgeNodes(te(),He,Ke)&&w.preventDefault();return}if(!(w.metaKey||w.ctrlKey))return;const _e=w.key.toLowerCase();_e==="c"?(Ot(),w.preventDefault()):_e==="v"?(ht(i.paste()),w.preventDefault()):_e==="z"&&(w.shiftKey?i.redo():i.undo(),w.preventDefault())}t.onMounted(async()=>{Z(),await t.nextTick(),x(),ee(),window.addEventListener("keydown",ve),window.addEventListener("pointerup",le),window.addEventListener("pointermove",p,{passive:!0})}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",ve),window.removeEventListener("pointerup",le),window.removeEventListener("pointermove",p)});function le(){y.value=null}function me(){m.value=!0,b.value=null}function ke(){var _e;m.value=!1;const w=(_e=document.elementFromPoint(f.x,f.y))==null?void 0:_e.closest(".vue-flow__node"),H=w==null?void 0:w.dataset.id;if(!H){b.value=null;return}const se=w.classList.contains("vue-flow__node-group")?"group":w.classList.contains("vue-flow__node-note")?"note":"entity";b.value={kind:se,id:H}}const Ze=t.computed(()=>Xy(i.state.logical).map(w=>`${w.consumerRef}>${w.typeRef}:${w.usageCount}`).sort().join("|"));t.watch([()=>i.resolved.value,()=>i.displayMode.value,()=>Ze.value],Z),t.watch(()=>i.resolved.value,w=>{const H=b.value;if(!H)return;(H.kind==="entity"?w.entities.some(_e=>_e.entity.modelId===H.id):H.kind==="group"?w.groups.some(_e=>_e.group.modelId===H.id):w.notes.some(_e=>_e.note.modelId===H.id))||(b.value=null)});function ct(w){const H=w.computedPosition??w.position,se=w.dimensions??{width:0,height:0};return{x:H.x+se.width/2,y:H.y+se.height/2}}function ft(w){const H=w.node;if(H){if(b.value=null,H.type==="group"){const se=i.resolved.value.groups.find(_e=>_e.group.modelId===H.id);g.value=se?{groupId:H.id,dx:H.position.x-se.geo.location.x,dy:H.position.y-se.geo.location.y}:null,y.value=null;return}if(H.type!=="entity"&&H.type!=="note"){y.value=null;return}y.value=pe(ct(H))}}function qe(w){var _e;y.value=null,g.value=null;const H=(_e=w.nodes)!=null&&_e.length?w.nodes:[w.node],se=H.filter($e=>($e==null?void 0:$e.type)==="group");if(se.length){for(const $e of se){if(!$e)continue;const Oe=i.resolved.value.entities.filter(He=>He.groupRef===$e.id).map(He=>{const Ke=z(He.entity.modelId),we=(Ke==null?void 0:Ke.computedPosition)??(Ke==null?void 0:Ke.position)??{x:0,y:0};return{id:He.entity.modelId,location:{x:we.x,y:we.y}}});i.dragGroup($e.id,{x:$e.position.x,y:$e.position.y},Oe)}return}for(const $e of H){if(!$e||$e.type==="group")continue;const Oe=$e.computedPosition??$e.position,He=$e.dimensions??{width:0,height:0},Ke={x:Oe.x+He.width/2,y:Oe.y+He.height/2};$e.type==="note"?i.dropNote($e.id,{x:Oe.x,y:Oe.y},pe(Ke)):i.dropEntity($e.id,{x:Oe.x,y:Oe.y},pe(Ke))}}function Rt(w){var q,Ce,Be,ue;if(!i.editable.value)return;const H=((q=A.connectionStartHandle.value)==null?void 0:q.type)==="target"?{source:w.target,sourceHandle:w.targetHandle,target:w.source,targetHandle:w.sourceHandle}:w;if(!H.source||!H.target)return;const se=((Ce=z(H.source))==null?void 0:Ce.type)==="note",_e=((Be=z(H.target))==null?void 0:Be.type)==="note";if(se||_e){if(se&&_e)return;const Ae=se?H.source:H.target,it=se?H.target:H.source;((ue=z(it))==null?void 0:ue.type)==="entity"&&i.addNoteConnection(Ae,it);return}const $e=Ae=>{var it;return(it=i.state.logical.entities.find(We=>We.modelId===Ae))==null?void 0:it.stereotype},Oe=$e(H.source)==="JPA_EMBEDDABLE",He=$e(H.target)==="JPA_EMBEDDABLE";if(Oe||He){if(Oe&&He)return;const Ae=Oe?H.source:H.target,it=Oe?H.target:H.source;i.addEmbedAssociation(it,Ae);return}const Ke=$e(H.source)==="SERIALIZED_TYPE",we=$e(H.target)==="SERIALIZED_TYPE";if(Ke||we){const Ae=we?H.target:H.source,it=we?H.source:H.target;Ae!==it&&i.addSerializedTypeAttribute(it,Ae);return}const Je=Ae=>Ae!=null&&Ae.startsWith("r:")||Ae!=null&&Ae.startsWith("l:")?Ae.slice(2):void 0,Xe=Je(H.sourceHandle),M=Je(H.targetHandle);i.addAssociation(H.source,H.target,Xe,M)}const et=t.ref(null);function jt(w,H){var _e;const se=i.state.layout.entityLayouts.find($e=>$e.entityRef===w);return Bt((_e=se==null?void 0:se.attributeStyles)==null?void 0:_e[H])}function Nt(w,H){var _e;const se=i.state.layout.entityLayouts.find($e=>$e.entityRef===w);return Bt((_e=se==null?void 0:se.operationStyles)==null?void 0:_e[H])}function ut(w){var H;return Bt((H=i.state.layout.groupLayouts.find(se=>se.groupRef===w))==null?void 0:H.style)}function yt(w){var H;return Bt((H=i.state.layout.notes.find(se=>se.modelId===w))==null?void 0:H.style)}function At(w){var $e,Oe;if(w.preventDefault(),!i.editable.value)return;const H=()=>F({x:w.clientX,y:w.clientY}),se=[{caption:i.t("em.ctx.addEntity"),icon:"add-entity",handler:()=>{const He=H();i.addEntity("NewEntity",{x:He.x,y:He.y})}},{caption:i.t("em.ctx.addNote"),icon:"note",handler:()=>{const He=H();i.addNote("메모",{x:He.x,y:He.y})}},{caption:i.t("em.ctx.addGroup"),icon:"folder",handler:()=>{const He=H();i.addEmptyGroup({x:He.x,y:He.y})}}],_e=($e=i.clipboard.value)==null?void 0:$e.kind;(_e==="entity"||_e==="entities")&&se.push({caption:i.t("em.ctx.paste"),icon:"clipboard",handler:()=>ht(i.paste())}),i.resolved.value.entities.length>0&&se.push({type:"separator"},{caption:i.t("em.panel.collapseAll"),icon:"collapse-all",handler:()=>i.collapseAll()},{caption:i.t("em.panel.expandAll"),icon:"expand-all",handler:()=>i.expandAll()}),(Oe=et.value)==null||Oe.open(w,se)}function jn({event:w,node:H}){var we,Je,Xe,M,q,Ce,Be,ue,Ae,it,We,Ho,pa,gt,Kn,al;const se=w;if(se.preventDefault(),!i.editable.value){if(H.type==="group"||H.type==="note")return;const at=(Je=(we=se.target)==null?void 0:we.closest("[data-attr]"))==null?void 0:Je.dataset.attr;if(at){const wt=i.selection.value;(wt==null?void 0:wt.kind)==="attribute"&&wt.entityId===H.id&&wt.ids.includes(at)||i.selectAttribute(H.id,at);const Gn=((Xe=i.selection.value)==null?void 0:Xe.kind)==="attribute"&&i.selection.value.entityId===H.id?[...i.selection.value.ids]:[at];(M=et.value)==null||M.open(se,[{caption:Gn.length>1?i.t("em.ctx.copyN",{n:Gn.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}(q=et.value)==null||q.open(se,[{caption:i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>Lr(a,i,H.id)},re(H.id)]);return}if(H.type==="group"){const at=i.isGroupLocked(H.id),wt=[];at||wt.push({type:"swatches",caption:i.t("em.common.color"),current:ut(H.id),onPick:Gn=>i.setGroupSwatch(H.id,Gn)},{type:"separator"});const xt=Qe()&&Re().includes(H.id)?Me():Pe(H.id);xt.length&&wt.push({caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy(xt)}),wt.push({caption:at?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:at?"unlock":"lock",handler:()=>i.setGroupLocked(H.id,!at)}),at||wt.push({type:"separator"},{caption:i.t("em.ctx.ungroup"),icon:"trash",danger:!0,handler:()=>i.removeGroup(H.id)}),(Ce=et.value)==null||Ce.open(se,wt);return}if(H.type==="note"){(Be=et.value)==null||Be.open(se,[{type:"swatches",caption:i.t("em.common.color"),current:yt(H.id),onPick:at=>i.setNoteSwatch(H.id,at)},{type:"separator"},{caption:i.t("em.ctx.deleteNote"),icon:"trash",danger:!0,handler:()=>i.removeNote(H.id)}]);return}const _e=(Ae=(ue=se.target)==null?void 0:ue.closest("[data-attr]"))==null?void 0:Ae.dataset.attr;if(_e){const at=i.selection.value;(at==null?void 0:at.kind)==="attribute"&&at.entityId===H.id&&at.ids.includes(_e)||i.selectAttribute(H.id,_e);const xt=((it=i.selection.value)==null?void 0:it.kind)==="attribute"&&i.selection.value.entityId===H.id?[...i.selection.value.ids]:[_e];if(i.isEntityLocked(H.id)){(We=et.value)==null||We.open(se,[{caption:xt.length>1?i.t("em.ctx.copyN",{n:xt.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}const Gn=xt.length>1,Bc=[{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(H.id)},{type:"swatches",caption:Gn?i.t("em.ctx.colorN",{n:xt.length}):i.t("em.common.color"),current:Gn?null:jt(H.id,_e),onPick:kP=>i.setAttributeSwatches(H.id,xt,kP)},{type:"separator"},{caption:Gn?i.t("em.ctx.copyN",{n:xt.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}],ha=i.clipboard.value;(ha==null?void 0:ha.kind)==="attribute"&&Bc.push({caption:ha.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:ha.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:H.id},i.paste()}}),Bc.push({type:"separator"},{caption:Gn?i.t("em.ctx.deleteAttrN",{n:xt.length}):i.t("em.ctx.deleteAttr"),icon:"trash",danger:!0,handler:()=>i.removeAttributes(H.id,xt)}),(Ho=et.value)==null||Ho.open(se,Bc);return}const $e=(gt=(pa=se.target)==null?void 0:pa.closest("[data-op]"))==null?void 0:gt.dataset.op;if($e){if(i.isEntityLocked(H.id))return;(Kn=et.value)==null||Kn.open(se,[{caption:i.t("em.ctx.addOperation"),icon:"method",handler:()=>i.addOperation(H.id)},{type:"swatches",caption:i.t("em.common.color"),current:Nt(H.id,$e),onPick:at=>i.setOperationSwatch(H.id,$e,at)},{type:"separator"},{caption:i.t("em.ctx.deleteOperation"),icon:"trash",danger:!0,handler:()=>i.removeOperation(H.id,$e)}]);return}const Oe=i.resolved.value.entities.find(at=>at.entity.modelId===H.id),He=!!(Oe!=null&&Oe.locked),Ke=[{caption:He?i.t("em.ctx.viewDetail"):i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>Lr(a,i,H.id)}];if(!He){Ke.push({type:"separator"},{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(H.id)},{caption:i.t("em.ctx.addMethod"),icon:"method",handler:()=>i.addOperation(H.id)},{caption:i.t("em.ctx.groupInto"),icon:"folder",handler:()=>{const wt=B.value.filter(xt=>xt.type==="entity").map(xt=>xt.id);i.createGroup(wt.includes(H.id)&&wt.length?wt:[H.id])}},{caption:i.t("em.ctx.addSelfAssoc"),icon:"arrow-lr",handler:()=>i.addAssociation(H.id,H.id)});const at=i.embeddableCatalog.value;if(at.length){Ke.push({type:"separator"});for(const wt of at){const xt=Ct(wt.label,i.userLanguage.value)??wt.type;Ke.push({caption:i.t("em.ctx.addEmbeddableNamed",{label:xt}),icon:"link",handler:()=>i.addPredefinedEmbed(H.id,wt.type)})}}}if(Ke.push({type:"separator"}),Ke.push({caption:Oe!=null&&Oe.collapsed?i.t("em.panel.expand"):i.t("em.panel.collapse"),icon:Oe!=null&&Oe.collapsed?"expand-all":"collapse-all",handler:()=>i.setEntityCollapsed(H.id,!(Oe!=null&&Oe.collapsed))}),Oe!=null&&Oe.groupRef&&!He&&Ke.push({caption:i.t("em.ctx.ungroupEntity"),icon:"folder",handler:()=>i.ungroupEntity(H.id)}),Ke.push({caption:He?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:He?"unlock":"lock",handler:()=>i.setEntityLocked(H.id,!He)}),Ke.push(re(H.id)),!He){const at=i.clipboard.value;(at==null?void 0:at.kind)==="attribute"&&Ke.push({caption:at.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:at.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:H.id},i.paste()}}),Ke.push({type:"separator"}),Ke.push({caption:i.t("em.ctx.deleteEntity"),icon:"trash",danger:!0,handler:()=>i.removeEntity(H.id)})}(al=et.value)==null||al.open(se,Ke)}function mt({event:w,edge:H}){var Oe,He;const se=w;if(se.preventDefault(),!i.editable.value)return;const _e=N(H.id);if(_e){(Oe=et.value)==null||Oe.open(se,[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearNoteConnectionWaypoints(_e.noteRef,_e.targetRef)},{type:"separator"},{caption:i.t("em.ctx.deleteConnection"),icon:"trash",danger:!0,handler:()=>i.removeNoteConnection(_e.noteRef,_e.targetRef)}]);return}const $e=[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearWaypoints(H.id)}];i.isAssociationLocked(H.id)||$e.push({type:"separator"},{caption:i.t("em.ctx.deleteAssociation"),icon:"trash",danger:!0,handler:()=>i.removeAssociation(H.id)}),(He=et.value)==null||He.open(se,$e)}function ze(w){return w==="group"?"group":w==="note"?"note":"entity"}function Y({node:w}){if(B.value.length>1){i.selection.value=null;return}i.selection.value={kind:ze(w.type),id:w.id}}function Wt({nodes:w}){w.length>1&&(i.selection.value=null)}function G({edge:w}){const H=N(w.id);i.selection.value=H?{kind:"note",id:H.noteRef}:{kind:"association",id:w.id}}function ae(w){const H=i.selection.value;return!!H&&H.kind!=="attribute"&&H.id===w.id}function De(w){var H,se;return ae(w)?w.type==="group"?"color-mix(in srgb, var(--em-selection) 22%, transparent)":"var(--em-selection)":w.type==="note"?"var(--em-note-soft)":w.type==="group"?uh(Bt((H=w.data)==null?void 0:H.style),!0)??"var(--em-mm-group)":uh(Bt((se=w.data)==null?void 0:se.style))??"var(--em-mm-entity)"}function je(w){return ae(w)?"var(--em-selection)":w.type==="note"?"var(--em-note-accent)":w.type==="group"?"var(--em-node-border)":"var(--em-on-surface-muted)"}function bt(w,H){$(w,H,{zoom:U().zoom,duration:350})}t.watch(()=>i.focusRequest.value,w=>{if(!w)return;const H=z(w.id);if(!H)return;const se=H.computedPosition??H.position,_e=H.dimensions??{width:0,height:0};bt(se.x+_e.width/2,se.y+_e.height/2)});function Vt({position:w}){bt(w.x,w.y)}function Ye({node:w}){i.selection.value={kind:ze(w.type),id:w.id};const H=w.computedPosition??w.position,se=w.dimensions??{width:0,height:0};bt(H.x+se.width/2,H.y+se.height/2)}function Ue({node:w}){x({nodes:[w.id],duration:350,maxZoom:1.2,padding:.6})}return(w,H)=>(t.openBlock(),t.createElementBlock("div",{tabindex:"-1",class:t.normalizeClass(["em-canvas",{"is-connecting":u.value,"is-panning":m.value}])},[t.createVNode(t.unref(Pv),{"min-zoom":.2,"max-zoom":2,"only-render-visible-elements":!X.value,"delete-key-code":null,"disable-keyboard-a11y":!0,"nodes-focusable":!1,"edges-focusable":!1,"nodes-draggable":t.unref(i).editable.value,"nodes-connectable":t.unref(i).editable.value,"connection-mode":t.unref(Pn).Loose,"connect-on-click":!1,"pan-on-scroll":"","zoom-on-scroll":!1,"zoom-on-pinch":!0,"zoom-on-double-click":!1,"zoom-activation-key-code":["Meta","Control"],onMoveStart:me,onMoveEnd:ke,onConnect:Rt,onConnectStart:H[1]||(H[1]=se=>u.value=!0),onConnectEnd:H[2]||(H[2]=se=>u.value=!1),onNodeDrag:ft,onNodeDragStop:qe,onNodeClick:Y,onEdgeClick:G,onSelectionChange:Wt,onPaneClick:H[3]||(H[3]=se=>t.unref(i).selection.value=null),onPaneContextMenu:At,onNodeContextMenu:jn,onEdgeContextMenu:mt},{"node-group":t.withCtx(se=>[t.createVNode(Ph,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),"node-entity":t.withCtx(se=>[t.createVNode(Oh,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),"node-note":t.withCtx(se=>[t.createVNode(zh,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),"edge-association":t.withCtx(se=>[t.createVNode(iy,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),"edge-note-connection":t.withCtx(se=>[t.createVNode(K2,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),"edge-serialized-type":t.withCtx(se=>[t.createVNode(Y2,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),default:t.withCtx(()=>[t.unref(i).showGrid.value?(t.openBlock(),t.createBlock(t.unref(Mx),{key:0,gap:16,"pattern-color":"var(--em-border)"})):t.createCommentVNode("",!0),t.createVNode(t.unref(a$),{"show-interactive":!1,position:"bottom-left"},{default:t.withCtx(()=>[t.unref(i).editable.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createVNode(t.unref(Po),{class:"em-palette__group-start",title:t.unref(i).t("em.ctx.addEntity"),onClick:Se},{default:t.withCtx(()=>[t.createVNode(xe,{name:"add-entity",size:14})]),_:1},8,["title"]),t.createVNode(t.unref(Po),{title:t.unref(i).t("em.ctx.addNote"),onClick:ce},{default:t.withCtx(()=>[t.createVNode(xe,{name:"note",size:14})]),_:1},8,["title"]),t.createVNode(t.unref(Po),{title:t.unref(i).t("em.palette.autoLayout"),onClick:H[0]||(H[0]=se=>t.unref(i).autoLayout())},{default:t.withCtx(()=>[t.createVNode(xe,{name:"auto-layout",size:14})]),_:1},8,["title"])],64)):t.createCommentVNode("",!0)]),_:1}),t.unref(i).showMinimap.value?(t.openBlock(),t.createBlock(t.unref(F2),{key:1,pannable:"",width:224,height:160,"node-color":De,"node-stroke-color":je,"node-border-radius":4,"node-stroke-width":2,"mask-color":"var(--em-minimap-mask)","mask-stroke-color":"var(--em-accent)","mask-stroke-width":1.5,"mask-border-radius":4,"offset-scale":3,onClick:Vt,onNodeClick:Ye,onNodeDblclick:Ue})):t.createCommentVNode("",!0)]),_:1},8,["only-render-visible-elements","nodes-draggable","nodes-connectable","connection-mode"]),ie.value?(t.openBlock(),t.createElementBlock("div",DV,[t.unref(i).editable.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("p",OV,t.toDisplayString(t.unref(i).t("em.canvas.emptyTitle")),1),t.createElementVNode("p",{class:"em-canvas__empty-hint",innerHTML:t.unref(i).t("em.canvas.emptyHint")},null,8,PV),t.createElementVNode("p",{class:"em-canvas__empty-hint",innerHTML:t.unref(i).t("em.canvas.emptyConnectHint")},null,8,zV),t.createElementVNode("p",{class:"em-canvas__empty-hint em-canvas__empty-sub",innerHTML:t.unref(i).t("em.canvas.emptyShortcutHint")},null,8,FV)],64)):(t.openBlock(),t.createElementBlock("p",UV,t.toDisplayString(t.unref(i).t("em.canvas.emptyReadonly")),1))])):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createBlock(LV,{key:1,controller:t.unref(i),onClose:H[4]||(H[4]=se=>r.value=!1)},null,8,["controller"])):t.createCommentVNode("",!0),t.createVNode(t.Transition,{name:"em-conflict-fade"},{default:t.withCtx(()=>[d.value?(t.openBlock(),t.createElementBlock("div",HV,[t.createVNode(xe,{name:"alert-triangle",size:16,class:"em-conflict-banner__icon"}),t.createElementVNode("div",jV,[t.createElementVNode("strong",KV,t.toDisplayString(d.value.title),1),t.createElementVNode("span",GV,t.toDisplayString(d.value.detail),1)])])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(iV,{ref_key:"menuRef",ref:et,locale:t.unref(i).uiLocale.value},null,8,["locale"]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"em-toast-fade"},{default:t.withCtx(()=>[l.value?(t.openBlock(),t.createElementBlock("div",YV,t.toDisplayString(l.value),1)):t.createCommentVNode("",!0)]),_:1})]))],2))}}),[["__scopeId","data-v-934041e8"]]),qV={class:"em-explorer em-scroll-overlay"},WV={class:"em-explorer__search"},JV=["placeholder","aria-label"],XV=["aria-label","title"],ZV={key:0,class:"em-explorer__empty"},QV=["aria-label"],eL=["data-key","aria-level","aria-posinset","aria-setsize","aria-expanded","aria-selected","tabindex","onClick","onDblclick","onFocus","onKeydown"],tL=["onClick"],nL=["title"],oL={class:"em-key-slot"},iL={class:"em-key-slot"},aL={class:"em-explorer__label"},rL={key:2,class:"em-explorer__sr"},lg=tt(t.defineComponent({__name:"DiagramExplorer",props:{controller:{},storageKey:{}},setup(e,{expose:n}){const o=e,i=o.controller,a=ne.useModal(),r=t.computed(()=>{const D=i.resolved.value,E=i.displayMode.value,R=i.userLanguage.value,I=V=>{var L,K;return _a(E,V.name,(L=Sn(V))==null?void 0:L[R],(K=V.table)==null?void 0:K.physicalName,i.t("em.node.logicalMissing"))},x=E==="PHYSICAL"||E==="LOGICAL_PHYSICAL",$=V=>{const L=V.attrType.startsWith("RELATION")&&V.dbAttrs.length>0;return{icon:V.attrType.startsWith("RELATION")?"link":"field",keyMarks:{pk:V.identifier,fk:L&&x}}},U=V=>V.attrType.startsWith("EMBED")&&V.dbAttrs.length>0,F=V=>U(V)||vn(V),B=E==="PHYSICAL"||E==="LOGICAL_PHYSICAL",j=new Map(i.state.logical.entities.map(V=>[V.modelId,V])),X=(V,L)=>{const K=V.dbAttrs[0];return K?Lt(V,K,0,j.get(L),i.state.logical,{embeddableCatalog:i.embeddableCatalog.value}):void 0},W={embeddableCatalog:i.embeddableCatalog.value},oe=new Map,de=V=>{let L=oe.get(V.modelId);return L||oe.set(V.modelId,L=mo(Rn(V,i.state.logical.entities))),L},ie=(V,L)=>{const K=j.get(L);return vn(V)?V.dbAttrs.map((Z,Q)=>Lt(V,Z,Q,K,i.state.logical)):V.attrType==="EMBED_PREDEF"&&!i.embeddableCatalog.value.some(Z=>Z.type===V.type)?V.dbAttrs:V.dbAttrs.map((Z,Q)=>{const fe=Lt(V,Z,Q,K,i.state.logical,W),be=K?fo(fe,de(K)):null;return be?{...fe,physicalName:be.physicalName}:fe})},Ie=(V,L)=>{const K=Ei(V,Go(i.state.logical),L,i.state.logical);return K.kind==="resolved"?K.entity:void 0},Le=(V,L,K)=>{var Ee,Ne,J,ee;const Z={entityId:L,attrId:V.modelId};if(F(V)){const te=_l(E,V,K==null?void 0:K.collection,K==null?void 0:K.targetName,Ie(V));return{key:`attr:${V.modelId}`,label:V.name+(te?` : ${te}`:""),icon:"table",attrRef:Z,focusId:L,matchText:yi(V.name,(Ee=jo(V,V.dbAttrs[0]))==null?void 0:Ee[R],(Ne=V.dbAttrs[0])==null?void 0:Ne.physicalName),children:B?ie(V,L).map(ge=>{var Re,Pe;return{key:`attr:${V.modelId}:col:${ge.modelId}`,label:_a(E,ge.physicalName,(Re=ge.logicalName)==null?void 0:Re[R],ge.physicalName,i.t("em.node.logicalMissing"))+(ge.dataType?` : ${ge.dataType}`:""),icon:"field",attrRef:Z,focusId:L,matchText:yi(ge.physicalName,(Pe=ge.logicalName)==null?void 0:Pe[R]),children:[]}}):[]}}const Q=(K==null?void 0:K.collection)??wi(V,i.state.logical.associations),fe=_l(E,V,Q,K==null?void 0:K.targetName,Ie(V)),be=X(V,L);return{key:`attr:${V.modelId}`,label:_a(E,V.name,(J=jo(V,be))==null?void 0:J[R],be==null?void 0:be.physicalName,i.t("em.node.logicalMissing"))+(fe?` : ${fe}`:""),...$(V),attrRef:Z,focusId:L,matchText:yi(V.name,(ee=jo(V,be))==null?void 0:ee[R],be==null?void 0:be.physicalName),children:[]}},Se=V=>{var Ee,Ne;const L=V.entity,K=E==="CLASS",Q=K||L.attributes.some(vn)?jl(L,i.state.logical):void 0,fe=K&&Q?Q.fields.map(J=>J.attr):[...L.attributes].sort((J,ee)=>J.order-ee.order),be=new Map(((Q==null?void 0:Q.fields)??[]).filter(J=>(K||vn(J.attr))&&(J.target||J.collection)).map(J=>{var ee;return[J.attr.modelId,{targetName:(ee=J.target)==null?void 0:ee.name,collection:J.collection}]}));return{key:`entity:${L.modelId}`,label:I(L),icon:"table",selectKind:"entity",selectId:L.modelId,focusId:L.modelId,matchText:yi(L.name,(Ee=Sn(L))==null?void 0:Ee[R],(Ne=L.table)==null?void 0:Ne.physicalName),children:fe.map(J=>Le(J,L.modelId,be.get(J.modelId)))}},ce=new Map,pe=[];for(const V of D.entities)if(V.groupRef){const L=ce.get(V.groupRef)??[];L.push(V),ce.set(V.groupRef,L)}else pe.push(V);const he=[];for(const V of D.groups){const L=V.group;he.push({key:`group:${L.modelId}`,label:Ct(L.name,R)||L.packageName||i.t("em.explorer.groupFallback"),icon:"folder",focusId:L.modelId,children:(ce.get(L.modelId)??[]).map(Se)})}for(const V of pe)he.push(Se(V));if(D.associations.length){const V=new Map(D.entities.map(L=>[L.entity.modelId,I(L.entity)]));he.push({key:"section:associations",label:i.t("em.explorer.associations",{n:D.associations.length}),icon:"arrow-lr",children:D.associations.map(L=>{const K=L.association,Z=V.get(K.end1.entityRef)??K.end1.entityRef,Q=V.get(K.end2.entityRef)??K.end2.entityRef;return{key:`assoc:${K.modelId}`,label:`${Z} — ${Q}`,icon:"arrow-lr",selectKind:"association",selectId:K.modelId,children:[]}})})}return D.notes.length&&he.push({key:"section:notes",label:i.t("em.explorer.notes",{n:D.notes.length}),icon:"note",children:D.notes.map(({note:V})=>{var L;return{key:`note:${V.modelId}`,label:((L=V.memo.split(`
|
|
73
|
-
`)[0])==null?void 0:L.slice(0,30))||i.t("em.explorer.emptyNote"),icon:"note",selectKind:"note",selectId:V.modelId,focusId:V.modelId,children:[]}})}),{key:"root",label:i.state.layout.name||i.t("em.explorer.diagram"),icon:"network",children:he}});function l(D){return D?D.pk&&D.fk?i.t("em.node.keyPfk"):D.pk?i.t("em.node.keyPk"):D.fk?i.t("em.node.keyFk"):"":""}const s=t.computed(()=>{const D=[],E=R=>{if(R.children.length){R.key!=="root"&&D.push(R.key);for(const I of R.children)E(I)}};return E(r.value),D}),c=D=>D.startsWith("entity:")||D==="section:associations",{isCollapsed:d,toggle:u,toggleAll:m,allExpanded:f}=eg({expandableKeys:()=>s.value,defaultCollapsed:c,storageKey:o.storageKey,scope:()=>i.state.layout.diagramId}),p=t.ref(""),y=t.ref(null),g=t.computed(()=>p.value.trim().length>0),b=t.computed(()=>{const D=[];if(g.value){const R=_V(r.value,p.value.trim().toLowerCase()),I=(x,$,U,F,B)=>{if(!R.has(x.key))return;D.push({node:x,depth:$,parentKey:U,posinset:F,setsize:B});const j=x.children.filter(X=>R.has(X.key));j.forEach((X,W)=>I(X,$+1,x.key,W+1,j.length))};return I(r.value,0,null,1,1),D}const E=(R,I,x,$,U)=>{D.push({node:R,depth:I,parentKey:x,posinset:$,setsize:U}),d(R.key)||R.children.forEach((F,B)=>E(F,I+1,R.key,B+1,R.children.length))};return E(r.value,0,null,1,1),D}),k=t.ref(null),_=t.ref(null),h=t.computed(()=>{var E;const D=b.value;return _.value&&D.some(R=>R.node.key===_.value)?_.value:((E=D[0])==null?void 0:E.node.key)??null}),C=D=>!g.value&&d(D);async function v(D){var E,R;D&&(_.value=D,await t.nextTick(),(R=(E=k.value)==null?void 0:E.querySelector(`[data-key="${D}"]`))==null||R.focus())}function S(D,E){var x,$,U,F,B;const R=b.value,I=R.findIndex(j=>j.node.key===E.node.key);switch(D.key){case"ArrowDown":D.preventDefault(),v((x=R[I+1])==null?void 0:x.node.key);return;case"ArrowUp":D.preventDefault(),v(($=R[I-1])==null?void 0:$.node.key);return;case"Home":D.preventDefault(),v((U=R[0])==null?void 0:U.node.key);return;case"End":D.preventDefault(),v((F=R[R.length-1])==null?void 0:F.node.key);return;case"ArrowRight":if(D.preventDefault(),!E.node.children.length)return;C(E.node.key)?u(E.node.key):v((B=R[I+1])==null?void 0:B.node.key);return;case"ArrowLeft":D.preventDefault(),E.node.children.length&&!C(E.node.key)?u(E.node.key):v(E.parentKey);return;case"Enter":case" ":D.preventDefault(),z(E.node,D);return;case"F2":D.preventDefault(),P(E.node)}}const N=t.computed(()=>g.value&&b.value.length<=1);function A(D){var I;if(D.key!=="/"||D.metaKey||D.ctrlKey||D.altKey||D.shiftKey)return;const E=D.target,R=E==null?void 0:E.tagName;R==="INPUT"||R==="TEXTAREA"||R==="SELECT"||E!=null&&E.isContentEditable||(D.preventDefault(),(I=y.value)==null||I.focus())}t.onMounted(()=>window.addEventListener("keydown",A)),t.onBeforeUnmount(()=>window.removeEventListener("keydown",A)),n({toggleAll:m,allExpanded:f,hasExpandable:t.computed(()=>s.value.length>0)});function T(D){const E=i.selection.value;return D.attrRef?(E==null?void 0:E.kind)==="attribute"&&E.entityId===D.attrRef.entityId&&E.ids.includes(D.attrRef.attrId):!!E&&E.kind!=="attribute"&&!!D.selectId&&D.selectKind===E.kind&&D.selectId===E.id}function O(D){const E=i.selection.value;return D.selectKind==="entity"&&(E==null?void 0:E.kind)==="attribute"&&E.entityId===D.selectId}function z(D,E){if(D.attrRef){const R=E.shiftKey?"range":E.metaKey||E.ctrlKey?"toggle":"replace";i.selectAttribute(D.attrRef.entityId,D.attrRef.attrId,R)}else D.selectKind&&D.selectId&&(i.selection.value={kind:D.selectKind,id:D.selectId});D.focusId&&i.requestFocus(D.focusId)}function P(D){D.selectKind==="entity"&&D.selectId&&Lr(a,i,D.selectId)}return(D,E)=>(t.openBlock(),t.createElementBlock("section",qV,[t.createElementVNode("div",WV,[t.createVNode(xe,{name:"search",size:14,class:"em-explorer__search-icon"}),t.withDirectives(t.createElementVNode("input",{ref_key:"searchInput",ref:y,"onUpdate:modelValue":E[0]||(E[0]=R=>p.value=R),class:"em-explorer__search-input",type:"text",placeholder:t.unref(i).t("em.explorer.searchPlaceholder"),"aria-label":t.unref(i).t("em.explorer.searchAria"),onKeydown:E[1]||(E[1]=t.withKeys(R=>p.value="",["esc"]))},null,40,JV),[[t.vModelText,p.value]]),p.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-explorer__search-clear","aria-label":t.unref(i).t("em.explorer.clearSearchAria"),title:t.unref(i).t("em.explorer.clearSearchTitle"),onClick:E[2]||(E[2]=R=>p.value="")},[t.createVNode(xe,{name:"x",size:13})],8,XV)):t.createCommentVNode("",!0)]),N.value?(t.openBlock(),t.createElementBlock("p",ZV,t.toDisplayString(t.unref(i).t("em.explorer.noMatches")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"rowsEl",ref:k,class:"em-explorer__rows",role:"tree","aria-label":t.unref(i).t("em.explorer.treeAria")},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,R=>(t.openBlock(),t.createElementBlock("div",{key:R.node.key,class:t.normalizeClass(["em-explorer__row",{"is-active":T(R.node),"is-focus-parent":O(R.node),"is-selectable":!!R.node.selectKind||!!R.node.attrRef||!!R.node.focusId}]),"data-key":R.node.key,role:"treeitem","aria-level":R.depth+1,"aria-posinset":R.posinset,"aria-setsize":R.setsize,"aria-expanded":R.node.children.length?!C(R.node.key):void 0,"aria-selected":T(R.node),tabindex:R.node.key===h.value?0:-1,style:t.normalizeStyle({paddingLeft:4+R.depth*14+"px"}),onClick:I=>z(R.node,I),onDblclick:I=>P(R.node),onFocus:I=>_.value=R.node.key,onKeydown:I=>S(I,R)},[t.createElementVNode("span",{class:t.normalizeClass(["em-explorer__chevron",{"is-leaf":!R.node.children.length,"is-open":!C(R.node.key)}]),onClick:t.withModifiers(I=>R.node.children.length&&t.unref(u)(R.node.key),["stop"])},[R.node.children.length?(t.openBlock(),t.createBlock(xe,{key:0,name:"chevron",size:14})):t.createCommentVNode("",!0)],10,tL),R.node.keyMarks?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-explorer__keys",title:l(R.node.keyMarks),"aria-hidden":"true"},[t.createElementVNode("span",oL,[R.node.keyMarks.pk?(t.openBlock(),t.createBlock(xe,{key:0,name:"key",size:14,class:"em-key is-pk"})):R.node.keyMarks.fk?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(xe,{key:1,class:"em-explorer__icon",name:R.node.icon,size:14},null,8,["name"]))]),t.createElementVNode("span",iL,[R.node.keyMarks.fk?(t.openBlock(),t.createBlock(xe,{key:0,name:"key",size:14,class:"em-key is-fk"})):t.createCommentVNode("",!0)])],8,nL)):(t.openBlock(),t.createBlock(xe,{key:1,class:"em-explorer__icon",name:R.node.icon,size:15},null,8,["name"])),t.createElementVNode("span",aL,t.toDisplayString(R.node.label),1),l(R.node.keyMarks)?(t.openBlock(),t.createElementBlock("span",rL,t.toDisplayString(l(R.node.keyMarks)),1)):t.createCommentVNode("",!0)],46,eL))),128))],8,QV)]))}}),[["__scopeId","data-v-ffebc201"]]),lL={class:"em-text-export"},sL=["id","aria-selected","tabindex","onClick"],cL=["aria-labelledby"],dL={class:"em-text-export__actions"},uL=tt(t.defineComponent({__name:"TextExportModal",props:{formats:{},title:{},locale:{}},setup(e){const n=e,o=ne.useModalHandle(),i=(m,f)=>cn(n.locale??"ko",m,f),a=t.ref(0);function r(){return n.formats[a.value]??n.formats[0]}const l=t.ref(null);async function s(m){var f,p;a.value=m,await t.nextTick(),(p=(f=l.value)==null?void 0:f.querySelectorAll('[role="tab"]')[m])==null||p.focus()}function c(m){const f=n.formats.length;f&&s((a.value+m+f)%f)}async function d(){try{await navigator.clipboard.writeText(r().content),ne.showNotification(i("em.export.copied"),"info")}catch{ne.showNotification(i("em.export.copyFailed"),"error")}}function u(){const m=r(),f=new Blob([m.content],{type:"text/plain;charset=utf-8"}),p=URL.createObjectURL(f);try{const y=document.createElement("a");y.href=p,y.download=m.filename,document.body.appendChild(y),y.click(),y.remove()}finally{URL.revokeObjectURL(p)}}return(m,f)=>(t.openBlock(),t.createBlock(t.unref(ne.BSModalFrame),{title:n.title??i("em.export.title")},{default:t.withCtx(()=>[t.createElementVNode("div",lL,[n.formats.length>1?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"tabsEl",ref:l,class:"em-text-export__tabs",role:"tablist"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.formats,(p,y)=>(t.openBlock(),t.createElementBlock("button",{id:`em-text-export-tab-${y}`,key:p.key,type:"button",role:"tab",class:t.normalizeClass(["em-text-export__tab",{"is-active":y===a.value}]),"aria-selected":y===a.value,"aria-controls":"em-text-export-panel",tabindex:y===a.value?0:-1,onClick:g=>a.value=y,onKeydown:[f[0]||(f[0]=t.withKeys(t.withModifiers(g=>c(-1),["prevent"]),["left"])),f[1]||(f[1]=t.withKeys(t.withModifiers(g=>c(1),["prevent"]),["right"])),f[2]||(f[2]=t.withKeys(t.withModifiers(g=>s(0),["prevent"]),["home"])),f[3]||(f[3]=t.withKeys(t.withModifiers(g=>s(n.formats.length-1),["prevent"]),["end"]))]},t.toDisplayString(p.label),43,sL))),128))],512)):t.createCommentVNode("",!0),t.createElementVNode("pre",{id:"em-text-export-panel",class:"em-text-export__pre",role:"tabpanel",tabindex:"0","aria-labelledby":n.formats.length>1?`em-text-export-tab-${a.value}`:void 0},t.toDisplayString(r().content),9,cL),t.createElementVNode("div",dL,[t.createVNode(t.unref(ne.BSButton),{caption:i("em.export.copy"),onClick:d},null,8,["caption"]),t.createVNode(t.unref(ne.BSButton),{caption:i("em.export.download"),onClick:u},null,8,["caption"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:i("em.common.close"),onClick:f[4]||(f[4]=p=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-74551f98"]]),mL={class:"em-text-import"},fL=["aria-label"],pL=["aria-checked","tabindex","onClick"],hL=["placeholder"],yL={key:0,class:"em-text-import__locale"},gL={key:0,class:"em-text-import__locale-marker"},bL={class:"em-text-import__locale-label"},kL={class:"em-text-import__locale-hint"},_L={class:"em-text-import__status"},EL={class:"em-text-import__ok"},NL={key:0,class:"em-text-import__warn"},wL={key:1,class:"em-text-import__err"},IL={key:2,class:"em-text-import__err"},vL={key:3,class:"em-text-import__err"},CL={class:"em-text-import__actions"},SL=tt(t.defineComponent({__name:"TextImportModal",props:{onImport:{type:Function},locale:{}},setup(e){const n=e,o=ne.useModalHandle(),i=(h,C)=>cn(n.locale??"ko",h,C),a=t.ref(""),r=t.ref("auto"),l=t.ref(""),s=[{v:""},...qn.map(h=>({v:h}))],c=[{key:"auto",labelKey:"em.import.formatAuto"},{key:"mermaid",labelKey:"em.import.formatMermaid"},{key:"ddl",labelKey:"em.import.formatDdl"},{key:"json",labelKey:"em.import.formatJson"}],d=t.ref(null);async function u(h){var v,S;const C=c[(h+c.length)%c.length];C&&(r.value=C.key,await t.nextTick(),(S=(v=d.value)==null?void 0:v.querySelectorAll('[role="radio"]')[c.indexOf(C)])==null||S.focus())}function m(h){u(c.findIndex(C=>C.key===r.value)+h)}function f(h){return h?h.startsWith("{")?"json":/\berdiagram\b/i.test(h)?"mermaid":/\bcreate\s+table\b/i.test(h)?"ddl":null:null}const p=t.computed(()=>r.value==="auto"?f(a.value.trim()):r.value),y=t.computed(()=>{const h=a.value.trim();if(!h)return{status:"empty"};const C=p.value;if(!C)return{status:"unknown"};try{let v,S=[];if(C==="json")v=Ud(h);else if(C==="mermaid")v=Rd(h);else{const N=l.value?{commentLocale:l.value}:void 0;v=Bd(h,N),S=Sl(h,N).warnings}return v.logical.entities.length===0?{status:"emptyParse"}:{status:"ok",source:v,warnings:S}}catch(v){return{status:"error",message:v instanceof Error?v.message:String(v)}}}),g=t.computed(()=>{const h=a.value.trim();if(!h||p.value!=="ddl")return null;const C=sb(h);return C.comments?C:null}),b=t.computed(()=>{const h=g.value;return h?h.verdict==="mixed"?i("em.import.commentMixed"):h.verdict==="unknown"?i("em.import.commentUnknown"):i("em.import.commentCertain",{locale:h.verdict}):""}),k=t.computed(()=>y.value.status==="ok");function _(){const h=y.value;h.status!=="ok"||!h.source||(n.onImport(h.source),o.close())}return(h,C)=>(t.openBlock(),t.createBlock(t.unref(ne.BSModalFrame),{title:i("em.import.title")},{default:t.withCtx(()=>[t.createElementVNode("div",mL,[t.createElementVNode("div",{ref_key:"fmtEl",ref:d,class:"em-text-import__formats",role:"radiogroup","aria-label":i("em.import.formatGroup")},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(c,v=>t.createElementVNode("button",{key:v.key,type:"button",role:"radio",class:t.normalizeClass(["em-text-import__fmt",{"is-active":v.key===r.value}]),"aria-checked":v.key===r.value,tabindex:v.key===r.value?0:-1,onClick:S=>r.value=v.key,onKeydown:[C[0]||(C[0]=t.withKeys(t.withModifiers(S=>m(-1),["prevent"]),["left"])),C[1]||(C[1]=t.withKeys(t.withModifiers(S=>m(1),["prevent"]),["right"])),C[2]||(C[2]=t.withKeys(t.withModifiers(S=>u(0),["prevent"]),["home"])),C[3]||(C[3]=t.withKeys(t.withModifiers(S=>u(c.length-1),["prevent"]),["end"]))]},t.toDisplayString(i(v.labelKey)),43,pL)),64))],8,fL),t.withDirectives(t.createElementVNode("textarea",{"onUpdate:modelValue":C[4]||(C[4]=v=>a.value=v),class:"em-text-import__input",placeholder:i("em.import.placeholder"),spellcheck:"false"},null,8,hL),[[t.vModelText,a.value]]),g.value?(t.openBlock(),t.createElementBlock("div",yL,[g.value.markerLocale?(t.openBlock(),t.createElementBlock("span",gL,t.toDisplayString(i("em.import.commentMarker",{locale:g.value.markerLocale})),1)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("label",bL,[t.createTextVNode(t.toDisplayString(i("em.import.commentLocale"))+" ",1),t.createVNode(t.unref(ne.BSSelect),{modelValue:l.value,"onUpdate:modelValue":C[5]||(C[5]=v=>l.value=v),class:"em-text-import__locale-sel",items:s,"value-provider":v=>v.v,"label-provider":v=>v.v===""?i("em.import.commentLocaleUnset"):v.v},null,8,["modelValue","value-provider","label-provider"])]),t.createElementVNode("span",kL,t.toDisplayString(i("em.import.commentEvidence",{n:g.value.comments,hangul:g.value.hangul,kana:g.value.kana,undecidable:g.value.undecidable}))+" · "+t.toDisplayString(b.value),1)],64))])):t.createCommentVNode("",!0),t.createElementVNode("div",_L,[y.value.status==="ok"&&y.value.source?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("span",EL,t.toDisplayString(i("em.import.detected",{format:i(`em.import.format${p.value==="json"?"Json":p.value==="ddl"?"Ddl":"Mermaid"}`)}))+" · "+t.toDisplayString(i("em.import.summary",{entities:y.value.source.logical.entities.length,relations:y.value.source.logical.associations.length})),1),y.value.warnings&&y.value.warnings.length?(t.openBlock(),t.createElementBlock("span",NL," ⚠ "+t.toDisplayString(i("em.import.warnings",{n:y.value.warnings.length})),1)):t.createCommentVNode("",!0)],64)):y.value.status==="error"?(t.openBlock(),t.createElementBlock("span",wL,t.toDisplayString(i("em.import.error",{message:y.value.message??""})),1)):y.value.status==="unknown"?(t.openBlock(),t.createElementBlock("span",IL,t.toDisplayString(i("em.import.unknownFormat")),1)):y.value.status==="emptyParse"?(t.openBlock(),t.createElementBlock("span",vL,t.toDisplayString(i("em.import.emptyParse")),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",CL,[t.createVNode(t.unref(ne.BSButton),{caption:i("em.import.confirm"),disabled:!k.value,onClick:_},null,8,["caption","disabled"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:i("em.common.close"),onClick:C[6]||(C[6]=v=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-a5e84c63"]]),RL={class:"em-toolbar"},AL=["title"],xL={class:"em-toolbar__mode"},sg=tt(t.defineComponent({__name:"EditorToolbar",props:{controller:{},historyOpen:{type:Boolean}},emits:["exportSvg","exportPng","fitView","toggleHistory"],setup(e,{emit:n}){const i=e.controller,a=n,r=ne.useModal(),l=[{v:"LOGICAL",labelKey:"em.displayMode.logical"},{v:"PHYSICAL",labelKey:"em.displayMode.physical"},{v:"LOGICAL_PHYSICAL",labelKey:"em.displayMode.logicalPhysical"},{v:"CLASS",labelKey:"em.displayMode.class"}],s=t.computed({get:()=>i.displayMode.value,set:y=>i.displayMode.value=y});function c(){i.routingMode.value=i.routingMode.value==="straight"?"orthogonal":"straight"}const d=t.computed(()=>{const y=i.resolved.value.entities;return y.length>0&&y.every(g=>g.collapsed)});function u(){d.value?i.expandAll():i.collapseAll()}function m(){const y=fl(i.state.logical,i.referenceOnlyDocument.value);r.openModal({component:uL,bind:{title:i.t("em.toolbar.exportText"),locale:i.uiLocale.value,formats:[{key:"text",label:i.t("em.export.formatText"),content:_d(y,{embeddableCatalog:i.embeddableCatalog.value}),filename:"diagram.txt"},{key:"mermaid-er",label:i.t("em.export.formatMermaidEr"),content:Il(y,"er",{embeddableCatalog:i.embeddableCatalog.value}),filename:"diagram.er.mmd"},{key:"mermaid-class",label:i.t("em.export.formatMermaidClass"),content:Il(y,"class"),filename:"diagram.class.mmd"},{key:"ddl",label:i.t("em.export.formatDdl"),content:Dd(y,"postgres",{embeddableCatalog:i.embeddableCatalog.value,commentLocale:i.projectLanguage.value}),filename:"schema.sql"},{key:"json",label:i.t("em.export.formatJson"),content:Fd(y,i.state.layout),filename:"diagram.json"}]}})}function f(){r.openModal({component:SL,bind:{locale:i.uiLocale.value,onImport:y=>{i.importEntities(y,y.logical.entities.map(g=>g.modelId))}}})}function p(){r.openModal({component:ag,bind:{locale:i.uiLocale.value}})}return(y,g)=>(t.openBlock(),t.createElementBlock("div",RL,[t.unref(i).referenceOnlyDocument.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-toolbar__refonly",title:t.unref(i).t("em.toolbar.referenceOnlyDocHint")},t.toDisplayString(t.unref(i).t("em.toolbar.referenceOnlyBadge")),9,AL)):t.createCommentVNode("",!0),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.undo"),disabled:!t.unref(i).canUndo.value||!t.unref(i).editable.value,onClick:g[0]||(g[0]=b=>t.unref(i).undo())},{left:t.withCtx(()=>[t.createVNode(xe,{name:"undo",size:16})]),_:1},8,["tooltip","disabled"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.redo"),disabled:!t.unref(i).canRedo.value||!t.unref(i).editable.value,onClick:g[1]||(g[1]=b=>t.unref(i).redo())},{left:t.withCtx(()=>[t.createVNode(xe,{name:"redo",size:16})]),_:1},8,["tooltip","disabled"]),g[10]||(g[10]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),t.createElementVNode("label",xL,[t.createTextVNode(t.toDisplayString(t.unref(i).t("em.toolbar.displayLabel"))+" ",1),t.createVNode(t.unref(ne.BSSelect),{modelValue:s.value,"onUpdate:modelValue":g[2]||(g[2]=b=>s.value=b),items:l,"value-provider":b=>b.v,"label-provider":b=>t.unref(i).t(b.labelKey)},null,8,["modelValue","value-provider","label-provider"])]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(i).t(t.unref(i).routingMode.value==="orthogonal"?"em.toolbar.routingOrthogonal":"em.toolbar.routingStraight"),tooltip:t.unref(i).t("em.toolbar.routingToggle"),onClick:c},{left:t.withCtx(()=>[t.createVNode(xe,{name:"route",size:16})]),_:1},8,["caption","tooltip"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:t.normalizeClass(["em-toolbar__toggle",{"is-active":t.unref(i).showGrid.value}]),caption:t.unref(i).t("em.toolbar.grid"),tooltip:t.unref(i).t(t.unref(i).showGrid.value?"em.toolbar.gridOff":"em.toolbar.gridOn"),onClick:g[3]||(g[3]=b=>t.unref(i).showGrid.value=!t.unref(i).showGrid.value)},{left:t.withCtx(()=>[t.createVNode(xe,{name:"grid",size:16})]),_:1},8,["class","caption","tooltip"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:t.normalizeClass(["em-toolbar__toggle",{"is-active":t.unref(i).showMinimap.value}]),caption:t.unref(i).t("em.toolbar.minimap"),tooltip:t.unref(i).t(t.unref(i).showMinimap.value?"em.toolbar.minimapOff":"em.toolbar.minimapOn"),onClick:g[4]||(g[4]=b=>t.unref(i).showMinimap.value=!t.unref(i).showMinimap.value)},{left:t.withCtx(()=>[t.createVNode(xe,{name:"map",size:16})]),_:1},8,["class","caption","tooltip"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(i).t(d.value?"em.panel.expandAll":"em.panel.collapseAll"),disabled:!t.unref(i).editable.value,onClick:u},{left:t.withCtx(()=>[t.createVNode(xe,{name:d.value?"expand-all":"collapse-all",size:16},null,8,["name"])]),_:1},8,["caption","disabled"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn em-toolbar__fit",tooltip:t.unref(i).t("em.toolbar.fitView"),onClick:g[5]||(g[5]=b=>a("fitView"))},{left:t.withCtx(()=>[t.createVNode(xe,{name:"fit-view",size:16})]),_:1},8,["tooltip"]),g[11]||(g[11]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.import"),disabled:!t.unref(i).editable.value,onClick:f},{left:t.withCtx(()=>[t.createVNode(xe,{name:"clipboard",size:16})]),_:1},8,["tooltip","disabled"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportText"),onClick:m},{left:t.withCtx(()=>[t.createVNode(xe,{name:"file-text",size:16})]),_:1},8,["tooltip"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportSvg"),onClick:g[6]||(g[6]=b=>a("exportSvg"))},{left:t.withCtx(()=>[t.createVNode(xe,{name:"image",size:16})]),_:1},8,["tooltip"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportPng"),onClick:g[7]||(g[7]=b=>a("exportPng"))},{left:t.withCtx(()=>[t.createVNode(xe,{name:"camera",size:16})]),_:1},8,["tooltip"]),g[12]||(g[12]=t.createElementVNode("span",{class:"em-toolbar__spacer"},null,-1)),t.unref(i).historyAvailable.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:t.normalizeClass(["em-toolbar__toggle",{"is-active":e.historyOpen}]),caption:t.unref(i).t("em.toolbar.history"),tooltip:t.unref(i).t(e.historyOpen?"em.toolbar.historyClose":"em.toolbar.historyOpen"),onClick:g[8]||(g[8]=b=>a("toggleHistory"))},{left:t.withCtx(()=>[t.createVNode(xe,{name:"history",size:16})]),_:1},8,["class","caption","tooltip"]),g[9]||(g[9]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1))],64)):t.createCommentVNode("",!0),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn em-toolbar__help",tooltip:t.unref(i).t("em.toolbar.shortcuts"),onClick:p},{left:t.withCtx(()=>[t.createVNode(xe,{name:"help",size:16})]),_:1},8,["tooltip"])]))}}),[["__scopeId","data-v-f45e3146"]]),$L=["title"],TL=["title"],ML=["disabled","aria-pressed"],VL=["disabled","aria-pressed"],LL=tt(t.defineComponent({__name:"EditModeToggle",props:{editable:{type:Boolean},opMode:{type:Boolean},frozen:{type:Boolean},locale:{}},emits:["toggle"],setup(e,{emit:n}){const o=e,i=n,a=l=>cn(o.locale??"ko",l);function r(l){o.frozen||!o.opMode||l!==o.editable&&i("toggle")}return(l,s)=>e.frozen?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-mode-toggle em-mode-frozen",role:"status",title:a("em.mode.frozenTitle")},[t.createVNode(xe,{name:"lock",size:14}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.frozen")),1)],8,$L)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["em-mode-toggle em-mode-segment",{"is-readonly":!e.opMode}]),role:"group",title:e.opMode?void 0:a("em.mode.readonlyTitle")},[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-seg",{"is-active":!e.editable}]),disabled:!e.opMode,"aria-pressed":!e.editable,onClick:s[0]||(s[0]=c=>r(!1))},[t.createVNode(xe,{name:"eye",size:13}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.view")),1)],10,ML),t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-seg",{"is-active":e.editable}]),disabled:!e.opMode,"aria-pressed":e.editable,onClick:s[1]||(s[1]=c=>r(!0))},[t.createVNode(xe,{name:"pencil",size:13}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.edit")),1)],10,VL)],10,TL))}}),[["__scopeId","data-v-2b5162b7"]]),BL=["disabled"],DL={class:"em-panel__sub"},OL={class:"em-nav"},PL={key:0,class:"em-nav__divider","aria-hidden":"true"},zL={key:1},FL=["onClick","onKeydown"],UL={class:"em-nav__name"},HL=["title"],jL={key:0,class:"em-panel__note"},KL=["data-attr-block"],GL={key:0,class:"em-embed-col__label"},YL={class:"em-attr__row"},qL=["title"],WL={key:1,class:"em-attr__row"},JL={key:2,class:"em-embed-cols"},XL={class:"em-embed-col"},ZL={class:"em-embed-col__label"},QL={class:"em-attr__row"},eB={class:"em-attr__navhint"},tB={key:3,class:"em-attr__navhint"},nB={class:"em-attr__navhint"},oB={class:"em-attr__row"},iB={class:"em-field"},aB={key:0,class:"em-attr__navhint"},rB={class:"em-attr__row"},lB={class:"em-attr__row"},sB=["title"],cB={class:"em-attr__flags"},dB={class:"em-attr__pii"},uB={class:"em-attr__pii"},mB={key:1,class:"em-attr__pii"},fB={key:2,class:"em-attr__pii em-attr__codetop"},pB={class:"em-multilang"},hB={key:6,class:"em-embed-cols"},yB={key:0,class:"em-attr__navhint"},gB={class:"em-embed-col__label"},bB={class:"em-attr__row"},kB=["title"],_B=["title"],EB=["title"],NB={class:"em-attr__row"},wB={key:0,class:"em-embed-upd","data-em-slot-ctl":"currency"},IB={key:1,class:"em-attr__navhint"},vB={class:"em-embed-upd","data-em-slot-ctl":"insertable"},CB={class:"em-embed-upd","data-em-slot-ctl":"updatable"},SB={class:"em-embed-upd","data-em-slot-ctl":"notnull"},RB={class:"em-attr__flags"},AB={class:"em-multilang"},xB={class:"em-swatch__row em-attr__swatch"},$B=["title","onClick"],TB=["title","onClick"],MB={key:0,class:"em-attr__swatch-hint"},VB=tt(t.defineComponent({__name:"EntityColumnsSection",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,{entity:i,isValueType:a,isColumnless:r,focusedAttrIds:l,personalInfoItems:s,piiLabel:c,idn:d,setAttrLogical:u,SERIALIZED_FIELD_CONTAINERS:m,setCollectionType:f,setAttr:p,isDerivedIdRow:y,rowName:g,rowNamePlaceholder:b,setRowName:k,assocFieldName:_,setAssocFieldName:h,nameLocked:C,nameLockedHint:v,isManagedFk:S,setNaturalId:N,setIdentifier:A,setTransient:T,dbLocked:O,fkDerived:z,fkOriginPhysical:P,typeLocked:D,typeValueOf:E,typeLabelOf:R,setAttrType:I,setAttrCustomType:x,setDb:$,scaleApplicable:U,scaleHint:F,setDbLogical:B,logicalPlaceholder:j,setAttrDescription:X,attrPiiValue:W,setAttrPii:oe,predefinedCustomTypeCatalog:de,serializedTypeNames:ie,embeddableCatalog:Ie,predefinedLabel:Le,groupCodeCatalog:Se,attrGroupCodes:ce,attrCodeItems:pe,codeValueOf:he,codeLabelOf:V,setAttrGroupCode:L,setAttrCode:K,setAttrDefaultValue:Z,hasColumnSlots:Q,isMultiColFk:fe,setDbAt:be,setDbLogicalAt:Ee,colSlotMeta:Ne,fixedDataType:J,fixedLength:ee,fixedScale:te,slotFixedHint:ge,updatableItems:Re,updatableLabel:Pe,updatableValue:Me,setUpdatableAt:Qe,setUpdatable:Ot,insertableItems:ht,insertableLabel:re,insertableValue:ve,setInsertableAt:le,setInsertable:me,notNullItems:ke,notNullLabel:Ze,notNullValue:ct,setNotNullAt:ft,sharedItems:qe,sharedLabel:Rt,sharedValue:et,setSharedAt:jt,isShared:Nt,sharedPhysical:ut}=ph(o,()=>n.entityId),yt=t.computed(()=>i.value?o.state.layout.entityLayouts.find(Ye=>Ye.entityRef===i.value.modelId)??null:null),At=t.computed(()=>{var Ye;return((Ye=i.value)==null?void 0:Ye.attributes.filter(Ue=>Ue.attrType!=="DIVIDER"))??[]}),jn=t.computed(()=>{var Ye;return((Ye=i.value)==null?void 0:Ye.attributes)??[]}),mt=t.computed(()=>At.value.filter(Ye=>l.value.has(Ye.modelId)));function ze(Ye){return{pk:Ye.identifier,fk:Ye.attrType.startsWith("RELATION")&&Ye.dbAttrs.length>0,required:Ye.notNull&&!Ye.identifier}}function Y(Ye){const Ue=ze(Ye),w=[Ue.pk&&"PK",Ue.fk&&"FK",Ue.required&&"NOT NULL"].filter(Boolean);return w.length?w.join(" · "):void 0}function Wt(Ye,Ue){i.value&&o.selectAttribute(i.value.modelId,Ye.modelId,Ue.shiftKey?"range":Ue.metaKey||Ue.ctrlKey?"toggle":"replace")}function G(Ye){var Ue,w;return Bt((w=(Ue=yt.value)==null?void 0:Ue.attributeStyles)==null?void 0:w[Ye.modelId])}function ae(Ye){return l.value.size>1&&l.value.has(Ye.modelId)}function De(Ye,Ue){if(!i.value)return;const w=ae(Ye)?o.selectedAttrIds.value:[Ye.modelId];o.setAttributeSwatches(i.value.modelId,w,Ue)}const je=t.ref(void 0);function bt(Ye){if(!Ye||!i.value)return;const Ue=o.addPredefinedEmbed(i.value.modelId,Ye);Ue&&o.selectAttribute(i.value.modelId,Ue),je.value=void 0}function Vt(){if(!i.value)return;const Ye=o.addAttribute(i.value.modelId);Ye&&o.selectAttribute(i.value.modelId,Ye)}return(Ye,Ue)=>t.unref(i)?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!t.unref(o).editable.value},[t.createElementVNode("h4",DL,[t.createTextVNode(t.toDisplayString(t.unref(o).t("em.attr.section",{n:At.value.length}))+" ",1),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:Vt},null,8,["caption"]),t.unref(Ie).length?(t.openBlock(),t.createBlock(t.unref(ne.BSSelect),{key:0,width:"120px",placeholder:t.unref(o).t("em.attr.addEmbeddable"),"model-value":je.value,items:t.unref(Ie),"value-provider":w=>w.type,"label-provider":t.unref(Le),"onUpdate:modelValue":bt},null,8,["placeholder","model-value","items","value-provider","label-provider"])):t.createCommentVNode("",!0)]),t.createElementVNode("ul",OL,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(jn.value,w=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:w.modelId},[w.attrType==="DIVIDER"?(t.openBlock(),t.createElementBlock("li",PL,[...Ue[0]||(Ue[0]=[t.createElementVNode("hr",null,null,-1)])])):(t.openBlock(),t.createElementBlock("li",zL,[t.createElementVNode("div",{class:t.normalizeClass(["em-nav__item",{"is-selected":t.unref(l).has(w.modelId)}]),role:"button",tabindex:"0",onClick:H=>Wt(w,H),onKeydown:[t.withKeys(t.withModifiers(H=>Wt(w,H),["prevent"]),["enter"]),t.withKeys(t.withModifiers(H=>Wt(w,H),["prevent"]),["space"])]},[t.createElementVNode("span",UL,t.toDisplayString(w.name||t.unref(o).t("em.attr.nameless")),1),t.createElementVNode("span",{class:"em-nav__marks",title:Y(w)},[ze(w).pk?(t.openBlock(),t.createBlock(xe,{key:0,name:"key",size:12,class:"em-nav-key is-pk"})):ze(w).required?(t.openBlock(),t.createBlock(xe,{key:1,name:"asterisk",size:14,class:"em-nav-key is-required"})):t.createCommentVNode("",!0),ze(w).fk?(t.openBlock(),t.createBlock(xe,{key:2,name:"key",size:12,class:"em-nav-key is-fk"})):t.createCommentVNode("",!0)],8,HL)],42,FL)]))],64))),128))]),At.value.length&&!mt.value.length?(t.openBlock(),t.createElementBlock("p",jL,t.toDisplayString(t.unref(o).t("em.attr.selectHint")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(mt.value,w=>{var H,se,_e,$e,Oe,He,Ke,we,Je,Xe;return t.openBlock(),t.createElementBlock("div",{key:w.modelId,class:t.normalizeClass(["em-attr",{"is-focused":t.unref(l).has(w.modelId)}]),"data-attr-block":w.modelId},[t.unref(y)(w)?(t.openBlock(),t.createElementBlock("span",GL,t.toDisplayString(t.unref(o).t("em.attr.derivedIdField")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",YL,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`attr-name-${w.modelId}`,width:"100%",disabled:t.unref(C)(w),title:t.unref(C)(w)?t.unref(v)(w):t.unref(y)(w)?t.unref(o).t("em.attr.derivedIdNote"):void 0,placeholder:t.unref(b)(w),"model-value":t.unref(g)(w),"onUpdate:modelValue":M=>t.unref(k)(w,M)},null,8,["name","disabled","title","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSSelect),{name:`attr-type-${w.modelId}`,width:"84px",placeholder:t.unref(o).t("em.attr.typePlaceholder"),disabled:t.unref(D)(w),items:t.unref(fd)(w.type,t.unref(de),t.unref(ie),t.unref(Ie)),"value-provider":t.unref(E),"label-provider":t.unref(R),"model-value":w.type,"onUpdate:modelValue":M=>t.unref(I)(w,M)},null,8,["name","placeholder","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(S)(w)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:M=>t.unref(o).removeAttribute(t.unref(i).modelId,w.modelId)},null,8,["onClick"])],8,qL)]),w.type===t.unref(pn)&&!t.unref(z)(w)?(t.openBlock(),t.createElementBlock("div",WL,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`attr-customtype-${w.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.customTypePlaceholder"),"model-value":w.customType??"","onUpdate:modelValue":M=>t.unref(x)(w,M)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(y)(w)?(t.openBlock(),t.createElementBlock("div",JL,[t.createElementVNode("div",XL,[t.createElementVNode("span",ZL,t.toDisplayString(t.unref(o).t("em.attr.assocField")),1),t.createElementVNode("div",QL,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`attr-assocname-${w.modelId}`,width:"100%",title:t.unref(o).t("em.attr.derivedIdNote"),placeholder:t.unref(o).t("em.attr.namePlaceholder"),"model-value":t.unref(_)(w),"onUpdate:modelValue":M=>t.unref(h)(w,M)},null,8,["name","title","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("p",eB,t.toDisplayString(t.unref(o).t("em.attr.derivedIdNote")),1)])])):t.createCommentVNode("",!0),w.attrType==="RELATION_REF"?(t.openBlock(),t.createElementBlock("p",tB,t.toDisplayString(t.unref(o).t("em.attr.inverseNavHint")),1)):t.createCommentVNode("",!0),t.unref(r)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createElementVNode("p",nB,t.toDisplayString(t.unref(o).t("em.attr.serializedNoColumnNote")),1),t.createElementVNode("div",oB,[t.createVNode(Qt,{class:"grow",name:`attr-field-logical-${w.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,placeholder:t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":w.fieldLogicalName,"onUpdate:modelValue":M=>t.unref(u)(w,M)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("label",iB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.serializedContainer")),1),t.createVNode(t.unref(ne.BSSelect),{name:`attr-container-${w.modelId}`,width:"100%",items:[...t.unref(m)],"value-provider":t.unref(d),"label-provider":M=>M==="none"?t.unref(o).t("em.attr.serializedContainerNone"):M,"model-value":w.collectionType??"none","onUpdate:modelValue":M=>M&&t.unref(f)(w,M)},null,8,["name","items","value-provider","label-provider","model-value","onUpdate:modelValue"])])],64)):t.unref(Q)(w)?(t.openBlock(),t.createElementBlock("div",hB,[t.unref(fe)(w)?(t.openBlock(),t.createElementBlock("p",yB,t.toDisplayString(t.unref(o).t("em.attr.fkDerivedNote")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.dbAttrs,(M,q)=>{var Ce,Be,ue,Ae,it;return t.openBlock(),t.createElementBlock("div",{key:M.modelId,class:"em-embed-col"},[t.createElementVNode("span",gB,t.toDisplayString(((Ce=t.unref(Ne)(w,q))==null?void 0:Ce.name)??((Be=t.unref(Ne)(w,q))==null?void 0:Be.physicalName)??t.unref(o).t("em.attr.colFallback",{n:q+1})),1),t.createElementVNode("div",bB,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`embed-col-${M.modelId}`,width:"100%",disabled:t.unref(Nt)(M),placeholder:((ue=t.unref(Ne)(w,q))==null?void 0:ue.physicalName)??t.unref(o).t("em.attr.columnPlaceholder"),"model-value":t.unref(Nt)(M)?t.unref(ut)(M):M.physicalName,"onUpdate:modelValue":We=>t.unref(be)(w,q,{physicalName:We})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(ge)(w)},[t.createVNode(t.unref(ne.BSTextInput),{name:`embed-dtype-${M.modelId}`,width:"84px",disabled:"","model-value":t.unref(J)(w,q)},null,8,["name","model-value"])],8,kB),t.createElementVNode("span",{title:t.unref(ge)(w)},[t.createVNode(t.unref(ne.BSNumberInput),{name:`embed-len-${M.modelId}`,width:"48px",disabled:"","model-value":t.unref(ee)(w,q)},null,8,["name","model-value"])],8,_B),t.createElementVNode("span",{title:t.unref(ge)(w)},[t.createVNode(t.unref(ne.BSNumberInput),{name:`embed-scale-${M.modelId}`,width:"48px",disabled:"","model-value":t.unref(te)(w,q)},null,8,["name","model-value"])],8,EB)]),t.createVNode(Do,{controller:t.unref(o),"ref-id":M.modelId},null,8,["controller","ref-id"]),t.createElementVNode("div",NB,[t.createVNode(Qt,{class:"grow",name:`embed-logical-${M.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,placeholder:t.unref(Ct)((Ae=t.unref(Ne)(w,q))==null?void 0:Ae.logicalName,t.unref(o).userLanguage.value)??t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":M.logicalName,"onUpdate:modelValue":We=>t.unref(Ee)(w,q,We)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),(it=t.unref(Ne)(w,q))!=null&&it.shareable?(t.openBlock(),t.createElementBlock("label",wB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.currencyColumn")),1),t.createVNode(t.unref(ne.BSSelect),{width:"110px","model-value":t.unref(et)(M),items:t.unref(qe)(),"value-provider":t.unref(d),"label-provider":t.unref(Rt),"onUpdate:modelValue":We=>We&&t.unref(jt)(w,q,We)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(Nt)(M)?(t.openBlock(),t.createElementBlock("p",IB,t.toDisplayString(t.unref(o).t("em.attr.embedSharedHint")),1)):t.createCommentVNode("",!0),t.createElementVNode("label",vB,[Ue[3]||(Ue[3]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"110px",disabled:t.unref(Nt)(M),"model-value":t.unref(Nt)(M)?"false":t.unref(ve)(M),items:t.unref(ht),"value-provider":t.unref(d),"label-provider":t.unref(re),"onUpdate:modelValue":We=>We&&t.unref(le)(w,q,We)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",CB,[Ue[4]||(Ue[4]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"110px",disabled:t.unref(Nt)(M),"model-value":t.unref(Nt)(M)?"false":t.unref(Me)(M),items:t.unref(Re),"value-provider":t.unref(d),"label-provider":t.unref(Pe),"onUpdate:modelValue":We=>We&&t.unref(Qe)(w,q,We)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",SB,[Ue[5]||(Ue[5]=t.createElementVNode("span",null,"NOT NULL",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"110px",disabled:t.unref(Nt)(M)||t.unref(O)(w)||t.unref(z)(w),"model-value":t.unref(ct)(M),items:t.unref(ke),"value-provider":t.unref(d),"label-provider":t.unref(Ze),"onUpdate:modelValue":We=>We&&t.unref(ft)(w,q,We)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])])])}),128)),t.unref(fe)(w)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",RB,[t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-pk-${w.modelId}`,label:"Primary Key","model-value":w.identifier,disabled:"","onUpdate:modelValue":M=>t.unref(A)(w,M)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-nn-${w.modelId}`,label:"Not Null","model-value":w.notNull,disabled:"","onUpdate:modelValue":M=>t.unref(p)(w,{notNull:M})},null,8,["name","model-value","onUpdate:modelValue"])]),t.createElementVNode("fieldset",AB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`attr-desc-${w.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":w.description,"onUpdate:modelValue":M=>t.unref(X)(w,M)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[t.unref(z)(w)?(t.openBlock(),t.createElementBlock("p",aB,t.toDisplayString(t.unref(o).t("em.attr.fkDerivedNote")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",rB,[t.createVNode(Qt,{class:"grow",name:`attr-logical-${w.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,placeholder:t.unref(j)(w,t.unref(o).userLanguage.value),"model-value":(H=w.dbAttrs[0])==null?void 0:H.logicalName,"onUpdate:modelValue":M=>t.unref(B)(w,M)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("div",lB,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`attr-col-${w.modelId}`,width:"100%",placeholder:t.unref(P)(w)??t.unref(o).t("em.attr.columnPlaceholder"),disabled:t.unref(O)(w),"model-value":((se=w.dbAttrs[0])==null?void 0:se.physicalName)??"","onUpdate:modelValue":M=>t.unref($)(w,{physicalName:M})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSSelect),{name:`attr-dtype-${w.modelId}`,width:"84px",placeholder:"dataType",disabled:t.unref(O)(w)||t.unref(z)(w),items:t.unref(ld)(((_e=w.dbAttrs[0])==null?void 0:_e.dataType)??"",t.unref(o).selectableDataTypes.value),"value-provider":t.unref(d),"label-provider":t.unref(hl),"model-value":(($e=w.dbAttrs[0])==null?void 0:$e.dataType)??"","onUpdate:modelValue":M=>M&&t.unref($)(w,{dataType:M})},null,8,["name","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSNumberInput),{name:`attr-len-${w.modelId}`,width:"48px",placeholder:"len",disabled:t.unref(O)(w)||t.unref(z)(w),"model-value":(Oe=w.dbAttrs[0])==null?void 0:Oe.length,"onUpdate:modelValue":M=>t.unref($)(w,{length:M||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(F)(w)},[t.createVNode(t.unref(ne.BSNumberInput),{name:`attr-scale-${w.modelId}`,width:"48px",placeholder:"scale",disabled:t.unref(O)(w)||t.unref(z)(w)||!t.unref(U)(w),"model-value":(He=w.dbAttrs[0])==null?void 0:He.scale,"onUpdate:modelValue":M=>t.unref($)(w,{scale:M||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,sB)]),t.createVNode(Do,{controller:t.unref(o),"ref-id":(Ke=w.dbAttrs[0])==null?void 0:Ke.modelId},null,8,["controller","ref-id"]),t.createElementVNode("div",cB,[t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-pk-${w.modelId}`,label:"Primary Key","model-value":w.identifier,disabled:t.unref(a)||t.unref(O)(w)||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref(A)(w,M)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-nn-${w.modelId}`,label:"Not Null","model-value":w.notNull,disabled:t.unref(O)(w)||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref(p)(w,{notNull:M})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-uq-${w.modelId}`,label:"Unique","model-value":!!((we=w.dbAttrs[0])!=null&&we.unique),disabled:t.unref(O)(w)||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref($)(w,{unique:M})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-ai-${w.modelId}`,label:"Auto Increment","model-value":!!((Je=w.dbAttrs[0])!=null&&Je.autoIncrement),disabled:t.unref(O)(w)||t.unref(z)(w)||!w.identifier,"onUpdate:modelValue":M=>t.unref($)(w,{autoIncrement:M})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-tr-${w.modelId}`,label:"@Transient","model-value":!!w.transient,disabled:w.identifier||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref(T)(w,M)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-nid-${w.modelId}`,label:"@NaturalId","model-value":!!w.naturalId,disabled:w.identifier||t.unref(O)(w)||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref(N)(w,M)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{class:"em-attr__flag-sub",name:`attr-nidm-${w.modelId}`,label:"mutable","model-value":!!w.naturalIdMutable,disabled:t.unref(O)(w)||!w.naturalId,"onUpdate:modelValue":M=>t.unref(p)(w,{naturalIdMutable:M||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-mv-${w.modelId}`,label:"Multi-Value (Set)","model-value":!!((Xe=w.dbAttrs[0])!=null&&Xe.multiValue),disabled:t.unref(O)(w)||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref($)(w,{multiValue:M||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),t.createElementVNode("label",dB,[Ue[1]||(Ue[1]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"100%",disabled:t.unref(O)(w),"model-value":t.unref(ve)(w.dbAttrs[0]),items:t.unref(ht),"value-provider":t.unref(d),"label-provider":t.unref(re),"onUpdate:modelValue":M=>M&&t.unref(me)(w,M)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",uB,[Ue[2]||(Ue[2]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"100%",disabled:t.unref(O)(w),"model-value":t.unref(Me)(w.dbAttrs[0]),items:t.unref(Re),"value-provider":t.unref(d),"label-provider":t.unref(Pe),"onUpdate:modelValue":M=>M&&t.unref(Ot)(w,M)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.unref(z)(w)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",mB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createVNode(t.unref(ne.BSSelect),{width:"100%","model-value":t.unref(W)(w),items:t.unref(s),"value-provider":t.unref(d),"label-provider":t.unref(c),"onUpdate:modelValue":M=>M&&t.unref(oe)(w,M)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])),t.unref(Se).length&&!t.unref(z)(w)?(t.openBlock(),t.createElementBlock("label",fB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.codeGroup")),1),t.createVNode(kh,{"model-value":w.groupCode,items:t.unref(Se),locale:t.unref(o).uiLocale.value,"onUpdate:modelValue":M=>t.unref(L)(w,M)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(z)(w)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",{key:3,class:t.normalizeClass(["em-attr__pii",{"em-attr__codetop":!t.unref(Se).length}])},[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.defaultValue")),1),t.unref(ce)(w).length?(t.openBlock(),t.createBlock(t.unref(ne.BSSelect),{key:0,width:"100%","model-value":w.defaultValue??"none",items:t.unref(pe)(w),"value-provider":t.unref(he),"label-provider":t.unref(V),"onUpdate:modelValue":M=>M&&t.unref(K)(w,M)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])):(t.openBlock(),t.createBlock(t.unref(ne.BSTextInput),{key:1,name:`attr-default-${w.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.defaultValue"),"model-value":w.defaultValue??"","onUpdate:modelValue":M=>t.unref(Z)(w,M)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))],2)),t.createElementVNode("fieldset",pB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`attr-desc-${w.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":w.description,"onUpdate:modelValue":M=>t.unref(X)(w,M)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)),t.createElementVNode("div",xB,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":G(w)===null}]),title:t.unref(o).t("em.swatch.none"),onClick:M=>De(w,null)},"∅",10,$B),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),M=>(t.openBlock(),t.createElementBlock("button",{key:M,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":G(w)===M}]),style:t.normalizeStyle({background:t.unref(di)(M)}),title:t.unref(o).t(t.unref(Bo)(M)),onClick:q=>De(w,M)},null,14,TB))),128)),ae(w)?(t.openBlock(),t.createElementBlock("span",MB,t.toDisplayString(t.unref(o).t("em.attr.batchHint",{n:t.unref(l).size})),1)):t.createCommentVNode("",!0)])],10,KL)}),128))],8,BL)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-4127b61b"]]),LB=["disabled"],BB={class:"em-panel__sub-label"},DB={class:"em-attr__row"},OB={class:"em-field em-idx-params"},PB=["value","placeholder","onChange"],zB=tt(t.defineComponent({__name:"EntityIndexSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean}},emits:["toggle"],setup(e,{emit:n}){const o=e,i=n,a=o.controller,r=t.computed(()=>a.state.logical.entities.find(v=>v.modelId===o.entityId)??null),l=t.computed(()=>r.value?bi(r.value,a.superClassCatalog.value):[]),s=t.computed(()=>{var v;return so(((v=r.value)==null?void 0:v.attributes)??[])}),c=v=>s.value.canon(v),d=t.computed(()=>({entity:r.value??{modelId:"",name:"",stereotype:"JPA_ENTITY",attributes:[]},logical:a.state.logical,resolver:s.value,inherited:l.value,embeddableCatalog:a.embeddableCatalog.value,t:a.t})),u=t.computed(()=>[...wh(d.value).map(v=>({value:v.ref,label:v.label})),...l.value.map(v=>({value:v.modelId,label:a.t("em.index.inherited",{field:v.field})}))]);function m(v,S){var O;const N=new Set(v.columns.filter((z,P)=>P!==S).map(z=>c(z.columnRef))),A=u.value.filter(z=>!N.has(c(z.value))),T=(O=v.columns[S])==null?void 0:O.columnRef;return T&&!A.some(z=>z.value===T)&&A.push({value:T,label:f(T)}),A}function f(v){return ic(v,d.value)}function p(v){const S=new Set(v.columns.map(N=>c(N.columnRef)));return u.value.filter(N=>!S.has(c(N.value)))}function y(){var S;if(!r.value)return;const v=u.value[0];a.addIndex(r.value.modelId,{modelId:Fe(),name:`idx_${(((S=r.value.indexes)==null?void 0:S.length)??0)+1}`,unique:!1,columns:v?[{columnRef:v.value,descending:!1}]:[]})}function g(v,S){r.value&&a.updateIndex(r.value.modelId,v,S)}function b(v){const S=p(v)[0];S&&g(v.modelId,{columns:[...v.columns,{columnRef:S.value,descending:!1}]})}function k(v,S,N){g(v.modelId,{columns:v.columns.map((A,T)=>T===S?{...A,columnRef:N}:A)})}function _(v,S,N){g(v.modelId,{columns:v.columns.map((A,T)=>T===S?{...A,descending:N}:A)})}function h(v,S){g(v.modelId,{columns:v.columns.filter((N,A)=>A!==S)})}function C(v,S){g(v.modelId,{parameters:S.trim()===""?void 0:S})}return(v,S)=>{var N;return r.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-section em-idx-section",disabled:!t.unref(a).editable.value},[t.createElementVNode("h4",{class:t.normalizeClass(["em-panel__sub",{"em-panel__sub--toggle":e.collapsible}]),onClick:S[0]||(S[0]=A=>e.collapsible&&i("toggle"))},[t.createElementVNode("span",BB,[e.collapsible?(t.openBlock(),t.createBlock(xe,{key:0,name:"chevron",size:13,class:t.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(t.unref(a).t("em.index.section",{n:((N=r.value.indexes)==null?void 0:N.length)??0})),1)]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(a).t("em.common.add"),onClick:t.withModifiers(y,["stop"])},null,8,["caption"])],2),!e.collapsible||!e.collapsed?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(r.value.indexes??[],A=>(t.openBlock(),t.createElementBlock("div",{key:A.modelId,class:"em-attr"},[t.createElementVNode("div",DB,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`idx-name-${A.modelId}`,width:"100%",placeholder:t.unref(a).t("em.index.namePlaceholder"),"model-value":A.name,"onUpdate:modelValue":T=>g(A.modelId,{name:T})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`idx-uq-${A.modelId}`,class:"em-check",label:"UQ","model-value":A.unique,"onUpdate:modelValue":T=>g(A.modelId,{unique:T})},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:T=>t.unref(a).removeIndex(r.value.modelId,A.modelId)},null,8,["onClick"])]),t.createVNode(Do,{controller:t.unref(a),"ref-id":A.modelId},null,8,["controller","ref-id"]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(A.columns,(T,O)=>(t.openBlock(),t.createElementBlock("div",{key:O,class:"em-attr__row"},[t.createVNode(t.unref(ne.BSSelect),{class:"grow","model-value":T.columnRef,items:m(A,O),"value-provider":z=>z.value,"label-provider":z=>z.label,"onUpdate:modelValue":z=>z&&k(A,O,z)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`idx-${A.modelId}-desc-${O}`,class:"em-check",label:"DESC","model-value":T.descending,"onUpdate:modelValue":z=>_(A,O,z)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:"−",onClick:z=>h(A,O)},null,8,["onClick"])]))),128)),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(a).t("em.index.addColumn"),disabled:!p(A).length,onClick:T=>b(A)},null,8,["caption","disabled","onClick"]),t.createElementVNode("label",OB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.index.condition")),1),t.createElementVNode("textarea",{class:"em-textarea",value:A.parameters??"",rows:"2",placeholder:t.unref(a).t("em.index.conditionPlaceholder"),onChange:T=>C(A,T.target.value)},null,40,PB)])]))),128)):t.createCommentVNode("",!0)],8,LB)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-ee0032b1"]]),FB=["disabled"],UB={class:"em-panel__sub-label"},HB={class:"em-attr__row"},jB={class:"em-attr__row"},KB={class:"em-multilang"},GB={class:"em-attr__pii"},YB={class:"em-swatch__row em-attr__swatch"},qB=["title","onClick"],WB=["title","onClick"],JB=tt(t.defineComponent({__name:"EntityOperationsSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean}},emits:["toggle"],setup(e,{emit:n}){const o=e,i=n,a=o.controller,r=ne.useModal(),l=t.computed(()=>a.state.logical.entities.find(h=>h.modelId===o.entityId)??null),s=t.computed(()=>l.value?a.state.layout.entityLayouts.find(h=>h.entityRef===l.value.modelId)??null:null),c=["PUBLIC","PROTECTED","PACKAGE","PRIVATE"],d=["none","PASSWORD","SOCIAL_SECURITY_NO","PASSPORT_NO","ALIEN_REGISTRATION_NO","DRIVERS_LICENSE_NO","BIOMETRICS","CREDITCARD_NO","ACCOUNT_NO","MEMBERSHIP_CARD_NO","ID","NAME","DATE_OF_BIRTH","PHONE_NO","EMAIL_ADDRESS","ADDRESS","IP_ADDRESS"];function u(h){return h==="none"?a.t("em.common.noneParen"):h}const m=h=>h;function f(h,C){l.value&&a.updateOperation(l.value.modelId,h.modelId,C)}function p(h,C){f(h,{description:Object.keys(C).length?C:void 0})}function y(h){return h.personalInfoAttributeType??"none"}function g(h,C){f(h,{personalInfoAttributeType:C==="none"?void 0:C})}function b(h){var C,v;return Bt((v=(C=s.value)==null?void 0:C.operationStyles)==null?void 0:v[h.modelId])}function k(h,C){l.value&&a.setOperationSwatch(l.value.modelId,h.modelId,C)}function _(h){r.openModal({component:Ih,bind:{operationName:h.name,sourceCode:h.sourceCode??"",locale:a.uiLocale.value,onSave:C=>f(h,{sourceCode:C})}})}return(h,C)=>{var v;return l.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!t.unref(a).editable.value},[t.createElementVNode("h4",{class:t.normalizeClass(["em-panel__sub",{"em-panel__sub--toggle":e.collapsible}]),onClick:C[1]||(C[1]=S=>e.collapsible&&i("toggle"))},[t.createElementVNode("span",UB,[e.collapsible?(t.openBlock(),t.createBlock(xe,{key:0,name:"chevron",size:13,class:t.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(t.unref(a).t("em.op.section",{n:((v=l.value.operations)==null?void 0:v.length)??0})),1)]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(a).t("em.common.add"),onClick:C[0]||(C[0]=t.withModifiers(S=>t.unref(a).addOperation(l.value.modelId),["stop"]))},null,8,["caption"])],2),!e.collapsible||!e.collapsed?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(l.value.operations??[],S=>(t.openBlock(),t.createElementBlock("div",{key:S.modelId,class:"em-attr"},[t.createElementVNode("div",HB,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`op-name-${S.modelId}`,width:"100%",placeholder:t.unref(a).t("em.op.namePlaceholder"),"model-value":S.name,"onUpdate:modelValue":N=>f(S,{name:N})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSSelect),{width:"96px","model-value":S.visibility??"PACKAGE",items:c,"value-provider":m,"label-provider":m,"onUpdate:modelValue":N=>N&&f(S,{visibility:N})},null,8,["model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:N=>t.unref(a).removeOperation(l.value.modelId,S.modelId)},null,8,["onClick"])]),t.createElementVNode("div",jB,[t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(a).t(S.sourceCode?"em.op.editBodyDirty":"em.op.editBody"),onClick:N=>_(S)},null,8,["caption","onClick"])]),t.createElementVNode("fieldset",KB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`op-desc-${S.modelId}`,languages:t.unref(a).languages.value,"default-lang":t.unref(a).userLanguage.value,"model-value":S.description,"onUpdate:modelValue":N=>p(S,N)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])]),t.createElementVNode("label",GB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.attr.pii")),1),t.createVNode(t.unref(ne.BSSelect),{width:"100%","model-value":y(S),items:d,"value-provider":m,"label-provider":u,"onUpdate:modelValue":N=>N&&g(S,N)},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("div",YB,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":b(S)===null}]),title:t.unref(a).t("em.swatch.none"),onClick:N=>k(S,null)},"∅",10,qB),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),N=>(t.openBlock(),t.createElementBlock("button",{key:N,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":b(S)===N}]),style:t.normalizeStyle({background:t.unref(di)(N)}),title:t.unref(a).t(t.unref(Bo)(N)),onClick:A=>k(S,N)},null,14,WB))),128))])]))),128)):t.createCommentVNode("",!0)],8,FB)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-04208206"]]),XB=["title"],ZB={class:"em-panel__head"},QB={class:"em-panel__head-row"},eD=["title"],tD={class:"em-panel__context"},nD={key:0,class:"em-panel__lock"},oD=["disabled"],iD={key:0,class:"em-attr__navhint"},aD={key:0,class:"em-panel__note"},rD={key:1,class:"em-panel__note"},lD={key:2,class:"em-jpa"},sD={class:"em-field"},cD={class:"em-field"},dD={class:"em-field"},uD={key:0,class:"em-field"},mD={class:"em-panel__note"},fD={class:"em-panel__sub"},pD={class:"em-field"},hD={class:"em-field"},yD={class:"em-jpa"},gD={key:0,class:"em-panel__note"},bD={key:1,class:"em-panel__note"},kD={class:"em-jpa"},_D={class:"em-field"},ED={key:0,class:"em-panel__note"},ND={class:"em-field"},wD={class:"em-multilang"},ID={class:"em-field"},vD=["value"],CD={class:"em-field"},SD={class:"em-swatch"},RD={class:"em-swatch__row"},AD=["title"],xD=["title","onClick"],$D={class:"em-panel__note"},TD={class:"em-field"},MD=["value"],VD={class:"em-swatch"},LD={class:"em-swatch__row"},BD=["title"],DD=["title","onClick"],cg=tt(t.defineComponent({__name:"PropertyPanel",props:{controller:{},width:{},resizing:{type:Boolean},startResize:{type:Function}},emits:["collapse"],setup(e,{expose:n,emit:o}){const i=e,a=o,r=t.ref(null);n({focusCollapse:()=>{var J;return(J=r.value)==null?void 0:J.focus()}});const l=i.controller,s=t.computed(()=>l.selection.value),c=t.computed(()=>l.inspectedEntityId.value),d=t.computed(()=>{const J=c.value;return J?l.state.logical.entities.find(ee=>ee.modelId===J)??null:null}),u=t.computed(()=>{const J=s.value;if((J==null?void 0:J.kind)==="association")return l.isAssociationLocked(J.id);const ee=c.value;return!!ee&&l.isEntityLocked(ee)}),m=t.computed(()=>{var J;return((J=l.selectedAttr.value)==null?void 0:J.attrId)??null}),f=t.computed(()=>new Set(l.selectedAttrIds.value)),p=t.computed(()=>m.value!==null),y=t.ref({});t.watch(p,()=>{y.value={}});function g(J){return y.value[J]??p.value}function b(J){y.value={...y.value,[J]:!g(J)}}const k=t.computed(()=>{var te;const J=d.value;if(!J)return l.t("em.entity.fallback");const ee=(te=J.table)==null?void 0:te.physicalName;return ee?`${J.name} (${ee})`:J.name}),_=t.computed(()=>{const J=s.value;return(J==null?void 0:J.kind)==="association"?l.state.logical.associations.find(ee=>ee.modelId===J.id)??null:null}),h=t.computed(()=>{const J=s.value;return(J==null?void 0:J.kind)==="group"?l.state.logical.groups.find(ee=>ee.modelId===J.id)??null:null}),C=t.computed(()=>{const J=s.value;return(J==null?void 0:J.kind)==="note"?l.state.layout.notes.find(ee=>ee.modelId===J.id)??null:null}),v=t.computed(()=>{var ee,te;const J=(ee=h.value)==null?void 0:ee.name;return Ct(J,l.userLanguage.value)||((te=h.value)==null?void 0:te.packageName)||l.t("em.group.fallback")}),S=t.computed(()=>{if(d.value){const J=f.value.size;if(J>1)return l.t("em.inspector.ctxEntityAttrs",{name:d.value.name,n:J});if(m.value){const ee=d.value.attributes.find(te=>te.modelId===m.value);return(ee==null?void 0:ee.attrType)==="DIVIDER"?l.t("em.inspector.ctxEntityDivider",{name:d.value.name}):l.t("em.inspector.ctxEntityAttr",{name:d.value.name,attr:(ee==null?void 0:ee.name)??""})}return l.t("em.inspector.ctxEntity",{name:d.value.name})}if(_.value){const J=ee=>{var te;return((te=l.state.logical.entities.find(ge=>ge.modelId===ee))==null?void 0:te.name)??ee};return l.t("em.inspector.ctxAssoc",{a:J(_.value.end1.entityRef),b:J(_.value.end2.entityRef)})}return h.value?l.t("em.inspector.ctxGroup",{name:v.value}):C.value?l.t("em.inspector.ctxNote"):l.t("em.inspector.ctxNone")}),N=["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"],A=["EXACTLY_ONE_INSTANCE","NO_INSTANCE_OR_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES"],T={EXACTLY_ONE_INSTANCE:"em.embed.card1",NO_INSTANCE_OR_ONE_INSTANCE:"em.embed.card01",ZERO_OR_MORE_INSTANCES:"em.embed.card0N"},O=J=>{const ee=T[J];return ee?l.t(ee):J},z=J=>{var ee;return((ee=l.state.logical.entities.find(te=>te.modelId===J))==null?void 0:ee.name)??J},P=["ALL","PERSIST","MERGE","REMOVE","REFRESH","DETACH"],D=["LIST","SET"],E=["inherit","LAZY","EAGER"],R=J=>J;function I(J){return J==="inherit"?l.t("em.common.inherit"):J}const x=t.computed(()=>!!_.value&&_.value.end1.entityRef===_.value.end2.entityRef);function $(J,ee){_.value&&l.updateAssociationEnd(_.value.modelId,J,ee)}function U(J){return ce.value?J:J==="end1"?"end2":"end1"}function F(J){var Re;const ee=(Re=_.value)==null?void 0:Re[J];if(!(ee!=null&&ee.attributeRef))return;const te=l.state.logical.entities.find(Pe=>Pe.modelId===ee.entityRef),ge=te==null?void 0:te.attributes.find(Pe=>Pe.modelId===ee.attributeRef);return ge&&(ge.attrType==="RELATION_OWN"||ge.attrType==="RELATION_REF")?ge.name:void 0}function B(J,ee){var ge;const te=(ge=_.value)==null?void 0:ge[J];te!=null&&te.attributeRef&&l.updateAttribute(te.entityRef,te.attributeRef,{name:ee})}function j(J){var Pe;const ee=F(J);if(ee!==void 0)return ee;const te=(Pe=_.value)==null?void 0:Pe[J];if(te!=null&&te.navFieldNameHint)return te.navFieldNameHint;const ge=J==="end1"?"end2":"end1",Re=l.state.logical.entities.find(Me=>{var Qe;return Me.modelId===((Qe=_.value)==null?void 0:Qe[ge].entityRef)});return Re?Ia(Re.name,Na(_.value[ge].multiplicity)):""}function X(J){return!!ce.value||F(J)!==void 0}function W(J){_.value&&!x.value&&l.setAssociationIdentifying(_.value.modelId,J)}function oe(J){var ee,te,ge;return!!((ge=(te=(ee=_.value)==null?void 0:ee[J].jpa)==null?void 0:te.cascadeTypes)!=null&&ge.includes("ALL"))}function de(J,ee,te){var Pe,Me;const ge=(Pe=_.value)==null?void 0:Pe[J];if(ee==="ALL"&&te){$(J,{jpa:{...ge==null?void 0:ge.jpa,cascadeTypes:["ALL"]}});return}const Re=new Set(((Me=ge==null?void 0:ge.jpa)==null?void 0:Me.cascadeTypes)??[]);te?Re.add(ee):Re.delete(ee),$(J,{jpa:{...ge==null?void 0:ge.jpa,cascadeTypes:[...Re]}})}function ie(J,ee){var ge;const te=(ge=_.value)==null?void 0:ge[J];$(J,{jpa:{...te==null?void 0:te.jpa,...ee}})}function Ie(J){var ee,te;return((te=(ee=_.value)==null?void 0:ee[J].jpa)==null?void 0:te.fetchType)??"inherit"}function Le(J,ee){ie(J,{fetchType:ee==="inherit"?void 0:ee})}function Se(J){var te;const ee=(te=_.value)==null?void 0:te[J==="end1"?"end2":"end1"];return(ee==null?void 0:ee.multiplicity)==="ZERO_OR_MORE_INSTANCES"||(ee==null?void 0:ee.multiplicity)==="ONE_OR_MORE_INSTANCES"}const ce=t.computed(()=>{const J=_.value;if(!J)return null;for(const ee of l.state.logical.entities){const te=ee.attributes.find(Me=>{var Qe;return((Qe=Me.embedded)==null?void 0:Qe.associationRef)===J.modelId&&Me.attrType==="EMBED_OWN"});if(!te)continue;const ge=J.end2.entityRef===te.embedded.embeddableRef?"end2":"end1",Re=J[ge].multiplicity,Pe=J[ge].jpa;return{which:ge,cardinality:Re,isCollection:Re==="ZERO_OR_MORE_INSTANCES"||Re==="ONE_OR_MORE_INSTANCES",collectionType:(Pe==null?void 0:Pe.collectionType)??"LIST",collectionTable:(Pe==null?void 0:Pe.collectionTable)??"",orderColumn:(Pe==null?void 0:Pe.orderColumn)??""}}return null});function pe(J){_.value&&l.setEmbedCardinality(_.value.modelId,J)}function he(J){const ee=ce.value;ee&&ie(ee.which,J==="SET"?{collectionType:"SET",orderColumn:void 0}:{collectionType:"LIST"})}function V(J){const ee=ce.value;ee&&ie(ee.which,{collectionTable:J.trim()||void 0})}function L(J){const ee=ce.value;ee&&ie(ee.which,{orderColumn:J.trim()||void 0})}function K(J){h.value&&l.updateGroup(h.value.modelId,J)}function Z(J,ee){var te;K({name:{...(te=h.value)==null?void 0:te.name,[J]:ee}})}const Q=t.computed(()=>{var J;return h.value?Bt((J=l.state.layout.groupLayouts.find(ee=>ee.groupRef===h.value.modelId))==null?void 0:J.style):null});function fe(J){h.value&&l.setGroupSwatch(h.value.modelId,J)}function be(J){C.value&&l.setNoteMemo(C.value.modelId,J)}const Ee=t.computed(()=>{var J;return Bt((J=C.value)==null?void 0:J.style)});function Ne(J){C.value&&l.setNoteSwatch(C.value.modelId,J)}return(J,ee)=>(t.openBlock(),t.createElementBlock("aside",{class:"em-panel",style:t.normalizeStyle({width:e.width+"px"})},[t.createElementVNode("div",{class:t.normalizeClass(["em-resize-handle em-resize-handle--left",{"is-dragging":e.resizing}]),title:t.unref(l).t("em.panel.resizeWidth"),onPointerdown:ee[0]||(ee[0]=(...te)=>e.startResize&&e.startResize(...te))},null,42,XB),t.createElementVNode("header",ZB,[t.createElementVNode("div",QB,[ee[14]||(ee[14]=t.createElementVNode("h3",{class:"em-panel__title"},"Inspector",-1)),t.createElementVNode("button",{ref_key:"collapseBtn",ref:r,type:"button",class:"em-panel__btn",title:t.unref(l).t("em.panel.collapse"),onClick:ee[1]||(ee[1]=te=>a("collapse"))},[t.createVNode(xe,{name:"panel-right-close",size:16})],8,eD)]),t.createElementVNode("p",tD,t.toDisplayString(S.value),1),u.value&&c.value?(t.openBlock(),t.createElementBlock("div",nD,[t.createVNode(xe,{name:"lock",size:13}),t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.panel.lockedBanner")),1),t.unref(l).editable.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-panel__unlock",onClick:ee[2]||(ee[2]=te=>t.unref(l).setEntityLocked(c.value,!1))},t.toDisplayString(t.unref(l).t("em.panel.unlock")),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),t.createElementVNode("fieldset",{class:"em-panel__body em-scroll-overlay",disabled:!t.unref(l).editable.value||u.value},[d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createVNode(fh,{controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("basics"),title:k.value,onToggle:ee[3]||(ee[3]=te=>b("basics"))},null,8,["controller","entity-id","collapsed","title"]),t.createVNode(VB,{controller:t.unref(l),"entity-id":d.value.modelId},null,8,["controller","entity-id"]),t.unref(mn)(d.value.stereotype)?(t.openBlock(),t.createElementBlock("p",iD,t.toDisplayString(t.unref(l).t("em.entity.noIndexNote")),1)):(t.openBlock(),t.createBlock(zB,{key:1,controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("index"),onToggle:ee[4]||(ee[4]=te=>b("index"))},null,8,["controller","entity-id","collapsed"])),t.createVNode(JB,{controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("ops"),onToggle:ee[5]||(ee[5]=te=>b("ops"))},null,8,["controller","entity-id","collapsed"])],64)):t.createCommentVNode("",!0),_.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(t.unref(ne.BSCheckbox),{name:"assoc-identifying",class:"em-check",label:t.unref(l).t("em.assoc.identifying"),"model-value":!!_.value.identifying,disabled:x.value||!!ce.value,"onUpdate:modelValue":W},null,8,["label","model-value","disabled"]),x.value?(t.openBlock(),t.createElementBlock("p",aD,t.toDisplayString(t.unref(l).t("em.assoc.selfNoIdentifying")),1)):ce.value?(t.openBlock(),t.createElementBlock("p",rD,t.toDisplayString(t.unref(l).t("em.assoc.embedNoIdentifying")),1)):t.createCommentVNode("",!0),ce.value?(t.openBlock(),t.createElementBlock("fieldset",lD,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.embed.legend")),1),t.createElementVNode("label",sD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.embed.cardinality")),1),t.createVNode(t.unref(ne.BSSelect),{"model-value":ce.value.cardinality,items:A,"value-provider":R,"label-provider":O,"onUpdate:modelValue":ee[6]||(ee[6]=te=>te&&pe(te))},null,8,["model-value"])]),ce.value.isCollection?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",cD,[ee[15]||(ee[15]=t.createElementVNode("span",null,"collectionType",-1)),t.createVNode(t.unref(ne.BSSelect),{"model-value":ce.value.collectionType,items:D,"value-provider":R,"label-provider":R,"onUpdate:modelValue":ee[7]||(ee[7]=te=>te&&he(te))},null,8,["model-value"])]),t.createElementVNode("label",dD,[ee[16]||(ee[16]=t.createElementVNode("span",null,"collectionTable",-1)),t.createVNode(t.unref(ne.BSTextInput),{name:"embed-coll-table",width:"100%",placeholder:t.unref(l).t("em.embed.collectionTablePlaceholder"),"model-value":ce.value.collectionTable,"onUpdate:modelValue":V},null,8,["placeholder","model-value"])]),ce.value.collectionType==="LIST"?(t.openBlock(),t.createElementBlock("label",uD,[ee[17]||(ee[17]=t.createElementVNode("span",null,"orderColumn",-1)),t.createVNode(t.unref(ne.BSTextInput),{name:"embed-order-col",width:"100%",placeholder:t.unref(l).t("em.embed.orderColumnPlaceholder"),"model-value":ce.value.orderColumn,"onUpdate:modelValue":L},null,8,["placeholder","model-value"])])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0),t.createElementVNode("p",mD,t.toDisplayString(t.unref(l).t("em.embed.ownerFixedNote")),1)])):t.createCommentVNode("",!0),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(["end1","end2"],te=>{var ge,Re,Pe;return t.withDirectives(t.createElementVNode("div",{key:te,class:"em-end"},[t.createElementVNode("h4",fD,t.toDisplayString(te)+" → "+t.toDisplayString(z(_.value[te].entityRef)),1),ce.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",pD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.assoc.multiplicity")),1),t.createVNode(t.unref(ne.BSSelect),{"model-value":_.value[te].multiplicity,items:N,"value-provider":R,"label-provider":t.unref(wa),"onUpdate:modelValue":Me=>$(te,{multiplicity:Me})},null,8,["model-value","label-provider","onUpdate:modelValue"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:`${U(te)}-navigable`,class:"em-check",label:"navigable",title:U(te)==="end2"?t.unref(l).t("em.assoc.ownerNavFixed"):void 0,disabled:U(te)==="end2","model-value":U(te)==="end2"?!0:_.value[U(te)].navigable,"onUpdate:modelValue":Me=>$(U(te),{navigable:Me})},null,8,["name","title","disabled","model-value","onUpdate:modelValue"]),t.createElementVNode("label",hD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.assoc.navFieldName")),1),t.createVNode(t.unref(ne.BSTextInput),{name:`${U(te)}-navname`,width:"100%",disabled:!X(U(te)),placeholder:t.unref(l).t("em.attr.namePlaceholder"),"model-value":j(U(te)),"onUpdate:modelValue":Me=>B(U(te),Me)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:`${U(te)}-composition`,class:"em-check",label:"composition","model-value":_.value[U(te)].composition,"onUpdate:modelValue":Me=>$(U(te),{composition:Me})},null,8,["name","model-value","onUpdate:modelValue"])],64)),t.createElementVNode("fieldset",yD,[ee[18]||(ee[18]=t.createElementVNode("legend",null,"cascade",-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(P,Me=>{var Qe,Ot;return t.createVNode(t.unref(ne.BSCheckbox),{key:Me,name:`${U(te)}-cascade-${Me}`,class:"em-check",label:Me,"model-value":!!((Ot=(Qe=_.value[U(te)].jpa)==null?void 0:Qe.cascadeTypes)!=null&&Ot.includes(Me)),disabled:!X(U(te))||Me!=="ALL"&&oe(U(te)),"onUpdate:modelValue":ht=>de(U(te),Me,ht)},null,8,["name","label","model-value","disabled","onUpdate:modelValue"])}),64)),X(U(te))?oe(U(te))?(t.openBlock(),t.createElementBlock("p",bD,t.toDisplayString(t.unref(l).t("em.assoc.cascadeAllNote")),1)):t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("p",gD,t.toDisplayString(t.unref(l).t("em.assoc.navRequiredNote")),1))]),t.createElementVNode("fieldset",kD,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.assoc.jpaDetails")),1),t.createElementVNode("label",_D,[ee[19]||(ee[19]=t.createElementVNode("span",null,"fetchType",-1)),t.createVNode(t.unref(ne.BSSelect),{disabled:!X(U(te)),"model-value":Ie(U(te)),items:E,"value-provider":R,"label-provider":I,"onUpdate:modelValue":Me=>Me&&Le(U(te),Me)},null,8,["disabled","model-value","onUpdate:modelValue"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:`${U(te)}-orphan`,class:"em-check",label:"orphanRemoval","model-value":!!((ge=_.value[U(te)].jpa)!=null&&ge.orphanRemoval),disabled:!X(U(te))||Se(te),"onUpdate:modelValue":Me=>ie(U(te),{orphanRemoval:Me})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),Se(te)&&((Re=_.value[U(te)].jpa)!=null&&Re.orphanRemoval)?(t.openBlock(),t.createElementBlock("p",ED,t.toDisplayString(t.unref(l).t("em.assoc.orphanRemovalNote")),1)):t.createCommentVNode("",!0),t.createElementVNode("label",ND,[ee[20]||(ee[20]=t.createElementVNode("span",null,"orderBy",-1)),t.createVNode(t.unref(ne.BSTextInput),{name:`${U(te)}-orderby`,width:"100%",disabled:!X(U(te)),placeholder:t.unref(l).t("em.assoc.orderByPlaceholder"),"model-value":((Pe=_.value[U(te)].jpa)==null?void 0:Pe.orderBy)??"","onUpdate:modelValue":Me=>ie(U(te),{orderBy:Me.trim()||void 0})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])])])]),[[t.vShow,!ce.value||te===ce.value.which]])}),64))],64)):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("fieldset",wD,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.group.nameLegend")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(l).languages.value,te=>{var ge;return t.openBlock(),t.createElementBlock("label",{key:te,class:"em-lang"},[t.createElementVNode("span",null,t.toDisplayString(te),1),t.createVNode(t.unref(ne.BSTextInput),{name:`grp-name-${te}`,width:"100%","model-value":((ge=h.value.name)==null?void 0:ge[te])??"","onUpdate:modelValue":Re=>Z(te,Re)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),t.createElementVNode("label",ID,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.common.description")),1),t.createElementVNode("textarea",{class:"em-textarea",value:h.value.description??"",rows:"3",onChange:ee[8]||(ee[8]=te=>K({description:te.target.value}))},null,40,vD)]),t.createElementVNode("label",CD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.entity.package")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"grp-package",width:"100%","model-value":h.value.packageName??"","onUpdate:modelValue":ee[9]||(ee[9]=te=>K({packageName:te}))},null,8,["model-value"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:"grp-exclude-ddl",class:"em-check",label:t.unref(l).t("em.group.excludeDDL"),"model-value":h.value.excludeDDLGeneration,"onUpdate:modelValue":ee[10]||(ee[10]=te=>K({excludeDDLGeneration:te}))},null,8,["label","model-value"]),t.createElementVNode("fieldset",SD,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.common.color")),1),t.createElementVNode("div",RD,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":Q.value===null}]),title:t.unref(l).t("em.swatch.none"),onClick:ee[11]||(ee[11]=te=>fe(null))},"∅",10,AD),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),te=>(t.openBlock(),t.createElementBlock("button",{key:te,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":Q.value===te}]),style:t.normalizeStyle({background:t.unref(di)(te)}),title:t.unref(l).t(t.unref(Bo)(te)),onClick:ge=>fe(te)},null,14,xD))),128))])]),t.createElementVNode("p",$D,t.toDisplayString(t.unref(l).t("em.group.members",{n:h.value.memberEntityRefs.length})),1)],64)):t.createCommentVNode("",!0),C.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createElementVNode("label",TD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.common.memo")),1),t.createElementVNode("textarea",{class:"em-textarea",value:C.value.memo,rows:"6",onChange:ee[12]||(ee[12]=te=>be(te.target.value))},null,40,MD)]),t.createElementVNode("fieldset",VD,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.common.color")),1),t.createElementVNode("div",LD,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":Ee.value===null}]),title:t.unref(l).t("em.swatch.none"),onClick:ee[13]||(ee[13]=te=>Ne(null))},"∅",10,BD),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),te=>(t.openBlock(),t.createElementBlock("button",{key:te,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":Ee.value===te}]),style:t.normalizeStyle({background:t.unref(di)(te)}),title:t.unref(l).t(t.unref(Bo)(te)),onClick:ge=>Ne(te)},null,14,DD))),128))])])],64)):t.createCommentVNode("",!0)],8,oD)],4))}}),[["__scopeId","data-v-923cccbb"]]),OD=["title"],PD={class:"em-validation__title"},zD=["title","onClick"],FD={key:0,class:"em-validation__body"},UD={class:"em-validation__opt"},HD={key:0,class:"em-validation__empty"},jD={key:1,class:"em-validation__empty"},KD={key:2,class:"em-validation__list"},GD=["onClick"],YD={class:"em-validation__item-msg"},qD={key:0,class:"em-validation__item-entity"},WD=["title","onClick"],JD=["title"],XD=tt(t.defineComponent({__name:"ValidationPanel",props:{controller:{},panelWidth:{},inspectorOpen:{type:Boolean,default:!0}},setup(e){const o=e.controller,i=t.computed(()=>o.issues.value),a=t.computed(()=>{const g=new Map;for(const b of o.state.logical.entities)g.set(b.modelId,b.name);return g});function r(g){const b=Qv(g);if(!b)return null;const k=a.value.get(b);return k===void 0?null:k.trim()===""?o.t("em.validation.nameless"):k}const l={error:{order:0,icon:"alert-circle",labelKey:"em.validation.severityError"},warning:{order:1,icon:"alert-triangle",labelKey:"em.validation.severityWarning"},info:{order:2,icon:"info",labelKey:"em.validation.severityInfo"}},s=t.computed(()=>{const g={error:0,warning:0,info:0};for(const b of i.value)g[b.severity]++;return g}),c=t.ref({error:!0,warning:!0,info:!0}),d=t.computed(()=>i.value.filter(g=>c.value[g.severity]).slice().sort((g,b)=>l[g.severity].order-l[b.severity].order)),u=t.computed(()=>d.value.map(g=>({issue:g,entityName:r(g),message:mh(o.t,g),category:Xv(o.t,g.ruleId)}))),m=t.ref(!1);function f(g){c.value[g]=!c.value[g]}function p(g){if(!m.value){m.value=!0;return}f(g)}function y(g){g.targetRef&&o.requestFocus(g.targetRef)}return(g,b)=>(t.openBlock(),t.createElementBlock("section",{class:t.normalizeClass(["em-validation",{"is-open":m.value,"is-inspector-collapsed":!e.inspectorOpen}]),style:t.normalizeStyle(m.value||!e.inspectorOpen?void 0:{width:e.panelWidth+"px"})},[t.createElementVNode("header",{class:"em-validation__head",onClick:b[1]||(b[1]=k=>m.value=!m.value)},[t.createElementVNode("button",{type:"button",class:"em-validation__toggle",title:t.unref(o).t(m.value?"em.panel.collapse":"em.panel.expand")},[t.createVNode(xe,{name:"chevron",size:14,class:t.normalizeClass([{"is-open":m.value},"em-validation__chevron"])},null,8,["class"]),t.createElementVNode("span",PD,t.toDisplayString(t.unref(o).t("em.validation.title")),1)],8,OD),t.createElementVNode("div",{class:"em-validation__counts",onClick:b[0]||(b[0]=t.withModifiers(()=>{},["stop"]))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(["error","warning","info"],k=>t.createElementVNode("button",{key:k,type:"button",class:t.normalizeClass(["em-validation__count",[`is-${k}`,{"is-off":!c.value[k]}]]),title:m.value?t.unref(o).t(c.value[k]?"em.validation.hideSeverity":"em.validation.showSeverity",{label:t.unref(o).t(l[k].labelKey)}):t.unref(o).t("em.validation.expandPanel"),onClick:_=>p(k)},[t.createVNode(xe,{name:l[k].icon,size:14},null,8,["name"]),t.createElementVNode("span",null,t.toDisplayString(s.value[k]),1)],10,zD)),64))])]),m.value?(t.openBlock(),t.createElementBlock("div",FD,[t.createElementVNode("label",UD,[t.createVNode(t.unref(ne.BSCheckbox),{name:"val-flag-norel",label:t.unref(o).t("em.validation.checkOrphanEntities"),"model-value":t.unref(o).flagEntitiesWithoutRelations.value,"onUpdate:modelValue":b[2]||(b[2]=k=>t.unref(o).flagEntitiesWithoutRelations.value=k)},null,8,["label","model-value"])]),i.value.length===0?(t.openBlock(),t.createElementBlock("p",HD,t.toDisplayString(t.unref(o).t("em.validation.noIssues")),1)):d.value.length===0?(t.openBlock(),t.createElementBlock("p",jD,t.toDisplayString(t.unref(o).t("em.validation.noVisibleIssues")),1)):(t.openBlock(),t.createElementBlock("ul",KD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,({issue:k,entityName:_,message:h,category:C},v)=>(t.openBlock(),t.createElementBlock("li",{key:`${k.ruleId}:${k.targetRef??"model"}:${v}`,class:t.normalizeClass(["em-validation__item",[`is-${k.severity}`,{"is-clickable":!!k.targetRef}]]),onClick:S=>y(k)},[t.createVNode(xe,{name:l[k.severity].icon,size:15,class:"em-validation__item-icon"},null,8,["name"]),t.createElementVNode("span",YD,[_?(t.openBlock(),t.createElementBlock("span",qD,t.toDisplayString(_),1)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(h),1)]),t.unref(o).hasQuickFix(k)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-validation__item-fix",title:t.unref(o).t("em.validation.quickFixTip"),onClick:t.withModifiers(S=>t.unref(o).applyQuickFix(k),["stop"])},t.toDisplayString(t.unref(o).t("em.validation.quickFix")),9,WD)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:"em-validation__item-cat",title:k.ruleId},t.toDisplayString(C),9,JD)],10,GD))),128))]))])):t.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-251fd3f0"]]),ZD=20;function QD(e,n=ZD){if(typeof e!="string")return null;const o=e.split(`
|
|
74
|
-
`)[0].trim();return o?o.length>n?`${o.slice(0,n)}…`:o:null}function eO(e){var o;const n=new Map;for(const i of[...e].sort((a,r)=>a.seq-r.seq))for(const a of i.ops){if(a.kind!=="note.add"&&a.kind!=="note.setMemo")continue;const r=a.noteRef,l=(o=a.value)==null?void 0:o.memo;typeof r=="string"&&typeof l=="string"&&n.set(r,l)}return n}const tO={class:"em-history"},nO={class:"em-history__head"},oO={class:"em-history__title"},iO={class:"em-history__head-actions"},aO=["title","disabled"],rO=["title"],lO={class:"em-history__filters"},sO={class:"em-history__filter"},cO={class:"em-history__filters em-history__filters--period"},dO={class:"em-history__filter-label"},uO=["title","aria-label","max"],mO=["title","aria-label","min"],fO=["title"],pO={key:0,class:"em-history__diffbar"},hO={class:"em-history__diffbar-range"},yO={class:"em-history__diffbar-count"},gO={class:"em-history__body"},bO={key:0,class:"em-history__empty"},kO={key:1,class:"em-history__diff-list"},_O=["onClick"],EO={class:"em-history__action-head"},NO={class:"em-history__action-name"},wO={key:0,class:"em-history__fields"},IO={class:"em-history__fname"},vO={key:0,class:"em-history__old"},CO={class:"em-history__val"},SO={key:1,class:"em-history__empty"},RO={key:2,class:"em-history__empty is-error"},AO={key:3,class:"em-history__empty"},xO={key:4,class:"em-history__list"},$O=["onClick"],TO={class:"em-history__summary"},MO={class:"em-history__seq"},VO={class:"em-history__gmeta"},LO={class:"em-history__who"},BO={key:0,class:"em-history__time"},DO={key:1,class:"em-history__restored-from"},OO=["onClick"],PO={key:0,class:"em-history__detail"},zO={class:"em-history__action-head"},FO={class:"em-history__action-name"},UO={key:0,class:"em-history__fields"},HO={class:"em-history__fname"},jO={key:0,class:"em-history__old"},KO={class:"em-history__val"},GO={class:"em-history__preview"},YO=["disabled"],qO={key:0,class:"em-history__diff-list is-preview"},WO={class:"em-history__action-head"},JO={class:"em-history__action-name"},XO={key:0,class:"em-history__fields"},ZO={class:"em-history__fname"},QO={key:0,class:"em-history__old"},eP={class:"em-history__val"},tP={class:"em-history__confirm-row"},nP={class:"em-history__confirm-msg"},oP=["disabled","onClick"],iP=["disabled"],aP=["onClick"],il=50,rP=tt(t.defineComponent({__name:"HistoryPanel",props:{controller:{},open:{type:Boolean}},emits:["close","diffChange"],setup(e,{emit:n}){const o=e,i=n,a=o.controller,r=t.ref([]),l=t.ref(!1),s=t.ref(null),c=t.ref(!1),d=t.computed(()=>r.value.reduce((re,ve)=>ve.seq>re?ve.seq:re,-1/0));async function u(re){if(a.historyTransport){l.value=!0,s.value=null;try{const ve=!(re!=null&&re.full)&&r.value.length>0&&Number.isFinite(d.value),le=await a.historyTransport(ve?d.value:void 0);if(!ve)r.value=le;else if(le.length){const me=new Set(r.value.map(Ze=>Ze.seq)),ke=le.filter(Ze=>!me.has(Ze.seq));ke.length&&(r.value=[...r.value,...ke])}c.value=!0}catch(ve){s.value=ve instanceof Error?ve.message:a.t("em.history.loadError")}finally{l.value=!1}}}async function m(){await a.whenOpsSettled(),await u()}const f=t.ref(null),p=t.ref(null);t.watch(()=>o.open,re=>{re?m():(f.value=null,p.value=null)},{immediate:!0});let y=null;t.watch(()=>a.revision.value,()=>{o.open&&(y&&clearTimeout(y),y=setTimeout(()=>void m(),500))}),t.watch(()=>a.reloadRequest.value,()=>{o.open&&m()});const g=t.computed(()=>new Map(a.state.logical.entities.map(re=>[re.modelId,re]))),b=t.computed(()=>new Map(a.state.logical.associations.map(re=>[re.modelId,re]))),k=t.computed(()=>{const re=a.userLanguage.value;return new Map((a.state.logical.groups??[]).map(ve=>[ve.modelId,ve.packageName||Ct(ve.name,re)||ve.modelId]))}),_=t.computed(()=>new Map(a.state.layout.notes.map(re=>[re.modelId,re.memo]))),h=t.computed(()=>eO(r.value));function C(re){const ve=QD(_.value.get(re)??h.value.get(re));return a.t("em.history.noteSubject",{name:ve??re})}function v(re){var ke,Ze,ct,ft,qe,Rt,et;const ve=b.value.get(re);if(!ve)return a.t("em.history.assocFallback");if((ke=ve.description)!=null&&ke.trim())return ve.description.trim();const le=(ft=(ct=g.value.get((Ze=ve.end1)==null?void 0:Ze.entityRef))==null?void 0:ct.name)==null?void 0:ft.trim(),me=(et=(Rt=g.value.get((qe=ve.end2)==null?void 0:qe.entityRef))==null?void 0:Rt.name)==null?void 0:et.trim();return le&&me?`${le}→${me}`:a.t("em.history.assocFallback")}function S(re){var ve,le,me,ke;if(re.kind==="entity")return((le=(ve=g.value.get(re.ref))==null?void 0:ve.name)==null?void 0:le.trim())||a.t("em.attr.nameless");if(re.kind==="attribute"||re.kind==="operation"||re.kind==="index"){const Ze=re.entityRef?g.value.get(re.entityRef):void 0,ft=((re.kind==="attribute"?Ze==null?void 0:Ze.attributes:re.kind==="operation"?Ze==null?void 0:Ze.operations:Ze==null?void 0:Ze.indexes)??[]).find(Rt=>Rt.modelId===re.ref),qe=(me=Ze==null?void 0:Ze.name)==null?void 0:me.trim();return`${qe?qe+".":""}${((ke=ft==null?void 0:ft.name)==null?void 0:ke.trim())||re.ref}`}return re.kind==="association"?v(re.ref):re.kind==="associationEnd"?`${v(re.ref)}(${re.end})`:re.kind==="group"?a.t("em.history.groupSubject",{name:k.value.get(re.ref)??re.ref}):re.kind==="note"?C(re.ref):re.ref}const N={entity:"table",attribute:"field",operation:"method",index:"key",association:"link",associationEnd:"link",group:"folder",note:"note"},A={add:"em.history.verbAdd",update:"em.history.verbUpdate",remove:"em.history.verbRemove"},T=t.ref("all"),O=[{v:"all",labelKey:"em.history.filterAll"},{v:"edit",labelKey:"em.history.kindEdit"},{v:"restore",labelKey:"em.history.kindRestore"}],z=t.computed({get:()=>T.value,set:re=>{re&&(T.value=re)}}),P=t.computed(()=>ts(r.value)),D=t.computed(()=>P.value.length?P.value[0].seq:null),E=t.computed(()=>T.value==="all"?P.value:P.value.filter(re=>(re.kind??"edit")===T.value)),R=t.ref(il),I=t.ref(""),x=t.ref(""),$=t.computed(()=>!!I.value||!!x.value);function U(){I.value="",x.value=""}const F=t.computed(()=>{const re=I.value?new Date(`${I.value}T00:00:00`).getTime():null,ve=x.value?new Date(`${x.value}T23:59:59.999`).getTime():null;return re==null&&ve==null?E.value:E.value.filter(le=>{if(le.ts==null)return!1;const me=new Date(le.ts).getTime();return!(isNaN(me)||re!=null&&me<re||ve!=null&&me>ve)})}),B=t.computed(()=>F.value.slice(0,R.value)),j=t.computed(()=>Math.max(0,F.value.length-R.value));function X(){R.value+=il}t.watch([T,I,x],()=>{R.value=il}),t.watch(()=>o.open,re=>{re&&(R.value=il,U())});function W(re){return re===void 0?"—":re===null?a.t("em.history.emptyValue"):typeof re=="object"?JSON.stringify(re):String(re)}function oe(re){const ve=S(re.subject);if(re.verb==="add")return a.t("em.history.summaryAdd",{name:ve});if(re.verb==="remove")return a.t("em.history.summaryRemove",{name:ve});if(re.fields.length===1){const le=re.fields[0];return`${ve}.${le.field} ${le.oldValue!==void 0?W(le.oldValue)+"→":""}${W(le.value)}`}return a.t("em.history.summaryFields",{name:ve,n:re.fields.length})}function de(re){return re.actions.length===0?a.t("em.history.noChange"):re.actions.length===1?oe(re.actions[0]):a.t("em.history.summaryMore",{summary:oe(re.actions[0]),n:re.actions.length-1})}const ie=t.ref(new Set);function Ie(re){const ve=new Set(ie.value);ve.has(re)?ve.delete(re):ve.add(re),ie.value=ve}function Le(re){if(re==null)return"";const ve=new Date(re);return isNaN(ve.getTime())?String(re):ve.toLocaleString()}function Se(re){const ve=re.author,le=re.origin;return ve&&le?`${ve}(${le})`:ve||(le?`(${le})`:"—")}const ce=t.computed(()=>f.value==null?null:ns(r.value,{fromSeq:f.value,...p.value!=null?{toSeq:p.value}:{}}));t.watch(()=>ce.value?Iu(ce.value):null,re=>i("diffChange",re));function pe(re){f.value=re,p.value=null,Re.value=null}function he(){f.value=null,p.value=null}const V=t.computed(()=>P.value.map(re=>re.seq)),L=t.computed(()=>D.value??1/0),K=t.computed(()=>p.value??L.value),Z=t.computed(()=>p.value??L.value),Q=t.computed(()=>V.value.filter(re=>re<K.value).map(re=>({v:re}))),fe=t.computed(()=>V.value.filter(re=>f.value!=null&&re>f.value).map(re=>({v:re})));function be(re){re!=null&&(f.value=re,p.value!=null&&p.value<=re&&(p.value=null))}function Ee(re){re!=null&&(p.value=re>=L.value?null:re)}function Ne(re){return re>=L.value?a.t("em.history.diff.current"):`#${re}`}function J(re){return re.kind==="entity"?g.value.has(re.ref)?re.ref:null:(re.kind==="attribute"||re.kind==="operation"||re.kind==="index")&&re.entityRef?g.value.has(re.entityRef)?re.entityRef:null:re.kind==="group"?k.value.has(re.ref)?re.ref:null:re.kind==="note"&&_.value.has(re.ref)?re.ref:null}function ee(re){const ve=J(re);ve&&a.requestFocus(ve)}const te={added:"em.history.verbAdd",modified:"em.history.verbUpdate",removed:"em.history.verbRemove"},ge={added:"add",modified:"update",removed:"remove"},Re=t.ref(null),Pe=t.ref(!1),Me=t.computed(()=>Re.value==null?null:ns(r.value,{fromSeq:Re.value})),Qe=t.ref(!1);function Ot(re){Re.value=re,Qe.value=!1}async function ht(re){Pe.value=!0;try{const ve=await a.restoreToSeq(re);ve.ok?(f.value=null,p.value=null):s.value=a.t("em.history.restoreFailed",{reason:ve.reason??a.t("em.history.unknown")})}finally{Pe.value=!1,Re.value=null}}return(re,ve)=>(t.openBlock(),t.createBlock(t.Transition,{name:"em-history"},{default:t.withCtx(()=>{var le,me;return[t.withDirectives(t.createElementVNode("section",tO,[t.createElementVNode("header",nO,[t.createElementVNode("div",oO,[t.createVNode(xe,{name:"undo",size:15}),t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.history.title")),1)]),t.createElementVNode("div",iO,[t.createElementVNode("button",{type:"button",class:"em-history__btn",title:t.unref(a).t("em.history.refresh"),disabled:l.value,onClick:ve[0]||(ve[0]=ke=>u({full:!0}))},[t.createVNode(xe,{name:"redo",size:15})],8,aO),t.createElementVNode("button",{type:"button",class:"em-history__btn",title:t.unref(a).t("em.common.close"),onClick:ve[1]||(ve[1]=ke=>i("close"))},[t.createVNode(xe,{name:"panel-close",size:15})],8,rO)])]),t.createElementVNode("div",lO,[t.createElementVNode("label",sO,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.toolbar.displayLabel")),1),t.createVNode(t.unref(ne.BSSelect),{modelValue:z.value,"onUpdate:modelValue":ve[2]||(ve[2]=ke=>z.value=ke),items:O,"value-provider":ke=>ke.v,"label-provider":ke=>t.unref(a).t(ke.labelKey)},null,8,["modelValue","value-provider","label-provider"])])]),t.createElementVNode("div",cO,[t.createElementVNode("span",dO,t.toDisplayString(t.unref(a).t("em.history.periodLabel")),1),t.withDirectives(t.createElementVNode("input",{type:"date",class:"em-history__date",title:t.unref(a).t("em.history.periodFrom"),"aria-label":t.unref(a).t("em.history.periodFrom"),max:x.value||void 0,"onUpdate:modelValue":ve[3]||(ve[3]=ke=>I.value=ke)},null,8,uO),[[t.vModelText,I.value]]),ve[9]||(ve[9]=t.createElementVNode("span",{class:"em-history__period-sep"},"~",-1)),t.withDirectives(t.createElementVNode("input",{type:"date",class:"em-history__date",title:t.unref(a).t("em.history.periodTo"),"aria-label":t.unref(a).t("em.history.periodTo"),min:I.value||void 0,"onUpdate:modelValue":ve[4]||(ve[4]=ke=>x.value=ke)},null,8,mO),[[t.vModelText,x.value]]),$.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-history__period-reset",title:t.unref(a).t("em.history.periodReset"),onClick:U},[t.createVNode(xe,{name:"x",size:12})],8,fO)):t.createCommentVNode("",!0)]),f.value!=null?(t.openBlock(),t.createElementBlock("div",pO,[t.createElementVNode("div",hO,[t.createVNode(t.unref(ne.BSSelect),{class:"em-history__range-sel","model-value":f.value??void 0,items:Q.value,"value-provider":ke=>ke.v,"label-provider":ke=>`#${ke.v}`,"onUpdate:modelValue":ve[5]||(ve[5]=ke=>be(ke??null))},null,8,["model-value","items","value-provider","label-provider"]),t.createVNode(xe,{name:"arrow-lr",size:12,class:"em-history__diffbar-arrow"}),t.createVNode(t.unref(ne.BSSelect),{class:"em-history__range-sel","model-value":Z.value,items:fe.value,"value-provider":ke=>ke.v,"label-provider":ke=>Ne(ke.v),"onUpdate:modelValue":ve[6]||(ve[6]=ke=>Ee(ke??null))},null,8,["model-value","items","value-provider","label-provider"])]),t.createElementVNode("span",yO,t.toDisplayString(t.unref(a).t("em.history.diff.count",{n:((le=ce.value)==null?void 0:le.entries.length)??0})),1),t.createElementVNode("button",{type:"button",class:"em-history__diffbar-exit",onClick:he},t.toDisplayString(t.unref(a).t("em.history.diff.exit")),1)])):t.createCommentVNode("",!0),t.createElementVNode("div",gO,[f.value!=null?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[(me=ce.value)!=null&&me.entries.length?(t.openBlock(),t.createElementBlock("ul",kO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ce.value.entries,(ke,Ze)=>(t.openBlock(),t.createElementBlock("li",{key:Ze,class:t.normalizeClass(["em-history__diff-entry",{"is-focusable":!!J(ke.subject)}]),onClick:ct=>ee(ke.subject)},[t.createElementVNode("div",EO,[t.createVNode(xe,{name:N[ke.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",NO,t.toDisplayString(S(ke.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${ge[ke.verb]}`])},t.toDisplayString(t.unref(a).t(te[ke.verb])),3)]),ke.fields.length?(t.openBlock(),t.createElementBlock("ul",wO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ke.fields,(ct,ft)=>(t.openBlock(),t.createElementBlock("li",{key:ft,class:"em-history__field"},[t.createElementVNode("span",IO,t.toDisplayString(ct.field),1),ct.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",vO,t.toDisplayString(W(ct.oldValue)),1)):t.createCommentVNode("",!0),ct.oldValue!==void 0?(t.openBlock(),t.createBlock(xe,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",CO,t.toDisplayString(W(ct.value)),1)]))),128))])):t.createCommentVNode("",!0)],10,_O))),128))])):(t.openBlock(),t.createElementBlock("p",bO,t.toDisplayString(t.unref(a).t("em.history.diff.empty")),1))],64)):l.value&&!c.value?(t.openBlock(),t.createElementBlock("p",SO,t.toDisplayString(t.unref(a).t("em.history.loading")),1)):s.value?(t.openBlock(),t.createElementBlock("p",RO,t.toDisplayString(s.value),1)):F.value.length===0?(t.openBlock(),t.createElementBlock("p",AO,t.toDisplayString(c.value?t.unref(a).t("em.history.emptyLoaded"):t.unref(a).t("em.history.emptyNotLoaded")),1)):(t.openBlock(),t.createElementBlock("ul",xO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(B.value,ke=>{var Ze,ct,ft;return t.openBlock(),t.createElementBlock("li",{key:ke.seq,class:t.normalizeClass(["em-history__group",[`is-${ke.kind??"edit"}`]])},[t.createElementVNode("div",{class:"em-history__ghead",onClick:qe=>Ie(ke.seq)},[t.createVNode(xe,{name:"chevron",size:13,class:t.normalizeClass(["em-history__chevron",{"is-open":ie.value.has(ke.seq)}])},null,8,["class"]),t.createElementVNode("span",{class:t.normalizeClass(["em-history__kind",`is-${ke.kind??"edit"}`])},t.toDisplayString(t.unref(a).t(ke.kind==="restore"?"em.history.kindRestore":"em.history.kindEdit")),3),t.createElementVNode("span",TO,t.toDisplayString(de(ke)),1),t.createElementVNode("span",MO,"#"+t.toDisplayString(ke.seq),1)],8,$O),t.createElementVNode("div",VO,[t.createElementVNode("span",LO,t.toDisplayString(Se(ke)),1),ke.ts?(t.openBlock(),t.createElementBlock("span",BO,t.toDisplayString(Le(ke.ts)),1)):t.createCommentVNode("",!0),ke.kind==="restore"&&ke.restoredFromSeq!=null?(t.openBlock(),t.createElementBlock("span",DO,"← #"+t.toDisplayString(ke.restoredFromSeq),1)):t.createCommentVNode("",!0),ke.seq!==D.value?(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:"em-history__compare-btn",onClick:t.withModifiers(qe=>pe(ke.seq),["stop"])},t.toDisplayString(t.unref(a).t("em.history.diff.compare")),9,OO)):t.createCommentVNode("",!0)]),ie.value.has(ke.seq)?(t.openBlock(),t.createElementBlock("div",PO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ke.actions,(qe,Rt)=>(t.openBlock(),t.createElementBlock("div",{key:Rt,class:"em-history__action"},[t.createElementVNode("div",zO,[t.createVNode(xe,{name:N[qe.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",FO,t.toDisplayString(S(qe.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${qe.verb}`])},t.toDisplayString(t.unref(a).t(A[qe.verb])),3)]),qe.fields.length?(t.openBlock(),t.createElementBlock("ul",UO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(qe.fields,(et,jt)=>(t.openBlock(),t.createElementBlock("li",{key:jt,class:"em-history__field"},[t.createElementVNode("span",HO,t.toDisplayString(et.field),1),et.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",jO,t.toDisplayString(W(et.oldValue)),1)):t.createCommentVNode("",!0),et.oldValue!==void 0?(t.openBlock(),t.createBlock(xe,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",KO,t.toDisplayString(W(et.value)),1)]))),128))])):t.createCommentVNode("",!0)]))),128))])):t.createCommentVNode("",!0),t.unref(a).restoreAvailable.value&&ke.seq!==D.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["em-history__restore",{"is-confirming":Re.value===ke.seq}])},[Re.value===ke.seq?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",GO,[t.createElementVNode("button",{type:"button",class:"em-history__preview-toggle",disabled:!((Ze=Me.value)!=null&&Ze.entries.length),onClick:ve[7]||(ve[7]=qe=>Qe.value=!Qe.value)},[t.createVNode(xe,{name:"chevron",size:11,class:t.normalizeClass(["em-history__chevron",{"is-open":Qe.value}])},null,8,["class"]),t.createTextVNode(" "+t.toDisplayString((ct=Me.value)!=null&&ct.entries.length?t.unref(a).t("em.history.diff.restorePreview",{n:Me.value.entries.length}):t.unref(a).t("em.history.diff.restorePreviewNone")),1)],8,YO),Qe.value&&((ft=Me.value)!=null&&ft.entries.length)?(t.openBlock(),t.createElementBlock("ul",qO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Me.value.entries,(qe,Rt)=>(t.openBlock(),t.createElementBlock("li",{key:Rt,class:"em-history__diff-entry"},[t.createElementVNode("div",WO,[t.createVNode(xe,{name:N[qe.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",JO,t.toDisplayString(S(qe.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${ge[qe.verb]}`])},t.toDisplayString(t.unref(a).t(te[qe.verb])),3)]),qe.fields.length?(t.openBlock(),t.createElementBlock("ul",XO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(qe.fields,(et,jt)=>(t.openBlock(),t.createElementBlock("li",{key:jt,class:"em-history__field"},[t.createElementVNode("span",ZO,t.toDisplayString(et.field),1),et.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",QO,t.toDisplayString(W(et.oldValue)),1)):t.createCommentVNode("",!0),et.oldValue!==void 0?(t.openBlock(),t.createBlock(xe,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",eP,t.toDisplayString(W(et.value)),1)]))),128))])):t.createCommentVNode("",!0)]))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("div",tP,[t.createElementVNode("span",nP,t.toDisplayString(t.unref(a).t("em.history.confirmRestore")),1),t.createElementVNode("button",{type:"button",class:"em-history__confirm-yes",disabled:Pe.value,onClick:qe=>ht(ke.seq)},t.toDisplayString(t.unref(a).t("em.history.doRestore")),9,oP),t.createElementVNode("button",{type:"button",class:"em-history__confirm-no",disabled:Pe.value,onClick:ve[8]||(ve[8]=qe=>Re.value=null)},t.toDisplayString(t.unref(a).t("em.history.cancel")),9,iP)])],64)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:"em-history__restore-btn",onClick:qe=>Ot(ke.seq)},[t.createVNode(xe,{name:"undo",size:12}),t.createTextVNode(" "+t.toDisplayString(t.unref(a).t("em.history.restoreToHere")),1)],8,aP))],2)):t.createCommentVNode("",!0)],2)}),128))])),f.value==null&&j.value>0?(t.openBlock(),t.createElementBlock("button",{key:5,type:"button",class:"em-history__load-more",onClick:X},t.toDisplayString(t.unref(a).t("em.history.loadMore",{n:j.value})),1)):t.createCommentVNode("",!0)])],512),[[t.vShow,e.open]])]}),_:1}))}}),[["__scopeId","data-v-9f624c61"]]);function lP(e,n){if(!e||typeof window>"u"||!window.localStorage)return null;const o=window.localStorage.getItem(e),i=o==null?NaN:Number(o);return Number.isFinite(i)&&i>=n?i:null}function dg(e){const n=t.ref(lP(e.storageKey,e.min)??e.initial),o=t.ref(!1);function i(a){a.preventDefault();const r=a.clientX,l=n.value;o.value=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none";const s=d=>{const u=e.edge==="left"?r-d.clientX:d.clientX-r;let m=l+u;m=Math.max(e.min,m),e.max!=null&&(m=Math.min(e.max,m)),n.value=m},c=()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",c),document.body.style.cursor="",document.body.style.userSelect="",o.value=!1,e.storageKey&&typeof window<"u"&&window.localStorage&&window.localStorage.setItem(e.storageKey,String(n.value))};window.addEventListener("pointermove",s),window.addEventListener("pointerup",c)}return{width:n,dragging:o,startResize:i}}const sP={class:"em-modeler"},cP={class:"em-modeler__body"},dP={class:"em-drawer__inner"},uP={class:"em-drawer__head"},mP={class:"em-drawer__actions"},fP=["title"],pP=["title"],hP=["title"],yP=["title"],gP=["title"],bP=tt(t.defineComponent({__name:"EntityModeler",props:{controller:{}},setup(e){const n=t.ref(!0),o=t.ref(!0),i=t.ref(null),a=t.ref(null),r=t.ref(null),l=t.ref(null);function s(C){t.nextTick(()=>{const v=C();v&&("focusCollapse"in v?v.focusCollapse():v.focus())})}function c(C){n.value=C,s(()=>C?i.value:a.value)}function d(C){o.value=C,s(()=>C?l.value:r.value)}const u=t.ref(!1),m=t.shallowRef(null),{width:f,dragging:p,startResize:y}=dg({initial:260,min:260,max:560,edge:"right",storageKey:"em.explorerWidth"}),{width:g,dragging:b,startResize:k}=dg({initial:320,min:320,max:640,edge:"left",storageKey:"em.panelWidth"}),_=t.ref(null),h=t.ref(null);return(C,v)=>{var S,N,A;return t.openBlock(),t.createElementBlock("div",sP,[t.createVNode(sg,{controller:e.controller,"history-open":u.value,onExportSvg:v[0]||(v[0]=T=>{var O;return(O=_.value)==null?void 0:O.exportSvg()}),onExportPng:v[1]||(v[1]=T=>{var O;return(O=_.value)==null?void 0:O.exportPng()}),onFitView:v[2]||(v[2]=T=>{var O;return(O=_.value)==null?void 0:O.fitView()}),onToggleHistory:v[3]||(v[3]=T=>u.value=!u.value)},null,8,["controller","history-open"]),t.createElementVNode("div",cP,[t.createElementVNode("aside",{class:t.normalizeClass(["em-drawer",{"is-collapsed":!n.value}]),style:t.normalizeStyle({width:t.unref(f)+"px"})},[t.createElementVNode("div",dP,[t.createElementVNode("header",uP,[v[12]||(v[12]=t.createElementVNode("span",null,"Diagram Explorer",-1)),t.createElementVNode("div",mP,[(S=h.value)!=null&&S.hasExpandable?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-drawer__btn",title:e.controller.t((N=h.value)!=null&&N.allExpanded?"em.panel.collapseAll":"em.panel.expandAll"),onClick:v[4]||(v[4]=T=>{var O;return(O=h.value)==null?void 0:O.toggleAll()})},[t.createVNode(xe,{name:(A=h.value)!=null&&A.allExpanded?"collapse-all":"expand-all",size:16},null,8,["name"])],8,fP)):t.createCommentVNode("",!0),t.createElementVNode("button",{ref_key:"explorerCollapseBtn",ref:i,type:"button",class:"em-drawer__btn",title:e.controller.t("em.panel.collapse"),onClick:v[5]||(v[5]=T=>c(!1))},[t.createVNode(xe,{name:"panel-close",size:16})],8,pP)])]),t.createVNode(lg,{ref_key:"explorer",ref:h,controller:e.controller,"storage-key":"em.explorerCollapsed"},null,8,["controller"])]),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(["em-resize-handle em-resize-handle--right",{"is-dragging":t.unref(p)}]),title:e.controller.t("em.panel.resizeWidth"),onPointerdown:v[6]||(v[6]=(...T)=>t.unref(y)&&t.unref(y)(...T))},null,42,hP),[[t.vShow,n.value]])],6),t.createVNode(t.Transition,{name:"em-reopen"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("button",{type:"button",ref_key:"explorerReopenBtn",ref:a,class:"em-drawer__reopen",title:e.controller.t("em.panel.openNamed",{name:"Diagram Explorer"}),onClick:v[7]||(v[7]=T=>c(!0))},[t.createVNode(xe,{name:"panel-open",size:18})],8,yP),[[t.vShow,!n.value]])]),_:1}),t.createElementVNode("div",{class:t.normalizeClass(["em-modeler__canvas",{"is-drawer-open":n.value,"is-resizing":t.unref(p),"is-inspector-collapsed":!o.value}]),style:t.normalizeStyle({"--em-drawer-shift":t.unref(f)-6+"px"})},[t.createVNode(rg,{ref_key:"canvas",ref:_,controller:e.controller,"diff-marks":m.value,"embed-collapse-storage-key":"em.embedCollapsed"},null,8,["controller","diff-marks"])],6),t.withDirectives(t.createVNode(cg,{ref_key:"inspectorRef",ref:l,controller:e.controller,width:t.unref(g),resizing:t.unref(b),"start-resize":t.unref(k),onCollapse:v[8]||(v[8]=T=>d(!1))},null,8,["controller","width","resizing","start-resize"]),[[t.vShow,o.value]]),t.createVNode(t.Transition,{name:"em-reopen"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("button",{type:"button",ref_key:"inspectorReopenBtn",ref:r,class:"em-panel__reopen",title:e.controller.t("em.panel.openNamed",{name:"Inspector"}),onClick:v[9]||(v[9]=T=>d(!0))},[t.createVNode(xe,{name:"panel-right-open",size:18})],8,gP),[[t.vShow,!o.value]])]),_:1}),t.createVNode(rP,{controller:e.controller,open:u.value,onClose:v[10]||(v[10]=T=>u.value=!1),onDiffChange:v[11]||(v[11]=T=>m.value=T)},null,8,["controller","open"])]),t.createVNode(XD,{controller:e.controller,"panel-width":t.unref(g),"inspector-open":o.value},null,8,["controller","panel-width","inspector-open"])])}}}),[["__scopeId","data-v-b162af97"]]);ye.APPLY_MODEL_OPS_INPUT_SCHEMA=rE,ye.AssociationEdge=iy,ye.CUSTOM_TYPE_VALUE=pn,ye.CommandStack=os,ye.DEFAULT_JAVA_TYPE=bl,ye.DIAGRAM_JSON_FORMAT=$l,ye.DIAGRAM_JSON_VERSION=Tl,ye.DiagramCanvas=rg,ye.DiagramExplorer=lg,ye.EDITOR=io,ye.EditModeToggle=LL,ye.EditorToolbar=sg,ye.EntityModeler=bP,ye.EntityNode=Oh,ye.GROUP_CODE_ENUM_VALUE=An,ye.GroupNode=Ph,ye.INHERITED_REF_PREFIX=ya,ye.InvalidDiagramJsonError=go,ye.JAVA_TYPES=Ni,ye.LIB_VERSION=wk,ye.NoteNode=zh,ye.OpSyncAdapter=hm,ye.PHYSICAL_NAME_MAX_LENGTH=Si,ye.PropertyPanel=cg,ye.RevCache=pm,ye.SELECTABLE_JAVA_TYPES=md,ye.SYMBOLIC_OP_KINDS=ym,ye.SYMBOLIC_OP_SCHEMA=Qm,ye.UI_LOCALES=xC,ye.applyDocumentReferenceOnly=fl,ye.buildAgentBatch=lE,ye.buildDiagramSvg=Vc,ye.buildDiffMarks=Iu,ye.collectSharedColumns=Rn,ye.commands=Wk,ye.computeAutoLayout=Pc,ye.createEditorController=hA,ye.dedupeModelIds=Ek,ye.defaultMermaidDialect=Dg,ye.defaultSqlDialect=cb,ye.diagramToJson=Fd,ye.displayLabel=_a,ye.emptyState=vh,ye.entityModelToDdl=Dd,ye.entityModelToMermaid=Il,ye.entityModelToText=_d,ye.exportDiagramPng=ig,ye.exportDiagramSvg=og,ye.fromPersisted=uf,ye.isGeneratable=ou,ye.isInheritedColumnRef=co,ye.isValueTypeStereotype=lt,ye.javaTypeLabel=Yo,ye.makeInheritedColumnRef=Hc,ye.mergeDiagram=bu,ye.mermaidErToImportSource=Rd,ye.migrateLegacyMoney=_k,ye.multiplicityLabel=wa,ye.newId=Fe,ye.packEntityBoxes=rl,ye.parseDiagramJson=Ud,ye.parseInheritedColumnRef=ll,ye.parseMermaidEr=Sd,ye.parseSqlDdl=Sl,ye.planHealBackfillOps=FE,ye.projectActionLog=ts,ye.projectEntityAudit=Nu,ye.projectFieldAudit=Tn,ye.projectInheritedColumns=bi,ye.projectSeqDiff=ns,ye.renderDiagramSvg=jd,ye.resolveColumnPhysicalName=_i,ye.resolveDiagram=Dc,ye.resolveEffectiveColumn=Lt,ye.resolveQuickFix=Ol,ye.resolveSharedColumn=fo,ye.resolveSymbolicOps=O_,ye.restoreDeepEqual=_o,ye.scaffoldEntityJava=Gb,ye.sharedColumnScopeEntities=pl,ye.sqlDdlToImportSource=Bd,ye.stereotypeLabel=gi,ye.synthesizeRestoreOps=Vk,ye.toPersisted=OE,ye.toPersistedV2=PE,ye.translate=cn,ye.uiMessagesEn=hh,ye.uiMessagesJa=yh,ye.uiMessagesKo=gh,ye.validateModel=Aa,Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"})}));
|
|
72
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);t.watchEffect($=>{if(g.value){const U=ao(g.value),F=X=>{if(X.sourceEvent.type!=="wheel"||!f.value||!p.value)return;const W=X.sourceEvent.ctrlKey&&ea()?10:1,oe=-X.sourceEvent.deltaY*(X.sourceEvent.deltaMode===1?.05:X.sourceEvent.deltaMode?1:.002)*e.zoomStep,de=c.value.zoom*2**(oe*W);p.value.scaleTo(f.value,de)},B=X=>{if(X.sourceEvent.type!=="mousemove"||!f.value||!p.value)return;const W=T.value*Math.max(1,c.value.zoom)*(e.inversePan?-1:1),oe={x:c.value.x-X.sourceEvent.movementX*W,y:c.value.y-X.sourceEvent.movementY*W},de=[[0,0],[u.value.width,u.value.height]],ie=Ac.translate(oe.x,oe.y).scale(c.value.zoom),Ie=p.value.constrain()(ie,de,d.value);p.value.transform(f.value,Ie)},j=M2().wheelDelta(X=>zs(X)*(e.zoomStep/10)).on("zoom",e.pannable?B:()=>{}).on("zoom.wheel",e.zoomable?F:()=>{});U.call(j),$(()=>{U.on("zoom",null)})}},{flush:"post"});function P($){const[U,F]=ro($);n("click",{event:$,position:{x:U,y:F}})}function D($,U){const F={event:$,node:U,connectedEdges:Mo([U],s.value)};m.miniMapNodeClick(F),n("nodeClick",F)}function E($,U){const F={event:$,node:U,connectedEdges:Mo([U],s.value)};m.miniMapNodeDoubleClick(F),n("nodeDblclick",F)}function R($,U){const F={event:$,node:U,connectedEdges:Mo([U],s.value)};m.miniMapNodeMouseEnter(F),n("nodeMouseenter",F)}function I($,U){const F={event:$,node:U,connectedEdges:Mo([U],s.value)};m.miniMapNodeMouseMove(F),n("nodeMousemove",F)}function x($,U){const F={event:$,node:U,connectedEdges:Mo([U],s.value)};m.miniMapNodeMouseLeave(F),n("nodeMouseleave",F)}return($,U)=>(t.openBlock(),t.createBlock(t.unref(ch),{position:$.position,class:t.normalizeClass(["vue-flow__minimap",{pannable:$.pannable,zoomable:$.zoomable}])},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{ref_key:"el",ref:g,width:b.value,height:k.value,viewBox:[O.value.x,O.value.y,O.value.width,O.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${t.unref(l)}`,onClick:P},[$.ariaLabel?(t.openBlock(),t.createElementBlock("title",{key:0,id:`vue-flow__minimap-${t.unref(l)}`},t.toDisplayString($.ariaLabel),9,O2)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(y),F=>(t.openBlock(),t.createBlock(B2,{id:F.id,key:F.id,f:"",position:F.computedPosition,dimensions:F.dimensions,selected:F.selected,dragging:F.dragging,style:t.normalizeStyle(F.style),class:t.normalizeClass(v.value(F)),color:h.value(F),"border-radius":$.nodeBorderRadius,"stroke-color":C.value(F),"stroke-width":$.nodeStrokeWidth,"shape-rendering":t.unref(_),type:F.type,hidden:F.hidden,onClick:B=>D(B,F),onDblclick:B=>E(B,F),onMouseenter:B=>R(B,F),onMousemove:B=>I(B,F),onMouseleave:B=>x(B,F)},null,8,["id","position","dimensions","selected","dragging","style","class","color","border-radius","stroke-color","stroke-width","shape-rendering","type","hidden","onClick","onDblclick","onMouseenter","onMousemove","onMouseleave"]))),128)),t.createElementVNode("path",{class:"vue-flow__minimap-mask",d:z.value,fill:$.maskColor,stroke:$.maskStrokeColor,"stroke-width":$.maskStrokeWidth,"fill-rule":"evenodd"},null,8,P2)],8,D2))]),_:1},8,["position","class"]))}}),U2=["d"],H2=["cx","cy","onDblclick"],j2=["x","y","onPointerdown","onDblclick"],K2=tt(t.defineComponent({inheritAttrs:!1,__name:"NoteConnectionEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,{screenToFlowCoordinate:o}=ot(),i=t.inject(dc),a=t.inject(io,null),r=t.computed(()=>!!a&&a.editable.value),l=t.inject(Oo,null),s=t.computed(()=>!!l&&l.active.value&&(!l.relatedEntityIds.value.has(n.data.targetRef)||!l.relatedNoteIds.value.has(n.data.noteRef))),c=t.computed(()=>(i==null?void 0:i.points(n.id))??[]),d=t.ref(-1),u=t.ref({x:0,y:0}),m=t.computed(()=>c.value.map((A,T)=>T===d.value?u.value:A)),{source:f,target:p,sourceSide:y,targetSide:g}=cc({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>m.value}),b=t.computed(()=>(a==null?void 0:a.routingMode.value)==="orthogonal"?rc(f.value,y.value,m.value,p.value,g.value):lc(f.value,m.value,p.value)),k=t.computed(()=>r.value?(a==null?void 0:a.routingMode.value)==="orthogonal"?Uh(f.value,y.value,m.value,p.value,g.value):Kh(f.value,m.value,p.value).map((A,T)=>({point:A,segIndex:T})):[]),_=t.computed(()=>r.value?m.value:[]);function h(A,T){d.value=A,u.value={...c.value[A]},T.target.setPointerCapture(T.pointerId),T.stopPropagation()}function C(A){if(d.value<0)return;const T=o({x:A.clientX,y:A.clientY});u.value={x:T.x,y:T.y}}function v(A){var T,O;d.value>=0&&i&&i.movePoint(n.id,d.value,{...u.value}),d.value=-1,(O=(T=A.target).releasePointerCapture)==null||O.call(T,A.pointerId)}function S(A,T){T.stopPropagation(),i==null||i.removePoint(n.id,A)}function N(A,T){if(!i)return;const O=o({x:T.clientX,y:T.clientY});i.insertPoint(n.id,A,{x:O.x,y:O.y})}return(A,T)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("path",{d:b.value,fill:"none","stroke-width":"1.5","stroke-dasharray":"6 4",class:t.normalizeClass(["em-note-edge__path",{"is-dimmed":s.value}])},null,10,U2),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.value,(O,z)=>(t.openBlock(),t.createElementBlock("circle",{key:`mid-${z}`,cx:O.point.x,cy:O.point.y,r:"4",class:t.normalizeClass(["em-note-edge__mid",{"is-dimmed":s.value}]),onDblclick:t.withModifiers(P=>N(O.segIndex,P),["stop"])},null,42,H2))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(O,z)=>(t.openBlock(),t.createElementBlock("rect",{key:`wp-${z}`,x:O.x-5,y:O.y-5,width:"10",height:"10",rx:"2",class:t.normalizeClass(["em-note-edge__waypoint",{"is-dimmed":s.value}]),onPointerdown:P=>h(z,P),onPointermove:C,onPointerup:v,onDblclick:P=>S(z,P)},null,42,j2))),128))],64))}}),[["__scopeId","data-v-8515def1"]]),G2=["d"],Y2=tt(t.defineComponent({inheritAttrs:!1,__name:"SerializedTypeEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,o=t.inject(io,null),i=t.inject(Oo,null),a=t.computed(()=>!!i&&i.active.value&&(!i.relatedEntityIds.value.has(n.data.consumerRef)||!i.relatedEntityIds.value.has(n.data.typeRef))),{source:r,target:l,sourceSide:s,targetSide:c}=cc({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>[]}),d=t.computed(()=>(o==null?void 0:o.routingMode.value)==="orthogonal"?rc(r.value,s.value,[],l.value,c.value):lc(r.value,[],l.value));return(u,m)=>(t.openBlock(),t.createElementBlock("path",{d:d.value,fill:"none","stroke-width":"1.5","stroke-dasharray":"2 5","stroke-linecap":"round",class:t.normalizeClass(["em-serialized-edge__path",{"is-dimmed":a.value}])},null,10,G2))}}),[["__scopeId","data-v-67430658"]]),q2=["data-theme"],W2={key:0,class:"em-ctx__sep",role:"separator"},J2=["aria-label"],X2={class:"em-ctx__swatches-label","aria-hidden":"true"},Z2={class:"em-ctx__chips",role:"none"},Q2=["aria-checked","aria-label","title","onClick"],eV=["aria-checked","aria-label","title","onClick"],tV=["disabled","onClick"],nV={class:"em-ctx__icon"},oV={class:"em-ctx__caption"},iV=tt(t.defineComponent({__name:"EmContextMenu",props:{locale:{}},setup(e,{expose:n}){const o=e,i=(h,C)=>cn(o.locale??"ko",h,C),a=t.ref(!1),r=t.ref([]),l=t.ref(void 0),s=t.ref(null),c=t.reactive({x:0,y:0});let d=null;const u=8;async function m(h,C){var N,A;r.value=C,l.value=(N=h.target)!=null&&N.closest('[data-theme="dark"]')?"dark":void 0,d=document.activeElement,c.x=h.clientX,c.y=h.clientY,a.value=!0,window.addEventListener("keydown",b),window.addEventListener("resize",f),await t.nextTick();const v=s.value;if(!v)return;const S=v.getBoundingClientRect();c.x+S.width>window.innerWidth-u&&(c.x=Math.max(u,window.innerWidth-u-S.width)),c.y+S.height>window.innerHeight-u&&(c.y=Math.max(u,window.innerHeight-u-S.height)),(A=p()[0])==null||A.focus()}function f(){if(!a.value)return;a.value=!1,r.value=[],window.removeEventListener("keydown",b),window.removeEventListener("resize",f);const h=d;d=null,h!=null&&h.isConnected&&h.focus()}function p(){const h=s.value;if(!h)return[];const C=[];for(const v of Array.from(h.children))if(v.classList.contains("em-ctx__item"))v.disabled||C.push(v);else if(v.classList.contains("em-ctx__swatches")){const S=Array.from(v.querySelectorAll(".em-ctx__chip"));S.length&&C.push(S.find(N=>N===document.activeElement)??S[0])}return C}function y(h){var N;const C=p();if(!C.length)return;const v=C.indexOf(document.activeElement),S=v<0?h>0?0:C.length-1:(v+h+C.length)%C.length;(N=C[S])==null||N.focus()}function g(h){var N,A;const C=(N=document.activeElement)==null?void 0:N.closest(".em-ctx__swatches");if(!C)return!1;const v=Array.from(C.querySelectorAll(".em-ctx__chip")),S=v.indexOf(document.activeElement);return S<0?!1:((A=v[(S+h+v.length)%v.length])==null||A.focus(),!0)}function b(h){var C,v;switch(h.key){case"Escape":h.stopPropagation(),f();return;case"ArrowDown":h.preventDefault(),y(1);return;case"ArrowUp":h.preventDefault(),y(-1);return;case"ArrowRight":g(1)&&h.preventDefault();return;case"ArrowLeft":g(-1)&&h.preventDefault();return;case"Home":h.preventDefault(),(C=p()[0])==null||C.focus();return;case"End":{h.preventDefault();const S=p();(v=S[S.length-1])==null||v.focus();return}case"Tab":h.preventDefault(),y(h.shiftKey?-1:1)}}function k(h){h.disabled||(h.handler(),f())}function _(h,C){h.onPick(C),f()}return t.onBeforeUnmount(f),n({open:m,close:f}),(h,C)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[a.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-ctx-layer","data-theme":l.value},[t.createElementVNode("div",{class:"em-ctx__scrim",onPointerdown:f,onContextmenu:t.withModifiers(f,["prevent"])},null,32),t.createElementVNode("div",{ref_key:"menuEl",ref:s,class:"em-ctx",style:t.normalizeStyle({left:c.x+"px",top:c.y+"px"}),role:"menu",onContextmenu:C[0]||(C[0]=t.withModifiers(()=>{},["prevent"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,(v,S)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:S},[v.type==="separator"?(t.openBlock(),t.createElementBlock("div",W2)):v.type==="swatches"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"em-ctx__swatches",role:"group","aria-label":v.caption},[t.createElementVNode("span",X2,t.toDisplayString(v.caption),1),t.createElementVNode("div",Z2,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-ctx__chip em-ctx__chip--none",{"is-on":v.current===null}]),role:"menuitemradio","aria-checked":v.current===null,"aria-label":i("em.swatch.none"),title:i("em.swatch.none"),onClick:N=>_(v,null)},null,10,Q2),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),N=>(t.openBlock(),t.createElementBlock("button",{key:N,type:"button",class:t.normalizeClass(["em-ctx__chip",{"is-on":v.current===N}]),style:t.normalizeStyle({background:t.unref(di)(N)}),role:"menuitemradio","aria-checked":v.current===N,"aria-label":i(t.unref(Bo)(N)),title:i(t.unref(Bo)(N)),onClick:A=>_(v,N)},null,14,eV))),128))])],8,J2)):(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:t.normalizeClass(["em-ctx__item",{"is-danger":v.danger,"is-disabled":v.disabled}]),disabled:v.disabled,role:"menuitem",onClick:N=>k(v)},[t.createElementVNode("span",nV,[v.icon?(t.openBlock(),t.createBlock(xe,{key:0,name:v.icon,size:15},null,8,["name"])):t.createCommentVNode("",!0)]),t.createElementVNode("span",oV,t.toDisplayString(v.caption),1)],10,tV))],64))),128))],36)],8,q2)):t.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-2f05239a"]]);function $c(e,n){return`serialized:${e}:${n}`}function Xy(e){const n=Go(e);if(n.size===0)return[];const o=new Map;for(const i of e.entities)for(const a of i.attributes){if(a.attrType!=="NORMAL")continue;const r=Ei(a,n,i,e);if(r.kind!=="resolved")continue;const l=r.entity;if(l.modelId===i.modelId)continue;const s=$c(i.modelId,l.modelId),c=o.get(s);c?c.usageCount++:o.set(s,{consumerRef:i.modelId,typeRef:l.modelId,usageCount:1})}return[...o.values()]}function Zy(e,n){return n?`${e}:${n}`:e}function Qy(e,n){var o;if(!e||typeof window>"u")return{};try{const i=(o=window.sessionStorage)==null?void 0:o.getItem(Zy(e,n));if(!i)return{};const a=JSON.parse(i);if(!a||typeof a!="object"||Array.isArray(a))return{};const r={};for(const[l,s]of Object.entries(a))typeof s=="boolean"&&(r[l]=s);return r}catch{return{}}}function aV(e,n,o){var i,a;if(!(!e||typeof window>"u"))try{const r=Zy(e,n);Object.keys(o).length?(a=window.sessionStorage)==null||a.setItem(r,JSON.stringify(o)):(i=window.sessionStorage)==null||i.removeItem(r)}catch{}}function eg(e){const n=()=>{var s;return(s=e.scope)==null?void 0:s.call(e)},o=t.ref(Qy(e.storageKey,n()));e.scope&&t.watch(()=>e.scope(),s=>o.value=Qy(e.storageKey,s)),t.watch(o,s=>aV(e.storageKey,n(),s),{deep:!0});const i=s=>o.value[s]??e.defaultCollapsed(s);function a(s){o.value={...o.value,[s]:!i(s)}}const r=t.computed(()=>!e.expandableKeys().some(s=>i(s)));function l(){const s=r.value,c={...o.value};for(const d of e.expandableKeys())c[d]=s;o.value=c}return{isCollapsed:i,toggle:a,toggleAll:l,allExpanded:r}}const Tc=[".em-entity__grip",".em-entity__add",".em-entity__footer",".em-sel",".em-handle",".em-note-handle",".vue-flow__handle",".em-group__resize",".em-note__resize",".em-edge__waypoint",".em-edge__mid",".em-note-edge__waypoint",".em-note-edge__mid"].join(",");function hi(e){const n=getComputedStyle(e);return!(n.display==="none"||n.visibility==="hidden"||parseFloat(n.opacity)===0)}function rV(e){return e.childElementCount>0?!1:(e.textContent??"").trim().length>0}function lV(e,n){const o=getComputedStyle(e),i={fill:o.color,fontSize:parseFloat(o.fontSize),fontFamily:o.fontFamily,fontWeight:o.fontWeight,fontStyle:o.fontStyle},a=document.createRange();a.selectNodeContents(e);const r=e.firstChild,l=a.getClientRects();if(!r||r.nodeType!==3||l.length<=1){const y=l.length?a.getBoundingClientRect():e.getBoundingClientRect();if(y.width===0&&y.height===0)return[];const g=n(y.left,y.top+y.height/2);return[{...i,x:g.x,y:g.y,text:(e.textContent??"").trim()}]}const s=r.textContent??"",c=[];let d="",u=null,m=0,f=0;const p=()=>{const y=d.trim();if(y){const g=n(m,(u+f)/2);c.push({...i,x:g.x,y:g.y,text:y})}d=""};for(let y=0;y<s.length;y++){a.setStart(r,y),a.setEnd(r,y+1);const g=a.getBoundingClientRect();u===null||Math.abs(g.top-u)>1?(p(),u=g.top,m=g.left,f=g.bottom,d=s[y]):(d+=s[y],f=Math.max(f,g.bottom))}return p(),c}function ol(e,n){const o=[];for(const i of e.querySelectorAll("*"))rV(i)&&(i.closest(Tc)||hi(i)&&o.push(...lV(i,n)));return o}function ma(e){return Math.round(e*100)/100}function sV(e,n){const o=[];for(const i of e.querySelectorAll("svg.em-icon")){if(i.closest(Tc)||!hi(i))continue;const a=i.getBoundingClientRect();if(a.width===0||a.height===0)continue;const r=n(a.left,a.top),l=n(a.right,a.bottom),s=getComputedStyle(i),c=i.getAttribute("viewBox")??"0 0 24 24",d=parseFloat(s.strokeWidth)||1.75;o.push(`<svg x="${ma(r.x)}" y="${ma(r.y)}" width="${ma(l.x-r.x)}" height="${ma(l.y-r.y)}" viewBox="${c}" fill="none" stroke="${s.color}" stroke-width="${d}" stroke-linecap="round" stroke-linejoin="round">${i.innerHTML}</svg>`)}return o}function cV(e){const n=[];for(const o of e.querySelectorAll(".em-edge__marker")){if(!hi(o))continue;const i=getComputedStyle(o),a=i.stroke,r=parseFloat(i.strokeWidth)||1.5,l=i.fill&&i.fill!=="none"?i.fill:"none",s=o.tagName.toLowerCase(),c=d=>ma(parseFloat(o.getAttribute(d)??"0"));s==="line"?n.push(`<line x1="${c("x1")}" y1="${c("y1")}" x2="${c("x2")}" y2="${c("y2")}" stroke="${a}" stroke-width="${r}" stroke-linecap="round" />`):s==="circle"?n.push(`<circle cx="${c("cx")}" cy="${c("cy")}" r="${c("r")}" fill="none" stroke="${a}" stroke-width="${r}" />`):s==="path"&&n.push(`<path d="${o.getAttribute("d")}" fill="${l}" stroke="${a}" stroke-width="${r}" stroke-linejoin="round" />`)}return n}function tg(e,n,o){const i=[];for(const a of e.querySelectorAll("*")){if(a===n||a.closest(Tc)||!hi(a))continue;const r=getComputedStyle(a),l=parseFloat(r.borderTopWidth);if(!l)continue;const s=a.getBoundingClientRect();if(s.width===0)continue;const c=o(s.left,s.top),d=o(s.right,s.top);i.push({x1:c.x,x2:d.x,y:c.y,stroke:r.borderTopColor,strokeWidth:l})}return i}function fa(e,n){const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=n(o.left,o.top),r=n(o.right,o.bottom),l=i.borderTopStyle==="dashed",s={tl:parseFloat(i.borderTopLeftRadius)||0,tr:parseFloat(i.borderTopRightRadius)||0,br:parseFloat(i.borderBottomRightRadius)||0,bl:parseFloat(i.borderBottomLeftRadius)||0};return{x:a.x,y:a.y,w:r.x-a.x,h:r.y-a.y,fill:i.backgroundColor,stroke:i.borderTopColor,strokeWidth:parseFloat(i.borderTopWidth)||void 0,strokeDasharray:l?"6 4":void 0,radius:s}}function Mc(e,n){e.minX=Math.min(e.minX,n.x),e.minY=Math.min(e.minY,n.y),e.maxX=Math.max(e.maxX,n.x+n.w),e.maxY=Math.max(e.maxY,n.y+n.h)}function dV(e){const n=e.vueFlowRef.value;if(!n)throw new Error("캔버스가 렌더되지 않아 SVG로 내보낼 수 없습니다.");const o=(p,y)=>e.screenToFlowCoordinate({x:p,y}),i=[],a=[],r=[],l=[],s={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(const p of e.nodes.value){const y=n.querySelector(`.vue-flow__node[data-id="${CSS.escape(p.id)}"]`);if(!y||!hi(y))continue;const g=y.firstElementChild;if(g)if(p.type==="group"){const b=fa(g,o);Mc(s,b),i.push({...b,texts:[]});const k=g.querySelector(".em-group__label");k&&i.push({...fa(k,o),stroke:"none",texts:[]}),i.push({...b,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:ol(g,o)})}else if(p.type==="note"){const b={...fa(g,o),texts:ol(g,o),lines:tg(g,g,o)};Mc(s,b),r.push(b)}else{const b=fa(g,o);Mc(s,b);const k=b.radius??{tl:0,tr:0};a.push({...b,stroke:"none",texts:[]});const _=g.querySelector(".em-entity__header");if(_){const h=fa(_,o);a.push({x:b.x,y:b.y,w:b.w,h:h.y+h.h-b.y,fill:h.fill,stroke:"none",radius:{tl:k.tl,tr:k.tr,br:0,bl:0},texts:[]})}a.push({...b,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:ol(g,o),lines:tg(g,g,o),icons:sV(g,o)}),a.push({...b,fill:"none",texts:[]})}}for(const p of n.querySelectorAll(".vue-flow__edge")){const y=p.querySelector("path.em-edge__path, path.em-note-edge__path");if(!y||!hi(y))continue;const g=y.getAttribute("d");if(!g)continue;const b=getComputedStyle(y),k=b.strokeDasharray,_=cV(p);l.push({d:g,stroke:b.stroke,strokeWidth:parseFloat(b.strokeWidth)||1.5,strokeDasharray:k&&k!=="none"?k:void 0,labels:ol(p,o),markers:_.length?_:void 0})}const c=n.closest(".em-canvas")??n,d=getComputedStyle(c).backgroundColor,u=24;return{viewBox:Number.isFinite(s.minX)?{x:s.minX-u,y:s.minY-u,w:s.maxX-s.minX+u*2,h:s.maxY-s.minY+u*2}:{x:0,y:0,w:100,h:100},background:d,groups:i,edges:l,entities:a,notes:r}}function Vc(e){return jd(dV(e))}function ng(e,n){const o=URL.createObjectURL(e);try{const i=document.createElement("a");i.href=o,i.download=n,document.body.appendChild(i),i.click(),i.remove()}finally{URL.revokeObjectURL(o)}}function og(e,n="diagram.svg"){const o=Vc(e);ng(new Blob([o],{type:"image/svg+xml;charset=utf-8"}),n)}function uV(e){var i,a;const n=Number((i=e.match(/width="([\d.]+)"/))==null?void 0:i[1]),o=Number((a=e.match(/height="([\d.]+)"/))==null?void 0:a[1]);return{w:n>0?n:1,h:o>0?o:1}}async function ig(e,n="diagram.png",o=2){const i=Vc(e),{w:a,h:r}=uV(i),l=URL.createObjectURL(new Blob([i],{type:"image/svg+xml;charset=utf-8"}));try{const s=new Image;s.width=a,s.height=r,await new Promise((m,f)=>{s.onload=()=>m(),s.onerror=()=>f(new Error("SVG 이미지 로드 실패")),s.src=l});const c=document.createElement("canvas");c.width=Math.max(1,Math.round(a*o)),c.height=Math.max(1,Math.round(r*o));const d=c.getContext("2d");if(!d)throw new Error("2D 캔버스 컨텍스트를 얻을 수 없습니다");d.scale(o,o),d.drawImage(s,0,0,a,r);const u=await new Promise(m=>c.toBlob(m,"image/png"));if(!u)throw new Error("PNG 변환 실패");ng(u,n)}finally{URL.revokeObjectURL(l)}}const mV={class:"em-shortcuts"},fV={class:"em-shortcuts__list"},pV={class:"em-shortcuts__title"},hV={class:"em-shortcuts__keys"},yV={class:"em-shortcuts__kbd"},gV={key:0,class:"em-shortcuts__plus"},bV={class:"em-shortcuts__desc"},kV={class:"em-shortcuts__actions"},ag=tt(t.defineComponent({__name:"ShortcutHelpModal",props:{locale:{}},setup(e){const n=e,o=ne.useModalHandle(),i=(s,c)=>cn(n.locale??"ko",s,c),r=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?"⌘":"Ctrl",l=t.computed(()=>[{title:i("em.shortcuts.groupEdit"),items:[{keys:[r,"Z"],desc:i("em.shortcuts.descUndo")},{keys:[r,"Shift","Z"],desc:i("em.shortcuts.descRedo")},{keys:[r,"C"],desc:i("em.shortcuts.descCopy")},{keys:[r,"V"],desc:i("em.shortcuts.descPaste")},{keys:["Delete"],desc:i("em.shortcuts.descDelete")}]},{title:i("em.shortcuts.groupMove"),items:[{keys:["←","↑","→","↓"],desc:i("em.shortcuts.descMove1")},{keys:["Shift",i("em.shortcuts.keyArrows")],desc:i("em.shortcuts.descMove10")},{keys:["↑","↓"],desc:i("em.shortcuts.descAttrFocus")},{keys:["Alt","↑","↓"],desc:i("em.shortcuts.descAttrReorder")}]},{title:i("em.shortcuts.groupExplorer"),items:[{keys:["/"],desc:i("em.shortcuts.descExplorerSearch")},{keys:[i("em.shortcuts.keyArrows")],desc:i("em.shortcuts.descExplorerNav")},{keys:["Enter"],desc:i("em.shortcuts.descExplorerSelect")},{keys:["F2"],desc:i("em.shortcuts.descExplorerDetail")}]},{title:i("em.shortcuts.groupOther"),items:[{keys:[r,"K"],desc:i("em.shortcuts.descCommandPalette")},{keys:[i("em.shortcuts.keyRightClick")],desc:i("em.shortcuts.descContextMenu")},{keys:["Enter"],desc:i("em.shortcuts.descInlineConfirm")},{keys:["Esc"],desc:i("em.shortcuts.descCloseEdit")},{keys:["?"],desc:i("em.shortcuts.descOpenHelp")}]}]);return(s,c)=>(t.openBlock(),t.createBlock(t.unref(ne.BSModalFrame),{title:i("em.shortcuts.title")},{default:t.withCtx(()=>[t.createElementVNode("div",mV,[t.createElementVNode("div",fV,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,d=>(t.openBlock(),t.createElementBlock("section",{key:d.title,class:"em-shortcuts__group"},[t.createElementVNode("h4",pV,t.toDisplayString(d.title),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.items,u=>(t.openBlock(),t.createElementBlock("div",{key:u.desc,class:"em-shortcuts__row"},[t.createElementVNode("span",hV,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.keys,(m,f)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m+f},[t.createElementVNode("kbd",yV,t.toDisplayString(m),1),f<u.keys.length-1?(t.openBlock(),t.createElementBlock("span",gV,"+")):t.createCommentVNode("",!0)],64))),128))]),t.createElementVNode("span",bV,t.toDisplayString(u.desc),1)]))),128))]))),128))]),t.createElementVNode("div",kV,[t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:i("em.common.close"),onClick:c[0]||(c[0]=d=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-38f2450f"]]);function yi(...e){return e.filter(o=>!!o).join(" ").toLowerCase().trim()||void 0}function _V(e,n){const o=new Set,i=a=>{const r=!!a.matchText&&a.matchText.includes(n);let l=!1;for(const c of a.children)i(c)&&(l=!0);const s=r||l;return s&&o.add(a.key),s};return i(e),o}const EV=["aria-label"],NV=["aria-activedescendant","aria-label","placeholder"],wV={id:"em-cmdk-listbox",class:"em-cmdk__results",role:"listbox"},IV=["aria-label"],vV={class:"em-cmdk__section","aria-hidden":"true"},CV=["id","aria-selected","onMouseenter","onClick"],SV={class:"em-cmdk__label"},RV={key:0,class:"em-cmdk__tag"},AV={key:1,class:"em-cmdk__sub"},xV=["aria-label"],$V={class:"em-cmdk__section","aria-hidden":"true"},TV=["id","aria-selected","aria-disabled","onMouseenter","onClick"],MV={class:"em-cmdk__label"},VV={key:1,class:"em-cmdk__empty"},LV=tt(t.defineComponent({__name:"CommandPalette",props:{controller:{}},emits:["close"],setup(e,{emit:n}){const o=e,i=n,a=o.controller,r=t.ref(""),l=t.ref(0),s=t.ref(null),c=t.computed(()=>a.userLanguage.value),d=t.computed(()=>{const v=c.value,S=a.state.logical.entities.map(A=>{var T,O,z,P;return{type:"goto",kind:"entity",id:A.modelId,label:((T=Sn(A))==null?void 0:T[v])||A.name,sub:(O=A.table)==null?void 0:O.physicalName,match:yi(A.name,(z=Sn(A))==null?void 0:z[v],(P=A.table)==null?void 0:P.physicalName)??""}}),N=a.state.logical.groups.map(A=>{var T,O;return{type:"goto",kind:"group",id:A.modelId,label:Ct(A.name,v)||A.packageName||a.t("em.cmd.groupTag"),tag:a.t("em.cmd.groupTag"),match:yi((T=A.name)==null?void 0:T[v],(O=A.name)==null?void 0:O.ko,A.packageName)??""}});return[...S,...N]}),u={LOGICAL:"em.displayMode.logical",PHYSICAL:"em.displayMode.physical",LOGICAL_PHYSICAL:"em.displayMode.logicalPhysical",CLASS:"em.displayMode.class"},m=t.computed(()=>{const v=[];a.editable.value&&(v.push({type:"action",id:"undo",label:a.t("em.toolbar.undo"),run:()=>a.undo(),disabled:!a.canUndo.value}),v.push({type:"action",id:"redo",label:a.t("em.toolbar.redo"),run:()=>a.redo(),disabled:!a.canRedo.value}),v.push({type:"action",id:"autolayout",label:a.t("em.palette.autoLayout"),run:()=>a.autoLayout()}),v.push({type:"action",id:"collapseAll",label:a.t("em.panel.collapseAll"),run:()=>a.collapseAll()}),v.push({type:"action",id:"expandAll",label:a.t("em.panel.expandAll"),run:()=>a.expandAll()})),v.push({type:"action",id:"grid",label:a.t("em.toolbar.grid"),run:()=>a.showGrid.value=!a.showGrid.value}),v.push({type:"action",id:"minimap",label:a.t("em.toolbar.minimap"),run:()=>a.showMinimap.value=!a.showMinimap.value}),v.push({type:"action",id:"routing",label:a.t("em.toolbar.routingToggle"),run:()=>a.routingMode.value=a.routingMode.value==="straight"?"orthogonal":"straight"});for(const S of["LOGICAL","PHYSICAL","LOGICAL_PHYSICAL","CLASS"])v.push({type:"action",id:`dm-${S}`,label:a.t(u[S]),run:()=>a.displayMode.value=S});return v});function f(v,S){return v.label.toLowerCase().includes(S)}const p=t.computed(()=>{const v=r.value.trim().toLowerCase();return v?d.value.filter(S=>S.match.includes(v)):d.value}),y=t.computed(()=>{const v=r.value.trim().toLowerCase();return v?m.value.filter(S=>f(S,v)):m.value}),g=t.computed(()=>[...p.value,...y.value]);t.watch([p,y],()=>{l.value=0});function b(v){return g.value.indexOf(v)}const k=v=>`em-cmdk-opt-${v}`,_=t.computed(()=>g.value[l.value]?k(l.value):void 0);t.watch(l,async()=>{var S;await t.nextTick();const v=_.value;v&&((S=document.getElementById(v))==null||S.scrollIntoView({block:"nearest"}))});function h(v){if(v.type==="goto")a.selection.value={kind:v.kind,id:v.id},a.requestFocus(v.id);else{if(v.disabled)return;v.run()}i("close")}function C(v){if(v.key==="Escape"){i("close"),v.preventDefault();return}if(v.key==="ArrowDown"){l.value=Math.min(l.value+1,g.value.length-1),v.preventDefault();return}if(v.key==="ArrowUp"){l.value=Math.max(l.value-1,0),v.preventDefault();return}if(v.key==="Enter"){const S=g.value[l.value];S&&h(S),v.preventDefault();return}v.key==="Tab"&&v.preventDefault()}return t.nextTick(()=>{var v;return(v=s.value)==null?void 0:v.focus()}),(v,S)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createElementVNode("div",{class:"em-cmdk__backdrop",onPointerdown:S[1]||(S[1]=t.withModifiers(N=>i("close"),["self"]))},[t.createElementVNode("div",{class:"em-cmdk",role:"dialog","aria-modal":"true","aria-label":t.unref(a).t("em.cmd.title")},[t.withDirectives(t.createElementVNode("input",{ref_key:"inputEl",ref:s,"onUpdate:modelValue":S[0]||(S[0]=N=>r.value=N),class:"em-cmdk__input",type:"text",role:"combobox","aria-expanded":"true","aria-autocomplete":"list",autocomplete:"off","aria-controls":"em-cmdk-listbox","aria-activedescendant":_.value,"aria-label":t.unref(a).t("em.cmd.placeholder"),placeholder:t.unref(a).t("em.cmd.placeholder"),onKeydown:C},null,40,NV),[[t.vModelText,r.value]]),t.createElementVNode("div",wV,[g.value.length?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[p.value.length?(t.openBlock(),t.createElementBlock("div",{key:0,role:"group","aria-label":t.unref(a).t("em.cmd.sectionGoto")},[t.createElementVNode("div",vV,t.toDisplayString(t.unref(a).t("em.cmd.sectionGoto")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(p.value,N=>(t.openBlock(),t.createElementBlock("button",{id:k(b(N)),key:N.id,type:"button",tabindex:"-1",class:t.normalizeClass(["em-cmdk__item",{"is-active":b(N)===l.value}]),role:"option","aria-selected":b(N)===l.value,onMouseenter:A=>l.value=b(N),onClick:A=>h(N)},[t.createElementVNode("span",SV,t.toDisplayString(N.label),1),N.tag?(t.openBlock(),t.createElementBlock("span",RV,t.toDisplayString(N.tag),1)):N.sub?(t.openBlock(),t.createElementBlock("span",AV,t.toDisplayString(N.sub),1)):t.createCommentVNode("",!0)],42,CV))),128))],8,IV)):t.createCommentVNode("",!0),y.value.length?(t.openBlock(),t.createElementBlock("div",{key:1,role:"group","aria-label":t.unref(a).t("em.cmd.sectionActions")},[t.createElementVNode("div",$V,t.toDisplayString(t.unref(a).t("em.cmd.sectionActions")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.value,N=>(t.openBlock(),t.createElementBlock("button",{id:k(b(N)),key:N.id,type:"button",tabindex:"-1",class:t.normalizeClass(["em-cmdk__item",{"is-active":b(N)===l.value,"is-disabled":N.disabled}]),role:"option","aria-selected":b(N)===l.value,"aria-disabled":N.disabled||void 0,onMouseenter:A=>l.value=b(N),onClick:A=>h(N)},[t.createElementVNode("span",MV,t.toDisplayString(N.label),1)],42,TV))),128))],8,xV)):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock("div",VV,t.toDisplayString(t.unref(a).t("em.cmd.empty")),1))])],8,EV)],32)]))}}),[["__scopeId","data-v-92971c73"]]);function BV(e){return e?e.kind==="missing"?{titleKey:"em.conflict.lockedTitle",detailKey:"em.conflict.missingDetail"}:{titleKey:"em.conflict.lockedTitle",detailKey:"em.conflict.changedDetail"}:null}function DV(e){const n=e.commandFailure?{titleKey:"em.conflict.lockedTitle",detailKey:"em.conflict.commandFailedDetail"}:BV(e.conflict);if(!n)return null;const o=e.reloadInFlight===!0;return{titleKey:n.titleKey,detailKey:o?"em.conflict.reloadingDetail":n.detailKey,reloading:o}}const OV={key:0,class:"em-canvas__empty","aria-hidden":"true"},PV={class:"em-canvas__empty-title"},zV=["innerHTML"],FV=["innerHTML"],UV=["innerHTML"],HV={key:1,class:"em-canvas__empty-title"},jV={key:0,class:"em-conflict-banner",role:"alert","aria-live":"assertive"},KV={key:0,class:"em-conflict-banner__spinner","aria-hidden":"true"},GV={class:"em-conflict-banner__body"},YV={class:"em-conflict-banner__title"},qV={class:"em-conflict-banner__detail"},WV={key:0,class:"em-toast",role:"status","aria-live":"polite"},Lc="nc:",rg=tt(t.defineComponent({__name:"DiagramCanvas",props:{controller:{},diffMarks:{},embedCollapseStorageKey:{}},setup(e,{expose:n}){const o=e,i=o.controller,a=ne.useModal(),r=t.ref(!1),l=t.ref(null);let s;function c(w){l.value=w,s&&clearTimeout(s),s=setTimeout(()=>l.value=null,3200)}t.watch(()=>i.notice.value,w=>{w&&c(w.text)}),t.onBeforeUnmount(()=>s&&clearTimeout(s));const d=t.computed(()=>{const w=DV({conflict:i.opConflict.value,commandFailure:i.commandFailure.value,reloadInFlight:i.reloadInFlight.value});return w?{title:i.t(w.titleKey),detail:i.t(w.detailKey),reloading:w.reloading}:null}),u=t.ref(!1),m=t.ref(!1),f={x:0,y:0};function p(w){f.x=w.clientX,f.y=w.clientY}const y=t.ref(null);t.provide(Br,y);const g=t.ref(null);t.provide(Ch,g);const b=t.ref(null),k=t.computed(()=>{const w=b.value,H=new Set;if(!w)return H;if(w.kind==="entity")H.add(w.id);else if(w.kind==="group"){const se=i.resolved.value.groups.find(_e=>_e.group.modelId===w.id);for(const _e of(se==null?void 0:se.group.memberEntityRefs)??[])H.add(_e)}return H}),_=t.computed(()=>{const w=b.value,H=new Set(k.value),se=new Set,_e=new Set;if(!w)return{related:H,edges:se,notes:_e};if(w.kind==="note"){_e.add(w.id);for(const Oe of i.resolved.value.noteConnections)Oe.noteRef===w.id&&H.add(Oe.targetRef);return{related:H,edges:se,notes:_e}}const $e=k.value;if(!$e.size)return{related:H,edges:se,notes:_e};for(const Oe of i.resolved.value.associations){const{end1:He,end2:Ke}=Oe.association;($e.has(He.entityRef)||$e.has(Ke.entityRef))&&(se.add(Oe.association.modelId),H.add(He.entityRef),H.add(Ke.entityRef))}for(const Oe of i.resolved.value.noteConnections)H.has(Oe.targetRef)&&_e.add(Oe.noteRef);return{related:H,edges:se,notes:_e}});t.provide(Oo,{source:b,active:t.computed(()=>b.value!==null),primaryEntityIds:k,relatedEntityIds:t.computed(()=>_.value.related),relatedEdgeIds:t.computed(()=>_.value.edges),relatedNoteIds:t.computed(()=>_.value.notes),hoverGroupId:t.computed(()=>{var w;return((w=b.value)==null?void 0:w.kind)==="group"?b.value.id:null}),setEntityHover:w=>{g.value||m.value||(b.value=w?{kind:"entity",id:w}:null)},setGroupHover:w=>{g.value||m.value||(b.value=w?{kind:"group",id:w}:null)},setNoteHover:w=>{g.value||m.value||(b.value=w?{kind:"note",id:w}:null)}}),t.provide(io,i);const h=EA(),C=t.computed(()=>h(i.state.logical,i.embeddableCatalog.value));t.provide(Ah,C);const v=eg({expandableKeys:()=>[],defaultCollapsed:vA,storageKey:o.embedCollapseStorageKey,scope:()=>i.state.layout.diagramId});t.provide(Th,{isCollapsed:v.isCollapsed,toggle:v.toggle}),t.provide(Sh,{marks:t.toRef(o,"diffMarks")});function S(w,H){return`${Lc}${w}:${H}`}function N(w){if(!w.startsWith(Lc))return null;const[H,se]=w.slice(Lc.length).split(":");return H&&se?{noteRef:H,targetRef:se}:null}t.provide(dc,{points:w=>{var se,_e;const H=N(w);return H?((se=i.resolved.value.noteConnections.find($e=>$e.noteRef===H.noteRef&&$e.targetRef===H.targetRef))==null?void 0:se.waypoints)??[]:((_e=i.resolved.value.associations.find($e=>$e.association.modelId===w))==null?void 0:_e.waypoints)??[]},movePoint:(w,H,se)=>{const _e=N(w);_e?i.moveNoteConnectionWaypoint(_e.noteRef,_e.targetRef,H,se):i.moveWaypoint(w,H,se)},insertPoint:(w,H,se)=>{const _e=N(w);_e?i.addNoteConnectionWaypoint(_e.noteRef,_e.targetRef,H,se):i.addWaypoint(w,H,se)},removePoint:(w,H)=>{const se=N(w);se?i.removeNoteConnectionWaypoint(se.noteRef,se.targetRef,H):i.removeWaypoint(w,H)}});const A=ot(),{nodes:T,edges:O,findNode:z,findEdge:P,addNodes:D,addEdges:E,removeNodes:R,removeEdges:I,fitView:x,setCenter:$,getViewport:U,screenToFlowCoordinate:F,getSelectedNodes:B,updateNodeInternals:j}=A,X=t.ref(!1);async function W(w){X.value=!0,await t.nextTick(),await new Promise(H=>requestAnimationFrame(()=>H(null)));try{return await w()}finally{X.value=!1}}async function oe(){try{await W(()=>og(A))}catch(w){console.error("[entity-modeler] SVG export failed",w),c(i.t("em.canvas.exportFailed"))}}async function de(){try{await W(()=>ig(A))}catch(w){console.error("[entity-modeler] PNG export failed",w),c(i.t("em.canvas.exportFailed"))}}n({exportSvg:oe,exportPng:de,fitView:x});const ie=t.computed(()=>i.resolved.value.entities.length===0);function Ie(){const w=U(),{width:H,height:se}=A.dimensions.value;return{x:(H/2-w.x)/w.zoom,y:(se/2-w.y)/w.zoom}}function Le(){return T.value.map(w=>w.computedPosition??w.position)}function Se(){i.addEntity("NewEntity",Fc(Ie(),Le()))}function ce(){i.addNote("메모",Fc(Ie(),Le()))}function pe(w){for(const H of i.resolved.value.groups){const{location:se,size:_e}=H.geo;if(w.x>=se.x&&w.x<=se.x+_e.width&&w.y>=se.y&&w.y<=se.y+_e.height)return H.group.modelId}return null}function he(w,H){return w.x===H.x&&w.y===H.y}function V(w,H){return(w==null?void 0:w.width)===(H==null?void 0:H.width)&&(w==null?void 0:w.height)===(H==null?void 0:H.height)}function L(w,H){return w.entity===H.entity&&w.displayMode===H.displayMode&&w.collapsed===H.collapsed&&w.locked===H.locked&&w.groupRef===H.groupRef&&V(w.size,H.size)&&w.style===H.style&&w.attributeStyles===H.attributeStyles&&w.operationStyles===H.operationStyles}function K(w,H){const se=Object.keys(w);if(se.length!==Object.keys(H).length)return!1;for(const _e of se)if(_e==="geo"){const $e=w.geo,Oe=H.geo;if(!he($e.location,Oe.location)||!V($e.size,Oe.size))return!1}else if(w[_e]!==H[_e])return!1;return!0}function Z(){const w=i.resolved.value,H=new Map(w.groups.map(we=>[we.group.modelId,we.geo])),se=new Set(w.groups.map(we=>we.group.modelId)),_e=new Set([...se,...w.entities.map(we=>we.entity.modelId),...w.notes.map(we=>we.note.modelId)]);for(const we of[...T.value])_e.has(we.id)||R([we.id]);for(const we of w.groups){const Je=we.group.modelId,Xe={width:`${we.geo.size.width}px`,height:`${we.geo.size.height}px`},M={group:we.group,style:we.style,locked:we.locked},q=we.locked?!1:void 0,Ce=z(Je);if(Ce){he(Ce.position,we.geo.location)||(Ce.position={...we.geo.location});const Be=Ce.data;(Be.group!==M.group||Be.style!==M.style||Be.locked!==M.locked)&&(Ce.data=M);const ue=Ce.style;((ue==null?void 0:ue.width)!==Xe.width||(ue==null?void 0:ue.height)!==Xe.height)&&(Ce.style=Xe),Ce.draggable!==q&&(Ce.draggable=q)}else D([{id:Je,type:"group",position:{...we.geo.location},draggable:q,style:Xe,data:M}])}for(const we of w.entities){const Je=we.entity.modelId,Xe=we.groupRef&&se.has(we.groupRef)?we.groupRef:void 0,M={entity:we.entity,displayMode:i.displayMode.value,collapsed:we.collapsed,locked:we.locked,groupRef:Xe,size:we.geo.size,style:we.style,attributeStyles:we.attributeStyles,operationStyles:we.operationStyles},q=we.locked?!1:void 0,Ce=we.locked?!1:void 0,Be=Xe?H.get(Xe):void 0,ue=Be?{x:we.geo.location.x-Be.location.x,y:we.geo.location.y-Be.location.y}:{...we.geo.location},Ae=z(Je);Ae?(he(Ae.position,ue)||(Ae.position=ue),L(Ae.data,M)||(Ae.data=M),Ae.parentNode!==Xe&&(Ae.parentNode=Xe),Ae.draggable!==q&&(Ae.draggable=q),Ae.connectable!==Ce&&(Ae.connectable=Ce)):D([{id:Je,type:"entity",position:ue,parentNode:Xe,draggable:q,connectable:Ce,data:M}])}for(const we of w.notes){const Je=we.note,Xe=Je.modelId,M=we.groupRef&&se.has(we.groupRef)?we.groupRef:void 0,q={note:Je,groupRef:M},Ce={width:`${Je.geo.size.width}px`,height:`${Je.geo.size.height}px`},Be=M?H.get(M):void 0,ue=Be?{x:Je.geo.location.x-Be.location.x,y:Je.geo.location.y-Be.location.y}:{...Je.geo.location},Ae=z(Xe);if(Ae){he(Ae.position,ue)||(Ae.position=ue);const it=Ae.data;(it.groupRef!==M||!K(it.note,Je))&&(Ae.data=q);const We=Ae.style;((We==null?void 0:We.width)!==Ce.width||(We==null?void 0:We.height)!==Ce.height)&&(Ae.style=Ce),Ae.parentNode!==M&&(Ae.parentNode=M)}else D([{id:Xe,type:"note",position:ue,parentNode:M,style:Ce,data:q}])}const $e=new Map(w.associations.map(we=>[we.association.modelId,we])),Oe=new Set(w.noteConnections.map(we=>S(we.noteRef,we.targetRef))),He=Xy(i.state.logical).filter(we=>z(we.consumerRef)&&z(we.typeRef)),Ke=new Set(He.map(we=>$c(we.consumerRef,we.typeRef)));for(const we of[...O.value])!$e.has(we.id)&&!Oe.has(we.id)&&!Ke.has(we.id)&&I([we.id]);for(const[we,Je]of $e){const Xe={id:we,type:"association",source:Je.association.end1.entityRef,target:Je.association.end2.entityRef,sourceHandle:Je.sourceColumnRef?`r:${Je.sourceColumnRef}`:void 0,targetHandle:Je.targetColumnRef?`l:${Je.targetColumnRef}`:void 0,data:{association:Je.association,sourceColumnRef:Je.sourceColumnRef,targetColumnRef:Je.targetColumnRef}},M=P(we);if(M){const q=M.data;(q.association!==Xe.data.association||q.sourceColumnRef!==Xe.data.sourceColumnRef||q.targetColumnRef!==Xe.data.targetColumnRef)&&(M.data=Xe.data),M.sourceHandle!==Xe.sourceHandle&&(M.sourceHandle=Xe.sourceHandle),M.targetHandle!==Xe.targetHandle&&(M.targetHandle=Xe.targetHandle)}else E([Xe])}for(const we of w.noteConnections){const Je=S(we.noteRef,we.targetRef),Xe={noteRef:we.noteRef,targetRef:we.targetRef};P(Je)||E([{id:Je,type:"note-connection",source:we.noteRef,target:we.targetRef,data:Xe}])}for(const we of He){const Je=$c(we.consumerRef,we.typeRef),Xe={consumerRef:we.consumerRef,typeRef:we.typeRef,usageCount:we.usageCount},M=P(Je);M?M.data.usageCount!==Xe.usageCount&&(M.data=Xe):E([{id:Je,type:"serialized-type",source:we.consumerRef,target:we.typeRef,data:Xe}])}}const Q=new Set;let fe=!1,be=!1;const Ee=new Map;function Ne(w){const H=document.querySelector(`.vue-flow__node[data-id="${CSS.escape(w)}"]`);if(!H)return null;let se=`${H.offsetHeight}`;for(const _e of H.querySelectorAll(".em-entity__row"))se+=`|${_e.dataset.attr}:${_e.offsetTop}`;return se}function J(){be=!1;const w=fe;fe=!1;const H=[...Q];if(Q.clear(),w){j();for(const _e of T.value){const $e=Ne(_e.id);$e!==null&&Ee.set(_e.id,$e)}return}const se=[];for(const _e of H){const $e=Ne(_e);if($e===null){Ee.delete(_e);continue}Ee.get(_e)!==$e&&(Ee.set(_e,$e),se.push(_e))}se.length&&j(se)}function ee(w){if(w)for(const H of w)Q.add(H);else fe=!0;be||(be=!0,t.nextTick(()=>requestAnimationFrame(J)))}t.provide(Rh,{mark:w=>ee([w])});function te(){const w=B.value.map(se=>se.id);if(w.length)return w;const H=i.selection.value;return H&&(H.kind==="entity"||H.kind==="note"||H.kind==="group")?[H.id]:[]}function ge(){return B.value.filter(w=>w.type==="entity").map(w=>w.id)}function Re(){return B.value.filter(w=>w.type==="group").map(w=>w.id)}function Pe(w){var H;return[...((H=i.state.logical.groups.find(se=>se.modelId===w))==null?void 0:H.memberEntityRefs)??[]]}function Me(){const w=Re().flatMap(Pe);return[...new Set([...ge(),...w])]}function Qe(){return Re().length>0||ge().length>1}function Ot(){Qe()?i.copy(Me()):i.copy()}async function ht(w){if(!w.length)return;await t.nextTick();const H=B.value;H.length&&A.removeSelectedNodes(H);const se=w.map(_e=>z(_e)).filter(_e=>!!_e);se.length&&A.addSelectedNodes(se)}function re(w){if(Qe()&&ge().includes(w)){const H=Me();return{caption:i.t("em.ctx.copyN",{n:H.length}),icon:"copy",handler:()=>i.copy(H)}}return{caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:w},i.copy()}}}function ve(w){var $e;const H=w.target;if(H&&(H.tagName==="INPUT"||H.tagName==="TEXTAREA"||H.isContentEditable))return;if(w.key==="?"){a.openModal({component:ag,bind:{locale:i.uiLocale.value}}),w.preventDefault();return}if((w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="k"){r.value=!0,w.preventDefault();return}if(!i.editable.value){(w.metaKey||w.ctrlKey)&&w.key.toLowerCase()==="c"&&(Ot(),w.preventDefault());return}if(w.key==="Delete"||w.key==="Backspace"){i.deleteSelection()&&w.preventDefault();return}if(w.key==="ArrowUp"||w.key==="ArrowDown"||w.key==="ArrowLeft"||w.key==="ArrowRight"){if((($e=i.selection.value)==null?void 0:$e.kind)==="attribute"){if(w.key==="ArrowUp"||w.key==="ArrowDown"){const we=w.key==="ArrowDown"?1:-1;(w.altKey?i.nudgeSelectedAttributes(we):i.moveAttributeFocus(we))&&w.preventDefault()}return}const Oe=w.shiftKey?10:1,He=w.key==="ArrowLeft"?-Oe:w.key==="ArrowRight"?Oe:0,Ke=w.key==="ArrowUp"?-Oe:w.key==="ArrowDown"?Oe:0;i.nudgeNodes(te(),He,Ke)&&w.preventDefault();return}if(!(w.metaKey||w.ctrlKey))return;const _e=w.key.toLowerCase();_e==="c"?(Ot(),w.preventDefault()):_e==="v"?(ht(i.paste()),w.preventDefault()):_e==="z"&&(w.shiftKey?i.redo():i.undo(),w.preventDefault())}t.onMounted(async()=>{Z(),await t.nextTick(),x(),ee(),window.addEventListener("keydown",ve),window.addEventListener("pointerup",le),window.addEventListener("pointermove",p,{passive:!0})}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",ve),window.removeEventListener("pointerup",le),window.removeEventListener("pointermove",p)});function le(){y.value=null}function me(){m.value=!0,b.value=null}function ke(){var _e;m.value=!1;const w=(_e=document.elementFromPoint(f.x,f.y))==null?void 0:_e.closest(".vue-flow__node"),H=w==null?void 0:w.dataset.id;if(!H){b.value=null;return}const se=w.classList.contains("vue-flow__node-group")?"group":w.classList.contains("vue-flow__node-note")?"note":"entity";b.value={kind:se,id:H}}const Ze=t.computed(()=>Xy(i.state.logical).map(w=>`${w.consumerRef}>${w.typeRef}:${w.usageCount}`).sort().join("|"));t.watch([()=>i.resolved.value,()=>i.displayMode.value,()=>Ze.value],Z),t.watch(()=>i.resolved.value,w=>{const H=b.value;if(!H)return;(H.kind==="entity"?w.entities.some(_e=>_e.entity.modelId===H.id):H.kind==="group"?w.groups.some(_e=>_e.group.modelId===H.id):w.notes.some(_e=>_e.note.modelId===H.id))||(b.value=null)});function ct(w){const H=w.computedPosition??w.position,se=w.dimensions??{width:0,height:0};return{x:H.x+se.width/2,y:H.y+se.height/2}}function ft(w){const H=w.node;if(H){if(b.value=null,H.type==="group"){const se=i.resolved.value.groups.find(_e=>_e.group.modelId===H.id);g.value=se?{groupId:H.id,dx:H.position.x-se.geo.location.x,dy:H.position.y-se.geo.location.y}:null,y.value=null;return}if(H.type!=="entity"&&H.type!=="note"){y.value=null;return}y.value=pe(ct(H))}}function qe(w){var _e;y.value=null,g.value=null;const H=(_e=w.nodes)!=null&&_e.length?w.nodes:[w.node],se=H.filter($e=>($e==null?void 0:$e.type)==="group");if(se.length){for(const $e of se){if(!$e)continue;const Oe=i.resolved.value.entities.filter(He=>He.groupRef===$e.id).map(He=>{const Ke=z(He.entity.modelId),we=(Ke==null?void 0:Ke.computedPosition)??(Ke==null?void 0:Ke.position)??{x:0,y:0};return{id:He.entity.modelId,location:{x:we.x,y:we.y}}});i.dragGroup($e.id,{x:$e.position.x,y:$e.position.y},Oe)}return}for(const $e of H){if(!$e||$e.type==="group")continue;const Oe=$e.computedPosition??$e.position,He=$e.dimensions??{width:0,height:0},Ke={x:Oe.x+He.width/2,y:Oe.y+He.height/2};$e.type==="note"?i.dropNote($e.id,{x:Oe.x,y:Oe.y},pe(Ke)):i.dropEntity($e.id,{x:Oe.x,y:Oe.y},pe(Ke))}}function Rt(w){var q,Ce,Be,ue;if(!i.editable.value)return;const H=((q=A.connectionStartHandle.value)==null?void 0:q.type)==="target"?{source:w.target,sourceHandle:w.targetHandle,target:w.source,targetHandle:w.sourceHandle}:w;if(!H.source||!H.target)return;const se=((Ce=z(H.source))==null?void 0:Ce.type)==="note",_e=((Be=z(H.target))==null?void 0:Be.type)==="note";if(se||_e){if(se&&_e)return;const Ae=se?H.source:H.target,it=se?H.target:H.source;((ue=z(it))==null?void 0:ue.type)==="entity"&&i.addNoteConnection(Ae,it);return}const $e=Ae=>{var it;return(it=i.state.logical.entities.find(We=>We.modelId===Ae))==null?void 0:it.stereotype},Oe=$e(H.source)==="JPA_EMBEDDABLE",He=$e(H.target)==="JPA_EMBEDDABLE";if(Oe||He){if(Oe&&He)return;const Ae=Oe?H.source:H.target,it=Oe?H.target:H.source;i.addEmbedAssociation(it,Ae);return}const Ke=$e(H.source)==="SERIALIZED_TYPE",we=$e(H.target)==="SERIALIZED_TYPE";if(Ke||we){const Ae=we?H.target:H.source,it=we?H.source:H.target;Ae!==it&&i.addSerializedTypeAttribute(it,Ae);return}const Je=Ae=>Ae!=null&&Ae.startsWith("r:")||Ae!=null&&Ae.startsWith("l:")?Ae.slice(2):void 0,Xe=Je(H.sourceHandle),M=Je(H.targetHandle);i.addAssociation(H.source,H.target,Xe,M)}const et=t.ref(null);function jt(w,H){var _e;const se=i.state.layout.entityLayouts.find($e=>$e.entityRef===w);return Bt((_e=se==null?void 0:se.attributeStyles)==null?void 0:_e[H])}function Nt(w,H){var _e;const se=i.state.layout.entityLayouts.find($e=>$e.entityRef===w);return Bt((_e=se==null?void 0:se.operationStyles)==null?void 0:_e[H])}function ut(w){var H;return Bt((H=i.state.layout.groupLayouts.find(se=>se.groupRef===w))==null?void 0:H.style)}function yt(w){var H;return Bt((H=i.state.layout.notes.find(se=>se.modelId===w))==null?void 0:H.style)}function At(w){var $e,Oe;if(w.preventDefault(),!i.editable.value)return;const H=()=>F({x:w.clientX,y:w.clientY}),se=[{caption:i.t("em.ctx.addEntity"),icon:"add-entity",handler:()=>{const He=H();i.addEntity("NewEntity",{x:He.x,y:He.y})}},{caption:i.t("em.ctx.addNote"),icon:"note",handler:()=>{const He=H();i.addNote("메모",{x:He.x,y:He.y})}},{caption:i.t("em.ctx.addGroup"),icon:"folder",handler:()=>{const He=H();i.addEmptyGroup({x:He.x,y:He.y})}}],_e=($e=i.clipboard.value)==null?void 0:$e.kind;(_e==="entity"||_e==="entities")&&se.push({caption:i.t("em.ctx.paste"),icon:"clipboard",handler:()=>ht(i.paste())}),i.resolved.value.entities.length>0&&se.push({type:"separator"},{caption:i.t("em.panel.collapseAll"),icon:"collapse-all",handler:()=>i.collapseAll()},{caption:i.t("em.panel.expandAll"),icon:"expand-all",handler:()=>i.expandAll()}),(Oe=et.value)==null||Oe.open(w,se)}function jn({event:w,node:H}){var we,Je,Xe,M,q,Ce,Be,ue,Ae,it,We,Ho,pa,gt,Kn,al;const se=w;if(se.preventDefault(),!i.editable.value){if(H.type==="group"||H.type==="note")return;const at=(Je=(we=se.target)==null?void 0:we.closest("[data-attr]"))==null?void 0:Je.dataset.attr;if(at){const wt=i.selection.value;(wt==null?void 0:wt.kind)==="attribute"&&wt.entityId===H.id&&wt.ids.includes(at)||i.selectAttribute(H.id,at);const Gn=((Xe=i.selection.value)==null?void 0:Xe.kind)==="attribute"&&i.selection.value.entityId===H.id?[...i.selection.value.ids]:[at];(M=et.value)==null||M.open(se,[{caption:Gn.length>1?i.t("em.ctx.copyN",{n:Gn.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}(q=et.value)==null||q.open(se,[{caption:i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>Lr(a,i,H.id)},re(H.id)]);return}if(H.type==="group"){const at=i.isGroupLocked(H.id),wt=[];at||wt.push({type:"swatches",caption:i.t("em.common.color"),current:ut(H.id),onPick:Gn=>i.setGroupSwatch(H.id,Gn)},{type:"separator"});const xt=Qe()&&Re().includes(H.id)?Me():Pe(H.id);xt.length&&wt.push({caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy(xt)}),wt.push({caption:at?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:at?"unlock":"lock",handler:()=>i.setGroupLocked(H.id,!at)}),at||wt.push({type:"separator"},{caption:i.t("em.ctx.ungroup"),icon:"trash",danger:!0,handler:()=>i.removeGroup(H.id)}),(Ce=et.value)==null||Ce.open(se,wt);return}if(H.type==="note"){(Be=et.value)==null||Be.open(se,[{type:"swatches",caption:i.t("em.common.color"),current:yt(H.id),onPick:at=>i.setNoteSwatch(H.id,at)},{type:"separator"},{caption:i.t("em.ctx.deleteNote"),icon:"trash",danger:!0,handler:()=>i.removeNote(H.id)}]);return}const _e=(Ae=(ue=se.target)==null?void 0:ue.closest("[data-attr]"))==null?void 0:Ae.dataset.attr;if(_e){const at=i.selection.value;(at==null?void 0:at.kind)==="attribute"&&at.entityId===H.id&&at.ids.includes(_e)||i.selectAttribute(H.id,_e);const xt=((it=i.selection.value)==null?void 0:it.kind)==="attribute"&&i.selection.value.entityId===H.id?[...i.selection.value.ids]:[_e];if(i.isEntityLocked(H.id)){(We=et.value)==null||We.open(se,[{caption:xt.length>1?i.t("em.ctx.copyN",{n:xt.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}const Gn=xt.length>1,Bc=[{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(H.id)},{type:"swatches",caption:Gn?i.t("em.ctx.colorN",{n:xt.length}):i.t("em.common.color"),current:Gn?null:jt(H.id,_e),onPick:EP=>i.setAttributeSwatches(H.id,xt,EP)},{type:"separator"},{caption:Gn?i.t("em.ctx.copyN",{n:xt.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}],ha=i.clipboard.value;(ha==null?void 0:ha.kind)==="attribute"&&Bc.push({caption:ha.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:ha.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:H.id},i.paste()}}),Bc.push({type:"separator"},{caption:Gn?i.t("em.ctx.deleteAttrN",{n:xt.length}):i.t("em.ctx.deleteAttr"),icon:"trash",danger:!0,handler:()=>i.removeAttributes(H.id,xt)}),(Ho=et.value)==null||Ho.open(se,Bc);return}const $e=(gt=(pa=se.target)==null?void 0:pa.closest("[data-op]"))==null?void 0:gt.dataset.op;if($e){if(i.isEntityLocked(H.id))return;(Kn=et.value)==null||Kn.open(se,[{caption:i.t("em.ctx.addOperation"),icon:"method",handler:()=>i.addOperation(H.id)},{type:"swatches",caption:i.t("em.common.color"),current:Nt(H.id,$e),onPick:at=>i.setOperationSwatch(H.id,$e,at)},{type:"separator"},{caption:i.t("em.ctx.deleteOperation"),icon:"trash",danger:!0,handler:()=>i.removeOperation(H.id,$e)}]);return}const Oe=i.resolved.value.entities.find(at=>at.entity.modelId===H.id),He=!!(Oe!=null&&Oe.locked),Ke=[{caption:He?i.t("em.ctx.viewDetail"):i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>Lr(a,i,H.id)}];if(!He){Ke.push({type:"separator"},{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(H.id)},{caption:i.t("em.ctx.addMethod"),icon:"method",handler:()=>i.addOperation(H.id)},{caption:i.t("em.ctx.groupInto"),icon:"folder",handler:()=>{const wt=B.value.filter(xt=>xt.type==="entity").map(xt=>xt.id);i.createGroup(wt.includes(H.id)&&wt.length?wt:[H.id])}},{caption:i.t("em.ctx.addSelfAssoc"),icon:"arrow-lr",handler:()=>i.addAssociation(H.id,H.id)});const at=i.embeddableCatalog.value;if(at.length){Ke.push({type:"separator"});for(const wt of at){const xt=Ct(wt.label,i.userLanguage.value)??wt.type;Ke.push({caption:i.t("em.ctx.addEmbeddableNamed",{label:xt}),icon:"link",handler:()=>i.addPredefinedEmbed(H.id,wt.type)})}}}if(Ke.push({type:"separator"}),Ke.push({caption:Oe!=null&&Oe.collapsed?i.t("em.panel.expand"):i.t("em.panel.collapse"),icon:Oe!=null&&Oe.collapsed?"expand-all":"collapse-all",handler:()=>i.setEntityCollapsed(H.id,!(Oe!=null&&Oe.collapsed))}),Oe!=null&&Oe.groupRef&&!He&&Ke.push({caption:i.t("em.ctx.ungroupEntity"),icon:"folder",handler:()=>i.ungroupEntity(H.id)}),Ke.push({caption:He?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:He?"unlock":"lock",handler:()=>i.setEntityLocked(H.id,!He)}),Ke.push(re(H.id)),!He){const at=i.clipboard.value;(at==null?void 0:at.kind)==="attribute"&&Ke.push({caption:at.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:at.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:H.id},i.paste()}}),Ke.push({type:"separator"}),Ke.push({caption:i.t("em.ctx.deleteEntity"),icon:"trash",danger:!0,handler:()=>i.removeEntity(H.id)})}(al=et.value)==null||al.open(se,Ke)}function mt({event:w,edge:H}){var Oe,He;const se=w;if(se.preventDefault(),!i.editable.value)return;const _e=N(H.id);if(_e){(Oe=et.value)==null||Oe.open(se,[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearNoteConnectionWaypoints(_e.noteRef,_e.targetRef)},{type:"separator"},{caption:i.t("em.ctx.deleteConnection"),icon:"trash",danger:!0,handler:()=>i.removeNoteConnection(_e.noteRef,_e.targetRef)}]);return}const $e=[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearWaypoints(H.id)}];i.isAssociationLocked(H.id)||$e.push({type:"separator"},{caption:i.t("em.ctx.deleteAssociation"),icon:"trash",danger:!0,handler:()=>i.removeAssociation(H.id)}),(He=et.value)==null||He.open(se,$e)}function ze(w){return w==="group"?"group":w==="note"?"note":"entity"}function Y({node:w}){if(B.value.length>1){i.selection.value=null;return}i.selection.value={kind:ze(w.type),id:w.id}}function Wt({nodes:w}){w.length>1&&(i.selection.value=null)}function G({edge:w}){const H=N(w.id);i.selection.value=H?{kind:"note",id:H.noteRef}:{kind:"association",id:w.id}}function ae(w){const H=i.selection.value;return!!H&&H.kind!=="attribute"&&H.id===w.id}function De(w){var H,se;return ae(w)?w.type==="group"?"color-mix(in srgb, var(--em-selection) 22%, transparent)":"var(--em-selection)":w.type==="note"?"var(--em-note-soft)":w.type==="group"?uh(Bt((H=w.data)==null?void 0:H.style),!0)??"var(--em-mm-group)":uh(Bt((se=w.data)==null?void 0:se.style))??"var(--em-mm-entity)"}function je(w){return ae(w)?"var(--em-selection)":w.type==="note"?"var(--em-note-accent)":w.type==="group"?"var(--em-node-border)":"var(--em-on-surface-muted)"}function bt(w,H){$(w,H,{zoom:U().zoom,duration:350})}t.watch(()=>i.focusRequest.value,w=>{if(!w)return;const H=z(w.id);if(!H)return;const se=H.computedPosition??H.position,_e=H.dimensions??{width:0,height:0};bt(se.x+_e.width/2,se.y+_e.height/2)});function Vt({position:w}){bt(w.x,w.y)}function Ye({node:w}){i.selection.value={kind:ze(w.type),id:w.id};const H=w.computedPosition??w.position,se=w.dimensions??{width:0,height:0};bt(H.x+se.width/2,H.y+se.height/2)}function Ue({node:w}){x({nodes:[w.id],duration:350,maxZoom:1.2,padding:.6})}return(w,H)=>(t.openBlock(),t.createElementBlock("div",{tabindex:"-1",class:t.normalizeClass(["em-canvas",{"is-connecting":u.value,"is-panning":m.value}])},[t.createVNode(t.unref(Pv),{"min-zoom":.2,"max-zoom":2,"only-render-visible-elements":!X.value,"delete-key-code":null,"disable-keyboard-a11y":!0,"nodes-focusable":!1,"edges-focusable":!1,"nodes-draggable":t.unref(i).editable.value,"nodes-connectable":t.unref(i).editable.value,"connection-mode":t.unref(Pn).Loose,"connect-on-click":!1,"pan-on-scroll":"","zoom-on-scroll":!1,"zoom-on-pinch":!0,"zoom-on-double-click":!1,"zoom-activation-key-code":["Meta","Control"],onMoveStart:me,onMoveEnd:ke,onConnect:Rt,onConnectStart:H[1]||(H[1]=se=>u.value=!0),onConnectEnd:H[2]||(H[2]=se=>u.value=!1),onNodeDrag:ft,onNodeDragStop:qe,onNodeClick:Y,onEdgeClick:G,onSelectionChange:Wt,onPaneClick:H[3]||(H[3]=se=>t.unref(i).selection.value=null),onPaneContextMenu:At,onNodeContextMenu:jn,onEdgeContextMenu:mt},{"node-group":t.withCtx(se=>[t.createVNode(Ph,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),"node-entity":t.withCtx(se=>[t.createVNode(Oh,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),"node-note":t.withCtx(se=>[t.createVNode(zh,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),"edge-association":t.withCtx(se=>[t.createVNode(iy,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),"edge-note-connection":t.withCtx(se=>[t.createVNode(K2,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),"edge-serialized-type":t.withCtx(se=>[t.createVNode(Y2,t.normalizeProps(t.guardReactiveProps(se)),null,16)]),default:t.withCtx(()=>[t.unref(i).showGrid.value?(t.openBlock(),t.createBlock(t.unref(Mx),{key:0,gap:16,"pattern-color":"var(--em-border)"})):t.createCommentVNode("",!0),t.createVNode(t.unref(a$),{"show-interactive":!1,position:"bottom-left"},{default:t.withCtx(()=>[t.unref(i).editable.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createVNode(t.unref(Po),{class:"em-palette__group-start",title:t.unref(i).t("em.ctx.addEntity"),onClick:Se},{default:t.withCtx(()=>[t.createVNode(xe,{name:"add-entity",size:14})]),_:1},8,["title"]),t.createVNode(t.unref(Po),{title:t.unref(i).t("em.ctx.addNote"),onClick:ce},{default:t.withCtx(()=>[t.createVNode(xe,{name:"note",size:14})]),_:1},8,["title"]),t.createVNode(t.unref(Po),{title:t.unref(i).t("em.palette.autoLayout"),onClick:H[0]||(H[0]=se=>t.unref(i).autoLayout())},{default:t.withCtx(()=>[t.createVNode(xe,{name:"auto-layout",size:14})]),_:1},8,["title"])],64)):t.createCommentVNode("",!0)]),_:1}),t.unref(i).showMinimap.value?(t.openBlock(),t.createBlock(t.unref(F2),{key:1,pannable:"",width:224,height:160,"node-color":De,"node-stroke-color":je,"node-border-radius":4,"node-stroke-width":2,"mask-color":"var(--em-minimap-mask)","mask-stroke-color":"var(--em-accent)","mask-stroke-width":1.5,"mask-border-radius":4,"offset-scale":3,onClick:Vt,onNodeClick:Ye,onNodeDblclick:Ue})):t.createCommentVNode("",!0)]),_:1},8,["only-render-visible-elements","nodes-draggable","nodes-connectable","connection-mode"]),ie.value?(t.openBlock(),t.createElementBlock("div",OV,[t.unref(i).editable.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("p",PV,t.toDisplayString(t.unref(i).t("em.canvas.emptyTitle")),1),t.createElementVNode("p",{class:"em-canvas__empty-hint",innerHTML:t.unref(i).t("em.canvas.emptyHint")},null,8,zV),t.createElementVNode("p",{class:"em-canvas__empty-hint",innerHTML:t.unref(i).t("em.canvas.emptyConnectHint")},null,8,FV),t.createElementVNode("p",{class:"em-canvas__empty-hint em-canvas__empty-sub",innerHTML:t.unref(i).t("em.canvas.emptyShortcutHint")},null,8,UV)],64)):(t.openBlock(),t.createElementBlock("p",HV,t.toDisplayString(t.unref(i).t("em.canvas.emptyReadonly")),1))])):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createBlock(LV,{key:1,controller:t.unref(i),onClose:H[4]||(H[4]=se=>r.value=!1)},null,8,["controller"])):t.createCommentVNode("",!0),t.createVNode(t.Transition,{name:"em-conflict-fade"},{default:t.withCtx(()=>[d.value?(t.openBlock(),t.createElementBlock("div",jV,[d.value.reloading?(t.openBlock(),t.createElementBlock("span",KV)):(t.openBlock(),t.createBlock(xe,{key:1,name:"alert-triangle",size:16,class:"em-conflict-banner__icon"})),t.createElementVNode("div",GV,[t.createElementVNode("strong",YV,t.toDisplayString(d.value.title),1),t.createElementVNode("span",qV,t.toDisplayString(d.value.detail),1)])])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(iV,{ref_key:"menuRef",ref:et,locale:t.unref(i).uiLocale.value},null,8,["locale"]),(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createVNode(t.Transition,{name:"em-toast-fade"},{default:t.withCtx(()=>[l.value?(t.openBlock(),t.createElementBlock("div",WV,t.toDisplayString(l.value),1)):t.createCommentVNode("",!0)]),_:1})]))],2))}}),[["__scopeId","data-v-c88d8f67"]]),JV={class:"em-explorer em-scroll-overlay"},XV={class:"em-explorer__search"},ZV=["placeholder","aria-label"],QV=["aria-label","title"],eL={key:0,class:"em-explorer__empty"},tL=["aria-label"],nL=["data-key","aria-level","aria-posinset","aria-setsize","aria-expanded","aria-selected","tabindex","onClick","onDblclick","onFocus","onKeydown"],oL=["onClick"],iL=["title"],aL={class:"em-key-slot"},rL={class:"em-key-slot"},lL={class:"em-explorer__label"},sL={key:2,class:"em-explorer__sr"},lg=tt(t.defineComponent({__name:"DiagramExplorer",props:{controller:{},storageKey:{}},setup(e,{expose:n}){const o=e,i=o.controller,a=ne.useModal(),r=t.computed(()=>{const D=i.resolved.value,E=i.displayMode.value,R=i.userLanguage.value,I=V=>{var L,K;return _a(E,V.name,(L=Sn(V))==null?void 0:L[R],(K=V.table)==null?void 0:K.physicalName,i.t("em.node.logicalMissing"))},x=E==="PHYSICAL"||E==="LOGICAL_PHYSICAL",$=V=>{const L=V.attrType.startsWith("RELATION")&&V.dbAttrs.length>0;return{icon:V.attrType.startsWith("RELATION")?"link":"field",keyMarks:{pk:V.identifier,fk:L&&x}}},U=V=>V.attrType.startsWith("EMBED")&&V.dbAttrs.length>0,F=V=>U(V)||vn(V),B=E==="PHYSICAL"||E==="LOGICAL_PHYSICAL",j=new Map(i.state.logical.entities.map(V=>[V.modelId,V])),X=(V,L)=>{const K=V.dbAttrs[0];return K?Lt(V,K,0,j.get(L),i.state.logical,{embeddableCatalog:i.embeddableCatalog.value}):void 0},W={embeddableCatalog:i.embeddableCatalog.value},oe=new Map,de=V=>{let L=oe.get(V.modelId);return L||oe.set(V.modelId,L=mo(Rn(V,i.state.logical.entities))),L},ie=(V,L)=>{const K=j.get(L);return vn(V)?V.dbAttrs.map((Z,Q)=>Lt(V,Z,Q,K,i.state.logical)):V.attrType==="EMBED_PREDEF"&&!i.embeddableCatalog.value.some(Z=>Z.type===V.type)?V.dbAttrs:V.dbAttrs.map((Z,Q)=>{const fe=Lt(V,Z,Q,K,i.state.logical,W),be=K?fo(fe,de(K)):null;return be?{...fe,physicalName:be.physicalName}:fe})},Ie=(V,L)=>{const K=Ei(V,Go(i.state.logical),L,i.state.logical);return K.kind==="resolved"?K.entity:void 0},Le=(V,L,K)=>{var Ee,Ne,J,ee;const Z={entityId:L,attrId:V.modelId};if(F(V)){const te=_l(E,V,K==null?void 0:K.collection,K==null?void 0:K.targetName,Ie(V));return{key:`attr:${V.modelId}`,label:V.name+(te?` : ${te}`:""),icon:"table",attrRef:Z,focusId:L,matchText:yi(V.name,(Ee=jo(V,V.dbAttrs[0]))==null?void 0:Ee[R],(Ne=V.dbAttrs[0])==null?void 0:Ne.physicalName),children:B?ie(V,L).map(ge=>{var Re,Pe;return{key:`attr:${V.modelId}:col:${ge.modelId}`,label:_a(E,ge.physicalName,(Re=ge.logicalName)==null?void 0:Re[R],ge.physicalName,i.t("em.node.logicalMissing"))+(ge.dataType?` : ${ge.dataType}`:""),icon:"field",attrRef:Z,focusId:L,matchText:yi(ge.physicalName,(Pe=ge.logicalName)==null?void 0:Pe[R]),children:[]}}):[]}}const Q=(K==null?void 0:K.collection)??wi(V,i.state.logical.associations),fe=_l(E,V,Q,K==null?void 0:K.targetName,Ie(V)),be=X(V,L);return{key:`attr:${V.modelId}`,label:_a(E,V.name,(J=jo(V,be))==null?void 0:J[R],be==null?void 0:be.physicalName,i.t("em.node.logicalMissing"))+(fe?` : ${fe}`:""),...$(V),attrRef:Z,focusId:L,matchText:yi(V.name,(ee=jo(V,be))==null?void 0:ee[R],be==null?void 0:be.physicalName),children:[]}},Se=V=>{var Ee,Ne;const L=V.entity,K=E==="CLASS",Q=K||L.attributes.some(vn)?jl(L,i.state.logical):void 0,fe=K&&Q?Q.fields.map(J=>J.attr):[...L.attributes].sort((J,ee)=>J.order-ee.order),be=new Map(((Q==null?void 0:Q.fields)??[]).filter(J=>(K||vn(J.attr))&&(J.target||J.collection)).map(J=>{var ee;return[J.attr.modelId,{targetName:(ee=J.target)==null?void 0:ee.name,collection:J.collection}]}));return{key:`entity:${L.modelId}`,label:I(L),icon:"table",selectKind:"entity",selectId:L.modelId,focusId:L.modelId,matchText:yi(L.name,(Ee=Sn(L))==null?void 0:Ee[R],(Ne=L.table)==null?void 0:Ne.physicalName),children:fe.map(J=>Le(J,L.modelId,be.get(J.modelId)))}},ce=new Map,pe=[];for(const V of D.entities)if(V.groupRef){const L=ce.get(V.groupRef)??[];L.push(V),ce.set(V.groupRef,L)}else pe.push(V);const he=[];for(const V of D.groups){const L=V.group;he.push({key:`group:${L.modelId}`,label:Ct(L.name,R)||L.packageName||i.t("em.explorer.groupFallback"),icon:"folder",focusId:L.modelId,children:(ce.get(L.modelId)??[]).map(Se)})}for(const V of pe)he.push(Se(V));if(D.associations.length){const V=new Map(D.entities.map(L=>[L.entity.modelId,I(L.entity)]));he.push({key:"section:associations",label:i.t("em.explorer.associations",{n:D.associations.length}),icon:"arrow-lr",children:D.associations.map(L=>{const K=L.association,Z=V.get(K.end1.entityRef)??K.end1.entityRef,Q=V.get(K.end2.entityRef)??K.end2.entityRef;return{key:`assoc:${K.modelId}`,label:`${Z} — ${Q}`,icon:"arrow-lr",selectKind:"association",selectId:K.modelId,children:[]}})})}return D.notes.length&&he.push({key:"section:notes",label:i.t("em.explorer.notes",{n:D.notes.length}),icon:"note",children:D.notes.map(({note:V})=>{var L;return{key:`note:${V.modelId}`,label:((L=V.memo.split(`
|
|
73
|
+
`)[0])==null?void 0:L.slice(0,30))||i.t("em.explorer.emptyNote"),icon:"note",selectKind:"note",selectId:V.modelId,focusId:V.modelId,children:[]}})}),{key:"root",label:i.state.layout.name||i.t("em.explorer.diagram"),icon:"network",children:he}});function l(D){return D?D.pk&&D.fk?i.t("em.node.keyPfk"):D.pk?i.t("em.node.keyPk"):D.fk?i.t("em.node.keyFk"):"":""}const s=t.computed(()=>{const D=[],E=R=>{if(R.children.length){R.key!=="root"&&D.push(R.key);for(const I of R.children)E(I)}};return E(r.value),D}),c=D=>D.startsWith("entity:")||D==="section:associations",{isCollapsed:d,toggle:u,toggleAll:m,allExpanded:f}=eg({expandableKeys:()=>s.value,defaultCollapsed:c,storageKey:o.storageKey,scope:()=>i.state.layout.diagramId}),p=t.ref(""),y=t.ref(null),g=t.computed(()=>p.value.trim().length>0),b=t.computed(()=>{const D=[];if(g.value){const R=_V(r.value,p.value.trim().toLowerCase()),I=(x,$,U,F,B)=>{if(!R.has(x.key))return;D.push({node:x,depth:$,parentKey:U,posinset:F,setsize:B});const j=x.children.filter(X=>R.has(X.key));j.forEach((X,W)=>I(X,$+1,x.key,W+1,j.length))};return I(r.value,0,null,1,1),D}const E=(R,I,x,$,U)=>{D.push({node:R,depth:I,parentKey:x,posinset:$,setsize:U}),d(R.key)||R.children.forEach((F,B)=>E(F,I+1,R.key,B+1,R.children.length))};return E(r.value,0,null,1,1),D}),k=t.ref(null),_=t.ref(null),h=t.computed(()=>{var E;const D=b.value;return _.value&&D.some(R=>R.node.key===_.value)?_.value:((E=D[0])==null?void 0:E.node.key)??null}),C=D=>!g.value&&d(D);async function v(D){var E,R;D&&(_.value=D,await t.nextTick(),(R=(E=k.value)==null?void 0:E.querySelector(`[data-key="${D}"]`))==null||R.focus())}function S(D,E){var x,$,U,F,B;const R=b.value,I=R.findIndex(j=>j.node.key===E.node.key);switch(D.key){case"ArrowDown":D.preventDefault(),v((x=R[I+1])==null?void 0:x.node.key);return;case"ArrowUp":D.preventDefault(),v(($=R[I-1])==null?void 0:$.node.key);return;case"Home":D.preventDefault(),v((U=R[0])==null?void 0:U.node.key);return;case"End":D.preventDefault(),v((F=R[R.length-1])==null?void 0:F.node.key);return;case"ArrowRight":if(D.preventDefault(),!E.node.children.length)return;C(E.node.key)?u(E.node.key):v((B=R[I+1])==null?void 0:B.node.key);return;case"ArrowLeft":D.preventDefault(),E.node.children.length&&!C(E.node.key)?u(E.node.key):v(E.parentKey);return;case"Enter":case" ":D.preventDefault(),z(E.node,D);return;case"F2":D.preventDefault(),P(E.node)}}const N=t.computed(()=>g.value&&b.value.length<=1);function A(D){var I;if(D.key!=="/"||D.metaKey||D.ctrlKey||D.altKey||D.shiftKey)return;const E=D.target,R=E==null?void 0:E.tagName;R==="INPUT"||R==="TEXTAREA"||R==="SELECT"||E!=null&&E.isContentEditable||(D.preventDefault(),(I=y.value)==null||I.focus())}t.onMounted(()=>window.addEventListener("keydown",A)),t.onBeforeUnmount(()=>window.removeEventListener("keydown",A)),n({toggleAll:m,allExpanded:f,hasExpandable:t.computed(()=>s.value.length>0)});function T(D){const E=i.selection.value;return D.attrRef?(E==null?void 0:E.kind)==="attribute"&&E.entityId===D.attrRef.entityId&&E.ids.includes(D.attrRef.attrId):!!E&&E.kind!=="attribute"&&!!D.selectId&&D.selectKind===E.kind&&D.selectId===E.id}function O(D){const E=i.selection.value;return D.selectKind==="entity"&&(E==null?void 0:E.kind)==="attribute"&&E.entityId===D.selectId}function z(D,E){if(D.attrRef){const R=E.shiftKey?"range":E.metaKey||E.ctrlKey?"toggle":"replace";i.selectAttribute(D.attrRef.entityId,D.attrRef.attrId,R)}else D.selectKind&&D.selectId&&(i.selection.value={kind:D.selectKind,id:D.selectId});D.focusId&&i.requestFocus(D.focusId)}function P(D){D.selectKind==="entity"&&D.selectId&&Lr(a,i,D.selectId)}return(D,E)=>(t.openBlock(),t.createElementBlock("section",JV,[t.createElementVNode("div",XV,[t.createVNode(xe,{name:"search",size:14,class:"em-explorer__search-icon"}),t.withDirectives(t.createElementVNode("input",{ref_key:"searchInput",ref:y,"onUpdate:modelValue":E[0]||(E[0]=R=>p.value=R),class:"em-explorer__search-input",type:"text",placeholder:t.unref(i).t("em.explorer.searchPlaceholder"),"aria-label":t.unref(i).t("em.explorer.searchAria"),onKeydown:E[1]||(E[1]=t.withKeys(R=>p.value="",["esc"]))},null,40,ZV),[[t.vModelText,p.value]]),p.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-explorer__search-clear","aria-label":t.unref(i).t("em.explorer.clearSearchAria"),title:t.unref(i).t("em.explorer.clearSearchTitle"),onClick:E[2]||(E[2]=R=>p.value="")},[t.createVNode(xe,{name:"x",size:13})],8,QV)):t.createCommentVNode("",!0)]),N.value?(t.openBlock(),t.createElementBlock("p",eL,t.toDisplayString(t.unref(i).t("em.explorer.noMatches")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"rowsEl",ref:k,class:"em-explorer__rows",role:"tree","aria-label":t.unref(i).t("em.explorer.treeAria")},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.value,R=>(t.openBlock(),t.createElementBlock("div",{key:R.node.key,class:t.normalizeClass(["em-explorer__row",{"is-active":T(R.node),"is-focus-parent":O(R.node),"is-selectable":!!R.node.selectKind||!!R.node.attrRef||!!R.node.focusId}]),"data-key":R.node.key,role:"treeitem","aria-level":R.depth+1,"aria-posinset":R.posinset,"aria-setsize":R.setsize,"aria-expanded":R.node.children.length?!C(R.node.key):void 0,"aria-selected":T(R.node),tabindex:R.node.key===h.value?0:-1,style:t.normalizeStyle({paddingLeft:4+R.depth*14+"px"}),onClick:I=>z(R.node,I),onDblclick:I=>P(R.node),onFocus:I=>_.value=R.node.key,onKeydown:I=>S(I,R)},[t.createElementVNode("span",{class:t.normalizeClass(["em-explorer__chevron",{"is-leaf":!R.node.children.length,"is-open":!C(R.node.key)}]),onClick:t.withModifiers(I=>R.node.children.length&&t.unref(u)(R.node.key),["stop"])},[R.node.children.length?(t.openBlock(),t.createBlock(xe,{key:0,name:"chevron",size:14})):t.createCommentVNode("",!0)],10,oL),R.node.keyMarks?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-explorer__keys",title:l(R.node.keyMarks),"aria-hidden":"true"},[t.createElementVNode("span",aL,[R.node.keyMarks.pk?(t.openBlock(),t.createBlock(xe,{key:0,name:"key",size:14,class:"em-key is-pk"})):R.node.keyMarks.fk?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(xe,{key:1,class:"em-explorer__icon",name:R.node.icon,size:14},null,8,["name"]))]),t.createElementVNode("span",rL,[R.node.keyMarks.fk?(t.openBlock(),t.createBlock(xe,{key:0,name:"key",size:14,class:"em-key is-fk"})):t.createCommentVNode("",!0)])],8,iL)):(t.openBlock(),t.createBlock(xe,{key:1,class:"em-explorer__icon",name:R.node.icon,size:15},null,8,["name"])),t.createElementVNode("span",lL,t.toDisplayString(R.node.label),1),l(R.node.keyMarks)?(t.openBlock(),t.createElementBlock("span",sL,t.toDisplayString(l(R.node.keyMarks)),1)):t.createCommentVNode("",!0)],46,nL))),128))],8,tL)]))}}),[["__scopeId","data-v-ffebc201"]]),cL={class:"em-text-export"},dL=["id","aria-selected","tabindex","onClick"],uL=["aria-labelledby"],mL={class:"em-text-export__actions"},fL=tt(t.defineComponent({__name:"TextExportModal",props:{formats:{},title:{},locale:{}},setup(e){const n=e,o=ne.useModalHandle(),i=(m,f)=>cn(n.locale??"ko",m,f),a=t.ref(0);function r(){return n.formats[a.value]??n.formats[0]}const l=t.ref(null);async function s(m){var f,p;a.value=m,await t.nextTick(),(p=(f=l.value)==null?void 0:f.querySelectorAll('[role="tab"]')[m])==null||p.focus()}function c(m){const f=n.formats.length;f&&s((a.value+m+f)%f)}async function d(){try{await navigator.clipboard.writeText(r().content),ne.showNotification(i("em.export.copied"),"info")}catch{ne.showNotification(i("em.export.copyFailed"),"error")}}function u(){const m=r(),f=new Blob([m.content],{type:"text/plain;charset=utf-8"}),p=URL.createObjectURL(f);try{const y=document.createElement("a");y.href=p,y.download=m.filename,document.body.appendChild(y),y.click(),y.remove()}finally{URL.revokeObjectURL(p)}}return(m,f)=>(t.openBlock(),t.createBlock(t.unref(ne.BSModalFrame),{title:n.title??i("em.export.title")},{default:t.withCtx(()=>[t.createElementVNode("div",cL,[n.formats.length>1?(t.openBlock(),t.createElementBlock("div",{key:0,ref_key:"tabsEl",ref:l,class:"em-text-export__tabs",role:"tablist"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.formats,(p,y)=>(t.openBlock(),t.createElementBlock("button",{id:`em-text-export-tab-${y}`,key:p.key,type:"button",role:"tab",class:t.normalizeClass(["em-text-export__tab",{"is-active":y===a.value}]),"aria-selected":y===a.value,"aria-controls":"em-text-export-panel",tabindex:y===a.value?0:-1,onClick:g=>a.value=y,onKeydown:[f[0]||(f[0]=t.withKeys(t.withModifiers(g=>c(-1),["prevent"]),["left"])),f[1]||(f[1]=t.withKeys(t.withModifiers(g=>c(1),["prevent"]),["right"])),f[2]||(f[2]=t.withKeys(t.withModifiers(g=>s(0),["prevent"]),["home"])),f[3]||(f[3]=t.withKeys(t.withModifiers(g=>s(n.formats.length-1),["prevent"]),["end"]))]},t.toDisplayString(p.label),43,dL))),128))],512)):t.createCommentVNode("",!0),t.createElementVNode("pre",{id:"em-text-export-panel",class:"em-text-export__pre",role:"tabpanel",tabindex:"0","aria-labelledby":n.formats.length>1?`em-text-export-tab-${a.value}`:void 0},t.toDisplayString(r().content),9,uL),t.createElementVNode("div",mL,[t.createVNode(t.unref(ne.BSButton),{caption:i("em.export.copy"),onClick:d},null,8,["caption"]),t.createVNode(t.unref(ne.BSButton),{caption:i("em.export.download"),onClick:u},null,8,["caption"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:i("em.common.close"),onClick:f[4]||(f[4]=p=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-74551f98"]]),pL={class:"em-text-import"},hL=["aria-label"],yL=["aria-checked","tabindex","onClick"],gL=["placeholder"],bL={key:0,class:"em-text-import__locale"},kL={key:0,class:"em-text-import__locale-marker"},_L={class:"em-text-import__locale-label"},EL={class:"em-text-import__locale-hint"},NL={class:"em-text-import__status"},wL={class:"em-text-import__ok"},IL={key:0,class:"em-text-import__warn"},vL={key:1,class:"em-text-import__err"},CL={key:2,class:"em-text-import__err"},SL={key:3,class:"em-text-import__err"},RL={class:"em-text-import__actions"},AL=tt(t.defineComponent({__name:"TextImportModal",props:{onImport:{type:Function},locale:{}},setup(e){const n=e,o=ne.useModalHandle(),i=(h,C)=>cn(n.locale??"ko",h,C),a=t.ref(""),r=t.ref("auto"),l=t.ref(""),s=[{v:""},...qn.map(h=>({v:h}))],c=[{key:"auto",labelKey:"em.import.formatAuto"},{key:"mermaid",labelKey:"em.import.formatMermaid"},{key:"ddl",labelKey:"em.import.formatDdl"},{key:"json",labelKey:"em.import.formatJson"}],d=t.ref(null);async function u(h){var v,S;const C=c[(h+c.length)%c.length];C&&(r.value=C.key,await t.nextTick(),(S=(v=d.value)==null?void 0:v.querySelectorAll('[role="radio"]')[c.indexOf(C)])==null||S.focus())}function m(h){u(c.findIndex(C=>C.key===r.value)+h)}function f(h){return h?h.startsWith("{")?"json":/\berdiagram\b/i.test(h)?"mermaid":/\bcreate\s+table\b/i.test(h)?"ddl":null:null}const p=t.computed(()=>r.value==="auto"?f(a.value.trim()):r.value),y=t.computed(()=>{const h=a.value.trim();if(!h)return{status:"empty"};const C=p.value;if(!C)return{status:"unknown"};try{let v,S=[];if(C==="json")v=Ud(h);else if(C==="mermaid")v=Rd(h);else{const N=l.value?{commentLocale:l.value}:void 0;v=Bd(h,N),S=Sl(h,N).warnings}return v.logical.entities.length===0?{status:"emptyParse"}:{status:"ok",source:v,warnings:S}}catch(v){return{status:"error",message:v instanceof Error?v.message:String(v)}}}),g=t.computed(()=>{const h=a.value.trim();if(!h||p.value!=="ddl")return null;const C=sb(h);return C.comments?C:null}),b=t.computed(()=>{const h=g.value;return h?h.verdict==="mixed"?i("em.import.commentMixed"):h.verdict==="unknown"?i("em.import.commentUnknown"):i("em.import.commentCertain",{locale:h.verdict}):""}),k=t.computed(()=>y.value.status==="ok");function _(){const h=y.value;h.status!=="ok"||!h.source||(n.onImport(h.source),o.close())}return(h,C)=>(t.openBlock(),t.createBlock(t.unref(ne.BSModalFrame),{title:i("em.import.title")},{default:t.withCtx(()=>[t.createElementVNode("div",pL,[t.createElementVNode("div",{ref_key:"fmtEl",ref:d,class:"em-text-import__formats",role:"radiogroup","aria-label":i("em.import.formatGroup")},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(c,v=>t.createElementVNode("button",{key:v.key,type:"button",role:"radio",class:t.normalizeClass(["em-text-import__fmt",{"is-active":v.key===r.value}]),"aria-checked":v.key===r.value,tabindex:v.key===r.value?0:-1,onClick:S=>r.value=v.key,onKeydown:[C[0]||(C[0]=t.withKeys(t.withModifiers(S=>m(-1),["prevent"]),["left"])),C[1]||(C[1]=t.withKeys(t.withModifiers(S=>m(1),["prevent"]),["right"])),C[2]||(C[2]=t.withKeys(t.withModifiers(S=>u(0),["prevent"]),["home"])),C[3]||(C[3]=t.withKeys(t.withModifiers(S=>u(c.length-1),["prevent"]),["end"]))]},t.toDisplayString(i(v.labelKey)),43,yL)),64))],8,hL),t.withDirectives(t.createElementVNode("textarea",{"onUpdate:modelValue":C[4]||(C[4]=v=>a.value=v),class:"em-text-import__input",placeholder:i("em.import.placeholder"),spellcheck:"false"},null,8,gL),[[t.vModelText,a.value]]),g.value?(t.openBlock(),t.createElementBlock("div",bL,[g.value.markerLocale?(t.openBlock(),t.createElementBlock("span",kL,t.toDisplayString(i("em.import.commentMarker",{locale:g.value.markerLocale})),1)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("label",_L,[t.createTextVNode(t.toDisplayString(i("em.import.commentLocale"))+" ",1),t.createVNode(t.unref(ne.BSSelect),{modelValue:l.value,"onUpdate:modelValue":C[5]||(C[5]=v=>l.value=v),class:"em-text-import__locale-sel",items:s,"value-provider":v=>v.v,"label-provider":v=>v.v===""?i("em.import.commentLocaleUnset"):v.v},null,8,["modelValue","value-provider","label-provider"])]),t.createElementVNode("span",EL,t.toDisplayString(i("em.import.commentEvidence",{n:g.value.comments,hangul:g.value.hangul,kana:g.value.kana,undecidable:g.value.undecidable}))+" · "+t.toDisplayString(b.value),1)],64))])):t.createCommentVNode("",!0),t.createElementVNode("div",NL,[y.value.status==="ok"&&y.value.source?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("span",wL,t.toDisplayString(i("em.import.detected",{format:i(`em.import.format${p.value==="json"?"Json":p.value==="ddl"?"Ddl":"Mermaid"}`)}))+" · "+t.toDisplayString(i("em.import.summary",{entities:y.value.source.logical.entities.length,relations:y.value.source.logical.associations.length})),1),y.value.warnings&&y.value.warnings.length?(t.openBlock(),t.createElementBlock("span",IL," ⚠ "+t.toDisplayString(i("em.import.warnings",{n:y.value.warnings.length})),1)):t.createCommentVNode("",!0)],64)):y.value.status==="error"?(t.openBlock(),t.createElementBlock("span",vL,t.toDisplayString(i("em.import.error",{message:y.value.message??""})),1)):y.value.status==="unknown"?(t.openBlock(),t.createElementBlock("span",CL,t.toDisplayString(i("em.import.unknownFormat")),1)):y.value.status==="emptyParse"?(t.openBlock(),t.createElementBlock("span",SL,t.toDisplayString(i("em.import.emptyParse")),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",RL,[t.createVNode(t.unref(ne.BSButton),{caption:i("em.import.confirm"),disabled:!k.value,onClick:_},null,8,["caption","disabled"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:i("em.common.close"),onClick:C[6]||(C[6]=v=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-a5e84c63"]]),xL={class:"em-toolbar"},$L=["title"],TL={class:"em-toolbar__mode"},sg=tt(t.defineComponent({__name:"EditorToolbar",props:{controller:{},historyOpen:{type:Boolean}},emits:["exportSvg","exportPng","fitView","toggleHistory"],setup(e,{emit:n}){const i=e.controller,a=n,r=ne.useModal(),l=[{v:"LOGICAL",labelKey:"em.displayMode.logical"},{v:"PHYSICAL",labelKey:"em.displayMode.physical"},{v:"LOGICAL_PHYSICAL",labelKey:"em.displayMode.logicalPhysical"},{v:"CLASS",labelKey:"em.displayMode.class"}],s=t.computed({get:()=>i.displayMode.value,set:y=>i.displayMode.value=y});function c(){i.routingMode.value=i.routingMode.value==="straight"?"orthogonal":"straight"}const d=t.computed(()=>{const y=i.resolved.value.entities;return y.length>0&&y.every(g=>g.collapsed)});function u(){d.value?i.expandAll():i.collapseAll()}function m(){const y=fl(i.state.logical,i.referenceOnlyDocument.value);r.openModal({component:fL,bind:{title:i.t("em.toolbar.exportText"),locale:i.uiLocale.value,formats:[{key:"text",label:i.t("em.export.formatText"),content:_d(y,{embeddableCatalog:i.embeddableCatalog.value}),filename:"diagram.txt"},{key:"mermaid-er",label:i.t("em.export.formatMermaidEr"),content:Il(y,"er",{embeddableCatalog:i.embeddableCatalog.value}),filename:"diagram.er.mmd"},{key:"mermaid-class",label:i.t("em.export.formatMermaidClass"),content:Il(y,"class"),filename:"diagram.class.mmd"},{key:"ddl",label:i.t("em.export.formatDdl"),content:Dd(y,"postgres",{embeddableCatalog:i.embeddableCatalog.value,commentLocale:i.projectLanguage.value}),filename:"schema.sql"},{key:"json",label:i.t("em.export.formatJson"),content:Fd(y,i.state.layout),filename:"diagram.json"}]}})}function f(){r.openModal({component:AL,bind:{locale:i.uiLocale.value,onImport:y=>{i.importEntities(y,y.logical.entities.map(g=>g.modelId))}}})}function p(){r.openModal({component:ag,bind:{locale:i.uiLocale.value}})}return(y,g)=>(t.openBlock(),t.createElementBlock("div",xL,[t.unref(i).referenceOnlyDocument.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-toolbar__refonly",title:t.unref(i).t("em.toolbar.referenceOnlyDocHint")},t.toDisplayString(t.unref(i).t("em.toolbar.referenceOnlyBadge")),9,$L)):t.createCommentVNode("",!0),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.undo"),disabled:!t.unref(i).canUndo.value||!t.unref(i).editable.value,onClick:g[0]||(g[0]=b=>t.unref(i).undo())},{left:t.withCtx(()=>[t.createVNode(xe,{name:"undo",size:16})]),_:1},8,["tooltip","disabled"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.redo"),disabled:!t.unref(i).canRedo.value||!t.unref(i).editable.value,onClick:g[1]||(g[1]=b=>t.unref(i).redo())},{left:t.withCtx(()=>[t.createVNode(xe,{name:"redo",size:16})]),_:1},8,["tooltip","disabled"]),g[10]||(g[10]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),t.createElementVNode("label",TL,[t.createTextVNode(t.toDisplayString(t.unref(i).t("em.toolbar.displayLabel"))+" ",1),t.createVNode(t.unref(ne.BSSelect),{modelValue:s.value,"onUpdate:modelValue":g[2]||(g[2]=b=>s.value=b),items:l,"value-provider":b=>b.v,"label-provider":b=>t.unref(i).t(b.labelKey)},null,8,["modelValue","value-provider","label-provider"])]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(i).t(t.unref(i).routingMode.value==="orthogonal"?"em.toolbar.routingOrthogonal":"em.toolbar.routingStraight"),tooltip:t.unref(i).t("em.toolbar.routingToggle"),onClick:c},{left:t.withCtx(()=>[t.createVNode(xe,{name:"route",size:16})]),_:1},8,["caption","tooltip"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:t.normalizeClass(["em-toolbar__toggle",{"is-active":t.unref(i).showGrid.value}]),caption:t.unref(i).t("em.toolbar.grid"),tooltip:t.unref(i).t(t.unref(i).showGrid.value?"em.toolbar.gridOff":"em.toolbar.gridOn"),onClick:g[3]||(g[3]=b=>t.unref(i).showGrid.value=!t.unref(i).showGrid.value)},{left:t.withCtx(()=>[t.createVNode(xe,{name:"grid",size:16})]),_:1},8,["class","caption","tooltip"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:t.normalizeClass(["em-toolbar__toggle",{"is-active":t.unref(i).showMinimap.value}]),caption:t.unref(i).t("em.toolbar.minimap"),tooltip:t.unref(i).t(t.unref(i).showMinimap.value?"em.toolbar.minimapOff":"em.toolbar.minimapOn"),onClick:g[4]||(g[4]=b=>t.unref(i).showMinimap.value=!t.unref(i).showMinimap.value)},{left:t.withCtx(()=>[t.createVNode(xe,{name:"map",size:16})]),_:1},8,["class","caption","tooltip"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(i).t(d.value?"em.panel.expandAll":"em.panel.collapseAll"),disabled:!t.unref(i).editable.value,onClick:u},{left:t.withCtx(()=>[t.createVNode(xe,{name:d.value?"expand-all":"collapse-all",size:16},null,8,["name"])]),_:1},8,["caption","disabled"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn em-toolbar__fit",tooltip:t.unref(i).t("em.toolbar.fitView"),onClick:g[5]||(g[5]=b=>a("fitView"))},{left:t.withCtx(()=>[t.createVNode(xe,{name:"fit-view",size:16})]),_:1},8,["tooltip"]),g[11]||(g[11]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.import"),disabled:!t.unref(i).editable.value,onClick:f},{left:t.withCtx(()=>[t.createVNode(xe,{name:"clipboard",size:16})]),_:1},8,["tooltip","disabled"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportText"),onClick:m},{left:t.withCtx(()=>[t.createVNode(xe,{name:"file-text",size:16})]),_:1},8,["tooltip"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportSvg"),onClick:g[6]||(g[6]=b=>a("exportSvg"))},{left:t.withCtx(()=>[t.createVNode(xe,{name:"image",size:16})]),_:1},8,["tooltip"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportPng"),onClick:g[7]||(g[7]=b=>a("exportPng"))},{left:t.withCtx(()=>[t.createVNode(xe,{name:"camera",size:16})]),_:1},8,["tooltip"]),g[12]||(g[12]=t.createElementVNode("span",{class:"em-toolbar__spacer"},null,-1)),t.unref(i).historyAvailable.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:t.normalizeClass(["em-toolbar__toggle",{"is-active":e.historyOpen}]),caption:t.unref(i).t("em.toolbar.history"),tooltip:t.unref(i).t(e.historyOpen?"em.toolbar.historyClose":"em.toolbar.historyOpen"),onClick:g[8]||(g[8]=b=>a("toggleHistory"))},{left:t.withCtx(()=>[t.createVNode(xe,{name:"history",size:16})]),_:1},8,["class","caption","tooltip"]),g[9]||(g[9]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1))],64)):t.createCommentVNode("",!0),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-toolbar__icon-btn em-toolbar__help",tooltip:t.unref(i).t("em.toolbar.shortcuts"),onClick:p},{left:t.withCtx(()=>[t.createVNode(xe,{name:"help",size:16})]),_:1},8,["tooltip"])]))}}),[["__scopeId","data-v-f45e3146"]]),ML=["title"],VL=["title"],LL=["disabled","aria-pressed"],BL=["disabled","aria-pressed"],DL=tt(t.defineComponent({__name:"EditModeToggle",props:{editable:{type:Boolean},opMode:{type:Boolean},frozen:{type:Boolean},locale:{}},emits:["toggle"],setup(e,{emit:n}){const o=e,i=n,a=l=>cn(o.locale??"ko",l);function r(l){o.frozen||!o.opMode||l!==o.editable&&i("toggle")}return(l,s)=>e.frozen?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-mode-toggle em-mode-frozen",role:"status",title:a("em.mode.frozenTitle")},[t.createVNode(xe,{name:"lock",size:14}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.frozen")),1)],8,ML)):(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["em-mode-toggle em-mode-segment",{"is-readonly":!e.opMode}]),role:"group",title:e.opMode?void 0:a("em.mode.readonlyTitle")},[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-seg",{"is-active":!e.editable}]),disabled:!e.opMode,"aria-pressed":!e.editable,onClick:s[0]||(s[0]=c=>r(!1))},[t.createVNode(xe,{name:"eye",size:13}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.view")),1)],10,LL),t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-seg",{"is-active":e.editable}]),disabled:!e.opMode,"aria-pressed":e.editable,onClick:s[1]||(s[1]=c=>r(!0))},[t.createVNode(xe,{name:"pencil",size:13}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.edit")),1)],10,BL)],10,VL))}}),[["__scopeId","data-v-2b5162b7"]]),OL=["disabled"],PL={class:"em-panel__sub"},zL={class:"em-nav"},FL={key:0,class:"em-nav__divider","aria-hidden":"true"},UL={key:1},HL=["onClick","onKeydown"],jL={class:"em-nav__name"},KL=["title"],GL={key:0,class:"em-panel__note"},YL=["data-attr-block"],qL={key:0,class:"em-embed-col__label"},WL={class:"em-attr__row"},JL=["title"],XL={key:1,class:"em-attr__row"},ZL={key:2,class:"em-embed-cols"},QL={class:"em-embed-col"},eB={class:"em-embed-col__label"},tB={class:"em-attr__row"},nB={class:"em-attr__navhint"},oB={key:3,class:"em-attr__navhint"},iB={class:"em-attr__navhint"},aB={class:"em-attr__row"},rB={class:"em-field"},lB={key:0,class:"em-attr__navhint"},sB={class:"em-attr__row"},cB={class:"em-attr__row"},dB=["title"],uB={class:"em-attr__flags"},mB={class:"em-attr__pii"},fB={class:"em-attr__pii"},pB={key:1,class:"em-attr__pii"},hB={key:2,class:"em-attr__pii em-attr__codetop"},yB={class:"em-multilang"},gB={key:6,class:"em-embed-cols"},bB={key:0,class:"em-attr__navhint"},kB={class:"em-embed-col__label"},_B={class:"em-attr__row"},EB=["title"],NB=["title"],wB=["title"],IB={class:"em-attr__row"},vB={key:0,class:"em-embed-upd","data-em-slot-ctl":"currency"},CB={key:1,class:"em-attr__navhint"},SB={class:"em-embed-upd","data-em-slot-ctl":"insertable"},RB={class:"em-embed-upd","data-em-slot-ctl":"updatable"},AB={class:"em-embed-upd","data-em-slot-ctl":"notnull"},xB={class:"em-attr__flags"},$B={class:"em-multilang"},TB={class:"em-swatch__row em-attr__swatch"},MB=["title","onClick"],VB=["title","onClick"],LB={key:0,class:"em-attr__swatch-hint"},BB=tt(t.defineComponent({__name:"EntityColumnsSection",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,{entity:i,isValueType:a,isColumnless:r,focusedAttrIds:l,personalInfoItems:s,piiLabel:c,idn:d,setAttrLogical:u,SERIALIZED_FIELD_CONTAINERS:m,setCollectionType:f,setAttr:p,isDerivedIdRow:y,rowName:g,rowNamePlaceholder:b,setRowName:k,assocFieldName:_,setAssocFieldName:h,nameLocked:C,nameLockedHint:v,isManagedFk:S,setNaturalId:N,setIdentifier:A,setTransient:T,dbLocked:O,fkDerived:z,fkOriginPhysical:P,typeLocked:D,typeValueOf:E,typeLabelOf:R,setAttrType:I,setAttrCustomType:x,setDb:$,scaleApplicable:U,scaleHint:F,setDbLogical:B,logicalPlaceholder:j,setAttrDescription:X,attrPiiValue:W,setAttrPii:oe,predefinedCustomTypeCatalog:de,serializedTypeNames:ie,embeddableCatalog:Ie,predefinedLabel:Le,groupCodeCatalog:Se,attrGroupCodes:ce,attrCodeItems:pe,codeValueOf:he,codeLabelOf:V,setAttrGroupCode:L,setAttrCode:K,setAttrDefaultValue:Z,hasColumnSlots:Q,isMultiColFk:fe,setDbAt:be,setDbLogicalAt:Ee,colSlotMeta:Ne,fixedDataType:J,fixedLength:ee,fixedScale:te,slotFixedHint:ge,updatableItems:Re,updatableLabel:Pe,updatableValue:Me,setUpdatableAt:Qe,setUpdatable:Ot,insertableItems:ht,insertableLabel:re,insertableValue:ve,setInsertableAt:le,setInsertable:me,notNullItems:ke,notNullLabel:Ze,notNullValue:ct,setNotNullAt:ft,sharedItems:qe,sharedLabel:Rt,sharedValue:et,setSharedAt:jt,isShared:Nt,sharedPhysical:ut}=ph(o,()=>n.entityId),yt=t.computed(()=>i.value?o.state.layout.entityLayouts.find(Ye=>Ye.entityRef===i.value.modelId)??null:null),At=t.computed(()=>{var Ye;return((Ye=i.value)==null?void 0:Ye.attributes.filter(Ue=>Ue.attrType!=="DIVIDER"))??[]}),jn=t.computed(()=>{var Ye;return((Ye=i.value)==null?void 0:Ye.attributes)??[]}),mt=t.computed(()=>At.value.filter(Ye=>l.value.has(Ye.modelId)));function ze(Ye){return{pk:Ye.identifier,fk:Ye.attrType.startsWith("RELATION")&&Ye.dbAttrs.length>0,required:Ye.notNull&&!Ye.identifier}}function Y(Ye){const Ue=ze(Ye),w=[Ue.pk&&"PK",Ue.fk&&"FK",Ue.required&&"NOT NULL"].filter(Boolean);return w.length?w.join(" · "):void 0}function Wt(Ye,Ue){i.value&&o.selectAttribute(i.value.modelId,Ye.modelId,Ue.shiftKey?"range":Ue.metaKey||Ue.ctrlKey?"toggle":"replace")}function G(Ye){var Ue,w;return Bt((w=(Ue=yt.value)==null?void 0:Ue.attributeStyles)==null?void 0:w[Ye.modelId])}function ae(Ye){return l.value.size>1&&l.value.has(Ye.modelId)}function De(Ye,Ue){if(!i.value)return;const w=ae(Ye)?o.selectedAttrIds.value:[Ye.modelId];o.setAttributeSwatches(i.value.modelId,w,Ue)}const je=t.ref(void 0);function bt(Ye){if(!Ye||!i.value)return;const Ue=o.addPredefinedEmbed(i.value.modelId,Ye);Ue&&o.selectAttribute(i.value.modelId,Ue),je.value=void 0}function Vt(){if(!i.value)return;const Ye=o.addAttribute(i.value.modelId);Ye&&o.selectAttribute(i.value.modelId,Ye)}return(Ye,Ue)=>t.unref(i)?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!t.unref(o).editable.value},[t.createElementVNode("h4",PL,[t.createTextVNode(t.toDisplayString(t.unref(o).t("em.attr.section",{n:At.value.length}))+" ",1),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:Vt},null,8,["caption"]),t.unref(Ie).length?(t.openBlock(),t.createBlock(t.unref(ne.BSSelect),{key:0,width:"120px",placeholder:t.unref(o).t("em.attr.addEmbeddable"),"model-value":je.value,items:t.unref(Ie),"value-provider":w=>w.type,"label-provider":t.unref(Le),"onUpdate:modelValue":bt},null,8,["placeholder","model-value","items","value-provider","label-provider"])):t.createCommentVNode("",!0)]),t.createElementVNode("ul",zL,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(jn.value,w=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:w.modelId},[w.attrType==="DIVIDER"?(t.openBlock(),t.createElementBlock("li",FL,[...Ue[0]||(Ue[0]=[t.createElementVNode("hr",null,null,-1)])])):(t.openBlock(),t.createElementBlock("li",UL,[t.createElementVNode("div",{class:t.normalizeClass(["em-nav__item",{"is-selected":t.unref(l).has(w.modelId)}]),role:"button",tabindex:"0",onClick:H=>Wt(w,H),onKeydown:[t.withKeys(t.withModifiers(H=>Wt(w,H),["prevent"]),["enter"]),t.withKeys(t.withModifiers(H=>Wt(w,H),["prevent"]),["space"])]},[t.createElementVNode("span",jL,t.toDisplayString(w.name||t.unref(o).t("em.attr.nameless")),1),t.createElementVNode("span",{class:"em-nav__marks",title:Y(w)},[ze(w).pk?(t.openBlock(),t.createBlock(xe,{key:0,name:"key",size:12,class:"em-nav-key is-pk"})):ze(w).required?(t.openBlock(),t.createBlock(xe,{key:1,name:"asterisk",size:14,class:"em-nav-key is-required"})):t.createCommentVNode("",!0),ze(w).fk?(t.openBlock(),t.createBlock(xe,{key:2,name:"key",size:12,class:"em-nav-key is-fk"})):t.createCommentVNode("",!0)],8,KL)],42,HL)]))],64))),128))]),At.value.length&&!mt.value.length?(t.openBlock(),t.createElementBlock("p",GL,t.toDisplayString(t.unref(o).t("em.attr.selectHint")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(mt.value,w=>{var H,se,_e,$e,Oe,He,Ke,we,Je,Xe;return t.openBlock(),t.createElementBlock("div",{key:w.modelId,class:t.normalizeClass(["em-attr",{"is-focused":t.unref(l).has(w.modelId)}]),"data-attr-block":w.modelId},[t.unref(y)(w)?(t.openBlock(),t.createElementBlock("span",qL,t.toDisplayString(t.unref(o).t("em.attr.derivedIdField")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",WL,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`attr-name-${w.modelId}`,width:"100%",disabled:t.unref(C)(w),title:t.unref(C)(w)?t.unref(v)(w):t.unref(y)(w)?t.unref(o).t("em.attr.derivedIdNote"):void 0,placeholder:t.unref(b)(w),"model-value":t.unref(g)(w),"onUpdate:modelValue":M=>t.unref(k)(w,M)},null,8,["name","disabled","title","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSSelect),{name:`attr-type-${w.modelId}`,width:"84px",placeholder:t.unref(o).t("em.attr.typePlaceholder"),disabled:t.unref(D)(w),items:t.unref(fd)(w.type,t.unref(de),t.unref(ie),t.unref(Ie)),"value-provider":t.unref(E),"label-provider":t.unref(R),"model-value":w.type,"onUpdate:modelValue":M=>t.unref(I)(w,M)},null,8,["name","placeholder","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(S)(w)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:M=>t.unref(o).removeAttribute(t.unref(i).modelId,w.modelId)},null,8,["onClick"])],8,JL)]),w.type===t.unref(pn)&&!t.unref(z)(w)?(t.openBlock(),t.createElementBlock("div",XL,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`attr-customtype-${w.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.customTypePlaceholder"),"model-value":w.customType??"","onUpdate:modelValue":M=>t.unref(x)(w,M)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(y)(w)?(t.openBlock(),t.createElementBlock("div",ZL,[t.createElementVNode("div",QL,[t.createElementVNode("span",eB,t.toDisplayString(t.unref(o).t("em.attr.assocField")),1),t.createElementVNode("div",tB,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`attr-assocname-${w.modelId}`,width:"100%",title:t.unref(o).t("em.attr.derivedIdNote"),placeholder:t.unref(o).t("em.attr.namePlaceholder"),"model-value":t.unref(_)(w),"onUpdate:modelValue":M=>t.unref(h)(w,M)},null,8,["name","title","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("p",nB,t.toDisplayString(t.unref(o).t("em.attr.derivedIdNote")),1)])])):t.createCommentVNode("",!0),w.attrType==="RELATION_REF"?(t.openBlock(),t.createElementBlock("p",oB,t.toDisplayString(t.unref(o).t("em.attr.inverseNavHint")),1)):t.createCommentVNode("",!0),t.unref(r)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[t.createElementVNode("p",iB,t.toDisplayString(t.unref(o).t("em.attr.serializedNoColumnNote")),1),t.createElementVNode("div",aB,[t.createVNode(Qt,{class:"grow",name:`attr-field-logical-${w.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,placeholder:t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":w.fieldLogicalName,"onUpdate:modelValue":M=>t.unref(u)(w,M)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("label",rB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.serializedContainer")),1),t.createVNode(t.unref(ne.BSSelect),{name:`attr-container-${w.modelId}`,width:"100%",items:[...t.unref(m)],"value-provider":t.unref(d),"label-provider":M=>M==="none"?t.unref(o).t("em.attr.serializedContainerNone"):M,"model-value":w.collectionType??"none","onUpdate:modelValue":M=>M&&t.unref(f)(w,M)},null,8,["name","items","value-provider","label-provider","model-value","onUpdate:modelValue"])])],64)):t.unref(Q)(w)?(t.openBlock(),t.createElementBlock("div",gB,[t.unref(fe)(w)?(t.openBlock(),t.createElementBlock("p",bB,t.toDisplayString(t.unref(o).t("em.attr.fkDerivedNote")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.dbAttrs,(M,q)=>{var Ce,Be,ue,Ae,it;return t.openBlock(),t.createElementBlock("div",{key:M.modelId,class:"em-embed-col"},[t.createElementVNode("span",kB,t.toDisplayString(((Ce=t.unref(Ne)(w,q))==null?void 0:Ce.name)??((Be=t.unref(Ne)(w,q))==null?void 0:Be.physicalName)??t.unref(o).t("em.attr.colFallback",{n:q+1})),1),t.createElementVNode("div",_B,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`embed-col-${M.modelId}`,width:"100%",disabled:t.unref(Nt)(M),placeholder:((ue=t.unref(Ne)(w,q))==null?void 0:ue.physicalName)??t.unref(o).t("em.attr.columnPlaceholder"),"model-value":t.unref(Nt)(M)?t.unref(ut)(M):M.physicalName,"onUpdate:modelValue":We=>t.unref(be)(w,q,{physicalName:We})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(ge)(w)},[t.createVNode(t.unref(ne.BSTextInput),{name:`embed-dtype-${M.modelId}`,width:"84px",disabled:"","model-value":t.unref(J)(w,q)},null,8,["name","model-value"])],8,EB),t.createElementVNode("span",{title:t.unref(ge)(w)},[t.createVNode(t.unref(ne.BSNumberInput),{name:`embed-len-${M.modelId}`,width:"48px",disabled:"","model-value":t.unref(ee)(w,q)},null,8,["name","model-value"])],8,NB),t.createElementVNode("span",{title:t.unref(ge)(w)},[t.createVNode(t.unref(ne.BSNumberInput),{name:`embed-scale-${M.modelId}`,width:"48px",disabled:"","model-value":t.unref(te)(w,q)},null,8,["name","model-value"])],8,wB)]),t.createVNode(Do,{controller:t.unref(o),"ref-id":M.modelId},null,8,["controller","ref-id"]),t.createElementVNode("div",IB,[t.createVNode(Qt,{class:"grow",name:`embed-logical-${M.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,placeholder:t.unref(Ct)((Ae=t.unref(Ne)(w,q))==null?void 0:Ae.logicalName,t.unref(o).userLanguage.value)??t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":M.logicalName,"onUpdate:modelValue":We=>t.unref(Ee)(w,q,We)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),(it=t.unref(Ne)(w,q))!=null&&it.shareable?(t.openBlock(),t.createElementBlock("label",vB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.currencyColumn")),1),t.createVNode(t.unref(ne.BSSelect),{width:"110px","model-value":t.unref(et)(M),items:t.unref(qe)(),"value-provider":t.unref(d),"label-provider":t.unref(Rt),"onUpdate:modelValue":We=>We&&t.unref(jt)(w,q,We)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(Nt)(M)?(t.openBlock(),t.createElementBlock("p",CB,t.toDisplayString(t.unref(o).t("em.attr.embedSharedHint")),1)):t.createCommentVNode("",!0),t.createElementVNode("label",SB,[Ue[3]||(Ue[3]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"110px",disabled:t.unref(Nt)(M),"model-value":t.unref(Nt)(M)?"false":t.unref(ve)(M),items:t.unref(ht),"value-provider":t.unref(d),"label-provider":t.unref(re),"onUpdate:modelValue":We=>We&&t.unref(le)(w,q,We)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",RB,[Ue[4]||(Ue[4]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"110px",disabled:t.unref(Nt)(M),"model-value":t.unref(Nt)(M)?"false":t.unref(Me)(M),items:t.unref(Re),"value-provider":t.unref(d),"label-provider":t.unref(Pe),"onUpdate:modelValue":We=>We&&t.unref(Qe)(w,q,We)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",AB,[Ue[5]||(Ue[5]=t.createElementVNode("span",null,"NOT NULL",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"110px",disabled:t.unref(Nt)(M)||t.unref(O)(w)||t.unref(z)(w),"model-value":t.unref(ct)(M),items:t.unref(ke),"value-provider":t.unref(d),"label-provider":t.unref(Ze),"onUpdate:modelValue":We=>We&&t.unref(ft)(w,q,We)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])])])}),128)),t.unref(fe)(w)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",xB,[t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-pk-${w.modelId}`,label:"Primary Key","model-value":w.identifier,disabled:"","onUpdate:modelValue":M=>t.unref(A)(w,M)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-nn-${w.modelId}`,label:"Not Null","model-value":w.notNull,disabled:"","onUpdate:modelValue":M=>t.unref(p)(w,{notNull:M})},null,8,["name","model-value","onUpdate:modelValue"])]),t.createElementVNode("fieldset",$B,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`attr-desc-${w.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":w.description,"onUpdate:modelValue":M=>t.unref(X)(w,M)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[t.unref(z)(w)?(t.openBlock(),t.createElementBlock("p",lB,t.toDisplayString(t.unref(o).t("em.attr.fkDerivedNote")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",sB,[t.createVNode(Qt,{class:"grow",name:`attr-logical-${w.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,placeholder:t.unref(j)(w,t.unref(o).userLanguage.value),"model-value":(H=w.dbAttrs[0])==null?void 0:H.logicalName,"onUpdate:modelValue":M=>t.unref(B)(w,M)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("div",cB,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`attr-col-${w.modelId}`,width:"100%",placeholder:t.unref(P)(w)??t.unref(o).t("em.attr.columnPlaceholder"),disabled:t.unref(O)(w),"model-value":((se=w.dbAttrs[0])==null?void 0:se.physicalName)??"","onUpdate:modelValue":M=>t.unref($)(w,{physicalName:M})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSSelect),{name:`attr-dtype-${w.modelId}`,width:"84px",placeholder:"dataType",disabled:t.unref(O)(w)||t.unref(z)(w),items:t.unref(ld)(((_e=w.dbAttrs[0])==null?void 0:_e.dataType)??"",t.unref(o).selectableDataTypes.value),"value-provider":t.unref(d),"label-provider":t.unref(hl),"model-value":(($e=w.dbAttrs[0])==null?void 0:$e.dataType)??"","onUpdate:modelValue":M=>M&&t.unref($)(w,{dataType:M})},null,8,["name","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSNumberInput),{name:`attr-len-${w.modelId}`,width:"48px",placeholder:"len",disabled:t.unref(O)(w)||t.unref(z)(w),"model-value":(Oe=w.dbAttrs[0])==null?void 0:Oe.length,"onUpdate:modelValue":M=>t.unref($)(w,{length:M||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(F)(w)},[t.createVNode(t.unref(ne.BSNumberInput),{name:`attr-scale-${w.modelId}`,width:"48px",placeholder:"scale",disabled:t.unref(O)(w)||t.unref(z)(w)||!t.unref(U)(w),"model-value":(He=w.dbAttrs[0])==null?void 0:He.scale,"onUpdate:modelValue":M=>t.unref($)(w,{scale:M||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,dB)]),t.createVNode(Do,{controller:t.unref(o),"ref-id":(Ke=w.dbAttrs[0])==null?void 0:Ke.modelId},null,8,["controller","ref-id"]),t.createElementVNode("div",uB,[t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-pk-${w.modelId}`,label:"Primary Key","model-value":w.identifier,disabled:t.unref(a)||t.unref(O)(w)||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref(A)(w,M)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-nn-${w.modelId}`,label:"Not Null","model-value":w.notNull,disabled:t.unref(O)(w)||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref(p)(w,{notNull:M})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-uq-${w.modelId}`,label:"Unique","model-value":!!((we=w.dbAttrs[0])!=null&&we.unique),disabled:t.unref(O)(w)||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref($)(w,{unique:M})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-ai-${w.modelId}`,label:"Auto Increment","model-value":!!((Je=w.dbAttrs[0])!=null&&Je.autoIncrement),disabled:t.unref(O)(w)||t.unref(z)(w)||!w.identifier,"onUpdate:modelValue":M=>t.unref($)(w,{autoIncrement:M})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-tr-${w.modelId}`,label:"@Transient","model-value":!!w.transient,disabled:w.identifier||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref(T)(w,M)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-nid-${w.modelId}`,label:"@NaturalId","model-value":!!w.naturalId,disabled:w.identifier||t.unref(O)(w)||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref(N)(w,M)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{class:"em-attr__flag-sub",name:`attr-nidm-${w.modelId}`,label:"mutable","model-value":!!w.naturalIdMutable,disabled:t.unref(O)(w)||!w.naturalId,"onUpdate:modelValue":M=>t.unref(p)(w,{naturalIdMutable:M||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`attr-mv-${w.modelId}`,label:"Multi-Value (Set)","model-value":!!((Xe=w.dbAttrs[0])!=null&&Xe.multiValue),disabled:t.unref(O)(w)||t.unref(z)(w),"onUpdate:modelValue":M=>t.unref($)(w,{multiValue:M||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),t.createElementVNode("label",mB,[Ue[1]||(Ue[1]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"100%",disabled:t.unref(O)(w),"model-value":t.unref(ve)(w.dbAttrs[0]),items:t.unref(ht),"value-provider":t.unref(d),"label-provider":t.unref(re),"onUpdate:modelValue":M=>M&&t.unref(me)(w,M)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",fB,[Ue[2]||(Ue[2]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(ne.BSSelect),{width:"100%",disabled:t.unref(O)(w),"model-value":t.unref(Me)(w.dbAttrs[0]),items:t.unref(Re),"value-provider":t.unref(d),"label-provider":t.unref(Pe),"onUpdate:modelValue":M=>M&&t.unref(Ot)(w,M)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.unref(z)(w)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",pB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createVNode(t.unref(ne.BSSelect),{width:"100%","model-value":t.unref(W)(w),items:t.unref(s),"value-provider":t.unref(d),"label-provider":t.unref(c),"onUpdate:modelValue":M=>M&&t.unref(oe)(w,M)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])),t.unref(Se).length&&!t.unref(z)(w)?(t.openBlock(),t.createElementBlock("label",hB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.codeGroup")),1),t.createVNode(kh,{"model-value":w.groupCode,items:t.unref(Se),locale:t.unref(o).uiLocale.value,"onUpdate:modelValue":M=>t.unref(L)(w,M)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(z)(w)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",{key:3,class:t.normalizeClass(["em-attr__pii",{"em-attr__codetop":!t.unref(Se).length}])},[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.defaultValue")),1),t.unref(ce)(w).length?(t.openBlock(),t.createBlock(t.unref(ne.BSSelect),{key:0,width:"100%","model-value":w.defaultValue??"none",items:t.unref(pe)(w),"value-provider":t.unref(he),"label-provider":t.unref(V),"onUpdate:modelValue":M=>M&&t.unref(K)(w,M)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])):(t.openBlock(),t.createBlock(t.unref(ne.BSTextInput),{key:1,name:`attr-default-${w.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.defaultValue"),"model-value":w.defaultValue??"","onUpdate:modelValue":M=>t.unref(Z)(w,M)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))],2)),t.createElementVNode("fieldset",yB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`attr-desc-${w.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":w.description,"onUpdate:modelValue":M=>t.unref(X)(w,M)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)),t.createElementVNode("div",TB,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":G(w)===null}]),title:t.unref(o).t("em.swatch.none"),onClick:M=>De(w,null)},"∅",10,MB),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),M=>(t.openBlock(),t.createElementBlock("button",{key:M,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":G(w)===M}]),style:t.normalizeStyle({background:t.unref(di)(M)}),title:t.unref(o).t(t.unref(Bo)(M)),onClick:q=>De(w,M)},null,14,VB))),128)),ae(w)?(t.openBlock(),t.createElementBlock("span",LB,t.toDisplayString(t.unref(o).t("em.attr.batchHint",{n:t.unref(l).size})),1)):t.createCommentVNode("",!0)])],10,YL)}),128))],8,OL)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-4127b61b"]]),DB=["disabled"],OB={class:"em-panel__sub-label"},PB={class:"em-attr__row"},zB={class:"em-field em-idx-params"},FB=["value","placeholder","onChange"],UB=tt(t.defineComponent({__name:"EntityIndexSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean}},emits:["toggle"],setup(e,{emit:n}){const o=e,i=n,a=o.controller,r=t.computed(()=>a.state.logical.entities.find(v=>v.modelId===o.entityId)??null),l=t.computed(()=>r.value?bi(r.value,a.superClassCatalog.value):[]),s=t.computed(()=>{var v;return so(((v=r.value)==null?void 0:v.attributes)??[])}),c=v=>s.value.canon(v),d=t.computed(()=>({entity:r.value??{modelId:"",name:"",stereotype:"JPA_ENTITY",attributes:[]},logical:a.state.logical,resolver:s.value,inherited:l.value,embeddableCatalog:a.embeddableCatalog.value,t:a.t})),u=t.computed(()=>[...wh(d.value).map(v=>({value:v.ref,label:v.label})),...l.value.map(v=>({value:v.modelId,label:a.t("em.index.inherited",{field:v.field})}))]);function m(v,S){var O;const N=new Set(v.columns.filter((z,P)=>P!==S).map(z=>c(z.columnRef))),A=u.value.filter(z=>!N.has(c(z.value))),T=(O=v.columns[S])==null?void 0:O.columnRef;return T&&!A.some(z=>z.value===T)&&A.push({value:T,label:f(T)}),A}function f(v){return ic(v,d.value)}function p(v){const S=new Set(v.columns.map(N=>c(N.columnRef)));return u.value.filter(N=>!S.has(c(N.value)))}function y(){var S;if(!r.value)return;const v=u.value[0];a.addIndex(r.value.modelId,{modelId:Fe(),name:`idx_${(((S=r.value.indexes)==null?void 0:S.length)??0)+1}`,unique:!1,columns:v?[{columnRef:v.value,descending:!1}]:[]})}function g(v,S){r.value&&a.updateIndex(r.value.modelId,v,S)}function b(v){const S=p(v)[0];S&&g(v.modelId,{columns:[...v.columns,{columnRef:S.value,descending:!1}]})}function k(v,S,N){g(v.modelId,{columns:v.columns.map((A,T)=>T===S?{...A,columnRef:N}:A)})}function _(v,S,N){g(v.modelId,{columns:v.columns.map((A,T)=>T===S?{...A,descending:N}:A)})}function h(v,S){g(v.modelId,{columns:v.columns.filter((N,A)=>A!==S)})}function C(v,S){g(v.modelId,{parameters:S.trim()===""?void 0:S})}return(v,S)=>{var N;return r.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-section em-idx-section",disabled:!t.unref(a).editable.value},[t.createElementVNode("h4",{class:t.normalizeClass(["em-panel__sub",{"em-panel__sub--toggle":e.collapsible}]),onClick:S[0]||(S[0]=A=>e.collapsible&&i("toggle"))},[t.createElementVNode("span",OB,[e.collapsible?(t.openBlock(),t.createBlock(xe,{key:0,name:"chevron",size:13,class:t.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(t.unref(a).t("em.index.section",{n:((N=r.value.indexes)==null?void 0:N.length)??0})),1)]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(a).t("em.common.add"),onClick:t.withModifiers(y,["stop"])},null,8,["caption"])],2),!e.collapsible||!e.collapsed?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(r.value.indexes??[],A=>(t.openBlock(),t.createElementBlock("div",{key:A.modelId,class:"em-attr"},[t.createElementVNode("div",PB,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`idx-name-${A.modelId}`,width:"100%",placeholder:t.unref(a).t("em.index.namePlaceholder"),"model-value":A.name,"onUpdate:modelValue":T=>g(A.modelId,{name:T})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`idx-uq-${A.modelId}`,class:"em-check",label:"UQ","model-value":A.unique,"onUpdate:modelValue":T=>g(A.modelId,{unique:T})},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:T=>t.unref(a).removeIndex(r.value.modelId,A.modelId)},null,8,["onClick"])]),t.createVNode(Do,{controller:t.unref(a),"ref-id":A.modelId},null,8,["controller","ref-id"]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(A.columns,(T,O)=>(t.openBlock(),t.createElementBlock("div",{key:O,class:"em-attr__row"},[t.createVNode(t.unref(ne.BSSelect),{class:"grow","model-value":T.columnRef,items:m(A,O),"value-provider":z=>z.value,"label-provider":z=>z.label,"onUpdate:modelValue":z=>z&&k(A,O,z)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSCheckbox),{name:`idx-${A.modelId}-desc-${O}`,class:"em-check",label:"DESC","model-value":T.descending,"onUpdate:modelValue":z=>_(A,O,z)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:"−",onClick:z=>h(A,O)},null,8,["onClick"])]))),128)),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(a).t("em.index.addColumn"),disabled:!p(A).length,onClick:T=>b(A)},null,8,["caption","disabled","onClick"]),t.createElementVNode("label",zB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.index.condition")),1),t.createElementVNode("textarea",{class:"em-textarea",value:A.parameters??"",rows:"2",placeholder:t.unref(a).t("em.index.conditionPlaceholder"),onChange:T=>C(A,T.target.value)},null,40,FB)])]))),128)):t.createCommentVNode("",!0)],8,DB)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-ee0032b1"]]),HB=["disabled"],jB={class:"em-panel__sub-label"},KB={class:"em-attr__row"},GB={class:"em-attr__row"},YB={class:"em-multilang"},qB={class:"em-attr__pii"},WB={class:"em-swatch__row em-attr__swatch"},JB=["title","onClick"],XB=["title","onClick"],ZB=tt(t.defineComponent({__name:"EntityOperationsSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean}},emits:["toggle"],setup(e,{emit:n}){const o=e,i=n,a=o.controller,r=ne.useModal(),l=t.computed(()=>a.state.logical.entities.find(h=>h.modelId===o.entityId)??null),s=t.computed(()=>l.value?a.state.layout.entityLayouts.find(h=>h.entityRef===l.value.modelId)??null:null),c=["PUBLIC","PROTECTED","PACKAGE","PRIVATE"],d=["none","PASSWORD","SOCIAL_SECURITY_NO","PASSPORT_NO","ALIEN_REGISTRATION_NO","DRIVERS_LICENSE_NO","BIOMETRICS","CREDITCARD_NO","ACCOUNT_NO","MEMBERSHIP_CARD_NO","ID","NAME","DATE_OF_BIRTH","PHONE_NO","EMAIL_ADDRESS","ADDRESS","IP_ADDRESS"];function u(h){return h==="none"?a.t("em.common.noneParen"):h}const m=h=>h;function f(h,C){l.value&&a.updateOperation(l.value.modelId,h.modelId,C)}function p(h,C){f(h,{description:Object.keys(C).length?C:void 0})}function y(h){return h.personalInfoAttributeType??"none"}function g(h,C){f(h,{personalInfoAttributeType:C==="none"?void 0:C})}function b(h){var C,v;return Bt((v=(C=s.value)==null?void 0:C.operationStyles)==null?void 0:v[h.modelId])}function k(h,C){l.value&&a.setOperationSwatch(l.value.modelId,h.modelId,C)}function _(h){r.openModal({component:Ih,bind:{operationName:h.name,sourceCode:h.sourceCode??"",locale:a.uiLocale.value,onSave:C=>f(h,{sourceCode:C})}})}return(h,C)=>{var v;return l.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!t.unref(a).editable.value},[t.createElementVNode("h4",{class:t.normalizeClass(["em-panel__sub",{"em-panel__sub--toggle":e.collapsible}]),onClick:C[1]||(C[1]=S=>e.collapsible&&i("toggle"))},[t.createElementVNode("span",jB,[e.collapsible?(t.openBlock(),t.createBlock(xe,{key:0,name:"chevron",size:13,class:t.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"])):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(t.unref(a).t("em.op.section",{n:((v=l.value.operations)==null?void 0:v.length)??0})),1)]),t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(a).t("em.common.add"),onClick:C[0]||(C[0]=t.withModifiers(S=>t.unref(a).addOperation(l.value.modelId),["stop"]))},null,8,["caption"])],2),!e.collapsible||!e.collapsed?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(l.value.operations??[],S=>(t.openBlock(),t.createElementBlock("div",{key:S.modelId,class:"em-attr"},[t.createElementVNode("div",KB,[t.createVNode(t.unref(ne.BSTextInput),{class:"grow",name:`op-name-${S.modelId}`,width:"100%",placeholder:t.unref(a).t("em.op.namePlaceholder"),"model-value":S.name,"onUpdate:modelValue":N=>f(S,{name:N})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSSelect),{width:"96px","model-value":S.visibility??"PACKAGE",items:c,"value-provider":m,"label-provider":m,"onUpdate:modelValue":N=>N&&f(S,{visibility:N})},null,8,["model-value","onUpdate:modelValue"]),t.createVNode(t.unref(ne.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:N=>t.unref(a).removeOperation(l.value.modelId,S.modelId)},null,8,["onClick"])]),t.createElementVNode("div",GB,[t.createVNode(t.unref(ne.BSButton),{variant:"text",caption:t.unref(a).t(S.sourceCode?"em.op.editBodyDirty":"em.op.editBody"),onClick:N=>_(S)},null,8,["caption","onClick"])]),t.createElementVNode("fieldset",YB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`op-desc-${S.modelId}`,languages:t.unref(a).languages.value,"default-lang":t.unref(a).userLanguage.value,"model-value":S.description,"onUpdate:modelValue":N=>p(S,N)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])]),t.createElementVNode("label",qB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.attr.pii")),1),t.createVNode(t.unref(ne.BSSelect),{width:"100%","model-value":y(S),items:d,"value-provider":m,"label-provider":u,"onUpdate:modelValue":N=>N&&g(S,N)},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("div",WB,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":b(S)===null}]),title:t.unref(a).t("em.swatch.none"),onClick:N=>k(S,null)},"∅",10,JB),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),N=>(t.openBlock(),t.createElementBlock("button",{key:N,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":b(S)===N}]),style:t.normalizeStyle({background:t.unref(di)(N)}),title:t.unref(a).t(t.unref(Bo)(N)),onClick:A=>k(S,N)},null,14,XB))),128))])]))),128)):t.createCommentVNode("",!0)],8,HB)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-04208206"]]),QB=["title"],eD={class:"em-panel__head"},tD={class:"em-panel__head-row"},nD=["title"],oD={class:"em-panel__context"},iD={key:0,class:"em-panel__lock"},aD=["disabled"],rD={key:0,class:"em-attr__navhint"},lD={key:0,class:"em-panel__note"},sD={key:1,class:"em-panel__note"},cD={key:2,class:"em-jpa"},dD={class:"em-field"},uD={class:"em-field"},mD={class:"em-field"},fD={key:0,class:"em-field"},pD={class:"em-panel__note"},hD={class:"em-panel__sub"},yD={class:"em-field"},gD={class:"em-field"},bD={class:"em-jpa"},kD={key:0,class:"em-panel__note"},_D={key:1,class:"em-panel__note"},ED={class:"em-jpa"},ND={class:"em-field"},wD={key:0,class:"em-panel__note"},ID={class:"em-field"},vD={class:"em-multilang"},CD={class:"em-field"},SD=["value"],RD={class:"em-field"},AD={class:"em-swatch"},xD={class:"em-swatch__row"},$D=["title"],TD=["title","onClick"],MD={class:"em-panel__note"},VD={class:"em-field"},LD=["value"],BD={class:"em-swatch"},DD={class:"em-swatch__row"},OD=["title"],PD=["title","onClick"],cg=tt(t.defineComponent({__name:"PropertyPanel",props:{controller:{},width:{},resizing:{type:Boolean},startResize:{type:Function}},emits:["collapse"],setup(e,{expose:n,emit:o}){const i=e,a=o,r=t.ref(null);n({focusCollapse:()=>{var J;return(J=r.value)==null?void 0:J.focus()}});const l=i.controller,s=t.computed(()=>l.selection.value),c=t.computed(()=>l.inspectedEntityId.value),d=t.computed(()=>{const J=c.value;return J?l.state.logical.entities.find(ee=>ee.modelId===J)??null:null}),u=t.computed(()=>{const J=s.value;if((J==null?void 0:J.kind)==="association")return l.isAssociationLocked(J.id);const ee=c.value;return!!ee&&l.isEntityLocked(ee)}),m=t.computed(()=>{var J;return((J=l.selectedAttr.value)==null?void 0:J.attrId)??null}),f=t.computed(()=>new Set(l.selectedAttrIds.value)),p=t.computed(()=>m.value!==null),y=t.ref({});t.watch(p,()=>{y.value={}});function g(J){return y.value[J]??p.value}function b(J){y.value={...y.value,[J]:!g(J)}}const k=t.computed(()=>{var te;const J=d.value;if(!J)return l.t("em.entity.fallback");const ee=(te=J.table)==null?void 0:te.physicalName;return ee?`${J.name} (${ee})`:J.name}),_=t.computed(()=>{const J=s.value;return(J==null?void 0:J.kind)==="association"?l.state.logical.associations.find(ee=>ee.modelId===J.id)??null:null}),h=t.computed(()=>{const J=s.value;return(J==null?void 0:J.kind)==="group"?l.state.logical.groups.find(ee=>ee.modelId===J.id)??null:null}),C=t.computed(()=>{const J=s.value;return(J==null?void 0:J.kind)==="note"?l.state.layout.notes.find(ee=>ee.modelId===J.id)??null:null}),v=t.computed(()=>{var ee,te;const J=(ee=h.value)==null?void 0:ee.name;return Ct(J,l.userLanguage.value)||((te=h.value)==null?void 0:te.packageName)||l.t("em.group.fallback")}),S=t.computed(()=>{if(d.value){const J=f.value.size;if(J>1)return l.t("em.inspector.ctxEntityAttrs",{name:d.value.name,n:J});if(m.value){const ee=d.value.attributes.find(te=>te.modelId===m.value);return(ee==null?void 0:ee.attrType)==="DIVIDER"?l.t("em.inspector.ctxEntityDivider",{name:d.value.name}):l.t("em.inspector.ctxEntityAttr",{name:d.value.name,attr:(ee==null?void 0:ee.name)??""})}return l.t("em.inspector.ctxEntity",{name:d.value.name})}if(_.value){const J=ee=>{var te;return((te=l.state.logical.entities.find(ge=>ge.modelId===ee))==null?void 0:te.name)??ee};return l.t("em.inspector.ctxAssoc",{a:J(_.value.end1.entityRef),b:J(_.value.end2.entityRef)})}return h.value?l.t("em.inspector.ctxGroup",{name:v.value}):C.value?l.t("em.inspector.ctxNote"):l.t("em.inspector.ctxNone")}),N=["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"],A=["EXACTLY_ONE_INSTANCE","NO_INSTANCE_OR_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES"],T={EXACTLY_ONE_INSTANCE:"em.embed.card1",NO_INSTANCE_OR_ONE_INSTANCE:"em.embed.card01",ZERO_OR_MORE_INSTANCES:"em.embed.card0N"},O=J=>{const ee=T[J];return ee?l.t(ee):J},z=J=>{var ee;return((ee=l.state.logical.entities.find(te=>te.modelId===J))==null?void 0:ee.name)??J},P=["ALL","PERSIST","MERGE","REMOVE","REFRESH","DETACH"],D=["LIST","SET"],E=["inherit","LAZY","EAGER"],R=J=>J;function I(J){return J==="inherit"?l.t("em.common.inherit"):J}const x=t.computed(()=>!!_.value&&_.value.end1.entityRef===_.value.end2.entityRef);function $(J,ee){_.value&&l.updateAssociationEnd(_.value.modelId,J,ee)}function U(J){return ce.value?J:J==="end1"?"end2":"end1"}function F(J){var Re;const ee=(Re=_.value)==null?void 0:Re[J];if(!(ee!=null&&ee.attributeRef))return;const te=l.state.logical.entities.find(Pe=>Pe.modelId===ee.entityRef),ge=te==null?void 0:te.attributes.find(Pe=>Pe.modelId===ee.attributeRef);return ge&&(ge.attrType==="RELATION_OWN"||ge.attrType==="RELATION_REF")?ge.name:void 0}function B(J,ee){var ge;const te=(ge=_.value)==null?void 0:ge[J];te!=null&&te.attributeRef&&l.updateAttribute(te.entityRef,te.attributeRef,{name:ee})}function j(J){var Pe;const ee=F(J);if(ee!==void 0)return ee;const te=(Pe=_.value)==null?void 0:Pe[J];if(te!=null&&te.navFieldNameHint)return te.navFieldNameHint;const ge=J==="end1"?"end2":"end1",Re=l.state.logical.entities.find(Me=>{var Qe;return Me.modelId===((Qe=_.value)==null?void 0:Qe[ge].entityRef)});return Re?Ia(Re.name,Na(_.value[ge].multiplicity)):""}function X(J){return!!ce.value||F(J)!==void 0}function W(J){_.value&&!x.value&&l.setAssociationIdentifying(_.value.modelId,J)}function oe(J){var ee,te,ge;return!!((ge=(te=(ee=_.value)==null?void 0:ee[J].jpa)==null?void 0:te.cascadeTypes)!=null&&ge.includes("ALL"))}function de(J,ee,te){var Pe,Me;const ge=(Pe=_.value)==null?void 0:Pe[J];if(ee==="ALL"&&te){$(J,{jpa:{...ge==null?void 0:ge.jpa,cascadeTypes:["ALL"]}});return}const Re=new Set(((Me=ge==null?void 0:ge.jpa)==null?void 0:Me.cascadeTypes)??[]);te?Re.add(ee):Re.delete(ee),$(J,{jpa:{...ge==null?void 0:ge.jpa,cascadeTypes:[...Re]}})}function ie(J,ee){var ge;const te=(ge=_.value)==null?void 0:ge[J];$(J,{jpa:{...te==null?void 0:te.jpa,...ee}})}function Ie(J){var ee,te;return((te=(ee=_.value)==null?void 0:ee[J].jpa)==null?void 0:te.fetchType)??"inherit"}function Le(J,ee){ie(J,{fetchType:ee==="inherit"?void 0:ee})}function Se(J){var te;const ee=(te=_.value)==null?void 0:te[J==="end1"?"end2":"end1"];return(ee==null?void 0:ee.multiplicity)==="ZERO_OR_MORE_INSTANCES"||(ee==null?void 0:ee.multiplicity)==="ONE_OR_MORE_INSTANCES"}const ce=t.computed(()=>{const J=_.value;if(!J)return null;for(const ee of l.state.logical.entities){const te=ee.attributes.find(Me=>{var Qe;return((Qe=Me.embedded)==null?void 0:Qe.associationRef)===J.modelId&&Me.attrType==="EMBED_OWN"});if(!te)continue;const ge=J.end2.entityRef===te.embedded.embeddableRef?"end2":"end1",Re=J[ge].multiplicity,Pe=J[ge].jpa;return{which:ge,cardinality:Re,isCollection:Re==="ZERO_OR_MORE_INSTANCES"||Re==="ONE_OR_MORE_INSTANCES",collectionType:(Pe==null?void 0:Pe.collectionType)??"LIST",collectionTable:(Pe==null?void 0:Pe.collectionTable)??"",orderColumn:(Pe==null?void 0:Pe.orderColumn)??""}}return null});function pe(J){_.value&&l.setEmbedCardinality(_.value.modelId,J)}function he(J){const ee=ce.value;ee&&ie(ee.which,J==="SET"?{collectionType:"SET",orderColumn:void 0}:{collectionType:"LIST"})}function V(J){const ee=ce.value;ee&&ie(ee.which,{collectionTable:J.trim()||void 0})}function L(J){const ee=ce.value;ee&&ie(ee.which,{orderColumn:J.trim()||void 0})}function K(J){h.value&&l.updateGroup(h.value.modelId,J)}function Z(J,ee){var te;K({name:{...(te=h.value)==null?void 0:te.name,[J]:ee}})}const Q=t.computed(()=>{var J;return h.value?Bt((J=l.state.layout.groupLayouts.find(ee=>ee.groupRef===h.value.modelId))==null?void 0:J.style):null});function fe(J){h.value&&l.setGroupSwatch(h.value.modelId,J)}function be(J){C.value&&l.setNoteMemo(C.value.modelId,J)}const Ee=t.computed(()=>{var J;return Bt((J=C.value)==null?void 0:J.style)});function Ne(J){C.value&&l.setNoteSwatch(C.value.modelId,J)}return(J,ee)=>(t.openBlock(),t.createElementBlock("aside",{class:"em-panel",style:t.normalizeStyle({width:e.width+"px"})},[t.createElementVNode("div",{class:t.normalizeClass(["em-resize-handle em-resize-handle--left",{"is-dragging":e.resizing}]),title:t.unref(l).t("em.panel.resizeWidth"),onPointerdown:ee[0]||(ee[0]=(...te)=>e.startResize&&e.startResize(...te))},null,42,QB),t.createElementVNode("header",eD,[t.createElementVNode("div",tD,[ee[14]||(ee[14]=t.createElementVNode("h3",{class:"em-panel__title"},"Inspector",-1)),t.createElementVNode("button",{ref_key:"collapseBtn",ref:r,type:"button",class:"em-panel__btn",title:t.unref(l).t("em.panel.collapse"),onClick:ee[1]||(ee[1]=te=>a("collapse"))},[t.createVNode(xe,{name:"panel-right-close",size:16})],8,nD)]),t.createElementVNode("p",oD,t.toDisplayString(S.value),1),u.value&&c.value?(t.openBlock(),t.createElementBlock("div",iD,[t.createVNode(xe,{name:"lock",size:13}),t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.panel.lockedBanner")),1),t.unref(l).editable.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-panel__unlock",onClick:ee[2]||(ee[2]=te=>t.unref(l).setEntityLocked(c.value,!1))},t.toDisplayString(t.unref(l).t("em.panel.unlock")),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),t.createElementVNode("fieldset",{class:"em-panel__body em-scroll-overlay",disabled:!t.unref(l).editable.value||u.value},[d.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createVNode(fh,{controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("basics"),title:k.value,onToggle:ee[3]||(ee[3]=te=>b("basics"))},null,8,["controller","entity-id","collapsed","title"]),t.createVNode(BB,{controller:t.unref(l),"entity-id":d.value.modelId},null,8,["controller","entity-id"]),t.unref(mn)(d.value.stereotype)?(t.openBlock(),t.createElementBlock("p",rD,t.toDisplayString(t.unref(l).t("em.entity.noIndexNote")),1)):(t.openBlock(),t.createBlock(UB,{key:1,controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("index"),onToggle:ee[4]||(ee[4]=te=>b("index"))},null,8,["controller","entity-id","collapsed"])),t.createVNode(ZB,{controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("ops"),onToggle:ee[5]||(ee[5]=te=>b("ops"))},null,8,["controller","entity-id","collapsed"])],64)):t.createCommentVNode("",!0),_.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(t.unref(ne.BSCheckbox),{name:"assoc-identifying",class:"em-check",label:t.unref(l).t("em.assoc.identifying"),"model-value":!!_.value.identifying,disabled:x.value||!!ce.value,"onUpdate:modelValue":W},null,8,["label","model-value","disabled"]),x.value?(t.openBlock(),t.createElementBlock("p",lD,t.toDisplayString(t.unref(l).t("em.assoc.selfNoIdentifying")),1)):ce.value?(t.openBlock(),t.createElementBlock("p",sD,t.toDisplayString(t.unref(l).t("em.assoc.embedNoIdentifying")),1)):t.createCommentVNode("",!0),ce.value?(t.openBlock(),t.createElementBlock("fieldset",cD,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.embed.legend")),1),t.createElementVNode("label",dD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.embed.cardinality")),1),t.createVNode(t.unref(ne.BSSelect),{"model-value":ce.value.cardinality,items:A,"value-provider":R,"label-provider":O,"onUpdate:modelValue":ee[6]||(ee[6]=te=>te&&pe(te))},null,8,["model-value"])]),ce.value.isCollection?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",uD,[ee[15]||(ee[15]=t.createElementVNode("span",null,"collectionType",-1)),t.createVNode(t.unref(ne.BSSelect),{"model-value":ce.value.collectionType,items:D,"value-provider":R,"label-provider":R,"onUpdate:modelValue":ee[7]||(ee[7]=te=>te&&he(te))},null,8,["model-value"])]),t.createElementVNode("label",mD,[ee[16]||(ee[16]=t.createElementVNode("span",null,"collectionTable",-1)),t.createVNode(t.unref(ne.BSTextInput),{name:"embed-coll-table",width:"100%",placeholder:t.unref(l).t("em.embed.collectionTablePlaceholder"),"model-value":ce.value.collectionTable,"onUpdate:modelValue":V},null,8,["placeholder","model-value"])]),ce.value.collectionType==="LIST"?(t.openBlock(),t.createElementBlock("label",fD,[ee[17]||(ee[17]=t.createElementVNode("span",null,"orderColumn",-1)),t.createVNode(t.unref(ne.BSTextInput),{name:"embed-order-col",width:"100%",placeholder:t.unref(l).t("em.embed.orderColumnPlaceholder"),"model-value":ce.value.orderColumn,"onUpdate:modelValue":L},null,8,["placeholder","model-value"])])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0),t.createElementVNode("p",pD,t.toDisplayString(t.unref(l).t("em.embed.ownerFixedNote")),1)])):t.createCommentVNode("",!0),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(["end1","end2"],te=>{var ge,Re,Pe;return t.withDirectives(t.createElementVNode("div",{key:te,class:"em-end"},[t.createElementVNode("h4",hD,t.toDisplayString(te)+" → "+t.toDisplayString(z(_.value[te].entityRef)),1),ce.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",yD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.assoc.multiplicity")),1),t.createVNode(t.unref(ne.BSSelect),{"model-value":_.value[te].multiplicity,items:N,"value-provider":R,"label-provider":t.unref(wa),"onUpdate:modelValue":Me=>$(te,{multiplicity:Me})},null,8,["model-value","label-provider","onUpdate:modelValue"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:`${U(te)}-navigable`,class:"em-check",label:"navigable",title:U(te)==="end2"?t.unref(l).t("em.assoc.ownerNavFixed"):void 0,disabled:U(te)==="end2","model-value":U(te)==="end2"?!0:_.value[U(te)].navigable,"onUpdate:modelValue":Me=>$(U(te),{navigable:Me})},null,8,["name","title","disabled","model-value","onUpdate:modelValue"]),t.createElementVNode("label",gD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.assoc.navFieldName")),1),t.createVNode(t.unref(ne.BSTextInput),{name:`${U(te)}-navname`,width:"100%",disabled:!X(U(te)),placeholder:t.unref(l).t("em.attr.namePlaceholder"),"model-value":j(U(te)),"onUpdate:modelValue":Me=>B(U(te),Me)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:`${U(te)}-composition`,class:"em-check",label:"composition","model-value":_.value[U(te)].composition,"onUpdate:modelValue":Me=>$(U(te),{composition:Me})},null,8,["name","model-value","onUpdate:modelValue"])],64)),t.createElementVNode("fieldset",bD,[ee[18]||(ee[18]=t.createElementVNode("legend",null,"cascade",-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(P,Me=>{var Qe,Ot;return t.createVNode(t.unref(ne.BSCheckbox),{key:Me,name:`${U(te)}-cascade-${Me}`,class:"em-check",label:Me,"model-value":!!((Ot=(Qe=_.value[U(te)].jpa)==null?void 0:Qe.cascadeTypes)!=null&&Ot.includes(Me)),disabled:!X(U(te))||Me!=="ALL"&&oe(U(te)),"onUpdate:modelValue":ht=>de(U(te),Me,ht)},null,8,["name","label","model-value","disabled","onUpdate:modelValue"])}),64)),X(U(te))?oe(U(te))?(t.openBlock(),t.createElementBlock("p",_D,t.toDisplayString(t.unref(l).t("em.assoc.cascadeAllNote")),1)):t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("p",kD,t.toDisplayString(t.unref(l).t("em.assoc.navRequiredNote")),1))]),t.createElementVNode("fieldset",ED,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.assoc.jpaDetails")),1),t.createElementVNode("label",ND,[ee[19]||(ee[19]=t.createElementVNode("span",null,"fetchType",-1)),t.createVNode(t.unref(ne.BSSelect),{disabled:!X(U(te)),"model-value":Ie(U(te)),items:E,"value-provider":R,"label-provider":I,"onUpdate:modelValue":Me=>Me&&Le(U(te),Me)},null,8,["disabled","model-value","onUpdate:modelValue"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:`${U(te)}-orphan`,class:"em-check",label:"orphanRemoval","model-value":!!((ge=_.value[U(te)].jpa)!=null&&ge.orphanRemoval),disabled:!X(U(te))||Se(te),"onUpdate:modelValue":Me=>ie(U(te),{orphanRemoval:Me})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),Se(te)&&((Re=_.value[U(te)].jpa)!=null&&Re.orphanRemoval)?(t.openBlock(),t.createElementBlock("p",wD,t.toDisplayString(t.unref(l).t("em.assoc.orphanRemovalNote")),1)):t.createCommentVNode("",!0),t.createElementVNode("label",ID,[ee[20]||(ee[20]=t.createElementVNode("span",null,"orderBy",-1)),t.createVNode(t.unref(ne.BSTextInput),{name:`${U(te)}-orderby`,width:"100%",disabled:!X(U(te)),placeholder:t.unref(l).t("em.assoc.orderByPlaceholder"),"model-value":((Pe=_.value[U(te)].jpa)==null?void 0:Pe.orderBy)??"","onUpdate:modelValue":Me=>ie(U(te),{orderBy:Me.trim()||void 0})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])])])]),[[t.vShow,!ce.value||te===ce.value.which]])}),64))],64)):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("fieldset",vD,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.group.nameLegend")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(l).languages.value,te=>{var ge;return t.openBlock(),t.createElementBlock("label",{key:te,class:"em-lang"},[t.createElementVNode("span",null,t.toDisplayString(te),1),t.createVNode(t.unref(ne.BSTextInput),{name:`grp-name-${te}`,width:"100%","model-value":((ge=h.value.name)==null?void 0:ge[te])??"","onUpdate:modelValue":Re=>Z(te,Re)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),t.createElementVNode("label",CD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.common.description")),1),t.createElementVNode("textarea",{class:"em-textarea",value:h.value.description??"",rows:"3",onChange:ee[8]||(ee[8]=te=>K({description:te.target.value}))},null,40,SD)]),t.createElementVNode("label",RD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.entity.package")),1),t.createVNode(t.unref(ne.BSTextInput),{name:"grp-package",width:"100%","model-value":h.value.packageName??"","onUpdate:modelValue":ee[9]||(ee[9]=te=>K({packageName:te}))},null,8,["model-value"])]),t.createVNode(t.unref(ne.BSCheckbox),{name:"grp-exclude-ddl",class:"em-check",label:t.unref(l).t("em.group.excludeDDL"),"model-value":h.value.excludeDDLGeneration,"onUpdate:modelValue":ee[10]||(ee[10]=te=>K({excludeDDLGeneration:te}))},null,8,["label","model-value"]),t.createElementVNode("fieldset",AD,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.common.color")),1),t.createElementVNode("div",xD,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":Q.value===null}]),title:t.unref(l).t("em.swatch.none"),onClick:ee[11]||(ee[11]=te=>fe(null))},"∅",10,$D),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),te=>(t.openBlock(),t.createElementBlock("button",{key:te,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":Q.value===te}]),style:t.normalizeStyle({background:t.unref(di)(te)}),title:t.unref(l).t(t.unref(Bo)(te)),onClick:ge=>fe(te)},null,14,TD))),128))])]),t.createElementVNode("p",MD,t.toDisplayString(t.unref(l).t("em.group.members",{n:h.value.memberEntityRefs.length})),1)],64)):t.createCommentVNode("",!0),C.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createElementVNode("label",VD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.common.memo")),1),t.createElementVNode("textarea",{class:"em-textarea",value:C.value.memo,rows:"6",onChange:ee[12]||(ee[12]=te=>be(te.target.value))},null,40,LD)]),t.createElementVNode("fieldset",BD,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.common.color")),1),t.createElementVNode("div",DD,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":Ee.value===null}]),title:t.unref(l).t("em.swatch.none"),onClick:ee[13]||(ee[13]=te=>Ne(null))},"∅",10,OD),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Lo),te=>(t.openBlock(),t.createElementBlock("button",{key:te,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":Ee.value===te}]),style:t.normalizeStyle({background:t.unref(di)(te)}),title:t.unref(l).t(t.unref(Bo)(te)),onClick:ge=>Ne(te)},null,14,PD))),128))])])],64)):t.createCommentVNode("",!0)],8,aD)],4))}}),[["__scopeId","data-v-923cccbb"]]),zD=["title"],FD={class:"em-validation__title"},UD=["title","onClick"],HD={key:0,class:"em-validation__body"},jD={class:"em-validation__opt"},KD={key:0,class:"em-validation__empty"},GD={key:1,class:"em-validation__empty"},YD={key:2,class:"em-validation__list"},qD=["onClick"],WD={class:"em-validation__item-msg"},JD={key:0,class:"em-validation__item-entity"},XD=["title","onClick"],ZD=["title"],QD=tt(t.defineComponent({__name:"ValidationPanel",props:{controller:{},panelWidth:{},inspectorOpen:{type:Boolean,default:!0}},setup(e){const o=e.controller,i=t.computed(()=>o.issues.value),a=t.computed(()=>{const g=new Map;for(const b of o.state.logical.entities)g.set(b.modelId,b.name);return g});function r(g){const b=Qv(g);if(!b)return null;const k=a.value.get(b);return k===void 0?null:k.trim()===""?o.t("em.validation.nameless"):k}const l={error:{order:0,icon:"alert-circle",labelKey:"em.validation.severityError"},warning:{order:1,icon:"alert-triangle",labelKey:"em.validation.severityWarning"},info:{order:2,icon:"info",labelKey:"em.validation.severityInfo"}},s=t.computed(()=>{const g={error:0,warning:0,info:0};for(const b of i.value)g[b.severity]++;return g}),c=t.ref({error:!0,warning:!0,info:!0}),d=t.computed(()=>i.value.filter(g=>c.value[g.severity]).slice().sort((g,b)=>l[g.severity].order-l[b.severity].order)),u=t.computed(()=>d.value.map(g=>({issue:g,entityName:r(g),message:mh(o.t,g),category:Xv(o.t,g.ruleId)}))),m=t.ref(!1);function f(g){c.value[g]=!c.value[g]}function p(g){if(!m.value){m.value=!0;return}f(g)}function y(g){g.targetRef&&o.requestFocus(g.targetRef)}return(g,b)=>(t.openBlock(),t.createElementBlock("section",{class:t.normalizeClass(["em-validation",{"is-open":m.value,"is-inspector-collapsed":!e.inspectorOpen}]),style:t.normalizeStyle(m.value||!e.inspectorOpen?void 0:{width:e.panelWidth+"px"})},[t.createElementVNode("header",{class:"em-validation__head",onClick:b[1]||(b[1]=k=>m.value=!m.value)},[t.createElementVNode("button",{type:"button",class:"em-validation__toggle",title:t.unref(o).t(m.value?"em.panel.collapse":"em.panel.expand")},[t.createVNode(xe,{name:"chevron",size:14,class:t.normalizeClass([{"is-open":m.value},"em-validation__chevron"])},null,8,["class"]),t.createElementVNode("span",FD,t.toDisplayString(t.unref(o).t("em.validation.title")),1)],8,zD),t.createElementVNode("div",{class:"em-validation__counts",onClick:b[0]||(b[0]=t.withModifiers(()=>{},["stop"]))},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(["error","warning","info"],k=>t.createElementVNode("button",{key:k,type:"button",class:t.normalizeClass(["em-validation__count",[`is-${k}`,{"is-off":!c.value[k]}]]),title:m.value?t.unref(o).t(c.value[k]?"em.validation.hideSeverity":"em.validation.showSeverity",{label:t.unref(o).t(l[k].labelKey)}):t.unref(o).t("em.validation.expandPanel"),onClick:_=>p(k)},[t.createVNode(xe,{name:l[k].icon,size:14},null,8,["name"]),t.createElementVNode("span",null,t.toDisplayString(s.value[k]),1)],10,UD)),64))])]),m.value?(t.openBlock(),t.createElementBlock("div",HD,[t.createElementVNode("label",jD,[t.createVNode(t.unref(ne.BSCheckbox),{name:"val-flag-norel",label:t.unref(o).t("em.validation.checkOrphanEntities"),"model-value":t.unref(o).flagEntitiesWithoutRelations.value,"onUpdate:modelValue":b[2]||(b[2]=k=>t.unref(o).flagEntitiesWithoutRelations.value=k)},null,8,["label","model-value"])]),i.value.length===0?(t.openBlock(),t.createElementBlock("p",KD,t.toDisplayString(t.unref(o).t("em.validation.noIssues")),1)):d.value.length===0?(t.openBlock(),t.createElementBlock("p",GD,t.toDisplayString(t.unref(o).t("em.validation.noVisibleIssues")),1)):(t.openBlock(),t.createElementBlock("ul",YD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,({issue:k,entityName:_,message:h,category:C},v)=>(t.openBlock(),t.createElementBlock("li",{key:`${k.ruleId}:${k.targetRef??"model"}:${v}`,class:t.normalizeClass(["em-validation__item",[`is-${k.severity}`,{"is-clickable":!!k.targetRef}]]),onClick:S=>y(k)},[t.createVNode(xe,{name:l[k.severity].icon,size:15,class:"em-validation__item-icon"},null,8,["name"]),t.createElementVNode("span",WD,[_?(t.openBlock(),t.createElementBlock("span",JD,t.toDisplayString(_),1)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(h),1)]),t.unref(o).hasQuickFix(k)?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-validation__item-fix",title:t.unref(o).t("em.validation.quickFixTip"),onClick:t.withModifiers(S=>t.unref(o).applyQuickFix(k),["stop"])},t.toDisplayString(t.unref(o).t("em.validation.quickFix")),9,XD)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:"em-validation__item-cat",title:k.ruleId},t.toDisplayString(C),9,ZD)],10,qD))),128))]))])):t.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-251fd3f0"]]),eO=20;function tO(e,n=eO){if(typeof e!="string")return null;const o=e.split(`
|
|
74
|
+
`)[0].trim();return o?o.length>n?`${o.slice(0,n)}…`:o:null}function nO(e){var o;const n=new Map;for(const i of[...e].sort((a,r)=>a.seq-r.seq))for(const a of i.ops){if(a.kind!=="note.add"&&a.kind!=="note.setMemo")continue;const r=a.noteRef,l=(o=a.value)==null?void 0:o.memo;typeof r=="string"&&typeof l=="string"&&n.set(r,l)}return n}const oO={class:"em-history"},iO={class:"em-history__head"},aO={class:"em-history__title"},rO={class:"em-history__head-actions"},lO=["title","disabled"],sO=["title"],cO={class:"em-history__filters"},dO={class:"em-history__filter"},uO={class:"em-history__filters em-history__filters--period"},mO={class:"em-history__filter-label"},fO=["title","aria-label","max"],pO=["title","aria-label","min"],hO=["title"],yO={key:0,class:"em-history__diffbar"},gO={class:"em-history__diffbar-range"},bO={class:"em-history__diffbar-count"},kO={class:"em-history__body"},_O={key:0,class:"em-history__empty"},EO={key:1,class:"em-history__diff-list"},NO=["onClick"],wO={class:"em-history__action-head"},IO={class:"em-history__action-name"},vO={key:0,class:"em-history__fields"},CO={class:"em-history__fname"},SO={key:0,class:"em-history__old"},RO={class:"em-history__val"},AO={key:1,class:"em-history__empty"},xO={key:2,class:"em-history__empty is-error"},$O={key:3,class:"em-history__empty"},TO={key:4,class:"em-history__list"},MO=["onClick"],VO={class:"em-history__summary"},LO={class:"em-history__seq"},BO={class:"em-history__gmeta"},DO={class:"em-history__who"},OO={key:0,class:"em-history__time"},PO={key:1,class:"em-history__restored-from"},zO=["onClick"],FO={key:0,class:"em-history__detail"},UO={class:"em-history__action-head"},HO={class:"em-history__action-name"},jO={key:0,class:"em-history__fields"},KO={class:"em-history__fname"},GO={key:0,class:"em-history__old"},YO={class:"em-history__val"},qO={class:"em-history__preview"},WO=["disabled"],JO={key:0,class:"em-history__diff-list is-preview"},XO={class:"em-history__action-head"},ZO={class:"em-history__action-name"},QO={key:0,class:"em-history__fields"},eP={class:"em-history__fname"},tP={key:0,class:"em-history__old"},nP={class:"em-history__val"},oP={class:"em-history__confirm-row"},iP={class:"em-history__confirm-msg"},aP=["disabled","onClick"],rP=["disabled"],lP=["onClick"],il=50,sP=tt(t.defineComponent({__name:"HistoryPanel",props:{controller:{},open:{type:Boolean}},emits:["close","diffChange"],setup(e,{emit:n}){const o=e,i=n,a=o.controller,r=t.ref([]),l=t.ref(!1),s=t.ref(null),c=t.ref(!1),d=t.computed(()=>r.value.reduce((re,ve)=>ve.seq>re?ve.seq:re,-1/0));async function u(re){if(a.historyTransport){l.value=!0,s.value=null;try{const ve=!(re!=null&&re.full)&&r.value.length>0&&Number.isFinite(d.value),le=await a.historyTransport(ve?d.value:void 0);if(!ve)r.value=le;else if(le.length){const me=new Set(r.value.map(Ze=>Ze.seq)),ke=le.filter(Ze=>!me.has(Ze.seq));ke.length&&(r.value=[...r.value,...ke])}c.value=!0}catch(ve){s.value=ve instanceof Error?ve.message:a.t("em.history.loadError")}finally{l.value=!1}}}async function m(){await a.whenOpsSettled(),await u()}const f=t.ref(null),p=t.ref(null);t.watch(()=>o.open,re=>{re?m():(f.value=null,p.value=null)},{immediate:!0});let y=null;t.watch(()=>a.revision.value,()=>{o.open&&(y&&clearTimeout(y),y=setTimeout(()=>void m(),500))}),t.watch(()=>a.reloadRequest.value,()=>{o.open&&m()});const g=t.computed(()=>new Map(a.state.logical.entities.map(re=>[re.modelId,re]))),b=t.computed(()=>new Map(a.state.logical.associations.map(re=>[re.modelId,re]))),k=t.computed(()=>{const re=a.userLanguage.value;return new Map((a.state.logical.groups??[]).map(ve=>[ve.modelId,ve.packageName||Ct(ve.name,re)||ve.modelId]))}),_=t.computed(()=>new Map(a.state.layout.notes.map(re=>[re.modelId,re.memo]))),h=t.computed(()=>nO(r.value));function C(re){const ve=tO(_.value.get(re)??h.value.get(re));return a.t("em.history.noteSubject",{name:ve??re})}function v(re){var ke,Ze,ct,ft,qe,Rt,et;const ve=b.value.get(re);if(!ve)return a.t("em.history.assocFallback");if((ke=ve.description)!=null&&ke.trim())return ve.description.trim();const le=(ft=(ct=g.value.get((Ze=ve.end1)==null?void 0:Ze.entityRef))==null?void 0:ct.name)==null?void 0:ft.trim(),me=(et=(Rt=g.value.get((qe=ve.end2)==null?void 0:qe.entityRef))==null?void 0:Rt.name)==null?void 0:et.trim();return le&&me?`${le}→${me}`:a.t("em.history.assocFallback")}function S(re){var ve,le,me,ke;if(re.kind==="entity")return((le=(ve=g.value.get(re.ref))==null?void 0:ve.name)==null?void 0:le.trim())||a.t("em.attr.nameless");if(re.kind==="attribute"||re.kind==="operation"||re.kind==="index"){const Ze=re.entityRef?g.value.get(re.entityRef):void 0,ft=((re.kind==="attribute"?Ze==null?void 0:Ze.attributes:re.kind==="operation"?Ze==null?void 0:Ze.operations:Ze==null?void 0:Ze.indexes)??[]).find(Rt=>Rt.modelId===re.ref),qe=(me=Ze==null?void 0:Ze.name)==null?void 0:me.trim();return`${qe?qe+".":""}${((ke=ft==null?void 0:ft.name)==null?void 0:ke.trim())||re.ref}`}return re.kind==="association"?v(re.ref):re.kind==="associationEnd"?`${v(re.ref)}(${re.end})`:re.kind==="group"?a.t("em.history.groupSubject",{name:k.value.get(re.ref)??re.ref}):re.kind==="note"?C(re.ref):re.ref}const N={entity:"table",attribute:"field",operation:"method",index:"key",association:"link",associationEnd:"link",group:"folder",note:"note"},A={add:"em.history.verbAdd",update:"em.history.verbUpdate",remove:"em.history.verbRemove"},T=t.ref("all"),O=[{v:"all",labelKey:"em.history.filterAll"},{v:"edit",labelKey:"em.history.kindEdit"},{v:"restore",labelKey:"em.history.kindRestore"}],z=t.computed({get:()=>T.value,set:re=>{re&&(T.value=re)}}),P=t.computed(()=>ts(r.value)),D=t.computed(()=>P.value.length?P.value[0].seq:null),E=t.computed(()=>T.value==="all"?P.value:P.value.filter(re=>(re.kind??"edit")===T.value)),R=t.ref(il),I=t.ref(""),x=t.ref(""),$=t.computed(()=>!!I.value||!!x.value);function U(){I.value="",x.value=""}const F=t.computed(()=>{const re=I.value?new Date(`${I.value}T00:00:00`).getTime():null,ve=x.value?new Date(`${x.value}T23:59:59.999`).getTime():null;return re==null&&ve==null?E.value:E.value.filter(le=>{if(le.ts==null)return!1;const me=new Date(le.ts).getTime();return!(isNaN(me)||re!=null&&me<re||ve!=null&&me>ve)})}),B=t.computed(()=>F.value.slice(0,R.value)),j=t.computed(()=>Math.max(0,F.value.length-R.value));function X(){R.value+=il}t.watch([T,I,x],()=>{R.value=il}),t.watch(()=>o.open,re=>{re&&(R.value=il,U())});function W(re){return re===void 0?"—":re===null?a.t("em.history.emptyValue"):typeof re=="object"?JSON.stringify(re):String(re)}function oe(re){const ve=S(re.subject);if(re.verb==="add")return a.t("em.history.summaryAdd",{name:ve});if(re.verb==="remove")return a.t("em.history.summaryRemove",{name:ve});if(re.fields.length===1){const le=re.fields[0];return`${ve}.${le.field} ${le.oldValue!==void 0?W(le.oldValue)+"→":""}${W(le.value)}`}return a.t("em.history.summaryFields",{name:ve,n:re.fields.length})}function de(re){return re.actions.length===0?a.t("em.history.noChange"):re.actions.length===1?oe(re.actions[0]):a.t("em.history.summaryMore",{summary:oe(re.actions[0]),n:re.actions.length-1})}const ie=t.ref(new Set);function Ie(re){const ve=new Set(ie.value);ve.has(re)?ve.delete(re):ve.add(re),ie.value=ve}function Le(re){if(re==null)return"";const ve=new Date(re);return isNaN(ve.getTime())?String(re):ve.toLocaleString()}function Se(re){const ve=re.author,le=re.origin;return ve&&le?`${ve}(${le})`:ve||(le?`(${le})`:"—")}const ce=t.computed(()=>f.value==null?null:ns(r.value,{fromSeq:f.value,...p.value!=null?{toSeq:p.value}:{}}));t.watch(()=>ce.value?Iu(ce.value):null,re=>i("diffChange",re));function pe(re){f.value=re,p.value=null,Re.value=null}function he(){f.value=null,p.value=null}const V=t.computed(()=>P.value.map(re=>re.seq)),L=t.computed(()=>D.value??1/0),K=t.computed(()=>p.value??L.value),Z=t.computed(()=>p.value??L.value),Q=t.computed(()=>V.value.filter(re=>re<K.value).map(re=>({v:re}))),fe=t.computed(()=>V.value.filter(re=>f.value!=null&&re>f.value).map(re=>({v:re})));function be(re){re!=null&&(f.value=re,p.value!=null&&p.value<=re&&(p.value=null))}function Ee(re){re!=null&&(p.value=re>=L.value?null:re)}function Ne(re){return re>=L.value?a.t("em.history.diff.current"):`#${re}`}function J(re){return re.kind==="entity"?g.value.has(re.ref)?re.ref:null:(re.kind==="attribute"||re.kind==="operation"||re.kind==="index")&&re.entityRef?g.value.has(re.entityRef)?re.entityRef:null:re.kind==="group"?k.value.has(re.ref)?re.ref:null:re.kind==="note"&&_.value.has(re.ref)?re.ref:null}function ee(re){const ve=J(re);ve&&a.requestFocus(ve)}const te={added:"em.history.verbAdd",modified:"em.history.verbUpdate",removed:"em.history.verbRemove"},ge={added:"add",modified:"update",removed:"remove"},Re=t.ref(null),Pe=t.ref(!1),Me=t.computed(()=>Re.value==null?null:ns(r.value,{fromSeq:Re.value})),Qe=t.ref(!1);function Ot(re){Re.value=re,Qe.value=!1}async function ht(re){Pe.value=!0;try{const ve=await a.restoreToSeq(re);ve.ok?(f.value=null,p.value=null):s.value=a.t("em.history.restoreFailed",{reason:ve.reason??a.t("em.history.unknown")})}finally{Pe.value=!1,Re.value=null}}return(re,ve)=>(t.openBlock(),t.createBlock(t.Transition,{name:"em-history"},{default:t.withCtx(()=>{var le,me;return[t.withDirectives(t.createElementVNode("section",oO,[t.createElementVNode("header",iO,[t.createElementVNode("div",aO,[t.createVNode(xe,{name:"undo",size:15}),t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.history.title")),1)]),t.createElementVNode("div",rO,[t.createElementVNode("button",{type:"button",class:"em-history__btn",title:t.unref(a).t("em.history.refresh"),disabled:l.value,onClick:ve[0]||(ve[0]=ke=>u({full:!0}))},[t.createVNode(xe,{name:"redo",size:15})],8,lO),t.createElementVNode("button",{type:"button",class:"em-history__btn",title:t.unref(a).t("em.common.close"),onClick:ve[1]||(ve[1]=ke=>i("close"))},[t.createVNode(xe,{name:"panel-close",size:15})],8,sO)])]),t.createElementVNode("div",cO,[t.createElementVNode("label",dO,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.toolbar.displayLabel")),1),t.createVNode(t.unref(ne.BSSelect),{modelValue:z.value,"onUpdate:modelValue":ve[2]||(ve[2]=ke=>z.value=ke),items:O,"value-provider":ke=>ke.v,"label-provider":ke=>t.unref(a).t(ke.labelKey)},null,8,["modelValue","value-provider","label-provider"])])]),t.createElementVNode("div",uO,[t.createElementVNode("span",mO,t.toDisplayString(t.unref(a).t("em.history.periodLabel")),1),t.withDirectives(t.createElementVNode("input",{type:"date",class:"em-history__date",title:t.unref(a).t("em.history.periodFrom"),"aria-label":t.unref(a).t("em.history.periodFrom"),max:x.value||void 0,"onUpdate:modelValue":ve[3]||(ve[3]=ke=>I.value=ke)},null,8,fO),[[t.vModelText,I.value]]),ve[9]||(ve[9]=t.createElementVNode("span",{class:"em-history__period-sep"},"~",-1)),t.withDirectives(t.createElementVNode("input",{type:"date",class:"em-history__date",title:t.unref(a).t("em.history.periodTo"),"aria-label":t.unref(a).t("em.history.periodTo"),min:I.value||void 0,"onUpdate:modelValue":ve[4]||(ve[4]=ke=>x.value=ke)},null,8,pO),[[t.vModelText,x.value]]),$.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-history__period-reset",title:t.unref(a).t("em.history.periodReset"),onClick:U},[t.createVNode(xe,{name:"x",size:12})],8,hO)):t.createCommentVNode("",!0)]),f.value!=null?(t.openBlock(),t.createElementBlock("div",yO,[t.createElementVNode("div",gO,[t.createVNode(t.unref(ne.BSSelect),{class:"em-history__range-sel","model-value":f.value??void 0,items:Q.value,"value-provider":ke=>ke.v,"label-provider":ke=>`#${ke.v}`,"onUpdate:modelValue":ve[5]||(ve[5]=ke=>be(ke??null))},null,8,["model-value","items","value-provider","label-provider"]),t.createVNode(xe,{name:"arrow-lr",size:12,class:"em-history__diffbar-arrow"}),t.createVNode(t.unref(ne.BSSelect),{class:"em-history__range-sel","model-value":Z.value,items:fe.value,"value-provider":ke=>ke.v,"label-provider":ke=>Ne(ke.v),"onUpdate:modelValue":ve[6]||(ve[6]=ke=>Ee(ke??null))},null,8,["model-value","items","value-provider","label-provider"])]),t.createElementVNode("span",bO,t.toDisplayString(t.unref(a).t("em.history.diff.count",{n:((le=ce.value)==null?void 0:le.entries.length)??0})),1),t.createElementVNode("button",{type:"button",class:"em-history__diffbar-exit",onClick:he},t.toDisplayString(t.unref(a).t("em.history.diff.exit")),1)])):t.createCommentVNode("",!0),t.createElementVNode("div",kO,[f.value!=null?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[(me=ce.value)!=null&&me.entries.length?(t.openBlock(),t.createElementBlock("ul",EO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ce.value.entries,(ke,Ze)=>(t.openBlock(),t.createElementBlock("li",{key:Ze,class:t.normalizeClass(["em-history__diff-entry",{"is-focusable":!!J(ke.subject)}]),onClick:ct=>ee(ke.subject)},[t.createElementVNode("div",wO,[t.createVNode(xe,{name:N[ke.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",IO,t.toDisplayString(S(ke.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${ge[ke.verb]}`])},t.toDisplayString(t.unref(a).t(te[ke.verb])),3)]),ke.fields.length?(t.openBlock(),t.createElementBlock("ul",vO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ke.fields,(ct,ft)=>(t.openBlock(),t.createElementBlock("li",{key:ft,class:"em-history__field"},[t.createElementVNode("span",CO,t.toDisplayString(ct.field),1),ct.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",SO,t.toDisplayString(W(ct.oldValue)),1)):t.createCommentVNode("",!0),ct.oldValue!==void 0?(t.openBlock(),t.createBlock(xe,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",RO,t.toDisplayString(W(ct.value)),1)]))),128))])):t.createCommentVNode("",!0)],10,NO))),128))])):(t.openBlock(),t.createElementBlock("p",_O,t.toDisplayString(t.unref(a).t("em.history.diff.empty")),1))],64)):l.value&&!c.value?(t.openBlock(),t.createElementBlock("p",AO,t.toDisplayString(t.unref(a).t("em.history.loading")),1)):s.value?(t.openBlock(),t.createElementBlock("p",xO,t.toDisplayString(s.value),1)):F.value.length===0?(t.openBlock(),t.createElementBlock("p",$O,t.toDisplayString(c.value?t.unref(a).t("em.history.emptyLoaded"):t.unref(a).t("em.history.emptyNotLoaded")),1)):(t.openBlock(),t.createElementBlock("ul",TO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(B.value,ke=>{var Ze,ct,ft;return t.openBlock(),t.createElementBlock("li",{key:ke.seq,class:t.normalizeClass(["em-history__group",[`is-${ke.kind??"edit"}`]])},[t.createElementVNode("div",{class:"em-history__ghead",onClick:qe=>Ie(ke.seq)},[t.createVNode(xe,{name:"chevron",size:13,class:t.normalizeClass(["em-history__chevron",{"is-open":ie.value.has(ke.seq)}])},null,8,["class"]),t.createElementVNode("span",{class:t.normalizeClass(["em-history__kind",`is-${ke.kind??"edit"}`])},t.toDisplayString(t.unref(a).t(ke.kind==="restore"?"em.history.kindRestore":"em.history.kindEdit")),3),t.createElementVNode("span",VO,t.toDisplayString(de(ke)),1),t.createElementVNode("span",LO,"#"+t.toDisplayString(ke.seq),1)],8,MO),t.createElementVNode("div",BO,[t.createElementVNode("span",DO,t.toDisplayString(Se(ke)),1),ke.ts?(t.openBlock(),t.createElementBlock("span",OO,t.toDisplayString(Le(ke.ts)),1)):t.createCommentVNode("",!0),ke.kind==="restore"&&ke.restoredFromSeq!=null?(t.openBlock(),t.createElementBlock("span",PO,"← #"+t.toDisplayString(ke.restoredFromSeq),1)):t.createCommentVNode("",!0),ke.seq!==D.value?(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:"em-history__compare-btn",onClick:t.withModifiers(qe=>pe(ke.seq),["stop"])},t.toDisplayString(t.unref(a).t("em.history.diff.compare")),9,zO)):t.createCommentVNode("",!0)]),ie.value.has(ke.seq)?(t.openBlock(),t.createElementBlock("div",FO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ke.actions,(qe,Rt)=>(t.openBlock(),t.createElementBlock("div",{key:Rt,class:"em-history__action"},[t.createElementVNode("div",UO,[t.createVNode(xe,{name:N[qe.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",HO,t.toDisplayString(S(qe.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${qe.verb}`])},t.toDisplayString(t.unref(a).t(A[qe.verb])),3)]),qe.fields.length?(t.openBlock(),t.createElementBlock("ul",jO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(qe.fields,(et,jt)=>(t.openBlock(),t.createElementBlock("li",{key:jt,class:"em-history__field"},[t.createElementVNode("span",KO,t.toDisplayString(et.field),1),et.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",GO,t.toDisplayString(W(et.oldValue)),1)):t.createCommentVNode("",!0),et.oldValue!==void 0?(t.openBlock(),t.createBlock(xe,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",YO,t.toDisplayString(W(et.value)),1)]))),128))])):t.createCommentVNode("",!0)]))),128))])):t.createCommentVNode("",!0),t.unref(a).restoreAvailable.value&&ke.seq!==D.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["em-history__restore",{"is-confirming":Re.value===ke.seq}])},[Re.value===ke.seq?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",qO,[t.createElementVNode("button",{type:"button",class:"em-history__preview-toggle",disabled:!((Ze=Me.value)!=null&&Ze.entries.length),onClick:ve[7]||(ve[7]=qe=>Qe.value=!Qe.value)},[t.createVNode(xe,{name:"chevron",size:11,class:t.normalizeClass(["em-history__chevron",{"is-open":Qe.value}])},null,8,["class"]),t.createTextVNode(" "+t.toDisplayString((ct=Me.value)!=null&&ct.entries.length?t.unref(a).t("em.history.diff.restorePreview",{n:Me.value.entries.length}):t.unref(a).t("em.history.diff.restorePreviewNone")),1)],8,WO),Qe.value&&((ft=Me.value)!=null&&ft.entries.length)?(t.openBlock(),t.createElementBlock("ul",JO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Me.value.entries,(qe,Rt)=>(t.openBlock(),t.createElementBlock("li",{key:Rt,class:"em-history__diff-entry"},[t.createElementVNode("div",XO,[t.createVNode(xe,{name:N[qe.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",ZO,t.toDisplayString(S(qe.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${ge[qe.verb]}`])},t.toDisplayString(t.unref(a).t(te[qe.verb])),3)]),qe.fields.length?(t.openBlock(),t.createElementBlock("ul",QO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(qe.fields,(et,jt)=>(t.openBlock(),t.createElementBlock("li",{key:jt,class:"em-history__field"},[t.createElementVNode("span",eP,t.toDisplayString(et.field),1),et.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",tP,t.toDisplayString(W(et.oldValue)),1)):t.createCommentVNode("",!0),et.oldValue!==void 0?(t.openBlock(),t.createBlock(xe,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",nP,t.toDisplayString(W(et.value)),1)]))),128))])):t.createCommentVNode("",!0)]))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("div",oP,[t.createElementVNode("span",iP,t.toDisplayString(t.unref(a).t("em.history.confirmRestore")),1),t.createElementVNode("button",{type:"button",class:"em-history__confirm-yes",disabled:Pe.value,onClick:qe=>ht(ke.seq)},t.toDisplayString(t.unref(a).t("em.history.doRestore")),9,aP),t.createElementVNode("button",{type:"button",class:"em-history__confirm-no",disabled:Pe.value,onClick:ve[8]||(ve[8]=qe=>Re.value=null)},t.toDisplayString(t.unref(a).t("em.history.cancel")),9,rP)])],64)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:"em-history__restore-btn",onClick:qe=>Ot(ke.seq)},[t.createVNode(xe,{name:"undo",size:12}),t.createTextVNode(" "+t.toDisplayString(t.unref(a).t("em.history.restoreToHere")),1)],8,lP))],2)):t.createCommentVNode("",!0)],2)}),128))])),f.value==null&&j.value>0?(t.openBlock(),t.createElementBlock("button",{key:5,type:"button",class:"em-history__load-more",onClick:X},t.toDisplayString(t.unref(a).t("em.history.loadMore",{n:j.value})),1)):t.createCommentVNode("",!0)])],512),[[t.vShow,e.open]])]}),_:1}))}}),[["__scopeId","data-v-9f624c61"]]);function cP(e,n){if(!e||typeof window>"u"||!window.localStorage)return null;const o=window.localStorage.getItem(e),i=o==null?NaN:Number(o);return Number.isFinite(i)&&i>=n?i:null}function dg(e){const n=t.ref(cP(e.storageKey,e.min)??e.initial),o=t.ref(!1);function i(a){a.preventDefault();const r=a.clientX,l=n.value;o.value=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none";const s=d=>{const u=e.edge==="left"?r-d.clientX:d.clientX-r;let m=l+u;m=Math.max(e.min,m),e.max!=null&&(m=Math.min(e.max,m)),n.value=m},c=()=>{window.removeEventListener("pointermove",s),window.removeEventListener("pointerup",c),document.body.style.cursor="",document.body.style.userSelect="",o.value=!1,e.storageKey&&typeof window<"u"&&window.localStorage&&window.localStorage.setItem(e.storageKey,String(n.value))};window.addEventListener("pointermove",s),window.addEventListener("pointerup",c)}return{width:n,dragging:o,startResize:i}}const dP={class:"em-modeler"},uP={class:"em-modeler__body"},mP={class:"em-drawer__inner"},fP={class:"em-drawer__head"},pP={class:"em-drawer__actions"},hP=["title"],yP=["title"],gP=["title"],bP=["title"],kP=["title"],_P=tt(t.defineComponent({__name:"EntityModeler",props:{controller:{}},setup(e){const n=t.ref(!0),o=t.ref(!0),i=t.ref(null),a=t.ref(null),r=t.ref(null),l=t.ref(null);function s(C){t.nextTick(()=>{const v=C();v&&("focusCollapse"in v?v.focusCollapse():v.focus())})}function c(C){n.value=C,s(()=>C?i.value:a.value)}function d(C){o.value=C,s(()=>C?l.value:r.value)}const u=t.ref(!1),m=t.shallowRef(null),{width:f,dragging:p,startResize:y}=dg({initial:260,min:260,max:560,edge:"right",storageKey:"em.explorerWidth"}),{width:g,dragging:b,startResize:k}=dg({initial:320,min:320,max:640,edge:"left",storageKey:"em.panelWidth"}),_=t.ref(null),h=t.ref(null);return(C,v)=>{var S,N,A;return t.openBlock(),t.createElementBlock("div",dP,[t.createVNode(sg,{controller:e.controller,"history-open":u.value,onExportSvg:v[0]||(v[0]=T=>{var O;return(O=_.value)==null?void 0:O.exportSvg()}),onExportPng:v[1]||(v[1]=T=>{var O;return(O=_.value)==null?void 0:O.exportPng()}),onFitView:v[2]||(v[2]=T=>{var O;return(O=_.value)==null?void 0:O.fitView()}),onToggleHistory:v[3]||(v[3]=T=>u.value=!u.value)},null,8,["controller","history-open"]),t.createElementVNode("div",uP,[t.createElementVNode("aside",{class:t.normalizeClass(["em-drawer",{"is-collapsed":!n.value}]),style:t.normalizeStyle({width:t.unref(f)+"px"})},[t.createElementVNode("div",mP,[t.createElementVNode("header",fP,[v[12]||(v[12]=t.createElementVNode("span",null,"Diagram Explorer",-1)),t.createElementVNode("div",pP,[(S=h.value)!=null&&S.hasExpandable?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-drawer__btn",title:e.controller.t((N=h.value)!=null&&N.allExpanded?"em.panel.collapseAll":"em.panel.expandAll"),onClick:v[4]||(v[4]=T=>{var O;return(O=h.value)==null?void 0:O.toggleAll()})},[t.createVNode(xe,{name:(A=h.value)!=null&&A.allExpanded?"collapse-all":"expand-all",size:16},null,8,["name"])],8,hP)):t.createCommentVNode("",!0),t.createElementVNode("button",{ref_key:"explorerCollapseBtn",ref:i,type:"button",class:"em-drawer__btn",title:e.controller.t("em.panel.collapse"),onClick:v[5]||(v[5]=T=>c(!1))},[t.createVNode(xe,{name:"panel-close",size:16})],8,yP)])]),t.createVNode(lg,{ref_key:"explorer",ref:h,controller:e.controller,"storage-key":"em.explorerCollapsed"},null,8,["controller"])]),t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(["em-resize-handle em-resize-handle--right",{"is-dragging":t.unref(p)}]),title:e.controller.t("em.panel.resizeWidth"),onPointerdown:v[6]||(v[6]=(...T)=>t.unref(y)&&t.unref(y)(...T))},null,42,gP),[[t.vShow,n.value]])],6),t.createVNode(t.Transition,{name:"em-reopen"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("button",{type:"button",ref_key:"explorerReopenBtn",ref:a,class:"em-drawer__reopen",title:e.controller.t("em.panel.openNamed",{name:"Diagram Explorer"}),onClick:v[7]||(v[7]=T=>c(!0))},[t.createVNode(xe,{name:"panel-open",size:18})],8,bP),[[t.vShow,!n.value]])]),_:1}),t.createElementVNode("div",{class:t.normalizeClass(["em-modeler__canvas",{"is-drawer-open":n.value,"is-resizing":t.unref(p),"is-inspector-collapsed":!o.value}]),style:t.normalizeStyle({"--em-drawer-shift":t.unref(f)-6+"px"})},[t.createVNode(rg,{ref_key:"canvas",ref:_,controller:e.controller,"diff-marks":m.value,"embed-collapse-storage-key":"em.embedCollapsed"},null,8,["controller","diff-marks"])],6),t.withDirectives(t.createVNode(cg,{ref_key:"inspectorRef",ref:l,controller:e.controller,width:t.unref(g),resizing:t.unref(b),"start-resize":t.unref(k),onCollapse:v[8]||(v[8]=T=>d(!1))},null,8,["controller","width","resizing","start-resize"]),[[t.vShow,o.value]]),t.createVNode(t.Transition,{name:"em-reopen"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("button",{type:"button",ref_key:"inspectorReopenBtn",ref:r,class:"em-panel__reopen",title:e.controller.t("em.panel.openNamed",{name:"Inspector"}),onClick:v[9]||(v[9]=T=>d(!0))},[t.createVNode(xe,{name:"panel-right-open",size:18})],8,kP),[[t.vShow,!o.value]])]),_:1}),t.createVNode(sP,{controller:e.controller,open:u.value,onClose:v[10]||(v[10]=T=>u.value=!1),onDiffChange:v[11]||(v[11]=T=>m.value=T)},null,8,["controller","open"])]),t.createVNode(QD,{controller:e.controller,"panel-width":t.unref(g),"inspector-open":o.value},null,8,["controller","panel-width","inspector-open"])])}}}),[["__scopeId","data-v-b162af97"]]);ye.APPLY_MODEL_OPS_INPUT_SCHEMA=rE,ye.AssociationEdge=iy,ye.CUSTOM_TYPE_VALUE=pn,ye.CommandStack=os,ye.DEFAULT_JAVA_TYPE=bl,ye.DIAGRAM_JSON_FORMAT=$l,ye.DIAGRAM_JSON_VERSION=Tl,ye.DiagramCanvas=rg,ye.DiagramExplorer=lg,ye.EDITOR=io,ye.EditModeToggle=DL,ye.EditorToolbar=sg,ye.EntityModeler=_P,ye.EntityNode=Oh,ye.GROUP_CODE_ENUM_VALUE=An,ye.GroupNode=Ph,ye.INHERITED_REF_PREFIX=ya,ye.InvalidDiagramJsonError=go,ye.JAVA_TYPES=Ni,ye.LIB_VERSION=wk,ye.NoteNode=zh,ye.OpSyncAdapter=hm,ye.PHYSICAL_NAME_MAX_LENGTH=Si,ye.PropertyPanel=cg,ye.RevCache=pm,ye.SELECTABLE_JAVA_TYPES=md,ye.SYMBOLIC_OP_KINDS=ym,ye.SYMBOLIC_OP_SCHEMA=Qm,ye.UI_LOCALES=xC,ye.applyDocumentReferenceOnly=fl,ye.buildAgentBatch=lE,ye.buildDiagramSvg=Vc,ye.buildDiffMarks=Iu,ye.collectSharedColumns=Rn,ye.commands=Wk,ye.computeAutoLayout=Pc,ye.createEditorController=hA,ye.dedupeModelIds=Ek,ye.defaultMermaidDialect=Dg,ye.defaultSqlDialect=cb,ye.diagramToJson=Fd,ye.displayLabel=_a,ye.emptyState=vh,ye.entityModelToDdl=Dd,ye.entityModelToMermaid=Il,ye.entityModelToText=_d,ye.exportDiagramPng=ig,ye.exportDiagramSvg=og,ye.fromPersisted=uf,ye.isGeneratable=ou,ye.isInheritedColumnRef=co,ye.isValueTypeStereotype=lt,ye.javaTypeLabel=Yo,ye.makeInheritedColumnRef=Hc,ye.mergeDiagram=bu,ye.mermaidErToImportSource=Rd,ye.migrateLegacyMoney=_k,ye.multiplicityLabel=wa,ye.newId=Fe,ye.packEntityBoxes=rl,ye.parseDiagramJson=Ud,ye.parseInheritedColumnRef=ll,ye.parseMermaidEr=Sd,ye.parseSqlDdl=Sl,ye.planHealBackfillOps=FE,ye.projectActionLog=ts,ye.projectEntityAudit=Nu,ye.projectFieldAudit=Tn,ye.projectInheritedColumns=bi,ye.projectSeqDiff=ns,ye.renderDiagramSvg=jd,ye.resolveColumnPhysicalName=_i,ye.resolveDiagram=Dc,ye.resolveEffectiveColumn=Lt,ye.resolveQuickFix=Ol,ye.resolveSharedColumn=fo,ye.resolveSymbolicOps=O_,ye.restoreDeepEqual=_o,ye.scaffoldEntityJava=Gb,ye.sharedColumnScopeEntities=pl,ye.sqlDdlToImportSource=Bd,ye.stereotypeLabel=gi,ye.synthesizeRestoreOps=Vk,ye.toPersisted=OE,ye.toPersistedV2=PE,ye.translate=cn,ye.uiMessagesEn=hh,ye.uiMessagesJa=yh,ye.uiMessagesKo=gh,ye.validateModel=Aa,Object.defineProperty(ye,Symbol.toStringTag,{value:"Module"})}));
|