@g1cloud/entity-modeler-next 5.2.3 → 5.2.4

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.
@@ -1,4 +1,4 @@
1
- (function(_e,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):(_e=typeof globalThis<"u"?globalThis:_e||self,t(_e.EntityModeler={},_e.Vue,_e.OpenBlueseaCore))})(this,(function(_e,t,oe){"use strict";var TO=Object.defineProperty;var MO=(_e,t,oe)=>t in _e?TO(_e,t,{enumerable:!0,configurable:!0,writable:!0,value:oe}):_e[t]=oe;var ct=(_e,t,oe)=>MO(_e,typeof t!="symbol"?t+"":t,oe);const dy={startX:40,startY:40,columnGap:280,rowGap:220,perRow:4,defaultSize:{width:220,height:140}};function uy(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 fc(e,n,o={}){const i={...dy,...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 _ of b.memberEntityRefs)s.set(_,b.modelId);const c=new Map;for(const b of n.groupLayouts)for(const _ of b.memberNoteRefs??[])c.set(_,b.groupRef);let d=0;const u=e.entities.map(b=>{const _=s.get(b.modelId),k=r.get(b.modelId);if(k){const y={location:{x:k.geo.location.x,y:k.geo.location.y},size:{width:k.geo.size.width,height:k.geo.size.height}};return{entity:b,geo:y,collapsed:k.collapsed??!1,locked:k.locked??!1,groupRef:_,style:k.style,attributeStyles:k.attributeStyles,operationStyles:k.operationStyles}}const N=uy(d++,i);return{entity:b,geo:N,collapsed:!1,locked:!1,groupRef:_}}),m=new Map(n.groupLayouts.map(b=>[b.groupRef,b])),p=e.groups.map(b=>{const _=m.get(b.modelId),k=_?{location:{x:_.geo.location.x,y:_.geo.location.y},size:{width:_.geo.size.width,height:_.geo.size.height}}:{location:{x:0,y:0},size:{width:400,height:300}};return{group:b,geo:k,style:_==null?void 0:_.style,locked:(_==null?void 0:_.locked)??!1}}),f=e.associations.map(b=>{const _=l.get(b.modelId);return{association:b,waypoints:(_==null?void 0:_.waypoints)??[],sourceColumnRef:_==null?void 0:_.sourceColumnRef,targetColumnRef:_==null?void 0:_.targetColumnRef}}),h=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 _ of b.connections??[])a.has(_.targetRef)&&g.push({noteRef:b.modelId,targetRef:_.targetRef,waypoints:_.waypoints.map(k=>({x:k.x,y:k.y}))});return{entities:u,associations:f,groups:p,notes:h,noteConnections:g}}const my={cellWidth:260,cellHeight:200,pad:24,headerHeight:28,ungroupedCols:4};function pc(e,n,o={}){const i={...my,...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),p=m?m.location:{x:0,y:0},f=m?m.size.width:800;m&&(l=Math.max(l,m.location.y+m.size.height));const h=Math.max(1,Math.floor((f-i.pad*2)/i.cellWidth));u.memberEntityRefs.forEach((g,b)=>{const _=b%h,k=Math.floor(b/h);r.push({id:g,location:{x:p.x+i.pad+_*i.cellWidth,y:p.y+i.pad+i.headerHeight+k*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 p=m%i.ungroupedCols,f=Math.floor(m/i.ungroupedCols);r.push({id:u.modelId,location:{x:i.pad+p*i.cellWidth,y:d+f*i.cellHeight}})}),r}const hc={cols:5,boxWidth:200,gap:60,baseX:0,baseY:0,headerHeight:48,rowHeight:24,footerHeight:16,minHeight:120};function fy(e,n={}){const o={...hc,...n},i=o.headerHeight+Math.max(0,e)*o.rowHeight+o.footerHeight;return Math.max(o.minHeight,i)}function Ur(e,n={}){const o={...hc,...n},i=Math.max(1,o.cols),a=new Array(i).fill(o.baseY);return e.map((r,l)=>{const s=l%i,c=fy(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 Jn(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 yc(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 py={UNDEFINED:"Undefined",JPA_ENTITY:"Entity",JPA_EMBEDDABLE:"Embeddable",JPA_MULTI_LANGUAGE_ENTITY:"MultiLanguageEntity",SERIALIZED_TYPE:"Serialized"};function si(e){return py[e]??e}function _t(e){return e==="JPA_EMBEDDABLE"||e==="SERIALIZED_TYPE"}function hn(e){return e==="SERIALIZED_TYPE"}const oa="inherited:";function gc(e,n){return`${oa}${e}:${n}`}function Xn(e){return e.startsWith(oa)}function Hr(e){if(!Xn(e))return null;const n=e.slice(oa.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 ci(e,n){var a;if(_t(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:gc(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 ia(e){return e.attrType.startsWith("RELATION")&&e.dbAttrs.length>0}function yn(e){return e.attrType==="RELATION_OWN"&&e.dbAttrs.length>1}function jr(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 Kr(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 Zn(e,n,o,i,a=0){var d;if(!ia(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 $o(s)[a];for(const m of o){const p=m.attributes.find(f=>f.modelId===c);if(p)return p.dbAttrs[a]??$o(s)[a]}}if(s)return $o(s)[a]}function $o(e){return((e==null?void 0:e.attributes)??[]).filter(n=>n.identifier&&(n.attrType==="NORMAL"||n.attrType==="RELATION_OWN")).slice().sort((n,o)=>n.order-o.order).flatMap(n=>n.dbAttrs)}function hy(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=bc(c,n,o);return d.length!==e.dbAttrs.length?e.dbAttrs.map(()=>{}):d.map(u=>u.propertyPath||void 0)}}function gn(e,n){return bc(e,n,new Set)}function bc(e,n,o){if(e==null||o.has(e.modelId))return[];const i=new Set(o).add(e.modelId);return e.attributes.flatMap(a=>{const r=hy(a,n,i),l=a.name??"";return a.dbAttrs.map((s,c)=>({col:s,propertyPath:l?r===void 0?a.dbAttrs.length>1?"":l:r[c]?`${l}.${r[c]}`:"":"",defaultPhysical:s.physicalName??"",...s.sharedColumnRef!=null?{defaultSharedRef:s.sharedColumnRef}:{},ownColumn:!!s.physicalName&&s.sharedColumnRef==null}))})}const _c=e=>e==null||e.trim()==="";function kc(e,n,o,i,a){var r,l,s,c;if(e.attrType==="EMBED_PREDEF")return(l=(r=a==null?void 0:a.embeddableCatalog)==null?void 0:r.find(d=>d.type===e.type))==null?void 0:l.fields[n];if(e.attrType==="EMBED_OWN"){const d=(s=e.embedded)==null?void 0:s.embeddableRef;return d==null||(c=gn(i.entities.find(u=>u.modelId===d))[n])==null?void 0:c.col}if(e.attrType.startsWith("RELATION"))return Zn(e,o,i.entities,i.associations,n)}function bn(e,n,o,i,a,r){const l=kc(e,o,i,a,r);return l?{...n,physicalName:n.physicalName||l.physicalName||"",dataType:n.dataType||l.dataType||"",length:n.length??l.length,scale:n.scale??l.scale,logicalName:yy(n.logicalName)?n.logicalName:l.logicalName,...n.sharedColumnRef==null&&!n.physicalName&&l.sharedColumnRef!=null&&(e.attrType==="EMBED_OWN"||e.attrType==="EMBED_PREDEF")?{sharedColumnRef:l.sharedColumnRef}:{}}:n}function yy(e){return e!=null&&Object.values(e).some(n=>!_c(n))}function di(e,n,o,i,a,r){var l;return _c(n.physicalName)?((l=kc(e,o,i,a,r))==null?void 0:l.physicalName)??"":n.physicalName}function Ec(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 p=0;p<m.dbAttrs.length;p++){if(u===n)return m.name||void 0;u++}}}function Gr(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 Dn(e,n){return Gr(e,n).flatMap(o=>o.attributes.flatMap(i=>i.dbAttrs))}function To(e){const n=new Map;for(const o of e)n.set(o.modelId,o);return n}function Qn(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 Mo(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 gy(e,n,o){const i=Mo(e,o),a=Mo(n,o);return i.kind===a.kind&&i.value!==a.value}function Vo(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 Yr(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 ui(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=Mo(o,i),s=r.filter(c=>{const d=Mo(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}}function aa(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 Nc="(미지정)",by="(이름 없음)",ra=e=>e==null||String(e).trim()==="",la=e=>ra(e)?by:String(e),wc=e=>ra(e)?Nc:String(e);function Ic(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 Nc}function vc(e,n){const o=e.length?`(${e.length}${e.scale!=null?`,${e.scale}`:""})`:"",i=ra(n)?wc(e.physicalName):String(n),a=ra(e.dataType)?"":String(e.dataType).trim();return a?`${i} ${a}${o}`:i}function Cc(e){return[e.unique?"UNIQUE":"",e.autoIncrement?"AUTO_INCREMENT":"",e.sharedColumnRef?"SHARED":""].filter(Boolean)}function Sc(e,n){var r,l,s;const o=new Map(e.entities.map(c=>[c.modelId,c.name])),i=new Map;for(const c of e.groups)for(const d of c.memberEntityRefs)i.set(d,c.packageName||(((r=c.name)==null?void 0:r.ko)??c.modelId));const a=[];for(const c of e.entities){const d=(l=c.table)!=null&&l.physicalName?` (${c.table.physicalName})`:"",u=i.get(c.modelId);a.push(`## ${la(c.name)}${d} «${si(c.stereotype)}»${u?` [${u}]`:""}`);const m=To(Dn(c,e.entities)),p=b=>{var _;return b.sharedColumnRef?(_=Qn(b,m))==null?void 0:_.physicalName:void 0},f=[...c.attributes].sort((b,_)=>b.order-_.order);for(const b of f){if(b.attrType==="DIVIDER"){a.push(` ${"─".repeat(8)}${b.name?` ${b.name} ${"─".repeat(8)}`:""}`);continue}const _=b.dbAttrs.map(($,O)=>bn(b,$,O,c,e,n)),k=[b.identifier?"PK":"",b.notNull&&!hn(c.stereotype)?"NOT NULL":""].filter(Boolean),N=ui(b,Vo(e),c,e),y=N.kind==="resolved"?Yr(b.type,N.entity):wc(b.type),E=` - ${la(b.name)}: ${y}`,S=$=>$.length?` {${$.join(", ")}}`:"";if(_.length>1){a.push(`${E}${S(k)}`),_.forEach(($,O)=>{const C=Ec(b,O,e,n);a.push(` · ${C?`${C} → `:""}${vc($,p($))}${S(Cc($))}`)});continue}const A=_[0],V=A?` → ${vc(A,p(A))}`:"";a.push(`${E}${V}${S([...k,...A?Cc(A):[]])}`)}const h=Jn(c.attributes);for(const b of c.indexes??[]){const _=b.columns.map(k=>{var N,y;return`${((N=h.attributeOf(k.columnRef))==null?void 0:N.name)??((y=Hr(k.columnRef))==null?void 0:y.field)??k.columnRef}${k.descending?" DESC":""}`}).join(", ");a.push(` index ${la(b.name)}${b.unique?" UNIQUE":""}: ${_}`)}const g=[...c.operations??[]].sort((b,_)=>b.order-_.order);for(const b of g){const _=b.visibility?` {${b.visibility}}`:"",k=(s=b.description)!=null&&s.ko?` — ${b.description.ko}`:"";a.push(` method ${la(b.name)}()${_}${k}`)}a.push("")}if(e.associations.length){a.push("# 관계");for(const c of e.associations){const d=o.get(c.end1.entityRef)??c.end1.entityRef,u=o.get(c.end2.entityRef)??c.end2.entityRef,m=c.end2.composition||c.end1.composition?" (composition)":"";a.push(` ${d} ${Ic(c.end1.multiplicity)} —— ${Ic(c.end2.multiplicity)} ${u}${m}`)}}return a.join(`
1
+ (function(be,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):(be=typeof globalThis<"u"?globalThis:be||self,t(be.EntityModeler={},be.Vue,be.OpenBlueseaCore))})(this,(function(be,t,oe){"use strict";var MO=Object.defineProperty;var VO=(be,t,oe)=>t in be?MO(be,t,{enumerable:!0,configurable:!0,writable:!0,value:oe}):be[t]=oe;var ct=(be,t,oe)=>VO(be,typeof t!="symbol"?t+"":t,oe);const dy={startX:40,startY:40,columnGap:280,rowGap:220,perRow:4,defaultSize:{width:220,height:140}};function uy(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 fc(e,n,o={}){const i={...dy,...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 _ of b.memberEntityRefs)s.set(_,b.modelId);const c=new Map;for(const b of n.groupLayouts)for(const _ of b.memberNoteRefs??[])c.set(_,b.groupRef);let d=0;const u=e.entities.map(b=>{const _=s.get(b.modelId),k=r.get(b.modelId);if(k){const y={location:{x:k.geo.location.x,y:k.geo.location.y},size:{width:k.geo.size.width,height:k.geo.size.height}};return{entity:b,geo:y,collapsed:k.collapsed??!1,locked:k.locked??!1,groupRef:_,style:k.style,attributeStyles:k.attributeStyles,operationStyles:k.operationStyles}}const N=uy(d++,i);return{entity:b,geo:N,collapsed:!1,locked:!1,groupRef:_}}),m=new Map(n.groupLayouts.map(b=>[b.groupRef,b])),p=e.groups.map(b=>{const _=m.get(b.modelId),k=_?{location:{x:_.geo.location.x,y:_.geo.location.y},size:{width:_.geo.size.width,height:_.geo.size.height}}:{location:{x:0,y:0},size:{width:400,height:300}};return{group:b,geo:k,style:_==null?void 0:_.style,locked:(_==null?void 0:_.locked)??!1}}),f=e.associations.map(b=>{const _=l.get(b.modelId);return{association:b,waypoints:(_==null?void 0:_.waypoints)??[],sourceColumnRef:_==null?void 0:_.sourceColumnRef,targetColumnRef:_==null?void 0:_.targetColumnRef}}),h=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 _ of b.connections??[])a.has(_.targetRef)&&g.push({noteRef:b.modelId,targetRef:_.targetRef,waypoints:_.waypoints.map(k=>({x:k.x,y:k.y}))});return{entities:u,associations:f,groups:p,notes:h,noteConnections:g}}const my={cellWidth:260,cellHeight:200,pad:24,headerHeight:28,ungroupedCols:4};function pc(e,n,o={}){const i={...my,...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),p=m?m.location:{x:0,y:0},f=m?m.size.width:800;m&&(l=Math.max(l,m.location.y+m.size.height));const h=Math.max(1,Math.floor((f-i.pad*2)/i.cellWidth));u.memberEntityRefs.forEach((g,b)=>{const _=b%h,k=Math.floor(b/h);r.push({id:g,location:{x:p.x+i.pad+_*i.cellWidth,y:p.y+i.pad+i.headerHeight+k*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 p=m%i.ungroupedCols,f=Math.floor(m/i.ungroupedCols);r.push({id:u.modelId,location:{x:i.pad+p*i.cellWidth,y:d+f*i.cellHeight}})}),r}const hc={cols:5,boxWidth:200,gap:60,baseX:0,baseY:0,headerHeight:48,rowHeight:24,footerHeight:16,minHeight:120};function fy(e,n={}){const o={...hc,...n},i=o.headerHeight+Math.max(0,e)*o.rowHeight+o.footerHeight;return Math.max(o.minHeight,i)}function Ur(e,n={}){const o={...hc,...n},i=Math.max(1,o.cols),a=new Array(i).fill(o.baseY);return e.map((r,l)=>{const s=l%i,c=fy(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 Jn(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 yc(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 py={UNDEFINED:"Undefined",JPA_ENTITY:"Entity",JPA_EMBEDDABLE:"Embeddable",JPA_MULTI_LANGUAGE_ENTITY:"MultiLanguageEntity",SERIALIZED_TYPE:"Serialized"};function si(e){return py[e]??e}function _t(e){return e==="JPA_EMBEDDABLE"||e==="SERIALIZED_TYPE"}function hn(e){return e==="SERIALIZED_TYPE"}const oa="inherited:";function gc(e,n){return`${oa}${e}:${n}`}function Xn(e){return e.startsWith(oa)}function Hr(e){if(!Xn(e))return null;const n=e.slice(oa.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 ci(e,n){var a;if(_t(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:gc(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 ia(e){return e.attrType.startsWith("RELATION")&&e.dbAttrs.length>0}function yn(e){return e.attrType==="RELATION_OWN"&&e.dbAttrs.length>1}function jr(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 Kr(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 Zn(e,n,o,i,a=0){var d;if(!ia(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 $o(s)[a];for(const m of o){const p=m.attributes.find(f=>f.modelId===c);if(p)return p.dbAttrs[a]??$o(s)[a]}}if(s)return $o(s)[a]}function $o(e){return((e==null?void 0:e.attributes)??[]).filter(n=>n.identifier&&(n.attrType==="NORMAL"||n.attrType==="RELATION_OWN")).slice().sort((n,o)=>n.order-o.order).flatMap(n=>n.dbAttrs)}function hy(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=bc(c,n,o);return d.length!==e.dbAttrs.length?e.dbAttrs.map(()=>{}):d.map(u=>u.propertyPath||void 0)}}function gn(e,n){return bc(e,n,new Set)}function bc(e,n,o){if(e==null||o.has(e.modelId))return[];const i=new Set(o).add(e.modelId);return e.attributes.flatMap(a=>{const r=hy(a,n,i),l=a.name??"";return a.dbAttrs.map((s,c)=>({col:s,propertyPath:l?r===void 0?a.dbAttrs.length>1?"":l:r[c]?`${l}.${r[c]}`:"":"",defaultPhysical:s.physicalName??"",...s.sharedColumnRef!=null?{defaultSharedRef:s.sharedColumnRef}:{},ownColumn:!!s.physicalName&&s.sharedColumnRef==null}))})}const _c=e=>e==null||e.trim()==="";function kc(e,n,o,i,a){var r,l,s,c;if(e.attrType==="EMBED_PREDEF")return(l=(r=a==null?void 0:a.embeddableCatalog)==null?void 0:r.find(d=>d.type===e.type))==null?void 0:l.fields[n];if(e.attrType==="EMBED_OWN"){const d=(s=e.embedded)==null?void 0:s.embeddableRef;return d==null||(c=gn(i.entities.find(u=>u.modelId===d))[n])==null?void 0:c.col}if(e.attrType.startsWith("RELATION"))return Zn(e,o,i.entities,i.associations,n)}function bn(e,n,o,i,a,r){const l=kc(e,o,i,a,r);return l?{...n,physicalName:n.physicalName||l.physicalName||"",dataType:n.dataType||l.dataType||"",length:n.length??l.length,scale:n.scale??l.scale,logicalName:yy(n.logicalName)?n.logicalName:l.logicalName,...n.sharedColumnRef==null&&!n.physicalName&&l.sharedColumnRef!=null&&(e.attrType==="EMBED_OWN"||e.attrType==="EMBED_PREDEF")?{sharedColumnRef:l.sharedColumnRef}:{}}:n}function yy(e){return e!=null&&Object.values(e).some(n=>!_c(n))}function di(e,n,o,i,a,r){var l;return _c(n.physicalName)?((l=kc(e,o,i,a,r))==null?void 0:l.physicalName)??"":n.physicalName}function Ec(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 p=0;p<m.dbAttrs.length;p++){if(u===n)return m.name||void 0;u++}}}function Gr(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 Dn(e,n){return Gr(e,n).flatMap(o=>o.attributes.flatMap(i=>i.dbAttrs))}function To(e){const n=new Map;for(const o of e)n.set(o.modelId,o);return n}function Qn(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 Mo(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 gy(e,n,o){const i=Mo(e,o),a=Mo(n,o);return i.kind===a.kind&&i.value!==a.value}function Vo(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 Yr(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 ui(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=Mo(o,i),s=r.filter(c=>{const d=Mo(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}}function aa(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 Nc="(미지정)",by="(이름 없음)",ra=e=>e==null||String(e).trim()==="",la=e=>ra(e)?by:String(e),wc=e=>ra(e)?Nc:String(e);function Ic(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 Nc}function vc(e,n){const o=e.length?`(${e.length}${e.scale!=null?`,${e.scale}`:""})`:"",i=ra(n)?wc(e.physicalName):String(n),a=ra(e.dataType)?"":String(e.dataType).trim();return a?`${i} ${a}${o}`:i}function Cc(e){return[e.unique?"UNIQUE":"",e.autoIncrement?"AUTO_INCREMENT":"",e.sharedColumnRef?"SHARED":""].filter(Boolean)}function Sc(e,n){var r,l,s;const o=new Map(e.entities.map(c=>[c.modelId,c.name])),i=new Map;for(const c of e.groups)for(const d of c.memberEntityRefs)i.set(d,c.packageName||(((r=c.name)==null?void 0:r.ko)??c.modelId));const a=[];for(const c of e.entities){const d=(l=c.table)!=null&&l.physicalName?` (${c.table.physicalName})`:"",u=i.get(c.modelId);a.push(`## ${la(c.name)}${d} «${si(c.stereotype)}»${u?` [${u}]`:""}`);const m=To(Dn(c,e.entities)),p=b=>{var _;return b.sharedColumnRef?(_=Qn(b,m))==null?void 0:_.physicalName:void 0},f=[...c.attributes].sort((b,_)=>b.order-_.order);for(const b of f){if(b.attrType==="DIVIDER"){a.push(` ${"─".repeat(8)}${b.name?` ${b.name} ${"─".repeat(8)}`:""}`);continue}const _=b.dbAttrs.map(($,O)=>bn(b,$,O,c,e,n)),k=[b.identifier?"PK":"",b.notNull&&!hn(c.stereotype)?"NOT NULL":""].filter(Boolean),N=ui(b,Vo(e),c,e),y=N.kind==="resolved"?Yr(b.type,N.entity):wc(b.type),E=` - ${la(b.name)}: ${y}`,S=$=>$.length?` {${$.join(", ")}}`:"";if(_.length>1){a.push(`${E}${S(k)}`),_.forEach(($,O)=>{const C=Ec(b,O,e,n);a.push(` · ${C?`${C} → `:""}${vc($,p($))}${S(Cc($))}`)});continue}const A=_[0],V=A?` → ${vc(A,p(A))}`:"";a.push(`${E}${V}${S([...k,...A?Cc(A):[]])}`)}const h=Jn(c.attributes);for(const b of c.indexes??[]){const _=b.columns.map(k=>{var N,y;return`${((N=h.attributeOf(k.columnRef))==null?void 0:N.name)??((y=Hr(k.columnRef))==null?void 0:y.field)??k.columnRef}${k.descending?" DESC":""}`}).join(", ");a.push(` index ${la(b.name)}${b.unique?" UNIQUE":""}: ${_}`)}const g=[...c.operations??[]].sort((b,_)=>b.order-_.order);for(const b of g){const _=b.visibility?` {${b.visibility}}`:"",k=(s=b.description)!=null&&s.ko?` — ${b.description.ko}`:"";a.push(` method ${la(b.name)}()${_}${k}`)}a.push("")}if(e.associations.length){a.push("# 관계");for(const c of e.associations){const d=o.get(c.end1.entityRef)??c.end1.entityRef,u=o.get(c.end2.entityRef)??c.end2.entityRef,m=c.end2.composition||c.end1.composition?" (composition)":"";a.push(` ${d} ${Ic(c.end1.multiplicity)} —— ${Ic(c.end2.multiplicity)} ${u}${m}`)}}return a.join(`
2
2
  `).trim()}function Bo(e){return e.referenceOnly===!0}function qr(e){const n=new Set;for(const o of e.entities)Bo(o)&&n.add(o.modelId);return n}function xc(e){return e.entities.filter(n=>!Bo(n))}function Rc(e,n=qr(e)){return n.size===0?e.associations:e.associations.filter(o=>!n.has(o.end1.entityRef)&&!n.has(o.end2.entityRef))}function Wr(e,n){return n?{...e,entities:e.entities.map(o=>o.referenceOnly?o:{...o,referenceOnly:!0})}:e}function _y(e,n){return Bo(e)||n===!0}const ky=e=>e&&e[0].toLowerCase()+e.slice(1);function sa(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function Ac(e){return e!=="EXACTLY_ONE_INSTANCE"&&e!=="ONE_OR_MORE_INSTANCES"}function ca(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 Ey(e){return/[^aeiou]y$/.test(e)?`${e.slice(0,-1)}ies`:/(s|x|z|ch|sh)$/.test(e)?`${e}es`:`${e}s`}function da(e,n){const o=ky(e);return n?Ey(o):o}function eo(e,n){if(!n.has(e))return e;for(let o=2;;o++){const i=`${e}${o}`;if(!n.has(i))return i}}function Ny(e){return e==="CLASS"?"class":"er"}function Jr(e,n,o){const i=wy(e);return n==="class"?Ay(i):Sy(i,o)}function wy(e){const n=qr(e);return n.size===0?e:{...e,entities:xc(e),associations:Rc(e,n)}}function mi(e,n){return(e??"").trim().replace(/[^0-9A-Za-z_]/g,"_").replace(/^(\d)/,"_$1")||n}function Xr(e){return(e??"").replace(/"/g,"'").replace(/\s+/g," ").trim()}function $c(e,n){const o=new Set,i=new Map;return e.entities.forEach((a,r)=>{const l=mi(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 Iy(e){return e.attrType==="RELATION_OWN"||e.attrType==="RELATION_REF"||e.derivedFrom!=null}const Tc=ca;function Zr(e){return e!=null&&Mc[e]!=null}const Mc={NO_INSTANCE_OR_ONE_INSTANCE:"|o",EXACTLY_ONE_INSTANCE:"||",ZERO_OR_MORE_INSTANCES:"}o",ONE_OR_MORE_INSTANCES:"}|"};function Vc(e,n){const o={NO_INSTANCE_OR_ONE_INSTANCE:"o|",EXACTLY_ONE_INSTANCE:"||",ZERO_OR_MORE_INSTANCES:"o{",ONE_OR_MORE_INSTANCES:"|{"},i=Zr(e)?e:"ZERO_OR_MORE_INSTANCES";return(n==="left"?Mc:o)[i]}function vy(e,n,o,i){if(e.dbAttrs.length===0)return[];const a=[];return e.dbAttrs.forEach((r,l)=>{var p;const s=bn(e,r,l,n,o,i);if(s.sharedColumnRef!=null)return;const c=l===0?e.name:Ec(e,l,o,i),d=mi(s.dataType||e.type,"unknown"),u=mi(s.physicalName||c,"col"),m=s.length?`(${s.length}${s.scale!=null?`,${s.scale}`:""})`:"";a.push(Cy(d,u,e,s.unique===!0,m,(p=s.logicalName)==null?void 0:p.ko))}),a}function Cy(e,n,o,i,a,r){const l=[o.identifier?"PK":"",Iy(o)?"FK":"",i?"UK":""].filter(Boolean).join(", "),s=Xr([r,a].filter(Boolean).join(" ")),c=[` ${e} ${n}`];return l&&c.push(l),c.join(" ")+(s?` "${s}"`:"")}function Sy(e,n){const o=$c(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 vy(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=`${Vc(r.end1.multiplicity,"left")}--${Vc(r.end2.multiplicity,"right")}`,d=Xr(r.description);i.push(` ${l} ${c} ${s} : "${d}"`),(!Zr(r.end1.multiplicity)||!Zr(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 xy(e){return e&&e!=="UNDEFINED"?si(e):null}function Ry(e){return(e??"").trim().replace(/</g,"~").replace(/>/g,"~").replace(/[^0-9A-Za-z_~]/g,"")||"any"}function Ay(e){const n=$c(e,i=>i.name),o=["classDiagram"];for(const i of e.entities){const a=n.get(i.modelId),r=[],l=xy(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(` +${Ry(c.type)} ${mi(c.name,"field")}`);for(const c of[...i.operations??[]].sort((d,u)=>d.order-u.order))r.push(` +${mi(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=$y(i),s=Xr(i.description),c=` ${a} "${Tc(i.end1.multiplicity)}" ${l} "${Tc(i.end2.multiplicity)}" ${r}`;o.push(s?`${c} : ${s}`:c)}return o.join(`
4
4
  `)}function $y(e){return e.end1.composition||e.end2.composition?"*--":e.end2.navigable||e.end1.navigable?"-->":"--"}function Pe(){return crypto.randomUUID()}const Bc=["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"],Ty=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"]),My=Bc.filter(e=>!Ty.has(e)),Vy={TIMESTAMP_WITH_TIMEZONE:"TIMESTAMP WITH TIME ZONE",BIG_SERIAL:"BIGSERIAL",DOUBLE:"DOUBLE PRECISION"};function Qr(e){return Vy[e]??e}const By=new Set(["CHAR","VARCHAR","NCHAR","NVARCHAR","BINARY","VARBINARY","NUMERIC","DECIMAL"]),el=new Set(["NUMERIC","DECIMAL"]);function Dc(e,n=My){const o=[...n];return e&&!o.includes(e)?[e,...o]:o}const _n="CustomType",to="GroupCodeEnum",tl="String",fi=[{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:to,label:"GroupCodeEnum"},{value:"CustomMoneyType",label:"Money"},{value:_n,label:"CustomType"}],Dy=new Map(fi.map(e=>[e.value,e.label]));function no(e){return Dy.get(e)??e}const Oy={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 Oc(e){if(e)return Oy[e.toUpperCase()]}const Ly={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"]),[to]:new Set(["VARCHAR","CHAR"])},Py=new Map(fi.filter(e=>e.boxed).map(e=>[e.value,e.boxed]));function zy(e,n){const o=e==null?void 0:e.trim(),i=n==null?void 0:n.trim();if(!o||!i||!Bc.includes(i))return;const a=Py.get(o)??o,r=Ly[a];if(r)return r.has(i)}const Fy=new Set([to,"CustomMoneyType"]),Lc=fi.filter(e=>!Fy.has(e.value)).map(e=>e.value===_n?{...e,label:"CustomType (사용자정의)"}:e);function Pc(e,n=[],o=[]){const i=n.map(l=>{var c,d;const s=((c=l.label)==null?void 0:c.ko)??((d=l.label)==null?void 0:d.en);return{value:l.type,label:s?`${l.type} (${s})`:l.type}}),a=o.map(l=>({value:l,label:l})),r=[...Lc,...i,...a];return e&&!r.some(l=>l.value===e)?[{value:e,label:no(e)},...r]:r}function Uy(e){return e.attrType.startsWith("EMBED")&&e.dbAttrs.length>0}function ua(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 nl(e,n,o,i,a){var r;if(n.attrType==="DIVIDER"||e==="LOGICAL")return"";if((e==="CLASS"||yn(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"}<${no(n.type)}>`;if(Uy(n))return no(n.type);if(e==="CLASS"){if(n.type===_n){const l=n.customType||no(n.type);return a?Yr(l,a):l}return a?Yr(no(n.type),a):no(n.type)}return Qr(((r=n.dbAttrs[0])==null?void 0:r.dataType)??"")}const Hy={"|o":"NO_INSTANCE_OR_ONE_INSTANCE","||":"EXACTLY_ONE_INSTANCE","}o":"ZERO_OR_MORE_INSTANCES","}|":"ONE_OR_MORE_INSTANCES"},jy={"o|":"NO_INSTANCE_OR_ONE_INSTANCE","||":"EXACTLY_ONE_INSTANCE","o{":"ZERO_OR_MORE_INSTANCES","|{":"ONE_OR_MORE_INSTANCES"};function Ky(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=(f,h)=>f.attributes.find(g=>{var b;return g.identifier&&(h==null||((b=g.dbAttrs[0])==null?void 0:b.physicalName)===h)});let p=c.length===1?c[0]:void 0;if(!p){const f=c.filter(h=>m(h.parent,u)!=null);f.length===1&&(p=f[0])}p&&(d.attrType="RELATION_OWN",d.derivedFrom={associationRef:p.assoc.modelId,sourceAttributeRef:((r=m(p.parent,u)??m(p.parent))==null?void 0:r.modelId)??""},p.assoc.end2.attributeRef||(p.assoc.end2.attributeRef=d.modelId))}}}function Gy(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(h=>h.trim()).filter(Boolean));let d,u,m;if(i!=null){const h=i.match(/\((\d+)(?:,\s*(\d+))?\)\s*$/);if(h){d=Number(h[1]),h[2]!=null&&(u=Number(h[2]));const g=i.slice(0,h.index).trim();g&&(m=g)}else i.trim()&&(m=i.trim())}const p={modelId:Pe(),physicalName:s,dataType:l};return d!=null&&(p.length=d),u!=null&&(p.scale=u),c.has("UK")&&(p.unique=!0),m&&(p.logicalName={ko:m}),{attr:{modelId:Pe(),name:s,type:Oc(l)??"",attrType:"NORMAL",identifier:c.has("PK"),notNull:c.has("PK"),order:n,dbAttrs:[p]},foreignKey:c.has("FK")}}function zc(e){const n=e.split(`
@@ -24,12 +24,12 @@ ${u}
24
24
  `)+`
25
25
  `}}function qg(e,n,o,i){const a=[`${n}.${e}`,...i?[i]:[],rt.jpaRepository,rt.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(`
26
26
  `)+`
27
- `}}const ro="com.example",Wg="command.domain";function kn(e,n,o={}){const i=Mo(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??Wg,s=l?`.${l}`:"";return`${a.basePackage}${r}${s}`}return n.packageName||""}const Jg="CustomMoneyType",Xg="Money";function Zg(e){return!(e.type!==Jg||e.attrType!=="NORMAL"||e.identifier||e.dbAttrs.length>1)}function Qg(e){const n=e.dbAttrs[0]??{modelId:Pe(),physicalName:"",dataType:""},o={modelId:Pe(),physicalName:"",dataType:""},{customType:i,...a}=e;return{...a,type:Xg,attrType:"EMBED_PREDEF",dbAttrs:[n,o]}}function eb(e){let n=!1;const o=e.entities.map(i=>{let a=!1;const r=i.attributes.map(l=>Zg(l)?(a=!0,n=!0,Qg(l)):l);return a?{...i,attributes:r}:i});return n?{...e,entities:o}:e}function tb(e,n){const o=new Map,i=[],a=new Map;for(const h of e.entities){const g=new Map,b=new Map,_=new Map,k=(N,y,E)=>{if(!N)return;o.get(N)||o.set(N,[{entityId:y,assignedId:N}]),i.push({id:N,entityId:y,sink:E}),E(N)};for(const N of h.attributes){k(N.modelId,h.modelId,y=>g.set(N,y));for(const y of N.dbAttrs)k(y.modelId,h.modelId,E=>b.set(y,E))}for(const N of h.indexes??[])k(N.modelId,h.modelId,y=>_.set(N,y));a.set(h,{attrs:g,cols:b,idx:_})}const r=new Set(o.keys()),l=new Map;for(const h of i){const g=(l.get(h.id)??0)+1;if(l.set(h.id,g),g===1)continue;const b=nb(h.id,g-1,r);r.add(b),o.get(h.id).push({entityId:h.entityId,assignedId:b}),h.sink(b)}const s=[...o.values()].reduce((h,g)=>h+Math.max(0,g.length-1),0);if(s===0)return{logical:e,layout:n,reissued:0};const c=(h,g)=>{var _;if(!g||!h)return g;const b=o.get(g);return!b||b.length<2?g:((_=b.find(k=>k.entityId===h))==null?void 0:_.assignedId)??g},d=new Map(e.associations.map(h=>[h.modelId,h])),u=(h,g)=>{const b=d.get(h);if(b)return b.end1.entityRef===g?b.end2.entityRef:b.end1.entityRef},m=e.entities.map(h=>{var N;const g=a.get(h),b=h.attributes.map(y=>{const E=g.attrs.get(y),S=y.dbAttrs.map($=>{const O=g.cols.get($);return O===$.modelId?$:{...$,modelId:O}});let A=y.derivedFrom;if(A){const $=u(A.associationRef,h.modelId),O=c($,A.sourceAttributeRef);O!==A.sourceAttributeRef&&(A={...A,sourceAttributeRef:O})}return E!==y.modelId||A!==y.derivedFrom||S.some(($,O)=>$!==y.dbAttrs[O])?{...y,modelId:E,dbAttrs:S,derivedFrom:A}:y}),_=(N=h.indexes)==null?void 0:N.map(y=>{const E=g.idx.get(y),S=y.columns.map(V=>{const $=c(h.modelId,V.columnRef);return $===V.columnRef?V:{...V,columnRef:$}});return E!==y.modelId||S.some((V,$)=>V!==y.columns[$])?{...y,modelId:E,columns:S}:y});return b.some((y,E)=>y!==h.attributes[E])||_&&h.indexes&&_.some((y,E)=>y!==h.indexes[E])?{...h,attributes:b,..._?{indexes:_}:{}}:h}),p=e.associations.map(h=>{const g=c(h.end1.entityRef,h.end1.attributeRef),b=c(h.end2.entityRef,h.end2.attributeRef);return g===h.end1.attributeRef&&b===h.end2.attributeRef?h:{...h,end1:g===h.end1.attributeRef?h.end1:{...h.end1,attributeRef:g},end2:b===h.end2.attributeRef?h.end2:{...h.end2,attributeRef:b}}}),f=n.associationLayouts.map(h=>{const g=d.get(h.associationRef);if(!g)return h;const b=c(g.end1.entityRef,h.sourceColumnRef),_=c(g.end2.entityRef,h.targetColumnRef);return b===h.sourceColumnRef&&_===h.targetColumnRef?h:{...h,sourceColumnRef:b,targetColumnRef:_}});return{logical:{...e,entities:m,associations:p},layout:f.some((h,g)=>h!==n.associationLayouts[g])?{...n,associationLayouts:f}:n,reissued:s}}function nb(e,n,o){let i=n;for(;;){const a=`dup${i}:${e}`;if(!o.has(a))return a;i++}}function jt(e){return e.reduce((n,o)=>Math.max(n,o.order),-1)+1}function Il(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 Ed(e){return!!e.derivedFrom&&e.dbAttrs.length>0}function Nd(e){for(const n of e){const o=[...n.attributes].sort((s,c)=>s.order-c.order),i=o.filter(Ed);if(!i.length)continue;const a=o.filter(s=>!Ed(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 Fo(e){return JSON.parse(JSON.stringify(e))}function wd(e,n,o){var V;const i=o.idFactory??Pe,a=o.offset??{x:0,y:0},{logical:r,layout:l}=e,s=new Set(n);if(o.includeRelated){const $=new Set(n);for(const O of r.associations){const C=$.has(O.end1.entityRef),R=$.has(O.end2.entityRef);C!==R&&s.add(C?O.end2.entityRef:O.end1.entityRef)}}const c=r.entities.filter($=>s.has($.modelId)),d=new Set(c.map($=>$.modelId)),u=r.associations.filter($=>d.has($.end1.entityRef)&&d.has($.end2.entityRef)),m=new Set(u.map($=>$.modelId)),p=new Map,f=$=>{let O=p.get($);return O||(O=i(),p.set($,O)),O};for(const $ of c){f($.modelId);for(const O of $.attributes){f(O.modelId);for(const C of O.dbAttrs)f(C.modelId)}for(const O of $.indexes??[])f(O.modelId);for(const O of $.operations??[])f(O.modelId)}for(const $ of u)f($.modelId);const h=$=>p.get($),g=c.map($=>{const O=Fo($);O.modelId=h($.modelId),O.attributes=O.attributes.map(C=>ob(C,h,m,d));for(const C of O.indexes??[])C.modelId=h(C.modelId),C.columns=C.columns.map(R=>Xn(R.columnRef)?R:{...R,columnRef:h(R.columnRef)}).filter(R=>R.columnRef!==void 0);for(const C of O.operations??[])C.modelId=h(C.modelId);return O});Nd(g);const b=u.map($=>{const O=Fo($);return O.modelId=h($.modelId),O.end1=Id(O.end1,h),O.end2=Id(O.end2,h),O}),_=[];for(const $ of r.groups){const O=$.memberEntityRefs.filter(R=>d.has(R));if(O.length===0)continue;const C=Fo($);C.modelId=f($.modelId),C.memberEntityRefs=O.map(R=>h(R)),_.push(C)}const k=o.collisionSuffix??"_imported",N=new Set(o.existing.entities.map($=>$.name)),y=new Set(o.existing.entities.map($=>{var O;return(O=$.table)==null?void 0:O.physicalName}).filter($=>!!$));for(const $ of g)N.has($.name)&&($.name=`${$.name}${k}`),(V=$.table)!=null&&V.physicalName&&y.has($.table.physicalName)&&($.table.physicalName=`${$.table.physicalName}${k}`);const E=[];for(const $ of l.entityLayouts){const O=h($.entityRef);if(!O)continue;const C=Fo($);C.entityRef=O,C.geo={...C.geo,location:vl(C.geo.location,a)},C.attributeStyles&&(C.attributeStyles=Na(C.attributeStyles,h)),C.operationStyles&&(C.operationStyles=Na(C.operationStyles,h)),E.push(C)}const S=[];for(const $ of l.associationLayouts){const O=h($.associationRef);if(!O)continue;const C=Fo($);C.associationRef=O,C.sourceColumnRef=$.sourceColumnRef?h($.sourceColumnRef):void 0,C.targetColumnRef=$.targetColumnRef?h($.targetColumnRef):void 0,C.waypoints=C.waypoints.map(R=>vl(R,a)),S.push(C)}const A=[];for(const $ of l.groupLayouts){const O=h($.groupRef);if(!O)continue;const C=Fo($);C.groupRef=O,C.geo={...C.geo,location:vl(C.geo.location,a)},delete C.memberNoteRefs,A.push(C)}return{logical:{entities:g,associations:b,groups:_},layout:{entityLayouts:E,associationLayouts:S,groupLayouts:A},idMap:p}}function vl(e,n){return{x:e.x+n.x,y:e.y+n.y}}function ob(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 Id(e,n){return{...e,entityRef:n(e.entityRef),attributeRef:e.attributeRef?n(e.attributeRef):void 0}}function Na(e,n){const o={};for(const[i,a]of Object.entries(e)){const r=n(i);r&&(o[r]=a)}return o}function Cl(e){if(!("rev"in e))return e;const{rev:n,...o}=e;return o}function lo(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)=>lo(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(!lo(e[i],n[i]))return!1;return!0}return!1}function so(e,n,o){const i={},a=new Set([...Object.keys(e),...Object.keys(n)]);for(const r of a)o.has(r)||lo(e[r],n[r])||(i[r]=n[r]===void 0?null:n[r]);return Object.keys(i).length?i:null}function co(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 ib(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 ab=new Set(["attributes","operations","indexes","rev"]),rb=new Set(["end1","end2","rev"]),lb=new Set(["memberEntityRefs","rev"]),vd=new Set(["modelId"]),sb=new Set(["modelId","columns"]),cb=new Set([]);function db(e,n,o,i){const a=co(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=so(s,c,vd);d&&i.push({kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:s.modelId,patch:d})}const r=co(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=so(s,c,vd);d&&i.push({kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId,patch:d})}const l=co(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(!lo(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=so(s,c,sb);d&&i.push({kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId,patch:d})}}function ub(e,n,o){const i=co(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:Cl(l)});for(const{cur:l,tgt:s}of i.common){const c=so(l,s,ab);c&&o.push({kind:"entity.update",casUnit:"logical",containerRef:l.modelId,entityRef:l.modelId,patch:c}),db(l.modelId,l,s,o)}const a=co(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:Cl(l)});for(const{cur:l,tgt:s}of a.common){const c=so(l,s,rb);c&&o.push({kind:"association.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,patch:c});for(const d of["end1","end2"]){const u=so(l[d]??{},s[d]??{},cb);u&&o.push({kind:"associationEnd.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,end:d,patch:u})}}const r=co(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:Cl(l)});for(const{cur:l,tgt:s}of r.common){const c=so(l,s,lb);c&&o.push({kind:"group.update",casUnit:"logical",containerRef:l.modelId,groupRef:l.modelId,patch:c});const d=ib(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 wa(e,n,o,i,a,r,l){const s=co(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)lo(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 mb(e,n,o){wa(e.entityLayouts??[],n.entityLayouts??[],i=>i.entityRef,"entityLayout.add","entityLayout.remove","entityRef",o),wa(e.associationLayouts??[],n.associationLayouts??[],i=>i.associationRef,"associationLayout.add","associationLayout.remove","associationRef",o),wa(e.groupLayouts??[],n.groupLayouts??[],i=>i.groupRef,"groupLayout.add","groupLayout.remove","groupRef",o),wa(e.notes??[],n.notes??[],i=>i.modelId,"note.add","note.remove","noteRef",o)}function fb(e,n){const o=[];return ub(e.logical,n.logical,o),mb(e.layout,n.layout,o),o}function pb(e){if(e.groupRef!=null)return"group";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 중 하나 필요).")}const hb={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([])};class yb{constructor(n){ct(this,"out",[]);ct(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({...bi(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({...bi(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({...bi(n),field:a,value:void 0,removed:!0});continue}this.out.push({...bi(n),field:a,value:void 0,removed:!0,oldValue:this.last.get(a)}),this.last.delete(a)}}member(n,o,i){const a="memberEntityRefs";this.fieldFilter!=null&&a!==this.fieldFilter||this.out.push({...bi(n),field:a,value:o,...i?{removed:!0}:{}})}result(){return this.out}}function bi(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 rn(e,n,o,i){if(o==null||typeof o!="object")return;const a=hb[i];for(const[r,l]of Object.entries(o))a.has(r)||e.set(n,r,l)}function uo(e,n,o){if(!(o==null||typeof o!="object"))for(const[i,a]of Object.entries(o))e.set(n,i,a)}function Sl(e,n){if(Array.isArray(e))return e.find(o=>o.modelId===n)}function Ln(e,n){var r,l,s,c,d,u,m,p;const o=pb(n),i=new yb(n.field),a=[...e].sort((f,h)=>f.seq-h.seq);for(const f of a)for(const h of f.ops)switch(o){case"entity":if(h.entityRef!==n.entityRef)break;h.kind==="entity.add"?rn(i,f,h.value,"entity"):h.kind==="entity.update"?uo(i,f,h.patch):h.kind==="entity.remove"&&i.remove(f);break;case"attribute":if(h.entityRef!==n.entityRef)break;if(h.kind==="entity.add"){const g=Sl((r=h.value)==null?void 0:r.attributes,n.attributeRef);g&&rn(i,f,g,"attribute")}else h.kind==="attribute.add"&&((l=h.value)==null?void 0:l.modelId)===n.attributeRef?rn(i,f,h.value,"attribute"):h.kind==="attribute.update"&&h.attributeRef===n.attributeRef?uo(i,f,h.patch):(h.kind==="attribute.remove"&&h.attributeRef===n.attributeRef||h.kind==="entity.remove")&&i.remove(f);break;case"operation":if(h.entityRef!==n.entityRef)break;if(h.kind==="entity.add"){const g=Sl((s=h.value)==null?void 0:s.operations,n.operationRef);g&&rn(i,f,g,"operation")}else h.kind==="operation.add"&&((c=h.value)==null?void 0:c.modelId)===n.operationRef?rn(i,f,h.value,"operation"):h.kind==="operation.update"&&h.operationRef===n.operationRef?uo(i,f,h.patch):(h.kind==="operation.remove"&&h.operationRef===n.operationRef||h.kind==="entity.remove")&&i.remove(f);break;case"index":if(h.entityRef!==n.entityRef)break;if(h.kind==="entity.add"){const g=Sl((d=h.value)==null?void 0:d.indexes,n.indexRef);g&&rn(i,f,g,"index")}else h.kind==="index.add"&&((u=h.value)==null?void 0:u.modelId)===n.indexRef?rn(i,f,h.value,"index"):h.kind==="index.update"&&h.indexRef===n.indexRef?uo(i,f,h.patch):(h.kind==="index.remove"&&h.indexRef===n.indexRef||h.kind==="entity.remove")&&i.remove(f);break;case"association":if(h.associationRef!==n.associationRef)break;h.kind==="association.add"?rn(i,f,h.value,"association"):h.kind==="association.update"?uo(i,f,h.patch):h.kind==="association.remove"&&i.remove(f);break;case"associationEnd":if(h.associationRef!==n.associationRef)break;if(h.kind==="association.add"){const g=(m=h.value)==null?void 0:m[n.end];rn(i,f,g,"associationEnd")}else h.kind==="associationEnd.update"&&h.end===n.end?uo(i,f,h.patch):h.kind==="association.remove"&&i.remove(f);break;case"group":if(h.groupRef!==n.groupRef)break;if(h.kind==="group.add"){rn(i,f,h.value,"group");const g=(p=h.value)==null?void 0:p.memberEntityRefs;if(Array.isArray(g))for(const b of g)i.member(f,b,!1)}else h.kind==="group.update"?uo(i,f,h.patch):h.kind==="group.remove"?i.remove(f):h.kind==="group.addMember"&&h.entityRef!=null?i.member(f,h.entityRef,!1):h.kind==="group.removeMember"&&h.entityRef!=null&&i.member(f,h.entityRef,!0);break}return i.result()}const lt={subject:null,existence:null,fieldAudit:!1,note:"레이아웃 축(LWW) — 감사·복원 diff는 논리 축 전용(AA-5: layout/note는 의도적 범위 밖)"},gb={"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":lt,"entityLayout.remove":lt,"entityLayout.move":lt,"entityLayout.resize":lt,"entityLayout.setCollapsed":lt,"entityLayout.setLocked":lt,"entityLayout.setStyle":lt,"entityLayout.setAttrStyle":lt,"entityLayout.setOpStyle":lt,"groupLayout.add":lt,"groupLayout.remove":lt,"groupLayout.move":lt,"groupLayout.resize":lt,"groupLayout.setLocked":lt,"groupLayout.setStyle":lt,"groupLayout.addNoteMember":lt,"groupLayout.removeNoteMember":lt,"associationLayout.add":lt,"associationLayout.remove":lt,"associationLayout.setWaypoints":lt,"note.add":lt,"note.remove":lt,"note.move":lt,"note.resize":lt,"note.setMemo":lt,"note.setStyle":lt,"noteConnection.add":lt,"noteConnection.remove":lt,"noteConnection.setWaypoints":lt},Kt=e=>typeof e=="string"?e:void 0,bb=e=>{var n;return Kt((n=e.value)==null?void 0:n.modelId)};function Cd(e){return Kt(e.containerRef)??Kt(e.entityRef)}function xl(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=Kt(s.modelId);c&&r.push({subject:{kind:o,ref:c,...i?{entityRef:i}:{}},existence:"add",inline:!0})}return r}function Rl(e){const n=gb[e.kind];if(!n||!n.subject)return[];const o=e,i=n.existence??void 0;switch(n.subject){case"entity":{const a=Kt(o.entityRef);if(!a)return[];const r={subject:{kind:"entity",ref:a},...i?{existence:i}:{}};return e.kind!=="entity.add"?[r]:[r,...xl(o,"attributes","attribute",a),...xl(o,"operations","operation",a),...xl(o,"indexes","index",a)]}case"attribute":case"operation":case"index":{const a=n.subject,r=Cd(o),l={attribute:"attributeRef",operation:"operationRef",index:"indexRef"}[a],s=i==="add"?bb(o):Kt(o[l]);return s?[{subject:{kind:a,ref:s,...r?{entityRef:r}:{}},...i?{existence:i}:{}}]:[]}case"association":case"associationEnd":{const a=Kt(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=Kt(o.groupRef);return a?[{subject:{kind:"group",ref:a},...i?{existence:i}:{}}]:[]}}}function _b(e){const n=e,o=e.kind;if(o.startsWith("entity.")){const i=Kt(n.entityRef);return i?{kind:"entity",ref:i}:null}if(o.startsWith("attribute.")||o.startsWith("operation.")||o.startsWith("index.")){const i=Cd(n);return i?{kind:"entity",ref:i}:null}if(o.startsWith("associationEnd.")||o.startsWith("association.")){const i=Kt(n.associationRef);return i?{kind:"association",ref:i}:null}if(o.startsWith("group.")){const i=Kt(n.groupRef);return i?{kind:"group",ref:i}:null}return null}function kb(e,n){const o=e;return o.entityRef===n||o.containerRef===n}function Eb(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 Rl(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 Ia(e,n){return e.map(o=>({...o,subject:n}))}function Sd(e,n){const o=e.filter(s=>s.ops.some(c=>kb(c,n))),{attributes:i,operations:a,indexes:r}=Eb(o,n),l=[...Ia(Ln(o,{entityRef:n}),{kind:"entity",ref:n})];for(const s of i)l.push(...Ia(Ln(o,{entityRef:n,attributeRef:s}),{kind:"attribute",ref:s}));for(const s of a)l.push(...Ia(Ln(o,{entityRef:n,operationRef:s}),{kind:"operation",ref:s}));for(const s of r)l.push(...Ia(Ln(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 Al(e){return`${e.kind}:${e.ref}:${e.end??""}`}function Nb(e){const n=new Set;for(const o of e)for(const i of o.ops)for(const a of Rl(i))a.existence==="add"&&n.add(Al(a.subject));return n}function wb(e){const n=new Set,o=new Set,i=new Set,a={entity:n,association:o,group:i};for(const r of e)for(const l of r.ops){const s=_b(l);s&&a[s.kind].add(s.ref)}return{entities:n,associations:o,groups:i}}function Ib(e){const{entities:n,associations:o,groups:i}=wb(e),a=[];for(const r of n)for(const l of Sd(e,r))a.push({...l,subject:{...l.subject,entityRef:r}});for(const r of o){for(const l of Ln(e,{associationRef:r}))a.push({...l,subject:{kind:"association",ref:r}});for(const l of["end1","end2"])for(const s of Ln(e,{associationRef:r,end:l}))a.push({...s,subject:{kind:"associationEnd",ref:r,end:l}})}for(const r of i)for(const l of Ln(e,{groupRef:r}))a.push({...l,subject:{kind:"group",ref:r}});return a}function $l(e){const n=Ib(e),o=Nb(e),i=new Map;for(const l of n){const s=Al(l.subject),c=i.get(s);(c===void 0||l.seq<c)&&i.set(s,l.seq)}const a=new Map;for(const l of n){let s=a.get(l.seq);s||(s={meta:l,subjects:new Map},a.set(l.seq,s));const c=Al(l.subject);let d=s.subjects.get(c);if(!d){const u=l.removed?"remove":i.get(c)===l.seq&&o.has(c)?"add":"update";d={subject:l.subject,verb:u,fields:[]},s.subjects.set(c,d)}l.removed?d.verb="remove":d.fields.push({field:l.field,value:l.value,...l.oldValue!==void 0?{oldValue:l.oldValue}:{}})}const r=[];for(const[l,s]of a){const c=s.meta;r.push({seq:l,...c.ts!==void 0?{ts:c.ts}:{},...c.origin!==void 0?{origin:c.origin}:{},...c.author!==void 0?{author:c.author}:{},...c.kind!==void 0?{kind:c.kind}:{},...c.restoredFromSeq!==void 0?{restoredFromSeq:c.restoredFromSeq}:{},actions:[...s.subjects.values()]})}return r.sort((l,s)=>s.seq-l.seq)}function xd(e){return`${e.kind}:${e.ref}:${e.end??""}`}function vb(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 Rl(r)){if(!l.existence||l.inline)continue;const s=l.subject;Cb.has(s.kind)&&!s.entityRef||i.push({seq:a.seq,subject:s,verb:l.existence,fields:[]})}return i}const Cb=new Set(["attribute","operation","index"]);function Tl(e,n){const{fromSeq:o}=n,i=$l(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 p=xd(m.subject);let f=s.get(p);f||(f={subject:m.subject,evs:[]},s.set(p,f)),f.evs.push(m)};for(const m of l)for(const p of m.actions)c({seq:m.seq,subject:p.subject,verb:p.verb,fields:p.fields});for(const m of vb(e,o,r)){const p=s.get(xd(m.subject));p!=null&&p.evs.some(f=>f.seq===m.seq)||c(m)}const d=[],u=new Set;for(const m of s.values()){m.evs.sort((f,h)=>f.seq-h.seq);const p=m.evs[m.evs.length-1];m.subject.kind==="entity"&&p.verb==="remove"&&u.add(m.subject.ref)}for(const m of s.values()){const p=m.evs[0].verb==="add",f=m.evs[m.evs.length-1].verb==="remove";if(m.subject.kind!=="entity"&&m.subject.entityRef&&u.has(m.subject.entityRef)||p&&f)continue;const h=new Map;let g=null;for(const _ of m.evs){_.verb==="add"&&g!==null&&g!=="add"&&h.clear(),g=_.verb;for(const k of _.fields){const N=h.get(k.field);N?N.lastValue=k.value:h.set(k.field,{firstOld:k.oldValue,hasOld:k.oldValue!==void 0,lastValue:k.value})}}if(f){d.push({subject:m.subject,verb:"removed",fields:[]});continue}if(p){const _=[];for(const[k,N]of h)_.push({field:k,value:N.lastValue});d.push({subject:m.subject,verb:"added",fields:_});continue}const b=[];for(const[_,k]of h)k.hasOld&&lo(k.firstOld,k.lastValue)||b.push({field:_,value:k.lastValue,...k.hasOld?{oldValue:k.firstOld}:{}});b.length!==0&&d.push({subject:m.subject,verb:"modified",fields:b})}return{fromSeq:o,toSeq:r,entries:d}}function Rd(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 Ml{constructor(n){ct(this,"undoStack",[]);ct(this,"redoStack",[]);ct(this,"savePoint",null);ct(this,"listeners",new Set);ct(this,"commandListeners",new Set);ct(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 Dt(e){const n={};for(const[o,i]of Object.entries(e))n[o]=i===void 0?null:i;return n}function Ad(e,n){return e.logical.entities.findIndex(o=>o.modelId===n)}function Nt(e,n){return e.layout.entityLayouts.findIndex(o=>o.entityRef===n)}function Gt(e,n){return e.layout.associationLayouts.find(o=>o.associationRef===n)}function ut(e,n){const o=e.logical.entities.find(i=>i.modelId===n);if(!o)throw new Error(`엔티티 없음: ${n}`);return o}function En(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 va(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=Ad(i,e.modelId);a>=0&&i.logical.entities.splice(a,1);const r=Nt(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 $d(e){let n=null;const o=i=>i.end1.entityRef===e||i.end2.entityRef===e;return{label:"엔티티 삭제",apply(i){const a=Ad(i,e);if(a<0)throw new Error(`엔티티 없음: ${e}`);const r=Nt(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(p=>p.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 Vl(e,n){const o={};return{label:"엔티티 수정",apply(i){const a=ut(i,e);for(const r of Object.keys(n))o[r]=a[r];Object.assign(a,n)},invert(i){Object.assign(ut(i,e),o)},emitOps(){return{forward:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:Dt(n)}],invert:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:Dt(o)}]}}}}function Td(e,n){let o="";return{label:`엔티티 이름 변경: ${n}`,apply(i){const a=ut(i,e);o=a.name,a.name=n},invert(i){ut(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 Uo(e,n){let o=null;return{label:"엔티티 이동",apply(i){const a=Nt(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=Nt(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 Md(e,n){let o=null;return{label:"엔티티 크기 변경",apply(i){const a=Nt(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=Nt(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 _i(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 Vd(e,n){let o;return{label:"엔티티 색상 변경",apply(i){const a=Nt(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.style,r.style=_i(r.style,n)},invert(i){const a=Nt(i,e);a>=0&&(i.layout.entityLayouts[a].style=o)},emitOps(i){const a=Nt(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 Bd(e,n){let o;return{label:n?"엔티티 접기":"엔티티 펼치기",apply(i){const a=Nt(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=Nt(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 Dd(e,n){let o;return{label:n?"엔티티 잠금":"엔티티 잠금 해제",apply(i){const a=Nt(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=Nt(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 Bl(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 Ca(e,n,o){let i;return{label:"속성 색상 변경",apply(a){const r=Nt(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.attributeStyles;const s={...l.attributeStyles},c=_i(s[n],o);c?s[n]=c:delete s[n],l.attributeStyles=Object.keys(s).length?s:void 0},invert(a){const r=Nt(a,e);r>=0&&(a.layout.entityLayouts[r].attributeStyles=i)},emitOps(a){const r=Nt(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 Sa(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 Od(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:Dt(n)}],invert:[{kind:"group.update",casUnit:"logical",containerRef:e,groupRef:e,patch:Dt(o)}]}}}}function Ld(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 Pd(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 xa(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 zd(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 Fd(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 Ud(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=_i(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 Hd(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 Yt(e,n){return{label:`속성 추가: ${n.name}`,apply(o){ut(o,e).attributes.push(n)},invert(o){const i=ut(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 qt(e,n,o){const i={},a=r=>{const l=ut(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:Dt(o)}],invert:[{kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:n,patch:Dt(i)}]}}}}function jd(e,n){let o=null;return{label:"속성 삭제",apply(i){const a=ut(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&&ut(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 Kd(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 Dl(e,n,o){let i=null;return{label:"속성 재정렬",apply(a){const r=ut(a,e);i=r.attributes.map(s=>({...s}));const l=Il([...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&&ut(a,e).attributes.splice(0,1/0,...i)},emitOps(a){const r=ut(a,e).attributes;return Kd("attribute.update","attributeRef",e,r,i??[])}}}function Gd(e,n){let o=!1;return{label:`메서드 추가: ${n.name}`,apply(i){const a=ut(i,e);a.operations||(a.operations=[],o=!0),a.operations.push(n)},invert(i){var l;const a=ut(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 Yd(e,n,o){const i={},a=r=>{var s;const l=(s=ut(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:Dt(o)}],invert:[{kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:n,patch:Dt(i)}]}}}}function qd(e,n){let o=null;return{label:"메서드 삭제",apply(i){var s;const a=ut(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=ut(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 Wd(e,n,o){let i=null;return{label:"메서드 재정렬",apply(a){const r=ut(a,e),l=r.operations??[];i=l.map(c=>({...c}));const s=Il([...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=ut(a,e);r.operations&&r.operations.splice(0,1/0,...i)},emitOps(a){const r=ut(a,e).operations??[];return Kd("operation.update","operationRef",e,r,i??[])}}}function Jd(e,n,o){let i;return{label:"메서드 색상 변경",apply(a){const r=Nt(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.operationStyles;const s={...l.operationStyles},c=_i(s[n],o);c?s[n]=c:delete s[n],l.operationStyles=Object.keys(s).length?s:void 0},invert(a){const r=Nt(a,e);r>=0&&(a.layout.entityLayouts[r].operationStyles=i)},emitOps(a){const r=Nt(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 Ra(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 Xd(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 Aa(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:Dt(n)}],invert:[{kind:"association.update",casUnit:"logical",containerRef:e,associationRef:e,patch:Dt(o)}]}}}}function Wt(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:Dt(o)}],invert:[{kind:"associationEnd.update",casUnit:"logical",containerRef:e,associationRef:e,end:n,patch:Dt(i)}]}}}}function Zd(e,n){return{label:"인덱스 추가",apply(o){const i=ut(o,e);(i.indexes??(i.indexes=[])).push(n)},invert(o){var r;const i=ut(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 $a(e,n,o){const i={},a=r=>{var s;const l=(s=ut(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:Dt(o)}],invert:[{kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:n,patch:Dt(i)}]}}}}function Qd(e,n){let o=null;return{label:"인덱스 삭제",apply(i){var l;const a=ut(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&&ut(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 ln=(e,n)=>({kind:"associationLayout.setWaypoints",casUnit:"layout",associationRef:e,value:{waypoints:n}}),ki=(e,n)=>{var o;return((o=Gt(e,n))==null?void 0:o.waypoints.map(i=>({...i})))??[]};function eu(e,n,o){let i=null;return{label:"waypoint 이동",coalesceKey:`waypoint:${e}`,apply(a){const r=Gt(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=Gt(a,e);r&&i&&r.waypoints.splice(n,1,i)},emitOps(a){const r=ki(a,e),l=r.map((s,c)=>c===n&&i?{...i}:s);return{forward:[ln(e,r)],invert:[ln(e,l)]}}}}function tu(e,n){let o=null;return{label:"waypoint 제거",apply(i){const a=Gt(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=Gt(i,e);a&&o&&a.waypoints.splice(n,0,o)},emitOps(i){const a=ki(i,e),r=a.slice();return o&&r.splice(n,0,{...o}),{forward:[ln(e,a)],invert:[ln(e,r)]}}}}function nu(e,n,o){let i=null;return{label:"waypoint 평행이동",apply(a){const r=Gt(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=Gt(a,e);r&&i&&(r.waypoints=i)},emitOps(a){return{forward:[ln(e,ki(a,e))],invert:[ln(e,i??[])]}}}}function ou(e){let n=null;return{label:"꺾은선 풀기",apply(o){const i=Gt(o,e);if(!i)throw new Error(`관계 레이아웃 없음: ${e}`);n=i.waypoints.map(a=>({...a})),i.waypoints=[]},invert(o){const i=Gt(o,e);i&&n&&(i.waypoints=n)},emitOps(o){return{forward:[ln(e,ki(o,e))],invert:[ln(e,n??[])]}}}}function iu(e,n,o){return{label:"waypoint 추가",apply(i){const a=Gt(i,e);if(!a)throw new Error(`관계 레이아웃 없음: ${e}`);a.waypoints.splice(n,0,{...o})},invert(i){const a=Gt(i,e);a==null||a.waypoints.splice(n,1)},emitOps(i){const a=ki(i,e),r=a.slice();return r.splice(n,1),{forward:[ln(e,a)],invert:[ln(e,r)]}}}}function au(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 ru(e){let n=null;return{label:"노트 삭제",apply(o){const i=o.layout.notes.findIndex(a=>a.modelId===e);if(i<0)throw new Error(`노트 없음: ${e}`);n={item:o.layout.notes[i],index:i},o.layout.notes.splice(i,1)},invert(o){n&&o.layout.notes.splice(n.index,0,n.item)},emitOps(){return n?{forward:[{kind:"note.remove",casUnit:"layout",noteRef:e}],invert:[{kind:"note.add",casUnit:"layout",noteRef:e,value:n.item}]}:{forward:[],invert:[]}}}}function Ei(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 lu(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 su(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 cu(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=_i(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 du(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 uu(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 Pn=(e,n,o)=>({kind:"noteConnection.setWaypoints",casUnit:"layout",noteRef:e,targetRef:n,value:{waypoints:o}}),Ta=(e,n,o)=>{var i;return((i=En(e,n,o))==null?void 0:i.waypoints.map(a=>({...a})))??[]};function mu(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 fu(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 pu(e,n,o,i){let a=null;return{label:"waypoint 이동",coalesceKey:`noteConnWaypoint:${e}:${n}`,apply(r){const l=En(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=En(r,e,n);l&&a&&l.waypoints.splice(o,1,a)},emitOps(r){const l=Ta(r,e,n),s=l.map((c,d)=>d===o&&a?{...a}:c);return{forward:[Pn(e,n,l)],invert:[Pn(e,n,s)]}}}}function hu(e,n,o,i){return{label:"waypoint 추가",apply(a){const r=En(a,e,n);if(!r)throw new Error(`노트 연결 없음: ${e}→${n}`);r.waypoints.splice(o,0,{...i})},invert(a){const r=En(a,e,n);r==null||r.waypoints.splice(o,1)},emitOps(a){const r=Ta(a,e,n),l=r.slice();return l.splice(o,1),{forward:[Pn(e,n,r)],invert:[Pn(e,n,l)]}}}}function yu(e,n,o){let i=null;return{label:"waypoint 제거",apply(a){const r=En(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=En(a,e,n);r&&i&&r.waypoints.splice(o,0,i)},emitOps(a){const r=Ta(a,e,n),l=r.slice();return i&&l.splice(o,0,{...i}),{forward:[Pn(e,n,r)],invert:[Pn(e,n,l)]}}}}function gu(e,n){let o=null;return{label:"꺾은선 풀기",apply(i){const a=En(i,e,n);if(!a)throw new Error(`노트 연결 없음: ${e}→${n}`);o=a.waypoints.map(r=>({...r})),a.waypoints=[]},invert(i){const a=En(i,e,n);a&&o&&(a.waypoints=o)},emitOps(i){return{forward:[Pn(e,n,Ta(i,e,n))],invert:[Pn(e,n,o??[])]}}}}function at(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 Sb=Object.freeze(Object.defineProperty({__proto__:null,addAssociation:Ra,addAttribute:Yt,addEntity:va,addEntityToGroup:Pd,addGroup:Sa,addIndex:Zd,addNote:au,addNoteConnection:mu,addNoteConnectionWaypoint:hu,addNoteToGroup:du,addOperation:Gd,addWaypoint:iu,clearNoteConnectionWaypoints:gu,clearWaypoints:ou,composite:at,moveEntity:Uo,moveGroup:zd,moveNote:Ei,moveNoteConnectionWaypoint:pu,moveWaypoint:eu,removeAssociation:Xd,removeAttribute:jd,removeEntity:$d,removeEntityFromGroup:xa,removeGroup:Ld,removeIndex:Qd,removeNote:ru,removeNoteConnection:fu,removeNoteConnectionWaypoint:yu,removeNoteFromGroup:uu,removeOperation:qd,removeWaypoint:tu,renameEntity:Td,reorderAttributes:Dl,reorderOperations:Wd,resizeEntity:Md,resizeGroup:Fd,resizeNote:lu,setAllEntitiesCollapsed:Bl,setAttributeSwatch:Ca,setEntityCollapsed:Bd,setEntityLocked:Dd,setEntitySwatch:Vd,setGroupLocked:Hd,setGroupSwatch:Ud,setNoteMemo:su,setNoteSwatch:cu,setOperationSwatch:Jd,translateWaypoints:nu,updateAssociation:Aa,updateAssociationEnd:Wt,updateAttribute:qt,updateEntity:Vl,updateGroup:Od,updateIndex:$a,updateOperation:Yd},Symbol.toStringTag,{value:"Module"}));class bu{constructor(){ct(this,"revs",new Map);ct(this,"layoutVersion",0);ct(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 xb=[400,1200];function Rb(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 Ab(e){const n=Rb(e);return n==null||n===408||n===429?!0:n<400||n>=500}const $b=e=>new Promise(n=>setTimeout(n,e));class _u{constructor(n){ct(this,"cache",new bu);ct(this,"newClientOpId");ct(this,"debounceMs");ct(this,"retryDelaysMs");ct(this,"emissions",new WeakMap);ct(this,"open",null);ct(this,"debounceHandle",null);ct(this,"queue",[]);ct(this,"sending",!1);ct(this,"_frozen",!1);ct(this,"stack",null);ct(this,"settledWaiters",[]);this.opts=n,this.newClientOpId=n.newClientOpId??Pe,this.debounceMs=n.debounceMs??300,this.retryDelaysMs=n.retryDelaysMs??xb}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||!Ab(l)){this.sending=!1,console.error("[op-sync] 전송 실패 확정 → 하드 프리즈(kind:missing)"),this.freeze({kind:"missing"});return}await $b(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 ku=["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"],Eu=["NORMAL","RELATION_OWN","RELATION_REF","EMBED_OWN","EMBED_REF","EMBED_PREDEF","DIVIDER"];function Nu(e,n){var r;if(!n.length||!((r=e.indexes)!=null&&r.length))return[];const o=new Set(n),i=new Set;for(const l of e.attributes)if(o.has(l.modelId)){i.add(l.modelId);for(const s of l.dbAttrs)i.add(s.modelId)}if(!i.size)return[];const a=[];for(const l of e.indexes){const s=l.columns.filter(c=>!i.has(c.columnRef));s.length!==l.columns.length&&a.push({indexRef:l.modelId,columns:s})}return a}function Tb(e){return gn(e).length}function Ol(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 Mb(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=di(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 wu(e,n,o=Pe){const i=e.entities.find(c=>c.modelId===n);if(!i)return[];const a=Tb(i);if(a===0)return[];const r=Ol(e,n),l=gn(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;Mb(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 Iu(e,n,o){var p;const i=e.entities.find(f=>f.modelId===n);if(!i)return[];const a=i.attributes;if(o.length!==a.length)return[];const r=new Map(a.map(f=>[f.modelId,f])),l=[];for(const f of o){const h=r.get(f);if(!h)return[];l.push(h)}const s=a.flatMap(f=>f.dbAttrs).map(f=>f.modelId),c=l.flatMap(f=>f.dbAttrs).map(f=>f.modelId);if(s.length!==c.length)return[];if(s.every((f,h)=>f===c[h]))return[];const d=new Map(s.map((f,h)=>[f,h])),u=Ol(e,n),m=[];for(const f of e.entities)for(const h of f.attributes){if(h.attrType!=="EMBED_OWN"||((p=h.embedded)==null?void 0:p.embeddableRef)!==n||u.has(h.embedded.associationRef)||h.dbAttrs.length!==s.length)continue;const g=c.map(_=>h.dbAttrs[d.get(_)]),b=g.reduce((_,k,N)=>k===h.dbAttrs[N]?_:_+1,0);b&&m.push({entityId:f.modelId,attributeId:h.modelId,dbAttrs:g,moved:b})}return m}function vu(e,n,o){var p;const i=e.entities.find(f=>f.modelId===n);if(!i)return[];const a=new Set(o),r=i.attributes.filter(f=>!a.has(f.modelId));if(r.length===i.attributes.length)return[];const l=gn(i).map(f=>f.col),s=l.map(f=>f.modelId),c=new Set(gn({...i,attributes:r}).map(f=>f.col.modelId)),d=new Set;if(s.forEach((f,h)=>{c.has(f)&&d.add(h)}),d.size===s.length)return[];const u=Ol(e,n),m=[];for(const f of e.entities)for(const h of f.attributes){if(h.attrType!=="EMBED_OWN"||((p=h.embedded)==null?void 0:p.embeddableRef)!==n||u.has(h.embedded.associationRef)||h.dbAttrs.length!==s.length)continue;const g=h.dbAttrs.filter((k,N)=>d.has(N)),b=h.dbAttrs.filter((k,N)=>!d.has(N));h.dbAttrs.some((k,N)=>{if(d.has(N))return!1;const y=l[N],E=!!k.physicalName&&k.physicalName!==((y==null?void 0:y.physicalName)??""),S=k.sharedColumnRef!=null&&k.sharedColumnRef!==(y==null?void 0:y.sharedColumnRef);return E||S})||m.push({entityId:f.modelId,attributeId:h.modelId,dbAttrs:g,dropped:b})}return m}function Vb(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 Bb(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 Cu(e,n,o){return e.associations.filter(i=>{const a=[i.end1.entityRef,i.end2.entityRef];return a.includes(n)&&a.includes(o)})}function St(e,n){const o=Vb(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>Lb(i,e))}}function Db(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 Ll(e,n){const o=Db(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 Pl(e,n,o){return e.reason==="not-found"?{code:"group-not-found",opIndex:n,handle:o}:{code:"group-ambiguous",opIndex:n,handle:o,matches:e.matches}}const Ob=new Set(["name","description","packageName","excludeDDLGeneration"]);function Lb(e,n){var a;const o=Mo(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(p=>p.modelId===l);return(s==null?void 0:s.name)||((m=s==null?void 0:s.table)==null?void 0:m.physicalName)||String(l??"?")}))]}}function Su(e,n){const o=Bb(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 Pb(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 zb(e,n){const o=Pb(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 xu(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 zl(e){return e.by!==void 0&&e.by!=="name"}function Fb(e,n){return(e.indexes??[]).filter(o=>o.name===n.ref)}function Ub(e,n){return(e.operations??[]).filter(o=>o.name===n.ref)}function Hb(e,n){const o=Fb(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 Ru(e,n){const o=Ub(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 Au(e){return e.physicalName!=null||e.dataType!=null||e.length!=null||e.scale!=null||e.columnLogicalName!=null||e.unique!=null||e.updatable!=null}function $u(e){return Au(e)&&e.dataType==null}function Tu(e,n,o){const i=Au(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}:{},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 Mu(e,n,o,i,a,r,l,s,c){const d=c(),u=new Map((e.embeddableOverrides??[]).map(f=>[f.field,f])),m=[];let p=!1;for(const f of n.fields){const h=u.get(f.name);if(h!=null&&h.sharedColumnPhysicalName){const g={ref:h.sharedColumnPhysicalName,by:"physicalName"},b=xu(Dn(i,a),g);if(!b.ok){s.push(b.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:r,entity:l,handle:g}:{code:"shared-column-target-ambiguous",opIndex:r,entity:l,handle:g,matches:b.matches}),p=!0;continue}m.push({modelId:c(),physicalName:"",dataType:"",sharedColumnRef:b.value.modelId});continue}m.push({modelId:c(),physicalName:(h==null?void 0:h.physicalName)??"",dataType:"",...h!=null&&h.length?{length:h.length}:{},...h!=null&&h.scale?{scale:h.scale}:{},...(h==null?void 0:h.insertable)!=null?{insertable:h.insertable}:{},...(h==null?void 0:h.updatable)!=null?{updatable:h.updatable}:{}})}return p?null:{modelId:d,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:m}}const jb=new Set(["name","type","customType","attrType","identifier","notNull","transient","naturalId","naturalIdMutable","description","attributeGroup","groupCode","defaultValue","personalInfoAttributeType","order","dbAttrs","derivedIdFieldName"]),Ho=e=>new Set(Object.keys(e)),Kb=Ho({name:!0,stereotype:!0,physicalName:!0,useVersion:!0,attributes:!0,indexes:!0,operations:!0,serialization:!0}),Vu=Ho({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}),Bu=Ho({name:!0,unique:!0,columns:!0,description:!0,parameters:!0}),Du=Ho({name:!0,visibility:!0,sourceCode:!0,description:!0,personalInfoAttributeType:!0}),Gb=Ho({from:!0,to:!0,fromMultiplicity:!0,toMultiplicity:!0,identifying:!0,composition:!0}),Yb=Ho({name:!0,packageName:!0,description:!0,excludeDDLGeneration:!0,members:!0});function Nn(e,n){return mo(e,n)}const qb=new Set(["name","stereotype","packageName","superClass","schema","description","abstractClass","hasPersonalInfo","declarationOfInterfaces","table","referenceOnly","serialization"]),Wb=new Set(["description","identifying"]),Jb=new Set(["multiplicity","navigable","composition"]),Xb=new Set(["name","unique","description","parameters"]),Zb=new Set(["name","visibility","sourceCode","description","order","personalInfoAttributeType"]);function mo(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 Fl=new Set(["physicalName","logicalName","dataType","length","scale","unique","autoIncrement","updatable","insertable","sharedColumnRef","multiValue","multiValueSeparator","sequenceName"]),Qb=new Set([...Fl].filter(e=>e!=="sharedColumnRef"));function e_(e,n,o,i){if(i||o.some(l=>!Qb.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))Fl.has(l)||(r[l]=s);return{...r,dbAttrs:[a]}}function t_(e,n,o,i,a,r,l,s){const c=new Map(o.map(m=>[m.field,m])),d=[];let u=!1;return e.dbAttrs.forEach((m,p)=>{const f=n.fields[p],h=f?c.get(f.name):void 0;if(!h){d.push(m);return}if(h.sharedColumnPhysicalName){const b={ref:h.sharedColumnPhysicalName,by:"physicalName"},_=xu(Dn(i,a),b);if(!_.ok){s.push(_.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:_.matches}),u=!0;return}d.push({modelId:m.modelId,physicalName:"",dataType:"",sharedColumnRef:_.value.modelId});return}const g={...m};delete g.sharedColumnRef,d.push({...g,...h.physicalName!=null?{physicalName:h.physicalName}:{},...h.length!=null?{length:h.length}:{},...h.scale!=null?{scale:h.scale}:{},...h.insertable!=null?{insertable:h.insertable}:{},...h.updatable!=null?{updatable:h.updatable}:{}})}),u?null:d}function Ou(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 Lu(e,n,o,i,a,r){const l=[];let s=!1;for(const c of n.columns){const d=zb(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 jo(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 n_(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 Nu(s,l))e.push({kind:"index.update",casUnit:"logical",containerRef:r,entityRef:r,indexRef:c.indexRef,patch:{columns:c.columns}})}}function o_(e,n,o,i,a,r){const l=m=>{const p=new Map;for(const{entityId:f,item:h}of m){if(a.has(f))continue;const g=p.get(f)??[];g.push(h),p.set(f,g)}return p},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,p]of s)if(!c.has(m))for(const f of vu(n,m,p))u(f);for(const[m,p]of c){if(s.has(m))continue;const f={...n,entities:n.entities.map(h=>h.modelId===m?{...h,attributes:[...h.attributes,...p]}:h)};for(const h of wu(f,m,r))u(h)}}function Pu(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 zu(e,n,o,i,a,r,l){var p;for(const f of i.remove)jo(e,r,o,f);for(const f of i.update)e.push({kind:"attribute.update",casUnit:"logical",containerRef:o,entityRef:o,attributeRef:f.attributeId,patch:f.patch}),a.attrPatches.push({entityId:o,attributeId:f.attributeId,patch:f.patch});const s=((p=n.entities.find(f=>f.modelId===o))==null?void 0:p.attributes)??[],c=[];for(const f of i.add){const h={...f,order:l(o,s)};e.push({kind:"attribute.add",casUnit:"logical",containerRef:o,entityRef:o,value:h}),a.cascadeAdds.push({entityId:o,attribute:h}),c.push(h)}const d=new Set(i.remove),u=[...s.filter(f=>!d.has(f.modelId)),...c],m=new Set(u.map(f=>f.modelId));for(const f of n.associations){if(f.end2.entityRef!==o)continue;const h=f.end2.attributeRef;if(h&&m.has(h))continue;const b=u.filter(_=>{var k;return((k=_.derivedFrom)==null?void 0:k.associationRef)===f.modelId&&_.dbAttrs.length>0}).sort((_,k)=>_.order-k.order)[0];b&&(e.push({kind:"associationEnd.update",casUnit:"logical",containerRef:f.modelId,associationRef:f.modelId,end:"end2",patch:{attributeRef:b.modelId}}),a.endPatches.push({associationRef:f.modelId,end:"end2",patch:{attributeRef:b.modelId}}))}}function Ul(e,n,o,i,a,r,l){for(const{entityId:s,plan:c}of nd(n,o,i))zu(e,n,s,c,a,r,l)}function i_(e,n,o,i,a,r){const l=new Map;for(const{entityId:p,attributeId:f}of i.pairs)l.has(p)||l.set(p,new Set),l.get(p).add(f);const s=new Map;for(const p of r.attrPatches)s.has(p.entityId)||s.set(p.entityId,[]),s.get(p.entityId).push(p);const c=new Map;for(const{entityId:p,attribute:f}of[...a,...r.cascadeAdds])c.has(p)||c.set(p,[]),c.get(p).push(f);const d=p=>{const f={};for(const[h,g]of Object.entries(p))h.includes(".")||(f[h]=g===null?void 0:g);return f},u=e.entities.filter(p=>!n.has(p.modelId)).map(p=>{const f=l.get(p.modelId),h=s.get(p.modelId),g=c.get(p.modelId);if(!f&&!h&&!g)return p;let b=p.attributes;return f&&(b=b.filter(_=>!f.has(_.modelId))),h&&(b=b.map(_=>{const k=h.filter(N=>N.attributeId===_.modelId);return k.length?k.reduce((N,y)=>Pu(N,y.patch),_):_})),g&&(b=[...b,...g]),{...p,attributes:b}}),m=e.associations.filter(p=>!o.has(p.modelId)&&!n.has(p.end1.entityRef)&&!n.has(p.end2.entityRef)).map(p=>{let f=p;for(const h of r.assocPatches)h.associationRef===p.modelId&&(f={...f,...d(h.patch)});for(const h of r.endPatches)h.associationRef===p.modelId&&(f={...f,[h.end]:{...f[h.end],...d(h.patch)}});return f}).concat(r.addedAssociations);return{...e,entities:u,associations:m}}function a_(e,n,o,i,a,r,l,s,c){if(!l.identifierCascadeParents.size)return;const d=i_(n,o,i,a,r,l),u=new Map;for(const m of l.identifierCascadeParents)for(const[p,f]of cl(d,m,s)){const h=u.get(p);u.set(p,h?sl(h,f):f)}for(const[m,p]of u)zu(e,d,m,td(p),l,a,c)}function r_(e,n,o={}){const i=o.mkId??Pe,a=o.embeddableCatalog??[],r=y=>a.find(E=>E.type===y),l=[],s=[],c=new Map,d=(y,E)=>{const S=c.get(y)??jt(E);return c.set(y,S+1),S},u=new Map,m=new Set,p=new Set,f={seen:new Set,pairs:[]},h=[],g={attrPatches:[],cascadeAdds:[],addedAssociations:[],assocPatches:[],endPatches:[],identifierCascadeParents:new Set},b=new Set,_=(y,E)=>`${y}\0${E}`,k=new Set;for(const y of n)y.kind==="entity.add"&&(k.add(y.spec.name),y.spec.physicalName&&k.add(y.spec.physicalName));const N=new Set;return n.forEach((y,E)=>{var S,A,V,$,O;switch(y.kind){case"entity.add":{{const M={ref:y.spec.name},x=Nn(y.spec,Kb);if(x.length){s.push({code:"entity-spec-unknown-key",opIndex:E,handle:M,keys:x});break}let P=!1;for(const Y of y.spec.attributes??[]){const se=Nn(Y,Vu);se.length&&(s.push({code:"attribute-spec-unknown-key",opIndex:E,entity:M,handle:{ref:Y.name},keys:se}),P=!0)}for(const Y of y.spec.indexes??[]){const se=Nn(Y,Bu);se.length&&(s.push({code:"index-spec-unknown-key",opIndex:E,entity:M,handle:{ref:Y.name},keys:se}),P=!0)}for(const Y of y.spec.operations??[]){const se=Nn(Y,Du);se.length&&(s.push({code:"operation-spec-unknown-key",opIndex:E,entity:M,handle:{ref:Y.name},keys:se}),P=!0)}if(P)break}const C=e.entities.filter(M=>M.name===y.spec.name).map(M=>M.modelId);if(C.length||N.has(y.spec.name)){s.push({code:"entity-name-conflict",opIndex:E,handle:{ref:y.spec.name},matches:C});break}N.add(y.spec.name);const R=i(),T={modelId:R,name:y.spec.name,stereotype:y.spec.stereotype??"JPA_ENTITY",attributes:[],...y.spec.useVersion?{jpaAttrs:{useVersion:!0}}:{},...y.spec.physicalName?{table:{physicalName:y.spec.physicalName}}:{},...y.spec.serialization?{serialization:y.spec.serialization}:{}},w={ref:y.spec.name};let I=!1;for(const[M,x]of(y.spec.attributes??[]).entries()){if(x.type==="GroupCodeEnum"&&!x.groupCode){s.push({code:"groupcode-required",opIndex:E,entity:w,handle:{ref:x.name}}),I=!0;continue}if(!r(x.type)&&!((S=x.embeddableOverrides)!=null&&S.length)&&$u(x)){s.push({code:"datatype-required",opIndex:E,entity:w,handle:{ref:x.name}}),I=!0;continue}const P=r(x.type);if(P){const Y=Mu(x,P,M,T,e.entities,E,w,s,i);Y?T.attributes.push(Y):I=!0}else(A=x.embeddableOverrides)!=null&&A.length?(s.push({code:"embeddable-type-unresolved",opIndex:E,entity:w,handle:{ref:x.name}}),I=!0):T.attributes.push(Tu(x,M,i))}const v=(y.spec.operations??[]).map((M,x)=>Ou(M,x,i));v.length&&(T.operations=v);const B=[];for(const M of y.spec.indexes??[]){const x=Lu(T,M,E,w,s,i);x?B.push(x):I=!0}if(B.length&&(T.indexes=B),I)break;l.push({kind:"entity.add",casUnit:"logical",entityRef:R,value:T});break}case"entity.update":{const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}const R=mo(y.patch,qb,["jpaAttrs.","table.","serialization."]);if(R.length){s.push({code:"entity-patch-unknown-key",opIndex:E,entity:y.entity,keys:R});break}const T=y.patch.stereotype;if(typeof T=="string"&&T!==C.value.stereotype){const w=T==="JPA_EMBEDDABLE"||C.value.stereotype==="JPA_EMBEDDABLE",I=T==="SERIALIZED_TYPE"||C.value.stereotype==="SERIALIZED_TYPE";if(w||I){s.push({code:w?"stereotype-embeddable-transition-unsupported":"stereotype-serialized-transition-unsupported",opIndex:E,entity:y.entity,from:C.value.stereotype??"",to:T});break}}l.push({kind:"entity.update",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,patch:y.patch});break}case"entity.remove":{const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}const R=C.value.modelId,T=e.associations.filter(B=>B.end1.entityRef===R||B.end2.entityRef===R),w=new Set(T.map(B=>B.modelId));for(const B of T)m.has(B.modelId)||(m.add(B.modelId),l.push({kind:"association.remove",casUnit:"logical",associationRef:B.modelId}));for(const B of e.entities)if(B.modelId!==R)for(const M of B.attributes)M.embedded&&w.has(M.embedded.associationRef)&&jo(l,f,B.modelId,M.modelId);for(const B of T){if(B.end1.entityRef===R||!B.end1.attributeRef)continue;const M=e.entities.find(P=>P.modelId===B.end1.entityRef),x=M==null?void 0:M.attributes.find(P=>P.modelId===B.end1.attributeRef&&P.attrType==="RELATION_REF");x&&jo(l,f,M.modelId,x.modelId)}const I={...e,entities:e.entities.filter(B=>B.modelId!==R),associations:e.associations.filter(B=>!w.has(B.modelId))},v=new Set(T.filter(B=>B.end1.entityRef===R&&B.end2.entityRef!==R).map(B=>B.end2.entityRef));Ul(l,I,[...v],i,g,f,d);for(const B of e.groups)B.memberEntityRefs.includes(R)&&(b.has(_(B.modelId,R))||(b.add(_(B.modelId,R)),l.push({kind:"group.removeMember",casUnit:"logical",containerRef:B.modelId,groupRef:B.modelId,entityRef:R})));p.add(R),l.push({kind:"entity.remove",casUnit:"logical",entityRef:R});break}case"attribute.add":{{const I=Nn(y.spec,Vu);if(I.length){s.push({code:"attribute-spec-unknown-key",opIndex:E,entity:y.entity,handle:{ref:y.spec.name},keys:I});break}}const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}if(y.spec.type==="GroupCodeEnum"&&!y.spec.groupCode){s.push({code:"groupcode-required",opIndex:E,entity:y.entity,handle:{ref:y.spec.name}});break}if(!r(y.spec.type)&&!((V=y.spec.embeddableOverrides)!=null&&V.length)&&$u(y.spec)){s.push({code:"datatype-required",opIndex:E,entity:y.entity,handle:{ref:y.spec.name}});break}const R=d(C.value.modelId,C.value.attributes),T=r(y.spec.type);let w;if(T)w=Mu(y.spec,T,R,C.value,e.entities,E,y.entity,s,i);else if(($=y.spec.embeddableOverrides)!=null&&$.length){s.push({code:"embeddable-type-unresolved",opIndex:E,entity:y.entity,handle:{ref:y.spec.name}});break}else w=Tu(y.spec,R,i);if(!w)break;l.push({kind:"attribute.add",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,value:w}),h.push({entityId:C.value.modelId,attribute:w}),w.identifier&&g.identifierCascadeParents.add(C.value.modelId);break}case"attribute.update":case"attribute.remove":{const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}const R=Su(C.value,y.attribute);if(!R.ok){s.push(R.reason==="not-found"?{code:"attribute-not-found",opIndex:E,entity:y.entity,handle:y.attribute}:{code:"attribute-ambiguous",opIndex:E,entity:y.entity,handle:y.attribute,matches:R.matches});break}if(y.kind==="attribute.update"){const T=[],w=[];let I=!1;for(const x of Object.keys(y.patch)){if(x.includes(".")){x.startsWith("dbAttrs.")?I=!0:w.push(x);continue}Fl.has(x)?T.push(x):jb.has(x)||w.push(x)}if(w.length){s.push({code:"attribute-patch-unknown-key",opIndex:E,entity:y.entity,handle:y.attribute,keys:w});break}if("attrType"in y.patch){const x=String(y.patch.attrType),P=Eu.includes(x)?x!==R.value.attrType?"transition":void 0:"unknown-value";if(P){s.push({code:"attribute-attrtype-unsupported",opIndex:E,entity:y.entity,handle:y.attribute,reason:P,current:R.value.attrType,requested:x});break}}const v="type"in y.patch?y.patch.type:R.value.type,B="groupCode"in y.patch?y.patch.groupCode:R.value.groupCode;if(v==="GroupCodeEnum"&&!B){s.push({code:"groupcode-required",opIndex:E,entity:y.entity,handle:y.attribute});break}let M=y.patch;if(T.length){const x=e_(R.value,y.patch,T,I);if(!x){s.push({code:"attribute-patch-dbattr-flat-key",opIndex:E,entity:y.entity,handle:y.attribute,keys:T});break}M=x}if((O=y.embeddableOverrides)!=null&&O.length){const x=r(R.value.type);if(!x||R.value.attrType!=="EMBED_PREDEF"){s.push({code:"embeddable-type-unresolved",opIndex:E,entity:y.entity,handle:y.attribute});break}const P=t_(R.value,x,y.embeddableOverrides,C.value,e.entities,E,y.entity,s);if(!P)break;M={...M,dbAttrs:P}}l.push({kind:"attribute.update",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,attributeRef:R.value.modelId,patch:M}),g.attrPatches.push({entityId:C.value.modelId,attributeId:R.value.modelId,patch:M});{const x=R.value,P=Pu(x,M),Y=(P.identifier??!1)!==(x.identifier??!1),se=(x.identifier||P.identifier)&&("type"in M||"customType"in M||"dbAttrs"in M||Object.keys(M).some(he=>he.startsWith("dbAttrs.")));(Y||se)&&g.identifierCascadeParents.add(C.value.modelId)}}else{const T=Po(e,C.value.modelId,R.value.modelId);if(T){const w=I=>{var v;return((v=e.entities.find(B=>B.modelId===I))==null?void 0:v.name)??I};s.push({code:"attribute-fk-managed",opIndex:E,entity:y.entity,handle:y.attribute,association:{from:w(T.end1.entityRef),to:w(T.end2.entityRef)}});break}jo(l,f,C.value.modelId,R.value.modelId),R.value.identifier&&g.identifierCascadeParents.add(C.value.modelId)}break}case"association.add":{{const B=Nn(y.spec,Gb);if(B.length){s.push({code:"association-spec-unknown-key",opIndex:E,handle:{from:y.spec.from,to:y.spec.to},keys:B});break}}const C=St(e,y.spec.from),R=St(e,y.spec.to);if(C.ok||s.push(xt(C.reason,E,y.spec.from,C.matches,k)),R.ok||s.push(xt(R.reason,E,y.spec.to,R.matches,k)),!C.ok||!R.ok)break;if(y.spec.identifying&&C.value.modelId===R.value.modelId){s.push({code:"self-identifying",opIndex:E,handle:{from:y.spec.from,to:y.spec.to}});break}if(C.value.stereotype==="JPA_EMBEDDABLE"||R.value.stereotype==="JPA_EMBEDDABLE"){s.push({code:"embeddable-relation-unsupported",opIndex:E,handle:{from:y.spec.from,to:y.spec.to}});break}if(C.value.stereotype==="SERIALIZED_TYPE"||R.value.stereotype==="SERIALIZED_TYPE"){s.push({code:"serialized-relation-invalid",opIndex:E,handle:{from:y.spec.from,to:y.spec.to}});break}const T=i(),w={modelId:T,...y.spec.identifying!=null?{identifying:y.spec.identifying}:{},end1:{entityRef:C.value.modelId,multiplicity:y.spec.fromMultiplicity??"EXACTLY_ONE_INSTANCE",navigable:!1,composition:!1},end2:{entityRef:R.value.modelId,multiplicity:y.spec.toMultiplicity??"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:y.spec.composition??!1}},I={...e,associations:[...e.associations,w]},v=pi(I,R.value.modelId,i);v.add[0]&&(w.end2.attributeRef=v.add[0].modelId),l.push({kind:"association.add",casUnit:"logical",associationRef:T,value:w}),g.addedAssociations.push(w);for(const B of v.add){const M={...B,order:d(R.value.modelId,R.value.attributes)};l.push({kind:"attribute.add",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,value:M}),g.cascadeAdds.push({entityId:R.value.modelId,attribute:M})}break}case"association.remove":{const C=St(e,y.association.from),R=St(e,y.association.to);if(C.ok||s.push(xt(C.reason,E,y.association.from,C.matches,k)),R.ok||s.push(xt(R.reason,E,y.association.to,R.matches,k)),!C.ok||!R.ok)break;const T=Cu(e,C.value.modelId,R.value.modelId);if(T.length!==1){s.push(T.length===0?{code:"association-not-found",opIndex:E,handle:y.association}:{code:"association-ambiguous",opIndex:E,handle:y.association,matches:T.map(B=>B.modelId)});break}const w=T[0];m.has(w.modelId)||(m.add(w.modelId),l.push({kind:"association.remove",casUnit:"logical",associationRef:w.modelId}));const I=e.entities.find(B=>B.attributes.some(M=>{var x;return((x=M.embedded)==null?void 0:x.associationRef)===w.modelId}));if(I){const B=I.attributes.find(M=>{var x;return((x=M.embedded)==null?void 0:x.associationRef)===w.modelId});jo(l,f,I.modelId,B.modelId);break}if(w.end1.attributeRef){const B=e.entities.find(x=>x.modelId===w.end1.entityRef),M=B==null?void 0:B.attributes.find(x=>x.modelId===w.end1.attributeRef&&x.attrType==="RELATION_REF");M&&jo(l,f,B.modelId,M.modelId)}const v={...e,associations:e.associations.filter(B=>B.modelId!==w.modelId)};Ul(l,v,[w.end2.entityRef],i,g,f,d);break}case"association.update":{const C=Fu(e,y.association,E,s,k);if(!C)break;const R=y.patch.identifying,T=typeof R=="boolean"?R:void 0;if(T===!0&&C.end1.entityRef===C.end2.entityRef){s.push({code:"self-identifying",opIndex:E,handle:y.association});break}const w=mo(y.patch,Wb);if(w.length){s.push({code:"association-patch-unknown-key",opIndex:E,handle:y.association,keys:w});break}if(l.push({kind:"association.update",casUnit:"logical",containerRef:C.modelId,associationRef:C.modelId,patch:y.patch}),g.assocPatches.push({associationRef:C.modelId,patch:y.patch}),T!==void 0&&T!==(C.identifying??!1)){const I={...e,associations:e.associations.map(v=>v.modelId===C.modelId?{...v,identifying:T}:v)};Ul(l,I,[C.end2.entityRef],i,g,f,d)}break}case"associationEnd.update":{const C=Fu(e,y.association,E,s,k);if(!C)break;const R=y.end==="from"?"end1":"end2";if(Object.prototype.hasOwnProperty.call(y.patch,"navigable")){s.push({code:"navigable-toggle-unsupported",opIndex:E,handle:y.association});break}const T=mo(y.patch,Jb,["jpa."]);if(T.length){s.push({code:"association-end-patch-unknown-key",opIndex:E,handle:y.association,keys:T});break}l.push({kind:"associationEnd.update",casUnit:"logical",containerRef:C.modelId,associationRef:C.modelId,end:R,patch:y.patch}),g.endPatches.push({associationRef:C.modelId,end:R,patch:y.patch});break}case"index.add":{{const T=Nn(y.spec,Bu);if(T.length){s.push({code:"index-spec-unknown-key",opIndex:E,entity:y.entity,handle:{ref:y.spec.name},keys:T});break}}const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}const R=Lu(C.value,y.spec,E,y.entity,s,i);if(!R)break;l.push({kind:"index.add",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,indexRef:R.modelId,value:R});break}case"index.update":case"index.remove":{const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}if(zl(y.index)){s.push({code:"handle-by-unsupported",opIndex:E,entity:y.entity,handle:y.index,target:"index"});break}const R=Hb(C.value,y.index);if(!R.ok){s.push(R.reason==="not-found"?{code:"index-not-found",opIndex:E,entity:y.entity,handle:y.index}:{code:"index-ambiguous",opIndex:E,entity:y.entity,handle:y.index,matches:R.matches});break}if(y.kind==="index.update"){if("columns"in y.patch){s.push({code:"index-columns-patch-unsupported",opIndex:E,entity:y.entity,handle:y.index});break}const T=mo(y.patch,Xb);if(T.length){s.push({code:"index-patch-unknown-key",opIndex:E,entity:y.entity,handle:y.index,keys:T});break}l.push({kind:"index.update",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,indexRef:R.value.modelId,patch:y.patch})}else l.push({kind:"index.remove",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,indexRef:R.value.modelId});break}case"operation.add":{{const w=Nn(y.spec,Du);if(w.length){s.push({code:"operation-spec-unknown-key",opIndex:E,entity:y.entity,handle:{ref:y.spec.name},keys:w});break}}const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}const R=u.get(C.value.modelId)??(C.value.operations?jt(C.value.operations):0);u.set(C.value.modelId,R+1);const T=Ou(y.spec,R,i);l.push({kind:"operation.add",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,operationRef:T.modelId,value:T});break}case"operation.update":case"operation.remove":{const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}if(zl(y.operation)){s.push({code:"handle-by-unsupported",opIndex:E,entity:y.entity,handle:y.operation,target:"operation"});break}const R=Ru(C.value,y.operation);if(!R.ok){s.push(R.reason==="not-found"?{code:"operation-not-found",opIndex:E,entity:y.entity,handle:y.operation}:{code:"operation-ambiguous",opIndex:E,entity:y.entity,handle:y.operation,matches:R.matches});break}if(y.kind==="operation.update"){const T=mo(y.patch,Zb);if(T.length){s.push({code:"operation-patch-unknown-key",opIndex:E,entity:y.entity,handle:y.operation,keys:T});break}l.push({kind:"operation.update",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,operationRef:R.value.modelId,patch:y.patch})}else l.push({kind:"operation.remove",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,operationRef:R.value.modelId});break}case"attribute.reorder":case"operation.reorder":{const C=y.kind==="attribute.reorder",R=St(e,y.entity);if(!R.ok){s.push(xt(R.reason,E,y.entity,R.matches,k));break}const T=C?y.order:y.operations,w=[],I=new Set;let v=!1;for(const P of T){if(!C&&zl(P)){s.push({code:"handle-by-unsupported",opIndex:E,entity:y.entity,handle:P,target:"operation"}),v=!0;continue}const Y=C?Su(R.value,P):Ru(R.value,P);if(!Y.ok){s.push(Y.reason==="not-found"?{code:"reorder-handle-not-found",opIndex:E,entity:y.entity,handle:P}:{code:"reorder-handle-ambiguous",opIndex:E,entity:y.entity,handle:P,matches:Y.matches}),v=!0;continue}if(I.has(Y.value.modelId)){s.push({code:"reorder-handle-duplicate",opIndex:E,entity:y.entity,handle:P}),v=!0;continue}I.add(Y.value.modelId),w.push(Y.value)}if(v)break;const M=[...C?R.value.attributes:R.value.operations??[]].sort((P,Y)=>P.order-Y.order).filter(P=>!I.has(P.modelId)),x=[...w,...M];if(x.forEach((P,Y)=>{P.order!==Y&&l.push(C?{kind:"attribute.update",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,attributeRef:P.modelId,patch:{order:Y}}:{kind:"operation.update",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,operationRef:P.modelId,patch:{order:Y}})}),C)for(const P of Iu(e,R.value.modelId,x.map(Y=>Y.modelId)))l.push({kind:"attribute.update",casUnit:"logical",containerRef:P.entityId,entityRef:P.entityId,attributeRef:P.attributeId,patch:{dbAttrs:P.dbAttrs}});break}case"group.add":{{const I=Nn(y.spec,Yb);if(I.length){s.push({code:"group-spec-unknown-key",opIndex:E,keys:I});break}}const C=[];let R=!1;for(const I of y.spec.members){const v=St(e,I);if(!v.ok){s.push(xt(v.reason,E,I,v.matches,k)),R=!0;continue}C.push(v.value.modelId)}if(R)break;const T=i(),w={modelId:T,excludeDDLGeneration:y.spec.excludeDDLGeneration??!1,memberEntityRefs:C,...y.spec.name?{name:y.spec.name}:{},...y.spec.packageName?{packageName:y.spec.packageName}:{},...y.spec.description?{description:y.spec.description}:{}};l.push({kind:"group.add",casUnit:"logical",groupRef:T,value:w});break}case"group.update":{const C=Ll(e,y.group);if(!C.ok){s.push(Pl(C,E,y.group));break}const R=mo(y.patch,Ob);if(R.length){s.push({code:"group-patch-unknown-key",opIndex:E,handle:y.group,keys:R});break}l.push({kind:"group.update",casUnit:"logical",containerRef:C.value.modelId,groupRef:C.value.modelId,patch:y.patch});break}case"group.remove":{const C=Ll(e,y.group);if(!C.ok){s.push(Pl(C,E,y.group));break}l.push({kind:"group.remove",casUnit:"logical",groupRef:C.value.modelId});break}case"group.addMember":case"group.removeMember":{const C=Ll(e,y.group);if(!C.ok){s.push(Pl(C,E,y.group));break}const R=St(e,y.entity);if(!R.ok){s.push(xt(R.reason,E,y.entity,R.matches,k));break}const T=C.value.memberEntityRefs.includes(R.value.modelId);if(y.kind==="group.addMember"?T:!T)break;if(y.kind==="group.removeMember"){if(b.has(_(C.value.modelId,R.value.modelId)))break;b.add(_(C.value.modelId,R.value.modelId))}l.push({kind:y.kind,casUnit:"logical",containerRef:C.value.modelId,groupRef:C.value.modelId,entityRef:R.value.modelId});break}}}),s.length||a_(l,e,p,m,f,h,g,i,d),s.length||n_(l,e,f,p),s.length||o_(l,e,f,h,p,i),s.length?{ok:!1,errors:s}:{ok:!0,ops:l}}function xt(e,n,o,i,a){return 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}}function Fu(e,n,o,i,a){const r=St(e,n.from),l=St(e,n.to);if(r.ok||i.push(xt(r.reason,o,n.from,r.matches,a)),l.ok||i.push(xt(l.reason,o,n.to,l.matches,a)),!r.ok||!l.ok)return null;const s=Cu(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 Uu={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},l_={type:"object",description:"엔티티 내 이름으로 지정(인덱스명·메서드명). 물리명 차원이 없어 매칭 키 고정(`by`)을 받지 않는다.",properties:{ref:{type:"string",description:"매칭할 이름."}},required:["ref"],additionalProperties:!1},s_={type:"object",description:"관계는 무명이라 양 끝 엔티티로 주소. from=부모(end1), to=자식(end2). 같은 쌍 복수 관계는 모호 보고.",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"}},required:["from","to"],additionalProperties:!1},c_={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."},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},d_={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},zn={type:"object",properties:{ko:{type:"string"},en:{type:"string"},ja:{type:"string"},zh:{type:"string"}},additionalProperties:!1},u_={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:{...zn,description:"속성 설명(다국어)."},columnLogicalName:{...zn,description:'dbAttr 컬럼 논리명(다국어, 예: {ko:"체크아웃유형"}). 한글 업무명 보존 위치.'},unique:{type:"boolean",description:"dbAttr UNIQUE 제약."},updatable:{type:"boolean",description:"dbAttr 갱신 가능(JPA @Column(updatable=))."},embeddableOverrides:{$ref:"#/$defs/embeddableOverrides"}},required:["name","type"],additionalProperties:!1},m_={type:"array",description:"predefined 임베더블 서브컬럼 오버라이드(속성 type이 카탈로그 엔트리이자 EMBED_PREDEF일 때만). field=카탈로그 필드명으로 매칭(@AttributeOverride 대응). 미설정 서브컬럼은 add=카탈로그 기본 상속 / update=기존값 유지. currency 등 공유 컬럼은 sharedColumnPhysicalName으로 SHARED_REF.",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 컬럼에만 저장."},sharedColumnPhysicalName:{type:"string",description:"SHARED_REF — 같은 엔터티(임베더블이면 owner 합집합) 다른 컬럼(물리명)을 공유해 read-only 투영(대표: currency). 설정 시 자체 컬럼 미보유, 타깃은 해소 시점 존재 필수."}},required:["field"],additionalProperties:!1}},Hu={type:"string",enum:["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"]},f_={type:"object",description:'일반 연관 생성. 양 end 는 일반 엔티티여야 한다 — 임베더블(JPA_EMBEDDABLE)·직렬화 타입을 end 로 주면 거부된다. 직렬화 타입은 관계가 아니라 소비 속성의 type 으로 지목한다(attribute.update {type: "<타입명>"}). (임베드는 EMBED 관계여야 하고 이 어휘엔 없다 → 캔버스에서 연결).',properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"},fromMultiplicity:{...Hu,description:"end1 다중성(기본 EXACTLY_ONE_INSTANCE)."},toMultiplicity:{...Hu,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},p_={type:"object",properties:{name:{type:"string"},unique:{type:"boolean",description:"UNIQUE 인덱스 여부(기본 false)."},columns:{type:"array",description:"인덱스 컬럼(순서 의미 있음).",items:{type:"object",properties:{column:{...Uu,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},h_={type:"object",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"],description:"가시성(기본 미설정)."},sourceCode:{type:"string",description:"Java 메서드 본문(멀티라인, 파라미터·반환 시그니처 포함)."},description:{...zn,description:"메서드 설명(다국어)."},personalInfoAttributeType:{type:"string",description:"개인정보 속성 유형(패스스루)."}},required:["name"],additionalProperties:!1},y_={type:"object",properties:{name:{...zn,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},g_={type:"object",description:"기존 속성 부분 patch. 논리 필드 + 스칼라 단일 컬럼의 물리 필드(physicalName·dataType·length·scale 등 — 서버가 dbAttrs[0]에 매핑). EMBED_PREDEF/Money 서브컬럼 조정은 op-레벨 embeddableOverrides로(평탄 키는 다중 컬럼서 모호해 거부).",properties:{name:{type:"string"},type:{type:"string"},customType:{type:"string"},attrType:{type:"string",enum:[...Eu],description:"속성 종류. **현재 값과 다르게 주면 거부된다** — 관계/임베드/구분선은 동반 구조(관계 소유·embedded·빈 dbAttrs)가 있어야 성립하고 patch로는 표현할 수 없다. 관계 실체화는 association.add, 임베드 서브컬럼은 embeddableOverrides 소관."},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:{...zn,description:"속성 설명(다국어)."},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:{...zn,description:"컬럼 논리명(다국어)."}},additionalProperties:!1},b_={type:"object",description:"관계 부분 patch. 양 end 설정(multiplicity·nav·jpa)은 associationEnd.update로.",properties:{description:{type:"string"},identifying:{type:"boolean",description:"식별 관계(부모 PK가 자식 PK 일부로 전파)."}},additionalProperties:!1},__={type:"object",description:"인덱스 부분 patch. columns(컬럼 구성) 변경은 index.remove+index.add로(패치 불가).",properties:{name:{type:"string"},unique:{type:"boolean"},description:{type:"string"},parameters:{type:"string"}},additionalProperties:!1},k_={type:"object",description:"메서드 부분 patch.",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"]},sourceCode:{type:"string"},description:{...zn,description:"메서드 설명(다국어)."},order:{type:"integer"},personalInfoAttributeType:{type:"string"}},additionalProperties:!1},E_={type:"object",description:'엔티티 부분 patch. 논리 키: name·stereotype·packageName·superClass·schema·description·abstractClass·hasPersonalInfo·referenceOnly·declarationOfInterfaces·table·serialization. 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 소관).'},N_={type:"object",description:'관계 end 부분 patch. 논리 키: multiplicity·navigable·composition. jpa 설정(cascadeTypes·fetchType·orphanRemoval·orderBy·collectionType·collectionTable·orderColumn)은 형제 클로버 방지를 위해 dotted-key로: {"jpa.orphanRemoval": true}.'};function ht(e,n){return{type:"object",properties:{kind:{const:e},...n.properties},required:["kind",...n.required],additionalProperties:!1}}const w_={"entity.add":ht("entity.add",{properties:{spec:{$ref:"#/$defs/entitySpec"}},required:["spec"]}),"entity.update":ht("entity.update",{properties:{entity:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/entityUpdatePatch"}},required:["entity","patch"]}),"entity.remove":ht("entity.remove",{properties:{entity:{$ref:"#/$defs/handle"}},required:["entity"]}),"attribute.add":ht("attribute.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/attrSpec"}},required:["entity","spec"]}),"attribute.update":ht("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":ht("attribute.remove",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"}},required:["entity","attribute"]}),"association.add":ht("association.add",{properties:{spec:{$ref:"#/$defs/assocSpec"}},required:["spec"]}),"association.remove":ht("association.remove",{properties:{association:{$ref:"#/$defs/assocHandle"}},required:["association"]}),"association.update":ht("association.update",{properties:{association:{$ref:"#/$defs/assocHandle"},patch:{$ref:"#/$defs/assocUpdatePatch"}},required:["association","patch"]}),"associationEnd.update":ht("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":ht("index.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/indexSpec"}},required:["entity","spec"]}),"index.update":ht("index.update",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/nameHandle"},patch:{$ref:"#/$defs/indexUpdatePatch"}},required:["entity","index","patch"]}),"index.remove":ht("index.remove",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/nameHandle"}},required:["entity","index"]}),"operation.add":ht("operation.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/operationSpec"}},required:["entity","spec"]}),"operation.update":ht("operation.update",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/nameHandle"},patch:{$ref:"#/$defs/operationUpdatePatch"}},required:["entity","operation","patch"]}),"operation.remove":ht("operation.remove",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/nameHandle"}},required:["entity","operation"]}),"attribute.reorder":ht("attribute.reorder",{properties:{entity:{$ref:"#/$defs/handle"},order:{type:"array",items:{$ref:"#/$defs/handle"},minItems:1}},required:["entity","order"]}),"operation.reorder":ht("operation.reorder",{properties:{entity:{$ref:"#/$defs/handle"},operations:{type:"array",items:{$ref:"#/$defs/nameHandle"},minItems:1}},required:["entity","operations"]}),"group.add":ht("group.add",{properties:{spec:{$ref:"#/$defs/groupSpec"}},required:["spec"]}),"group.update":ht("group.update",{properties:{group:{$ref:"#/$defs/groupHandle"},patch:{$ref:"#/$defs/groupUpdatePatch"}},required:["group","patch"]}),"group.remove":ht("group.remove",{properties:{group:{$ref:"#/$defs/groupHandle"}},required:["group"]}),"group.addMember":ht("group.addMember",{properties:{group:{$ref:"#/$defs/groupHandle"},entity:{$ref:"#/$defs/handle"}},required:["group","entity"]}),"group.removeMember":ht("group.removeMember",{properties:{group:{$ref:"#/$defs/groupHandle"},entity:{$ref:"#/$defs/handle"}},required:["group","entity"]})},I_={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},v_={type:"object",description:"그룹 부분 patch. 멤버 변경은 group.addMember/removeMember로(배열 통째 교체는 동시 편집이 서로를 덮는다).",properties:{name:{...zn,description:"그룹 논리명(다국어)."},packageName:{type:"string"},description:{type:"string"},excludeDDLGeneration:{type:"boolean"}},additionalProperties:!1},ju={anyOf:ku.map(e=>w_[e])},C_={type:"object",description:"엔티티 모델을 생성·수정·삭제할 때 호출한다. ops는 사람 핸들(엔티티 물리명/논리명, 속성명)로 지정하며 서버가 modelId로 해소한다. 모호하면 에러로 후보를 돌려주니 리소스로 현재 모델을 먼저 읽어 핸들을 확정하라.",properties:{ops:{type:"array",items:{$ref:"#/$defs/symbolicOp"}}},required:["ops"],additionalProperties:!1,$defs:{handle:Uu,nameHandle:l_,groupHandle:I_,assocHandle:s_,entitySpec:c_,serialization:d_,attrSpec:u_,embeddableOverrides:m_,assocSpec:f_,indexSpec:p_,operationSpec:h_,groupSpec:y_,entityUpdatePatch:E_,attrUpdatePatch:g_,assocUpdatePatch:b_,assocEndUpdatePatch:N_,indexUpdatePatch:__,operationUpdatePatch:k_,groupUpdatePatch:v_,symbolicOp:ju}};function S_(e,n,o,i={}){const a=i.mkClientOpId??Pe,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 Ku={location:{x:0,y:0},size:{width:220,height:140}};function Gu(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,sharedColumnRef:e.sharedColumnRef,multiValue:e.multiValue,multiValueSeparator:e.multiValueSeparator,sequenceName:e.sequenceName}}const x_=/^[-=_*~\s]{3,}$/;function R_(e){return e.attrType&&e.attrType!=="NORMAL"||!x_.test(e.name??"")?!1:!(e.dbAttrs??[]).some(n=>n.physicalName||n.dataType)}function A_(e){return e.type===_n&&e.customType==="java.util.Currency"?{type:"Currency",customType:void 0}:{type:e.type,customType:e.customType}}function $_(e,n){if(e.attrType==="DIVIDER"||R_(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=A_(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(Gu)}}function T_(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 M_(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 V_(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($_),operations:(n=e.operations)==null?void 0:n.map(T_),indexes:(o=e.indexes)==null?void 0:o.map(M_),jpaAttrs:e.jpaAttrs,table:e.dbAttrs?{physicalName:e.dbAttrs.physicalName,logicalName:e.dbAttrs.logicalName}:void 0}}function B_(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??{...Ku},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 Yu(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 Hl(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:Yu(e)}}function D_(e){if(e.end1.endModel.refId===e.end2.endModel.refId)return;const n=o=>jl(o)&&(o==null?void 0:o.identifier)===!0;return n(e.end1.attribute)||n(e.end2.attribute)?!0:void 0}function O_(e){var i,a;const n={modelId:e.modelId,description:e.description,identifying:D_(e),end1:Hl(e.end1),end2:Hl(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 jl(e){var n;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("RELATION")&&(((n=e.dbAttrs)==null?void 0:n.length)??0)>0}function qu(e){var n;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("EMBED")&&(((n=e.dbAttrs)==null?void 0:n.length)??0)>0}function Wu(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 Ju(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(Gu)}}function L_(e,n,o){var y,E;const i=jl(e.end1.attribute),a=jl(e.end2.attribute);if(i===a)return O_(e);const r=i?e.end1:e.end2,l=i?e.end2:e.end1,s=r.attribute,c=(E=(y=s.dbAttrs)==null?void 0:y[0])==null?void 0:E.targetModelId,d=c?o.get(c):void 0,u=n.get(l.endModel.refId),m=u?u.attributes.reduce((S,A)=>Math.max(S,A.order),-1)+1:s.order??0,p={...Ju(s,m),attrType:"RELATION_OWN",derivedFrom:d?{associationRef:e.modelId,sourceAttributeRef:d}:void 0};u&&u.attributes.push(p);const f=n.get(r.endModel.refId),h=l.attribute;let g;if(h&&f&&r.navigable){const S=sa(l.multiplicity);g={modelId:h.modelId??crypto.randomUUID(),name:eo(h.name??da((u==null?void 0:u.name)??l.endModel.refId,S),new Set(f.attributes.map(A=>A.name))),type:(u==null?void 0:u.name)??l.endModel.refId,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:f.attributes.reduce((A,V)=>Math.max(A,V.order),-1)+1,dbAttrs:[]},f.attributes.push(g)}const b=(S,A)=>({entityRef:S.endModel.refId,multiplicity:S.multiplicity,navigable:S.navigable,composition:S.composition,attributeRef:A?g==null?void 0:g.modelId:p.modelId,jpa:Yu(S)}),_=r.endModel.refId===l.endModel.refId,k={modelId:e.modelId,description:e.description,identifying:!_&&p.identifier===!0?!0:void 0,end1:b(e.end1,i),end2:b(e.end2,a)},N={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:i?d:p.modelId,targetColumnRef:i?p.modelId:d,style:e.style};return{assoc:k,layout:N}}function P_(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)}}function z_(e,n,o){var h;const i=((h=e.end1.attribute)==null?void 0:h.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={...Ju(l,c),attrType:l.attrType??"EMBED_OWN",dbAttrs:(l.dbAttrs??[]).map(g=>P_(g,o)),embedded:{associationRef:e.modelId,embeddableRef:a.endModel.refId}};s&&s.attributes.push(d);const u=g=>({...Hl(g),legacyEmbedRaw:g.attribute}),m={modelId:e.modelId,description:e.description,end1:u(e.end1),end2:u(e.end2)},p=!i,f={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:p?d.modelId:void 0,targetColumnRef:p?void 0:d.modelId,style:e.style};return{assoc:m,layout:f}}function F_(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 Xu(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=F_(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 Zu(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 U_(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||_t(a.stereotype)||_t(r.stereotype))continue;const l=i.end1.attributeRef?a.attributes.find(p=>p.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(p=>p.modelId===s);if((c==null?void 0:c.attrType)==="RELATION_REF"){i.end1.attributeRef=s;continue}const d=sa(i.end2.multiplicity),u=da(r.name,d),m=eo(u,new Set(a.attributes.map(p=>p.name)));a.attributes.push({modelId:s,name:m,type:r.name,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:a.attributes.reduce((p,f)=>Math.max(p,f.order),-1)+1,dbAttrs:[]}),i.end1.attributeRef=s}}function H_(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||_t(a.stereotype)||_t(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 Qu(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&&_t(l.stereotype))continue;const s=a.end1.entityRef===a.end2.entityRef,c=a.identifying===!0||!s&&!Ac(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 em(e){const n=JSON.parse(JSON.stringify(e));return(n.schemaVersion??1)>=2&&"logical"in n?j_(n):K_(n)}function j_(e){const n=e.id??e.logical.modelId??"",o={},i=m=>{const{rev:p,...f}=m;return p!=null&&(o[m.modelId]=p),f},a=e.logical.entities.map(i),r=e.logical.associations.map(i),l=e.logical.groups.map(i);U_(a,r),H_(a,r),Qu(a,r);const{version:s,...c}=e.layout;Zu(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 K_(e){var _,k;const n=e.id??"",o=[],i=[],a=[],r=[],l=[],s=[],c=[],d=(N,y)=>{o.push(V_(N));const E=B_(N);E.geo={location:{x:E.geo.location.x+y.x,y:E.geo.location.y+y.y},size:E.geo.size},i.push(E);for(const S of N.ownedAssociations??[])c.push(S)},u={x:0,y:0};for(const N of e.entities??[])d(N,u);const m=[];for(const N of e.groups??[]){const y=N.entities??[];l.push({modelId:N.modelId,name:N.name,description:N.description,packageName:N.packageName,excludeDDLGeneration:N.excludeDDLGeneration??!1,memberEntityRefs:y.map(S=>S.modelId)});const E=((_=N.geo)==null?void 0:_.location)??u;if(N.geo){const S=(N.notes??[]).map(A=>A.modelId);s.push({groupRef:N.modelId,geo:N.geo,style:N.style,locked:N.locked,memberNoteRefs:S.length?S:void 0})}for(const S of y)d(S,E);for(const S of N.notes??[])m.push(Xu(S,E))}const p=new Map(o.map(N=>[N.modelId,N])),f=new Map,h=new Map;for(const N of o)for(const y of N.attributes)for(const E of y.dbAttrs)f.set(E.modelId,y.modelId),h.set(E.modelId,E);for(const N of c)for(const y of[N.end1,N.end2]){const E=y.attribute;if(E&&(((k=E.dbAttrs)==null?void 0:k.length)??0)>0)for(const S of E.dbAttrs)S.modelId&&f.set(S.modelId,E.modelId)}for(const N of c){const y=qu(N.end1.attribute),E=qu(N.end2.attribute),S=Wu(N.end1)||Wu(N.end2),{assoc:A,layout:V}=y!==E||S?z_(N,p,h):L_(N,p,f);a.push(A),r.push(V)}Zu(o,a,r),Nd(o),Qu(o,a);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(N=>Xu(N)),...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 tm(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,sharedColumnRef:e.sharedColumnRef,multiValue:e.multiValue,multiValueSeparator:e.multiValueSeparator,sequenceName:e.sequenceName}}function G_(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(tm),style:n}}function Y_(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 q_(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 Fn(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 W_(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{...tm(i),targetModelId:(r=o==null?void 0:o.dbAttrs[a])==null?void 0:r.modelId}})}}function J_(e){return{modelId:e.modelId,name:e.name,type:e.type,attrType:"RELATION_OWN",dbAttrs:[]}}function nm(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 X_(e){const n=new Set;for(const o of e.logical.associations){const i=nm(o,e);i&&(n.add(i.navAttr.modelId),i.fk&&n.add(i.fk.modelId))}return n}function Z_(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 Q_(e,n){return e===n||JSON.stringify(e??null)===JSON.stringify(n??null)}function ek(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:Q_(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)}}function tk(e,n,o){let i;for(const m of n.logical.entities){const p=m.attributes.find(f=>{var h;return((h=f.embedded)==null?void 0:h.associationRef)===e.modelId});if(p){i=p;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,p)=>ek(m,l[p]))},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:Fn(e.end1,c?s:u),end2:Fn(e.end2,c?u:s)}}function nk(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:Fn(e.end1,e.end1.legacyEmbedRaw),end2:Fn(e.end2,e.end2.legacyEmbedRaw)};const a=tk(e,n,i);if(a)return a;const r=nm(e,n);if(r){const l=n.logical.entities.find(d=>d.modelId===r.navEnd.entityRef),s=r.fk?W_(r.fk,l):void 0,c=J_(r.navAttr);return{...i,end1:Fn(e.end1,r.navEnd===e.end1?s:c),end2:Fn(e.end2,r.navEnd===e.end2?s:c)}}return{...i,end1:Fn(e.end1),end2:Fn(e.end2)}}function om(e,n,o,i,a={x:0,y:0}){var u,m;const r=n.layout.entityLayouts.find(p=>p.entityRef===e.modelId),l=n.logical.associations.filter(p=>p.end1.entityRef===e.modelId),s=p=>n.layout.associationLayouts.find(f=>f.associationRef===p),c=(r==null?void 0:r.geo)??{...Ku},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(p=>!o.has(p.modelId)&&!i.has(p.modelId)).map(p=>{var f;return G_(p,(f=r==null?void 0:r.attributeStyles)==null?void 0:f[p.modelId])}),operations:(u=e.operations)==null?void 0:u.map(p=>{var f;return Y_(p,(f=r==null?void 0:r.operationStyles)==null?void 0:f[p.modelId])}),ownedAssociations:l.map(p=>nk(p,n,s(p.modelId))),indexes:(m=e.indexes)==null?void 0:m.map(q_),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 ok(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=>im(c,l));return{modelId:e.modelId,name:e.name,description:e.description,packageName:e.packageName,excludeDDLGeneration:e.excludeDDLGeneration,entities:r.map(c=>om(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 im(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 ik(e,n={}){const o=new Set(e.logical.groups.flatMap(s=>s.memberEntityRefs)),i=e.logical.entities.filter(s=>!o.has(s.modelId)),a=X_(e),r=Z_(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=>om(s,e,a,r)),groups:e.logical.groups.map(s=>ok(s,e,a,r)),notes:e.layout.notes.filter(s=>!l.has(s.modelId)).map(s=>im(s))}}function ak(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 rk=["notNull"];function lk(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}=em(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(p=>[p.modelId,p]))]));for(const m of i.logical.entities){const p=c.get(m.modelId);if(p)for(const f of m.attributes){const h=p.get(f.modelId);if(!h){l.push({kind:"attribute.add",casUnit:"logical",containerRef:m.modelId,entityRef:m.modelId,value:f}),s.navAdds++;continue}const g={};for(const b of rk)f[b]===!0!=(h[b]===!0)&&(g[b]=f[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:f.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 p=d.get(m.modelId);p&&(m.end1.attributeRef&&m.end1.attributeRef!==p.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&&p.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 Ni(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function wn(e){return typeof e=="function"?e():t.unref(e)}const sk=typeof window<"u"&&typeof document<"u",ck=e=>typeof e<"u",dk=Object.prototype.toString,uk=e=>dk.call(e)==="[object Object]",mk=()=>{};function fk(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 am=e=>e();function pk(e=am){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 rm(e,n=!1,o="Timeout"){return new Promise((i,a)=>{setTimeout(n?()=>a(o):i,e)})}function hk(e,n,o={}){const{eventFilter:i=am,...a}=o;return t.watch(e,fk(i,n),a)}function Ko(e,n,o={}){const{eventFilter:i,...a}=o,{eventFilter:r,pause:l,resume:s,isActive:c}=pk(i);return{stop:hk(e,n,{...a,eventFilter:r}),pause:l,resume:s,isActive:c}}function yk(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=wn(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 Kl(e,n=!1){function o(m,{flush:p="sync",deep:f=!1,timeout:h,throwOnTimeout:g}={}){let b=null;const k=[new Promise(N=>{b=t.watch(e,y=>{m(y)!==n&&(b==null||b(),N(y))},{flush:p,deep:f,immediate:!0})})];return h!=null&&k.push(rm(h,g).then(()=>wn(e)).finally(()=>b==null?void 0:b())),Promise.race(k)}function i(m,p){if(!t.isRef(m))return o(y=>y===m,p);const{flush:f="sync",deep:h=!1,timeout:g,throwOnTimeout:b}=p??{};let _=null;const N=[new Promise(y=>{_=t.watch([e,m],([E,S])=>{n!==(E===S)&&(_==null||_(),y(E))},{flush:f,deep:h,immediate:!0})})];return g!=null&&N.push(rm(g,b).then(()=>wn(e)).finally(()=>(_==null||_(),wn(e)))),Promise.race(N)}function a(m){return o(p=>!!p,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,p){return o(f=>{const h=Array.from(f);return h.includes(m)||h.includes(wn(m))},p)}function d(m){return u(1,m)}function u(m=1,p){let f=-1;return o(()=>(f+=1,f>=m),p)}return Array.isArray(wn(e))?{toMatch:o,toContains:c,changed:d,changedTimes:u,get not(){return Kl(e,!n)}}:{toMatch:o,toBe:i,toBeTruthy:a,toBeNull:r,toBeNaN:s,toBeUndefined:l,changed:d,changedTimes:u,get not(){return Kl(e,!n)}}}function Gl(e){return Kl(e)}function gk(e){var n;const o=wn(e);return(n=o==null?void 0:o.$el)!=null?n:o}const lm=sk?window:void 0;function sm(...e){let n,o,i,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([o,i,a]=e,n=lm):[n,o,i,a]=e,!n)return mk;Array.isArray(o)||(o=[o]),Array.isArray(i)||(i=[i]);const r=[],l=()=>{r.forEach(u=>u()),r.length=0},s=(u,m,p,f)=>(u.addEventListener(m,p,f),()=>u.removeEventListener(m,p,f)),c=t.watch(()=>[gk(n),wn(a)],([u,m])=>{if(l(),!u)return;const p=uk(m)?{...m}:m;r.push(...o.flatMap(f=>i.map(h=>s(u,f,h,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return Ni(d),d}function bk(e){return typeof e=="function"?e:typeof e=="string"?n=>n.key===e:Array.isArray(e)?n=>e.includes(n.key):()=>!0}function cm(...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=lm,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=i,c=bk(n);return sm(a,r,u=>{u.repeat&&wn(s)||c(u)&&o(u)},l)}function _k(e){return JSON.parse(JSON.stringify(e))}function Yl(e,n,o,i={}){var a,r,l;const{clone:s=!1,passive:c=!1,eventName:d,deep:u=!1,defaultValue:m,shouldEmit:p}=i,f=t.getCurrentInstance(),h=o||(f==null?void 0:f.emit)||((a=f==null?void 0:f.$emit)==null?void 0:a.bind(f))||((l=(r=f==null?void 0:f.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(f==null?void 0:f.proxy));let g=d;n||(n="modelValue"),g=g||`update:${n.toString()}`;const b=N=>s?typeof s=="function"?s(N):_k(N):N,_=()=>ck(e[n])?b(e[n]):m,k=N=>{p?p(N)&&h(g,N):h(g,N)};if(c){const N=_(),y=t.ref(N);let E=!1;return t.watch(()=>e[n],S=>{E||(E=!0,y.value=b(S),t.nextTick(()=>E=!1))}),t.watch(y,S=>{!E&&(S!==e[n]||u)&&k(S)},{deep:u}),y}else return t.computed({get(){return _()},set(N){k(N)}})}var kk={value:()=>{}};function Ma(){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 Va(o)}function Va(e){this._=e}function Ek(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}})}Va.prototype=Ma.prototype={constructor:Va,on:function(e,n){var o=this._,i=Ek(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=Nk(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]=dm(o[a],e.name,n);else if(n==null)for(a in o)o[a]=dm(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 Va(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 Nk(e,n){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===n)return a.value}function dm(e,n,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=kk,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:n,value:o}),e}var ql="http://www.w3.org/1999/xhtml";const um={svg:"http://www.w3.org/2000/svg",xhtml:ql,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ba(e){var n=e+="",o=n.indexOf(":");return o>=0&&(n=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),um.hasOwnProperty(n)?{space:um[n],local:e}:e}function wk(e){return function(){var n=this.ownerDocument,o=this.namespaceURI;return o===ql&&n.documentElement.namespaceURI===ql?n.createElement(e):n.createElementNS(o,e)}}function Ik(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mm(e){var n=Ba(e);return(n.local?Ik:wk)(n)}function vk(){}function Wl(e){return e==null?vk:function(){return this.querySelector(e)}}function Ck(e){typeof e!="function"&&(e=Wl(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 Ut(i,this._parents)}function Sk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function xk(){return[]}function fm(e){return e==null?xk:function(){return this.querySelectorAll(e)}}function Rk(e){return function(){return Sk(e.apply(this,arguments))}}function Ak(e){typeof e=="function"?e=Rk(e):e=fm(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 Ut(i,a)}function pm(e){return function(){return this.matches(e)}}function hm(e){return function(n){return n.matches(e)}}var $k=Array.prototype.find;function Tk(e){return function(){return $k.call(this.children,e)}}function Mk(){return this.firstElementChild}function Vk(e){return this.select(e==null?Mk:Tk(typeof e=="function"?e:hm(e)))}var Bk=Array.prototype.filter;function Dk(){return Array.from(this.children)}function Ok(e){return function(){return Bk.call(this.children,e)}}function Lk(e){return this.selectAll(e==null?Dk:Ok(typeof e=="function"?e:hm(e)))}function Pk(e){typeof e!="function"&&(e=pm(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 Ut(i,this._parents)}function ym(e){return new Array(e.length)}function zk(){return new Ut(this._enter||this._groups.map(ym),this._parents)}function Da(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Da.prototype={constructor:Da,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 Fk(e){return function(){return e}}function Uk(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 Da(e,r[l]);for(;l<c;++l)(s=n[l])&&(a[l]=s)}function Hk(e,n,o,i,a,r,l){var s,c,d=new Map,u=n.length,m=r.length,p=new Array(u),f;for(s=0;s<u;++s)(c=n[s])&&(p[s]=f=l.call(c,c.__data__,s,n)+"",d.has(f)?a[s]=c:d.set(f,c));for(s=0;s<m;++s)f=l.call(e,r[s],s,r)+"",(c=d.get(f))?(i[s]=c,c.__data__=r[s],d.delete(f)):o[s]=new Da(e,r[s]);for(s=0;s<u;++s)(c=n[s])&&d.get(p[s])===c&&(a[s]=c)}function jk(e){return e.__data__}function Kk(e,n){if(!arguments.length)return Array.from(this,jk);var o=n?Hk:Uk,i=this._parents,a=this._groups;typeof e!="function"&&(e=Fk(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],p=m.length,f=Gk(e.call(u,u&&u.__data__,d,i)),h=f.length,g=s[d]=new Array(h),b=l[d]=new Array(h),_=c[d]=new Array(p);o(u,m,g,b,_,f,n);for(var k=0,N=0,y,E;k<h;++k)if(y=g[k]){for(k>=N&&(N=k+1);!(E=b[N])&&++N<h;);y._next=E||null}}return l=new Ut(l,i),l._enter=s,l._exit=c,l}function Gk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Yk(){return new Ut(this._exit||this._groups.map(ym),this._parents)}function qk(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 Wk(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,p=s[c]=new Array(m),f,h=0;h<m;++h)(f=d[h]||u[h])&&(p[h]=f);for(;c<a;++c)s[c]=o[c];return new Ut(s,this._parents)}function Jk(){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 Xk(e){e||(e=Zk);function n(m,p){return m&&p?e(m.__data__,p.__data__):!m-!p}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 Ut(a,this._parents).order()}function Zk(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function Qk(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function eE(){return Array.from(this)}function tE(){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 nE(){let e=0;for(const n of this)++e;return e}function oE(){return!this.node()}function iE(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 aE(e){return function(){this.removeAttribute(e)}}function rE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lE(e,n){return function(){this.setAttribute(e,n)}}function sE(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function cE(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function dE(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 uE(e,n){var o=Ba(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?rE:aE:typeof n=="function"?o.local?dE:cE:o.local?sE:lE)(o,n))}function gm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function mE(e){return function(){this.style.removeProperty(e)}}function fE(e,n,o){return function(){this.style.setProperty(e,n,o)}}function pE(e,n,o){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function hE(e,n,o){return arguments.length>1?this.each((n==null?mE:typeof n=="function"?pE:fE)(e,n,o??"")):Go(this.node(),e)}function Go(e,n){return e.style.getPropertyValue(n)||gm(e).getComputedStyle(e,null).getPropertyValue(n)}function yE(e){return function(){delete this[e]}}function gE(e,n){return function(){this[e]=n}}function bE(e,n){return function(){var o=n.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function _E(e,n){return arguments.length>1?this.each((n==null?yE:typeof n=="function"?bE:gE)(e,n)):this.node()[e]}function bm(e){return e.trim().split(/^|\s+/)}function Jl(e){return e.classList||new _m(e)}function _m(e){this._node=e,this._names=bm(e.getAttribute("class")||"")}_m.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 km(e,n){for(var o=Jl(e),i=-1,a=n.length;++i<a;)o.add(n[i])}function Em(e,n){for(var o=Jl(e),i=-1,a=n.length;++i<a;)o.remove(n[i])}function kE(e){return function(){km(this,e)}}function EE(e){return function(){Em(this,e)}}function NE(e,n){return function(){(n.apply(this,arguments)?km:Em)(this,e)}}function wE(e,n){var o=bm(e+"");if(arguments.length<2){for(var i=Jl(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof n=="function"?NE:n?kE:EE)(o,n))}function IE(){this.textContent=""}function vE(e){return function(){this.textContent=e}}function CE(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function SE(e){return arguments.length?this.each(e==null?IE:(typeof e=="function"?CE:vE)(e)):this.node().textContent}function xE(){this.innerHTML=""}function RE(e){return function(){this.innerHTML=e}}function AE(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function $E(e){return arguments.length?this.each(e==null?xE:(typeof e=="function"?AE:RE)(e)):this.node().innerHTML}function TE(){this.nextSibling&&this.parentNode.appendChild(this)}function ME(){return this.each(TE)}function VE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function BE(){return this.each(VE)}function DE(e){var n=typeof e=="function"?e:mm(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function OE(){return null}function LE(e,n){var o=typeof e=="function"?e:mm(e),i=n==null?OE:typeof n=="function"?n:Wl(n);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function PE(){var e=this.parentNode;e&&e.removeChild(this)}function zE(){return this.each(PE)}function FE(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function UE(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function HE(e){return this.select(e?UE:FE)}function jE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function KE(e){return function(n){e.call(this,n,this.__data__)}}function GE(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 YE(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 qE(e,n,o){return function(){var i=this.__on,a,r=KE(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 WE(e,n,o){var i=GE(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?qE:YE,a=0;a<r;++a)this.each(s(i[a],n,o));return this}function Nm(e,n,o){var i=gm(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 JE(e,n){return function(){return Nm(this,e,n)}}function XE(e,n){return function(){return Nm(this,e,n.apply(this,arguments))}}function ZE(e,n){return this.each((typeof n=="function"?XE:JE)(e,n))}function*QE(){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 wm=[null];function Ut(e,n){this._groups=e,this._parents=n}function wi(){return new Ut([[document.documentElement]],wm)}function e1(){return this}Ut.prototype=wi.prototype={constructor:Ut,select:Ck,selectAll:Ak,selectChild:Vk,selectChildren:Lk,filter:Pk,data:Kk,enter:zk,exit:Yk,join:qk,merge:Wk,selection:e1,order:Jk,sort:Xk,call:Qk,nodes:eE,node:tE,size:nE,empty:oE,each:iE,attr:uE,style:hE,property:_E,classed:wE,text:SE,html:$E,raise:ME,lower:BE,append:DE,insert:LE,remove:zE,clone:HE,datum:jE,on:WE,dispatch:ZE,[Symbol.iterator]:QE};function Jt(e){return typeof e=="string"?new Ut([[document.querySelector(e)]],[document.documentElement]):new Ut([[e]],wm)}function t1(e){let n;for(;n=e.sourceEvent;)e=n;return e}function sn(e,n){if(e=t1(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 n1={passive:!1},Ii={capture:!0,passive:!1};function Xl(e){e.stopImmediatePropagation()}function Yo(e){e.preventDefault(),e.stopImmediatePropagation()}function Im(e){var n=e.document.documentElement,o=Jt(e).on("dragstart.drag",Yo,Ii);"onselectstart"in n?o.on("selectstart.drag",Yo,Ii):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function vm(e,n){var o=e.document.documentElement,i=Jt(e).on("dragstart.drag",null);n&&(i.on("click.drag",Yo,Ii),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 Oa=e=>()=>e;function Zl(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}})}Zl.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function o1(e){return!e.ctrlKey&&!e.button}function i1(){return this.parentNode}function a1(e,n){return n??{x:e.x,y:e.y}}function r1(){return navigator.maxTouchPoints||"ontouchstart"in this}function l1(){var e=o1,n=i1,o=a1,i=r1,a={},r=Ma("start","drag","end"),l=0,s,c,d,u,m=0;function p(y){y.on("mousedown.drag",f).filter(i).on("touchstart.drag",b).on("touchmove.drag",_,n1).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(y,E){if(!(u||!e.call(this,y,E))){var S=N(this,n.call(this,y,E),y,E,"mouse");S&&(Jt(y.view).on("mousemove.drag",h,Ii).on("mouseup.drag",g,Ii),Im(y.view),Xl(y),d=!1,s=y.clientX,c=y.clientY,S("start",y))}}function h(y){if(Yo(y),!d){var E=y.clientX-s,S=y.clientY-c;d=E*E+S*S>m}a.mouse("drag",y)}function g(y){Jt(y.view).on("mousemove.drag mouseup.drag",null),vm(y.view,d),Yo(y),a.mouse("end",y)}function b(y,E){if(e.call(this,y,E)){var S=y.changedTouches,A=n.call(this,y,E),V=S.length,$,O;for($=0;$<V;++$)(O=N(this,A,y,E,S[$].identifier,S[$]))&&(Xl(y),O("start",y,S[$]))}}function _(y){var E=y.changedTouches,S=E.length,A,V;for(A=0;A<S;++A)(V=a[E[A].identifier])&&(Yo(y),V("drag",y,E[A]))}function k(y){var E=y.changedTouches,S=E.length,A,V;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),A=0;A<S;++A)(V=a[E[A].identifier])&&(Xl(y),V("end",y,E[A]))}function N(y,E,S,A,V,$){var O=r.copy(),C=sn($||S,E),R,T,w;if((w=o.call(y,new Zl("beforestart",{sourceEvent:S,target:p,identifier:V,active:l,x:C[0],y:C[1],dx:0,dy:0,dispatch:O}),A))!=null)return R=w.x-C[0]||0,T=w.y-C[1]||0,function I(v,B,M){var x=C,P;switch(v){case"start":a[V]=I,P=l++;break;case"end":delete a[V],--l;case"drag":C=sn(M||B,E),P=l;break}O.call(v,y,new Zl(v,{sourceEvent:B,subject:w,target:p,identifier:V,active:P,x:C[0]+R,y:C[1]+T,dx:C[0]-x[0],dy:C[1]-x[1],dispatch:O}),A)}}return p.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Oa(!!y),p):e},p.container=function(y){return arguments.length?(n=typeof y=="function"?y:Oa(y),p):n},p.subject=function(y){return arguments.length?(o=typeof y=="function"?y:Oa(y),p):o},p.touchable=function(y){return arguments.length?(i=typeof y=="function"?y:Oa(!!y),p):i},p.on=function(){var y=r.on.apply(r,arguments);return y===r?p:y},p.clickDistance=function(y){return arguments.length?(m=(y=+y)*y,p):Math.sqrt(m)},p}function Ql(e,n,o){e.prototype=n.prototype=o,o.constructor=e}function Cm(e,n){var o=Object.create(e.prototype);for(var i in n)o[i]=n[i];return o}function vi(){}var Ci=.7,La=1/Ci,qo="\\s*([+-]?\\d+)\\s*",Si="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",s1=/^#([0-9a-f]{3,8})$/,c1=new RegExp(`^rgb\\(${qo},${qo},${qo}\\)$`),d1=new RegExp(`^rgb\\(${cn},${cn},${cn}\\)$`),u1=new RegExp(`^rgba\\(${qo},${qo},${qo},${Si}\\)$`),m1=new RegExp(`^rgba\\(${cn},${cn},${cn},${Si}\\)$`),f1=new RegExp(`^hsl\\(${Si},${cn},${cn}\\)$`),p1=new RegExp(`^hsla\\(${Si},${cn},${cn},${Si}\\)$`),Sm={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};Ql(vi,fo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xm,formatHex:xm,formatHex8:h1,formatHsl:y1,formatRgb:Rm,toString:Rm});function xm(){return this.rgb().formatHex()}function h1(){return this.rgb().formatHex8()}function y1(){return Vm(this).formatHsl()}function Rm(){return this.rgb().formatRgb()}function fo(e){var n,o;return e=(e+"").trim().toLowerCase(),(n=s1.exec(e))?(o=n[1].length,n=parseInt(n[1],16),o===6?Am(n):o===3?new Ot(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):o===8?Pa(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):o===4?Pa(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=c1.exec(e))?new Ot(n[1],n[2],n[3],1):(n=d1.exec(e))?new Ot(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=u1.exec(e))?Pa(n[1],n[2],n[3],n[4]):(n=m1.exec(e))?Pa(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=f1.exec(e))?Mm(n[1],n[2]/100,n[3]/100,1):(n=p1.exec(e))?Mm(n[1],n[2]/100,n[3]/100,n[4]):Sm.hasOwnProperty(e)?Am(Sm[e]):e==="transparent"?new Ot(NaN,NaN,NaN,0):null}function Am(e){return new Ot(e>>16&255,e>>8&255,e&255,1)}function Pa(e,n,o,i){return i<=0&&(e=n=o=NaN),new Ot(e,n,o,i)}function g1(e){return e instanceof vi||(e=fo(e)),e?(e=e.rgb(),new Ot(e.r,e.g,e.b,e.opacity)):new Ot}function es(e,n,o,i){return arguments.length===1?g1(e):new Ot(e,n,o,i??1)}function Ot(e,n,o,i){this.r=+e,this.g=+n,this.b=+o,this.opacity=+i}Ql(Ot,es,Cm(vi,{brighter(e){return e=e==null?La:Math.pow(La,e),new Ot(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ci:Math.pow(Ci,e),new Ot(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ot(po(this.r),po(this.g),po(this.b),za(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:$m,formatHex:$m,formatHex8:b1,formatRgb:Tm,toString:Tm}));function $m(){return`#${ho(this.r)}${ho(this.g)}${ho(this.b)}`}function b1(){return`#${ho(this.r)}${ho(this.g)}${ho(this.b)}${ho((isNaN(this.opacity)?1:this.opacity)*255)}`}function Tm(){const e=za(this.opacity);return`${e===1?"rgb(":"rgba("}${po(this.r)}, ${po(this.g)}, ${po(this.b)}${e===1?")":`, ${e})`}`}function za(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function po(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ho(e){return e=po(e),(e<16?"0":"")+e.toString(16)}function Mm(e,n,o,i){return i<=0?e=n=o=NaN:o<=0||o>=1?e=n=NaN:n<=0&&(e=NaN),new Xt(e,n,o,i)}function Vm(e){if(e instanceof Xt)return new Xt(e.h,e.s,e.l,e.opacity);if(e instanceof vi||(e=fo(e)),!e)return new Xt;if(e instanceof Xt)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 Xt(l,s,c,e.opacity)}function _1(e,n,o,i){return arguments.length===1?Vm(e):new Xt(e,n,o,i??1)}function Xt(e,n,o,i){this.h=+e,this.s=+n,this.l=+o,this.opacity=+i}Ql(Xt,_1,Cm(vi,{brighter(e){return e=e==null?La:Math.pow(La,e),new Xt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ci:Math.pow(Ci,e),new Xt(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 Ot(ts(e>=240?e-240:e+120,a,i),ts(e,a,i),ts(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new Xt(Bm(this.h),Fa(this.s),Fa(this.l),za(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=za(this.opacity);return`${e===1?"hsl(":"hsla("}${Bm(this.h)}, ${Fa(this.s)*100}%, ${Fa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bm(e){return e=(e||0)%360,e<0?e+360:e}function Fa(e){return Math.max(0,Math.min(1,e||0))}function ts(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 ns=e=>()=>e;function k1(e,n){return function(o){return e+o*n}}function E1(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 N1(e){return(e=+e)==1?Dm:function(n,o){return o-n?E1(n,o,e):ns(isNaN(n)?o:n)}}function Dm(e,n){var o=n-e;return o?k1(e,o):ns(isNaN(e)?n:e)}const Ua=(function e(n){var o=N1(n);function i(a,r){var l=o((a=es(a)).r,(r=es(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=Dm(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 w1(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 I1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function v1(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]=xi(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 C1(e,n){var o=new Date;return e=+e,n=+n,function(i){return o.setTime(e*(1-i)+n*i),o}}function dn(e,n){return e=+e,n=+n,function(o){return e*(1-o)+n*o}}function S1(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]=xi(e[a],n[a]):i[a]=n[a];return function(r){for(a in o)i[a]=o[a](r);return i}}var os=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,is=new RegExp(os.source,"g");function x1(e){return function(){return e}}function R1(e){return function(n){return e(n)+""}}function Om(e,n){var o=os.lastIndex=is.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",n=n+"";(i=os.exec(e))&&(a=is.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:dn(i,a)})),o=is.lastIndex;return o<n.length&&(r=n.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?R1(c[0].x):x1(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 xi(e,n){var o=typeof n,i;return n==null||o==="boolean"?ns(n):(o==="number"?dn:o==="string"?(i=fo(n))?(n=i,Ua):Om:n instanceof fo?Ua:n instanceof Date?C1:I1(n)?w1:Array.isArray(n)?v1:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?S1:dn)(e,n)}var Lm=180/Math.PI,as={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pm(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)*Lm,skewX:Math.atan(c)*Lm,scaleX:l,scaleY:s}}var Ha;function A1(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?as:Pm(n.a,n.b,n.c,n.d,n.e,n.f)}function $1(e){return e==null||(Ha||(Ha=document.createElementNS("http://www.w3.org/2000/svg","g")),Ha.setAttribute("transform",e),!(e=Ha.transform.baseVal.consolidate()))?as:(e=e.matrix,Pm(e.a,e.b,e.c,e.d,e.e,e.f))}function zm(e,n,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,p,f,h){if(d!==m||u!==p){var g=f.push("translate(",null,n,null,o);h.push({i:g-4,x:dn(d,m)},{i:g-2,x:dn(u,p)})}else(m||p)&&f.push("translate("+m+n+p+o)}function l(d,u,m,p){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),p.push({i:m.push(a(m)+"rotate(",null,i)-2,x:dn(d,u)})):u&&m.push(a(m)+"rotate("+u+i)}function s(d,u,m,p){d!==u?p.push({i:m.push(a(m)+"skewX(",null,i)-2,x:dn(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,p,f,h){if(d!==m||u!==p){var g=f.push(a(f)+"scale(",null,",",null,")");h.push({i:g-4,x:dn(d,m)},{i:g-2,x:dn(u,p)})}else(m!==1||p!==1)&&f.push(a(f)+"scale("+m+","+p+")")}return function(d,u){var m=[],p=[];return d=e(d),u=e(u),r(d.translateX,d.translateY,u.translateX,u.translateY,m,p),l(d.rotate,u.rotate,m,p),s(d.skewX,u.skewX,m,p),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,m,p),d=u=null,function(f){for(var h=-1,g=p.length,b;++h<g;)m[(b=p[h]).i]=b.x(f);return m.join("")}}}var T1=zm(A1,"px, ","px)","deg)"),M1=zm($1,", ",")",")"),V1=1e-12;function Fm(e){return((e=Math.exp(e))+1/e)/2}function B1(e){return((e=Math.exp(e))-1/e)/2}function D1(e){return((e=Math.exp(2*e))-1)/(e+1)}const ja=(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],p=l[2],f=u-s,h=m-c,g=f*f+h*h,b,_;if(g<V1)_=Math.log(p/d)/n,b=function(A){return[s+A*f,c+A*h,d*Math.exp(n*A*_)]};else{var k=Math.sqrt(g),N=(p*p-d*d+i*g)/(2*d*o*k),y=(p*p-d*d-i*g)/(2*p*o*k),E=Math.log(Math.sqrt(N*N+1)-N),S=Math.log(Math.sqrt(y*y+1)-y);_=(S-E)/n,b=function(A){var V=A*_,$=Fm(E),O=d/(o*k)*($*D1(n*V+E)-B1(E));return[s+O*f,c+O*h,d*$/Fm(n*V+E)]}}return b.duration=_*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 Wo=0,Ri=0,Ai=0,Um=1e3,Ka,$i,Ga=0,yo=0,Ya=0,Ti=typeof performance=="object"&&performance.now?performance:Date,Hm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function rs(){return yo||(Hm(O1),yo=Ti.now()+Ya)}function O1(){yo=0}function qa(){this._call=this._time=this._next=null}qa.prototype=jm.prototype={constructor:qa,restart:function(e,n,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?rs():+o)+(n==null?0:+n),!this._next&&$i!==this&&($i?$i._next=this:Ka=this,$i=this),this._call=e,this._time=o,ls()},stop:function(){this._call&&(this._call=null,this._time=1/0,ls())}};function jm(e,n,o){var i=new qa;return i.restart(e,n,o),i}function L1(){rs(),++Wo;for(var e=Ka,n;e;)(n=yo-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Wo}function Km(){yo=(Ga=Ti.now())+Ya,Wo=Ri=0;try{L1()}finally{Wo=0,z1(),yo=0}}function P1(){var e=Ti.now(),n=e-Ga;n>Um&&(Ya-=n,Ga=e)}function z1(){for(var e,n=Ka,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:Ka=o);$i=e,ls(i)}function ls(e){if(!Wo){Ri&&(Ri=clearTimeout(Ri));var n=e-yo;n>24?(e<1/0&&(Ri=setTimeout(Km,e-Ti.now()-Ya)),Ai&&(Ai=clearInterval(Ai))):(Ai||(Ga=Ti.now(),Ai=setInterval(P1,Um)),Wo=1,Hm(Km))}}function Gm(e,n,o){var i=new qa;return n=n==null?0:+n,i.restart(a=>{i.stop(),e(a+n)},n,o),i}var F1=Ma("start","end","cancel","interrupt"),U1=[],Ym=0,qm=1,ss=2,Wa=3,Wm=4,cs=5,Ja=6;function Xa(e,n,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;H1(e,o,{name:n,index:i,group:a,on:F1,tween:U1,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ym})}function ds(e,n){var o=Zt(e,n);if(o.state>Ym)throw new Error("too late; already scheduled");return o}function un(e,n){var o=Zt(e,n);if(o.state>Wa)throw new Error("too late; already running");return o}function Zt(e,n){var o=e.__transition;if(!o||!(o=o[n]))throw new Error("transition not found");return o}function H1(e,n,o){var i=e.__transition,a;i[n]=o,o.timer=jm(r,0,o.time);function r(d){o.state=qm,o.timer.restart(l,o.delay,o.time),o.delay<=d&&l(d-o.delay)}function l(d){var u,m,p,f;if(o.state!==qm)return c();for(u in i)if(f=i[u],f.name===o.name){if(f.state===Wa)return Gm(l);f.state===Wm?(f.state=Ja,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<n&&(f.state=Ja,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(Gm(function(){o.state===Wa&&(o.state=Wm,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=ss,o.on.call("start",e,e.__data__,o.index,o.group),o.state===ss){for(o.state=Wa,a=new Array(p=o.tween.length),u=0,m=-1;u<p;++u)(f=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++m]=f);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=cs,1),m=-1,p=a.length;++m<p;)a[m].call(e,u);o.state===cs&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=Ja,o.timer.stop(),delete i[n];for(var d in i)return;delete e.__transition}}function Za(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>ss&&i.state<cs,i.state=Ja,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function j1(e){return this.each(function(){Za(this,e)})}function K1(e,n){var o,i;return function(){var a=un(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 G1(e,n,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=un(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 Y1(e,n){var o=this._id;if(e+="",arguments.length<2){for(var i=Zt(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?K1:G1)(o,e,n))}function us(e,n,o){var i=e._id;return e.each(function(){var a=un(this,i);(a.value||(a.value={}))[n]=o.apply(this,arguments)}),function(a){return Zt(a,i).value[n]}}function Jm(e,n){var o;return(typeof n=="number"?dn:n instanceof fo?Ua:(o=fo(n))?(n=o,Ua):Om)(e,n)}function q1(e){return function(){this.removeAttribute(e)}}function W1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function J1(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 X1(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 Z1(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 Q1(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 e0(e,n){var o=Ba(e),i=o==="transform"?M1:Jm;return this.attrTween(e,typeof n=="function"?(o.local?Q1:Z1)(o,i,us(this,"attr."+e,n)):n==null?(o.local?W1:q1)(o):(o.local?X1:J1)(o,i,n))}function t0(e,n){return function(o){this.setAttribute(e,n.call(this,o))}}function n0(e,n){return function(o){this.setAttributeNS(e.space,e.local,n.call(this,o))}}function o0(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&n0(e,r)),o}return a._value=n,a}function i0(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&t0(e,r)),o}return a._value=n,a}function a0(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=Ba(e);return this.tween(o,(i.local?o0:i0)(i,n))}function r0(e,n){return function(){ds(this,e).delay=+n.apply(this,arguments)}}function l0(e,n){return n=+n,function(){ds(this,e).delay=n}}function s0(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?r0:l0)(n,e)):Zt(this.node(),n).delay}function c0(e,n){return function(){un(this,e).duration=+n.apply(this,arguments)}}function d0(e,n){return n=+n,function(){un(this,e).duration=n}}function u0(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?c0:d0)(n,e)):Zt(this.node(),n).duration}function m0(e,n){if(typeof n!="function")throw new Error;return function(){un(this,e).ease=n}}function f0(e){var n=this._id;return arguments.length?this.each(m0(n,e)):Zt(this.node(),n).ease}function p0(e,n){return function(){var o=n.apply(this,arguments);if(typeof o!="function")throw new Error;un(this,e).ease=o}}function h0(e){if(typeof e!="function")throw new Error;return this.each(p0(this._id,e))}function y0(e){typeof e!="function"&&(e=pm(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 In(i,this._parents,this._name,this._id)}function g0(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),p,f=0;f<u;++f)(p=c[f]||d[f])&&(m[f]=p);for(;s<i;++s)l[s]=n[s];return new In(l,this._parents,this._name,this._id)}function b0(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 _0(e,n,o){var i,a,r=b0(n)?ds:un;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(n,o),l.on=a}}function k0(e,n){var o=this._id;return arguments.length<2?Zt(this.node(),o).on.on(e):this.each(_0(o,e,n))}function E0(e){return function(){var n=this.parentNode;for(var o in this.__transition)if(+o!==e)return;n&&n.removeChild(this)}}function N0(){return this.on("end.remove",E0(this._id))}function w0(e){var n=this._name,o=this._id;typeof e!="function"&&(e=Wl(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,p=0;p<c;++p)(u=s[p])&&(m=e.call(u,u.__data__,p,s))&&("__data__"in u&&(m.__data__=u.__data__),d[p]=m,Xa(d[p],n,o,p,d,Zt(u,o)));return new In(r,this._parents,n,o)}function I0(e){var n=this._name,o=this._id;typeof e!="function"&&(e=fm(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 p=e.call(u,u.__data__,m,c),f,h=Zt(u,o),g=0,b=p.length;g<b;++g)(f=p[g])&&Xa(f,n,o,g,p,h);r.push(p),l.push(u)}return new In(r,l,n,o)}var v0=wi.prototype.constructor;function C0(){return new v0(this._groups,this._parents)}function S0(e,n){var o,i,a;return function(){var r=Go(this,e),l=(this.style.removeProperty(e),Go(this,e));return r===l?null:r===o&&l===i?a:a=n(o=r,i=l)}}function Xm(e){return function(){this.style.removeProperty(e)}}function x0(e,n,o){var i,a=o+"",r;return function(){var l=Go(this,e);return l===a?null:l===i?r:r=n(i=l,o)}}function R0(e,n,o){var i,a,r;return function(){var l=Go(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Go(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s))}}function A0(e,n){var o,i,a,r="style."+n,l="end."+r,s;return function(){var c=un(this,e),d=c.on,u=c.value[r]==null?s||(s=Xm(n)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function $0(e,n,o){var i=(e+="")=="transform"?T1:Jm;return n==null?this.styleTween(e,S0(e,i)).on("end.style."+e,Xm(e)):typeof n=="function"?this.styleTween(e,R0(e,i,us(this,"style."+e,n))).each(A0(this._id,e)):this.styleTween(e,x0(e,i,n),o).on("end.style."+e,null)}function T0(e,n,o){return function(i){this.style.setProperty(e,n.call(this,i),o)}}function M0(e,n,o){var i,a;function r(){var l=n.apply(this,arguments);return l!==a&&(i=(a=l)&&T0(e,l,o)),i}return r._value=n,r}function V0(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,M0(e,n,o??""))}function B0(e){return function(){this.textContent=e}}function D0(e){return function(){var n=e(this);this.textContent=n??""}}function O0(e){return this.tween("text",typeof e=="function"?D0(us(this,"text",e)):B0(e==null?"":e+""))}function L0(e){return function(n){this.textContent=e.call(this,n)}}function P0(e){var n,o;function i(){var a=e.apply(this,arguments);return a!==o&&(n=(o=a)&&L0(a)),n}return i._value=e,i}function z0(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,P0(e))}function F0(){for(var e=this._name,n=this._id,o=Zm(),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=Zt(c,n);Xa(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new In(i,this._parents,e,o)}function U0(){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=un(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 H0=0;function In(e,n,o,i){this._groups=e,this._parents=n,this._name=o,this._id=i}function Zm(){return++H0}var vn=wi.prototype;In.prototype={constructor:In,select:w0,selectAll:I0,selectChild:vn.selectChild,selectChildren:vn.selectChildren,filter:y0,merge:g0,selection:C0,transition:F0,call:vn.call,nodes:vn.nodes,node:vn.node,size:vn.size,empty:vn.empty,each:vn.each,on:k0,attr:e0,attrTween:a0,style:$0,styleTween:V0,text:O0,textTween:z0,remove:N0,tween:Y1,delay:s0,duration:u0,ease:f0,easeVarying:h0,end:U0,[Symbol.iterator]:vn[Symbol.iterator]};function j0(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var K0={time:null,delay:0,duration:250,ease:j0};function G0(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 Y0(e){var n,o;e instanceof In?(n=e._id,e=e._name):(n=Zm(),(o=K0).time=rs(),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])&&Xa(c,e,n,d,l,o||G0(c,n));return new In(i,this._parents,e,n)}wi.prototype.interrupt=j1,wi.prototype.transition=Y0;const Qa=e=>()=>e;function q0(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 Cn(e,n,o){this.k=e,this.x=n,this.y=o}Cn.prototype={constructor:Cn,scale:function(e){return e===1?this:new Cn(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Cn(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 Jo=new Cn(1,0,0);Cn.prototype;function ms(e){e.stopImmediatePropagation()}function Mi(e){e.preventDefault(),e.stopImmediatePropagation()}function W0(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function J0(){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 Qm(){return this.__zoom||Jo}function X0(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Z0(){return navigator.maxTouchPoints||"ontouchstart"in this}function Q0(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 eN(){var e=W0,n=J0,o=Q0,i=X0,a=Z0,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=ja,d=Ma("start","zoom","end"),u,m,p,f=500,h=150,g=0,b=10;function _(w){w.property("__zoom",Qm).on("wheel.zoom",V,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",O).filter(a).on("touchstart.zoom",C).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(w,I,v,B){var M=w.selection?w.selection():w;M.property("__zoom",Qm),w!==M?E(w,I,v,B):M.interrupt().each(function(){S(this,arguments).event(B).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},_.scaleBy=function(w,I,v,B){_.scaleTo(w,function(){var M=this.__zoom.k,x=typeof I=="function"?I.apply(this,arguments):I;return M*x},v,B)},_.scaleTo=function(w,I,v,B){_.transform(w,function(){var M=n.apply(this,arguments),x=this.__zoom,P=v==null?y(M):typeof v=="function"?v.apply(this,arguments):v,Y=x.invert(P),se=typeof I=="function"?I.apply(this,arguments):I;return o(N(k(x,se),P,Y),M,l)},v,B)},_.translateBy=function(w,I,v,B){_.transform(w,function(){return o(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof v=="function"?v.apply(this,arguments):v),n.apply(this,arguments),l)},null,B)},_.translateTo=function(w,I,v,B,M){_.transform(w,function(){var x=n.apply(this,arguments),P=this.__zoom,Y=B==null?y(x):typeof B=="function"?B.apply(this,arguments):B;return o(Jo.translate(Y[0],Y[1]).scale(P.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof v=="function"?-v.apply(this,arguments):-v),x,l)},B,M)};function k(w,I){return I=Math.max(r[0],Math.min(r[1],I)),I===w.k?w:new Cn(I,w.x,w.y)}function N(w,I,v){var B=I[0]-v[0]*w.k,M=I[1]-v[1]*w.k;return B===w.x&&M===w.y?w:new Cn(w.k,B,M)}function y(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function E(w,I,v,B){w.on("start.zoom",function(){S(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(B).end()}).tween("zoom",function(){var M=this,x=arguments,P=S(M,x).event(B),Y=n.apply(M,x),se=v==null?y(Y):typeof v=="function"?v.apply(M,x):v,he=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),ie=M.__zoom,fe=typeof I=="function"?I.apply(M,x):I,pe=c(ie.invert(se).concat(he/ie.k),fe.invert(se).concat(he/fe.k));return function(ge){if(ge===1)ge=fe;else{var Te=pe(ge),He=he/Te[2];ge=new Cn(He,se[0]-Te[0]*He,se[1]-Te[1]*He)}P.zoom(null,ge)}})}function S(w,I,v){return!v&&w.__zooming||new A(w,I)}function A(w,I){this.that=w,this.args=I,this.active=0,this.sourceEvent=null,this.extent=n.apply(w,I),this.taps=0}A.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,I){return this.mouse&&w!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var I=Jt(this.that).datum();d.call(w,this.that,new q0(w,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),I)}};function V(w,...I){if(!e.apply(this,arguments))return;var v=S(this,I).event(w),B=this.__zoom,M=Math.max(r[0],Math.min(r[1],B.k*Math.pow(2,i.apply(this,arguments)))),x=sn(w);if(v.wheel)(v.mouse[0][0]!==x[0]||v.mouse[0][1]!==x[1])&&(v.mouse[1]=B.invert(v.mouse[0]=x)),clearTimeout(v.wheel);else{if(B.k===M)return;v.mouse=[x,B.invert(x)],Za(this),v.start()}Mi(w),v.wheel=setTimeout(P,h),v.zoom("mouse",o(N(k(B,M),v.mouse[0],v.mouse[1]),v.extent,l));function P(){v.wheel=null,v.end()}}function $(w,...I){if(p||!e.apply(this,arguments))return;var v=w.currentTarget,B=S(this,I,!0).event(w),M=Jt(w.view).on("mousemove.zoom",se,!0).on("mouseup.zoom",he,!0),x=sn(w,v),P=w.clientX,Y=w.clientY;Im(w.view),ms(w),B.mouse=[x,this.__zoom.invert(x)],Za(this),B.start();function se(ie){if(Mi(ie),!B.moved){var fe=ie.clientX-P,pe=ie.clientY-Y;B.moved=fe*fe+pe*pe>g}B.event(ie).zoom("mouse",o(N(B.that.__zoom,B.mouse[0]=sn(ie,v),B.mouse[1]),B.extent,l))}function he(ie){M.on("mousemove.zoom mouseup.zoom",null),vm(ie.view,B.moved),Mi(ie),B.event(ie).end()}}function O(w,...I){if(e.apply(this,arguments)){var v=this.__zoom,B=sn(w.changedTouches?w.changedTouches[0]:w,this),M=v.invert(B),x=v.k*(w.shiftKey?.5:2),P=o(N(k(v,x),B,M),n.apply(this,I),l);Mi(w),s>0?Jt(this).transition().duration(s).call(E,P,B,w):Jt(this).call(_.transform,P,B,w)}}function C(w,...I){if(e.apply(this,arguments)){var v=w.touches,B=v.length,M=S(this,I,w.changedTouches.length===B).event(w),x,P,Y,se;for(ms(w),P=0;P<B;++P)Y=v[P],se=sn(Y,this),se=[se,this.__zoom.invert(se),Y.identifier],M.touch0?!M.touch1&&M.touch0[2]!==se[2]&&(M.touch1=se,M.taps=0):(M.touch0=se,x=!0,M.taps=1+!!u);u&&(u=clearTimeout(u)),x&&(M.taps<2&&(m=se[0],u=setTimeout(function(){u=null},f)),Za(this),M.start())}}function R(w,...I){if(this.__zooming){var v=S(this,I).event(w),B=w.changedTouches,M=B.length,x,P,Y,se;for(Mi(w),x=0;x<M;++x)P=B[x],Y=sn(P,this),v.touch0&&v.touch0[2]===P.identifier?v.touch0[0]=Y:v.touch1&&v.touch1[2]===P.identifier&&(v.touch1[0]=Y);if(P=v.that.__zoom,v.touch1){var he=v.touch0[0],ie=v.touch0[1],fe=v.touch1[0],pe=v.touch1[1],ge=(ge=fe[0]-he[0])*ge+(ge=fe[1]-he[1])*ge,Te=(Te=pe[0]-ie[0])*Te+(Te=pe[1]-ie[1])*Te;P=k(P,Math.sqrt(ge/Te)),Y=[(he[0]+fe[0])/2,(he[1]+fe[1])/2],se=[(ie[0]+pe[0])/2,(ie[1]+pe[1])/2]}else if(v.touch0)Y=v.touch0[0],se=v.touch0[1];else return;v.zoom("touch",o(N(P,Y,se),v.extent,l))}}function T(w,...I){if(this.__zooming){var v=S(this,I).event(w),B=w.changedTouches,M=B.length,x,P;for(ms(w),p&&clearTimeout(p),p=setTimeout(function(){p=null},f),x=0;x<M;++x)P=B[x],v.touch0&&v.touch0[2]===P.identifier?delete v.touch0:v.touch1&&v.touch1[2]===P.identifier&&delete v.touch1;if(v.touch1&&!v.touch0&&(v.touch0=v.touch1,delete v.touch1),v.touch0)v.touch0[1]=this.__zoom.invert(v.touch0[0]);else if(v.end(),v.taps===2&&(P=sn(P,this),Math.hypot(m[0]-P[0],m[1]-P[1])<b)){var Y=Jt(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return _.wheelDelta=function(w){return arguments.length?(i=typeof w=="function"?w:Qa(+w),_):i},_.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Qa(!!w),_):e},_.touchable=function(w){return arguments.length?(a=typeof w=="function"?w:Qa(!!w),_):a},_.extent=function(w){return arguments.length?(n=typeof w=="function"?w:Qa([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),_):n},_.scaleExtent=function(w){return arguments.length?(r[0]=+w[0],r[1]=+w[1],_):[r[0],r[1]]},_.translateExtent=function(w){return arguments.length?(l[0][0]=+w[0][0],l[1][0]=+w[1][0],l[0][1]=+w[0][1],l[1][1]=+w[1][1],_):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},_.constrain=function(w){return arguments.length?(o=w,_):o},_.duration=function(w){return arguments.length?(s=+w,_):s},_.interpolate=function(w){return arguments.length?(c=w,_):c},_.on=function(){var w=d.on.apply(d,arguments);return w===d?_:w},_.clickDistance=function(w){return arguments.length?(g=(w=+w)*w,_):Math.sqrt(g)},_.tapDistance=function(w){return arguments.length?(b=+w,_):b},_}var Oe=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(Oe||{}),fs=(e=>(e.Partial="partial",e.Full="full",e))(fs||{}),go=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(go||{}),Sn=(e=>(e.Strict="strict",e.Loose="loose",e))(Sn||{}),ps=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(ps||{}),Vi=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Vi||{}),ef=(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))(ef||{});const tN=["INPUT","SELECT","TEXTAREA"],nN=typeof document<"u"?document:null;function hs(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 tN.includes(i==null?void 0:i.nodeName)||a||!!r}function oN(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function tf(e,n,o,i){const a=n.replace("+",`
27
+ `}}const ro="com.example",Wg="command.domain";function kn(e,n,o={}){const i=Mo(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??Wg,s=l?`.${l}`:"";return`${a.basePackage}${r}${s}`}return n.packageName||""}const Jg="CustomMoneyType",Xg="Money";function Zg(e){return!(e.type!==Jg||e.attrType!=="NORMAL"||e.identifier||e.dbAttrs.length>1)}function Qg(e){const n=e.dbAttrs[0]??{modelId:Pe(),physicalName:"",dataType:""},o={modelId:Pe(),physicalName:"",dataType:""},{customType:i,...a}=e;return{...a,type:Xg,attrType:"EMBED_PREDEF",dbAttrs:[n,o]}}function eb(e){let n=!1;const o=e.entities.map(i=>{let a=!1;const r=i.attributes.map(l=>Zg(l)?(a=!0,n=!0,Qg(l)):l);return a?{...i,attributes:r}:i});return n?{...e,entities:o}:e}function tb(e,n){const o=new Map,i=[],a=new Map;for(const h of e.entities){const g=new Map,b=new Map,_=new Map,k=(N,y,E)=>{if(!N)return;o.get(N)||o.set(N,[{entityId:y,assignedId:N}]),i.push({id:N,entityId:y,sink:E}),E(N)};for(const N of h.attributes){k(N.modelId,h.modelId,y=>g.set(N,y));for(const y of N.dbAttrs)k(y.modelId,h.modelId,E=>b.set(y,E))}for(const N of h.indexes??[])k(N.modelId,h.modelId,y=>_.set(N,y));a.set(h,{attrs:g,cols:b,idx:_})}const r=new Set(o.keys()),l=new Map;for(const h of i){const g=(l.get(h.id)??0)+1;if(l.set(h.id,g),g===1)continue;const b=nb(h.id,g-1,r);r.add(b),o.get(h.id).push({entityId:h.entityId,assignedId:b}),h.sink(b)}const s=[...o.values()].reduce((h,g)=>h+Math.max(0,g.length-1),0);if(s===0)return{logical:e,layout:n,reissued:0};const c=(h,g)=>{var _;if(!g||!h)return g;const b=o.get(g);return!b||b.length<2?g:((_=b.find(k=>k.entityId===h))==null?void 0:_.assignedId)??g},d=new Map(e.associations.map(h=>[h.modelId,h])),u=(h,g)=>{const b=d.get(h);if(b)return b.end1.entityRef===g?b.end2.entityRef:b.end1.entityRef},m=e.entities.map(h=>{var N;const g=a.get(h),b=h.attributes.map(y=>{const E=g.attrs.get(y),S=y.dbAttrs.map($=>{const O=g.cols.get($);return O===$.modelId?$:{...$,modelId:O}});let A=y.derivedFrom;if(A){const $=u(A.associationRef,h.modelId),O=c($,A.sourceAttributeRef);O!==A.sourceAttributeRef&&(A={...A,sourceAttributeRef:O})}return E!==y.modelId||A!==y.derivedFrom||S.some(($,O)=>$!==y.dbAttrs[O])?{...y,modelId:E,dbAttrs:S,derivedFrom:A}:y}),_=(N=h.indexes)==null?void 0:N.map(y=>{const E=g.idx.get(y),S=y.columns.map(V=>{const $=c(h.modelId,V.columnRef);return $===V.columnRef?V:{...V,columnRef:$}});return E!==y.modelId||S.some((V,$)=>V!==y.columns[$])?{...y,modelId:E,columns:S}:y});return b.some((y,E)=>y!==h.attributes[E])||_&&h.indexes&&_.some((y,E)=>y!==h.indexes[E])?{...h,attributes:b,..._?{indexes:_}:{}}:h}),p=e.associations.map(h=>{const g=c(h.end1.entityRef,h.end1.attributeRef),b=c(h.end2.entityRef,h.end2.attributeRef);return g===h.end1.attributeRef&&b===h.end2.attributeRef?h:{...h,end1:g===h.end1.attributeRef?h.end1:{...h.end1,attributeRef:g},end2:b===h.end2.attributeRef?h.end2:{...h.end2,attributeRef:b}}}),f=n.associationLayouts.map(h=>{const g=d.get(h.associationRef);if(!g)return h;const b=c(g.end1.entityRef,h.sourceColumnRef),_=c(g.end2.entityRef,h.targetColumnRef);return b===h.sourceColumnRef&&_===h.targetColumnRef?h:{...h,sourceColumnRef:b,targetColumnRef:_}});return{logical:{...e,entities:m,associations:p},layout:f.some((h,g)=>h!==n.associationLayouts[g])?{...n,associationLayouts:f}:n,reissued:s}}function nb(e,n,o){let i=n;for(;;){const a=`dup${i}:${e}`;if(!o.has(a))return a;i++}}const ob="5.2.4";function jt(e){return e.reduce((n,o)=>Math.max(n,o.order),-1)+1}function Il(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 Ed(e){return!!e.derivedFrom&&e.dbAttrs.length>0}function Nd(e){for(const n of e){const o=[...n.attributes].sort((s,c)=>s.order-c.order),i=o.filter(Ed);if(!i.length)continue;const a=o.filter(s=>!Ed(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 Fo(e){return JSON.parse(JSON.stringify(e))}function wd(e,n,o){var V;const i=o.idFactory??Pe,a=o.offset??{x:0,y:0},{logical:r,layout:l}=e,s=new Set(n);if(o.includeRelated){const $=new Set(n);for(const O of r.associations){const C=$.has(O.end1.entityRef),R=$.has(O.end2.entityRef);C!==R&&s.add(C?O.end2.entityRef:O.end1.entityRef)}}const c=r.entities.filter($=>s.has($.modelId)),d=new Set(c.map($=>$.modelId)),u=r.associations.filter($=>d.has($.end1.entityRef)&&d.has($.end2.entityRef)),m=new Set(u.map($=>$.modelId)),p=new Map,f=$=>{let O=p.get($);return O||(O=i(),p.set($,O)),O};for(const $ of c){f($.modelId);for(const O of $.attributes){f(O.modelId);for(const C of O.dbAttrs)f(C.modelId)}for(const O of $.indexes??[])f(O.modelId);for(const O of $.operations??[])f(O.modelId)}for(const $ of u)f($.modelId);const h=$=>p.get($),g=c.map($=>{const O=Fo($);O.modelId=h($.modelId),O.attributes=O.attributes.map(C=>ib(C,h,m,d));for(const C of O.indexes??[])C.modelId=h(C.modelId),C.columns=C.columns.map(R=>Xn(R.columnRef)?R:{...R,columnRef:h(R.columnRef)}).filter(R=>R.columnRef!==void 0);for(const C of O.operations??[])C.modelId=h(C.modelId);return O});Nd(g);const b=u.map($=>{const O=Fo($);return O.modelId=h($.modelId),O.end1=Id(O.end1,h),O.end2=Id(O.end2,h),O}),_=[];for(const $ of r.groups){const O=$.memberEntityRefs.filter(R=>d.has(R));if(O.length===0)continue;const C=Fo($);C.modelId=f($.modelId),C.memberEntityRefs=O.map(R=>h(R)),_.push(C)}const k=o.collisionSuffix??"_imported",N=new Set(o.existing.entities.map($=>$.name)),y=new Set(o.existing.entities.map($=>{var O;return(O=$.table)==null?void 0:O.physicalName}).filter($=>!!$));for(const $ of g)N.has($.name)&&($.name=`${$.name}${k}`),(V=$.table)!=null&&V.physicalName&&y.has($.table.physicalName)&&($.table.physicalName=`${$.table.physicalName}${k}`);const E=[];for(const $ of l.entityLayouts){const O=h($.entityRef);if(!O)continue;const C=Fo($);C.entityRef=O,C.geo={...C.geo,location:vl(C.geo.location,a)},C.attributeStyles&&(C.attributeStyles=Na(C.attributeStyles,h)),C.operationStyles&&(C.operationStyles=Na(C.operationStyles,h)),E.push(C)}const S=[];for(const $ of l.associationLayouts){const O=h($.associationRef);if(!O)continue;const C=Fo($);C.associationRef=O,C.sourceColumnRef=$.sourceColumnRef?h($.sourceColumnRef):void 0,C.targetColumnRef=$.targetColumnRef?h($.targetColumnRef):void 0,C.waypoints=C.waypoints.map(R=>vl(R,a)),S.push(C)}const A=[];for(const $ of l.groupLayouts){const O=h($.groupRef);if(!O)continue;const C=Fo($);C.groupRef=O,C.geo={...C.geo,location:vl(C.geo.location,a)},delete C.memberNoteRefs,A.push(C)}return{logical:{entities:g,associations:b,groups:_},layout:{entityLayouts:E,associationLayouts:S,groupLayouts:A},idMap:p}}function vl(e,n){return{x:e.x+n.x,y:e.y+n.y}}function ib(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 Id(e,n){return{...e,entityRef:n(e.entityRef),attributeRef:e.attributeRef?n(e.attributeRef):void 0}}function Na(e,n){const o={};for(const[i,a]of Object.entries(e)){const r=n(i);r&&(o[r]=a)}return o}function Cl(e){if(!("rev"in e))return e;const{rev:n,...o}=e;return o}function lo(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)=>lo(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(!lo(e[i],n[i]))return!1;return!0}return!1}function so(e,n,o){const i={},a=new Set([...Object.keys(e),...Object.keys(n)]);for(const r of a)o.has(r)||lo(e[r],n[r])||(i[r]=n[r]===void 0?null:n[r]);return Object.keys(i).length?i:null}function co(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 ab(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 rb=new Set(["attributes","operations","indexes","rev"]),lb=new Set(["end1","end2","rev"]),sb=new Set(["memberEntityRefs","rev"]),vd=new Set(["modelId"]),cb=new Set(["modelId","columns"]),db=new Set([]);function ub(e,n,o,i){const a=co(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=so(s,c,vd);d&&i.push({kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:s.modelId,patch:d})}const r=co(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=so(s,c,vd);d&&i.push({kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId,patch:d})}const l=co(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(!lo(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=so(s,c,cb);d&&i.push({kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId,patch:d})}}function mb(e,n,o){const i=co(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:Cl(l)});for(const{cur:l,tgt:s}of i.common){const c=so(l,s,rb);c&&o.push({kind:"entity.update",casUnit:"logical",containerRef:l.modelId,entityRef:l.modelId,patch:c}),ub(l.modelId,l,s,o)}const a=co(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:Cl(l)});for(const{cur:l,tgt:s}of a.common){const c=so(l,s,lb);c&&o.push({kind:"association.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,patch:c});for(const d of["end1","end2"]){const u=so(l[d]??{},s[d]??{},db);u&&o.push({kind:"associationEnd.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,end:d,patch:u})}}const r=co(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:Cl(l)});for(const{cur:l,tgt:s}of r.common){const c=so(l,s,sb);c&&o.push({kind:"group.update",casUnit:"logical",containerRef:l.modelId,groupRef:l.modelId,patch:c});const d=ab(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 wa(e,n,o,i,a,r,l){const s=co(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)lo(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 fb(e,n,o){wa(e.entityLayouts??[],n.entityLayouts??[],i=>i.entityRef,"entityLayout.add","entityLayout.remove","entityRef",o),wa(e.associationLayouts??[],n.associationLayouts??[],i=>i.associationRef,"associationLayout.add","associationLayout.remove","associationRef",o),wa(e.groupLayouts??[],n.groupLayouts??[],i=>i.groupRef,"groupLayout.add","groupLayout.remove","groupRef",o),wa(e.notes??[],n.notes??[],i=>i.modelId,"note.add","note.remove","noteRef",o)}function pb(e,n){const o=[];return mb(e.logical,n.logical,o),fb(e.layout,n.layout,o),o}function hb(e){if(e.groupRef!=null)return"group";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 중 하나 필요).")}const yb={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([])};class gb{constructor(n){ct(this,"out",[]);ct(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({...bi(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({...bi(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({...bi(n),field:a,value:void 0,removed:!0});continue}this.out.push({...bi(n),field:a,value:void 0,removed:!0,oldValue:this.last.get(a)}),this.last.delete(a)}}member(n,o,i){const a="memberEntityRefs";this.fieldFilter!=null&&a!==this.fieldFilter||this.out.push({...bi(n),field:a,value:o,...i?{removed:!0}:{}})}result(){return this.out}}function bi(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 rn(e,n,o,i){if(o==null||typeof o!="object")return;const a=yb[i];for(const[r,l]of Object.entries(o))a.has(r)||e.set(n,r,l)}function uo(e,n,o){if(!(o==null||typeof o!="object"))for(const[i,a]of Object.entries(o))e.set(n,i,a)}function Sl(e,n){if(Array.isArray(e))return e.find(o=>o.modelId===n)}function Ln(e,n){var r,l,s,c,d,u,m,p;const o=hb(n),i=new gb(n.field),a=[...e].sort((f,h)=>f.seq-h.seq);for(const f of a)for(const h of f.ops)switch(o){case"entity":if(h.entityRef!==n.entityRef)break;h.kind==="entity.add"?rn(i,f,h.value,"entity"):h.kind==="entity.update"?uo(i,f,h.patch):h.kind==="entity.remove"&&i.remove(f);break;case"attribute":if(h.entityRef!==n.entityRef)break;if(h.kind==="entity.add"){const g=Sl((r=h.value)==null?void 0:r.attributes,n.attributeRef);g&&rn(i,f,g,"attribute")}else h.kind==="attribute.add"&&((l=h.value)==null?void 0:l.modelId)===n.attributeRef?rn(i,f,h.value,"attribute"):h.kind==="attribute.update"&&h.attributeRef===n.attributeRef?uo(i,f,h.patch):(h.kind==="attribute.remove"&&h.attributeRef===n.attributeRef||h.kind==="entity.remove")&&i.remove(f);break;case"operation":if(h.entityRef!==n.entityRef)break;if(h.kind==="entity.add"){const g=Sl((s=h.value)==null?void 0:s.operations,n.operationRef);g&&rn(i,f,g,"operation")}else h.kind==="operation.add"&&((c=h.value)==null?void 0:c.modelId)===n.operationRef?rn(i,f,h.value,"operation"):h.kind==="operation.update"&&h.operationRef===n.operationRef?uo(i,f,h.patch):(h.kind==="operation.remove"&&h.operationRef===n.operationRef||h.kind==="entity.remove")&&i.remove(f);break;case"index":if(h.entityRef!==n.entityRef)break;if(h.kind==="entity.add"){const g=Sl((d=h.value)==null?void 0:d.indexes,n.indexRef);g&&rn(i,f,g,"index")}else h.kind==="index.add"&&((u=h.value)==null?void 0:u.modelId)===n.indexRef?rn(i,f,h.value,"index"):h.kind==="index.update"&&h.indexRef===n.indexRef?uo(i,f,h.patch):(h.kind==="index.remove"&&h.indexRef===n.indexRef||h.kind==="entity.remove")&&i.remove(f);break;case"association":if(h.associationRef!==n.associationRef)break;h.kind==="association.add"?rn(i,f,h.value,"association"):h.kind==="association.update"?uo(i,f,h.patch):h.kind==="association.remove"&&i.remove(f);break;case"associationEnd":if(h.associationRef!==n.associationRef)break;if(h.kind==="association.add"){const g=(m=h.value)==null?void 0:m[n.end];rn(i,f,g,"associationEnd")}else h.kind==="associationEnd.update"&&h.end===n.end?uo(i,f,h.patch):h.kind==="association.remove"&&i.remove(f);break;case"group":if(h.groupRef!==n.groupRef)break;if(h.kind==="group.add"){rn(i,f,h.value,"group");const g=(p=h.value)==null?void 0:p.memberEntityRefs;if(Array.isArray(g))for(const b of g)i.member(f,b,!1)}else h.kind==="group.update"?uo(i,f,h.patch):h.kind==="group.remove"?i.remove(f):h.kind==="group.addMember"&&h.entityRef!=null?i.member(f,h.entityRef,!1):h.kind==="group.removeMember"&&h.entityRef!=null&&i.member(f,h.entityRef,!0);break}return i.result()}const lt={subject:null,existence:null,fieldAudit:!1,note:"레이아웃 축(LWW) — 감사·복원 diff는 논리 축 전용(AA-5: layout/note는 의도적 범위 밖)"},bb={"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":lt,"entityLayout.remove":lt,"entityLayout.move":lt,"entityLayout.resize":lt,"entityLayout.setCollapsed":lt,"entityLayout.setLocked":lt,"entityLayout.setStyle":lt,"entityLayout.setAttrStyle":lt,"entityLayout.setOpStyle":lt,"groupLayout.add":lt,"groupLayout.remove":lt,"groupLayout.move":lt,"groupLayout.resize":lt,"groupLayout.setLocked":lt,"groupLayout.setStyle":lt,"groupLayout.addNoteMember":lt,"groupLayout.removeNoteMember":lt,"associationLayout.add":lt,"associationLayout.remove":lt,"associationLayout.setWaypoints":lt,"note.add":lt,"note.remove":lt,"note.move":lt,"note.resize":lt,"note.setMemo":lt,"note.setStyle":lt,"noteConnection.add":lt,"noteConnection.remove":lt,"noteConnection.setWaypoints":lt},Kt=e=>typeof e=="string"?e:void 0,_b=e=>{var n;return Kt((n=e.value)==null?void 0:n.modelId)};function Cd(e){return Kt(e.containerRef)??Kt(e.entityRef)}function xl(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=Kt(s.modelId);c&&r.push({subject:{kind:o,ref:c,...i?{entityRef:i}:{}},existence:"add",inline:!0})}return r}function Rl(e){const n=bb[e.kind];if(!n||!n.subject)return[];const o=e,i=n.existence??void 0;switch(n.subject){case"entity":{const a=Kt(o.entityRef);if(!a)return[];const r={subject:{kind:"entity",ref:a},...i?{existence:i}:{}};return e.kind!=="entity.add"?[r]:[r,...xl(o,"attributes","attribute",a),...xl(o,"operations","operation",a),...xl(o,"indexes","index",a)]}case"attribute":case"operation":case"index":{const a=n.subject,r=Cd(o),l={attribute:"attributeRef",operation:"operationRef",index:"indexRef"}[a],s=i==="add"?_b(o):Kt(o[l]);return s?[{subject:{kind:a,ref:s,...r?{entityRef:r}:{}},...i?{existence:i}:{}}]:[]}case"association":case"associationEnd":{const a=Kt(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=Kt(o.groupRef);return a?[{subject:{kind:"group",ref:a},...i?{existence:i}:{}}]:[]}}}function kb(e){const n=e,o=e.kind;if(o.startsWith("entity.")){const i=Kt(n.entityRef);return i?{kind:"entity",ref:i}:null}if(o.startsWith("attribute.")||o.startsWith("operation.")||o.startsWith("index.")){const i=Cd(n);return i?{kind:"entity",ref:i}:null}if(o.startsWith("associationEnd.")||o.startsWith("association.")){const i=Kt(n.associationRef);return i?{kind:"association",ref:i}:null}if(o.startsWith("group.")){const i=Kt(n.groupRef);return i?{kind:"group",ref:i}:null}return null}function Eb(e,n){const o=e;return o.entityRef===n||o.containerRef===n}function Nb(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 Rl(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 Ia(e,n){return e.map(o=>({...o,subject:n}))}function Sd(e,n){const o=e.filter(s=>s.ops.some(c=>Eb(c,n))),{attributes:i,operations:a,indexes:r}=Nb(o,n),l=[...Ia(Ln(o,{entityRef:n}),{kind:"entity",ref:n})];for(const s of i)l.push(...Ia(Ln(o,{entityRef:n,attributeRef:s}),{kind:"attribute",ref:s}));for(const s of a)l.push(...Ia(Ln(o,{entityRef:n,operationRef:s}),{kind:"operation",ref:s}));for(const s of r)l.push(...Ia(Ln(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 Al(e){return`${e.kind}:${e.ref}:${e.end??""}`}function wb(e){const n=new Set;for(const o of e)for(const i of o.ops)for(const a of Rl(i))a.existence==="add"&&n.add(Al(a.subject));return n}function Ib(e){const n=new Set,o=new Set,i=new Set,a={entity:n,association:o,group:i};for(const r of e)for(const l of r.ops){const s=kb(l);s&&a[s.kind].add(s.ref)}return{entities:n,associations:o,groups:i}}function vb(e){const{entities:n,associations:o,groups:i}=Ib(e),a=[];for(const r of n)for(const l of Sd(e,r))a.push({...l,subject:{...l.subject,entityRef:r}});for(const r of o){for(const l of Ln(e,{associationRef:r}))a.push({...l,subject:{kind:"association",ref:r}});for(const l of["end1","end2"])for(const s of Ln(e,{associationRef:r,end:l}))a.push({...s,subject:{kind:"associationEnd",ref:r,end:l}})}for(const r of i)for(const l of Ln(e,{groupRef:r}))a.push({...l,subject:{kind:"group",ref:r}});return a}function $l(e){const n=vb(e),o=wb(e),i=new Map;for(const l of n){const s=Al(l.subject),c=i.get(s);(c===void 0||l.seq<c)&&i.set(s,l.seq)}const a=new Map;for(const l of n){let s=a.get(l.seq);s||(s={meta:l,subjects:new Map},a.set(l.seq,s));const c=Al(l.subject);let d=s.subjects.get(c);if(!d){const u=l.removed?"remove":i.get(c)===l.seq&&o.has(c)?"add":"update";d={subject:l.subject,verb:u,fields:[]},s.subjects.set(c,d)}l.removed?d.verb="remove":d.fields.push({field:l.field,value:l.value,...l.oldValue!==void 0?{oldValue:l.oldValue}:{}})}const r=[];for(const[l,s]of a){const c=s.meta;r.push({seq:l,...c.ts!==void 0?{ts:c.ts}:{},...c.origin!==void 0?{origin:c.origin}:{},...c.author!==void 0?{author:c.author}:{},...c.kind!==void 0?{kind:c.kind}:{},...c.restoredFromSeq!==void 0?{restoredFromSeq:c.restoredFromSeq}:{},actions:[...s.subjects.values()]})}return r.sort((l,s)=>s.seq-l.seq)}function xd(e){return`${e.kind}:${e.ref}:${e.end??""}`}function Cb(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 Rl(r)){if(!l.existence||l.inline)continue;const s=l.subject;Sb.has(s.kind)&&!s.entityRef||i.push({seq:a.seq,subject:s,verb:l.existence,fields:[]})}return i}const Sb=new Set(["attribute","operation","index"]);function Tl(e,n){const{fromSeq:o}=n,i=$l(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 p=xd(m.subject);let f=s.get(p);f||(f={subject:m.subject,evs:[]},s.set(p,f)),f.evs.push(m)};for(const m of l)for(const p of m.actions)c({seq:m.seq,subject:p.subject,verb:p.verb,fields:p.fields});for(const m of Cb(e,o,r)){const p=s.get(xd(m.subject));p!=null&&p.evs.some(f=>f.seq===m.seq)||c(m)}const d=[],u=new Set;for(const m of s.values()){m.evs.sort((f,h)=>f.seq-h.seq);const p=m.evs[m.evs.length-1];m.subject.kind==="entity"&&p.verb==="remove"&&u.add(m.subject.ref)}for(const m of s.values()){const p=m.evs[0].verb==="add",f=m.evs[m.evs.length-1].verb==="remove";if(m.subject.kind!=="entity"&&m.subject.entityRef&&u.has(m.subject.entityRef)||p&&f)continue;const h=new Map;let g=null;for(const _ of m.evs){_.verb==="add"&&g!==null&&g!=="add"&&h.clear(),g=_.verb;for(const k of _.fields){const N=h.get(k.field);N?N.lastValue=k.value:h.set(k.field,{firstOld:k.oldValue,hasOld:k.oldValue!==void 0,lastValue:k.value})}}if(f){d.push({subject:m.subject,verb:"removed",fields:[]});continue}if(p){const _=[];for(const[k,N]of h)_.push({field:k,value:N.lastValue});d.push({subject:m.subject,verb:"added",fields:_});continue}const b=[];for(const[_,k]of h)k.hasOld&&lo(k.firstOld,k.lastValue)||b.push({field:_,value:k.lastValue,...k.hasOld?{oldValue:k.firstOld}:{}});b.length!==0&&d.push({subject:m.subject,verb:"modified",fields:b})}return{fromSeq:o,toSeq:r,entries:d}}function Rd(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 Ml{constructor(n){ct(this,"undoStack",[]);ct(this,"redoStack",[]);ct(this,"savePoint",null);ct(this,"listeners",new Set);ct(this,"commandListeners",new Set);ct(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 Dt(e){const n={};for(const[o,i]of Object.entries(e))n[o]=i===void 0?null:i;return n}function Ad(e,n){return e.logical.entities.findIndex(o=>o.modelId===n)}function Nt(e,n){return e.layout.entityLayouts.findIndex(o=>o.entityRef===n)}function Gt(e,n){return e.layout.associationLayouts.find(o=>o.associationRef===n)}function ut(e,n){const o=e.logical.entities.find(i=>i.modelId===n);if(!o)throw new Error(`엔티티 없음: ${n}`);return o}function En(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 va(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=Ad(i,e.modelId);a>=0&&i.logical.entities.splice(a,1);const r=Nt(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 $d(e){let n=null;const o=i=>i.end1.entityRef===e||i.end2.entityRef===e;return{label:"엔티티 삭제",apply(i){const a=Ad(i,e);if(a<0)throw new Error(`엔티티 없음: ${e}`);const r=Nt(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(p=>p.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 Vl(e,n){const o={};return{label:"엔티티 수정",apply(i){const a=ut(i,e);for(const r of Object.keys(n))o[r]=a[r];Object.assign(a,n)},invert(i){Object.assign(ut(i,e),o)},emitOps(){return{forward:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:Dt(n)}],invert:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:Dt(o)}]}}}}function Td(e,n){let o="";return{label:`엔티티 이름 변경: ${n}`,apply(i){const a=ut(i,e);o=a.name,a.name=n},invert(i){ut(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 Uo(e,n){let o=null;return{label:"엔티티 이동",apply(i){const a=Nt(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=Nt(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 Md(e,n){let o=null;return{label:"엔티티 크기 변경",apply(i){const a=Nt(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=Nt(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 _i(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 Vd(e,n){let o;return{label:"엔티티 색상 변경",apply(i){const a=Nt(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.style,r.style=_i(r.style,n)},invert(i){const a=Nt(i,e);a>=0&&(i.layout.entityLayouts[a].style=o)},emitOps(i){const a=Nt(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 Bd(e,n){let o;return{label:n?"엔티티 접기":"엔티티 펼치기",apply(i){const a=Nt(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=Nt(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 Dd(e,n){let o;return{label:n?"엔티티 잠금":"엔티티 잠금 해제",apply(i){const a=Nt(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=Nt(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 Bl(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 Ca(e,n,o){let i;return{label:"속성 색상 변경",apply(a){const r=Nt(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.attributeStyles;const s={...l.attributeStyles},c=_i(s[n],o);c?s[n]=c:delete s[n],l.attributeStyles=Object.keys(s).length?s:void 0},invert(a){const r=Nt(a,e);r>=0&&(a.layout.entityLayouts[r].attributeStyles=i)},emitOps(a){const r=Nt(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 Sa(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 Od(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:Dt(n)}],invert:[{kind:"group.update",casUnit:"logical",containerRef:e,groupRef:e,patch:Dt(o)}]}}}}function Ld(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 Pd(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 xa(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 zd(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 Fd(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 Ud(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=_i(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 Hd(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 Yt(e,n){return{label:`속성 추가: ${n.name}`,apply(o){ut(o,e).attributes.push(n)},invert(o){const i=ut(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 qt(e,n,o){const i={},a=r=>{const l=ut(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:Dt(o)}],invert:[{kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:n,patch:Dt(i)}]}}}}function jd(e,n){let o=null;return{label:"속성 삭제",apply(i){const a=ut(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&&ut(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 Kd(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 Dl(e,n,o){let i=null;return{label:"속성 재정렬",apply(a){const r=ut(a,e);i=r.attributes.map(s=>({...s}));const l=Il([...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&&ut(a,e).attributes.splice(0,1/0,...i)},emitOps(a){const r=ut(a,e).attributes;return Kd("attribute.update","attributeRef",e,r,i??[])}}}function Gd(e,n){let o=!1;return{label:`메서드 추가: ${n.name}`,apply(i){const a=ut(i,e);a.operations||(a.operations=[],o=!0),a.operations.push(n)},invert(i){var l;const a=ut(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 Yd(e,n,o){const i={},a=r=>{var s;const l=(s=ut(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:Dt(o)}],invert:[{kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:n,patch:Dt(i)}]}}}}function qd(e,n){let o=null;return{label:"메서드 삭제",apply(i){var s;const a=ut(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=ut(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 Wd(e,n,o){let i=null;return{label:"메서드 재정렬",apply(a){const r=ut(a,e),l=r.operations??[];i=l.map(c=>({...c}));const s=Il([...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=ut(a,e);r.operations&&r.operations.splice(0,1/0,...i)},emitOps(a){const r=ut(a,e).operations??[];return Kd("operation.update","operationRef",e,r,i??[])}}}function Jd(e,n,o){let i;return{label:"메서드 색상 변경",apply(a){const r=Nt(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.operationStyles;const s={...l.operationStyles},c=_i(s[n],o);c?s[n]=c:delete s[n],l.operationStyles=Object.keys(s).length?s:void 0},invert(a){const r=Nt(a,e);r>=0&&(a.layout.entityLayouts[r].operationStyles=i)},emitOps(a){const r=Nt(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 Ra(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 Xd(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 Aa(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:Dt(n)}],invert:[{kind:"association.update",casUnit:"logical",containerRef:e,associationRef:e,patch:Dt(o)}]}}}}function Wt(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:Dt(o)}],invert:[{kind:"associationEnd.update",casUnit:"logical",containerRef:e,associationRef:e,end:n,patch:Dt(i)}]}}}}function Zd(e,n){return{label:"인덱스 추가",apply(o){const i=ut(o,e);(i.indexes??(i.indexes=[])).push(n)},invert(o){var r;const i=ut(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 $a(e,n,o){const i={},a=r=>{var s;const l=(s=ut(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:Dt(o)}],invert:[{kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:n,patch:Dt(i)}]}}}}function Qd(e,n){let o=null;return{label:"인덱스 삭제",apply(i){var l;const a=ut(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&&ut(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 ln=(e,n)=>({kind:"associationLayout.setWaypoints",casUnit:"layout",associationRef:e,value:{waypoints:n}}),ki=(e,n)=>{var o;return((o=Gt(e,n))==null?void 0:o.waypoints.map(i=>({...i})))??[]};function eu(e,n,o){let i=null;return{label:"waypoint 이동",coalesceKey:`waypoint:${e}`,apply(a){const r=Gt(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=Gt(a,e);r&&i&&r.waypoints.splice(n,1,i)},emitOps(a){const r=ki(a,e),l=r.map((s,c)=>c===n&&i?{...i}:s);return{forward:[ln(e,r)],invert:[ln(e,l)]}}}}function tu(e,n){let o=null;return{label:"waypoint 제거",apply(i){const a=Gt(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=Gt(i,e);a&&o&&a.waypoints.splice(n,0,o)},emitOps(i){const a=ki(i,e),r=a.slice();return o&&r.splice(n,0,{...o}),{forward:[ln(e,a)],invert:[ln(e,r)]}}}}function nu(e,n,o){let i=null;return{label:"waypoint 평행이동",apply(a){const r=Gt(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=Gt(a,e);r&&i&&(r.waypoints=i)},emitOps(a){return{forward:[ln(e,ki(a,e))],invert:[ln(e,i??[])]}}}}function ou(e){let n=null;return{label:"꺾은선 풀기",apply(o){const i=Gt(o,e);if(!i)throw new Error(`관계 레이아웃 없음: ${e}`);n=i.waypoints.map(a=>({...a})),i.waypoints=[]},invert(o){const i=Gt(o,e);i&&n&&(i.waypoints=n)},emitOps(o){return{forward:[ln(e,ki(o,e))],invert:[ln(e,n??[])]}}}}function iu(e,n,o){return{label:"waypoint 추가",apply(i){const a=Gt(i,e);if(!a)throw new Error(`관계 레이아웃 없음: ${e}`);a.waypoints.splice(n,0,{...o})},invert(i){const a=Gt(i,e);a==null||a.waypoints.splice(n,1)},emitOps(i){const a=ki(i,e),r=a.slice();return r.splice(n,1),{forward:[ln(e,a)],invert:[ln(e,r)]}}}}function au(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 ru(e){let n=null;return{label:"노트 삭제",apply(o){const i=o.layout.notes.findIndex(a=>a.modelId===e);if(i<0)throw new Error(`노트 없음: ${e}`);n={item:o.layout.notes[i],index:i},o.layout.notes.splice(i,1)},invert(o){n&&o.layout.notes.splice(n.index,0,n.item)},emitOps(){return n?{forward:[{kind:"note.remove",casUnit:"layout",noteRef:e}],invert:[{kind:"note.add",casUnit:"layout",noteRef:e,value:n.item}]}:{forward:[],invert:[]}}}}function Ei(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 lu(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 su(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 cu(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=_i(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 du(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 uu(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 Pn=(e,n,o)=>({kind:"noteConnection.setWaypoints",casUnit:"layout",noteRef:e,targetRef:n,value:{waypoints:o}}),Ta=(e,n,o)=>{var i;return((i=En(e,n,o))==null?void 0:i.waypoints.map(a=>({...a})))??[]};function mu(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 fu(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 pu(e,n,o,i){let a=null;return{label:"waypoint 이동",coalesceKey:`noteConnWaypoint:${e}:${n}`,apply(r){const l=En(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=En(r,e,n);l&&a&&l.waypoints.splice(o,1,a)},emitOps(r){const l=Ta(r,e,n),s=l.map((c,d)=>d===o&&a?{...a}:c);return{forward:[Pn(e,n,l)],invert:[Pn(e,n,s)]}}}}function hu(e,n,o,i){return{label:"waypoint 추가",apply(a){const r=En(a,e,n);if(!r)throw new Error(`노트 연결 없음: ${e}→${n}`);r.waypoints.splice(o,0,{...i})},invert(a){const r=En(a,e,n);r==null||r.waypoints.splice(o,1)},emitOps(a){const r=Ta(a,e,n),l=r.slice();return l.splice(o,1),{forward:[Pn(e,n,r)],invert:[Pn(e,n,l)]}}}}function yu(e,n,o){let i=null;return{label:"waypoint 제거",apply(a){const r=En(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=En(a,e,n);r&&i&&r.waypoints.splice(o,0,i)},emitOps(a){const r=Ta(a,e,n),l=r.slice();return i&&l.splice(o,0,{...i}),{forward:[Pn(e,n,r)],invert:[Pn(e,n,l)]}}}}function gu(e,n){let o=null;return{label:"꺾은선 풀기",apply(i){const a=En(i,e,n);if(!a)throw new Error(`노트 연결 없음: ${e}→${n}`);o=a.waypoints.map(r=>({...r})),a.waypoints=[]},invert(i){const a=En(i,e,n);a&&o&&(a.waypoints=o)},emitOps(i){return{forward:[Pn(e,n,Ta(i,e,n))],invert:[Pn(e,n,o??[])]}}}}function at(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 xb=Object.freeze(Object.defineProperty({__proto__:null,addAssociation:Ra,addAttribute:Yt,addEntity:va,addEntityToGroup:Pd,addGroup:Sa,addIndex:Zd,addNote:au,addNoteConnection:mu,addNoteConnectionWaypoint:hu,addNoteToGroup:du,addOperation:Gd,addWaypoint:iu,clearNoteConnectionWaypoints:gu,clearWaypoints:ou,composite:at,moveEntity:Uo,moveGroup:zd,moveNote:Ei,moveNoteConnectionWaypoint:pu,moveWaypoint:eu,removeAssociation:Xd,removeAttribute:jd,removeEntity:$d,removeEntityFromGroup:xa,removeGroup:Ld,removeIndex:Qd,removeNote:ru,removeNoteConnection:fu,removeNoteConnectionWaypoint:yu,removeNoteFromGroup:uu,removeOperation:qd,removeWaypoint:tu,renameEntity:Td,reorderAttributes:Dl,reorderOperations:Wd,resizeEntity:Md,resizeGroup:Fd,resizeNote:lu,setAllEntitiesCollapsed:Bl,setAttributeSwatch:Ca,setEntityCollapsed:Bd,setEntityLocked:Dd,setEntitySwatch:Vd,setGroupLocked:Hd,setGroupSwatch:Ud,setNoteMemo:su,setNoteSwatch:cu,setOperationSwatch:Jd,translateWaypoints:nu,updateAssociation:Aa,updateAssociationEnd:Wt,updateAttribute:qt,updateEntity:Vl,updateGroup:Od,updateIndex:$a,updateOperation:Yd},Symbol.toStringTag,{value:"Module"}));class bu{constructor(){ct(this,"revs",new Map);ct(this,"layoutVersion",0);ct(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 Rb=[400,1200];function Ab(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 $b(e){const n=Ab(e);return n==null||n===408||n===429?!0:n<400||n>=500}const Tb=e=>new Promise(n=>setTimeout(n,e));class _u{constructor(n){ct(this,"cache",new bu);ct(this,"newClientOpId");ct(this,"debounceMs");ct(this,"retryDelaysMs");ct(this,"emissions",new WeakMap);ct(this,"open",null);ct(this,"debounceHandle",null);ct(this,"queue",[]);ct(this,"sending",!1);ct(this,"_frozen",!1);ct(this,"stack",null);ct(this,"settledWaiters",[]);this.opts=n,this.newClientOpId=n.newClientOpId??Pe,this.debounceMs=n.debounceMs??300,this.retryDelaysMs=n.retryDelaysMs??Rb}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||!$b(l)){this.sending=!1,console.error("[op-sync] 전송 실패 확정 → 하드 프리즈(kind:missing)"),this.freeze({kind:"missing"});return}await Tb(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 ku=["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"],Eu=["NORMAL","RELATION_OWN","RELATION_REF","EMBED_OWN","EMBED_REF","EMBED_PREDEF","DIVIDER"];function Nu(e,n){var r;if(!n.length||!((r=e.indexes)!=null&&r.length))return[];const o=new Set(n),i=new Set;for(const l of e.attributes)if(o.has(l.modelId)){i.add(l.modelId);for(const s of l.dbAttrs)i.add(s.modelId)}if(!i.size)return[];const a=[];for(const l of e.indexes){const s=l.columns.filter(c=>!i.has(c.columnRef));s.length!==l.columns.length&&a.push({indexRef:l.modelId,columns:s})}return a}function Mb(e){return gn(e).length}function Ol(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 Vb(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=di(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 wu(e,n,o=Pe){const i=e.entities.find(c=>c.modelId===n);if(!i)return[];const a=Mb(i);if(a===0)return[];const r=Ol(e,n),l=gn(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;Vb(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 Iu(e,n,o){var p;const i=e.entities.find(f=>f.modelId===n);if(!i)return[];const a=i.attributes;if(o.length!==a.length)return[];const r=new Map(a.map(f=>[f.modelId,f])),l=[];for(const f of o){const h=r.get(f);if(!h)return[];l.push(h)}const s=a.flatMap(f=>f.dbAttrs).map(f=>f.modelId),c=l.flatMap(f=>f.dbAttrs).map(f=>f.modelId);if(s.length!==c.length)return[];if(s.every((f,h)=>f===c[h]))return[];const d=new Map(s.map((f,h)=>[f,h])),u=Ol(e,n),m=[];for(const f of e.entities)for(const h of f.attributes){if(h.attrType!=="EMBED_OWN"||((p=h.embedded)==null?void 0:p.embeddableRef)!==n||u.has(h.embedded.associationRef)||h.dbAttrs.length!==s.length)continue;const g=c.map(_=>h.dbAttrs[d.get(_)]),b=g.reduce((_,k,N)=>k===h.dbAttrs[N]?_:_+1,0);b&&m.push({entityId:f.modelId,attributeId:h.modelId,dbAttrs:g,moved:b})}return m}function vu(e,n,o){var p;const i=e.entities.find(f=>f.modelId===n);if(!i)return[];const a=new Set(o),r=i.attributes.filter(f=>!a.has(f.modelId));if(r.length===i.attributes.length)return[];const l=gn(i).map(f=>f.col),s=l.map(f=>f.modelId),c=new Set(gn({...i,attributes:r}).map(f=>f.col.modelId)),d=new Set;if(s.forEach((f,h)=>{c.has(f)&&d.add(h)}),d.size===s.length)return[];const u=Ol(e,n),m=[];for(const f of e.entities)for(const h of f.attributes){if(h.attrType!=="EMBED_OWN"||((p=h.embedded)==null?void 0:p.embeddableRef)!==n||u.has(h.embedded.associationRef)||h.dbAttrs.length!==s.length)continue;const g=h.dbAttrs.filter((k,N)=>d.has(N)),b=h.dbAttrs.filter((k,N)=>!d.has(N));h.dbAttrs.some((k,N)=>{if(d.has(N))return!1;const y=l[N],E=!!k.physicalName&&k.physicalName!==((y==null?void 0:y.physicalName)??""),S=k.sharedColumnRef!=null&&k.sharedColumnRef!==(y==null?void 0:y.sharedColumnRef);return E||S})||m.push({entityId:f.modelId,attributeId:h.modelId,dbAttrs:g,dropped:b})}return m}function Bb(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 Db(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 Cu(e,n,o){return e.associations.filter(i=>{const a=[i.end1.entityRef,i.end2.entityRef];return a.includes(n)&&a.includes(o)})}function St(e,n){const o=Bb(e,n);return o.length===1?{ok:!0,value:o[0]}:{ok:!1,reason:o.length===0?"not-found":"ambiguous",matches:o.map(i=>Pb(i,e))}}function Ob(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 Ll(e,n){const o=Ob(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 Pl(e,n,o){return e.reason==="not-found"?{code:"group-not-found",opIndex:n,handle:o}:{code:"group-ambiguous",opIndex:n,handle:o,matches:e.matches}}const Lb=new Set(["name","description","packageName","excludeDDLGeneration"]);function Pb(e,n){var a;const o=Mo(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(p=>p.modelId===l);return(s==null?void 0:s.name)||((m=s==null?void 0:s.table)==null?void 0:m.physicalName)||String(l??"?")}))]}}function Su(e,n){const o=Db(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 zb(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 Fb(e,n){const o=zb(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 xu(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 zl(e){return e.by!==void 0&&e.by!=="name"}function Ub(e,n){return(e.indexes??[]).filter(o=>o.name===n.ref)}function Hb(e,n){return(e.operations??[]).filter(o=>o.name===n.ref)}function jb(e,n){const o=Ub(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 Ru(e,n){const o=Hb(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 Au(e){return e.physicalName!=null||e.dataType!=null||e.length!=null||e.scale!=null||e.columnLogicalName!=null||e.unique!=null||e.updatable!=null}function $u(e){return Au(e)&&e.dataType==null}function Tu(e,n,o){const i=Au(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}:{},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 Mu(e,n,o,i,a,r,l,s,c){const d=c(),u=new Map((e.embeddableOverrides??[]).map(f=>[f.field,f])),m=[];let p=!1;for(const f of n.fields){const h=u.get(f.name);if(h!=null&&h.sharedColumnPhysicalName){const g={ref:h.sharedColumnPhysicalName,by:"physicalName"},b=xu(Dn(i,a),g);if(!b.ok){s.push(b.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:r,entity:l,handle:g}:{code:"shared-column-target-ambiguous",opIndex:r,entity:l,handle:g,matches:b.matches}),p=!0;continue}m.push({modelId:c(),physicalName:"",dataType:"",sharedColumnRef:b.value.modelId});continue}m.push({modelId:c(),physicalName:(h==null?void 0:h.physicalName)??"",dataType:"",...h!=null&&h.length?{length:h.length}:{},...h!=null&&h.scale?{scale:h.scale}:{},...(h==null?void 0:h.insertable)!=null?{insertable:h.insertable}:{},...(h==null?void 0:h.updatable)!=null?{updatable:h.updatable}:{}})}return p?null:{modelId:d,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:m}}const Kb=new Set(["name","type","customType","attrType","identifier","notNull","transient","naturalId","naturalIdMutable","description","attributeGroup","groupCode","defaultValue","personalInfoAttributeType","order","dbAttrs","derivedIdFieldName"]),Ho=e=>new Set(Object.keys(e)),Gb=Ho({name:!0,stereotype:!0,physicalName:!0,useVersion:!0,attributes:!0,indexes:!0,operations:!0,serialization:!0}),Vu=Ho({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}),Bu=Ho({name:!0,unique:!0,columns:!0,description:!0,parameters:!0}),Du=Ho({name:!0,visibility:!0,sourceCode:!0,description:!0,personalInfoAttributeType:!0}),Yb=Ho({from:!0,to:!0,fromMultiplicity:!0,toMultiplicity:!0,identifying:!0,composition:!0}),qb=Ho({name:!0,packageName:!0,description:!0,excludeDDLGeneration:!0,members:!0});function Nn(e,n){return mo(e,n)}const Wb=new Set(["name","stereotype","packageName","superClass","schema","description","abstractClass","hasPersonalInfo","declarationOfInterfaces","table","referenceOnly","serialization"]),Jb=new Set(["description","identifying"]),Xb=new Set(["multiplicity","navigable","composition"]),Zb=new Set(["name","unique","description","parameters"]),Qb=new Set(["name","visibility","sourceCode","description","order","personalInfoAttributeType"]);function mo(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 Fl=new Set(["physicalName","logicalName","dataType","length","scale","unique","autoIncrement","updatable","insertable","sharedColumnRef","multiValue","multiValueSeparator","sequenceName"]),e_=new Set([...Fl].filter(e=>e!=="sharedColumnRef"));function t_(e,n,o,i){if(i||o.some(l=>!e_.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))Fl.has(l)||(r[l]=s);return{...r,dbAttrs:[a]}}function n_(e,n,o,i,a,r,l,s){const c=new Map(o.map(m=>[m.field,m])),d=[];let u=!1;return e.dbAttrs.forEach((m,p)=>{const f=n.fields[p],h=f?c.get(f.name):void 0;if(!h){d.push(m);return}if(h.sharedColumnPhysicalName){const b={ref:h.sharedColumnPhysicalName,by:"physicalName"},_=xu(Dn(i,a),b);if(!_.ok){s.push(_.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:_.matches}),u=!0;return}d.push({modelId:m.modelId,physicalName:"",dataType:"",sharedColumnRef:_.value.modelId});return}const g={...m};delete g.sharedColumnRef,d.push({...g,...h.physicalName!=null?{physicalName:h.physicalName}:{},...h.length!=null?{length:h.length}:{},...h.scale!=null?{scale:h.scale}:{},...h.insertable!=null?{insertable:h.insertable}:{},...h.updatable!=null?{updatable:h.updatable}:{}})}),u?null:d}function Ou(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 Lu(e,n,o,i,a,r){const l=[];let s=!1;for(const c of n.columns){const d=Fb(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 jo(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 o_(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 Nu(s,l))e.push({kind:"index.update",casUnit:"logical",containerRef:r,entityRef:r,indexRef:c.indexRef,patch:{columns:c.columns}})}}function i_(e,n,o,i,a,r){const l=m=>{const p=new Map;for(const{entityId:f,item:h}of m){if(a.has(f))continue;const g=p.get(f)??[];g.push(h),p.set(f,g)}return p},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,p]of s)if(!c.has(m))for(const f of vu(n,m,p))u(f);for(const[m,p]of c){if(s.has(m))continue;const f={...n,entities:n.entities.map(h=>h.modelId===m?{...h,attributes:[...h.attributes,...p]}:h)};for(const h of wu(f,m,r))u(h)}}function Pu(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 zu(e,n,o,i,a,r,l){var p;for(const f of i.remove)jo(e,r,o,f);for(const f of i.update)e.push({kind:"attribute.update",casUnit:"logical",containerRef:o,entityRef:o,attributeRef:f.attributeId,patch:f.patch}),a.attrPatches.push({entityId:o,attributeId:f.attributeId,patch:f.patch});const s=((p=n.entities.find(f=>f.modelId===o))==null?void 0:p.attributes)??[],c=[];for(const f of i.add){const h={...f,order:l(o,s)};e.push({kind:"attribute.add",casUnit:"logical",containerRef:o,entityRef:o,value:h}),a.cascadeAdds.push({entityId:o,attribute:h}),c.push(h)}const d=new Set(i.remove),u=[...s.filter(f=>!d.has(f.modelId)),...c],m=new Set(u.map(f=>f.modelId));for(const f of n.associations){if(f.end2.entityRef!==o)continue;const h=f.end2.attributeRef;if(h&&m.has(h))continue;const b=u.filter(_=>{var k;return((k=_.derivedFrom)==null?void 0:k.associationRef)===f.modelId&&_.dbAttrs.length>0}).sort((_,k)=>_.order-k.order)[0];b&&(e.push({kind:"associationEnd.update",casUnit:"logical",containerRef:f.modelId,associationRef:f.modelId,end:"end2",patch:{attributeRef:b.modelId}}),a.endPatches.push({associationRef:f.modelId,end:"end2",patch:{attributeRef:b.modelId}}))}}function Ul(e,n,o,i,a,r,l){for(const{entityId:s,plan:c}of nd(n,o,i))zu(e,n,s,c,a,r,l)}function a_(e,n,o,i,a,r){const l=new Map;for(const{entityId:p,attributeId:f}of i.pairs)l.has(p)||l.set(p,new Set),l.get(p).add(f);const s=new Map;for(const p of r.attrPatches)s.has(p.entityId)||s.set(p.entityId,[]),s.get(p.entityId).push(p);const c=new Map;for(const{entityId:p,attribute:f}of[...a,...r.cascadeAdds])c.has(p)||c.set(p,[]),c.get(p).push(f);const d=p=>{const f={};for(const[h,g]of Object.entries(p))h.includes(".")||(f[h]=g===null?void 0:g);return f},u=e.entities.filter(p=>!n.has(p.modelId)).map(p=>{const f=l.get(p.modelId),h=s.get(p.modelId),g=c.get(p.modelId);if(!f&&!h&&!g)return p;let b=p.attributes;return f&&(b=b.filter(_=>!f.has(_.modelId))),h&&(b=b.map(_=>{const k=h.filter(N=>N.attributeId===_.modelId);return k.length?k.reduce((N,y)=>Pu(N,y.patch),_):_})),g&&(b=[...b,...g]),{...p,attributes:b}}),m=e.associations.filter(p=>!o.has(p.modelId)&&!n.has(p.end1.entityRef)&&!n.has(p.end2.entityRef)).map(p=>{let f=p;for(const h of r.assocPatches)h.associationRef===p.modelId&&(f={...f,...d(h.patch)});for(const h of r.endPatches)h.associationRef===p.modelId&&(f={...f,[h.end]:{...f[h.end],...d(h.patch)}});return f}).concat(r.addedAssociations);return{...e,entities:u,associations:m}}function r_(e,n,o,i,a,r,l,s,c){if(!l.identifierCascadeParents.size)return;const d=a_(n,o,i,a,r,l),u=new Map;for(const m of l.identifierCascadeParents)for(const[p,f]of cl(d,m,s)){const h=u.get(p);u.set(p,h?sl(h,f):f)}for(const[m,p]of u)zu(e,d,m,td(p),l,a,c)}function l_(e,n,o={}){const i=o.mkId??Pe,a=o.embeddableCatalog??[],r=y=>a.find(E=>E.type===y),l=[],s=[],c=new Map,d=(y,E)=>{const S=c.get(y)??jt(E);return c.set(y,S+1),S},u=new Map,m=new Set,p=new Set,f={seen:new Set,pairs:[]},h=[],g={attrPatches:[],cascadeAdds:[],addedAssociations:[],assocPatches:[],endPatches:[],identifierCascadeParents:new Set},b=new Set,_=(y,E)=>`${y}\0${E}`,k=new Set;for(const y of n)y.kind==="entity.add"&&(k.add(y.spec.name),y.spec.physicalName&&k.add(y.spec.physicalName));const N=new Set;return n.forEach((y,E)=>{var S,A,V,$,O;switch(y.kind){case"entity.add":{{const M={ref:y.spec.name},x=Nn(y.spec,Gb);if(x.length){s.push({code:"entity-spec-unknown-key",opIndex:E,handle:M,keys:x});break}let P=!1;for(const Y of y.spec.attributes??[]){const se=Nn(Y,Vu);se.length&&(s.push({code:"attribute-spec-unknown-key",opIndex:E,entity:M,handle:{ref:Y.name},keys:se}),P=!0)}for(const Y of y.spec.indexes??[]){const se=Nn(Y,Bu);se.length&&(s.push({code:"index-spec-unknown-key",opIndex:E,entity:M,handle:{ref:Y.name},keys:se}),P=!0)}for(const Y of y.spec.operations??[]){const se=Nn(Y,Du);se.length&&(s.push({code:"operation-spec-unknown-key",opIndex:E,entity:M,handle:{ref:Y.name},keys:se}),P=!0)}if(P)break}const C=e.entities.filter(M=>M.name===y.spec.name).map(M=>M.modelId);if(C.length||N.has(y.spec.name)){s.push({code:"entity-name-conflict",opIndex:E,handle:{ref:y.spec.name},matches:C});break}N.add(y.spec.name);const R=i(),T={modelId:R,name:y.spec.name,stereotype:y.spec.stereotype??"JPA_ENTITY",attributes:[],...y.spec.useVersion?{jpaAttrs:{useVersion:!0}}:{},...y.spec.physicalName?{table:{physicalName:y.spec.physicalName}}:{},...y.spec.serialization?{serialization:y.spec.serialization}:{}},w={ref:y.spec.name};let I=!1;for(const[M,x]of(y.spec.attributes??[]).entries()){if(x.type==="GroupCodeEnum"&&!x.groupCode){s.push({code:"groupcode-required",opIndex:E,entity:w,handle:{ref:x.name}}),I=!0;continue}if(!r(x.type)&&!((S=x.embeddableOverrides)!=null&&S.length)&&$u(x)){s.push({code:"datatype-required",opIndex:E,entity:w,handle:{ref:x.name}}),I=!0;continue}const P=r(x.type);if(P){const Y=Mu(x,P,M,T,e.entities,E,w,s,i);Y?T.attributes.push(Y):I=!0}else(A=x.embeddableOverrides)!=null&&A.length?(s.push({code:"embeddable-type-unresolved",opIndex:E,entity:w,handle:{ref:x.name}}),I=!0):T.attributes.push(Tu(x,M,i))}const v=(y.spec.operations??[]).map((M,x)=>Ou(M,x,i));v.length&&(T.operations=v);const B=[];for(const M of y.spec.indexes??[]){const x=Lu(T,M,E,w,s,i);x?B.push(x):I=!0}if(B.length&&(T.indexes=B),I)break;l.push({kind:"entity.add",casUnit:"logical",entityRef:R,value:T});break}case"entity.update":{const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}const R=mo(y.patch,Wb,["jpaAttrs.","table.","serialization."]);if(R.length){s.push({code:"entity-patch-unknown-key",opIndex:E,entity:y.entity,keys:R});break}const T=y.patch.stereotype;if(typeof T=="string"&&T!==C.value.stereotype){const w=T==="JPA_EMBEDDABLE"||C.value.stereotype==="JPA_EMBEDDABLE",I=T==="SERIALIZED_TYPE"||C.value.stereotype==="SERIALIZED_TYPE";if(w||I){s.push({code:w?"stereotype-embeddable-transition-unsupported":"stereotype-serialized-transition-unsupported",opIndex:E,entity:y.entity,from:C.value.stereotype??"",to:T});break}}l.push({kind:"entity.update",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,patch:y.patch});break}case"entity.remove":{const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}const R=C.value.modelId,T=e.associations.filter(B=>B.end1.entityRef===R||B.end2.entityRef===R),w=new Set(T.map(B=>B.modelId));for(const B of T)m.has(B.modelId)||(m.add(B.modelId),l.push({kind:"association.remove",casUnit:"logical",associationRef:B.modelId}));for(const B of e.entities)if(B.modelId!==R)for(const M of B.attributes)M.embedded&&w.has(M.embedded.associationRef)&&jo(l,f,B.modelId,M.modelId);for(const B of T){if(B.end1.entityRef===R||!B.end1.attributeRef)continue;const M=e.entities.find(P=>P.modelId===B.end1.entityRef),x=M==null?void 0:M.attributes.find(P=>P.modelId===B.end1.attributeRef&&P.attrType==="RELATION_REF");x&&jo(l,f,M.modelId,x.modelId)}const I={...e,entities:e.entities.filter(B=>B.modelId!==R),associations:e.associations.filter(B=>!w.has(B.modelId))},v=new Set(T.filter(B=>B.end1.entityRef===R&&B.end2.entityRef!==R).map(B=>B.end2.entityRef));Ul(l,I,[...v],i,g,f,d);for(const B of e.groups)B.memberEntityRefs.includes(R)&&(b.has(_(B.modelId,R))||(b.add(_(B.modelId,R)),l.push({kind:"group.removeMember",casUnit:"logical",containerRef:B.modelId,groupRef:B.modelId,entityRef:R})));p.add(R),l.push({kind:"entity.remove",casUnit:"logical",entityRef:R});break}case"attribute.add":{{const I=Nn(y.spec,Vu);if(I.length){s.push({code:"attribute-spec-unknown-key",opIndex:E,entity:y.entity,handle:{ref:y.spec.name},keys:I});break}}const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}if(y.spec.type==="GroupCodeEnum"&&!y.spec.groupCode){s.push({code:"groupcode-required",opIndex:E,entity:y.entity,handle:{ref:y.spec.name}});break}if(!r(y.spec.type)&&!((V=y.spec.embeddableOverrides)!=null&&V.length)&&$u(y.spec)){s.push({code:"datatype-required",opIndex:E,entity:y.entity,handle:{ref:y.spec.name}});break}const R=d(C.value.modelId,C.value.attributes),T=r(y.spec.type);let w;if(T)w=Mu(y.spec,T,R,C.value,e.entities,E,y.entity,s,i);else if(($=y.spec.embeddableOverrides)!=null&&$.length){s.push({code:"embeddable-type-unresolved",opIndex:E,entity:y.entity,handle:{ref:y.spec.name}});break}else w=Tu(y.spec,R,i);if(!w)break;l.push({kind:"attribute.add",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,value:w}),h.push({entityId:C.value.modelId,attribute:w}),w.identifier&&g.identifierCascadeParents.add(C.value.modelId);break}case"attribute.update":case"attribute.remove":{const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}const R=Su(C.value,y.attribute);if(!R.ok){s.push(R.reason==="not-found"?{code:"attribute-not-found",opIndex:E,entity:y.entity,handle:y.attribute}:{code:"attribute-ambiguous",opIndex:E,entity:y.entity,handle:y.attribute,matches:R.matches});break}if(y.kind==="attribute.update"){const T=[],w=[];let I=!1;for(const x of Object.keys(y.patch)){if(x.includes(".")){x.startsWith("dbAttrs.")?I=!0:w.push(x);continue}Fl.has(x)?T.push(x):Kb.has(x)||w.push(x)}if(w.length){s.push({code:"attribute-patch-unknown-key",opIndex:E,entity:y.entity,handle:y.attribute,keys:w});break}if("attrType"in y.patch){const x=String(y.patch.attrType),P=Eu.includes(x)?x!==R.value.attrType?"transition":void 0:"unknown-value";if(P){s.push({code:"attribute-attrtype-unsupported",opIndex:E,entity:y.entity,handle:y.attribute,reason:P,current:R.value.attrType,requested:x});break}}const v="type"in y.patch?y.patch.type:R.value.type,B="groupCode"in y.patch?y.patch.groupCode:R.value.groupCode;if(v==="GroupCodeEnum"&&!B){s.push({code:"groupcode-required",opIndex:E,entity:y.entity,handle:y.attribute});break}let M=y.patch;if(T.length){const x=t_(R.value,y.patch,T,I);if(!x){s.push({code:"attribute-patch-dbattr-flat-key",opIndex:E,entity:y.entity,handle:y.attribute,keys:T});break}M=x}if((O=y.embeddableOverrides)!=null&&O.length){const x=r(R.value.type);if(!x||R.value.attrType!=="EMBED_PREDEF"){s.push({code:"embeddable-type-unresolved",opIndex:E,entity:y.entity,handle:y.attribute});break}const P=n_(R.value,x,y.embeddableOverrides,C.value,e.entities,E,y.entity,s);if(!P)break;M={...M,dbAttrs:P}}l.push({kind:"attribute.update",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,attributeRef:R.value.modelId,patch:M}),g.attrPatches.push({entityId:C.value.modelId,attributeId:R.value.modelId,patch:M});{const x=R.value,P=Pu(x,M),Y=(P.identifier??!1)!==(x.identifier??!1),se=(x.identifier||P.identifier)&&("type"in M||"customType"in M||"dbAttrs"in M||Object.keys(M).some(he=>he.startsWith("dbAttrs.")));(Y||se)&&g.identifierCascadeParents.add(C.value.modelId)}}else{const T=Po(e,C.value.modelId,R.value.modelId);if(T){const w=I=>{var v;return((v=e.entities.find(B=>B.modelId===I))==null?void 0:v.name)??I};s.push({code:"attribute-fk-managed",opIndex:E,entity:y.entity,handle:y.attribute,association:{from:w(T.end1.entityRef),to:w(T.end2.entityRef)}});break}jo(l,f,C.value.modelId,R.value.modelId),R.value.identifier&&g.identifierCascadeParents.add(C.value.modelId)}break}case"association.add":{{const B=Nn(y.spec,Yb);if(B.length){s.push({code:"association-spec-unknown-key",opIndex:E,handle:{from:y.spec.from,to:y.spec.to},keys:B});break}}const C=St(e,y.spec.from),R=St(e,y.spec.to);if(C.ok||s.push(xt(C.reason,E,y.spec.from,C.matches,k)),R.ok||s.push(xt(R.reason,E,y.spec.to,R.matches,k)),!C.ok||!R.ok)break;if(y.spec.identifying&&C.value.modelId===R.value.modelId){s.push({code:"self-identifying",opIndex:E,handle:{from:y.spec.from,to:y.spec.to}});break}if(C.value.stereotype==="JPA_EMBEDDABLE"||R.value.stereotype==="JPA_EMBEDDABLE"){s.push({code:"embeddable-relation-unsupported",opIndex:E,handle:{from:y.spec.from,to:y.spec.to}});break}if(C.value.stereotype==="SERIALIZED_TYPE"||R.value.stereotype==="SERIALIZED_TYPE"){s.push({code:"serialized-relation-invalid",opIndex:E,handle:{from:y.spec.from,to:y.spec.to}});break}const T=i(),w={modelId:T,...y.spec.identifying!=null?{identifying:y.spec.identifying}:{},end1:{entityRef:C.value.modelId,multiplicity:y.spec.fromMultiplicity??"EXACTLY_ONE_INSTANCE",navigable:!1,composition:!1},end2:{entityRef:R.value.modelId,multiplicity:y.spec.toMultiplicity??"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:y.spec.composition??!1}},I={...e,associations:[...e.associations,w]},v=pi(I,R.value.modelId,i);v.add[0]&&(w.end2.attributeRef=v.add[0].modelId),l.push({kind:"association.add",casUnit:"logical",associationRef:T,value:w}),g.addedAssociations.push(w);for(const B of v.add){const M={...B,order:d(R.value.modelId,R.value.attributes)};l.push({kind:"attribute.add",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,value:M}),g.cascadeAdds.push({entityId:R.value.modelId,attribute:M})}break}case"association.remove":{const C=St(e,y.association.from),R=St(e,y.association.to);if(C.ok||s.push(xt(C.reason,E,y.association.from,C.matches,k)),R.ok||s.push(xt(R.reason,E,y.association.to,R.matches,k)),!C.ok||!R.ok)break;const T=Cu(e,C.value.modelId,R.value.modelId);if(T.length!==1){s.push(T.length===0?{code:"association-not-found",opIndex:E,handle:y.association}:{code:"association-ambiguous",opIndex:E,handle:y.association,matches:T.map(B=>B.modelId)});break}const w=T[0];m.has(w.modelId)||(m.add(w.modelId),l.push({kind:"association.remove",casUnit:"logical",associationRef:w.modelId}));const I=e.entities.find(B=>B.attributes.some(M=>{var x;return((x=M.embedded)==null?void 0:x.associationRef)===w.modelId}));if(I){const B=I.attributes.find(M=>{var x;return((x=M.embedded)==null?void 0:x.associationRef)===w.modelId});jo(l,f,I.modelId,B.modelId);break}if(w.end1.attributeRef){const B=e.entities.find(x=>x.modelId===w.end1.entityRef),M=B==null?void 0:B.attributes.find(x=>x.modelId===w.end1.attributeRef&&x.attrType==="RELATION_REF");M&&jo(l,f,B.modelId,M.modelId)}const v={...e,associations:e.associations.filter(B=>B.modelId!==w.modelId)};Ul(l,v,[w.end2.entityRef],i,g,f,d);break}case"association.update":{const C=Fu(e,y.association,E,s,k);if(!C)break;const R=y.patch.identifying,T=typeof R=="boolean"?R:void 0;if(T===!0&&C.end1.entityRef===C.end2.entityRef){s.push({code:"self-identifying",opIndex:E,handle:y.association});break}const w=mo(y.patch,Jb);if(w.length){s.push({code:"association-patch-unknown-key",opIndex:E,handle:y.association,keys:w});break}if(l.push({kind:"association.update",casUnit:"logical",containerRef:C.modelId,associationRef:C.modelId,patch:y.patch}),g.assocPatches.push({associationRef:C.modelId,patch:y.patch}),T!==void 0&&T!==(C.identifying??!1)){const I={...e,associations:e.associations.map(v=>v.modelId===C.modelId?{...v,identifying:T}:v)};Ul(l,I,[C.end2.entityRef],i,g,f,d)}break}case"associationEnd.update":{const C=Fu(e,y.association,E,s,k);if(!C)break;const R=y.end==="from"?"end1":"end2";if(Object.prototype.hasOwnProperty.call(y.patch,"navigable")){s.push({code:"navigable-toggle-unsupported",opIndex:E,handle:y.association});break}const T=mo(y.patch,Xb,["jpa."]);if(T.length){s.push({code:"association-end-patch-unknown-key",opIndex:E,handle:y.association,keys:T});break}l.push({kind:"associationEnd.update",casUnit:"logical",containerRef:C.modelId,associationRef:C.modelId,end:R,patch:y.patch}),g.endPatches.push({associationRef:C.modelId,end:R,patch:y.patch});break}case"index.add":{{const T=Nn(y.spec,Bu);if(T.length){s.push({code:"index-spec-unknown-key",opIndex:E,entity:y.entity,handle:{ref:y.spec.name},keys:T});break}}const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}const R=Lu(C.value,y.spec,E,y.entity,s,i);if(!R)break;l.push({kind:"index.add",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,indexRef:R.modelId,value:R});break}case"index.update":case"index.remove":{const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}if(zl(y.index)){s.push({code:"handle-by-unsupported",opIndex:E,entity:y.entity,handle:y.index,target:"index"});break}const R=jb(C.value,y.index);if(!R.ok){s.push(R.reason==="not-found"?{code:"index-not-found",opIndex:E,entity:y.entity,handle:y.index}:{code:"index-ambiguous",opIndex:E,entity:y.entity,handle:y.index,matches:R.matches});break}if(y.kind==="index.update"){if("columns"in y.patch){s.push({code:"index-columns-patch-unsupported",opIndex:E,entity:y.entity,handle:y.index});break}const T=mo(y.patch,Zb);if(T.length){s.push({code:"index-patch-unknown-key",opIndex:E,entity:y.entity,handle:y.index,keys:T});break}l.push({kind:"index.update",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,indexRef:R.value.modelId,patch:y.patch})}else l.push({kind:"index.remove",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,indexRef:R.value.modelId});break}case"operation.add":{{const w=Nn(y.spec,Du);if(w.length){s.push({code:"operation-spec-unknown-key",opIndex:E,entity:y.entity,handle:{ref:y.spec.name},keys:w});break}}const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}const R=u.get(C.value.modelId)??(C.value.operations?jt(C.value.operations):0);u.set(C.value.modelId,R+1);const T=Ou(y.spec,R,i);l.push({kind:"operation.add",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,operationRef:T.modelId,value:T});break}case"operation.update":case"operation.remove":{const C=St(e,y.entity);if(!C.ok){s.push(xt(C.reason,E,y.entity,C.matches,k));break}if(zl(y.operation)){s.push({code:"handle-by-unsupported",opIndex:E,entity:y.entity,handle:y.operation,target:"operation"});break}const R=Ru(C.value,y.operation);if(!R.ok){s.push(R.reason==="not-found"?{code:"operation-not-found",opIndex:E,entity:y.entity,handle:y.operation}:{code:"operation-ambiguous",opIndex:E,entity:y.entity,handle:y.operation,matches:R.matches});break}if(y.kind==="operation.update"){const T=mo(y.patch,Qb);if(T.length){s.push({code:"operation-patch-unknown-key",opIndex:E,entity:y.entity,handle:y.operation,keys:T});break}l.push({kind:"operation.update",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,operationRef:R.value.modelId,patch:y.patch})}else l.push({kind:"operation.remove",casUnit:"logical",containerRef:C.value.modelId,entityRef:C.value.modelId,operationRef:R.value.modelId});break}case"attribute.reorder":case"operation.reorder":{const C=y.kind==="attribute.reorder",R=St(e,y.entity);if(!R.ok){s.push(xt(R.reason,E,y.entity,R.matches,k));break}const T=C?y.order:y.operations,w=[],I=new Set;let v=!1;for(const P of T){if(!C&&zl(P)){s.push({code:"handle-by-unsupported",opIndex:E,entity:y.entity,handle:P,target:"operation"}),v=!0;continue}const Y=C?Su(R.value,P):Ru(R.value,P);if(!Y.ok){s.push(Y.reason==="not-found"?{code:"reorder-handle-not-found",opIndex:E,entity:y.entity,handle:P}:{code:"reorder-handle-ambiguous",opIndex:E,entity:y.entity,handle:P,matches:Y.matches}),v=!0;continue}if(I.has(Y.value.modelId)){s.push({code:"reorder-handle-duplicate",opIndex:E,entity:y.entity,handle:P}),v=!0;continue}I.add(Y.value.modelId),w.push(Y.value)}if(v)break;const M=[...C?R.value.attributes:R.value.operations??[]].sort((P,Y)=>P.order-Y.order).filter(P=>!I.has(P.modelId)),x=[...w,...M];if(x.forEach((P,Y)=>{P.order!==Y&&l.push(C?{kind:"attribute.update",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,attributeRef:P.modelId,patch:{order:Y}}:{kind:"operation.update",casUnit:"logical",containerRef:R.value.modelId,entityRef:R.value.modelId,operationRef:P.modelId,patch:{order:Y}})}),C)for(const P of Iu(e,R.value.modelId,x.map(Y=>Y.modelId)))l.push({kind:"attribute.update",casUnit:"logical",containerRef:P.entityId,entityRef:P.entityId,attributeRef:P.attributeId,patch:{dbAttrs:P.dbAttrs}});break}case"group.add":{{const I=Nn(y.spec,qb);if(I.length){s.push({code:"group-spec-unknown-key",opIndex:E,keys:I});break}}const C=[];let R=!1;for(const I of y.spec.members){const v=St(e,I);if(!v.ok){s.push(xt(v.reason,E,I,v.matches,k)),R=!0;continue}C.push(v.value.modelId)}if(R)break;const T=i(),w={modelId:T,excludeDDLGeneration:y.spec.excludeDDLGeneration??!1,memberEntityRefs:C,...y.spec.name?{name:y.spec.name}:{},...y.spec.packageName?{packageName:y.spec.packageName}:{},...y.spec.description?{description:y.spec.description}:{}};l.push({kind:"group.add",casUnit:"logical",groupRef:T,value:w});break}case"group.update":{const C=Ll(e,y.group);if(!C.ok){s.push(Pl(C,E,y.group));break}const R=mo(y.patch,Lb);if(R.length){s.push({code:"group-patch-unknown-key",opIndex:E,handle:y.group,keys:R});break}l.push({kind:"group.update",casUnit:"logical",containerRef:C.value.modelId,groupRef:C.value.modelId,patch:y.patch});break}case"group.remove":{const C=Ll(e,y.group);if(!C.ok){s.push(Pl(C,E,y.group));break}l.push({kind:"group.remove",casUnit:"logical",groupRef:C.value.modelId});break}case"group.addMember":case"group.removeMember":{const C=Ll(e,y.group);if(!C.ok){s.push(Pl(C,E,y.group));break}const R=St(e,y.entity);if(!R.ok){s.push(xt(R.reason,E,y.entity,R.matches,k));break}const T=C.value.memberEntityRefs.includes(R.value.modelId);if(y.kind==="group.addMember"?T:!T)break;if(y.kind==="group.removeMember"){if(b.has(_(C.value.modelId,R.value.modelId)))break;b.add(_(C.value.modelId,R.value.modelId))}l.push({kind:y.kind,casUnit:"logical",containerRef:C.value.modelId,groupRef:C.value.modelId,entityRef:R.value.modelId});break}}}),s.length||r_(l,e,p,m,f,h,g,i,d),s.length||o_(l,e,f,p),s.length||i_(l,e,f,h,p,i),s.length?{ok:!1,errors:s}:{ok:!0,ops:l}}function xt(e,n,o,i,a){return 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}}function Fu(e,n,o,i,a){const r=St(e,n.from),l=St(e,n.to);if(r.ok||i.push(xt(r.reason,o,n.from,r.matches,a)),l.ok||i.push(xt(l.reason,o,n.to,l.matches,a)),!r.ok||!l.ok)return null;const s=Cu(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 Uu={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},s_={type:"object",description:"엔티티 내 이름으로 지정(인덱스명·메서드명). 물리명 차원이 없어 매칭 키 고정(`by`)을 받지 않는다.",properties:{ref:{type:"string",description:"매칭할 이름."}},required:["ref"],additionalProperties:!1},c_={type:"object",description:"관계는 무명이라 양 끝 엔티티로 주소. from=부모(end1), to=자식(end2). 같은 쌍 복수 관계는 모호 보고.",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"}},required:["from","to"],additionalProperties:!1},d_={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."},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},u_={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},zn={type:"object",properties:{ko:{type:"string"},en:{type:"string"},ja:{type:"string"},zh:{type:"string"}},additionalProperties:!1},m_={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:{...zn,description:"속성 설명(다국어)."},columnLogicalName:{...zn,description:'dbAttr 컬럼 논리명(다국어, 예: {ko:"체크아웃유형"}). 한글 업무명 보존 위치.'},unique:{type:"boolean",description:"dbAttr UNIQUE 제약."},updatable:{type:"boolean",description:"dbAttr 갱신 가능(JPA @Column(updatable=))."},embeddableOverrides:{$ref:"#/$defs/embeddableOverrides"}},required:["name","type"],additionalProperties:!1},f_={type:"array",description:"predefined 임베더블 서브컬럼 오버라이드(속성 type이 카탈로그 엔트리이자 EMBED_PREDEF일 때만). field=카탈로그 필드명으로 매칭(@AttributeOverride 대응). 미설정 서브컬럼은 add=카탈로그 기본 상속 / update=기존값 유지. currency 등 공유 컬럼은 sharedColumnPhysicalName으로 SHARED_REF.",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 컬럼에만 저장."},sharedColumnPhysicalName:{type:"string",description:"SHARED_REF — 같은 엔터티(임베더블이면 owner 합집합) 다른 컬럼(물리명)을 공유해 read-only 투영(대표: currency). 설정 시 자체 컬럼 미보유, 타깃은 해소 시점 존재 필수."}},required:["field"],additionalProperties:!1}},Hu={type:"string",enum:["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"]},p_={type:"object",description:'일반 연관 생성. 양 end 는 일반 엔티티여야 한다 — 임베더블(JPA_EMBEDDABLE)·직렬화 타입을 end 로 주면 거부된다. 직렬화 타입은 관계가 아니라 소비 속성의 type 으로 지목한다(attribute.update {type: "<타입명>"}). (임베드는 EMBED 관계여야 하고 이 어휘엔 없다 → 캔버스에서 연결).',properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"},fromMultiplicity:{...Hu,description:"end1 다중성(기본 EXACTLY_ONE_INSTANCE)."},toMultiplicity:{...Hu,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},h_={type:"object",properties:{name:{type:"string"},unique:{type:"boolean",description:"UNIQUE 인덱스 여부(기본 false)."},columns:{type:"array",description:"인덱스 컬럼(순서 의미 있음).",items:{type:"object",properties:{column:{...Uu,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},y_={type:"object",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"],description:"가시성(기본 미설정)."},sourceCode:{type:"string",description:"Java 메서드 본문(멀티라인, 파라미터·반환 시그니처 포함)."},description:{...zn,description:"메서드 설명(다국어)."},personalInfoAttributeType:{type:"string",description:"개인정보 속성 유형(패스스루)."}},required:["name"],additionalProperties:!1},g_={type:"object",properties:{name:{...zn,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},b_={type:"object",description:"기존 속성 부분 patch. 논리 필드 + 스칼라 단일 컬럼의 물리 필드(physicalName·dataType·length·scale 등 — 서버가 dbAttrs[0]에 매핑). EMBED_PREDEF/Money 서브컬럼 조정은 op-레벨 embeddableOverrides로(평탄 키는 다중 컬럼서 모호해 거부).",properties:{name:{type:"string"},type:{type:"string"},customType:{type:"string"},attrType:{type:"string",enum:[...Eu],description:"속성 종류. **현재 값과 다르게 주면 거부된다** — 관계/임베드/구분선은 동반 구조(관계 소유·embedded·빈 dbAttrs)가 있어야 성립하고 patch로는 표현할 수 없다. 관계 실체화는 association.add, 임베드 서브컬럼은 embeddableOverrides 소관."},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:{...zn,description:"속성 설명(다국어)."},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:{...zn,description:"컬럼 논리명(다국어)."}},additionalProperties:!1},__={type:"object",description:"관계 부분 patch. 양 end 설정(multiplicity·nav·jpa)은 associationEnd.update로.",properties:{description:{type:"string"},identifying:{type:"boolean",description:"식별 관계(부모 PK가 자식 PK 일부로 전파)."}},additionalProperties:!1},k_={type:"object",description:"인덱스 부분 patch. columns(컬럼 구성) 변경은 index.remove+index.add로(패치 불가).",properties:{name:{type:"string"},unique:{type:"boolean"},description:{type:"string"},parameters:{type:"string"}},additionalProperties:!1},E_={type:"object",description:"메서드 부분 patch.",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"]},sourceCode:{type:"string"},description:{...zn,description:"메서드 설명(다국어)."},order:{type:"integer"},personalInfoAttributeType:{type:"string"}},additionalProperties:!1},N_={type:"object",description:'엔티티 부분 patch. 논리 키: name·stereotype·packageName·superClass·schema·description·abstractClass·hasPersonalInfo·referenceOnly·declarationOfInterfaces·table·serialization. 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 소관).'},w_={type:"object",description:'관계 end 부분 patch. 논리 키: multiplicity·navigable·composition. jpa 설정(cascadeTypes·fetchType·orphanRemoval·orderBy·collectionType·collectionTable·orderColumn)은 형제 클로버 방지를 위해 dotted-key로: {"jpa.orphanRemoval": true}.'};function ht(e,n){return{type:"object",properties:{kind:{const:e},...n.properties},required:["kind",...n.required],additionalProperties:!1}}const I_={"entity.add":ht("entity.add",{properties:{spec:{$ref:"#/$defs/entitySpec"}},required:["spec"]}),"entity.update":ht("entity.update",{properties:{entity:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/entityUpdatePatch"}},required:["entity","patch"]}),"entity.remove":ht("entity.remove",{properties:{entity:{$ref:"#/$defs/handle"}},required:["entity"]}),"attribute.add":ht("attribute.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/attrSpec"}},required:["entity","spec"]}),"attribute.update":ht("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":ht("attribute.remove",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"}},required:["entity","attribute"]}),"association.add":ht("association.add",{properties:{spec:{$ref:"#/$defs/assocSpec"}},required:["spec"]}),"association.remove":ht("association.remove",{properties:{association:{$ref:"#/$defs/assocHandle"}},required:["association"]}),"association.update":ht("association.update",{properties:{association:{$ref:"#/$defs/assocHandle"},patch:{$ref:"#/$defs/assocUpdatePatch"}},required:["association","patch"]}),"associationEnd.update":ht("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":ht("index.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/indexSpec"}},required:["entity","spec"]}),"index.update":ht("index.update",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/nameHandle"},patch:{$ref:"#/$defs/indexUpdatePatch"}},required:["entity","index","patch"]}),"index.remove":ht("index.remove",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/nameHandle"}},required:["entity","index"]}),"operation.add":ht("operation.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/operationSpec"}},required:["entity","spec"]}),"operation.update":ht("operation.update",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/nameHandle"},patch:{$ref:"#/$defs/operationUpdatePatch"}},required:["entity","operation","patch"]}),"operation.remove":ht("operation.remove",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/nameHandle"}},required:["entity","operation"]}),"attribute.reorder":ht("attribute.reorder",{properties:{entity:{$ref:"#/$defs/handle"},order:{type:"array",items:{$ref:"#/$defs/handle"},minItems:1}},required:["entity","order"]}),"operation.reorder":ht("operation.reorder",{properties:{entity:{$ref:"#/$defs/handle"},operations:{type:"array",items:{$ref:"#/$defs/nameHandle"},minItems:1}},required:["entity","operations"]}),"group.add":ht("group.add",{properties:{spec:{$ref:"#/$defs/groupSpec"}},required:["spec"]}),"group.update":ht("group.update",{properties:{group:{$ref:"#/$defs/groupHandle"},patch:{$ref:"#/$defs/groupUpdatePatch"}},required:["group","patch"]}),"group.remove":ht("group.remove",{properties:{group:{$ref:"#/$defs/groupHandle"}},required:["group"]}),"group.addMember":ht("group.addMember",{properties:{group:{$ref:"#/$defs/groupHandle"},entity:{$ref:"#/$defs/handle"}},required:["group","entity"]}),"group.removeMember":ht("group.removeMember",{properties:{group:{$ref:"#/$defs/groupHandle"},entity:{$ref:"#/$defs/handle"}},required:["group","entity"]})},v_={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},C_={type:"object",description:"그룹 부분 patch. 멤버 변경은 group.addMember/removeMember로(배열 통째 교체는 동시 편집이 서로를 덮는다).",properties:{name:{...zn,description:"그룹 논리명(다국어)."},packageName:{type:"string"},description:{type:"string"},excludeDDLGeneration:{type:"boolean"}},additionalProperties:!1},ju={anyOf:ku.map(e=>I_[e])},S_={type:"object",description:"엔티티 모델을 생성·수정·삭제할 때 호출한다. ops는 사람 핸들(엔티티 물리명/논리명, 속성명)로 지정하며 서버가 modelId로 해소한다. 모호하면 에러로 후보를 돌려주니 리소스로 현재 모델을 먼저 읽어 핸들을 확정하라.",properties:{ops:{type:"array",items:{$ref:"#/$defs/symbolicOp"}}},required:["ops"],additionalProperties:!1,$defs:{handle:Uu,nameHandle:s_,groupHandle:v_,assocHandle:c_,entitySpec:d_,serialization:u_,attrSpec:m_,embeddableOverrides:f_,assocSpec:p_,indexSpec:h_,operationSpec:y_,groupSpec:g_,entityUpdatePatch:N_,attrUpdatePatch:b_,assocUpdatePatch:__,assocEndUpdatePatch:w_,indexUpdatePatch:k_,operationUpdatePatch:E_,groupUpdatePatch:C_,symbolicOp:ju}};function x_(e,n,o,i={}){const a=i.mkClientOpId??Pe,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 Ku={location:{x:0,y:0},size:{width:220,height:140}};function Gu(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,sharedColumnRef:e.sharedColumnRef,multiValue:e.multiValue,multiValueSeparator:e.multiValueSeparator,sequenceName:e.sequenceName}}const R_=/^[-=_*~\s]{3,}$/;function A_(e){return e.attrType&&e.attrType!=="NORMAL"||!R_.test(e.name??"")?!1:!(e.dbAttrs??[]).some(n=>n.physicalName||n.dataType)}function $_(e){return e.type===_n&&e.customType==="java.util.Currency"?{type:"Currency",customType:void 0}:{type:e.type,customType:e.customType}}function T_(e,n){if(e.attrType==="DIVIDER"||A_(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=$_(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(Gu)}}function M_(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 V_(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 B_(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(T_),operations:(n=e.operations)==null?void 0:n.map(M_),indexes:(o=e.indexes)==null?void 0:o.map(V_),jpaAttrs:e.jpaAttrs,table:e.dbAttrs?{physicalName:e.dbAttrs.physicalName,logicalName:e.dbAttrs.logicalName}:void 0}}function D_(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??{...Ku},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 Yu(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 Hl(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:Yu(e)}}function O_(e){if(e.end1.endModel.refId===e.end2.endModel.refId)return;const n=o=>jl(o)&&(o==null?void 0:o.identifier)===!0;return n(e.end1.attribute)||n(e.end2.attribute)?!0:void 0}function L_(e){var i,a;const n={modelId:e.modelId,description:e.description,identifying:O_(e),end1:Hl(e.end1),end2:Hl(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 jl(e){var n;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("RELATION")&&(((n=e.dbAttrs)==null?void 0:n.length)??0)>0}function qu(e){var n;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("EMBED")&&(((n=e.dbAttrs)==null?void 0:n.length)??0)>0}function Wu(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 Ju(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(Gu)}}function P_(e,n,o){var y,E;const i=jl(e.end1.attribute),a=jl(e.end2.attribute);if(i===a)return L_(e);const r=i?e.end1:e.end2,l=i?e.end2:e.end1,s=r.attribute,c=(E=(y=s.dbAttrs)==null?void 0:y[0])==null?void 0:E.targetModelId,d=c?o.get(c):void 0,u=n.get(l.endModel.refId),m=u?u.attributes.reduce((S,A)=>Math.max(S,A.order),-1)+1:s.order??0,p={...Ju(s,m),attrType:"RELATION_OWN",derivedFrom:d?{associationRef:e.modelId,sourceAttributeRef:d}:void 0};u&&u.attributes.push(p);const f=n.get(r.endModel.refId),h=l.attribute;let g;if(h&&f&&r.navigable){const S=sa(l.multiplicity);g={modelId:h.modelId??crypto.randomUUID(),name:eo(h.name??da((u==null?void 0:u.name)??l.endModel.refId,S),new Set(f.attributes.map(A=>A.name))),type:(u==null?void 0:u.name)??l.endModel.refId,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:f.attributes.reduce((A,V)=>Math.max(A,V.order),-1)+1,dbAttrs:[]},f.attributes.push(g)}const b=(S,A)=>({entityRef:S.endModel.refId,multiplicity:S.multiplicity,navigable:S.navigable,composition:S.composition,attributeRef:A?g==null?void 0:g.modelId:p.modelId,jpa:Yu(S)}),_=r.endModel.refId===l.endModel.refId,k={modelId:e.modelId,description:e.description,identifying:!_&&p.identifier===!0?!0:void 0,end1:b(e.end1,i),end2:b(e.end2,a)},N={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:i?d:p.modelId,targetColumnRef:i?p.modelId:d,style:e.style};return{assoc:k,layout:N}}function z_(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)}}function F_(e,n,o){var h;const i=((h=e.end1.attribute)==null?void 0:h.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={...Ju(l,c),attrType:l.attrType??"EMBED_OWN",dbAttrs:(l.dbAttrs??[]).map(g=>z_(g,o)),embedded:{associationRef:e.modelId,embeddableRef:a.endModel.refId}};s&&s.attributes.push(d);const u=g=>({...Hl(g),legacyEmbedRaw:g.attribute}),m={modelId:e.modelId,description:e.description,end1:u(e.end1),end2:u(e.end2)},p=!i,f={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:p?d.modelId:void 0,targetColumnRef:p?void 0:d.modelId,style:e.style};return{assoc:m,layout:f}}function U_(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 Xu(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=U_(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 Zu(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 H_(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||_t(a.stereotype)||_t(r.stereotype))continue;const l=i.end1.attributeRef?a.attributes.find(p=>p.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(p=>p.modelId===s);if((c==null?void 0:c.attrType)==="RELATION_REF"){i.end1.attributeRef=s;continue}const d=sa(i.end2.multiplicity),u=da(r.name,d),m=eo(u,new Set(a.attributes.map(p=>p.name)));a.attributes.push({modelId:s,name:m,type:r.name,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:a.attributes.reduce((p,f)=>Math.max(p,f.order),-1)+1,dbAttrs:[]}),i.end1.attributeRef=s}}function j_(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||_t(a.stereotype)||_t(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 Qu(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&&_t(l.stereotype))continue;const s=a.end1.entityRef===a.end2.entityRef,c=a.identifying===!0||!s&&!Ac(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 em(e){const n=JSON.parse(JSON.stringify(e));return(n.schemaVersion??1)>=2&&"logical"in n?K_(n):G_(n)}function K_(e){const n=e.id??e.logical.modelId??"",o={},i=m=>{const{rev:p,...f}=m;return p!=null&&(o[m.modelId]=p),f},a=e.logical.entities.map(i),r=e.logical.associations.map(i),l=e.logical.groups.map(i);H_(a,r),j_(a,r),Qu(a,r);const{version:s,...c}=e.layout;Zu(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 G_(e){var _,k;const n=e.id??"",o=[],i=[],a=[],r=[],l=[],s=[],c=[],d=(N,y)=>{o.push(B_(N));const E=D_(N);E.geo={location:{x:E.geo.location.x+y.x,y:E.geo.location.y+y.y},size:E.geo.size},i.push(E);for(const S of N.ownedAssociations??[])c.push(S)},u={x:0,y:0};for(const N of e.entities??[])d(N,u);const m=[];for(const N of e.groups??[]){const y=N.entities??[];l.push({modelId:N.modelId,name:N.name,description:N.description,packageName:N.packageName,excludeDDLGeneration:N.excludeDDLGeneration??!1,memberEntityRefs:y.map(S=>S.modelId)});const E=((_=N.geo)==null?void 0:_.location)??u;if(N.geo){const S=(N.notes??[]).map(A=>A.modelId);s.push({groupRef:N.modelId,geo:N.geo,style:N.style,locked:N.locked,memberNoteRefs:S.length?S:void 0})}for(const S of y)d(S,E);for(const S of N.notes??[])m.push(Xu(S,E))}const p=new Map(o.map(N=>[N.modelId,N])),f=new Map,h=new Map;for(const N of o)for(const y of N.attributes)for(const E of y.dbAttrs)f.set(E.modelId,y.modelId),h.set(E.modelId,E);for(const N of c)for(const y of[N.end1,N.end2]){const E=y.attribute;if(E&&(((k=E.dbAttrs)==null?void 0:k.length)??0)>0)for(const S of E.dbAttrs)S.modelId&&f.set(S.modelId,E.modelId)}for(const N of c){const y=qu(N.end1.attribute),E=qu(N.end2.attribute),S=Wu(N.end1)||Wu(N.end2),{assoc:A,layout:V}=y!==E||S?F_(N,p,h):P_(N,p,f);a.push(A),r.push(V)}Zu(o,a,r),Nd(o),Qu(o,a);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(N=>Xu(N)),...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 tm(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,sharedColumnRef:e.sharedColumnRef,multiValue:e.multiValue,multiValueSeparator:e.multiValueSeparator,sequenceName:e.sequenceName}}function Y_(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(tm),style:n}}function q_(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 W_(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 Fn(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 J_(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{...tm(i),targetModelId:(r=o==null?void 0:o.dbAttrs[a])==null?void 0:r.modelId}})}}function X_(e){return{modelId:e.modelId,name:e.name,type:e.type,attrType:"RELATION_OWN",dbAttrs:[]}}function nm(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 Z_(e){const n=new Set;for(const o of e.logical.associations){const i=nm(o,e);i&&(n.add(i.navAttr.modelId),i.fk&&n.add(i.fk.modelId))}return n}function Q_(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 ek(e,n){return e===n||JSON.stringify(e??null)===JSON.stringify(n??null)}function tk(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:ek(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)}}function nk(e,n,o){let i;for(const m of n.logical.entities){const p=m.attributes.find(f=>{var h;return((h=f.embedded)==null?void 0:h.associationRef)===e.modelId});if(p){i=p;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,p)=>tk(m,l[p]))},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:Fn(e.end1,c?s:u),end2:Fn(e.end2,c?u:s)}}function ok(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:Fn(e.end1,e.end1.legacyEmbedRaw),end2:Fn(e.end2,e.end2.legacyEmbedRaw)};const a=nk(e,n,i);if(a)return a;const r=nm(e,n);if(r){const l=n.logical.entities.find(d=>d.modelId===r.navEnd.entityRef),s=r.fk?J_(r.fk,l):void 0,c=X_(r.navAttr);return{...i,end1:Fn(e.end1,r.navEnd===e.end1?s:c),end2:Fn(e.end2,r.navEnd===e.end2?s:c)}}return{...i,end1:Fn(e.end1),end2:Fn(e.end2)}}function om(e,n,o,i,a={x:0,y:0}){var u,m;const r=n.layout.entityLayouts.find(p=>p.entityRef===e.modelId),l=n.logical.associations.filter(p=>p.end1.entityRef===e.modelId),s=p=>n.layout.associationLayouts.find(f=>f.associationRef===p),c=(r==null?void 0:r.geo)??{...Ku},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(p=>!o.has(p.modelId)&&!i.has(p.modelId)).map(p=>{var f;return Y_(p,(f=r==null?void 0:r.attributeStyles)==null?void 0:f[p.modelId])}),operations:(u=e.operations)==null?void 0:u.map(p=>{var f;return q_(p,(f=r==null?void 0:r.operationStyles)==null?void 0:f[p.modelId])}),ownedAssociations:l.map(p=>ok(p,n,s(p.modelId))),indexes:(m=e.indexes)==null?void 0:m.map(W_),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 ik(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=>im(c,l));return{modelId:e.modelId,name:e.name,description:e.description,packageName:e.packageName,excludeDDLGeneration:e.excludeDDLGeneration,entities:r.map(c=>om(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 im(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 ak(e,n={}){const o=new Set(e.logical.groups.flatMap(s=>s.memberEntityRefs)),i=e.logical.entities.filter(s=>!o.has(s.modelId)),a=Z_(e),r=Q_(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=>om(s,e,a,r)),groups:e.logical.groups.map(s=>ik(s,e,a,r)),notes:e.layout.notes.filter(s=>!l.has(s.modelId)).map(s=>im(s))}}function rk(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 lk=["notNull"];function sk(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}=em(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(p=>[p.modelId,p]))]));for(const m of i.logical.entities){const p=c.get(m.modelId);if(p)for(const f of m.attributes){const h=p.get(f.modelId);if(!h){l.push({kind:"attribute.add",casUnit:"logical",containerRef:m.modelId,entityRef:m.modelId,value:f}),s.navAdds++;continue}const g={};for(const b of lk)f[b]===!0!=(h[b]===!0)&&(g[b]=f[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:f.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 p=d.get(m.modelId);p&&(m.end1.attributeRef&&m.end1.attributeRef!==p.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&&p.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 Ni(e){return t.getCurrentScope()?(t.onScopeDispose(e),!0):!1}function wn(e){return typeof e=="function"?e():t.unref(e)}const ck=typeof window<"u"&&typeof document<"u",dk=e=>typeof e<"u",uk=Object.prototype.toString,mk=e=>uk.call(e)==="[object Object]",fk=()=>{};function pk(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 am=e=>e();function hk(e=am){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 rm(e,n=!1,o="Timeout"){return new Promise((i,a)=>{setTimeout(n?()=>a(o):i,e)})}function yk(e,n,o={}){const{eventFilter:i=am,...a}=o;return t.watch(e,pk(i,n),a)}function Ko(e,n,o={}){const{eventFilter:i,...a}=o,{eventFilter:r,pause:l,resume:s,isActive:c}=hk(i);return{stop:yk(e,n,{...a,eventFilter:r}),pause:l,resume:s,isActive:c}}function gk(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=wn(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 Kl(e,n=!1){function o(m,{flush:p="sync",deep:f=!1,timeout:h,throwOnTimeout:g}={}){let b=null;const k=[new Promise(N=>{b=t.watch(e,y=>{m(y)!==n&&(b==null||b(),N(y))},{flush:p,deep:f,immediate:!0})})];return h!=null&&k.push(rm(h,g).then(()=>wn(e)).finally(()=>b==null?void 0:b())),Promise.race(k)}function i(m,p){if(!t.isRef(m))return o(y=>y===m,p);const{flush:f="sync",deep:h=!1,timeout:g,throwOnTimeout:b}=p??{};let _=null;const N=[new Promise(y=>{_=t.watch([e,m],([E,S])=>{n!==(E===S)&&(_==null||_(),y(E))},{flush:f,deep:h,immediate:!0})})];return g!=null&&N.push(rm(g,b).then(()=>wn(e)).finally(()=>(_==null||_(),wn(e)))),Promise.race(N)}function a(m){return o(p=>!!p,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,p){return o(f=>{const h=Array.from(f);return h.includes(m)||h.includes(wn(m))},p)}function d(m){return u(1,m)}function u(m=1,p){let f=-1;return o(()=>(f+=1,f>=m),p)}return Array.isArray(wn(e))?{toMatch:o,toContains:c,changed:d,changedTimes:u,get not(){return Kl(e,!n)}}:{toMatch:o,toBe:i,toBeTruthy:a,toBeNull:r,toBeNaN:s,toBeUndefined:l,changed:d,changedTimes:u,get not(){return Kl(e,!n)}}}function Gl(e){return Kl(e)}function bk(e){var n;const o=wn(e);return(n=o==null?void 0:o.$el)!=null?n:o}const lm=ck?window:void 0;function sm(...e){let n,o,i,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([o,i,a]=e,n=lm):[n,o,i,a]=e,!n)return fk;Array.isArray(o)||(o=[o]),Array.isArray(i)||(i=[i]);const r=[],l=()=>{r.forEach(u=>u()),r.length=0},s=(u,m,p,f)=>(u.addEventListener(m,p,f),()=>u.removeEventListener(m,p,f)),c=t.watch(()=>[bk(n),wn(a)],([u,m])=>{if(l(),!u)return;const p=mk(m)?{...m}:m;r.push(...o.flatMap(f=>i.map(h=>s(u,f,h,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return Ni(d),d}function _k(e){return typeof e=="function"?e:typeof e=="string"?n=>n.key===e:Array.isArray(e)?n=>e.includes(n.key):()=>!0}function cm(...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=lm,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=i,c=_k(n);return sm(a,r,u=>{u.repeat&&wn(s)||c(u)&&o(u)},l)}function kk(e){return JSON.parse(JSON.stringify(e))}function Yl(e,n,o,i={}){var a,r,l;const{clone:s=!1,passive:c=!1,eventName:d,deep:u=!1,defaultValue:m,shouldEmit:p}=i,f=t.getCurrentInstance(),h=o||(f==null?void 0:f.emit)||((a=f==null?void 0:f.$emit)==null?void 0:a.bind(f))||((l=(r=f==null?void 0:f.proxy)==null?void 0:r.$emit)==null?void 0:l.bind(f==null?void 0:f.proxy));let g=d;n||(n="modelValue"),g=g||`update:${n.toString()}`;const b=N=>s?typeof s=="function"?s(N):kk(N):N,_=()=>dk(e[n])?b(e[n]):m,k=N=>{p?p(N)&&h(g,N):h(g,N)};if(c){const N=_(),y=t.ref(N);let E=!1;return t.watch(()=>e[n],S=>{E||(E=!0,y.value=b(S),t.nextTick(()=>E=!1))}),t.watch(y,S=>{!E&&(S!==e[n]||u)&&k(S)},{deep:u}),y}else return t.computed({get(){return _()},set(N){k(N)}})}var Ek={value:()=>{}};function Ma(){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 Va(o)}function Va(e){this._=e}function Nk(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}})}Va.prototype=Ma.prototype={constructor:Va,on:function(e,n){var o=this._,i=Nk(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=wk(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]=dm(o[a],e.name,n);else if(n==null)for(a in o)o[a]=dm(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 Va(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 wk(e,n){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===n)return a.value}function dm(e,n,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=Ek,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:n,value:o}),e}var ql="http://www.w3.org/1999/xhtml";const um={svg:"http://www.w3.org/2000/svg",xhtml:ql,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ba(e){var n=e+="",o=n.indexOf(":");return o>=0&&(n=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),um.hasOwnProperty(n)?{space:um[n],local:e}:e}function Ik(e){return function(){var n=this.ownerDocument,o=this.namespaceURI;return o===ql&&n.documentElement.namespaceURI===ql?n.createElement(e):n.createElementNS(o,e)}}function vk(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mm(e){var n=Ba(e);return(n.local?vk:Ik)(n)}function Ck(){}function Wl(e){return e==null?Ck:function(){return this.querySelector(e)}}function Sk(e){typeof e!="function"&&(e=Wl(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 Ut(i,this._parents)}function xk(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Rk(){return[]}function fm(e){return e==null?Rk:function(){return this.querySelectorAll(e)}}function Ak(e){return function(){return xk(e.apply(this,arguments))}}function $k(e){typeof e=="function"?e=Ak(e):e=fm(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 Ut(i,a)}function pm(e){return function(){return this.matches(e)}}function hm(e){return function(n){return n.matches(e)}}var Tk=Array.prototype.find;function Mk(e){return function(){return Tk.call(this.children,e)}}function Vk(){return this.firstElementChild}function Bk(e){return this.select(e==null?Vk:Mk(typeof e=="function"?e:hm(e)))}var Dk=Array.prototype.filter;function Ok(){return Array.from(this.children)}function Lk(e){return function(){return Dk.call(this.children,e)}}function Pk(e){return this.selectAll(e==null?Ok:Lk(typeof e=="function"?e:hm(e)))}function zk(e){typeof e!="function"&&(e=pm(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 Ut(i,this._parents)}function ym(e){return new Array(e.length)}function Fk(){return new Ut(this._enter||this._groups.map(ym),this._parents)}function Da(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Da.prototype={constructor:Da,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 Uk(e){return function(){return e}}function Hk(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 Da(e,r[l]);for(;l<c;++l)(s=n[l])&&(a[l]=s)}function jk(e,n,o,i,a,r,l){var s,c,d=new Map,u=n.length,m=r.length,p=new Array(u),f;for(s=0;s<u;++s)(c=n[s])&&(p[s]=f=l.call(c,c.__data__,s,n)+"",d.has(f)?a[s]=c:d.set(f,c));for(s=0;s<m;++s)f=l.call(e,r[s],s,r)+"",(c=d.get(f))?(i[s]=c,c.__data__=r[s],d.delete(f)):o[s]=new Da(e,r[s]);for(s=0;s<u;++s)(c=n[s])&&d.get(p[s])===c&&(a[s]=c)}function Kk(e){return e.__data__}function Gk(e,n){if(!arguments.length)return Array.from(this,Kk);var o=n?jk:Hk,i=this._parents,a=this._groups;typeof e!="function"&&(e=Uk(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],p=m.length,f=Yk(e.call(u,u&&u.__data__,d,i)),h=f.length,g=s[d]=new Array(h),b=l[d]=new Array(h),_=c[d]=new Array(p);o(u,m,g,b,_,f,n);for(var k=0,N=0,y,E;k<h;++k)if(y=g[k]){for(k>=N&&(N=k+1);!(E=b[N])&&++N<h;);y._next=E||null}}return l=new Ut(l,i),l._enter=s,l._exit=c,l}function Yk(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function qk(){return new Ut(this._exit||this._groups.map(ym),this._parents)}function Wk(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 Jk(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,p=s[c]=new Array(m),f,h=0;h<m;++h)(f=d[h]||u[h])&&(p[h]=f);for(;c<a;++c)s[c]=o[c];return new Ut(s,this._parents)}function Xk(){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 Zk(e){e||(e=Qk);function n(m,p){return m&&p?e(m.__data__,p.__data__):!m-!p}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 Ut(a,this._parents).order()}function Qk(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function eE(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function tE(){return Array.from(this)}function nE(){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 oE(){let e=0;for(const n of this)++e;return e}function iE(){return!this.node()}function aE(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 rE(e){return function(){this.removeAttribute(e)}}function lE(e){return function(){this.removeAttributeNS(e.space,e.local)}}function sE(e,n){return function(){this.setAttribute(e,n)}}function cE(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function dE(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function uE(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 mE(e,n){var o=Ba(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?lE:rE:typeof n=="function"?o.local?uE:dE:o.local?cE:sE)(o,n))}function gm(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function fE(e){return function(){this.style.removeProperty(e)}}function pE(e,n,o){return function(){this.style.setProperty(e,n,o)}}function hE(e,n,o){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function yE(e,n,o){return arguments.length>1?this.each((n==null?fE:typeof n=="function"?hE:pE)(e,n,o??"")):Go(this.node(),e)}function Go(e,n){return e.style.getPropertyValue(n)||gm(e).getComputedStyle(e,null).getPropertyValue(n)}function gE(e){return function(){delete this[e]}}function bE(e,n){return function(){this[e]=n}}function _E(e,n){return function(){var o=n.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function kE(e,n){return arguments.length>1?this.each((n==null?gE:typeof n=="function"?_E:bE)(e,n)):this.node()[e]}function bm(e){return e.trim().split(/^|\s+/)}function Jl(e){return e.classList||new _m(e)}function _m(e){this._node=e,this._names=bm(e.getAttribute("class")||"")}_m.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 km(e,n){for(var o=Jl(e),i=-1,a=n.length;++i<a;)o.add(n[i])}function Em(e,n){for(var o=Jl(e),i=-1,a=n.length;++i<a;)o.remove(n[i])}function EE(e){return function(){km(this,e)}}function NE(e){return function(){Em(this,e)}}function wE(e,n){return function(){(n.apply(this,arguments)?km:Em)(this,e)}}function IE(e,n){var o=bm(e+"");if(arguments.length<2){for(var i=Jl(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof n=="function"?wE:n?EE:NE)(o,n))}function vE(){this.textContent=""}function CE(e){return function(){this.textContent=e}}function SE(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function xE(e){return arguments.length?this.each(e==null?vE:(typeof e=="function"?SE:CE)(e)):this.node().textContent}function RE(){this.innerHTML=""}function AE(e){return function(){this.innerHTML=e}}function $E(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function TE(e){return arguments.length?this.each(e==null?RE:(typeof e=="function"?$E:AE)(e)):this.node().innerHTML}function ME(){this.nextSibling&&this.parentNode.appendChild(this)}function VE(){return this.each(ME)}function BE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function DE(){return this.each(BE)}function OE(e){var n=typeof e=="function"?e:mm(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function LE(){return null}function PE(e,n){var o=typeof e=="function"?e:mm(e),i=n==null?LE:typeof n=="function"?n:Wl(n);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function zE(){var e=this.parentNode;e&&e.removeChild(this)}function FE(){return this.each(zE)}function UE(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function HE(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function jE(e){return this.select(e?HE:UE)}function KE(e){return arguments.length?this.property("__data__",e):this.node().__data__}function GE(e){return function(n){e.call(this,n,this.__data__)}}function YE(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 qE(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 WE(e,n,o){return function(){var i=this.__on,a,r=GE(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 JE(e,n,o){var i=YE(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?WE:qE,a=0;a<r;++a)this.each(s(i[a],n,o));return this}function Nm(e,n,o){var i=gm(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 XE(e,n){return function(){return Nm(this,e,n)}}function ZE(e,n){return function(){return Nm(this,e,n.apply(this,arguments))}}function QE(e,n){return this.each((typeof n=="function"?ZE:XE)(e,n))}function*e1(){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 wm=[null];function Ut(e,n){this._groups=e,this._parents=n}function wi(){return new Ut([[document.documentElement]],wm)}function t1(){return this}Ut.prototype=wi.prototype={constructor:Ut,select:Sk,selectAll:$k,selectChild:Bk,selectChildren:Pk,filter:zk,data:Gk,enter:Fk,exit:qk,join:Wk,merge:Jk,selection:t1,order:Xk,sort:Zk,call:eE,nodes:tE,node:nE,size:oE,empty:iE,each:aE,attr:mE,style:yE,property:kE,classed:IE,text:xE,html:TE,raise:VE,lower:DE,append:OE,insert:PE,remove:FE,clone:jE,datum:KE,on:JE,dispatch:QE,[Symbol.iterator]:e1};function Jt(e){return typeof e=="string"?new Ut([[document.querySelector(e)]],[document.documentElement]):new Ut([[e]],wm)}function n1(e){let n;for(;n=e.sourceEvent;)e=n;return e}function sn(e,n){if(e=n1(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 o1={passive:!1},Ii={capture:!0,passive:!1};function Xl(e){e.stopImmediatePropagation()}function Yo(e){e.preventDefault(),e.stopImmediatePropagation()}function Im(e){var n=e.document.documentElement,o=Jt(e).on("dragstart.drag",Yo,Ii);"onselectstart"in n?o.on("selectstart.drag",Yo,Ii):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function vm(e,n){var o=e.document.documentElement,i=Jt(e).on("dragstart.drag",null);n&&(i.on("click.drag",Yo,Ii),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 Oa=e=>()=>e;function Zl(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}})}Zl.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function i1(e){return!e.ctrlKey&&!e.button}function a1(){return this.parentNode}function r1(e,n){return n??{x:e.x,y:e.y}}function l1(){return navigator.maxTouchPoints||"ontouchstart"in this}function s1(){var e=i1,n=a1,o=r1,i=l1,a={},r=Ma("start","drag","end"),l=0,s,c,d,u,m=0;function p(y){y.on("mousedown.drag",f).filter(i).on("touchstart.drag",b).on("touchmove.drag",_,o1).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(y,E){if(!(u||!e.call(this,y,E))){var S=N(this,n.call(this,y,E),y,E,"mouse");S&&(Jt(y.view).on("mousemove.drag",h,Ii).on("mouseup.drag",g,Ii),Im(y.view),Xl(y),d=!1,s=y.clientX,c=y.clientY,S("start",y))}}function h(y){if(Yo(y),!d){var E=y.clientX-s,S=y.clientY-c;d=E*E+S*S>m}a.mouse("drag",y)}function g(y){Jt(y.view).on("mousemove.drag mouseup.drag",null),vm(y.view,d),Yo(y),a.mouse("end",y)}function b(y,E){if(e.call(this,y,E)){var S=y.changedTouches,A=n.call(this,y,E),V=S.length,$,O;for($=0;$<V;++$)(O=N(this,A,y,E,S[$].identifier,S[$]))&&(Xl(y),O("start",y,S[$]))}}function _(y){var E=y.changedTouches,S=E.length,A,V;for(A=0;A<S;++A)(V=a[E[A].identifier])&&(Yo(y),V("drag",y,E[A]))}function k(y){var E=y.changedTouches,S=E.length,A,V;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),A=0;A<S;++A)(V=a[E[A].identifier])&&(Xl(y),V("end",y,E[A]))}function N(y,E,S,A,V,$){var O=r.copy(),C=sn($||S,E),R,T,w;if((w=o.call(y,new Zl("beforestart",{sourceEvent:S,target:p,identifier:V,active:l,x:C[0],y:C[1],dx:0,dy:0,dispatch:O}),A))!=null)return R=w.x-C[0]||0,T=w.y-C[1]||0,function I(v,B,M){var x=C,P;switch(v){case"start":a[V]=I,P=l++;break;case"end":delete a[V],--l;case"drag":C=sn(M||B,E),P=l;break}O.call(v,y,new Zl(v,{sourceEvent:B,subject:w,target:p,identifier:V,active:P,x:C[0]+R,y:C[1]+T,dx:C[0]-x[0],dy:C[1]-x[1],dispatch:O}),A)}}return p.filter=function(y){return arguments.length?(e=typeof y=="function"?y:Oa(!!y),p):e},p.container=function(y){return arguments.length?(n=typeof y=="function"?y:Oa(y),p):n},p.subject=function(y){return arguments.length?(o=typeof y=="function"?y:Oa(y),p):o},p.touchable=function(y){return arguments.length?(i=typeof y=="function"?y:Oa(!!y),p):i},p.on=function(){var y=r.on.apply(r,arguments);return y===r?p:y},p.clickDistance=function(y){return arguments.length?(m=(y=+y)*y,p):Math.sqrt(m)},p}function Ql(e,n,o){e.prototype=n.prototype=o,o.constructor=e}function Cm(e,n){var o=Object.create(e.prototype);for(var i in n)o[i]=n[i];return o}function vi(){}var Ci=.7,La=1/Ci,qo="\\s*([+-]?\\d+)\\s*",Si="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",cn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",c1=/^#([0-9a-f]{3,8})$/,d1=new RegExp(`^rgb\\(${qo},${qo},${qo}\\)$`),u1=new RegExp(`^rgb\\(${cn},${cn},${cn}\\)$`),m1=new RegExp(`^rgba\\(${qo},${qo},${qo},${Si}\\)$`),f1=new RegExp(`^rgba\\(${cn},${cn},${cn},${Si}\\)$`),p1=new RegExp(`^hsl\\(${Si},${cn},${cn}\\)$`),h1=new RegExp(`^hsla\\(${Si},${cn},${cn},${Si}\\)$`),Sm={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};Ql(vi,fo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:xm,formatHex:xm,formatHex8:y1,formatHsl:g1,formatRgb:Rm,toString:Rm});function xm(){return this.rgb().formatHex()}function y1(){return this.rgb().formatHex8()}function g1(){return Vm(this).formatHsl()}function Rm(){return this.rgb().formatRgb()}function fo(e){var n,o;return e=(e+"").trim().toLowerCase(),(n=c1.exec(e))?(o=n[1].length,n=parseInt(n[1],16),o===6?Am(n):o===3?new Ot(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):o===8?Pa(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):o===4?Pa(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=d1.exec(e))?new Ot(n[1],n[2],n[3],1):(n=u1.exec(e))?new Ot(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=m1.exec(e))?Pa(n[1],n[2],n[3],n[4]):(n=f1.exec(e))?Pa(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=p1.exec(e))?Mm(n[1],n[2]/100,n[3]/100,1):(n=h1.exec(e))?Mm(n[1],n[2]/100,n[3]/100,n[4]):Sm.hasOwnProperty(e)?Am(Sm[e]):e==="transparent"?new Ot(NaN,NaN,NaN,0):null}function Am(e){return new Ot(e>>16&255,e>>8&255,e&255,1)}function Pa(e,n,o,i){return i<=0&&(e=n=o=NaN),new Ot(e,n,o,i)}function b1(e){return e instanceof vi||(e=fo(e)),e?(e=e.rgb(),new Ot(e.r,e.g,e.b,e.opacity)):new Ot}function es(e,n,o,i){return arguments.length===1?b1(e):new Ot(e,n,o,i??1)}function Ot(e,n,o,i){this.r=+e,this.g=+n,this.b=+o,this.opacity=+i}Ql(Ot,es,Cm(vi,{brighter(e){return e=e==null?La:Math.pow(La,e),new Ot(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ci:Math.pow(Ci,e),new Ot(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ot(po(this.r),po(this.g),po(this.b),za(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:$m,formatHex:$m,formatHex8:_1,formatRgb:Tm,toString:Tm}));function $m(){return`#${ho(this.r)}${ho(this.g)}${ho(this.b)}`}function _1(){return`#${ho(this.r)}${ho(this.g)}${ho(this.b)}${ho((isNaN(this.opacity)?1:this.opacity)*255)}`}function Tm(){const e=za(this.opacity);return`${e===1?"rgb(":"rgba("}${po(this.r)}, ${po(this.g)}, ${po(this.b)}${e===1?")":`, ${e})`}`}function za(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function po(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ho(e){return e=po(e),(e<16?"0":"")+e.toString(16)}function Mm(e,n,o,i){return i<=0?e=n=o=NaN:o<=0||o>=1?e=n=NaN:n<=0&&(e=NaN),new Xt(e,n,o,i)}function Vm(e){if(e instanceof Xt)return new Xt(e.h,e.s,e.l,e.opacity);if(e instanceof vi||(e=fo(e)),!e)return new Xt;if(e instanceof Xt)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 Xt(l,s,c,e.opacity)}function k1(e,n,o,i){return arguments.length===1?Vm(e):new Xt(e,n,o,i??1)}function Xt(e,n,o,i){this.h=+e,this.s=+n,this.l=+o,this.opacity=+i}Ql(Xt,k1,Cm(vi,{brighter(e){return e=e==null?La:Math.pow(La,e),new Xt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ci:Math.pow(Ci,e),new Xt(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 Ot(ts(e>=240?e-240:e+120,a,i),ts(e,a,i),ts(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new Xt(Bm(this.h),Fa(this.s),Fa(this.l),za(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=za(this.opacity);return`${e===1?"hsl(":"hsla("}${Bm(this.h)}, ${Fa(this.s)*100}%, ${Fa(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bm(e){return e=(e||0)%360,e<0?e+360:e}function Fa(e){return Math.max(0,Math.min(1,e||0))}function ts(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 ns=e=>()=>e;function E1(e,n){return function(o){return e+o*n}}function N1(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 w1(e){return(e=+e)==1?Dm:function(n,o){return o-n?N1(n,o,e):ns(isNaN(n)?o:n)}}function Dm(e,n){var o=n-e;return o?E1(e,o):ns(isNaN(e)?n:e)}const Ua=(function e(n){var o=w1(n);function i(a,r){var l=o((a=es(a)).r,(r=es(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=Dm(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 I1(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 v1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function C1(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]=xi(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 S1(e,n){var o=new Date;return e=+e,n=+n,function(i){return o.setTime(e*(1-i)+n*i),o}}function dn(e,n){return e=+e,n=+n,function(o){return e*(1-o)+n*o}}function x1(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]=xi(e[a],n[a]):i[a]=n[a];return function(r){for(a in o)i[a]=o[a](r);return i}}var os=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,is=new RegExp(os.source,"g");function R1(e){return function(){return e}}function A1(e){return function(n){return e(n)+""}}function Om(e,n){var o=os.lastIndex=is.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",n=n+"";(i=os.exec(e))&&(a=is.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:dn(i,a)})),o=is.lastIndex;return o<n.length&&(r=n.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?A1(c[0].x):R1(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 xi(e,n){var o=typeof n,i;return n==null||o==="boolean"?ns(n):(o==="number"?dn:o==="string"?(i=fo(n))?(n=i,Ua):Om:n instanceof fo?Ua:n instanceof Date?S1:v1(n)?I1:Array.isArray(n)?C1:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?x1:dn)(e,n)}var Lm=180/Math.PI,as={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Pm(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)*Lm,skewX:Math.atan(c)*Lm,scaleX:l,scaleY:s}}var Ha;function $1(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?as:Pm(n.a,n.b,n.c,n.d,n.e,n.f)}function T1(e){return e==null||(Ha||(Ha=document.createElementNS("http://www.w3.org/2000/svg","g")),Ha.setAttribute("transform",e),!(e=Ha.transform.baseVal.consolidate()))?as:(e=e.matrix,Pm(e.a,e.b,e.c,e.d,e.e,e.f))}function zm(e,n,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,p,f,h){if(d!==m||u!==p){var g=f.push("translate(",null,n,null,o);h.push({i:g-4,x:dn(d,m)},{i:g-2,x:dn(u,p)})}else(m||p)&&f.push("translate("+m+n+p+o)}function l(d,u,m,p){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),p.push({i:m.push(a(m)+"rotate(",null,i)-2,x:dn(d,u)})):u&&m.push(a(m)+"rotate("+u+i)}function s(d,u,m,p){d!==u?p.push({i:m.push(a(m)+"skewX(",null,i)-2,x:dn(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,p,f,h){if(d!==m||u!==p){var g=f.push(a(f)+"scale(",null,",",null,")");h.push({i:g-4,x:dn(d,m)},{i:g-2,x:dn(u,p)})}else(m!==1||p!==1)&&f.push(a(f)+"scale("+m+","+p+")")}return function(d,u){var m=[],p=[];return d=e(d),u=e(u),r(d.translateX,d.translateY,u.translateX,u.translateY,m,p),l(d.rotate,u.rotate,m,p),s(d.skewX,u.skewX,m,p),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,m,p),d=u=null,function(f){for(var h=-1,g=p.length,b;++h<g;)m[(b=p[h]).i]=b.x(f);return m.join("")}}}var M1=zm($1,"px, ","px)","deg)"),V1=zm(T1,", ",")",")"),B1=1e-12;function Fm(e){return((e=Math.exp(e))+1/e)/2}function D1(e){return((e=Math.exp(e))-1/e)/2}function O1(e){return((e=Math.exp(2*e))-1)/(e+1)}const ja=(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],p=l[2],f=u-s,h=m-c,g=f*f+h*h,b,_;if(g<B1)_=Math.log(p/d)/n,b=function(A){return[s+A*f,c+A*h,d*Math.exp(n*A*_)]};else{var k=Math.sqrt(g),N=(p*p-d*d+i*g)/(2*d*o*k),y=(p*p-d*d-i*g)/(2*p*o*k),E=Math.log(Math.sqrt(N*N+1)-N),S=Math.log(Math.sqrt(y*y+1)-y);_=(S-E)/n,b=function(A){var V=A*_,$=Fm(E),O=d/(o*k)*($*O1(n*V+E)-D1(E));return[s+O*f,c+O*h,d*$/Fm(n*V+E)]}}return b.duration=_*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 Wo=0,Ri=0,Ai=0,Um=1e3,Ka,$i,Ga=0,yo=0,Ya=0,Ti=typeof performance=="object"&&performance.now?performance:Date,Hm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function rs(){return yo||(Hm(L1),yo=Ti.now()+Ya)}function L1(){yo=0}function qa(){this._call=this._time=this._next=null}qa.prototype=jm.prototype={constructor:qa,restart:function(e,n,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?rs():+o)+(n==null?0:+n),!this._next&&$i!==this&&($i?$i._next=this:Ka=this,$i=this),this._call=e,this._time=o,ls()},stop:function(){this._call&&(this._call=null,this._time=1/0,ls())}};function jm(e,n,o){var i=new qa;return i.restart(e,n,o),i}function P1(){rs(),++Wo;for(var e=Ka,n;e;)(n=yo-e._time)>=0&&e._call.call(void 0,n),e=e._next;--Wo}function Km(){yo=(Ga=Ti.now())+Ya,Wo=Ri=0;try{P1()}finally{Wo=0,F1(),yo=0}}function z1(){var e=Ti.now(),n=e-Ga;n>Um&&(Ya-=n,Ga=e)}function F1(){for(var e,n=Ka,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:Ka=o);$i=e,ls(i)}function ls(e){if(!Wo){Ri&&(Ri=clearTimeout(Ri));var n=e-yo;n>24?(e<1/0&&(Ri=setTimeout(Km,e-Ti.now()-Ya)),Ai&&(Ai=clearInterval(Ai))):(Ai||(Ga=Ti.now(),Ai=setInterval(z1,Um)),Wo=1,Hm(Km))}}function Gm(e,n,o){var i=new qa;return n=n==null?0:+n,i.restart(a=>{i.stop(),e(a+n)},n,o),i}var U1=Ma("start","end","cancel","interrupt"),H1=[],Ym=0,qm=1,ss=2,Wa=3,Wm=4,cs=5,Ja=6;function Xa(e,n,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;j1(e,o,{name:n,index:i,group:a,on:U1,tween:H1,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Ym})}function ds(e,n){var o=Zt(e,n);if(o.state>Ym)throw new Error("too late; already scheduled");return o}function un(e,n){var o=Zt(e,n);if(o.state>Wa)throw new Error("too late; already running");return o}function Zt(e,n){var o=e.__transition;if(!o||!(o=o[n]))throw new Error("transition not found");return o}function j1(e,n,o){var i=e.__transition,a;i[n]=o,o.timer=jm(r,0,o.time);function r(d){o.state=qm,o.timer.restart(l,o.delay,o.time),o.delay<=d&&l(d-o.delay)}function l(d){var u,m,p,f;if(o.state!==qm)return c();for(u in i)if(f=i[u],f.name===o.name){if(f.state===Wa)return Gm(l);f.state===Wm?(f.state=Ja,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<n&&(f.state=Ja,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(Gm(function(){o.state===Wa&&(o.state=Wm,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=ss,o.on.call("start",e,e.__data__,o.index,o.group),o.state===ss){for(o.state=Wa,a=new Array(p=o.tween.length),u=0,m=-1;u<p;++u)(f=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++m]=f);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=cs,1),m=-1,p=a.length;++m<p;)a[m].call(e,u);o.state===cs&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=Ja,o.timer.stop(),delete i[n];for(var d in i)return;delete e.__transition}}function Za(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>ss&&i.state<cs,i.state=Ja,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function K1(e){return this.each(function(){Za(this,e)})}function G1(e,n){var o,i;return function(){var a=un(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 Y1(e,n,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=un(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 q1(e,n){var o=this._id;if(e+="",arguments.length<2){for(var i=Zt(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?G1:Y1)(o,e,n))}function us(e,n,o){var i=e._id;return e.each(function(){var a=un(this,i);(a.value||(a.value={}))[n]=o.apply(this,arguments)}),function(a){return Zt(a,i).value[n]}}function Jm(e,n){var o;return(typeof n=="number"?dn:n instanceof fo?Ua:(o=fo(n))?(n=o,Ua):Om)(e,n)}function W1(e){return function(){this.removeAttribute(e)}}function J1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function X1(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 Z1(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 Q1(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 e0(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 t0(e,n){var o=Ba(e),i=o==="transform"?V1:Jm;return this.attrTween(e,typeof n=="function"?(o.local?e0:Q1)(o,i,us(this,"attr."+e,n)):n==null?(o.local?J1:W1)(o):(o.local?Z1:X1)(o,i,n))}function n0(e,n){return function(o){this.setAttribute(e,n.call(this,o))}}function o0(e,n){return function(o){this.setAttributeNS(e.space,e.local,n.call(this,o))}}function i0(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&o0(e,r)),o}return a._value=n,a}function a0(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&n0(e,r)),o}return a._value=n,a}function r0(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=Ba(e);return this.tween(o,(i.local?i0:a0)(i,n))}function l0(e,n){return function(){ds(this,e).delay=+n.apply(this,arguments)}}function s0(e,n){return n=+n,function(){ds(this,e).delay=n}}function c0(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?l0:s0)(n,e)):Zt(this.node(),n).delay}function d0(e,n){return function(){un(this,e).duration=+n.apply(this,arguments)}}function u0(e,n){return n=+n,function(){un(this,e).duration=n}}function m0(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?d0:u0)(n,e)):Zt(this.node(),n).duration}function f0(e,n){if(typeof n!="function")throw new Error;return function(){un(this,e).ease=n}}function p0(e){var n=this._id;return arguments.length?this.each(f0(n,e)):Zt(this.node(),n).ease}function h0(e,n){return function(){var o=n.apply(this,arguments);if(typeof o!="function")throw new Error;un(this,e).ease=o}}function y0(e){if(typeof e!="function")throw new Error;return this.each(h0(this._id,e))}function g0(e){typeof e!="function"&&(e=pm(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 In(i,this._parents,this._name,this._id)}function b0(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),p,f=0;f<u;++f)(p=c[f]||d[f])&&(m[f]=p);for(;s<i;++s)l[s]=n[s];return new In(l,this._parents,this._name,this._id)}function _0(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 k0(e,n,o){var i,a,r=_0(n)?ds:un;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(n,o),l.on=a}}function E0(e,n){var o=this._id;return arguments.length<2?Zt(this.node(),o).on.on(e):this.each(k0(o,e,n))}function N0(e){return function(){var n=this.parentNode;for(var o in this.__transition)if(+o!==e)return;n&&n.removeChild(this)}}function w0(){return this.on("end.remove",N0(this._id))}function I0(e){var n=this._name,o=this._id;typeof e!="function"&&(e=Wl(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,p=0;p<c;++p)(u=s[p])&&(m=e.call(u,u.__data__,p,s))&&("__data__"in u&&(m.__data__=u.__data__),d[p]=m,Xa(d[p],n,o,p,d,Zt(u,o)));return new In(r,this._parents,n,o)}function v0(e){var n=this._name,o=this._id;typeof e!="function"&&(e=fm(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 p=e.call(u,u.__data__,m,c),f,h=Zt(u,o),g=0,b=p.length;g<b;++g)(f=p[g])&&Xa(f,n,o,g,p,h);r.push(p),l.push(u)}return new In(r,l,n,o)}var C0=wi.prototype.constructor;function S0(){return new C0(this._groups,this._parents)}function x0(e,n){var o,i,a;return function(){var r=Go(this,e),l=(this.style.removeProperty(e),Go(this,e));return r===l?null:r===o&&l===i?a:a=n(o=r,i=l)}}function Xm(e){return function(){this.style.removeProperty(e)}}function R0(e,n,o){var i,a=o+"",r;return function(){var l=Go(this,e);return l===a?null:l===i?r:r=n(i=l,o)}}function A0(e,n,o){var i,a,r;return function(){var l=Go(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Go(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s))}}function $0(e,n){var o,i,a,r="style."+n,l="end."+r,s;return function(){var c=un(this,e),d=c.on,u=c.value[r]==null?s||(s=Xm(n)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function T0(e,n,o){var i=(e+="")=="transform"?M1:Jm;return n==null?this.styleTween(e,x0(e,i)).on("end.style."+e,Xm(e)):typeof n=="function"?this.styleTween(e,A0(e,i,us(this,"style."+e,n))).each($0(this._id,e)):this.styleTween(e,R0(e,i,n),o).on("end.style."+e,null)}function M0(e,n,o){return function(i){this.style.setProperty(e,n.call(this,i),o)}}function V0(e,n,o){var i,a;function r(){var l=n.apply(this,arguments);return l!==a&&(i=(a=l)&&M0(e,l,o)),i}return r._value=n,r}function B0(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,V0(e,n,o??""))}function D0(e){return function(){this.textContent=e}}function O0(e){return function(){var n=e(this);this.textContent=n??""}}function L0(e){return this.tween("text",typeof e=="function"?O0(us(this,"text",e)):D0(e==null?"":e+""))}function P0(e){return function(n){this.textContent=e.call(this,n)}}function z0(e){var n,o;function i(){var a=e.apply(this,arguments);return a!==o&&(n=(o=a)&&P0(a)),n}return i._value=e,i}function F0(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,z0(e))}function U0(){for(var e=this._name,n=this._id,o=Zm(),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=Zt(c,n);Xa(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new In(i,this._parents,e,o)}function H0(){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=un(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 j0=0;function In(e,n,o,i){this._groups=e,this._parents=n,this._name=o,this._id=i}function Zm(){return++j0}var vn=wi.prototype;In.prototype={constructor:In,select:I0,selectAll:v0,selectChild:vn.selectChild,selectChildren:vn.selectChildren,filter:g0,merge:b0,selection:S0,transition:U0,call:vn.call,nodes:vn.nodes,node:vn.node,size:vn.size,empty:vn.empty,each:vn.each,on:E0,attr:t0,attrTween:r0,style:T0,styleTween:B0,text:L0,textTween:F0,remove:w0,tween:q1,delay:c0,duration:m0,ease:p0,easeVarying:y0,end:H0,[Symbol.iterator]:vn[Symbol.iterator]};function K0(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var G0={time:null,delay:0,duration:250,ease:K0};function Y0(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 q0(e){var n,o;e instanceof In?(n=e._id,e=e._name):(n=Zm(),(o=G0).time=rs(),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])&&Xa(c,e,n,d,l,o||Y0(c,n));return new In(i,this._parents,e,n)}wi.prototype.interrupt=K1,wi.prototype.transition=q0;const Qa=e=>()=>e;function W0(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 Cn(e,n,o){this.k=e,this.x=n,this.y=o}Cn.prototype={constructor:Cn,scale:function(e){return e===1?this:new Cn(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Cn(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 Jo=new Cn(1,0,0);Cn.prototype;function ms(e){e.stopImmediatePropagation()}function Mi(e){e.preventDefault(),e.stopImmediatePropagation()}function J0(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function X0(){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 Qm(){return this.__zoom||Jo}function Z0(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Q0(){return navigator.maxTouchPoints||"ontouchstart"in this}function eN(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 tN(){var e=J0,n=X0,o=eN,i=Z0,a=Q0,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=ja,d=Ma("start","zoom","end"),u,m,p,f=500,h=150,g=0,b=10;function _(w){w.property("__zoom",Qm).on("wheel.zoom",V,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",O).filter(a).on("touchstart.zoom",C).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(w,I,v,B){var M=w.selection?w.selection():w;M.property("__zoom",Qm),w!==M?E(w,I,v,B):M.interrupt().each(function(){S(this,arguments).event(B).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},_.scaleBy=function(w,I,v,B){_.scaleTo(w,function(){var M=this.__zoom.k,x=typeof I=="function"?I.apply(this,arguments):I;return M*x},v,B)},_.scaleTo=function(w,I,v,B){_.transform(w,function(){var M=n.apply(this,arguments),x=this.__zoom,P=v==null?y(M):typeof v=="function"?v.apply(this,arguments):v,Y=x.invert(P),se=typeof I=="function"?I.apply(this,arguments):I;return o(N(k(x,se),P,Y),M,l)},v,B)},_.translateBy=function(w,I,v,B){_.transform(w,function(){return o(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof v=="function"?v.apply(this,arguments):v),n.apply(this,arguments),l)},null,B)},_.translateTo=function(w,I,v,B,M){_.transform(w,function(){var x=n.apply(this,arguments),P=this.__zoom,Y=B==null?y(x):typeof B=="function"?B.apply(this,arguments):B;return o(Jo.translate(Y[0],Y[1]).scale(P.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof v=="function"?-v.apply(this,arguments):-v),x,l)},B,M)};function k(w,I){return I=Math.max(r[0],Math.min(r[1],I)),I===w.k?w:new Cn(I,w.x,w.y)}function N(w,I,v){var B=I[0]-v[0]*w.k,M=I[1]-v[1]*w.k;return B===w.x&&M===w.y?w:new Cn(w.k,B,M)}function y(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function E(w,I,v,B){w.on("start.zoom",function(){S(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(B).end()}).tween("zoom",function(){var M=this,x=arguments,P=S(M,x).event(B),Y=n.apply(M,x),se=v==null?y(Y):typeof v=="function"?v.apply(M,x):v,he=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),ie=M.__zoom,fe=typeof I=="function"?I.apply(M,x):I,pe=c(ie.invert(se).concat(he/ie.k),fe.invert(se).concat(he/fe.k));return function(ge){if(ge===1)ge=fe;else{var Te=pe(ge),He=he/Te[2];ge=new Cn(He,se[0]-Te[0]*He,se[1]-Te[1]*He)}P.zoom(null,ge)}})}function S(w,I,v){return!v&&w.__zooming||new A(w,I)}function A(w,I){this.that=w,this.args=I,this.active=0,this.sourceEvent=null,this.extent=n.apply(w,I),this.taps=0}A.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,I){return this.mouse&&w!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var I=Jt(this.that).datum();d.call(w,this.that,new W0(w,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),I)}};function V(w,...I){if(!e.apply(this,arguments))return;var v=S(this,I).event(w),B=this.__zoom,M=Math.max(r[0],Math.min(r[1],B.k*Math.pow(2,i.apply(this,arguments)))),x=sn(w);if(v.wheel)(v.mouse[0][0]!==x[0]||v.mouse[0][1]!==x[1])&&(v.mouse[1]=B.invert(v.mouse[0]=x)),clearTimeout(v.wheel);else{if(B.k===M)return;v.mouse=[x,B.invert(x)],Za(this),v.start()}Mi(w),v.wheel=setTimeout(P,h),v.zoom("mouse",o(N(k(B,M),v.mouse[0],v.mouse[1]),v.extent,l));function P(){v.wheel=null,v.end()}}function $(w,...I){if(p||!e.apply(this,arguments))return;var v=w.currentTarget,B=S(this,I,!0).event(w),M=Jt(w.view).on("mousemove.zoom",se,!0).on("mouseup.zoom",he,!0),x=sn(w,v),P=w.clientX,Y=w.clientY;Im(w.view),ms(w),B.mouse=[x,this.__zoom.invert(x)],Za(this),B.start();function se(ie){if(Mi(ie),!B.moved){var fe=ie.clientX-P,pe=ie.clientY-Y;B.moved=fe*fe+pe*pe>g}B.event(ie).zoom("mouse",o(N(B.that.__zoom,B.mouse[0]=sn(ie,v),B.mouse[1]),B.extent,l))}function he(ie){M.on("mousemove.zoom mouseup.zoom",null),vm(ie.view,B.moved),Mi(ie),B.event(ie).end()}}function O(w,...I){if(e.apply(this,arguments)){var v=this.__zoom,B=sn(w.changedTouches?w.changedTouches[0]:w,this),M=v.invert(B),x=v.k*(w.shiftKey?.5:2),P=o(N(k(v,x),B,M),n.apply(this,I),l);Mi(w),s>0?Jt(this).transition().duration(s).call(E,P,B,w):Jt(this).call(_.transform,P,B,w)}}function C(w,...I){if(e.apply(this,arguments)){var v=w.touches,B=v.length,M=S(this,I,w.changedTouches.length===B).event(w),x,P,Y,se;for(ms(w),P=0;P<B;++P)Y=v[P],se=sn(Y,this),se=[se,this.__zoom.invert(se),Y.identifier],M.touch0?!M.touch1&&M.touch0[2]!==se[2]&&(M.touch1=se,M.taps=0):(M.touch0=se,x=!0,M.taps=1+!!u);u&&(u=clearTimeout(u)),x&&(M.taps<2&&(m=se[0],u=setTimeout(function(){u=null},f)),Za(this),M.start())}}function R(w,...I){if(this.__zooming){var v=S(this,I).event(w),B=w.changedTouches,M=B.length,x,P,Y,se;for(Mi(w),x=0;x<M;++x)P=B[x],Y=sn(P,this),v.touch0&&v.touch0[2]===P.identifier?v.touch0[0]=Y:v.touch1&&v.touch1[2]===P.identifier&&(v.touch1[0]=Y);if(P=v.that.__zoom,v.touch1){var he=v.touch0[0],ie=v.touch0[1],fe=v.touch1[0],pe=v.touch1[1],ge=(ge=fe[0]-he[0])*ge+(ge=fe[1]-he[1])*ge,Te=(Te=pe[0]-ie[0])*Te+(Te=pe[1]-ie[1])*Te;P=k(P,Math.sqrt(ge/Te)),Y=[(he[0]+fe[0])/2,(he[1]+fe[1])/2],se=[(ie[0]+pe[0])/2,(ie[1]+pe[1])/2]}else if(v.touch0)Y=v.touch0[0],se=v.touch0[1];else return;v.zoom("touch",o(N(P,Y,se),v.extent,l))}}function T(w,...I){if(this.__zooming){var v=S(this,I).event(w),B=w.changedTouches,M=B.length,x,P;for(ms(w),p&&clearTimeout(p),p=setTimeout(function(){p=null},f),x=0;x<M;++x)P=B[x],v.touch0&&v.touch0[2]===P.identifier?delete v.touch0:v.touch1&&v.touch1[2]===P.identifier&&delete v.touch1;if(v.touch1&&!v.touch0&&(v.touch0=v.touch1,delete v.touch1),v.touch0)v.touch0[1]=this.__zoom.invert(v.touch0[0]);else if(v.end(),v.taps===2&&(P=sn(P,this),Math.hypot(m[0]-P[0],m[1]-P[1])<b)){var Y=Jt(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return _.wheelDelta=function(w){return arguments.length?(i=typeof w=="function"?w:Qa(+w),_):i},_.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Qa(!!w),_):e},_.touchable=function(w){return arguments.length?(a=typeof w=="function"?w:Qa(!!w),_):a},_.extent=function(w){return arguments.length?(n=typeof w=="function"?w:Qa([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),_):n},_.scaleExtent=function(w){return arguments.length?(r[0]=+w[0],r[1]=+w[1],_):[r[0],r[1]]},_.translateExtent=function(w){return arguments.length?(l[0][0]=+w[0][0],l[1][0]=+w[1][0],l[0][1]=+w[0][1],l[1][1]=+w[1][1],_):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},_.constrain=function(w){return arguments.length?(o=w,_):o},_.duration=function(w){return arguments.length?(s=+w,_):s},_.interpolate=function(w){return arguments.length?(c=w,_):c},_.on=function(){var w=d.on.apply(d,arguments);return w===d?_:w},_.clickDistance=function(w){return arguments.length?(g=(w=+w)*w,_):Math.sqrt(g)},_.tapDistance=function(w){return arguments.length?(b=+w,_):b},_}var Oe=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(Oe||{}),fs=(e=>(e.Partial="partial",e.Full="full",e))(fs||{}),go=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(go||{}),Sn=(e=>(e.Strict="strict",e.Loose="loose",e))(Sn||{}),ps=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(ps||{}),Vi=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Vi||{}),ef=(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))(ef||{});const nN=["INPUT","SELECT","TEXTAREA"],oN=typeof document<"u"?document:null;function hs(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 nN.includes(i==null?void 0:i.nodeName)||a||!!r}function iN(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function tf(e,n,o,i){const a=n.replace("+",`
28
28
  `).replace(`
29
29
 
30
30
  `,`
31
31
  +`).split(`
32
- `).map(l=>l.trim().toLowerCase());if(a.length===1)return e.toLowerCase()===n.toLowerCase();i||o.add(e.toLowerCase());const r=a.every((l,s)=>o.has(l)&&Array.from(o.values())[s]===a[s]);return i&&o.delete(e.toLowerCase()),r}function iN(e,n){return o=>{if(!o.code&&!o.key)return!1;const i=aN(o.code,e);return Array.isArray(e)?e.some(a=>tf(o[i],a,n,o.type==="keyup")):tf(o[i],e,n,o.type==="keyup")}}function aN(e,n){return n.includes(e)?"code":"key"}function Bi(e,n){const o=t.computed(()=>t.toValue(n==null?void 0:n.target)??nN),i=t.shallowRef(t.toValue(e)===!0);let a=!1;const r=new Set;let l=c(t.toValue(e));t.watch(()=>t.toValue(e),(d,u)=>{typeof u=="boolean"&&typeof d!="boolean"&&s(),l=c(d)},{immediate:!0}),sm(["blur","contextmenu"],s),cm((...d)=>l(...d),d=>{var u,m;const p=t.toValue(n==null?void 0:n.actInsideInputWithModifier)??!0,f=t.toValue(n==null?void 0:n.preventDefault)??!1;if(a=oN(d),(!a||a&&!p)&&hs(d))return;const g=((m=(u=d.composedPath)==null?void 0:u.call(d))==null?void 0:m[0])||d.target,b=(g==null?void 0:g.nodeName)==="BUTTON"||(g==null?void 0:g.nodeName)==="A";!f&&(a||!b)&&d.preventDefault(),i.value=!0},{eventName:"keydown",target:o}),cm((...d)=>l(...d),d=>{const u=t.toValue(n==null?void 0:n.actInsideInputWithModifier)??!0;if(i.value){if((!a||a&&!u)&&hs(d))return;a=!1,i.value=!1}},{eventName:"keyup",target:o});function s(){a=!1,r.clear(),i.value=t.toValue(e)===!0}function c(d){return d===null?(s(),()=>!1):typeof d=="boolean"?(s(),i.value=d,()=>!1):Array.isArray(d)||typeof d=="string"?iN(d,r):d}return i}const nf="vue-flow__node-desc",of="vue-flow__edge-desc",rN="vue-flow__aria-live",af=["Enter"," ","Escape"],Xo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function er(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function tr(e,n){const o=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),i=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(o*i)}function nr(e){return{width:e.offsetWidth,height:e.offsetHeight}}function bo(e,n=0,o=1){return Math.min(Math.max(e,n),o)}function rf(e,n){return{x:bo(e.x,n[0][0],n[1][0]),y:bo(e.y,n[0][1],n[1][1])}}function lf(e){const n=e.getRootNode();return"elementFromPoint"in n?n:window.document}function Un(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function _o(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Un(e)}function Di(e){return _o(e)&&"computedPosition"in e}function or(e){return!Number.isNaN(e)&&Number.isFinite(e)}function lN(e){return or(e.width)&&or(e.height)&&or(e.x)&&or(e.y)}function sN(e,n,o){const i={id:e.id.toString(),type:e.type??"default",dimensions:t.markRaw({width:0,height:0}),computedPosition:t.markRaw({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Et(e.data)?e.data:{},events:t.markRaw(Et(e.events)?e.events:{})};return Object.assign(n??i,e,{id:e.id.toString(),parentNode:o})}function sf(e,n,o){var i,a;const r={id:e.id.toString(),type:e.type??(n==null?void 0:n.type)??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(i=e.sourceHandle)==null?void 0:i.toString(),targetHandle:(a=e.targetHandle)==null?void 0:a.toString(),updatable:e.updatable??(o==null?void 0:o.updatable),selectable:e.selectable??(o==null?void 0:o.selectable),focusable:e.focusable??(o==null?void 0:o.focusable),data:Et(e.data)?e.data:{},events:t.markRaw(Et(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(o==null?void 0:o.interactionWidth),...o??{}};return Object.assign(n??r,e,{id:e.id.toString()})}function cf(e,n,o,i){const a=typeof e=="string"?e:e.id,r=new Set,l=i==="source"?"target":"source";for(const s of o)s[l]===a&&r.add(s[i]);return n.filter(s=>r.has(s.id))}function cN(...e){if(e.length===3){const[r,l,s]=e;return cf(r,l,s,"target")}const[n,o]=e,i=typeof n=="string"?n:n.id;return o.filter(r=>Un(r)&&r.source===i).map(r=>o.find(l=>_o(l)&&l.id===r.target))}function dN(...e){if(e.length===3){const[r,l,s]=e;return cf(r,l,s,"source")}const[n,o]=e,i=typeof n=="string"?n:n.id;return o.filter(r=>Un(r)&&r.target===i).map(r=>o.find(l=>_o(l)&&l.id===r.source))}function df({source:e,sourceHandle:n,target:o,targetHandle:i}){return`vueflow__edge-${e}${n??""}-${o}${i??""}`}function uN(e,n){return n.some(o=>Un(o)&&o.source===e.source&&o.target===e.target&&(o.sourceHandle===e.sourceHandle||!o.sourceHandle&&!e.sourceHandle)&&(o.targetHandle===e.targetHandle||!o.targetHandle&&!e.targetHandle))}function Oi({x:e,y:n},{x:o,y:i,zoom:a}){return{x:e*a+o,y:n*a+i}}function Li({x:e,y:n},{x:o,y:i,zoom:a},r=!1,l=[1,1]){const s={x:(e-o)/a,y:(n-i)/a};return r?ar(s,l):s}function uf(e,n){return{x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}}function ir({x:e,y:n,width:o,height:i}){return{x:e,y:n,x2:e+o,y2:n+i}}function mf({x:e,y:n,x2:o,y2:i}){return{x:e,y:n,width:o-e,height:i-n}}function mN(e,n){return mf(uf(ir(e),ir(n)))}function ys(e){let n={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let o=0;o<e.length;o++){const i=e[o];n=uf(n,ir({...i.computedPosition,...i.dimensions}))}return mf(n)}function ff(e,n,o={x:0,y:0,zoom:1},i=!1,a=!1){const r={...Li(n,o),width:n.width/o.zoom,height:n.height/o.zoom},l=[];for(const s of e){const{dimensions:c,selectable:d=!0,hidden:u=!1}=s,m=c.width??s.width??null,p=c.height??s.height??null;if(a&&!d||u)continue;const f=tr(r,er(s)),h=m===null||p===null,g=i&&f>0,b=(m??0)*(p??0);(h||g||f>=b||s.dragging)&&l.push(s)}return l}function ko(e,n){const o=new Set;if(typeof e=="string")o.add(e);else if(e.length>=1)for(const i of e)o.add(i.id);return n.filter(i=>o.has(i.source)||o.has(i.target))}function Zo(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const o=Number.parseFloat(e);if(!Number.isNaN(o))return Math.floor(o)}if(typeof e=="string"&&e.endsWith("%")){const o=Number.parseFloat(e);if(!Number.isNaN(o))return Math.floor(n*o*.01)}return Fi(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function fN(e,n,o){if(typeof e=="string"||typeof e=="number"){const i=Zo(e,o),a=Zo(e,n);return{top:i,right:a,bottom:i,left:a,x:a*2,y:i*2}}if(typeof e=="object"){const i=Zo(e.top??e.y??0,o),a=Zo(e.bottom??e.y??0,o),r=Zo(e.left??e.x??0,n),l=Zo(e.right??e.x??0,n);return{top:i,right:l,bottom:a,left:r,x:r+l,y:i+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function pN(e,n,o,i,a,r){const{x:l,y:s}=Oi(e,{x:n,y:o,zoom:i}),{x:c,y:d}=Oi({x:e.x+e.width,y:e.y+e.height},{x:n,y:o,zoom:i}),u=a-c,m=r-d;return{left:Math.floor(l),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(m)}}function pf(e,n,o,i,a,r=.1){const l=fN(r,n,o),s=(n-l.x)/e.width,c=(o-l.y)/e.height,d=Math.min(s,c),u=bo(d,i,a),m=e.x+e.width/2,p=e.y+e.height/2,f=n/2-m*u,h=o/2-p*u,g=pN(e,f,h,u,n,o),b={left:Math.min(g.left-l.left,0),top:Math.min(g.top-l.top,0),right:Math.min(g.right-l.right,0),bottom:Math.min(g.bottom-l.bottom,0)};return{x:f-b.left+b.right,y:h-b.top+b.bottom,zoom:u}}function hN(e,n){return{x:n.x+e.x,y:n.y+e.y,z:(e.z>n.z?e.z:n.z)+1}}function hf(e,n){if(!e.parentNode)return!1;const o=n.get(e.parentNode);return o?o.selected?!0:hf(o,n):!1}function Pi(e,n){return typeof e>"u"?"":typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`}function gs(e){const n=e.ctrlKey&&zi()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n}function yf(e,n,o){return e<n?bo(Math.abs(e-n),1,n)/n:e>o?-bo(Math.abs(e-o),1,n)/n:0}function gf(e,n,o=15,i=40){const a=yf(e.x,i,n.width-i)*o,r=yf(e.y,i,n.height-i)*o;return[a,r]}function bs(e,n){if(n){const o=e.position.x+e.dimensions.width-n.dimensions.width,i=e.position.y+e.dimensions.height-n.dimensions.height;if(o>0||i>0||e.position.x<0||e.position.y<0){let a={};if(typeof n.style=="function"?a={...n.style(n)}:n.style&&(a={...n.style}),a.width=a.width??`${n.dimensions.width}px`,a.height=a.height??`${n.dimensions.height}px`,o>0)if(typeof a.width=="string"){const r=Number(a.width.replace("px",""));a.width=`${r+o}px`}else a.width+=o;if(i>0)if(typeof a.height=="string"){const r=Number(a.height.replace("px",""));a.height=`${r+i}px`}else a.height+=i;if(e.position.x<0){const r=Math.abs(e.position.x);if(n.position.x=n.position.x-r,typeof a.width=="string"){const l=Number(a.width.replace("px",""));a.width=`${l+r}px`}else a.width+=r;e.position.x=0}if(e.position.y<0){const r=Math.abs(e.position.y);if(n.position.y=n.position.y-r,typeof a.height=="string"){const l=Number(a.height.replace("px",""));a.height=`${l+r}px`}else a.height+=r;e.position.y=0}n.dimensions.width=Number(a.width.toString().replace("px","")),n.dimensions.height=Number(a.height.toString().replace("px","")),typeof n.style=="function"?n.style=r=>{const l=n.style;return{...l(r),...a}}:n.style={...n.style,...a}}}}function bf(e,n){var o,i;const a=e.filter(l=>l.type==="add"||l.type==="remove");for(const l of a)if(l.type==="add")n.findIndex(c=>c.id===l.item.id)===-1&&n.push(l.item);else if(l.type==="remove"){const s=n.findIndex(c=>c.id===l.id);s!==-1&&n.splice(s,1)}const r=n.map(l=>l.id);for(const l of n)for(const s of e)if(s.id===l.id)switch(s.type){case"select":l.selected=s.selected;break;case"position":if(Di(l)&&(typeof s.position<"u"&&(l.position=s.position),typeof s.dragging<"u"&&(l.dragging=s.dragging),l.expandParent&&l.parentNode)){const c=n[r.indexOf(l.parentNode)];c&&Di(c)&&bs(l,c)}break;case"dimensions":if(Di(l)&&(typeof s.dimensions<"u"&&(l.dimensions=s.dimensions),typeof s.updateStyle<"u"&&s.updateStyle&&(l.style={...l.style||{},width:`${(o=s.dimensions)==null?void 0:o.width}px`,height:`${(i=s.dimensions)==null?void 0:i.height}px`}),typeof s.resizing<"u"&&(l.resizing=s.resizing),l.expandParent&&l.parentNode)){const c=n[r.indexOf(l.parentNode)];c&&Di(c)&&(!!c.dimensions.width&&!!c.dimensions.height?bs(l,c):t.nextTick(()=>{bs(l,c)}))}break}return n}function Hn(e,n){return{id:e,type:"select",selected:n}}function _f(e){return{item:e,type:"add"}}function kf(e){return{id:e,type:"remove"}}function Ef(e,n,o,i,a){return{id:e,source:n,target:o,sourceHandle:i||null,targetHandle:a||null,type:"remove"}}function jn(e,n=new Set,o=!1){const i=[];for(const[a,r]of e){const l=n.has(a);!(r.selected===void 0&&!l)&&r.selected!==l&&(o&&(r.selected=l),i.push(Hn(r.id,l)))}return i}const Nf=()=>{};function Me(e){const n=new Set;let o=Nf,i=()=>!1;const a=()=>n.size>0||i(),r=p=>{o=p},l=()=>{o=Nf},s=p=>{i=p},c=()=>{i=()=>!1},d=p=>{n.delete(p)};return{on:p=>{n.add(p);const f=()=>d(p);return Ni(f),{off:f}},off:d,trigger:p=>{const f=[o];return a()?f.push(...n):e&&f.push(e),Promise.allSettled(f.map(h=>h(p)))},hasListeners:a,listeners:n,setEmitter:r,removeEmitter:l,setHasEmitListeners:s,removeHasEmitListeners:c}}function wf(e,n,o){let i=e;do{if(i&&i.matches(n))return!0;if(i===o)return!1;i=i.parentElement}while(i);return!1}function yN(e,n,o,i){var a,r;const l=new Map;for(const[s,c]of e)(c.selected||c.id===i)&&(!c.parentNode||!hf(c,e))&&(c.draggable||n&&typeof c.draggable>"u")&&e.get(s)&&l.set(s,{id:c.id,position:c.position||{x:0,y:0},distance:{x:o.x-((a=c.computedPosition)==null?void 0:a.x)||0,y:o.y-((r=c.computedPosition)==null?void 0:r.y)||0},from:{x:c.computedPosition.x,y:c.computedPosition.y},extent:c.extent,parentNode:c.parentNode,dimensions:{...c.dimensions},expandParent:c.expandParent});return Array.from(l.values())}function _s({id:e,dragItems:n,findNode:o}){const i=[];for(const a of n){const r=o(a.id);r&&i.push(r)}return[e?i.find(a=>a.id===e):i[0],i]}function If(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function gN(e,n,o){const[i,a,r,l]=typeof e!="string"?If(e.padding):[0,0,0,0];return o&&typeof o.computedPosition.x<"u"&&typeof o.computedPosition.y<"u"&&typeof o.dimensions.width<"u"&&typeof o.dimensions.height<"u"?[[o.computedPosition.x+l,o.computedPosition.y+i],[o.computedPosition.x+o.dimensions.width-a,o.computedPosition.y+o.dimensions.height-r]]:!1}function bN(e,n,o,i){let a=e.extent||o;if((a==="parent"||!Array.isArray(a)&&(a==null?void 0:a.range)==="parent")&&!e.expandParent)if(e.parentNode&&i&&e.dimensions.width&&e.dimensions.height){const r=gN(a,e,i);r&&(a=r)}else n(new wt(kt.NODE_EXTENT_INVALID,e.id)),a=o;else if(Array.isArray(a)){const r=(i==null?void 0:i.computedPosition.x)||0,l=(i==null?void 0:i.computedPosition.y)||0;a=[[a[0][0]+r,a[0][1]+l],[a[1][0]+r,a[1][1]+l]]}else if(a!=="parent"&&(a!=null&&a.range)&&Array.isArray(a.range)){const[r,l,s,c]=If(a.padding),d=(i==null?void 0:i.computedPosition.x)||0,u=(i==null?void 0:i.computedPosition.y)||0;a=[[a.range[0][0]+d+c,a.range[0][1]+u+r],[a.range[1][0]+d-l,a.range[1][1]+u-s]]}return a==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:a}function _N({width:e,height:n},o){return[o[0],[o[1][0]-(e||0),o[1][1]-(n||0)]]}function ks(e,n,o,i,a){const r=_N(e.dimensions,bN(e,o,i,a)),l=rf(n,r);return{position:{x:l.x-((a==null?void 0:a.computedPosition.x)||0),y:l.y-((a==null?void 0:a.computedPosition.y)||0)},computedPosition:l}}function Qo(e,n,o=Oe.Left,i=!1){const a=((n==null?void 0:n.x)??0)+e.computedPosition.x,r=((n==null?void 0:n.y)??0)+e.computedPosition.y,{width:l,height:s}=n??wN(e);if(i)return{x:a+l/2,y:r+s/2};switch((n==null?void 0:n.position)??o){case Oe.Top:return{x:a+l/2,y:r};case Oe.Right:return{x:a+l,y:r+s/2};case Oe.Bottom:return{x:a+l/2,y:r+s};case Oe.Left:return{x:a,y:r+s/2}}}function vf(e,n){return e&&(n?e.find(o=>o.id===n):e[0])||null}function kN({sourcePos:e,targetPos:n,sourceWidth:o,sourceHeight:i,targetWidth:a,targetHeight:r,width:l,height:s,viewport:c}){const d={x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x+o,n.x+a),y2:Math.max(e.y+i,n.y+r)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const u=ir({x:(0-c.x)/c.zoom,y:(0-c.y)/c.zoom,width:l/c.zoom,height:s/c.zoom}),m=Math.max(0,Math.min(u.x2,d.x2)-Math.max(u.x,d.x)),p=Math.max(0,Math.min(u.y2,d.y2)-Math.max(u.y,d.y));return Math.ceil(m*p)>0}function EN(e,n,o=!1){const i=typeof e.zIndex=="number";let a=i?e.zIndex:0;const r=n(e.source),l=n(e.target);return!r||!l?0:(o&&(a=i?e.zIndex:Math.max(r.computedPosition.z||0,l.computedPosition.z||0)),a)}var kt=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(kt||{});const Cf={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
32
+ `).map(l=>l.trim().toLowerCase());if(a.length===1)return e.toLowerCase()===n.toLowerCase();i||o.add(e.toLowerCase());const r=a.every((l,s)=>o.has(l)&&Array.from(o.values())[s]===a[s]);return i&&o.delete(e.toLowerCase()),r}function aN(e,n){return o=>{if(!o.code&&!o.key)return!1;const i=rN(o.code,e);return Array.isArray(e)?e.some(a=>tf(o[i],a,n,o.type==="keyup")):tf(o[i],e,n,o.type==="keyup")}}function rN(e,n){return n.includes(e)?"code":"key"}function Bi(e,n){const o=t.computed(()=>t.toValue(n==null?void 0:n.target)??oN),i=t.shallowRef(t.toValue(e)===!0);let a=!1;const r=new Set;let l=c(t.toValue(e));t.watch(()=>t.toValue(e),(d,u)=>{typeof u=="boolean"&&typeof d!="boolean"&&s(),l=c(d)},{immediate:!0}),sm(["blur","contextmenu"],s),cm((...d)=>l(...d),d=>{var u,m;const p=t.toValue(n==null?void 0:n.actInsideInputWithModifier)??!0,f=t.toValue(n==null?void 0:n.preventDefault)??!1;if(a=iN(d),(!a||a&&!p)&&hs(d))return;const g=((m=(u=d.composedPath)==null?void 0:u.call(d))==null?void 0:m[0])||d.target,b=(g==null?void 0:g.nodeName)==="BUTTON"||(g==null?void 0:g.nodeName)==="A";!f&&(a||!b)&&d.preventDefault(),i.value=!0},{eventName:"keydown",target:o}),cm((...d)=>l(...d),d=>{const u=t.toValue(n==null?void 0:n.actInsideInputWithModifier)??!0;if(i.value){if((!a||a&&!u)&&hs(d))return;a=!1,i.value=!1}},{eventName:"keyup",target:o});function s(){a=!1,r.clear(),i.value=t.toValue(e)===!0}function c(d){return d===null?(s(),()=>!1):typeof d=="boolean"?(s(),i.value=d,()=>!1):Array.isArray(d)||typeof d=="string"?aN(d,r):d}return i}const nf="vue-flow__node-desc",of="vue-flow__edge-desc",lN="vue-flow__aria-live",af=["Enter"," ","Escape"],Xo={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function er(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function tr(e,n){const o=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),i=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(o*i)}function nr(e){return{width:e.offsetWidth,height:e.offsetHeight}}function bo(e,n=0,o=1){return Math.min(Math.max(e,n),o)}function rf(e,n){return{x:bo(e.x,n[0][0],n[1][0]),y:bo(e.y,n[0][1],n[1][1])}}function lf(e){const n=e.getRootNode();return"elementFromPoint"in n?n:window.document}function Un(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function _o(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Un(e)}function Di(e){return _o(e)&&"computedPosition"in e}function or(e){return!Number.isNaN(e)&&Number.isFinite(e)}function sN(e){return or(e.width)&&or(e.height)&&or(e.x)&&or(e.y)}function cN(e,n,o){const i={id:e.id.toString(),type:e.type??"default",dimensions:t.markRaw({width:0,height:0}),computedPosition:t.markRaw({z:0,...e.position}),handleBounds:{source:[],target:[]},draggable:void 0,selectable:void 0,connectable:void 0,focusable:void 0,selected:!1,dragging:!1,resizing:!1,initialized:!1,isParent:!1,position:{x:0,y:0},data:Et(e.data)?e.data:{},events:t.markRaw(Et(e.events)?e.events:{})};return Object.assign(n??i,e,{id:e.id.toString(),parentNode:o})}function sf(e,n,o){var i,a;const r={id:e.id.toString(),type:e.type??(n==null?void 0:n.type)??"default",source:e.source.toString(),target:e.target.toString(),sourceHandle:(i=e.sourceHandle)==null?void 0:i.toString(),targetHandle:(a=e.targetHandle)==null?void 0:a.toString(),updatable:e.updatable??(o==null?void 0:o.updatable),selectable:e.selectable??(o==null?void 0:o.selectable),focusable:e.focusable??(o==null?void 0:o.focusable),data:Et(e.data)?e.data:{},events:t.markRaw(Et(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(o==null?void 0:o.interactionWidth),...o??{}};return Object.assign(n??r,e,{id:e.id.toString()})}function cf(e,n,o,i){const a=typeof e=="string"?e:e.id,r=new Set,l=i==="source"?"target":"source";for(const s of o)s[l]===a&&r.add(s[i]);return n.filter(s=>r.has(s.id))}function dN(...e){if(e.length===3){const[r,l,s]=e;return cf(r,l,s,"target")}const[n,o]=e,i=typeof n=="string"?n:n.id;return o.filter(r=>Un(r)&&r.source===i).map(r=>o.find(l=>_o(l)&&l.id===r.target))}function uN(...e){if(e.length===3){const[r,l,s]=e;return cf(r,l,s,"source")}const[n,o]=e,i=typeof n=="string"?n:n.id;return o.filter(r=>Un(r)&&r.target===i).map(r=>o.find(l=>_o(l)&&l.id===r.source))}function df({source:e,sourceHandle:n,target:o,targetHandle:i}){return`vueflow__edge-${e}${n??""}-${o}${i??""}`}function mN(e,n){return n.some(o=>Un(o)&&o.source===e.source&&o.target===e.target&&(o.sourceHandle===e.sourceHandle||!o.sourceHandle&&!e.sourceHandle)&&(o.targetHandle===e.targetHandle||!o.targetHandle&&!e.targetHandle))}function Oi({x:e,y:n},{x:o,y:i,zoom:a}){return{x:e*a+o,y:n*a+i}}function Li({x:e,y:n},{x:o,y:i,zoom:a},r=!1,l=[1,1]){const s={x:(e-o)/a,y:(n-i)/a};return r?ar(s,l):s}function uf(e,n){return{x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}}function ir({x:e,y:n,width:o,height:i}){return{x:e,y:n,x2:e+o,y2:n+i}}function mf({x:e,y:n,x2:o,y2:i}){return{x:e,y:n,width:o-e,height:i-n}}function fN(e,n){return mf(uf(ir(e),ir(n)))}function ys(e){let n={x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY,x2:Number.NEGATIVE_INFINITY,y2:Number.NEGATIVE_INFINITY};for(let o=0;o<e.length;o++){const i=e[o];n=uf(n,ir({...i.computedPosition,...i.dimensions}))}return mf(n)}function ff(e,n,o={x:0,y:0,zoom:1},i=!1,a=!1){const r={...Li(n,o),width:n.width/o.zoom,height:n.height/o.zoom},l=[];for(const s of e){const{dimensions:c,selectable:d=!0,hidden:u=!1}=s,m=c.width??s.width??null,p=c.height??s.height??null;if(a&&!d||u)continue;const f=tr(r,er(s)),h=m===null||p===null,g=i&&f>0,b=(m??0)*(p??0);(h||g||f>=b||s.dragging)&&l.push(s)}return l}function ko(e,n){const o=new Set;if(typeof e=="string")o.add(e);else if(e.length>=1)for(const i of e)o.add(i.id);return n.filter(i=>o.has(i.source)||o.has(i.target))}function Zo(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const o=Number.parseFloat(e);if(!Number.isNaN(o))return Math.floor(o)}if(typeof e=="string"&&e.endsWith("%")){const o=Number.parseFloat(e);if(!Number.isNaN(o))return Math.floor(n*o*.01)}return Fi(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function pN(e,n,o){if(typeof e=="string"||typeof e=="number"){const i=Zo(e,o),a=Zo(e,n);return{top:i,right:a,bottom:i,left:a,x:a*2,y:i*2}}if(typeof e=="object"){const i=Zo(e.top??e.y??0,o),a=Zo(e.bottom??e.y??0,o),r=Zo(e.left??e.x??0,n),l=Zo(e.right??e.x??0,n);return{top:i,right:l,bottom:a,left:r,x:r+l,y:i+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function hN(e,n,o,i,a,r){const{x:l,y:s}=Oi(e,{x:n,y:o,zoom:i}),{x:c,y:d}=Oi({x:e.x+e.width,y:e.y+e.height},{x:n,y:o,zoom:i}),u=a-c,m=r-d;return{left:Math.floor(l),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(m)}}function pf(e,n,o,i,a,r=.1){const l=pN(r,n,o),s=(n-l.x)/e.width,c=(o-l.y)/e.height,d=Math.min(s,c),u=bo(d,i,a),m=e.x+e.width/2,p=e.y+e.height/2,f=n/2-m*u,h=o/2-p*u,g=hN(e,f,h,u,n,o),b={left:Math.min(g.left-l.left,0),top:Math.min(g.top-l.top,0),right:Math.min(g.right-l.right,0),bottom:Math.min(g.bottom-l.bottom,0)};return{x:f-b.left+b.right,y:h-b.top+b.bottom,zoom:u}}function yN(e,n){return{x:n.x+e.x,y:n.y+e.y,z:(e.z>n.z?e.z:n.z)+1}}function hf(e,n){if(!e.parentNode)return!1;const o=n.get(e.parentNode);return o?o.selected?!0:hf(o,n):!1}function Pi(e,n){return typeof e>"u"?"":typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`}function gs(e){const n=e.ctrlKey&&zi()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n}function yf(e,n,o){return e<n?bo(Math.abs(e-n),1,n)/n:e>o?-bo(Math.abs(e-o),1,n)/n:0}function gf(e,n,o=15,i=40){const a=yf(e.x,i,n.width-i)*o,r=yf(e.y,i,n.height-i)*o;return[a,r]}function bs(e,n){if(n){const o=e.position.x+e.dimensions.width-n.dimensions.width,i=e.position.y+e.dimensions.height-n.dimensions.height;if(o>0||i>0||e.position.x<0||e.position.y<0){let a={};if(typeof n.style=="function"?a={...n.style(n)}:n.style&&(a={...n.style}),a.width=a.width??`${n.dimensions.width}px`,a.height=a.height??`${n.dimensions.height}px`,o>0)if(typeof a.width=="string"){const r=Number(a.width.replace("px",""));a.width=`${r+o}px`}else a.width+=o;if(i>0)if(typeof a.height=="string"){const r=Number(a.height.replace("px",""));a.height=`${r+i}px`}else a.height+=i;if(e.position.x<0){const r=Math.abs(e.position.x);if(n.position.x=n.position.x-r,typeof a.width=="string"){const l=Number(a.width.replace("px",""));a.width=`${l+r}px`}else a.width+=r;e.position.x=0}if(e.position.y<0){const r=Math.abs(e.position.y);if(n.position.y=n.position.y-r,typeof a.height=="string"){const l=Number(a.height.replace("px",""));a.height=`${l+r}px`}else a.height+=r;e.position.y=0}n.dimensions.width=Number(a.width.toString().replace("px","")),n.dimensions.height=Number(a.height.toString().replace("px","")),typeof n.style=="function"?n.style=r=>{const l=n.style;return{...l(r),...a}}:n.style={...n.style,...a}}}}function bf(e,n){var o,i;const a=e.filter(l=>l.type==="add"||l.type==="remove");for(const l of a)if(l.type==="add")n.findIndex(c=>c.id===l.item.id)===-1&&n.push(l.item);else if(l.type==="remove"){const s=n.findIndex(c=>c.id===l.id);s!==-1&&n.splice(s,1)}const r=n.map(l=>l.id);for(const l of n)for(const s of e)if(s.id===l.id)switch(s.type){case"select":l.selected=s.selected;break;case"position":if(Di(l)&&(typeof s.position<"u"&&(l.position=s.position),typeof s.dragging<"u"&&(l.dragging=s.dragging),l.expandParent&&l.parentNode)){const c=n[r.indexOf(l.parentNode)];c&&Di(c)&&bs(l,c)}break;case"dimensions":if(Di(l)&&(typeof s.dimensions<"u"&&(l.dimensions=s.dimensions),typeof s.updateStyle<"u"&&s.updateStyle&&(l.style={...l.style||{},width:`${(o=s.dimensions)==null?void 0:o.width}px`,height:`${(i=s.dimensions)==null?void 0:i.height}px`}),typeof s.resizing<"u"&&(l.resizing=s.resizing),l.expandParent&&l.parentNode)){const c=n[r.indexOf(l.parentNode)];c&&Di(c)&&(!!c.dimensions.width&&!!c.dimensions.height?bs(l,c):t.nextTick(()=>{bs(l,c)}))}break}return n}function Hn(e,n){return{id:e,type:"select",selected:n}}function _f(e){return{item:e,type:"add"}}function kf(e){return{id:e,type:"remove"}}function Ef(e,n,o,i,a){return{id:e,source:n,target:o,sourceHandle:i||null,targetHandle:a||null,type:"remove"}}function jn(e,n=new Set,o=!1){const i=[];for(const[a,r]of e){const l=n.has(a);!(r.selected===void 0&&!l)&&r.selected!==l&&(o&&(r.selected=l),i.push(Hn(r.id,l)))}return i}const Nf=()=>{};function Me(e){const n=new Set;let o=Nf,i=()=>!1;const a=()=>n.size>0||i(),r=p=>{o=p},l=()=>{o=Nf},s=p=>{i=p},c=()=>{i=()=>!1},d=p=>{n.delete(p)};return{on:p=>{n.add(p);const f=()=>d(p);return Ni(f),{off:f}},off:d,trigger:p=>{const f=[o];return a()?f.push(...n):e&&f.push(e),Promise.allSettled(f.map(h=>h(p)))},hasListeners:a,listeners:n,setEmitter:r,removeEmitter:l,setHasEmitListeners:s,removeHasEmitListeners:c}}function wf(e,n,o){let i=e;do{if(i&&i.matches(n))return!0;if(i===o)return!1;i=i.parentElement}while(i);return!1}function gN(e,n,o,i){var a,r;const l=new Map;for(const[s,c]of e)(c.selected||c.id===i)&&(!c.parentNode||!hf(c,e))&&(c.draggable||n&&typeof c.draggable>"u")&&e.get(s)&&l.set(s,{id:c.id,position:c.position||{x:0,y:0},distance:{x:o.x-((a=c.computedPosition)==null?void 0:a.x)||0,y:o.y-((r=c.computedPosition)==null?void 0:r.y)||0},from:{x:c.computedPosition.x,y:c.computedPosition.y},extent:c.extent,parentNode:c.parentNode,dimensions:{...c.dimensions},expandParent:c.expandParent});return Array.from(l.values())}function _s({id:e,dragItems:n,findNode:o}){const i=[];for(const a of n){const r=o(a.id);r&&i.push(r)}return[e?i.find(a=>a.id===e):i[0],i]}function If(e){if(Array.isArray(e))switch(e.length){case 1:return[e[0],e[0],e[0],e[0]];case 2:return[e[0],e[1],e[0],e[1]];case 3:return[e[0],e[1],e[2],e[1]];case 4:return e;default:return[0,0,0,0]}return[e,e,e,e]}function bN(e,n,o){const[i,a,r,l]=typeof e!="string"?If(e.padding):[0,0,0,0];return o&&typeof o.computedPosition.x<"u"&&typeof o.computedPosition.y<"u"&&typeof o.dimensions.width<"u"&&typeof o.dimensions.height<"u"?[[o.computedPosition.x+l,o.computedPosition.y+i],[o.computedPosition.x+o.dimensions.width-a,o.computedPosition.y+o.dimensions.height-r]]:!1}function _N(e,n,o,i){let a=e.extent||o;if((a==="parent"||!Array.isArray(a)&&(a==null?void 0:a.range)==="parent")&&!e.expandParent)if(e.parentNode&&i&&e.dimensions.width&&e.dimensions.height){const r=bN(a,e,i);r&&(a=r)}else n(new wt(kt.NODE_EXTENT_INVALID,e.id)),a=o;else if(Array.isArray(a)){const r=(i==null?void 0:i.computedPosition.x)||0,l=(i==null?void 0:i.computedPosition.y)||0;a=[[a[0][0]+r,a[0][1]+l],[a[1][0]+r,a[1][1]+l]]}else if(a!=="parent"&&(a!=null&&a.range)&&Array.isArray(a.range)){const[r,l,s,c]=If(a.padding),d=(i==null?void 0:i.computedPosition.x)||0,u=(i==null?void 0:i.computedPosition.y)||0;a=[[a.range[0][0]+d+c,a.range[0][1]+u+r],[a.range[1][0]+d-l,a.range[1][1]+u-s]]}return a==="parent"?[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]]:a}function kN({width:e,height:n},o){return[o[0],[o[1][0]-(e||0),o[1][1]-(n||0)]]}function ks(e,n,o,i,a){const r=kN(e.dimensions,_N(e,o,i,a)),l=rf(n,r);return{position:{x:l.x-((a==null?void 0:a.computedPosition.x)||0),y:l.y-((a==null?void 0:a.computedPosition.y)||0)},computedPosition:l}}function Qo(e,n,o=Oe.Left,i=!1){const a=((n==null?void 0:n.x)??0)+e.computedPosition.x,r=((n==null?void 0:n.y)??0)+e.computedPosition.y,{width:l,height:s}=n??IN(e);if(i)return{x:a+l/2,y:r+s/2};switch((n==null?void 0:n.position)??o){case Oe.Top:return{x:a+l/2,y:r};case Oe.Right:return{x:a+l,y:r+s/2};case Oe.Bottom:return{x:a+l/2,y:r+s};case Oe.Left:return{x:a,y:r+s/2}}}function vf(e,n){return e&&(n?e.find(o=>o.id===n):e[0])||null}function EN({sourcePos:e,targetPos:n,sourceWidth:o,sourceHeight:i,targetWidth:a,targetHeight:r,width:l,height:s,viewport:c}){const d={x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x+o,n.x+a),y2:Math.max(e.y+i,n.y+r)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const u=ir({x:(0-c.x)/c.zoom,y:(0-c.y)/c.zoom,width:l/c.zoom,height:s/c.zoom}),m=Math.max(0,Math.min(u.x2,d.x2)-Math.max(u.x,d.x)),p=Math.max(0,Math.min(u.y2,d.y2)-Math.max(u.y,d.y));return Math.ceil(m*p)>0}function NN(e,n,o=!1){const i=typeof e.zIndex=="number";let a=i?e.zIndex:0;const r=n(e.source),l=n(e.target);return!r||!l?0:(o&&(a=i?e.zIndex:Math.max(r.computedPosition.z||0,l.computedPosition.z||0)),a)}var kt=(e=>(e.MISSING_STYLES="MISSING_STYLES",e.MISSING_VIEWPORT_DIMENSIONS="MISSING_VIEWPORT_DIMENSIONS",e.NODE_INVALID="NODE_INVALID",e.NODE_NOT_FOUND="NODE_NOT_FOUND",e.NODE_MISSING_PARENT="NODE_MISSING_PARENT",e.NODE_TYPE_MISSING="NODE_TYPE_MISSING",e.NODE_EXTENT_INVALID="NODE_EXTENT_INVALID",e.EDGE_INVALID="EDGE_INVALID",e.EDGE_NOT_FOUND="EDGE_NOT_FOUND",e.EDGE_SOURCE_MISSING="EDGE_SOURCE_MISSING",e.EDGE_TARGET_MISSING="EDGE_TARGET_MISSING",e.EDGE_TYPE_MISSING="EDGE_TYPE_MISSING",e.EDGE_SOURCE_TARGET_SAME="EDGE_SOURCE_TARGET_SAME",e.EDGE_SOURCE_TARGET_MISSING="EDGE_SOURCE_TARGET_MISSING",e.EDGE_ORPHANED="EDGE_ORPHANED",e.USEVUEFLOW_OPTIONS="USEVUEFLOW_OPTIONS",e))(kt||{});const Cf={MISSING_STYLES:()=>"It seems that you haven't loaded the necessary styles. Please import '@vue-flow/core/dist/style.css' to ensure that the graph is rendered correctly",MISSING_VIEWPORT_DIMENSIONS:()=>"The Vue Flow parent container needs a width and a height to render the graph",NODE_INVALID:e=>`Node is invalid
33
33
  Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
34
34
  Node: ${e}`,NODE_MISSING_PARENT:(e,n)=>`Node is missing a parent
35
35
  Node: ${e}
@@ -49,7 +49,7 @@ Edge: ${e}
49
49
  Source: ${n}
50
50
  Target: ${o}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
51
51
  Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
52
- 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 wt extends Error{constructor(n,...o){var i;super((i=Cf[n])==null?void 0:i.call(Cf,...o)),this.name="VueFlowError",this.code=n,this.args=o}}function Es(e){return"clientX"in e}function NN(e){return"sourceEvent"in e}function mn(e,n){const o=Es(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 zi=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function wN(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 ar(e,n=[1,1]){return{x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}}const IN=()=>!0;function Ns(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function vN(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())tr(a,er(r))>0&&i.push(r);return i}const CN=250;function SN(e,n,o,i){var a,r;let l=[],s=Number.POSITIVE_INFINITY;const c=vN(e,o,n+CN);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:p,y:f}=Qo(d,m,m.position,!0),h=Math.sqrt((p-e.x)**2+(f-e.y)**2);h>n||(h<s?(l=[{...m,x:p,y:f}],s=h):h===s&&l.push({...m,x:p,y:f}))}}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 Sf(e,{handle:n,connectionMode:o,fromNodeId:i,fromHandleId:a,fromType:r,doc:l,lib:s,flowId:c,isValidConnection:d=IN},u,m,p,f){const h=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:_}=mn(e),k=l.elementFromPoint(b,_),N=k!=null&&k.classList.contains(`${s}-flow__handle`)?k:g,y={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const E=xf(void 0,N),S=N.getAttribute("data-nodeid"),A=N.getAttribute("data-handleid"),V=N.classList.contains("connectable"),$=N.classList.contains("connectableend");if(!S||!E)return y;const O={source:h?S:i,sourceHandle:h?A:a,target:h?i:S,targetHandle:h?a:A};y.connection=O;const R=V&&$&&(o===Sn.Strict?h&&E==="source"||!h&&E==="target":S!==i||A!==a);y.isValid=R&&d(O,{nodes:m,edges:u,sourceNode:p(O.source),targetNode:p(O.target)}),y.toHandle=Rf(S,E,A,f,o,!0)}return y}function xf(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function xN(e,n){let o=null;return n?o="valid":e&&!n&&(o="invalid"),o}function RN(e,n){let o=null;return n?o=!0:e&&!n&&(o=!1),o}function Rf(e,n,o,i,a,r=!1){var l,s,c;const d=i.get(e);if(!d)return null;const u=a===Sn.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(p=>p.id===o):u==null?void 0:u[0])??null;return m&&r?{...m,...Qo(d,m,m.position,!0)}:m}const ws={[Oe.Left]:Oe.Right,[Oe.Right]:Oe.Left,[Oe.Top]:Oe.Bottom,[Oe.Bottom]:Oe.Top},AN=["production","prod"];function Fi(e,...n){Af()&&console.warn(`[Vue Flow]: ${e}`,...n)}function Af(){return!AN.includes(process.env.NODE_ENV||"")}function $f(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 Is(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 $N(e,n,o,i){if(!e||!e.source||!e.target)return o(new wt(kt.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let a;return Un(e)?a=e:a={...e,id:df(e)},a=sf(a,void 0,i),uN(a,n)?!1:a}function TN(e,n,o,i,a){if(!n.source||!n.target)return a(new wt(kt.EDGE_INVALID,e.id)),!1;if(!o)return a(new wt(kt.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...l}=e;return{...l,id:i?df(n):r,source:n.source,target:n.target,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle}}function Tf(e,n,o){const i={},a=[];for(let r=0;r<e.length;++r){const l=e[r];if(!_o(l)){o(new wt(kt.NODE_INVALID,l==null?void 0:l.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const s=sN(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 wt(kt.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 Mf(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 vs(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}`;Mf("source",c,u,e,a,l),Mf("target",c,d,e,r,s)}}function Vf(e,n){if(e.size!==n.size)return!1;for(const o of e)if(!n.has(o))return!1;return!0}function Cs(e,n,o,i,a,r,l,s){const c=[];for(const d of e){const u=Un(d)?d:$N(d,s,a,r);if(!u)continue;const m=o(u.source),p=o(u.target);if(!m||!p){a(new wt(kt.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!m){a(new wt(kt.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!p){a(new wt(kt.EDGE_TARGET_MISSING,u.id,u.target));continue}if(n&&!n(u,{edges:s,nodes:l,sourceNode:m,targetNode:p})){a(new wt(kt.EDGE_INVALID,u.id));continue}const f=i(u.id);c.push({...sf(u,f,r),sourceNode:m,targetNode:p})}return c}const Bf=Symbol("vueFlow"),Df=Symbol("nodeId"),Of=Symbol("nodeRef"),MN=Symbol("edgeId"),VN=Symbol("edgeRef"),rr=Symbol("slots");function Lf(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:p,findNode:f,multiSelectionActive:h,nodesSelectionActive:g,selectNodesOnDrag:b,removeSelectedElements:_,addSelectedNodes:k,updateNodePositions:N,emits:y}=tt(),{onStart:E,onDrag:S,onStop:A,onClick:V,el:$,disabled:O,id:C,selectable:R,dragHandle:T}=e,w=t.shallowRef(!1);let I=[],v,B=null,M={x:void 0,y:void 0},x={x:0,y:0},P=null,Y=!1,se=!1,he=0,ie=!1;const fe=ON(),pe=({x:re,y:ue})=>{M={x:re,y:ue};let z=!1;if(I=I.map(L=>{const F={x:re-L.distance.x,y:ue-L.distance.y},{computedPosition:X}=ks(L,o.value?ar(F,i.value):F,y.error,l.value,L.parentNode?f(L.parentNode):void 0);return z=z||L.position.x!==X.x||L.position.y!==X.y,L.position=X,L}),se=se||z,!!z&&(N(I,!0,!0),w.value=!0,P)){const[L,F]=_s({id:C,dragItems:I,findNode:f});S({event:P,node:L,nodes:F})}},ge=()=>{if(!B)return;const[re,ue]=gf(x,B,u.value);if(re!==0||ue!==0){const z={x:(M.x??0)-re/c.value.zoom,y:(M.y??0)-ue/c.value.zoom};p({x:re,y:ue})&&pe(z)}he=requestAnimationFrame(ge)},Te=(re,ue)=>{Y=!0;const z=f(C);!b.value&&!h.value&&z&&(z.selected||_()),z&&t.toValue(R)&&b.value&&Is(z,h.value,k,_,g,!1,ue);const L=fe(re.sourceEvent);if(M=L,I=yN(r.value,m.value,L,C),I.length){const[F,X]=_s({id:C,dragItems:I,findNode:f});E({event:re.sourceEvent,node:F,nodes:X})}},He=(re,ue)=>{var z;re.sourceEvent.type==="touchmove"&&re.sourceEvent.touches.length>1||(se=!1,s.value===0&&Te(re,ue),M=fe(re.sourceEvent),B=((z=n.value)==null?void 0:z.getBoundingClientRect())||null,x=mn(re.sourceEvent,B))},De=(re,ue)=>{const z=fe(re.sourceEvent);if(!ie&&Y&&d.value&&(ie=!0,ge()),!Y){const L=z.xSnapped-(M.x??0),F=z.ySnapped-(M.y??0);Math.sqrt(L*L+F*F)>s.value&&Te(re,ue)}(M.x!==z.xSnapped||M.y!==z.ySnapped)&&I.length&&Y&&(P=re.sourceEvent,x=mn(re.sourceEvent,B),pe(z))},Z=re=>{let ue=!1;if(!Y&&!w.value&&!h.value){const z=re.sourceEvent,L=fe(z),F=L.xSnapped-(M.x??0),X=L.ySnapped-(M.y??0),ee=Math.sqrt(F*F+X*X);ee!==0&&ee<=s.value&&(V==null||V(z),ue=!0)}if(I.length&&!ue){se&&(N(I,!1,!1),se=!1);const[z,L]=_s({id:C,dragItems:I,findNode:f});A({event:re.sourceEvent,node:z,nodes:L})}I=[],w.value=!1,ie=!1,Y=!1,M={x:void 0,y:void 0},cancelAnimationFrame(he)};return t.watch([()=>t.toValue(O),$],([re,ue],z,L)=>{if(ue){const F=Jt(ue);re||(v=l1().on("start",X=>He(X,ue)).on("drag",X=>De(X,ue)).on("end",X=>Z(X)).filter(X=>{const ee=X.target,ke=t.toValue(T);return!X.button&&(!a.value||!wf(ee,`.${a.value}`,ue)&&(!ke||wf(ee,ke,ue)))}),F.call(v)),L(()=>{F.on(".drag",null),v&&(v.on("start",null),v.on("drag",null),v.on("end",null))})}}),w}function BN(){return{doubleClick:Me(),click:Me(),mouseEnter:Me(),mouseMove:Me(),mouseLeave:Me(),contextMenu:Me(),updateStart:Me(),update:Me(),updateEnd:Me()}}function DN(e,n){const o=BN();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 ON(){const{viewport:e,snapGrid:n,snapToGrid:o,vueFlowRef:i}=tt();return a=>{var r;const l=((r=i.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},s=NN(a)?a.sourceEvent:a,{x:c,y:d}=mn(s,l),u=Li({x:c,y:d},e.value),{x:m,y:p}=o.value?ar(u,n.value):u;return{xSnapped:m,ySnapped:p,...u}}}function lr(){return!0}function Pf({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:p,nodesConnectable:f,autoPanOnConnect:h,autoPanSpeed:g,findNode:b,panBy:_,startConnection:k,updateConnection:N,endConnection:y,emits:E,viewport:S,edges:A,nodes:V,isValidConnection:$,nodeLookup:O}=tt();let C=null,R=!1,T=null;function w(v){var B;const M=t.toValue(o)==="target",x=Es(v),P=lf(v.target),Y=v.currentTarget;if(Y&&(x&&v.button===0||!x)){let se=function(we){z=mn(we,Z),pe=SN(Li(z,S.value,!1,[1,1]),u.value,O.value,X),L||(F(),L=!0);const G=Sf(we,{handle:pe,connectionMode:d.value,fromNodeId:t.toValue(n),fromHandleId:t.toValue(e),fromType:M?"target":"source",isValidConnection:fe,doc:P,lib:"vue",flowId:s,nodeLookup:O.value},A.value,V.value,b,O.value);T=G.handleDomNode,C=G.connection,R=RN(!!pe,G.isValid);const q={...Ne,isValid:R,to:G.toHandle&&R?Oi({x:G.toHandle.x,y:G.toHandle.y},S.value):z,toHandle:G.toHandle,toPosition:R&&G.toHandle?G.toHandle.position:ws[X.position],toNode:G.toHandle?O.value.get(G.toHandle.nodeId):null};if(R&&pe&&(Ne!=null&&Ne.toHandle)&&q.toHandle&&Ne.toHandle.type===q.toHandle.type&&Ne.toHandle.nodeId===q.toHandle.nodeId&&Ne.toHandle.id===q.toHandle.id&&Ne.to.x===q.to.x&&Ne.to.y===q.to.y)return;const W=pe??G.toHandle;if(N(W&&R?Oi({x:W.x,y:W.y},S.value):z,W,xN(!!W,R)),Ne=q,!pe&&!R&&!T)return Ns(ue);C&&C.source!==C.target&&T&&(Ns(ue),ue=T,T.classList.add("connecting","vue-flow__handle-connecting"),T.classList.toggle("valid",!!R),T.classList.toggle("vue-flow__handle-valid",!!R))},he=function(we){"touches"in we&&we.touches.length>0||((pe||T)&&C&&R&&(r?r(we,C):E.connect(C)),E.connectEnd(we),a&&(l==null||l(we)),Ns(ue),cancelAnimationFrame(ge),y(we),L=!1,R=!1,C=null,T=null,P.removeEventListener("mousemove",se),P.removeEventListener("mouseup",he),P.removeEventListener("touchmove",se),P.removeEventListener("touchend",he))};const ie=b(t.toValue(n));let fe=t.toValue(i)||$.value||lr;!fe&&ie&&(fe=(M?ie.isValidSourcePos:ie.isValidTargetPos)||lr);let pe,ge=0;const{x:Te,y:He}=mn(v),De=xf(t.toValue(a),Y),Z=(B=c.value)==null?void 0:B.getBoundingClientRect();if(!Z||!De)return;const re=Rf(t.toValue(n),De,t.toValue(e),O.value,d.value);if(!re)return;let ue,z=mn(v,Z),L=!1;const F=()=>{if(!h.value)return;const[we,G]=gf(z,Z,g.value);_({x:we,y:G}),ge=requestAnimationFrame(F)},X={...re,nodeId:t.toValue(n),type:De,position:re.position},ee=O.value.get(t.toValue(n)),ye={inProgress:!0,isValid:null,from:Qo(ee,X,Oe.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:ee,to:z,toHandle:null,toPosition:ws[X.position],toNode:null};k({nodeId:t.toValue(n),id:t.toValue(e),type:De,position:(Y==null?void 0:Y.getAttribute("data-handlepos"))||Oe.Top,...z},{x:Te-Z.left,y:He-Z.top}),E.connectStart({event:v,nodeId:t.toValue(n),handleId:t.toValue(e),handleType:De});let Ne=ye;P.addEventListener("mousemove",se),P.addEventListener("mouseup",he),P.addEventListener("touchmove",se),P.addEventListener("touchend",he)}}function I(v){var B,M;if(!m.value)return;const x=t.toValue(o)==="target";if(!p.value){E.clickConnectStart({event:v,nodeId:t.toValue(n),handleId:t.toValue(e)}),k({nodeId:t.toValue(n),type:t.toValue(o),id:t.toValue(e),position:Oe.Top,...mn(v)},void 0,!0);return}let P=t.toValue(i)||$.value||lr;const Y=b(t.toValue(n));if(!P&&Y&&(P=(x?Y.isValidSourcePos:Y.isValidTargetPos)||lr),Y&&(typeof Y.connectable>"u"?f.value:Y.connectable)===!1)return;const se=lf(v.target),he=Sf(v,{handle:{nodeId:t.toValue(n),id:t.toValue(e),type:t.toValue(o),position:Oe.Top,...mn(v)},connectionMode:d.value,fromNodeId:p.value.nodeId,fromHandleId:p.value.id??null,fromType:p.value.type,isValidConnection:P,doc:se,lib:"vue",flowId:s,nodeLookup:O.value},A.value,V.value,b,O.value),ie=((B=he.connection)==null?void 0:B.source)===((M=he.connection)==null?void 0:M.target);he.isValid&&he.connection&&!ie&&E.connect(he.connection),E.clickConnectEnd(v),y(v,!0)}return{handlePointerDown:w,handleClick:I}}function LN(){return t.inject(Df,"")}function zf(e){const n=e??LN()??"",o=t.inject(Of,t.ref(null)),{findNode:i,edges:a,emits:r}=tt(),l=i(n);return l||r.error(new wt(kt.NODE_NOT_FOUND,n)),{id:n,nodeEl:o,node:l,parentNode:t.computed(()=>i(l.parentNode)),connectedEdges:t.computed(()=>ko([l],a.value))}}function PN(){return{doubleClick:Me(),click:Me(),mouseEnter:Me(),mouseMove:Me(),mouseLeave:Me(),contextMenu:Me(),dragStart:Me(),drag:Me(),dragStop:Me()}}function zN(e,n){const o=PN();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 Ff(){const{getSelectedNodes:e,nodeExtent:n,updateNodePositions:o,findNode:i,snapGrid:a,snapToGrid:r,nodesDraggable:l,emits:s}=tt();return(c,d=!1)=>{const u=r.value?a.value[0]:5,m=r.value?a.value[1]:5,p=d?4:1,f=c.x*u*p,h=c.y*m*p,g=[];for(const b of e.value)if(b.draggable||l&&typeof b.draggable>"u"){const _={x:b.computedPosition.x+f,y:b.computedPosition.y+h},{position:k}=ks(b,_,s.error,n.value,b.parentNode?i(b.parentNode):void 0);g.push({id:b.id,position:k,from:b.position,distance:{x:c.x,y:c.y},dimensions:b.dimensions})}o(g,!0,!1)}}const sr=.1,FN=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function Kn(){return Fi("Viewport not initialized yet."),Promise.resolve(!1)}const UN={zoomIn:Kn,zoomOut:Kn,zoomTo:Kn,fitView:Kn,setCenter:Kn,fitBounds:Kn,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:Kn,setTransform:Kn,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function HN(e){function n(i,a){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((a==null?void 0:a.interpolate)==="linear"?xi:ja).scaleBy(Ss(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}=rf({x:-i,y:-a},e.translateExtent),m=Jo.translate(-d,-u).scale(r);e.d3Selection&&e.d3Zoom?(c=e.d3Zoom)==null||c.interpolate((l==null?void 0:l.interpolate)==="linear"?xi:ja).transform(Ss(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"?xi:ja).scaleTo(Ss(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:sr,includeHiddenNodes:!1,duration:0})=>{var r,l;const s=[];for(const p of e.nodes)p.dimensions.width&&p.dimensions.height&&((a==null?void 0:a.includeHiddenNodes)||!p.hidden)&&(!((r=a.nodes)!=null&&r.length)||(l=a.nodes)!=null&&l.length&&a.nodes.includes(p.id))&&s.push(p);if(!s.length)return Promise.resolve(!1);const c=ys(s),{x:d,y:u,zoom:m}=pf(c,e.dimensions.width,e.dimensions.height,a.minZoom??e.minZoom,a.maxZoom??e.maxZoom,a.padding??sr);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:sr})=>{const{x:l,y:s,zoom:c}=pf(a,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding??sr);return o(l,s,c,r)},project:a=>Li(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 Li(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 Oi(s,e.viewport)}return{x:0,y:0}}}:UN)}function Ss(e,n=0,o=FN,i=()=>{}){const a=typeof n=="number"&&n>0;return a||i(),a?e.transition().duration(n).ease(o).on("end",i):e}function jN(e,n,o){const i=t.effectScope(!0);return i.run(()=>{const a=()=>{i.run(()=>{let g,b,_=!!(o.nodes.value.length||o.edges.value.length);g=Ko([e.modelValue,()=>{var k,N;return(N=(k=e.modelValue)==null?void 0:k.value)==null?void 0:N.length}],([k])=>{k&&Array.isArray(k)&&(b==null||b.pause(),o.setElements(k),!b&&!_&&k.length?_=!0:b==null||b.resume())}),b=Ko([o.nodes,o.edges,()=>o.edges.value.length,()=>o.nodes.value.length],([k,N])=>{var y;(y=e.modelValue)!=null&&y.value&&Array.isArray(e.modelValue.value)&&(g==null||g.pause(),e.modelValue.value=[...k,...N],t.nextTick(()=>{g==null||g.resume()}))},{immediate:_}),t.onScopeDispose(()=>{g==null||g.stop(),b==null||b.stop()})})},r=()=>{i.run(()=>{let g,b,_=!!o.nodes.value.length;g=Ko([e.nodes,()=>{var k,N;return(N=(k=e.nodes)==null?void 0:k.value)==null?void 0:N.length}],([k])=>{k&&Array.isArray(k)&&(b==null||b.pause(),o.setNodes(k),!b&&!_&&k.length?_=!0:b==null||b.resume())}),b=Ko([o.nodes,()=>o.nodes.value.length],([k])=>{var N;(N=e.nodes)!=null&&N.value&&Array.isArray(e.nodes.value)&&(g==null||g.pause(),e.nodes.value=[...k],t.nextTick(()=>{g==null||g.resume()}))},{immediate:_}),t.onScopeDispose(()=>{g==null||g.stop(),b==null||b.stop()})})},l=()=>{i.run(()=>{let g,b,_=!!o.edges.value.length;g=Ko([e.edges,()=>{var k,N;return(N=(k=e.edges)==null?void 0:k.value)==null?void 0:N.length}],([k])=>{k&&Array.isArray(k)&&(b==null||b.pause(),o.setEdges(k),!b&&!_&&k.length?_=!0:b==null||b.resume())}),b=Ko([o.edges,()=>o.edges.value.length],([k])=>{var N;(N=e.edges)!=null&&N.value&&Array.isArray(e.edges.value)&&(g==null||g.pause(),e.edges.value=[...k],t.nextTick(()=>{g==null||g.resume()}))},{immediate:_}),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})})},p=()=>{i.run(()=>{const g=async b=>{let _=b;typeof n.autoConnect=="function"&&(_=await n.autoConnect(b)),_!==!1&&o.addEdges([_])};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),k(()=>{o.hooks.value.connect.off(g)})},{immediate:!0})})},f=()=>{const g=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const b of Object.keys(n)){const _=b;if(!g.includes(_)){const k=t.toRef(()=>n[_]),N=o[_];t.isRef(N)&&i.run(()=>{t.watch(k,y=>{Et(y)&&(N.value=y)},{immediate:!0})})}}};(()=>{a(),r(),l(),c(),s(),d(),u(),m(),p(),f()})()}),()=>i.stop()}function KN(){return{edgesChange:Me(),nodesChange:Me(),nodeDoubleClick:Me(),nodeClick:Me(),nodeMouseEnter:Me(),nodeMouseMove:Me(),nodeMouseLeave:Me(),nodeContextMenu:Me(),nodeDragStart:Me(),nodeDrag:Me(),nodeDragStop:Me(),nodesInitialized:Me(),miniMapNodeClick:Me(),miniMapNodeDoubleClick:Me(),miniMapNodeMouseEnter:Me(),miniMapNodeMouseMove:Me(),miniMapNodeMouseLeave:Me(),connect:Me(),connectStart:Me(),connectEnd:Me(),clickConnectStart:Me(),clickConnectEnd:Me(),paneReady:Me(),init:Me(),move:Me(),moveStart:Me(),moveEnd:Me(),selectionDragStart:Me(),selectionDrag:Me(),selectionDragStop:Me(),selectionContextMenu:Me(),selectionStart:Me(),selectionEnd:Me(),viewportChangeStart:Me(),viewportChange:Me(),viewportChangeEnd:Me(),paneScroll:Me(),paneClick:Me(),paneContextMenu:Me(),paneMouseEnter:Me(),paneMouseMove:Me(),paneMouseLeave:Me(),edgeContextMenu:Me(),edgeMouseEnter:Me(),edgeMouseMove:Me(),edgeMouseLeave:Me(),edgeDoubleClick:Me(),edgeClick:Me(),edgeUpdateStart:Me(),edgeUpdate:Me(),edgeUpdateEnd:Me(),updateNodeInternals:Me(),error:Me(e=>Fi(e.message))}}function GN(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),Ni(r.removeEmitter),r.setHasEmitListeners(()=>i(a)),Ni(r.removeHasEmitListeners)}});function i(a){var r;const l=YN(a);return!!((r=o==null?void 0:o.vnode.props)==null?void 0:r[l])}}function YN(e){const[n,...o]=e.split(":");return`on${n.replace(/(?:^|-)(\w)/g,(a,r)=>r.toUpperCase())}${o.length?`:${o.join(":")}`:""}`}function Uf(){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:fs.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Vi.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:go.Bezier,style:{}},connectionMode:Sn.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:zi()?"Meta":"Control",zoomActivationKeyCode:zi()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:KN(),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 qN=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function WN(e,n,o){const i=HN(e),a=z=>{const L=z??[];e.hooks.updateNodeInternals.trigger(L)},r=z=>dN(z,e.nodes,e.edges),l=z=>cN(z,e.nodes,e.edges),s=z=>ko(z,e.edges),c=({id:z,type:L,nodeId:F})=>{var X;const ee=z?`-${L}-${z}`:`-${L}`;return Array.from(((X=e.connectionLookup.get(`${F}${ee}`))==null?void 0:X.values())??[])},d=z=>{if(z)return n.value.get(z)},u=z=>{if(z)return o.value.get(z)},m=(z,L,F)=>{var X,ee;const ke=[];for(const ye of z){const Ne={id:ye.id,type:"position",dragging:F,from:ye.from};if(L&&(Ne.position=ye.position,ye.parentNode)){const we=d(ye.parentNode);Ne.position={x:Ne.position.x-(((X=we==null?void 0:we.computedPosition)==null?void 0:X.x)??0),y:Ne.position.y-(((ee=we==null?void 0:we.computedPosition)==null?void 0:ee.y)??0)}}ke.push(Ne)}ke!=null&&ke.length&&e.hooks.nodesChange.trigger(ke)},p=z=>{if(!e.vueFlowRef)return;const L=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!L)return;const F=window.getComputedStyle(L),{m22:X}=new window.DOMMatrixReadOnly(F.transform),ee=[];for(const ke of z){const ye=ke,Ne=d(ye.id);if(Ne){const we=nr(ye.nodeElement);if(!!(we.width&&we.height&&(Ne.dimensions.width!==we.width||Ne.dimensions.height!==we.height||ye.forceUpdate))){const q=ye.nodeElement.getBoundingClientRect();Ne.dimensions=we,Ne.handleBounds.source=$f("source",ye.nodeElement,q,X,Ne.id),Ne.handleBounds.target=$f("target",ye.nodeElement,q,X,Ne.id),ee.push({id:Ne.id,type:"dimensions",dimensions:we})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&i.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),ee.length&&e.hooks.nodesChange.trigger(ee)},f=(z,L)=>{const F=new Set,X=new Set;for(const ye of z)_o(ye)?F.add(ye.id):Un(ye)&&X.add(ye.id);const ee=jn(n.value,F,!0),ke=jn(o.value,X);if(e.multiSelectionActive){for(const ye of F)ee.push(Hn(ye,L));for(const ye of X)ke.push(Hn(ye,L))}ee.length&&e.hooks.nodesChange.trigger(ee),ke.length&&e.hooks.edgesChange.trigger(ke)},h=z=>{if(e.multiSelectionActive){const L=z.map(F=>Hn(F.id,!0));e.hooks.nodesChange.trigger(L);return}e.hooks.nodesChange.trigger(jn(n.value,new Set(z.map(L=>L.id)),!0)),e.hooks.edgesChange.trigger(jn(o.value))},g=z=>{if(e.multiSelectionActive){const L=z.map(F=>Hn(F.id,!0));e.hooks.edgesChange.trigger(L);return}e.hooks.edgesChange.trigger(jn(o.value,new Set(z.map(L=>L.id)))),e.hooks.nodesChange.trigger(jn(n.value,new Set,!0))},b=z=>{f(z,!0)},_=z=>{const F=(z||e.nodes).map(X=>(X.selected=!1,Hn(X.id,!1)));e.hooks.nodesChange.trigger(F)},k=z=>{const F=(z||e.edges).map(X=>(X.selected=!1,Hn(X.id,!1)));e.hooks.edgesChange.trigger(F)},N=z=>{if(!z||!z.length)return f([],!1);const L=z.reduce((F,X)=>{const ee=Hn(X.id,!1);return _o(X)?F.nodes.push(ee):F.edges.push(ee),F},{nodes:[],edges:[]});L.nodes.length&&e.hooks.nodesChange.trigger(L.nodes),L.edges.length&&e.hooks.edgesChange.trigger(L.edges)},y=z=>{var L;(L=e.d3Zoom)==null||L.scaleExtent([z,e.maxZoom]),e.minZoom=z},E=z=>{var L;(L=e.d3Zoom)==null||L.scaleExtent([e.minZoom,z]),e.maxZoom=z},S=z=>{var L;(L=e.d3Zoom)==null||L.translateExtent(z),e.translateExtent=z},A=z=>{e.nodeExtent=z,a()},V=z=>{var L;(L=e.d3Zoom)==null||L.clickDistance(z)},$=z=>{e.nodesDraggable=z,e.nodesConnectable=z,e.elementsSelectable=z},O=z=>{const L=z instanceof Function?z(e.nodes):z;!e.initialized&&!L.length||(e.nodes=Tf(L,d,e.hooks.error.trigger))},C=z=>{const L=z instanceof Function?z(e.edges):z;if(!e.initialized&&!L.length)return;const F=Cs(L,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);vs(e.connectionLookup,o.value,F),e.edges=F},R=z=>{const L=z instanceof Function?z([...e.nodes,...e.edges]):z;!e.initialized&&!L.length||(O(L.filter(_o)),C(L.filter(Un)))},T=z=>{let L=z instanceof Function?z(e.nodes):z;L=Array.isArray(L)?L:[L];const F=Tf(L,d,e.hooks.error.trigger),X=[];for(const ee of F)X.push(_f(ee));X.length&&e.hooks.nodesChange.trigger(X)},w=z=>{let L=z instanceof Function?z(e.edges):z;L=Array.isArray(L)?L:[L];const F=Cs(L,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),X=[];for(const ee of F)X.push(_f(ee));X.length&&e.hooks.edgesChange.trigger(X)},I=(z,L=!0,F=!1)=>{const X=z instanceof Function?z(e.nodes):z,ee=Array.isArray(X)?X:[X],ke=[],ye=[];function Ne(G){const q=s(G);for(const W of q)(!Et(W.deletable)||W.deletable)&&ye.push(Ef(W.id,W.source,W.target,W.sourceHandle,W.targetHandle))}function we(G){const q=[];for(const W of e.nodes)W.parentNode===G&&q.push(W);if(q.length){for(const W of q)ke.push(kf(W.id));L&&Ne(q);for(const W of q)we(W.id)}}for(const G of ee){const q=typeof G=="string"?d(G):G;q&&(Et(q.deletable)&&!q.deletable||(ke.push(kf(q.id)),L&&Ne([q]),F&&we(q.id)))}ye.length&&e.hooks.edgesChange.trigger(ye),ke.length&&e.hooks.nodesChange.trigger(ke)},v=z=>{const L=z instanceof Function?z(e.edges):z,F=Array.isArray(L)?L:[L],X=[];for(const ee of F){const ke=typeof ee=="string"?u(ee):ee;ke&&(Et(ke.deletable)&&!ke.deletable||X.push(Ef(typeof ee=="string"?ee:ee.id,ke.source,ke.target,ke.sourceHandle,ke.targetHandle)))}e.hooks.edgesChange.trigger(X)},B=(z,L,F=!0)=>{const X=u(z.id);if(!X)return!1;const ee=e.edges.indexOf(X),ke=TN(z,L,X,F,e.hooks.error.trigger);if(ke){const[ye]=Cs([ke],e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((Ne,we)=>we===ee?ye:Ne),vs(e.connectionLookup,o.value,[ye]),ye}return!1},M=(z,L,F={replace:!1})=>{const X=u(z);if(!X)return;const ee=typeof L=="function"?L(X):L;X.data=F.replace?ee:{...X.data,...ee}},x=z=>bf(z,e.nodes),P=z=>{const L=bf(z,e.edges);return vs(e.connectionLookup,o.value,L),L},Y=(z,L,F={replace:!1})=>{const X=d(z);if(!X)return;const ee=typeof L=="function"?L(X):L;F.replace?e.nodes.splice(e.nodes.indexOf(X),1,ee):Object.assign(X,ee)},se=(z,L,F={replace:!1})=>{const X=d(z);if(!X)return;const ee=typeof L=="function"?L(X):L;X.data=F.replace?ee:{...X.data,...ee}},he=(z,L,F=!1)=>{F?e.connectionClickStartHandle=z:e.connectionStartHandle=z,e.connectionEndHandle=null,e.connectionStatus=null,L&&(e.connectionPosition=L)},ie=(z,L=null,F=null)=>{e.connectionStartHandle&&(e.connectionPosition=z,e.connectionEndHandle=L,e.connectionStatus=F)},fe=(z,L)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,L?e.connectionClickStartHandle=null:e.connectionStartHandle=null},pe=z=>{const L=lN(z),F=L?null:Di(z)?z:d(z.id);return!L&&!F?[null,null,L]:[L?z:er(F),F,L]},ge=(z,L=!0,F=e.nodes)=>{const[X,ee,ke]=pe(z);if(!X)return[];const ye=[];for(const Ne of F||e.nodes){if(!ke&&(Ne.id===ee.id||!Ne.computedPosition))continue;const we=er(Ne),G=tr(we,X);(L&&G>0||G>=we.width*we.height||G>=Number(X.width)*Number(X.height))&&ye.push(Ne)}return ye},Te=(z,L,F=!0)=>{const[X]=pe(z);if(!X)return!1;const ee=tr(X,L);return F&&ee>0||ee>=Number(X.width)*Number(X.height)},He=z=>{const{viewport:L,dimensions:F,d3Zoom:X,d3Selection:ee,translateExtent:ke}=e;if(!X||!ee||!z.x&&!z.y)return!1;const ye=Jo.translate(L.x+z.x,L.y+z.y).scale(L.zoom),Ne=[[0,0],[F.width,F.height]],we=X.constrain()(ye,Ne,ke),G=e.viewport.x!==we.x||e.viewport.y!==we.y||e.viewport.zoom!==we.k;return X.transform(ee,we),G},De=z=>{const L=z instanceof Function?z(e):z,F=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Et(L.defaultEdgeOptions)&&(e.defaultEdgeOptions=L.defaultEdgeOptions);const X=L.modelValue||L.nodes||L.edges?[]:void 0;X&&(L.modelValue&&X.push(...L.modelValue),L.nodes&&X.push(...L.nodes),L.edges&&X.push(...L.edges),R(X));const ee=()=>{Et(L.maxZoom)&&E(L.maxZoom),Et(L.minZoom)&&y(L.minZoom),Et(L.translateExtent)&&S(L.translateExtent)};for(const ke of Object.keys(L)){const ye=ke,Ne=L[ye];![...qN,...F].includes(ye)&&Et(Ne)&&(e[ye]=Ne)}Gl(()=>e.d3Zoom).not.toBeNull().then(ee),e.initialized||(e.initialized=!0)};return{updateNodePositions:m,updateNodeDimensions:p,setElements:R,setNodes:O,setEdges:C,addNodes:T,addEdges:w,removeNodes:I,removeEdges:v,findNode:d,findEdge:u,updateEdge:B,updateEdgeData:M,updateNode:Y,updateNodeData:se,applyEdgeChanges:P,applyNodeChanges:x,addSelectedElements:b,addSelectedNodes:h,addSelectedEdges:g,setMinZoom:y,setMaxZoom:E,setTranslateExtent:S,setNodeExtent:A,setPaneClickDistance:V,removeSelectedElements:N,removeSelectedNodes:_,removeSelectedEdges:k,startConnection:he,updateConnection:ie,endConnection:fe,setInteractive:$,setState:De,getIntersectingNodes:ge,getIncomers:r,getOutgoers:l,getConnectedEdges:s,getHandleConnections:c,isNodeIntersecting:Te,panBy:He,fitView:z=>i.value.fitView(z),zoomIn:z=>i.value.zoomIn(z),zoomOut:z=>i.value.zoomOut(z),zoomTo:(z,L)=>i.value.zoomTo(z,L),setViewport:(z,L)=>i.value.setViewport(z,L),setTransform:(z,L)=>i.value.setTransform(z,L),getViewport:()=>i.value.getViewport(),getTransform:()=>i.value.getTransform(),setCenter:(z,L,F)=>i.value.setCenter(z,L,F),fitBounds:(z,L)=>i.value.fitBounds(z,L),project:z=>i.value.project(z),screenToFlowCoordinate:z=>i.value.screenToFlowCoordinate(z),flowToScreenCoordinate:z=>i.value.flowToScreenCoordinate(z),toObject:()=>{const z=[],L=[];for(const F of e.nodes){const{computedPosition:X,handleBounds:ee,selected:ke,dimensions:ye,isParent:Ne,resizing:we,dragging:G,events:q,...W}=F;z.push(W)}for(const F of e.edges){const{selected:X,sourceNode:ee,targetNode:ke,events:ye,...Ne}=F;L.push(Ne)}return JSON.parse(JSON.stringify({nodes:z,edges:L,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:z=>new Promise(L=>{const{nodes:F,edges:X,position:ee,zoom:ke,viewport:ye}=z;F&&O(F),X&&C(X);const[Ne,we]=ye!=null&&ye.x&&(ye!=null&&ye.y)?[ye.x,ye.y]:ee??[null,null];if(Ne&&we){const G=(ye==null?void 0:ye.zoom)||ke||e.viewport.zoom;return Gl(()=>i.value.viewportInitialized).toBe(!0).then(()=>{i.value.setViewport({x:Ne,y:we,zoom:G}).then(()=>{L(!0)})})}else L(!0)}),updateNodeInternals:a,viewportHelper:i,$reset:()=>{const z=Uf();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const L=Jo.translate(z.defaultViewport.x??0,z.defaultViewport.y??0).scale(bo(z.defaultViewport.zoom??1,z.minZoom,z.maxZoom)),F=e.viewportRef.getBoundingClientRect(),X=[[0,0],[F.width,F.height]],ee=e.d3Zoom.constrain()(L,X,z.translateExtent);e.d3Zoom.transform(e.d3Selection,ee)}De(z)},$destroy:()=>{}}}const JN=["data-id","data-handleid","data-nodeid","data-handlepos"],XN={name:"Handle",compatConfig:{MODE:3}},Eo=t.defineComponent({...XN,props:{id:{default:null},type:{},position:{default:()=>Oe.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:p}=tt(),{id:f,node:h,nodeEl:g,connectedEdges:b}=zf(),_=t.ref(),k=t.toRef(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),N=t.toRef(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),y=t.toRef(()=>{var C,R,T,w,I,v;return((C=l.value)==null?void 0:C.nodeId)===f&&((R=l.value)==null?void 0:R.id)===e.id&&((T=l.value)==null?void 0:T.type)===i.value||((w=c.value)==null?void 0:w.nodeId)===f&&((I=c.value)==null?void 0:I.id)===e.id&&((v=c.value)==null?void 0:v.type)===i.value}),E=t.toRef(()=>{var C,R,T;return((C=s.value)==null?void 0:C.nodeId)===f&&((R=s.value)==null?void 0:R.id)===e.id&&((T=s.value)==null?void 0:T.type)===i.value}),{handlePointerDown:S,handleClick:A}=Pf({nodeId:f,handleId:e.id,isValidConnection:a,type:i}),V=t.computed(()=>typeof e.connectable=="string"&&e.connectable==="single"?!b.value.some(C=>{const R=C[`${i.value}Handle`];return C[i.value]!==f?!1:R?R===e.id:!0}):typeof e.connectable=="number"?b.value.filter(C=>{const R=C[`${i.value}Handle`];return C[i.value]!==f?!1:R?R===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(h,b.value):Et(e.connectable)?e.connectable:u.value);t.onMounted(()=>{var C;if(!h.dimensions.width||!h.dimensions.height)return;const R=(C=h.handleBounds[i.value])==null?void 0:C.find(x=>x.id===e.id);if(!d.value||R)return;const T=d.value.querySelector(".vue-flow__transformationpane");if(!g.value||!_.value||!T||!e.id)return;const w=g.value.getBoundingClientRect(),I=_.value.getBoundingClientRect(),v=window.getComputedStyle(T),{m22:B}=new window.DOMMatrixReadOnly(v.transform),M={id:e.id,position:e.position,x:(I.left-w.left)/B,y:(I.top-w.top)/B,type:i.value,nodeId:f,...nr(_.value)};h.handleBounds[i.value]=[...h.handleBounds[i.value]??[],M]});function $(C){const R=Es(C);V.value&&k.value&&(R&&C.button===0||!R)&&S(C)}function O(C){!f||!s.value&&!k.value||V.value&&A(C)}return n({handleClick:A,handlePointerDown:S,onClick:O,onPointerDown:$}),(C,R)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"handle",ref:_,"data-id":`${t.unref(r)}-${t.unref(f)}-${e.id}-${i.value}`,"data-handleid":e.id,"data-nodeid":t.unref(f),"data-handlepos":C.position,class:t.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${C.position}`,`vue-flow__handle-${e.id}`,t.unref(m),t.unref(p),i.value,{connectable:V.value,connecting:E.value,connectablestart:k.value,connectableend:N.value,connectionindicator:V.value&&(k.value&&!y.value||N.value&&y.value)}]]),onMousedown:$,onTouchstartPassive:$,onClick:O},[t.renderSlot(C.$slots,"default",{id:C.id})],42,JN))}}),cr=function({sourcePosition:e=Oe.Bottom,targetPosition:n=Oe.Top,label:o,connectable:i=!0,isValidTargetPos:a,isValidSourcePos:r,data:l}){const s=l.label??o;return[t.h(Eo,{type:"target",position:n,connectable:i,isValidConnection:a}),typeof s!="string"&&s?t.h(s):t.h(t.Fragment,[s]),t.h(Eo,{type:"source",position:e,connectable:i,isValidConnection:r})]};cr.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],cr.inheritAttrs=!1,cr.compatConfig={MODE:3};const ZN=cr,dr=function({targetPosition:e=Oe.Top,label:n,connectable:o=!0,isValidTargetPos:i,data:a}){const r=a.label??n;return[t.h(Eo,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof r!="string"&&r?t.h(r):t.h(t.Fragment,[r])]};dr.props=["targetPosition","label","isValidTargetPos","connectable","data"],dr.inheritAttrs=!1,dr.compatConfig={MODE:3};const QN=dr,ur=function({sourcePosition:e=Oe.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(Eo,{type:"source",position:e,connectable:o,isValidConnection:i})]};ur.props=["sourcePosition","label","isValidSourcePos","connectable","data"],ur.inheritAttrs=!1,ur.compatConfig={MODE:3};const ew=ur,tw=["transform"],nw=["width","height","x","y","rx","ry"],ow=["y"],iw={name:"EdgeText",compatConfig:{MODE:3}},aw=t.defineComponent({...iw,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,nw)):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,ow)],8,tw))}}),rw=["id","d","marker-end","marker-start"],lw=["d","stroke-width"],sw={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},mr=t.defineComponent({...sw,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,rw),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,lw)):t.createCommentVNode("",!0),l.label&&l.labelX&&l.labelY?(t.openBlock(),t.createBlock(aw,{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 Hf({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 jf({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 fr(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function Kf({pos:e,x1:n,y1:o,x2:i,y2:a,c:r}){let l,s;switch(e){case Oe.Left:l=n-fr(n-i,r),s=o;break;case Oe.Right:l=n+fr(i-n,r),s=o;break;case Oe.Top:l=n,s=o-fr(o-a,r);break;case Oe.Bottom:l=n,s=o+fr(a-o,r);break}return[l,s]}function Gf(e){const{sourceX:n,sourceY:o,sourcePosition:i=Oe.Bottom,targetX:a,targetY:r,targetPosition:l=Oe.Top,curvature:s=.25}=e,[c,d]=Kf({pos:i,x1:n,y1:o,x2:a,y2:r,c:s}),[u,m]=Kf({pos:l,x1:a,y1:r,x2:n,y2:o,c:s}),[p,f,h,g]=jf({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}`,p,f,h,g]}function Yf({pos:e,x1:n,y1:o,x2:i,y2:a}){let r,l;switch(e){case Oe.Left:case Oe.Right:r=.5*(n+i),l=o;break;case Oe.Top:case Oe.Bottom:r=n,l=.5*(o+a);break}return[r,l]}function qf(e){const{sourceX:n,sourceY:o,sourcePosition:i=Oe.Bottom,targetX:a,targetY:r,targetPosition:l=Oe.Top}=e,[s,c]=Yf({pos:i,x1:n,y1:o,x2:a,y2:r}),[d,u]=Yf({pos:l,x1:a,y1:r,x2:n,y2:o}),[m,p,f,h]=jf({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,p,f,h]}const Wf={[Oe.Left]:{x:-1,y:0},[Oe.Right]:{x:1,y:0},[Oe.Top]:{x:0,y:-1},[Oe.Bottom]:{x:0,y:1}};function cw({source:e,sourcePosition:n=Oe.Bottom,target:o}){return n===Oe.Left||n===Oe.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 Jf(e,n){return Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2)}function dw({source:e,sourcePosition:n=Oe.Bottom,target:o,targetPosition:i=Oe.Top,center:a,offset:r}){const l=Wf[n],s=Wf[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=cw({source:c,sourcePosition:n,target:d}),m=u.x!==0?"x":"y",p=u[m];let f,h,g;const b={x:0,y:0},_={x:0,y:0},[k,N,y,E]=Hf({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(l[m]*s[m]===-1){h=a.x??k,g=a.y??N;const A=[{x:h,y:c.y},{x:h,y:d.y}],V=[{x:c.x,y:g},{x:d.x,y:g}];l[m]===p?f=m==="x"?A:V:f=m==="x"?V:A}else{const A=[{x:c.x,y:d.y}],V=[{x:d.x,y:c.y}];if(m==="x"?f=l.x===p?V:A:f=l.y===p?A:V,n===i){const T=Math.abs(e[m]-o[m]);if(T<=r){const w=Math.min(r-1,r-T);l[m]===p?b[m]=(c[m]>e[m]?-1:1)*w:_[m]=(d[m]>o[m]?-1:1)*w}}if(n!==i){const T=m==="x"?"y":"x",w=l[m]===s[T],I=c[T]>d[T],v=c[T]<d[T];(l[m]===1&&(!w&&I||w&&v)||l[m]!==1&&(!w&&v||w&&I))&&(f=m==="x"?A:V)}const $={x:c.x+b.x,y:c.y+b.y},O={x:d.x+_.x,y:d.y+_.y},C=Math.max(Math.abs($.x-f[0].x),Math.abs(O.x-f[0].x)),R=Math.max(Math.abs($.y-f[0].y),Math.abs(O.y-f[0].y));C>=R?(h=($.x+O.x)/2,g=f[0].y):(h=f[0].x,g=($.y+O.y)/2)}return[[e,{x:c.x+b.x,y:c.y+b.y},...f,{x:d.x+_.x,y:d.y+_.y},o],h,g,y,E]}function uw(e,n,o,i){const a=Math.min(Jf(e,n)/2,Jf(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=Oe.Bottom,targetX:a,targetY:r,targetPosition:l=Oe.Top,borderRadius:s=5,centerX:c,centerY:d,offset:u=20}=e,[m,p,f,h,g]=dw({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,N)=>{let y;return N>0&&N<m.length-1?y=uw(m[N-1],k,m[N+1],s):y=`${N===0?"M":"L"}${k.x} ${k.y}`,_+=y,_},""),p,f,h,g]}function mw(e){const{sourceX:n,sourceY:o,targetX:i,targetY:a}=e,[r,l,s,c]=Hf({sourceX:n,sourceY:o,targetX:i,targetY:a});return[`M ${n},${o}L ${i},${a}`,r,l,s,c]}const fw=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]=mw(e);return t.h(mr,{path:o,labelX:i,labelY:a,...n,...e})}}}),Xf=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??Oe.Bottom,targetPosition:e.targetPosition??Oe.Top});return t.h(mr,{path:o,labelX:i,labelY:a,...n,...e})}}}),pw=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(Xf,{...e,...n,borderRadius:0})}}),hw=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]=Gf({...e,sourcePosition:e.sourcePosition??Oe.Bottom,targetPosition:e.targetPosition??Oe.Top});return t.h(mr,{path:o,labelX:i,labelY:a,...n,...e})}}}),yw=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]=qf({...e,sourcePosition:e.sourcePosition??Oe.Bottom,targetPosition:e.targetPosition??Oe.Top});return t.h(mr,{path:o,labelX:i,labelY:a,...n,...e})}}}),gw={input:ew,default:ZN,output:QN},bw={default:hw,straight:fw,step:pw,smoothstep:Xf,simplebezier:yw};function _w(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={...bw,...e.edgeTypes},b=Object.keys(g);for(const _ of e.edges)_.type&&!b.includes(_.type)&&(g[_.type]=_.type);return g}),l=t.computed(()=>{const g={...gw,...e.nodeTypes},b=Object.keys(g);for(const _ of e.nodes)_.type&&!b.includes(_.type)&&(g[_.type]=_.type);return g}),s=t.computed(()=>e.onlyRenderVisibleElements?ff(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 _=n.value.get(b.source),k=n.value.get(b.target);kN({sourcePos:_.computedPosition||{x:0,y:0},targetPos:k.computedPosition||{x:0,y:0},sourceWidth:_.dimensions.width,sourceHeight:_.dimensions.height,targetWidth:k.dimensions.width,targetHeight:k.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}),p=t.computed(()=>[...u.value,...m.value]),f=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}),h=t.computed(()=>s.value.length>0&&f.value.length===s.value.length);return{getNode:i,getEdge:a,getElements:d,getEdgeTypes:r,getNodeTypes:l,getEdges:c,getNodes:s,getSelectedElements:p,getSelectedNodes:u,getSelectedEdges:m,getNodesInitialized:f,areNodesInitialized:h}}class No{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)??No.instance;return No.instance=i??new No,o&&(o.config.globalProperties.$vueFlowStorage=No.instance),No.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=Uf(),a=t.reactive(i),r={};for(const[p,f]of Object.entries(a.hooks)){const h=`on${p.charAt(0).toUpperCase()+p.slice(1)}`;r[h]=f.on}const l={};for(const[p,f]of Object.entries(a.hooks))l[p]=f.trigger;const s=t.computed(()=>{const p=new Map;for(const f of a.nodes)p.set(f.id,f);return p}),c=t.computed(()=>{const p=new Map;for(const f of a.edges)p.set(f.id,f);return p}),d=_w(a,s,c),u=WN(a,s,c);u.setState({...a,...o});const m={...r,...d,...u,...yk(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 tt(e){const n=No.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(Bf,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,p,f)=>{const h=b=>{d.applyNodeChanges(b)},g=b=>{d.applyEdgeChanges(b)};m?(d.onNodesChange(h),d.onEdgesChange(g)):(d.hooks.value.nodesChange.off(h),d.hooks.value.edgesChange.off(g)),f(()=>{d.hooks.value.nodesChange.off(h),d.hooks.value.edgesChange.off(g)})},{immediate:!0}),Ni(()=>{if(s){const m=n.get(s.id);m?m.$destroy():Fi(`No store instance found for id ${s.id} in storage.`)}})})}else i&&s.setState(a);if(o&&(t.provide(Bf,s),o.vueFlowId=s.id),i){const c=t.getCurrentInstance();(c==null?void 0:c.type.name)!=="VueFlow"&&s.emits.error(new wt(kt.USEVUEFLOW_OPTIONS))}return s}function kw(e){const{emits:n,dimensions:o}=tt();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 wt(kt.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 Ew={name:"UserSelection",compatConfig:{MODE:3}},Nw=t.defineComponent({...Ew,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))}}),ww=["tabIndex"],Iw={name:"NodesSelection",compatConfig:{MODE:3}},vw=t.defineComponent({...Iw,setup(e){const{emits:n,viewport:o,getSelectedNodes:i,noPanClassName:a,disableKeyboardA11y:r,userSelectionActive:l}=tt(),s=Ff(),c=t.ref(null),d=Lf({el:c,onStart(h){n.selectionDragStart(h),n.nodeDragStart(h)},onDrag(h){n.selectionDrag(h),n.nodeDrag(h)},onStop(h){n.selectionDragStop(h),n.nodeDragStop(h)}});t.onMounted(()=>{var h;r.value||(h=c.value)==null||h.focus({preventScroll:!0})});const u=t.computed(()=>ys(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 p(h){n.selectionContextMenu({event:h,nodes:i.value})}function f(h){r.value||Xo[h.key]&&(h.preventDefault(),s({x:Xo[h.key].x,y:Xo[h.key].y},h.shiftKey))}return(h,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:p,onKeydown:f},null,46,ww)],6)):t.createCommentVNode("",!0)}});function Cw(e,n){return{x:e.clientX-n.left,y:e.clientY-n.top}}const Sw={name:"Pane",compatConfig:{MODE:3}},xw=t.defineComponent({...Sw,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:p,removeEdges:f,selectionMode:h,deleteKeyCode:g,multiSelectionKeyCode:b,multiSelectionActive:_,edgeLookup:k,nodeLookup:N,connectionLookup:y,defaultEdgeOptions:E,connectionStartHandle:S,panOnDrag:A}=tt(),V=t.shallowRef(null),$=t.shallowRef(new Set),O=t.shallowRef(new Set),C=t.shallowRef(null),R=t.toRef(()=>c.value&&(e.isSelecting||r.value)),T=t.toRef(()=>S.value!==null);let w=!1,I=!1;const v=Bi(g,{actInsideInputWithModifier:!1}),B=Bi(b);t.watch(v,fe=>{fe&&(p(m.value),f(u.value),d.value=!1)}),t.watch(B,fe=>{_.value=fe});function M(fe,pe){return ge=>{ge.target===pe&&(fe==null||fe(ge))}}function x(fe){if(w||T.value){w=!1;return}a.paneClick(fe),l(),d.value=!1}function P(fe){var pe;if(Array.isArray(A.value)&&((pe=A.value)!=null&&pe.includes(2))){fe.preventDefault();return}a.paneContextMenu(fe)}function Y(fe){a.paneScroll(fe)}function se(fe){var pe,ge,Te;if(C.value=((pe=n.value)==null?void 0:pe.getBoundingClientRect())??null,!c.value||!e.isSelecting||fe.button!==0||fe.target!==V.value||!C.value)return;(Te=(ge=fe.target)==null?void 0:ge.setPointerCapture)==null||Te.call(ge,fe.pointerId);const{x:He,y:De}=Cw(fe,C.value);I=!0,w=!1,l(),s.value={width:0,height:0,startX:He,startY:De,x:He,y:De},a.selectionStart(fe)}function he(fe){var pe;if(!C.value||!s.value)return;w=!0;const{x:ge,y:Te}=mn(fe,C.value),{startX:He=0,startY:De=0}=s.value,Z={startX:He,startY:De,x:ge<He?ge:He,y:Te<De?Te:De,width:Math.abs(ge-He),height:Math.abs(Te-De)},re=$.value,ue=O.value;$.value=new Set(ff(o.value,Z,i.value,h.value===fs.Partial,!0).map(L=>L.id)),O.value=new Set;const z=((pe=E.value)==null?void 0:pe.selectable)??!0;for(const L of $.value){const F=y.value.get(L);if(F)for(const{edgeId:X}of F.values()){const ee=k.value.get(X);ee&&(ee.selectable??z)&&O.value.add(X)}}if(!Vf(re,$.value)){const L=jn(N.value,$.value,!0);a.nodesChange(L)}if(!Vf(ue,O.value)){const L=jn(k.value,O.value);a.edgesChange(L)}s.value=Z,r.value=!0,d.value=!1}function ie(fe){var pe;fe.button!==0||!I||((pe=fe.target)==null||pe.releasePointerCapture(fe.pointerId),!r.value&&s.value&&fe.target===V.value&&x(fe),r.value=!1,s.value=null,d.value=$.value.size>0,a.selectionEnd(fe),e.selectionKeyPressed&&(w=!1),I=!1)}return(fe,pe)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"container",ref:V,class:t.normalizeClass(["vue-flow__pane vue-flow__container",{selection:fe.isSelecting}]),onClick:pe[0]||(pe[0]=ge=>R.value?void 0:M(x,V.value)(ge)),onContextmenu:pe[1]||(pe[1]=ge=>M(P,V.value)(ge)),onWheelPassive:pe[2]||(pe[2]=ge=>M(Y,V.value)(ge)),onPointerenter:pe[3]||(pe[3]=ge=>R.value?void 0:t.unref(a).paneMouseEnter(ge)),onPointerdown:pe[4]||(pe[4]=ge=>R.value?se(ge):t.unref(a).paneMouseMove(ge)),onPointermove:pe[5]||(pe[5]=ge=>R.value?he(ge):t.unref(a).paneMouseMove(ge)),onPointerup:pe[6]||(pe[6]=ge=>R.value?ie(ge):void 0),onPointerleave:pe[7]||(pe[7]=ge=>t.unref(a).paneMouseLeave(ge))},[t.renderSlot(fe.$slots,"default"),t.unref(r)&&t.unref(s)?(t.openBlock(),t.createBlock(Nw,{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(vw,{key:1})):t.createCommentVNode("",!0)],34))}}),Rw={name:"Transform",compatConfig:{MODE:3}},Aw=t.defineComponent({...Rw,setup(e){const{viewport:n,fitViewOnInit:o,fitViewOnInitDone:i}=tt(),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))}}),$w={name:"Viewport",compatConfig:{MODE:3}},Tw=t.defineComponent({...$w,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:p,zoomOnPinch:f,zoomOnScroll:h,preventScrolling:g,noWheelClassName:b,noPanClassName:_,emits:k,connectionStartHandle:N,userSelectionActive:y,paneDragging:E,d3Zoom:S,d3Selection:A,d3ZoomHandler:V,viewport:$,viewportRef:O,paneClickDistance:C}=tt();kw(O);const R=t.shallowRef(!1),T=t.shallowRef(!1);let w=null,I=!1,v=0,B={x:0,y:0,zoom:0};const M=Bi(s),x=Bi(l),P=Bi(r),Y=t.toRef(()=>(!x.value||x.value&&l.value===!0)&&(M.value||m.value)),se=t.toRef(()=>M.value||c.value),he=t.toRef(()=>l.value===!0&&Y.value!==!0),ie=t.toRef(()=>x.value&&l.value!==!0||y.value||he.value),fe=t.toRef(()=>N.value!==null);t.onMounted(()=>{if(!O.value){Fi("Viewport element is missing");return}const De=O.value,Z=De.getBoundingClientRect(),re=eN().clickDistance(C.value).scaleExtent([n.value,o.value]).translateExtent(a.value),ue=Jt(De).call(re),z=ue.on("wheel.zoom"),L=Jo.translate(i.value.x??0,i.value.y??0).scale(bo(i.value.zoom??1,n.value,o.value)),F=[[0,0],[Z.width,Z.height]],X=re.constrain()(L,F,a.value);re.transform(ue,X),re.wheelDelta(gs),S.value=re,A.value=ue,V.value=z,$.value={x:X.x,y:X.y,zoom:X.k},re.on("start",ee=>{var ke;if(!ee.sourceEvent)return null;v=ee.sourceEvent.button,R.value=!0;const ye=Te(ee.transform);((ke=ee.sourceEvent)==null?void 0:ke.type)==="mousedown"&&(E.value=!0),B=ye,k.viewportChangeStart(ye),k.moveStart({event:ee,flowTransform:ye})}),re.on("end",ee=>{if(!ee.sourceEvent)return null;if(R.value=!1,E.value=!1,pe(Y.value,v??0)&&!I&&k.paneContextMenu(ee.sourceEvent),I=!1,ge(B,ee.transform)){const ke=Te(ee.transform);B=ke,k.viewportChangeEnd(ke),k.moveEnd({event:ee,flowTransform:ke})}}),re.filter(ee=>{var ke;const ye=P.value||h.value,Ne=f.value&&ee.ctrlKey,we=ee.button,G=ee.type==="wheel";if(we===1&&ee.type==="mousedown"&&(He(ee,"vue-flow__node")||He(ee,"vue-flow__edge")))return!0;if(!Y.value&&!ye&&!se.value&&!p.value&&!f.value||y.value||fe.value&&!G||!p.value&&ee.type==="dblclick"||He(ee,b.value)&&G||He(ee,_.value)&&(!G||se.value&&G&&!P.value)||!f.value&&ee.ctrlKey&&G||!ye&&!se.value&&!Ne&&G)return!1;if(!f&&ee.type==="touchstart"&&((ke=ee.touches)==null?void 0:ke.length)>1)return ee.preventDefault(),!1;if(!Y.value&&(ee.type==="mousedown"||ee.type==="touchstart")||he.value&&Array.isArray(m.value)&&m.value.includes(0)&&we===0||Array.isArray(m.value)&&!m.value.includes(we)&&(ee.type==="mousedown"||ee.type==="touchstart"))return!1;const q=Array.isArray(m.value)&&m.value.includes(we)||l.value===!0&&Array.isArray(m.value)&&!m.value.includes(0)||!we||we<=1;return(!ee.ctrlKey||M.value||G)&&q}),t.watch([y,Y],()=>{y.value&&!R.value?re.on("zoom",null):y.value||re.on("zoom",ee=>{$.value={x:ee.transform.x,y:ee.transform.y,zoom:ee.transform.k};const ke=Te(ee.transform);I=pe(Y.value,v??0),k.viewportChange(ke),k.move({event:ee,flowTransform:ke})})},{immediate:!0}),t.watch([y,se,d,P,f,g,b],()=>{se.value&&!P.value&&!y.value?ue.on("wheel.zoom",ee=>{if(He(ee,b.value))return!1;const ke=P.value||h.value,ye=f.value&&ee.ctrlKey;if(!(!g.value||se.value||ke||ye))return!1;ee.preventDefault(),ee.stopImmediatePropagation();const we=ue.property("__zoom").k||1,G=zi();if(!M.value&&ee.ctrlKey&&f.value&&G){const ze=sn(ee),Fe=gs(ee),ae=we*2**Fe;re.scaleTo(ue,ae,ze,ee);return}const q=ee.deltaMode===1?20:1;let W=d.value===Vi.Vertical?0:ee.deltaX*q,Ce=d.value===Vi.Horizontal?0:ee.deltaY*q;!G&&ee.shiftKey&&d.value!==Vi.Vertical&&!W&&Ce&&(W=Ce,Ce=0),re.translateBy(ue,-(W/we)*u.value,-(Ce/we)*u.value);const $e=Te(ue.property("__zoom"));w&&clearTimeout(w),T.value?(k.move({event:ee,flowTransform:$e}),k.viewportChange($e),w=setTimeout(()=>{k.moveEnd({event:ee,flowTransform:$e}),k.viewportChangeEnd($e),T.value=!1},150)):(T.value=!0,k.moveStart({event:ee,flowTransform:$e}),k.viewportChangeStart($e))},{passive:!1}):typeof z<"u"&&ue.on("wheel.zoom",function(ee,ke){const ye=!g.value&&ee.type==="wheel"&&!ee.ctrlKey,Ne=P.value||h.value,we=f.value&&ee.ctrlKey;if(!Ne&&!c.value&&!we&&ee.type==="wheel"||ye||He(ee,b.value))return null;ee.preventDefault(),z.call(this,ee,ke)},{passive:!1})},{immediate:!0})});function pe(De,Z){return Z===2&&Array.isArray(De)&&De.includes(2)}function ge(De,Z){return De.x!==Z.x&&!Number.isNaN(Z.x)||De.y!==Z.y&&!Number.isNaN(Z.y)||De.zoom!==Z.k&&!Number.isNaN(Z.k)}function Te(De){return{x:De.x,y:De.y,zoom:De.k}}function He(De,Z){return De.target.closest(`.${Z}`)}return(De,Z)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"viewportRef",ref:O,class:"vue-flow__viewport vue-flow__container"},[t.createVNode(xw,{"is-selecting":ie.value,"selection-key-pressed":t.unref(x),class:t.normalizeClass({connecting:fe.value,dragging:t.unref(E),draggable:t.unref(m)===!0||Array.isArray(t.unref(m))&&t.unref(m).includes(0)})},{default:t.withCtx(()=>[t.createVNode(Aw,null,{default:t.withCtx(()=>[t.renderSlot(De.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Mw=["id"],Vw=["id"],Bw=["id"],Dw={name:"A11yDescriptions",compatConfig:{MODE:3}},Ow=t.defineComponent({...Dw,setup(e){const{id:n,disableKeyboardA11y:o,ariaLiveMessage:i}=tt();return(a,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{id:`${t.unref(nf)}-${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,Mw),t.createElementVNode("div",{id:`${t.unref(of)}-${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,Vw),t.unref(o)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,id:`${t.unref(rN)}-${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,Bw))],64))}});function Lw(){const e=tt();t.watch(()=>e.viewportHelper.value.viewportInitialized,n=>{n&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function Pw(e,n,o){return o===Oe.Left?e-n:o===Oe.Right?e+n:e}function zw(e,n,o){return o===Oe.Top?e-n:o===Oe.Bottom?e+n:e}const Rs=function({radius:e=10,centerX:n=0,centerY:o=0,position:i=Oe.Top,type:a}){return t.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${a}`,cx:Pw(n,e,i),cy:zw(o,e,i),r:e,stroke:"transparent",fill:"transparent"})};Rs.props=["radius","centerX","centerY","position","type"],Rs.compatConfig={MODE:3};const Zf=Rs,Fw=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:p,multiSelectionActive:f,disableKeyboardA11y:h,elementsSelectable:g,edgesUpdatable:b,edgesFocusable:_,hooks:k}=tt(),N=t.computed(()=>u(e.id)),{emit:y,on:E}=DN(N.value,r),S=t.inject(rr),A=t.getCurrentInstance(),V=t.ref(!1),$=t.ref(!1),O=t.ref(""),C=t.ref(null),R=t.ref("source"),T=t.ref(null),w=t.toRef(()=>typeof N.value.selectable>"u"?g.value:N.value.selectable),I=t.toRef(()=>typeof N.value.updatable>"u"?b.value:N.value.updatable),v=t.toRef(()=>typeof N.value.focusable>"u"?_.value:N.value.focusable);t.provide(MN,e.id),t.provide(VN,T);const B=t.computed(()=>N.value.class instanceof Function?N.value.class(N.value):N.value.class),M=t.computed(()=>N.value.style instanceof Function?N.value.style(N.value):N.value.style),x=t.computed(()=>{const L=N.value.type||"default",F=S==null?void 0:S[`edge-${L}`];if(F)return F;let X=N.value.template??c.value[L];if(typeof X=="string"&&A){const ee=Object.keys(A.appContext.components);ee&&ee.includes(L)&&(X=t.resolveComponent(L,!1))}return X&&typeof X!="string"?X:(r.error(new wt(kt.EDGE_TYPE_MISSING,X)),!1)}),{handlePointerDown:P}=Pf({nodeId:O,handleId:C,type:R,isValidConnection:p,edgeUpdaterType:R,onEdgeUpdate:he,onEdgeUpdateEnd:ie});return()=>{const L=m(N.value.source),F=m(N.value.target),X="pathOptions"in N.value?N.value.pathOptions:{};if(!L&&!F)return r.error(new wt(kt.EDGE_SOURCE_TARGET_MISSING,N.value.id,N.value.source,N.value.target)),null;if(!L)return r.error(new wt(kt.EDGE_SOURCE_MISSING,N.value.id,N.value.source)),null;if(!F)return r.error(new wt(kt.EDGE_TARGET_MISSING,N.value.id,N.value.target)),null;if(!N.value||N.value.hidden||L.hidden||F.hidden)return null;let ee;i.value===Sn.Strict?ee=L.handleBounds.source:ee=[...L.handleBounds.source||[],...L.handleBounds.target||[]];const ke=vf(ee,N.value.sourceHandle);let ye;i.value===Sn.Strict?ye=F.handleBounds.target:ye=[...F.handleBounds.target||[],...F.handleBounds.source||[]];const Ne=vf(ye,N.value.targetHandle),we=(ke==null?void 0:ke.position)||Oe.Bottom,G=(Ne==null?void 0:Ne.position)||Oe.Top,{x:q,y:W}=Qo(L,ke,we),{x:Ce,y:$e}=Qo(F,Ne,G);return N.value.sourceX=q,N.value.sourceY=W,N.value.targetX=Ce,N.value.targetY=$e,t.h("g",{ref:T,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${x.value===!1?"default":N.value.type||"default"}`,s.value,B.value,{updating:V.value,selected:N.value.selected,animated:N.value.animated,inactive:!w.value&&!k.value.edgeClick.hasListeners()}],tabIndex:v.value?0:void 0,"aria-label":N.value.ariaLabel===null?void 0:N.value.ariaLabel??`Edge from ${N.value.source} to ${N.value.target}`,"aria-describedby":v.value?`${of}-${n}`:void 0,"aria-roledescription":"edge",role:v.value?"group":"img",...N.value.domAttributes,onClick:pe,onContextmenu:ge,onDblclick:Te,onMouseenter:He,onMousemove:De,onMouseleave:Z,onKeyDown:v.value?z:void 0},[$.value?null:t.h(x.value===!1?c.value.default:x.value,{id:e.id,sourceNode:L,targetNode:F,source:N.value.source,target:N.value.target,type:N.value.type,updatable:I.value,selected:N.value.selected,animated:N.value.animated,label:N.value.label,labelStyle:N.value.labelStyle,labelShowBg:N.value.labelShowBg,labelBgStyle:N.value.labelBgStyle,labelBgPadding:N.value.labelBgPadding,labelBgBorderRadius:N.value.labelBgBorderRadius,data:N.value.data,events:{...N.value.events,...E},style:M.value,markerStart:`url('#${Pi(N.value.markerStart,n)}')`,markerEnd:`url('#${Pi(N.value.markerEnd,n)}')`,sourcePosition:we,targetPosition:G,sourceX:q,sourceY:W,targetX:Ce,targetY:$e,sourceHandleId:N.value.sourceHandle,targetHandleId:N.value.targetHandle,interactionWidth:N.value.interactionWidth,...X}),[I.value==="source"||I.value===!0?[t.h("g",{onMousedown:re,onMouseenter:Y,onMouseout:se},t.h(Zf,{position:we,centerX:q,centerY:W,radius:a.value,type:"source","data-type":"source"}))]:null,I.value==="target"||I.value===!0?[t.h("g",{onMousedown:ue,onMouseenter:Y,onMouseout:se},t.h(Zf,{position:G,centerX:Ce,centerY:$e,radius:a.value,type:"target","data-type":"target"}))]:null]])};function Y(){V.value=!0}function se(){V.value=!1}function he(L,F){y.update({event:L,edge:N.value,connection:F})}function ie(L){y.updateEnd({event:L,edge:N.value}),$.value=!1}function fe(L,F){L.button===0&&($.value=!0,O.value=F?N.value.target:N.value.source,C.value=(F?N.value.targetHandle:N.value.sourceHandle)??null,R.value=F?"target":"source",y.updateStart({event:L,edge:N.value}),P(L))}function pe(L){var F;const X={event:L,edge:N.value};w.value&&(l.value=!1,N.value.selected&&f.value?(d([N.value]),(F=T.value)==null||F.blur()):o([N.value])),y.click(X)}function ge(L){y.contextMenu({event:L,edge:N.value})}function Te(L){y.doubleClick({event:L,edge:N.value})}function He(L){y.mouseEnter({event:L,edge:N.value})}function De(L){y.mouseMove({event:L,edge:N.value})}function Z(L){y.mouseLeave({event:L,edge:N.value})}function re(L){fe(L,!0)}function ue(L){fe(L,!1)}function z(L){var F;!h.value&&af.includes(L.key)&&w.value&&(L.key==="Escape"?((F=T.value)==null||F.blur(),d([u(e.id)])):o([u(e.id)]))}}}),Uw=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}=tt(),p=(e=t.inject(rr))==null?void 0:e["connection-line"],f=t.computed(()=>{var k;return m((k=i.value)==null?void 0:k.nodeId)}),h=t.computed(()=>{var k;return m((k=a.value)==null?void 0:k.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(#${Pi(c.value.markerStart,n)})`:""),_=t.computed(()=>c.value.markerEnd?`url(#${Pi(c.value.markerEnd,n)})`:"");return()=>{var k,N,y;if(!f.value||!i.value)return null;const E=i.value.id,S=i.value.type,A=f.value.handleBounds;let V=(A==null?void 0:A[S])??[];if(o.value===Sn.Loose){const M=(A==null?void 0:A[S==="source"?"target":"source"])??[];V=[...V,...M]}if(!V)return null;const $=(E?V.find(M=>M.id===E):V[0])??null,O=($==null?void 0:$.position)??Oe.Top,{x:C,y:R}=Qo(f.value,$,O);let T=null;h.value&&(o.value===Sn.Strict?T=((k=h.value.handleBounds[S==="source"?"target":"source"])==null?void 0:k.find(M=>{var x;return M.id===((x=a.value)==null?void 0:x.id)}))||null:T=((N=[...h.value.handleBounds.source??[],...h.value.handleBounds.target??[]])==null?void 0:N.find(M=>{var x;return M.id===((x=a.value)==null?void 0:x.id)}))||null);const w=((y=a.value)==null?void 0:y.position)??(O?ws[O]:null);if(!O||!w)return null;const I=l.value??c.value.type??go.Bezier;let v="";const B={sourceX:C,sourceY:R,sourcePosition:O,targetX:g.value.x,targetY:g.value.y,targetPosition:w};return I===go.Bezier?[v]=Gf(B):I===go.Step?[v]=xs({...B,borderRadius:0}):I===go.SmoothStep?[v]=xs(B):I===go.SimpleBezier?[v]=qf(B):v=`M${C},${R} ${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"},p?t.h(p,{sourceX:C,sourceY:R,sourcePosition:O,targetX:g.value.x,targetY:g.value.y,targetPosition:w,sourceNode:f.value,sourceHandle:$,targetNode:h.value,targetHandle:T,markerEnd:_.value,markerStart:b.value,connectionStatus:d.value}):t.h("path",{d:v,class:[c.value.class,d.value,"vue-flow__connection-path"],style:{...s.value,...c.value.style},"marker-end":_.value,"marker-start":b.value})))}}}),Hw=["id","markerWidth","markerHeight","markerUnits","orient"],jw={name:"MarkerType",compatConfig:{MODE:3}},Kw=t.defineComponent({...jw,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(ps).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(ps).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,Hw))}}),Gw={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},Yw={name:"MarkerDefinitions",compatConfig:{MODE:3}},qw=t.defineComponent({...Yw,setup(e){const{id:n,edges:o,connectionLineOptions:i,defaultMarkerColor:a}=tt(),r=t.computed(()=>{const l=new Set,s=[],c=d=>{if(d){const u=Pi(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",Gw,[t.createElementVNode("defs",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,c=>(t.openBlock(),t.createBlock(Kw,{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))])]))}}),Ww={name:"Edges",compatConfig:{MODE:3}},Jw=t.defineComponent({...Ww,setup(e){const{findNode:n,getEdges:o,elevateEdgesOnSelect:i}=tt();return(a,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(qw),(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(EN)(l,t.unref(n),t.unref(i))})},[t.createVNode(t.unref(Fw),{id:l.id},null,8,["id"])],4))),128)),t.createVNode(t.unref(Uw))],64))}}),Xw=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:p,elevateNodesOnSelect:f,disableKeyboardA11y:h,ariaLiveMessage:g,snapToGrid:b,snapGrid:_,nodeDragThreshold:k,nodesDraggable:N,elementsSelectable:y,nodesConnectable:E,nodesFocusable:S,hooks:A}=tt(),V=t.ref(null);t.provide(Of,V),t.provide(Df,e.id);const $=t.inject(rr),O=t.getCurrentInstance(),C=Ff(),{node:R,parentNode:T}=zf(e.id),{emit:w,on:I}=zN(R,l),v=t.toRef(()=>typeof R.draggable>"u"?N.value:R.draggable),B=t.toRef(()=>typeof R.selectable>"u"?y.value:R.selectable),M=t.toRef(()=>typeof R.connectable>"u"?E.value:R.connectable),x=t.toRef(()=>typeof R.focusable>"u"?S.value:R.focusable),P=t.computed(()=>B.value||v.value||A.value.nodeClick.hasListeners()||A.value.nodeDoubleClick.hasListeners()||A.value.nodeMouseEnter.hasListeners()||A.value.nodeMouseMove.hasListeners()||A.value.nodeMouseLeave.hasListeners()),Y=t.toRef(()=>!!R.dimensions.width&&!!R.dimensions.height),se=t.computed(()=>{const F=R.type||"default",X=$==null?void 0:$[`node-${F}`];if(X)return X;let ee=R.template||m.value[F];if(typeof ee=="string"&&O){const ke=Object.keys(O.appContext.components);ke&&ke.includes(F)&&(ee=t.resolveComponent(F,!1))}return ee&&typeof ee!="string"?ee:(l.error(new wt(kt.NODE_TYPE_MISSING,ee)),!1)}),he=Lf({id:e.id,el:V,disabled:()=>!v.value,selectable:B,dragHandle:()=>R.dragHandle,onStart(F){w.dragStart(F)},onDrag(F){w.drag(F)},onStop(F){w.dragStop(F)},onClick(F){z(F)}}),ie=t.computed(()=>R.class instanceof Function?R.class(R):R.class),fe=t.computed(()=>{const F=(R.style instanceof Function?R.style(R):R.style)||{},X=R.width instanceof Function?R.width(R):R.width,ee=R.height instanceof Function?R.height(R):R.height;return!F.width&&X&&(F.width=typeof X=="string"?X:`${X}px`),!F.height&&ee&&(F.height=typeof ee=="string"?ee:`${ee}px`),F}),pe=t.toRef(()=>Number(R.zIndex??fe.value.zIndex??0));return u(F=>{(F.includes(e.id)||!F.length)&&Te()}),t.onMounted(()=>{t.watch(()=>R.hidden,(F=!1,X,ee)=>{!F&&V.value&&(e.resizeObserver.observe(V.value),ee(()=>{V.value&&e.resizeObserver.unobserve(V.value)}))},{immediate:!0,flush:"post"})}),t.watch([()=>R.type,()=>R.sourcePosition,()=>R.targetPosition],()=>{t.nextTick(()=>{d([{id:e.id,nodeElement:V.value,forceUpdate:!0}])})}),t.watch([()=>R.position.x,()=>R.position.y,()=>{var F;return(F=T.value)==null?void 0:F.computedPosition.x},()=>{var F;return(F=T.value)==null?void 0:F.computedPosition.y},()=>{var F;return(F=T.value)==null?void 0:F.computedPosition.z},pe,()=>R.selected,()=>R.dimensions.height,()=>R.dimensions.width,()=>{var F;return(F=T.value)==null?void 0:F.dimensions.height},()=>{var F;return(F=T.value)==null?void 0:F.dimensions.width}],([F,X,ee,ke,ye,Ne])=>{const we={x:F,y:X,z:Ne+(f.value&&R.selected?1e3:0)};typeof ee<"u"&&typeof ke<"u"?R.computedPosition=hN({x:ee,y:ke,z:ye},we):R.computedPosition=we},{flush:"post",immediate:!0}),t.watch([()=>R.extent,p],([F,X],[ee,ke])=>{(F!==ee||X!==ke)&&ge()}),R.extent==="parent"||typeof R.extent=="object"&&"range"in R.extent&&R.extent.range==="parent"?Gl(()=>Y).toBe(!0).then(ge):ge(),()=>R.hidden?null:t.h("div",{ref:V,"data-id":R.id,class:["vue-flow__node",`vue-flow__node-${se.value===!1?"default":R.type||"default"}`,{[o.value]:v.value,dragging:he==null?void 0:he.value,draggable:v.value,selected:R.selected,selectable:B.value,parent:R.isParent},ie.value],style:{visibility:Y.value?"visible":"hidden",zIndex:R.computedPosition.z??pe.value,transform:`translate(${R.computedPosition.x}px,${R.computedPosition.y}px)`,pointerEvents:P.value?"all":"none",...fe.value},tabIndex:x.value?0:void 0,role:x.value?"group":void 0,"aria-describedby":h.value?void 0:`${nf}-${n}`,"aria-label":R.ariaLabel,"aria-roledescription":"node",...R.domAttributes,onMouseenter:He,onMousemove:De,onMouseleave:Z,onContextmenu:re,onClick:z,onDblclick:ue,onKeydown:L},[t.h(se.value===!1?m.value.default:se.value,{id:R.id,type:R.type,data:R.data,events:{...R.events,...I},selected:R.selected,resizing:R.resizing,dragging:he.value,connectable:M.value,position:R.computedPosition,dimensions:R.dimensions,isValidTargetPos:R.isValidTargetPos,isValidSourcePos:R.isValidSourcePos,parent:R.parentNode,parentNodeId:R.parentNode,zIndex:R.computedPosition.z??pe.value,targetPosition:R.targetPosition,sourcePosition:R.sourcePosition,label:R.label,dragHandle:R.dragHandle,onUpdateNodeInternals:Te})]);function ge(){const F=R.computedPosition,{computedPosition:X,position:ee}=ks(R,b.value?ar(F,_.value):F,l.error,p.value,T.value);(R.computedPosition.x!==X.x||R.computedPosition.y!==X.y)&&(R.computedPosition={...R.computedPosition,...X}),(R.position.x!==ee.x||R.position.y!==ee.y)&&(R.position=ee)}function Te(){V.value&&d([{id:e.id,nodeElement:V.value,forceUpdate:!0}])}function He(F){he!=null&&he.value||w.mouseEnter({event:F,node:R})}function De(F){he!=null&&he.value||w.mouseMove({event:F,node:R})}function Z(F){he!=null&&he.value||w.mouseLeave({event:F,node:R})}function re(F){return w.contextMenu({event:F,node:R})}function ue(F){return w.doubleClick({event:F,node:R})}function z(F){B.value&&(!i.value||!v.value||k.value>0)&&Is(R,r.value,c,s,a,!1,V.value),w.click({event:F,node:R})}function L(F){if(!(hs(F)||h.value))if(af.includes(F.key)&&B.value){const X=F.key==="Escape";Is(R,r.value,c,s,a,X,V.value)}else v.value&&R.selected&&Xo[F.key]&&(F.preventDefault(),g.value=`Moved selected node ${F.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~R.position.x}, y: ${~~R.position.y}`,C({x:Xo[F.key].x,y:Xo[F.key].y},F.shiftKey))}}});function Zw(e={includeHiddenNodes:!1}){const{nodes:n}=tt();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 Qw={class:"vue-flow__nodes vue-flow__container"},eI={name:"Nodes",compatConfig:{MODE:3}},tI=t.defineComponent({...eI,setup(e){const{getNodes:n,updateNodeDimensions:o,emits:i}=tt(),a=Zw(),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",Qw,[r.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(n),(c,d,u,m)=>{const p=[c.id];if(m&&m.key===c.id&&t.isMemoSame(m,p))return m;const f=(t.openBlock(),t.createBlock(t.unref(Xw),{id:c.id,key:c.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return f.memo=p,f},s,0),128)):t.createCommentVNode("",!0)]))}});function nI(){const{emits:e}=tt();t.onMounted(()=>{if(Af()){const n=document.querySelector(".vue-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.error(new wt(kt.MISSING_STYLES))}})}const oI=t.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),iI={name:"VueFlow",compatConfig:{MODE:3}},aI=t.defineComponent({...iI,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=Yl(i,"modelValue",o),l=Yl(i,"nodes",o),s=Yl(i,"edges",o),c=tt(i),d=jN({modelValue:r,nodes:l,edges:s},i,c);return GN(o,c.hooks),Lw(),nI(),t.provide(rr,a),t.onUnmounted(d),n(c),(u,m)=>(t.openBlock(),t.createElementBlock("div",{ref:t.unref(c).vueFlowRef,class:"vue-flow"},[t.createVNode(Tw,null,{default:t.withCtx(()=>[t.createVNode(Jw),oI,t.createVNode(tI),t.renderSlot(u.$slots,"zoom-pane")]),_:3}),t.renderSlot(u.$slots,"default"),t.createVNode(Ow)],512))}}),rI={name:"Panel",compatConfig:{MODE:3}},Qf=t.defineComponent({...rI,props:{position:{}},setup(e){const n=e,{userSelectionActive:o}=tt(),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))}}),lI=["width","height","innerHTML"],sI=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"/>'};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,lI))}}),Qe=(e,n)=>{const o=e.__vccOpts||e;for(const[i,a]of n)o[i]=a;return o},Ve=Qe(sI,[["__scopeId","data-v-05aac699"]]),wo=["red","amber","green","teal","blue","indigo","violet","pink"],ep={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 cI(e){return typeof e=="string"&&e in ep}const dI={red:0,amber:32,green:145,teal:173,blue:221,indigo:244,violet:262,pink:330},uI=.15;function mI(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 fI(e){if(typeof e!="string")return null;const n=mI(e);if(!n||n.s<uI)return null;let o=null,i=1/0;for(const a of wo){const r=Math.abs(n.h-dI[a]),l=Math.min(r,360-r);l<i&&(i=l,o=a)}return o}function $t(e){var i;const n=(i=e==null?void 0:e.properties)==null?void 0:i.swatch;if(cI(n))return n;const o=e==null?void 0:e.properties;return fI((o==null?void 0:o["background-color"])??(o==null?void 0:o["font-color"])??(o==null?void 0:o.color))}function As(e){return e?{bar:`var(--em-swatch-${e}-bar)`,barOn:`var(--em-swatch-${e}-on)`,text:`var(--em-swatch-${e}-text)`}:null}const pI={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)"},hI={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 tp(e,n=!1){return e?n?hI[e]:pI[e]:null}function Io(e){return ep[e]}function ei(e){return`var(--em-swatch-${e}-bar)`}function yI(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 gI(e,n){const o=yI(n);return o?e(o):n.split("-")[1]??n}function bI(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-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-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 np(e,n){const o=bI(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 _I(e){return e.targetKind==="entity"?e.targetRef:e.contextRef}const kI={class:"em-inline-issue__msgs"},vo=Qe(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(Ve,{name:i[r.value].icon,size:13,class:"em-inline-issue__icon"},null,8,["name"]),t.createElementVNode("span",kI,[(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(np)(t.unref(o).t,c)),1))),128))])],2)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-9f959cc0"]]),EI=["id","aria-selected","aria-controls","tabindex","onClick","onKeydown"],NI={key:0,class:"em-mlang__dot"},wI=["id","role","aria-labelledby"],II=["title"],Qt=Qe(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 _=o.defaultLang;return _&&o.languages.includes(_)?_:o.languages[0]??"ko"}const r=t.computed(()=>o.activeLang!==void 0),l=t.ref(a()),s=t.computed(()=>{const _=o.activeLang;return _&&o.languages.includes(_)?_:r.value?o.languages[0]??"ko":l.value});t.watch(()=>[o.languages,o.defaultLang],()=>{o.languages.includes(l.value)||(l.value=a())});function c(_){var k,N;return!!((N=(k=o.modelValue)==null?void 0:k[_])!=null&&N.trim())}const d=_=>`${o.name}-tab-${_}`,u=t.computed(()=>`${o.name}-panel`),m=t.ref(null);async function p(_){var y,E;const k=o.languages,N=k[(_+k.length)%k.length];N&&(l.value=N,await t.nextTick(),(E=(y=m.value)==null?void 0:y.querySelectorAll('[role="tab"]')[k.indexOf(N)])==null||E.focus())}function f(_){p(o.languages.indexOf(s.value)+_)}const h=t.computed(()=>o.languages.filter(_=>{var k,N;return _!==s.value&&!!((N=(k=o.modelValue)==null?void 0:k[_])!=null&&N.trim())})),g=t.computed(()=>{var _;return((_=o.modelValue)==null?void 0:_[s.value])??""});function b(_){const k={...o.modelValue};_.trim()===""?delete k[s.value]:k[s.value]=_,i("update:modelValue",k)}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,N=>(t.openBlock(),t.createElementBlock("span",{id:d(N),key:N,class:t.normalizeClass(["em-mlang__tab",{"is-active":s.value===N}]),role:"tab","aria-selected":s.value===N,"aria-controls":u.value,tabindex:s.value===N?0:-1,onClick:y=>l.value=N,onKeydown:[t.withKeys(t.withModifiers(y=>l.value=N,["prevent"]),["enter"]),t.withKeys(t.withModifiers(y=>l.value=N,["prevent"]),["space"]),k[0]||(k[0]=t.withKeys(t.withModifiers(y=>f(-1),["prevent"]),["left"])),k[1]||(k[1]=t.withKeys(t.withModifiers(y=>f(1),["prevent"]),["right"])),k[2]||(k[2]=t.withKeys(t.withModifiers(y=>p(0),["prevent"]),["home"])),k[3]||(k[3]=t.withKeys(t.withModifiers(y=>p(e.languages.length-1),["prevent"]),["end"]))]},[t.createTextVNode(t.toDisplayString(N),1),c(N)?(t.openBlock(),t.createElementBlock("span",NI,"•")):t.createCommentVNode("",!0)],42,EI))),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(oe.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(oe.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,wI),r.value&&h.value.length?(t.openBlock(),t.createElementBlock("span",{key:1,class:"em-mlang__others",title:h.value.join(", "),"aria-hidden":"true"},"•",8,II)):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-9cb21667"]]),vI=["disabled"],CI={class:"em-panel__sub-label"},SI={class:"em-field"},xI={class:"em-field"},RI={class:"em-field"},AI={key:0,class:"em-field"},$I={class:"em-field"},TI={class:"em-class"},MI={class:"em-field"},VI={class:"em-field"},BI={key:1,class:"em-attr__navhint"},DI={key:2,class:"em-field"},OI={key:3,class:"em-field"},LI={class:"em-multilang"},PI={class:"em-multilang"},zI={key:4,class:"em-jpa"},FI={class:"em-field"},UI={class:"em-field"},HI={class:"em-field"},jI=["title"],KI={class:"em-swatch"},GI={class:"em-swatch__row"},YI=["title"],qI=["title","onClick"],op=Qe(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(M=>M.modelId===o.entityId)??null),l=t.computed(()=>r.value?a.state.layout.entityLayouts.find(M=>M.entityRef===r.value.modelId)??null:null),s=t.computed(()=>{var M;return $t(((M=l.value)==null?void 0:M.style)??void 0)}),c=["JPA_ENTITY","JPA_EMBEDDABLE","SERIALIZED_TYPE","JPA_MULTI_LANGUAGE_ENTITY","UNDEFINED"],d=["none","LIST","SET","MAP"],u=t.computed(()=>{var M,x;return((x=(M=r.value)==null?void 0:M.serialization)==null?void 0:x.collectionType)??"none"});function m(M){return M==="none"?a.t("em.entity.serializedContainerNone"):M}function p(M){var Y,se;const x=M==="none"?void 0:M,P=x==="MAP"?(se=(Y=r.value)==null?void 0:Y.serialization)==null?void 0:se.mapKeyType:void 0;k({serialization:x?{collectionType:x,...P?{mapKeyType:P}:{}}:null})}function f(M){var P,Y;((Y=(P=r.value)==null?void 0:P.serialization)==null?void 0:Y.collectionType)==="MAP"&&k({serialization:{collectionType:"MAP",...M.trim()?{mapKeyType:M.trim()}:{}}})}const h=[{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=M=>M;function _(M){return M==="inherit"?a.t("em.common.inherit"):M}function k(M){r.value&&a.updateEntity(r.value.modelId,M)}function N(M,x,P){var se;const Y=((se=r.value)==null?void 0:se.table)??{physicalName:""};k(M==="physicalName"?{table:{...Y,physicalName:P}}:{table:{...Y,logicalName:{...Y.logicalName,[x]:P}}})}function y(M){k({description:Object.keys(M).length?M:void 0})}function E(M,x){var P;k({jpaAttrs:{...(P=r.value)==null?void 0:P.jpaAttrs,[M]:x}})}function S(M,x){E(M,x)}const A=t.computed(()=>{var M,x;return((x=(M=r.value)==null?void 0:M.jpaAttrs)==null?void 0:x.discriminatorType)??"inherit"}),V=t.computed(()=>{var M,x;return!((x=(M=r.value)==null?void 0:M.jpaAttrs)!=null&&x.useDiscriminator)});function $(M){E("discriminatorType",M==="inherit"?void 0:M)}function O(M){k({hasPersonalInfo:M})}function C(M){k({referenceOnly:M?!0:void 0})}function R(M){k({superClass:M.trim()||void 0})}function T(M){k({schema:M.trim()||void 0})}function w(M){k({abstractClass:M})}const I=t.computed(()=>{var M,x;return((x=(M=r.value)==null?void 0:M.declarationOfInterfaces)==null?void 0:x.join(", "))??""});function v(M){const x=M.split(",").map(P=>P.trim()).filter(Boolean);k({declarationOfInterfaces:x.length?x:void 0})}function B(M){r.value&&a.setEntitySwatch(r.value.modelId,M)}return(M,x)=>{var P,Y,se,he;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:x[0]||(x[0]=ie=>i("toggle"))},[t.createElementVNode("span",CI,[t.createVNode(Ve,{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(vo,{controller:t.unref(a),"ref-id":e.entityId,class:"em-section__issues"},null,8,["controller","ref-id"]),t.createElementVNode("label",SI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.name")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-name",width:"100%","model-value":r.value.name,"onUpdate:modelValue":x[1]||(x[1]=ie=>k({name:ie}))},null,8,["model-value"])]),t.createElementVNode("label",xI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.stereotype")),1),t.createVNode(t.unref(oe.BSSelect),{"model-value":r.value.stereotype,items:c,"value-provider":b,"label-provider":t.unref(si),"onUpdate:modelValue":x[2]||(x[2]=ie=>k({stereotype:ie}))},null,8,["model-value","label-provider"])]),r.value.stereotype==="SERIALIZED_TYPE"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",RI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.serializedContainer")),1),t.createVNode(t.unref(oe.BSSelect),{name:"ent-ser-container","model-value":u.value,items:d,"value-provider":b,"label-provider":m,"onUpdate:modelValue":x[3]||(x[3]=ie=>ie&&p(ie))},null,8,["model-value"])]),u.value==="MAP"?(t.openBlock(),t.createElementBlock("label",AI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.serializedMapKey")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-ser-mapkey",width:"100%",placeholder:t.unref(a).t("em.entity.serializedMapKeyPlaceholder"),"model-value":((P=r.value.serialization)==null?void 0:P.mapKeyType)??"","onUpdate:modelValue":f},null,8,["placeholder","model-value"])])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0),t.createElementVNode("label",$I,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.package")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-package",width:"100%","model-value":r.value.packageName??"","onUpdate:modelValue":x[4]||(x[4]=ie=>k({packageName:ie}))},null,8,["model-value"])]),t.createElementVNode("fieldset",TI,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.entity.classLegend")),1),t.createElementVNode("label",MI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.superClass")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-superclass",width:"100%",placeholder:t.unref(a).t("em.entity.superClassPlaceholder"),"model-value":r.value.superClass??"","onUpdate:modelValue":x[5]||(x[5]=ie=>R(ie))},null,8,["placeholder","model-value"])]),t.createElementVNode("label",VI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.interfaces")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-interfaces",width:"100%",placeholder:t.unref(a).t("em.entity.interfacesPlaceholder"),"model-value":I.value,"onUpdate:modelValue":x[6]||(x[6]=ie=>v(ie))},null,8,["placeholder","model-value"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:"ent-abstract",class:"em-check",label:t.unref(a).t("em.entity.abstractClass"),"model-value":!!r.value.abstractClass,"onUpdate:modelValue":x[7]||(x[7]=ie=>w(ie))},null,8,["label","model-value"])]),t.unref(_t)(r.value.stereotype)?(t.openBlock(),t.createElementBlock("p",BI,t.toDisplayString(t.unref(a).t("em.entity.noOwnTableNote")),1)):(t.openBlock(),t.createElementBlock("label",DI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.tablePhysical")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-table",width:"100%","model-value":((Y=r.value.table)==null?void 0:Y.physicalName)??"","onUpdate:modelValue":x[8]||(x[8]=ie=>N("physicalName",null,ie))},null,8,["model-value"])])),t.unref(hn)(r.value.stereotype)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",OI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.schema")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-schema",width:"100%",placeholder:t.unref(a).t("em.entity.schemaPlaceholder"),"model-value":r.value.schema??"","onUpdate:modelValue":x[9]||(x[9]=ie=>T(ie))},null,8,["placeholder","model-value"])])),t.createElementVNode("fieldset",LI,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.entity.tableLogicalLegend")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a).languages.value,ie=>{var fe,pe;return t.openBlock(),t.createElementBlock("label",{key:ie,class:"em-lang"},[t.createElementVNode("span",null,t.toDisplayString(ie),1),t.createVNode(t.unref(oe.BSTextInput),{name:`ent-logical-${ie}`,width:"100%","model-value":((pe=(fe=r.value.table)==null?void 0:fe.logicalName)==null?void 0:pe[ie])??"","onUpdate:modelValue":ge=>N("logicalName",ie,ge)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),t.createElementVNode("fieldset",PI,[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":y},null,8,["languages","default-lang","model-value"])]),t.unref(hn)(r.value.stereotype)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("fieldset",zI,[x[14]||(x[14]=t.createElementVNode("legend",null,"JPA",-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(h,ie=>{var fe;return t.createVNode(t.unref(oe.BSCheckbox),{key:ie.key,name:`jpa-${ie.key}`,class:"em-check",label:ie.label,"model-value":!!((fe=r.value.jpaAttrs)!=null&&fe[ie.key]),"onUpdate:modelValue":pe=>S(ie.key,pe)},null,8,["name","label","model-value","onUpdate:modelValue"])}),64)),t.createElementVNode("label",FI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discColumn")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"disc-col",width:"100%",placeholder:t.unref(a).t("em.entity.discColumnPlaceholder"),disabled:V.value,"model-value":((se=r.value.jpaAttrs)==null?void 0:se.discriminatorColumnName)??"","onUpdate:modelValue":x[10]||(x[10]=ie=>E("discriminatorColumnName",ie.trim()||void 0))},null,8,["placeholder","disabled","model-value"])]),t.createElementVNode("label",UI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discType")),1),t.createVNode(t.unref(oe.BSSelect),{disabled:V.value,"model-value":A.value,items:g,"value-provider":b,"label-provider":_,"onUpdate:modelValue":x[11]||(x[11]=ie=>ie&&$(ie))},null,8,["disabled","model-value"])]),t.createElementVNode("label",HI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discLength")),1),t.createVNode(t.unref(oe.BSNumberInput),{name:"disc-len",width:"64px",placeholder:"len",disabled:V.value,"model-value":(he=r.value.jpaAttrs)==null?void 0:he.discriminatorLength,"onUpdate:modelValue":x[12]||(x[12]=ie=>E("discriminatorLength",ie||void 0))},null,8,["disabled","model-value"])])])),t.createVNode(t.unref(oe.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":O},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(oe.BSCheckbox),{name:"ent-reference-only",class:"em-check",label:t.unref(a).t("em.entity.referenceOnly"),"model-value":!!r.value.referenceOnly,"onUpdate:modelValue":C},null,8,["label","model-value"])],8,jI),t.createElementVNode("fieldset",KI,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.entity.headerColor")),1),t.createElementVNode("div",GI,[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:x[13]||(x[13]=ie=>B(null))},"∅",10,YI),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),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(ei)(ie)}),title:t.unref(a).t(t.unref(Io)(ie)),onClick:fe=>B(ie)},null,14,qI))),128))])])],64)):t.createCommentVNode("",!0)],8,vI)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-1b3b91f5"]]),WI=["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"],ip=["inherit","true","false"],pr="__OWN__";function ap(e,n){const o=t.computed(()=>e.state.logical.entities.find(J=>J.modelId===n())??null),i=t.computed(()=>{var J;return _t(((J=o.value)==null?void 0:J.stereotype)??"UNDEFINED")}),a=t.computed(()=>{var J;return hn(((J=o.value)==null?void 0:J.stereotype)??"UNDEFINED")}),r=t.computed(()=>new Set(e.selectedAttrIds.value));function l(J){return J==="none"?e.t("em.common.noneParen"):J}const s=J=>J;function c(J,ce){o.value&&e.updateAttribute(o.value.modelId,J.modelId,ce)}const d=t.computed(()=>jr(e.state.logical.associations));function u(J){if(!o.value)return;const ce=Po(e.state.logical,o.value.modelId,J.modelId);return ce&&ka(J,ce)?ce:void 0}function m(J){return!!u(J)}function p(J){return m(J)?J.derivedIdFieldName??"":J.name??""}function f(J){const ce=u(J);if(!ce)return e.t("em.attr.namePlaceholder");const Ae=new Map(e.state.logical.entities.map(Ee=>[Ee.modelId,Ee]));return gl({...J,derivedIdFieldName:void 0},ce,Ae)||e.t("em.attr.namePlaceholder")}function h(J,ce){m(J)?c(J,{derivedIdFieldName:ce||void 0}):c(J,{name:ce})}function g(J){return J.name??""}function b(J,ce){c(J,{name:ce})}function _(J){return!!o.value&&Kr(J,o.value,d.value)}function k(J){var Ee,H;const ce=(Ee=J.derivedFrom)==null?void 0:Ee.associationRef,Ae=(H=o.value)==null?void 0:H.attributes.find(It=>{var Rt;return It.attrType==="RELATION_OWN"&&((Rt=It.derivedFrom)==null?void 0:Rt.associationRef)===ce&&d.value.has(It.modelId)});return e.t("em.attr.joinColumnOnlyNote",{anchor:(Ae==null?void 0:Ae.name)||e.t("em.attr.nameless")})}function N(J){return!!o.value&&!!Po(e.state.logical,o.value.modelId,J.modelId)}function y(J,ce){c(J,{naturalId:ce||void 0,naturalIdMutable:ce?J.naturalIdMutable:void 0})}function E(){return{naturalId:void 0,naturalIdMutable:void 0}}function S(J,ce){c(J,{identifier:ce,...ce?E():{}})}function A(J,ce){c(J,{transient:ce||void 0,...ce?E():{}})}function V(J){return!!J.transient||J.attrType==="RELATION_REF"}function $(J){return ia(J)}function O(J,ce=0){var Ae;return((Ae=Zn(J,o.value,e.state.logical.entities,e.state.logical.associations,ce))==null?void 0:Ae.physicalName)||void 0}const C=J=>J.value,R=J=>J.label;function T(J,ce){if(!ce)return;const Ae=se.value.find(Ee=>Ee.type===ce);if(Ae){const Ee=J.dbAttrs[0]??{modelId:J.modelId+".c",physicalName:J.name,dataType:"VARCHAR"};c(J,{type:ce,customType:void 0,dbAttrs:[{...Ee,dataType:Ae.dataType,length:Ae.length,scale:Ae.scale}]});return}c(J,ce===_n?{type:ce}:{type:ce,customType:void 0})}function w(J,ce){c(J,{customType:ce.trim()===""?void 0:ce})}function I(J,ce){if(J.attrType==="RELATION_REF")return;const Ee={...J.dbAttrs[0]??{modelId:J.modelId+".c",physicalName:J.name,dataType:"VARCHAR"},...ce};ce.dataType!==void 0&&!el.has(Ee.dataType)&&(Ee.scale=void 0),c(J,{dbAttrs:[Ee]})}function v(J){var ce;return el.has(((ce=J.dbAttrs[0])==null?void 0:ce.dataType)??"")}function B(J){return!v(J)&&!$(J)&&!V(J)?e.t("em.attr.scaleTypeHint"):void 0}function M(J,ce){I(J,{logicalName:Object.keys(ce).length?ce:void 0})}function x(J,ce){c(J,{description:Object.keys(ce).length?ce:void 0})}function P(J){return J.personalInfoAttributeType??"none"}function Y(J,ce){c(J,{personalInfoAttributeType:ce==="none"?void 0:ce})}const se=t.computed(()=>e.predefinedCustomTypeCatalog.value),he=t.computed(()=>[...Vo(e.state.logical).keys()].sort()),ie=t.computed(()=>e.embeddableCatalog.value);function fe(J){var ce,Ae,Ee;return((ce=J.label)==null?void 0:ce[e.userLanguage.value])??((Ae=J.label)==null?void 0:Ae.ko)??((Ee=J.label)==null?void 0:Ee.en)??J.type}const pe=t.computed(()=>e.groupCodeCatalog.value);function ge(J){var ce;return((ce=pe.value.find(Ae=>Ae.groupCode===J.groupCode))==null?void 0:ce.codes)??[]}function Te(J){return["none",...ge(J)]}function He(J){return J==="none"?"none":J.code}function De(J){var Ae,Ee,H;if(J==="none")return e.t("em.common.noneParen");const ce=((Ae=J.label)==null?void 0:Ae[e.userLanguage.value])??((Ee=J.label)==null?void 0:Ee.ko)??((H=J.label)==null?void 0:H.en);return ce?`${J.code} (${ce})`:J.code}function Z(J,ce){o.value&&e.setAttributeGroupCode(o.value.modelId,J.modelId,ce)}function re(J,ce){c(J,{defaultValue:ce==="none"?void 0:ce})}function ue(J,ce){c(J,{defaultValue:ce.trim()===""?void 0:ce})}function z(J){return J.attrType.startsWith("EMBED")&&J.dbAttrs.length>0}const L=yn;function F(J){return z(J)||L(J)}function X(J,ce,Ae){const Ee=J.dbAttrs.map((H,It)=>{if(It!==ce)return H;const Rt={...H,...Ae};for(const ot of Object.keys(Ae))Ae[ot]===void 0&&delete Rt[ot];return Rt});o.value&&e.setEmbedColumns(o.value.modelId,J.modelId,Ee)}function ee(J,ce,Ae){X(J,ce,{logicalName:Object.keys(Ae).length?Ae:void 0})}function ke(J,ce){var H,It,Rt;if(L(J)){const ot=Zn(J,o.value,e.state.logical.entities,e.state.logical.associations,ce);return ot?{physicalName:ot.physicalName,dataType:ot.dataType,length:ot.length,scale:ot.scale,logicalName:ot.logicalName}:void 0}if(J.attrType==="EMBED_PREDEF"){const ot=(H=e.embeddableCatalog.value.find(We=>We.type===J.type))==null?void 0:H.fields[ce];return ot?{name:ot.name,physicalName:ot.physicalName,dataType:ot.dataType,length:ot.length,scale:ot.scale,shareable:ot.shareable,logicalName:ot.logicalName}:void 0}const Ae=(It=J.embedded)==null?void 0:It.embeddableRef;if(!Ae)return;const Ee=(Rt=e.state.logical.entities.find(ot=>ot.modelId===Ae))==null?void 0:Rt.attributes.flatMap(ot=>ot.dbAttrs)[ce];return Ee?{physicalName:Ee.physicalName,dataType:Ee.dataType,length:Ee.length,scale:Ee.scale,logicalName:Ee.logicalName}:void 0}function ye(J,ce){var Ae,Ee;return((Ae=ke(J,ce))==null?void 0:Ae.dataType)||((Ee=J.dbAttrs[ce])==null?void 0:Ee.dataType)||""}function Ne(J,ce){var Ae,Ee;return((Ae=ke(J,ce))==null?void 0:Ae.length)??((Ee=J.dbAttrs[ce])==null?void 0:Ee.length)}function we(J,ce){var Ae,Ee;return((Ae=ke(J,ce))==null?void 0:Ae.scale)??((Ee=J.dbAttrs[ce])==null?void 0:Ee.scale)}function G(J){return e.t(L(J)?"em.attr.fkFixedHint":"em.attr.embedFixedHint")}const q=ip;function W(J){return J==="inherit"?e.t("em.common.inherit"):J}function Ce(J){return(J==null?void 0:J.updatable)===void 0?"inherit":J.updatable?"true":"false"}function $e(J,ce,Ae){X(J,ce,{updatable:Ae==="inherit"?void 0:Ae==="true"})}function ze(J,ce){I(J,{updatable:ce==="inherit"?void 0:ce==="true"})}const Fe=ip;function ae(J){return J==="inherit"?e.t("em.common.inherit"):J}function Se(J){return(J==null?void 0:J.insertable)===void 0?"inherit":J.insertable?"true":"false"}function Ge(J,ce,Ae){X(J,ce,{insertable:Ae==="inherit"?void 0:Ae==="true"})}function et(J,ce){I(J,{insertable:ce==="inherit"?void 0:ce==="true"})}const te=t.computed(()=>o.value?Gr(o.value,e.state.logical.entities):[]),de=t.computed(()=>To(te.value.flatMap(J=>J.attributes.flatMap(ce=>ce.dbAttrs)))),Le=t.computed(()=>te.value.flatMap(J=>J.attributes.filter(ce=>ce.attrType==="NORMAL"&&ce.dbAttrs.length===1&&ce.dbAttrs[0]).map(ce=>{var Ae;return{modelId:ce.dbAttrs[0].modelId,physical:ce.dbAttrs[0].physicalName||ce.name,isCurrency:ce.type==="Currency",ownerName:J.modelId===((Ae=o.value)==null?void 0:Ae.modelId)?void 0:J.name}})));function dt(){const J=[...Le.value].sort((ce,Ae)=>Number(Ae.isCurrency)-Number(ce.isCurrency));return[pr,...J.map(ce=>ce.modelId)]}function Xe(J){if(J===pr)return e.t("em.attr.sharedOwn");const ce=Le.value.find(Ee=>Ee.modelId===J);if(!ce)return J;const Ae=ce.ownerName?`${ce.ownerName}.`:"";return e.t("em.attr.sharedRef",{owner:Ae,physical:ce.physical,mode:ce.isCurrency?e.t("em.attr.currencyMode"):e.t("em.attr.sharedMode")})}function yt(J){return(J==null?void 0:J.sharedColumnRef)??pr}function st(J,ce,Ae){X(J,ce,{sharedColumnRef:Ae===pr?void 0:Ae})}function ft(J){return(J==null?void 0:J.sharedColumnRef)!=null}function nt(J){var ce;return((ce=Qn(J,de.value))==null?void 0:ce.physicalName)??""}return{entity:o,isValueType:i,isColumnless:a,focusedAttrIds:r,personalInfoItems:WI,piiLabel:l,idn:s,setAttr:c,isDerivedIdRow:m,rowName:p,rowNamePlaceholder:f,setRowName:h,assocFieldName:g,setAssocFieldName:b,nameLocked:_,nameLockedHint:k,isManagedFk:N,setNaturalId:y,clearNaturalIdPatch:E,setIdentifier:S,setTransient:A,dbLocked:V,fkDerived:$,fkOriginPhysical:O,typeValueOf:C,typeLabelOf:R,setAttrType:T,setAttrCustomType:w,setDb:I,scaleApplicable:v,scaleHint:B,setDbLogical:M,setAttrDescription:x,attrPiiValue:P,setAttrPii:Y,predefinedCustomTypeCatalog:se,serializedTypeNames:he,embeddableCatalog:ie,predefinedLabel:fe,groupCodeCatalog:pe,attrGroupCodes:ge,attrCodeItems:Te,codeValueOf:He,codeLabelOf:De,setAttrGroupCode:Z,setAttrCode:re,setAttrDefaultValue:ue,isEmbedExpanded:z,isMultiColFk:L,hasColumnSlots:F,setDbAt:X,setDbLogicalAt:ee,colSlotMeta:ke,fixedDataType:ye,fixedLength:Ne,fixedScale:we,slotFixedHint:G,updatableItems:q,updatableLabel:W,updatableValue:Ce,setUpdatableAt:$e,setUpdatable:ze,insertableItems:Fe,insertableLabel:ae,insertableValue:Se,setInsertableAt:Ge,setInsertable:et,scopeEntities:te,columnsById:de,sharedCandidates:Le,sharedItems:dt,sharedLabel:Xe,sharedValue:yt,setSharedAt:st,isShared:ft,sharedPhysical:nt}}const rp={"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.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.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.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.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.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.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.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.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.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"},lp={"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.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.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.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.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.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.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.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.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.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":"未指定"},sp={"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.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.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.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.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.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.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.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.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.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":"미지정"},JI=["ko","en","ja"],$s={ko:sp,en:rp,ja:lp};function en(e,n,o){let a=($s[e]??$s.ko)[n]??$s.ko[n]??n;return o&&(a=a.replace(/\{(\w+)\}/g,(r,l)=>l in o?String(o[l]):r)),a}const cp=["ko","en","ja","zh"];function XI(e){if(e)for(const n of cp){const o=e[n];if(o)return o}}function Ts(e){const n=XI(e.label);return n?`${e.groupCode} (${n})`:e.groupCode}function ZI(e,n){const o=n.trim().toLowerCase();return o?e.filter(i=>i.groupCode.toLowerCase().includes(o)?!0:cp.some(a=>{var r,l;return(l=(r=i.label)==null?void 0:r[a])==null?void 0:l.toLowerCase().includes(o)})):e}const QI=["aria-expanded","placeholder"],ev=["aria-selected","onClick","onMouseenter"],tv={key:0,class:"gcc__opt gcc__opt--empty"},dp=Qe(t.defineComponent({__name:"GroupCodeCombobox",props:{modelValue:{},items:{},locale:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,i=n,a=($,O)=>en(o.locale??"ko",$,O),r=t.ref(),l=t.ref(),s=t.ref(),c=t.ref(""),d=t.ref(!1),u=t.ref(-1),m=t.ref({}),p=t.computed(()=>o.items.find($=>$.groupCode===o.modelValue)),f=t.computed(()=>p.value?Ts(p.value):"");t.watch(f,$=>{d.value||(c.value=$)},{immediate:!0});const h=t.computed(()=>c.value===f.value?o.items:ZI(o.items,c.value));function g(){var O;const $=(O=r.value)==null?void 0:O.getBoundingClientRect();$&&(m.value={left:`${$.left}px`,top:`${$.bottom}px`,width:`${$.width}px`})}function b(){d.value=!0,g(),u.value=Math.max(0,h.value.findIndex($=>$.groupCode===o.modelValue)),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),document.addEventListener("mousedown",V)}function _(){d.value=!1,window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),document.removeEventListener("mousedown",V)}t.onBeforeUnmount(_);function k(){b(),t.nextTick(()=>{var $;return($=l.value)==null?void 0:$.select()})}function N(){d.value||b(),u.value=0}function y($){i("update:modelValue",$.groupCode),c.value=Ts($),_()}function E(){i("update:modelValue",void 0),c.value="",_()}function S(){c.value.trim()===""?E():(c.value=f.value,_())}function A($){var O;if($.key==="ArrowDown")d.value||b(),u.value=Math.min(u.value+1,h.value.length-1),$.preventDefault();else if($.key==="ArrowUp")u.value=Math.max(u.value-1,0),$.preventDefault();else if($.key==="Enter"){const C=h.value[u.value];C&&y(C),$.preventDefault()}else $.key==="Escape"&&(c.value=f.value,_(),(O=l.value)==null||O.blur())}function V($){var C,R;const O=$.target;!((C=r.value)!=null&&C.contains(O))&&!((R=s.value)!=null&&R.contains(O))&&S()}return($,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]=C=>c.value=C),class:"gcc__input",type:"text",role:"combobox",autocomplete:"off","aria-expanded":d.value,placeholder:a("em.groupCode.searchPlaceholder"),onFocus:k,onInput:N,onKeydown:A},null,40,QI),[[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:E},t.toDisplayString(a("em.common.noneParen")),33),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,(C,R)=>(t.openBlock(),t.createElementBlock("li",{key:C.groupCode,class:t.normalizeClass(["gcc__opt",{"is-active":R===u.value,"is-selected":C.groupCode===e.modelValue}]),role:"option","aria-selected":C.groupCode===e.modelValue,onMousedown:O[2]||(O[2]=t.withModifiers(()=>{},["prevent"])),onClick:T=>y(C),onMouseenter:T=>u.value=R},t.toDisplayString(t.unref(Ts)(C)),43,ev))),128)),h.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("li",tv,t.toDisplayString(a("em.groupCode.noMatch")),1))],4)):t.createCommentVNode("",!0)]))],512))}}),[["__scopeId","data-v-431f9333"]]),nv=["aria-labelledby"],ov=["aria-checked","tabindex","onClick","onKeydown"],up=Qe(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,ov))),128))],8,nv))}}),[["__scopeId","data-v-5c793bbb"]]),iv=["disabled"],av={class:"em-aw__toolbar"},rv={class:"em-aw__count"},lv={class:"em-aw__scroll"},sv={class:"em-aw__table"},cv={class:"c-name"},dv={class:"c-type"},uv={class:"c-logical"},mv=["id"],fv={class:"c-col"},pv={class:"c-constraints"},hv={class:"c-del"},yv={class:"c-expand"},gv=["title","onClick","onKeydown"],bv=["title"],_v=["title"],kv={key:1,class:"em-aw__muted"},Ev=["title"],Nv=["title"],wv=["title"],Iv={class:"em-aw__cflags"},vv=["title"],Cv={key:0,class:"em-aw__embed-col"},Sv={class:"em-aw__embed-label"},xv=["title"],Rv={colspan:"8"},Av={class:"em-aw__detail"},$v={class:"em-aw__dgroup"},Tv=["title"],Mv={class:"em-aw__df"},Vv={class:"em-aw__df"},Bv={class:"em-aw__dgroup"},Dv={key:0,class:"em-aw__dgroup"},Ov={class:"em-aw__df"},Lv={key:0,class:"em-aw__df"},Pv={class:"em-aw__df"},zv={class:"em-aw__dgroup em-aw__ddesc"},Fv={class:"c-expand"},Uv=["title","onClick","onKeydown"],Hv={key:1,class:"em-aw__caret is-static","aria-hidden":"true"},jv=["title"],Kv=["title"],Gv=["colspan"],Yv=["title"],qv={class:"em-aw__cflags"},Wv=["title"],Jv={colspan:"8"},Xv={class:"em-aw__detail"},Zv={class:"em-aw__dgroup em-aw__ddesc"},Qv={class:"c-expand"},eC=["title","onClick","onKeydown"],tC={class:"em-aw__embed-label"},nC=["title"],oC=["title"],iC={class:"em-aw__ro"},aC=["title"],rC={class:"em-aw__ro"},lC=["title"],sC={class:"em-aw__ro"},cC={key:0,class:"em-aw__detail-row em-aw__embed-detail"},dC={colspan:"8"},uC={class:"em-aw__detail"},mC={class:"em-aw__dgroup"},fC={key:0,class:"em-aw__df"},pC={class:"em-aw__df"},hC={class:"em-aw__df"},yC={key:0},gC={colspan:"99",class:"em-aw__empty"},bC=6,mp=5,_C=Qe(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,setAttr:u,isDerivedIdRow:m,rowName:p,rowNamePlaceholder:f,setRowName:h,assocFieldName:g,setAssocFieldName:b,nameLocked:_,nameLockedHint:k,isManagedFk:N,setNaturalId:y,setIdentifier:E,setTransient:S,dbLocked:A,fkDerived:V,fkOriginPhysical:$,typeValueOf:O,typeLabelOf:C,setAttrType:R,setAttrCustomType:T,setDb:w,scaleApplicable:I,scaleHint:v,setDbLogical:B,attrPiiValue:M,setAttrPii:x,predefinedCustomTypeCatalog:P,serializedTypeNames:Y,embeddableCatalog:se,predefinedLabel:he,groupCodeCatalog:ie,attrGroupCodes:fe,attrCodeItems:pe,codeValueOf:ge,codeLabelOf:Te,setAttrGroupCode:He,setAttrCode:De,setAttrDefaultValue:Z,setAttrDescription:re,hasColumnSlots:ue,isMultiColFk:z,setDbAt:L,setDbLogicalAt:F,colSlotMeta:X,fixedDataType:ee,fixedLength:ke,fixedScale:ye,slotFixedHint:Ne,updatableItems:we,updatableLabel:G,updatableValue:q,setUpdatableAt:W,setUpdatable:Ce,insertableItems:$e,insertableLabel:ze,insertableValue:Fe,setInsertableAt:ae,setInsertable:Se,sharedItems:Ge,sharedLabel:et,sharedValue:te,setSharedAt:de,isShared:Le,sharedPhysical:dt}=ap(o,()=>n.entityId),Xe=t.computed(()=>{var Ae;return[...((Ae=i.value)==null?void 0:Ae.attributes)??[]].sort((Ee,H)=>Ee.order-H.order)}),yt=t.computed(()=>{var Ae;return(((Ae=i.value)==null?void 0:Ae.attributes)??[]).filter(Ee=>Ee.attrType!=="DIVIDER").length}),st=t.ref(new Set);function ft(Ae){return st.value.has(Ae)}function nt(Ae){const Ee=new Set(st.value);Ee.has(Ae)?Ee.delete(Ae):Ee.add(Ae),st.value=Ee}const J=t.ref(o.userLanguage.value);function ce(Ae){!Ae||!i.value||o.addPredefinedEmbed(i.value.modelId,Ae)}return(Ae,Ee)=>t.unref(i)?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-aw",disabled:!t.unref(o).editable.value},[t.createElementVNode("div",av,[t.createElementVNode("span",rv,t.toDisplayString(t.unref(o).t("em.attr.section",{n:yt.value})),1),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:Ee[0]||(Ee[0]=H=>t.unref(o).addAttribute(t.unref(i).modelId))},null,8,["caption"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t("em.attr.addDivider"),onClick:Ee[1]||(Ee[1]=H=>t.unref(o).addDivider(t.unref(i).modelId))},null,8,["caption"]),t.unref(se).length?(t.openBlock(),t.createBlock(t.unref(oe.BSSelect),{key:0,width:"140px",placeholder:t.unref(o).t("em.attr.addEmbeddable"),"model-value":void 0,items:t.unref(se),"value-provider":H=>H.type,"label-provider":t.unref(he),"onUpdate:modelValue":ce},null,8,["placeholder","items","value-provider","label-provider"])):t.createCommentVNode("",!0)]),t.createElementVNode("div",lv,[t.createElementVNode("table",sv,[t.createElementVNode("thead",null,[t.createElementVNode("tr",null,[Ee[3]||(Ee[3]=t.createElementVNode("th",{class:"c-expand"},null,-1)),t.createElementVNode("th",cv,t.toDisplayString(t.unref(o).t("em.attr.namePlaceholder")),1),t.createElementVNode("th",dv,t.toDisplayString(t.unref(o).t("em.attr.typePlaceholder")),1),t.createElementVNode("th",uv,[t.createElementVNode("span",{id:`aw-logical-head-${t.unref(i).modelId}`},t.toDisplayString(t.unref(o).t("em.attr.logicalPlaceholder")),9,mv),t.createVNode(up,{modelValue:J.value,"onUpdate:modelValue":Ee[2]||(Ee[2]=H=>J.value=H),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",fv,t.toDisplayString(t.unref(o).t("em.attr.columnPhysical")),1),Ee[4]||(Ee[4]=t.createElementVNode("th",{class:"c-dtype"},"dataType",-1)),Ee[5]||(Ee[5]=t.createElementVNode("th",{class:"c-len"},"len",-1)),t.createElementVNode("th",pv,t.toDisplayString(t.unref(o).t("em.attr.constraints")),1),Ee[6]||(Ee[6]=t.createElementVNode("th",{class:"c-del"},null,-1))])]),t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Xe.value,H=>{var It,Rt,ot,We,Ze,Q,Mt,Vt,Mn,an;return t.openBlock(),t.createElementBlock(t.Fragment,{key:H.modelId},[H.attrType==="DIVIDER"?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["em-aw__divider-row",{"is-focused":t.unref(l).has(H.modelId)}])},[Ee[7]||(Ee[7]=t.createElementVNode("td",{class:"c-expand"},null,-1)),t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-divlabel-${H.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.dividerLabelPlaceholder"),"model-value":H.name,"onUpdate:modelValue":be=>t.unref(u)(H,{name:be})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",{colspan:bC,class:"em-aw__divider-note"},t.toDisplayString(t.unref(o).t("em.attr.dividerNote")),1),t.createElementVNode("td",hv,[t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:be=>t.unref(o).removeAttribute(t.unref(i).modelId,H.modelId)},null,8,["onClick"])])],2)):t.unref(ue)(H)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("tr",{class:t.normalizeClass(["em-aw__embed-parent",{"is-focused":t.unref(l).has(H.modelId)}])},[t.createElementVNode("td",Fv,[t.unref(z)(H)?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["em-aw__caret",{"is-open":ft(H.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ft(H.modelId)?"em.attr.detailCollapse":"em.attr.detailExpand"),onClick:be=>nt(H.modelId),onKeydown:[t.withKeys(t.withModifiers(be=>nt(H.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(be=>nt(H.modelId),["prevent"]),["space"])]},[t.createVNode(Ve,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,Uv)):(t.openBlock(),t.createElementBlock("span",Hv,[t.createVNode(Ve,{name:"chevron",size:14,class:"em-aw__caret-ic"})]))]),t.createElementVNode("td",{title:t.unref(_)(H)?t.unref(k)(H):void 0},[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-name-${H.modelId}`,width:"100%",disabled:t.unref(_)(H),placeholder:t.unref(f)(H),"model-value":t.unref(p)(H),"onUpdate:modelValue":be=>t.unref(h)(H,be)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])],8,jv),t.createElementVNode("td",{title:t.unref(V)(H)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-type-${H.modelId}`,width:"100%",disabled:"","model-value":H.type},null,8,["name","model-value"])],8,Kv),t.createElementVNode("td",{colspan:t.unref(z)(H)?mp-1:mp,class:"em-aw__embed-note"},t.toDisplayString(t.unref(z)(H)?t.unref(o).t("em.attr.fkChildCols",{n:H.dbAttrs.length}):t.unref(o).t("em.attr.embedChildCols",{n:H.dbAttrs.length})),9,Gv),t.unref(z)(H)?(t.openBlock(),t.createElementBlock("td",{key:0,class:"c-constraints",title:t.unref(o).t("em.attr.fkDerivedNote")},[t.createElementVNode("div",qv,[t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-pk-${H.modelId}`,label:"PK","model-value":H.identifier,disabled:"","onUpdate:modelValue":be=>t.unref(E)(H,be)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-nn-${H.modelId}`,label:"NN","model-value":H.notNull,disabled:"","onUpdate:modelValue":be=>t.unref(u)(H,{notNull:be})},null,8,["name","model-value","onUpdate:modelValue"])])],8,Yv)):t.createCommentVNode("",!0),t.createElementVNode("td",{class:"c-del",title:t.unref(N)(H)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:be=>t.unref(o).removeAttribute(t.unref(i).modelId,H.modelId)},null,8,["onClick"])],8,Wv)],2),t.unref(z)(H)&&ft(H.modelId)?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["em-aw__detail-row",{"is-focused":t.unref(l).has(H.modelId)}])},[Ee[15]||(Ee[15]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",Jv,[t.createElementVNode("div",Xv,[t.createElementVNode("fieldset",Zv,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`aw-desc-${H.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":H.description,"onUpdate:modelValue":be=>t.unref(re)(H,be)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])])])],2)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(H.dbAttrs,(be,mt)=>{var vt,D,U,le,ne,xe,Be,qe;return t.openBlock(),t.createElementBlock(t.Fragment,{key:be.modelId},[t.createElementVNode("tr",{class:t.normalizeClass(["em-aw__embed-col",{"em-aw__open":ft(be.modelId)}])},[t.createElementVNode("td",Qv,[t.createElementVNode("span",{class:t.normalizeClass(["em-aw__caret",{"is-open":ft(be.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ft(be.modelId)?"em.attr.overrideCollapse":"em.attr.overrideExpand"),onClick:je=>nt(be.modelId),onKeydown:[t.withKeys(t.withModifiers(je=>nt(be.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(je=>nt(be.modelId),["prevent"]),["space"])]},[t.createVNode(Ve,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,eC)]),t.createElementVNode("td",tC,"↳ "+t.toDisplayString(((vt=t.unref(X)(H,mt))==null?void 0:vt.name)??((D=t.unref(X)(H,mt))==null?void 0:D.physicalName)??t.unref(o).t("em.attr.colFallback",{n:mt+1})),1),Ee[16]||(Ee[16]=t.createElementVNode("td",null,null,-1)),t.createElementVNode("td",null,[t.createVNode(Qt,{name:`aw-embed-logical-${be.modelId}`,languages:t.unref(o).languages.value,"active-lang":J.value,placeholder:((le=(U=t.unref(X)(H,mt))==null?void 0:U.logicalName)==null?void 0:le[J.value])??((xe=(ne=t.unref(X)(H,mt))==null?void 0:ne.logicalName)==null?void 0:xe.ko)??t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":be.logicalName,"onUpdate:modelValue":je=>t.unref(F)(H,mt,je)},null,8,["name","languages","active-lang","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",{title:t.unref(Le)(be)?t.unref(o).t("em.attr.embedSharedHint"):void 0},[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-embed-col-${be.modelId}`,width:"100%",disabled:t.unref(Le)(be),placeholder:((Be=t.unref(X)(H,mt))==null?void 0:Be.physicalName)??t.unref(o).t("em.attr.columnPlaceholder"),"model-value":t.unref(Le)(be)?t.unref(dt)(be):be.physicalName,"onUpdate:modelValue":je=>t.unref(L)(H,mt,{physicalName:je})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(vo,{controller:t.unref(o),"ref-id":be.modelId},null,8,["controller","ref-id"])],8,nC),t.createElementVNode("td",{title:t.unref(Ne)(H)},[t.createElementVNode("span",iC,t.toDisplayString(t.unref(ee)(H,mt)),1)],8,oC),t.createElementVNode("td",{title:t.unref(Ne)(H)},[t.createElementVNode("span",rC,t.toDisplayString(t.unref(ke)(H,mt)??""),1)],8,aC),t.createElementVNode("td",{class:"c-constraints",title:t.unref(Ne)(H)},[t.createElementVNode("span",sC,t.toDisplayString(t.unref(ye)(H,mt)!=null?`scale ${t.unref(ye)(H,mt)}`:""),1)],8,lC),Ee[17]||(Ee[17]=t.createElementVNode("td",null,null,-1))],2),ft(be.modelId)?(t.openBlock(),t.createElementBlock("tr",cC,[Ee[20]||(Ee[20]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",dC,[t.createElementVNode("div",uC,[t.createElementVNode("fieldset",mC,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.attr.overrideLegend")),1),(qe=t.unref(X)(H,mt))!=null&&qe.shareable?(t.openBlock(),t.createElementBlock("label",fC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.currencyColumn")),1),t.createVNode(t.unref(oe.BSSelect),{width:"150px","model-value":t.unref(te)(be),items:t.unref(Ge)(),"value-provider":t.unref(d),"label-provider":t.unref(et),"onUpdate:modelValue":je=>je&&t.unref(de)(H,mt,je)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.createElementVNode("label",pC,[Ee[18]||(Ee[18]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"110px",disabled:t.unref(Le)(be),"model-value":t.unref(Le)(be)?"false":t.unref(Fe)(be),items:t.unref($e),"value-provider":t.unref(d),"label-provider":t.unref(ze),"onUpdate:modelValue":je=>je&&t.unref(ae)(H,mt,je)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",hC,[Ee[19]||(Ee[19]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"110px",disabled:t.unref(Le)(be),"model-value":t.unref(Le)(be)?"false":t.unref(q)(be),items:t.unref(we),"value-provider":t.unref(d),"label-provider":t.unref(G),"onUpdate:modelValue":je=>je&&t.unref(W)(H,mt,je)},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(H.modelId),"em-aw__open":ft(H.modelId)})},[t.createElementVNode("td",yv,[t.createElementVNode("span",{class:t.normalizeClass(["em-aw__caret",{"is-open":ft(H.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ft(H.modelId)?"em.attr.detailCollapse":"em.attr.detailExpand"),onClick:be=>nt(H.modelId),onKeydown:[t.withKeys(t.withModifiers(be=>nt(H.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(be=>nt(H.modelId),["prevent"]),["space"])]},[t.createVNode(Ve,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,gv)]),t.createElementVNode("td",{title:t.unref(_)(H)?t.unref(k)(H):t.unref(m)(H)?t.unref(o).t("em.attr.derivedIdNote"):void 0},[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-name-${H.modelId}`,width:"100%",disabled:t.unref(_)(H),placeholder:t.unref(f)(H),"model-value":t.unref(p)(H),"onUpdate:modelValue":be=>t.unref(h)(H,be)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])],8,bv),t.createElementVNode("td",{title:t.unref(V)(H)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(oe.BSSelect),{name:`aw-type-${H.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.typePlaceholder"),disabled:!!H.groupCode||H.attrType==="RELATION_REF"||t.unref(V)(H),items:t.unref(Pc)(H.type,t.unref(P),t.unref(Y)),"value-provider":t.unref(O),"label-provider":t.unref(C),"model-value":H.type,"onUpdate:modelValue":be=>t.unref(R)(H,be)},null,8,["name","placeholder","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),H.type===t.unref(_n)&&!t.unref(V)(H)?(t.openBlock(),t.createBlock(t.unref(oe.BSTextInput),{key:0,name:`aw-customtype-${H.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.customTypePlaceholder"),"model-value":H.customType??"","onUpdate:modelValue":be=>t.unref(T)(H,be)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])):t.createCommentVNode("",!0)],8,_v),t.createElementVNode("td",null,[H.attrType!=="RELATION_REF"?(t.openBlock(),t.createBlock(Qt,{key:0,name:`aw-logical-${H.modelId}`,languages:t.unref(o).languages.value,"active-lang":J.value,placeholder:t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":(It=H.dbAttrs[0])==null?void 0:It.logicalName,"onUpdate:modelValue":be=>t.unref(B)(H,be)},null,8,["name","languages","active-lang","placeholder","model-value","onUpdate:modelValue"])):(t.openBlock(),t.createElementBlock("span",kv,"—"))]),t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-col-${H.modelId}`,width:"100%",placeholder:t.unref($)(H)??t.unref(o).t("em.attr.columnPlaceholder"),disabled:t.unref(r)||t.unref(A)(H),"model-value":((Rt=H.dbAttrs[0])==null?void 0:Rt.physicalName)??"","onUpdate:modelValue":be=>t.unref(w)(H,{physicalName:be})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),t.createVNode(vo,{controller:t.unref(o),"ref-id":(ot=H.dbAttrs[0])==null?void 0:ot.modelId},null,8,["controller","ref-id"])]),t.createElementVNode("td",{title:t.unref(r)?t.unref(o).t("em.attr.serializedNoColumnNote"):t.unref(V)(H)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(oe.BSSelect),{name:`aw-dtype-${H.modelId}`,width:"100%",placeholder:"dataType",disabled:t.unref(r)||t.unref(A)(H)||t.unref(V)(H),items:t.unref(Dc)(((We=H.dbAttrs[0])==null?void 0:We.dataType)??"",t.unref(o).selectableDataTypes.value),"value-provider":t.unref(d),"label-provider":t.unref(Qr),"model-value":((Ze=H.dbAttrs[0])==null?void 0:Ze.dataType)??"","onUpdate:modelValue":be=>be&&t.unref(w)(H,{dataType:be})},null,8,["name","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"])],8,Ev),t.createElementVNode("td",{title:t.unref(V)(H)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(oe.BSNumberInput),{name:`aw-len-${H.modelId}`,width:"100%",placeholder:"len",disabled:t.unref(A)(H)||t.unref(V)(H),"model-value":(Q=H.dbAttrs[0])==null?void 0:Q.length,"onUpdate:modelValue":be=>t.unref(w)(H,{length:be||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,Nv),t.createElementVNode("td",{class:"c-constraints",title:t.unref(V)(H)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createElementVNode("div",Iv,[t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-pk-${H.modelId}`,label:"PK","model-value":H.identifier,disabled:t.unref(a)||t.unref(A)(H)||t.unref(V)(H),"onUpdate:modelValue":be=>t.unref(E)(H,be)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-nn-${H.modelId}`,label:"NN","model-value":t.unref(r)?!1:H.notNull,disabled:t.unref(r)||t.unref(A)(H)||t.unref(V)(H),"onUpdate:modelValue":be=>t.unref(u)(H,{notNull:be})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-uq-${H.modelId}`,label:"UQ","model-value":!!((Mt=H.dbAttrs[0])!=null&&Mt.unique),disabled:t.unref(A)(H)||t.unref(V)(H),"onUpdate:modelValue":be=>t.unref(w)(H,{unique:be})},null,8,["name","model-value","disabled","onUpdate:modelValue"])])],8,wv),t.createElementVNode("td",{class:"c-del",title:t.unref(N)(H)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:be=>t.unref(o).removeAttribute(t.unref(i).modelId,H.modelId)},null,8,["onClick"])],8,vv)],2),t.unref(m)(H)?(t.openBlock(),t.createElementBlock("tr",Cv,[Ee[8]||(Ee[8]=t.createElementVNode("td",{class:"c-expand"},null,-1)),t.createElementVNode("td",Sv,"↳ "+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(oe.BSTextInput),{name:`aw-assocname-${H.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.namePlaceholder"),"model-value":t.unref(g)(H),"onUpdate:modelValue":be=>t.unref(b)(H,be)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])],8,xv)])):t.createCommentVNode("",!0),ft(H.modelId)?(t.openBlock(),t.createElementBlock("tr",{key:1,class:t.normalizeClass(["em-aw__detail-row",{"is-focused":t.unref(l).has(H.modelId)}])},[Ee[14]||(Ee[14]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",Rv,[t.createElementVNode("div",Av,[t.createElementVNode("fieldset",$v,[Ee[12]||(Ee[12]=t.createElementVNode("legend",null,"DB",-1)),t.createElementVNode("label",{class:"em-aw__df",title:t.unref(v)(H)},[Ee[9]||(Ee[9]=t.createElementVNode("span",null,"scale",-1)),t.createVNode(t.unref(oe.BSNumberInput),{name:`aw-scale-${H.modelId}`,width:"72px",placeholder:"scale",disabled:t.unref(A)(H)||t.unref(V)(H)||!t.unref(I)(H),"model-value":(Vt=H.dbAttrs[0])==null?void 0:Vt.scale,"onUpdate:modelValue":be=>t.unref(w)(H,{scale:be||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,Tv),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-ai-${H.modelId}`,label:"Auto Increment","model-value":!!((Mn=H.dbAttrs[0])!=null&&Mn.autoIncrement),disabled:t.unref(A)(H)||t.unref(V)(H)||!H.identifier,"onUpdate:modelValue":be=>t.unref(w)(H,{autoIncrement:be})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createElementVNode("label",Mv,[Ee[10]||(Ee[10]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(oe.BSSelect),{name:`aw-ins-${H.modelId}`,width:"110px",disabled:t.unref(A)(H),"model-value":t.unref(Fe)(H.dbAttrs[0]),items:t.unref($e),"value-provider":t.unref(d),"label-provider":t.unref(ze),"onUpdate:modelValue":be=>be&&t.unref(Se)(H,be)},null,8,["name","disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",Vv,[Ee[11]||(Ee[11]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(oe.BSSelect),{name:`aw-upd-${H.modelId}`,width:"110px",disabled:t.unref(A)(H),"model-value":t.unref(q)(H.dbAttrs[0]),items:t.unref(we),"value-provider":t.unref(d),"label-provider":t.unref(G),"onUpdate:modelValue":be=>be&&t.unref(Ce)(H,be)},null,8,["name","disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])])]),t.createElementVNode("fieldset",Bv,[Ee[13]||(Ee[13]=t.createElementVNode("legend",null,"JPA",-1)),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-tr-${H.modelId}`,label:"@Transient","model-value":!!H.transient,disabled:H.identifier||t.unref(V)(H),"onUpdate:modelValue":be=>t.unref(S)(H,be)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-nid-${H.modelId}`,label:"@NaturalId","model-value":!!H.naturalId,disabled:H.identifier||t.unref(A)(H)||t.unref(V)(H),"onUpdate:modelValue":be=>t.unref(y)(H,be)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{class:"em-aw__dsub",name:`aw-nidm-${H.modelId}`,label:"mutable","model-value":!!H.naturalIdMutable,disabled:t.unref(A)(H)||!H.naturalId,"onUpdate:modelValue":be=>t.unref(u)(H,{naturalIdMutable:be||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-mv-${H.modelId}`,label:"Multi-Value (Set)","model-value":!!((an=H.dbAttrs[0])!=null&&an.multiValue),disabled:t.unref(A)(H)||t.unref(V)(H),"onUpdate:modelValue":be=>t.unref(w)(H,{multiValue:be||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),t.unref(V)(H)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("fieldset",Dv,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.attr.semanticLegend")),1),t.createElementVNode("label",Ov,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createVNode(t.unref(oe.BSSelect),{width:"150px","model-value":t.unref(M)(H),items:t.unref(s),"value-provider":t.unref(d),"label-provider":t.unref(c),"onUpdate:modelValue":be=>be&&t.unref(x)(H,be)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.unref(ie).length?(t.openBlock(),t.createElementBlock("label",Lv,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.codeGroup")),1),t.createVNode(dp,{"model-value":H.groupCode,items:t.unref(ie),locale:t.unref(o).uiLocale.value,"onUpdate:modelValue":be=>t.unref(He)(H,be)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.createElementVNode("label",Pv,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.defaultValue")),1),t.unref(fe)(H).length?(t.openBlock(),t.createBlock(t.unref(oe.BSSelect),{key:0,width:"150px","model-value":H.defaultValue??"none",items:t.unref(pe)(H),"value-provider":t.unref(ge),"label-provider":t.unref(Te),"onUpdate:modelValue":be=>be&&t.unref(De)(H,be)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])):(t.openBlock(),t.createBlock(t.unref(oe.BSTextInput),{key:1,name:`aw-default-${H.modelId}`,width:"150px",placeholder:t.unref(o).t("em.attr.defaultValue"),"model-value":H.defaultValue??"","onUpdate:modelValue":be=>t.unref(Z)(H,be)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))])])),t.createElementVNode("fieldset",zv,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`aw-desc-${H.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":H.description,"onUpdate:modelValue":be=>t.unref(re)(H,be)},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",yC,[t.createElementVNode("td",gC,t.toDisplayString(t.unref(o).t("em.attr.empty")),1)]))])])])],8,iv)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-2bbe40a8"]]);function Ms(e,n){return n&&n!==e?`${e} (${n})`:e}function fp(e,n,o){const i=e.dbAttrs[n];return i?di(e,i,n,o.entity,o.logical,{embeddableCatalog:o.embeddableCatalog}):""}function kC(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}):Ms(o,fp(e,0,n))}function Vs(e,n){var l;if(Xn(e)){const s=(l=n.inherited)==null?void 0:l.find(c=>c.modelId===e);return s?Ms(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 Ms(i,fp(o,r<0?0:r,n))}function pp(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:kC(o,e)});continue}for(const a of i)n.push({ref:a.modelId,label:Vs(a.modelId,e)})}}return n}const EC=["disabled"],NC={class:"em-idxw__list"},wC={class:"em-idxw__list-head"},IC=["aria-label"],vC=["aria-current","onClick","onKeydown"],CC={class:"em-idxw__item-name"},SC={key:0,class:"em-idxw__badge"},xC={class:"em-idxw__item-cnt"},RC={key:0,class:"em-idxw__empty"},AC={key:0,class:"em-idxw__edit"},$C={class:"em-idxw__form"},TC={class:"em-field em-idxw__name"},MC={class:"em-field"},VC=["value","placeholder"],BC={class:"em-idxw__transfer"},DC={class:"em-idxw__pane"},OC={class:"em-idxw__pane-head"},LC=["aria-label"],PC=["aria-pressed","onClick","onKeydown"],zC=["title"],FC={key:0,class:"em-idxw__empty"},UC={class:"em-idxw__arrows"},HC={class:"em-idxw__pane"},jC={class:"em-idxw__pane-head"},KC={class:"em-idxw__col-name"},GC=["title"],YC={class:"em-idxw__col-ops"},qC=["title","disabled","onClick"],WC=["title","disabled","onClick"],JC=["title","onClick"],XC={key:0,class:"em-idxw__empty"},ZC={key:1,class:"em-idxw__edit em-idxw__edit--empty"},QC=Qe(t.defineComponent({__name:"EntityIndexesWide",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=t.computed(()=>o.state.logical.entities.find(T=>T.modelId===n.entityId)??null),a=t.computed(()=>{var T;return((T=i.value)==null?void 0:T.indexes)??[]}),r=t.computed(()=>{var T;return((T=i.value)==null?void 0:T.attributes)??[]}),l=t.ref(null),s=t.ref(null);t.watch(a,T=>{var w;T.some(I=>I.modelId===s.value)||(s.value=((w=T[0])==null?void 0:w.modelId)??null)},{immediate:!0});const c=t.computed(()=>a.value.find(T=>T.modelId===s.value)??null),d=t.computed(()=>i.value?ci(i.value,o.superClassCatalog.value):[]),u=t.computed(()=>Jn(r.value)),m=T=>u.value.canon(T),p=t.computed(()=>{var T;return new Set((((T=c.value)==null?void 0:T.columns)??[]).map(w=>m(w.columnRef)))}),f=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 h(T){return T.physicalName&&T.physicalName!==T.field?`${T.field} (${T.physicalName})`:T.field}function g(T){return Vs(T,f.value)}const b=t.computed(()=>[...pp(f.value).filter(T=>!p.value.has(m(T.ref))).map(T=>({ref:T.ref,label:T.label,inherited:!1})),...d.value.filter(T=>!p.value.has(m(T.modelId))).map(T=>({ref:T.modelId,label:h(T),inherited:!0}))]),_=t.ref(new Set);t.watch(s,()=>_.value=new Set);function k(T){return Xn(T)}function N(T,w){i.value&&o.updateIndex(i.value.modelId,T,w)}function y(){var w;if(!i.value)return;const T=Pe();o.addIndex(i.value.modelId,{modelId:T,name:`idx_${(((w=i.value.indexes)==null?void 0:w.length)??0)+1}`,unique:!1,columns:[]}),s.value=T}function E(T){i.value&&o.removeIndex(i.value.modelId,T)}function S(T){c.value&&N(c.value.modelId,{parameters:T.trim()===""?void 0:T})}function A(T){const w=new Set(_.value);w.has(T)?w.delete(T):w.add(T),_.value=w}function V(){const T=c.value;if(!T||!_.value.size)return;const w=[..._.value].map(I=>({columnRef:I,descending:!1}));N(T.modelId,{columns:[...T.columns,...w]}),_.value=new Set}function $(T){const w=c.value;w&&N(w.modelId,{columns:w.columns.filter((I,v)=>v!==T)})}function O(T,w){const I=c.value;I&&N(I.modelId,{columns:I.columns.map((v,B)=>B===T?{...v,descending:w}:v)})}function C(T,w){const I=c.value;if(!I)return;const v=T+w;if(v<0||v>=I.columns.length)return;const B=[...I.columns];[B[T],B[v]]=[B[v],B[T]],N(I.modelId,{columns:B}),R(v,w)}async function R(T,w){var x,P;await t.nextTick();const I=(x=l.value)==null?void 0:x.querySelectorAll(".em-idxw__col--idx")[T];if(!I)return;const v=Y=>I.querySelector(`[data-move="${Y}"]`),B=v(w<0?"up":"down"),M=v(w<0?"down":"up");(P=B&&!B.disabled?B:M)==null||P.focus()}return(T,w)=>i.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-idxw",disabled:!t.unref(o).editable.value},[t.createElementVNode("aside",NC,[t.createElementVNode("div",wC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.index.section",{n:a.value.length})),1),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:y},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,I=>(t.openBlock(),t.createElementBlock("li",{key:I.modelId,class:t.normalizeClass(["em-idxw__item",{"is-active":I.modelId===s.value}]),role:"button",tabindex:"0","aria-current":I.modelId===s.value?"true":void 0,onClick:v=>s.value=I.modelId,onKeydown:[t.withKeys(t.withModifiers(v=>s.value=I.modelId,["prevent"]),["enter"]),t.withKeys(t.withModifiers(v=>s.value=I.modelId,["prevent"]),["space"])]},[t.createElementVNode("span",CC,t.toDisplayString(I.name||t.unref(o).t("em.attr.nameless")),1),I.unique?(t.openBlock(),t.createElementBlock("span",SC,"UQ")):t.createCommentVNode("",!0),t.createElementVNode("span",xC,t.toDisplayString(I.columns.length),1)],42,vC))),128))],8,IC),a.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",RC,t.toDisplayString(t.unref(o).t("em.index.empty")),1))]),c.value?(t.openBlock(),t.createElementBlock("section",AC,[t.createElementVNode("div",$C,[t.createElementVNode("label",TC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.index.namePlaceholder")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"idxw-name",width:"100%","model-value":c.value.name,"onUpdate:modelValue":w[0]||(w[0]=I=>N(c.value.modelId,{name:I}))},null,8,["model-value"]),t.createVNode(vo,{controller:t.unref(o),"ref-id":c.value.modelId},null,8,["controller","ref-id"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:"idxw-uq",class:"em-check em-idxw__uq",label:"unique","model-value":c.value.unique,"onUpdate:modelValue":w[1]||(w[1]=I=>N(c.value.modelId,{unique:I}))},null,8,["model-value"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn em-idxw__del",caption:t.unref(o).t("em.index.delete"),onClick:w[2]||(w[2]=I=>E(c.value.modelId))},null,8,["caption"])]),t.createElementVNode("label",MC,[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:w[3]||(w[3]=I=>S(I.target.value))},null,40,VC)]),t.createElementVNode("div",BC,[t.createElementVNode("div",DC,[t.createElementVNode("div",OC,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,I=>(t.openBlock(),t.createElementBlock("li",{key:I.ref,class:t.normalizeClass(["em-idxw__col",{"is-sel":_.value.has(I.ref)}]),role:"button",tabindex:"0","aria-pressed":_.value.has(I.ref),onClick:v=>A(I.ref),onKeydown:[t.withKeys(t.withModifiers(v=>A(I.ref),["prevent"]),["enter"]),t.withKeys(t.withModifiers(v=>A(I.ref),["prevent"]),["space"])]},[t.createTextVNode(t.toDisplayString(I.label),1),I.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,zC)):t.createCommentVNode("",!0)],42,PC))),128))],8,LC),b.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",FC,t.toDisplayString(t.unref(o).t("em.index.allColumnsUsed")),1))]),t.createElementVNode("div",UC,[t.createVNode(t.unref(oe.BSButton),{caption:t.unref(o).t("em.index.addArrow"),disabled:!_.value.size,onClick:V},null,8,["caption","disabled"])]),t.createElementVNode("div",HC,[t.createElementVNode("div",jC,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,(I,v)=>(t.openBlock(),t.createElementBlock("li",{key:v,class:"em-idxw__col em-idxw__col--idx"},[t.createElementVNode("span",KC,[t.createTextVNode(t.toDisplayString(g(I.columnRef)),1),k(I.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,GC)):t.createCommentVNode("",!0)]),t.createVNode(t.unref(oe.BSCheckbox),{name:`idxw-desc-${v}`,class:"em-check",label:"DESC","model-value":I.descending,"onUpdate:modelValue":B=>O(v,B)},null,8,["name","model-value","onUpdate:modelValue"]),t.createElementVNode("span",YC,[t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn","data-move":"up",title:t.unref(o).t("em.index.moveUp"),disabled:v===0,onClick:B=>C(v,-1)},"↑",8,qC),t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn","data-move":"down",title:t.unref(o).t("em.index.moveDown"),disabled:v===c.value.columns.length-1,onClick:B=>C(v,1)},"↓",8,WC),t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn em-idxw__opbtn--del",title:t.unref(o).t("em.index.removeColumn"),onClick:B=>$(v)},"✕",8,JC)])]))),128)),c.value.columns.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("li",XC,t.toDisplayString(t.unref(o).t("em.index.noColumns")),1))],512)])])])):(t.openBlock(),t.createElementBlock("section",ZC,t.toDisplayString(t.unref(o).t("em.index.selectPrompt")),1))],8,EC)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-76dd7610"]]),eS={class:"em-op-src"},tS=["placeholder"],nS={class:"em-op-src__actions"},hp=Qe(t.defineComponent({__name:"OperationSourceEditor",props:{operationName:{},sourceCode:{},onSave:{type:Function},locale:{}},setup(e){const n=e,o=oe.useModalHandle(),i=(l,s)=>en(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(oe.BSModalFrame),{title:i("em.opSource.title",{name:n.operationName})},{default:t.withCtx(()=>[t.createElementVNode("div",eS,[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,tS),[[t.vModelText,a.value]]),t.createElementVNode("div",nS,[t.createVNode(t.unref(oe.BSButton),{caption:i("em.common.save"),onClick:r},null,8,["caption"]),t.createVNode(t.unref(oe.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"]]),oS=["disabled"],iS={class:"em-ow__toolbar"},aS={class:"em-ow__count"},rS={class:"em-ow__scroll"},lS={class:"em-ow__table"},sS={class:"c-name"},cS={class:"c-desc"},dS=["id"],uS={class:"c-pii"},mS={class:"c-src"},fS={class:"c-del"},pS={key:0},hS={colspan:"6",class:"em-ow__empty"},yS=Qe(t.defineComponent({__name:"EntityOperationsWide",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=oe.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)=>_.order-k.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,_){a.value&&o.updateOperation(a.value.modelId,b.modelId,_)}function p(b,_){m(b,{description:Object.keys(_).length?_:void 0})}function f(b){return b.personalInfoAttributeType??"none"}function h(b,_){m(b,{personalInfoAttributeType:_==="none"?void 0:_})}function g(b){i.openModal({component:hp,bind:{operationName:b.name,sourceCode:b.sourceCode??"",locale:o.uiLocale.value,onSave:_=>m(b,{sourceCode:_})}})}return(b,_)=>{var k,N;return a.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-ow",disabled:!t.unref(o).editable.value},[t.createElementVNode("div",iS,[t.createElementVNode("span",aS,t.toDisplayString(t.unref(o).t("em.op.section",{n:((k=a.value.operations)==null?void 0:k.length)??0})),1),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:_[0]||(_[0]=y=>t.unref(o).addOperation(a.value.modelId))},null,8,["caption"])]),t.createElementVNode("div",rS,[t.createElementVNode("table",lS,[t.createElementVNode("thead",null,[t.createElementVNode("tr",null,[t.createElementVNode("th",sS,t.toDisplayString(t.unref(o).t("em.attr.namePlaceholder")),1),_[2]||(_[2]=t.createElementVNode("th",{class:"c-vis"},"visibility",-1)),t.createElementVNode("th",cS,[t.createElementVNode("span",{id:`ow-desc-head-${a.value.modelId}`},t.toDisplayString(t.unref(o).t("em.common.description")),9,dS),t.createVNode(up,{modelValue:l.value,"onUpdate:modelValue":_[1]||(_[1]=y=>l.value=y),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",uS,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createElementVNode("th",mS,t.toDisplayString(t.unref(o).t("em.op.body")),1),_[3]||(_[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,y=>(t.openBlock(),t.createElementBlock("tr",{key:y.modelId},[t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSTextInput),{name:`ow-name-${y.modelId}`,width:"100%",placeholder:t.unref(o).t("em.op.namePlaceholder"),"model-value":y.name,"onUpdate:modelValue":E=>m(y,{name:E})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSSelect),{width:"100%","model-value":y.visibility??"PACKAGE",items:s,"value-provider":u,"label-provider":u,"onUpdate:modelValue":E=>E&&m(y,{visibility:E})},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(Qt,{name:`ow-desc-${y.modelId}`,languages:t.unref(o).languages.value,"active-lang":l.value,"model-value":y.description,"onUpdate:modelValue":E=>p(y,E)},null,8,["name","languages","active-lang","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSSelect),{width:"100%","model-value":f(y),items:c,"value-provider":u,"label-provider":d,"onUpdate:modelValue":E=>E&&h(y,E)},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t(y.sourceCode?"em.op.bodyDirty":"em.op.body"),onClick:E=>g(y)},null,8,["caption","onClick"])]),t.createElementVNode("td",fS,[t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:E=>t.unref(o).removeOperation(a.value.modelId,y.modelId)},null,8,["onClick"])])]))),128)),(N=a.value.operations)!=null&&N.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("tr",pS,[t.createElementVNode("td",hS,t.toDisplayString(t.unref(o).t("em.op.empty")),1)]))])])])],8,oS)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-743b04a6"]]),gS={class:"em-detail__tabs"},bS=["onClick"],_S={key:0,class:"em-detail__lock"},kS=["disabled"],ES={key:0,class:"em-detail__narrow"},NS=Qe(t.defineComponent({__name:"EntityDetailModal",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=oe.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(oe.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",gS,[(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:p=>s.value=m.key},t.toDisplayString(t.unref(o).t(m.labelKey)),11,bS)),64))]),a.value?(t.openBlock(),t.createElementBlock("div",_S,[t.createVNode(Ve,{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",ES,[t.createVNode(op,{controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])])):s.value==="columns"?(t.openBlock(),t.createBlock(_C,{key:1,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])):s.value==="indexes"?(t.openBlock(),t.createBlock(QC,{key:2,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])):(t.openBlock(),t.createBlock(yS,{key:3,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"]))],10,kS)],2)):t.createCommentVNode("",!0)]),_:1},8,["title"])}}}),[["__scopeId","data-v-328396cc"]]);function hr(e,n,o){e.openModal({component:NS,bind:{controller:t.markRaw(n),entityId:o}})}function xn(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=>jd(e,r))}function tn(e,n){if(!n.length)return[];const o=new Map;for(const{entityId:a,attributeId:r}of n){const l=o.get(a)??[];l.push(r),o.set(a,l)}const i=[];for(const[a,r]of o){const l=e.entities.find(s=>s.modelId===a);if(l)for(const s of Nu(l,r))i.push($a(a,s.indexRef,{columns:s.columns}))}return i}function yr(e,n,o,i){var c;const a=[];a.push(...xn(n,o.remove,i));for(const d of o.update)a.push(qt(n,d.attributeId,d.patch));for(const d of o.add)a.push(Yt(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 p=l.filter(f=>{var h;return((h=f.derivedFrom)==null?void 0:h.associationRef)===d.modelId&&f.dbAttrs.length>0}).sort((f,h)=>f.order-h.order)[0];p&&a.push(Wt(d.modelId,"end2",{attributeRef:p.modelId}))}return a}function ti(e,n,o){return{...e,entities:e.entities.map(i=>i.modelId===n?{...i,attributes:o(i.attributes)}:i)}}function Ui(e,n,o){const i=[];for(const[a,r]of cl(e,n,Pe))i.push(...yr(e,a,r,o));for(const a of wu(e,n,Pe))i.push(qt(a.entityId,a.attributeId,{dbAttrs:a.dbAttrs}));return i}function wS(e,n,o,i){const a=e.entities.find(l=>l.modelId===n);if(!a)return[];const r=Il([...a.attributes].sort((l,s)=>l.order-s.order),o,i).map(l=>l.modelId);return Iu(e,n,r).map(l=>qt(l.entityId,l.attributeId,{dbAttrs:l.dbAttrs}))}function yp(e,n,o){return vu(e,n,o).map(i=>qt(i.entityId,i.attributeId,{dbAttrs:i.dbAttrs}))}function IS(e,n,o){const i=new Set(o.remove);return ti(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 gr(e,n,o){const i=[];for(const{entityId:a,plan:r}of nd(e,n,Pe))i.push(...yr(e,a,r,o));return i}function gp(e,n,o=new Set){var r,l;if(!hn(n))return[];const i=[];for(const s of e.attributes){if(o.has(s.modelId))continue;const c={};s.dbAttrs.length>0&&(c.dbAttrs=[]),s.notNull&&(c.notNull=!1),Object.keys(c).length>0&&i.push(qt(e.modelId,s.modelId,c))}const a={};return(r=e.table)!=null&&r.physicalName&&(a.table=null),(l=e.indexes)!=null&&l.length&&(a.indexes=[]),e.schema&&(a.schema=null),e.jpaAttrs&&(a.jpaAttrs=null),Object.keys(a).length>0&&i.push(Vl(e.modelId,a)),i}function bp(e){return gn(e).map(n=>({...n.col,modelId:Pe()}))}function vS(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),p=new Set(o.attributes.map(h=>h.name));let f="id";for(let h=2;p.has(f);h++)f=`id${h}`;a={modelId:Pe(),name:f,type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:m,dbAttrs:[{modelId:Pe(),physicalName:f.toLowerCase(),dataType:"BIGINT"}]},i.push(Yt(n,a))}const r=[];for(const m of e.entities)for(const p of m.attributes){if(((u=p.embedded)==null?void 0:u.embeddableRef)!==n)continue;const f=e.associations.find(_=>_.modelId===p.embedded.associationRef);if(!f)continue;const h=f.end1.entityRef===m.modelId,g=h?f.end1:f.end2,b=h?f.end2:f.end1;r.push({ownerId:m.modelId,dispId:p.modelId,assocId:f.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 p=new Set(r.filter(f=>f.ownerId===m.modelId).map(f=>f.dispId));return p.size?{...m,attributes:m.attributes.filter(f=>!p.has(f.modelId))}:m}),associations:e.associations.map(m=>{const p=r.find(f=>f.assocId===m.modelId);return p?{...m,end1:p.end1,end2:p.end2}:m})},s=pi(l,n,Pe);for(const m of r){const p=s.add.find(f=>{var h;return((h=f.derivedFrom)==null?void 0:h.associationRef)===m.assocId});p&&(m.end2.attributeRef=p.modelId)}const c=[];for(const m of r)i.push(...xn(m.ownerId,[m.dispId],c)),i.push(Aa(m.assocId,{end1:m.end1,end2:m.end2}));i.push(...yr(l,n,s,c));const d=IS(l,n,s);return i.push(...Ui(d,n,c)),i.push(...tn(e,c)),i}function CS(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(N=>N.modelId===c);if(!d||d.attributes.some(N=>{var y;return((y=N.embedded)==null?void 0:y.associationRef)===r.modelId}))continue;const u=Pe(),m=jt(d.attributes),p=new Set(d.attributes.map(N=>N.name)),f=a(o.name);let h=f;for(let N=2;p.has(h);N++)h=`${f}${N}`;const g=o.attributes.filter(N=>!N.identifier&&!N.derivedFrom).flatMap(N=>N.dbAttrs).map(N=>({...N,modelId:Pe()})),b={modelId:u,name:h,type:o.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:m,dbAttrs:g,embedded:{associationRef:r.modelId,embeddableRef:n}};i.push(Yt(c,b));const _=l?"end2":"end1",k=l?"end1":"end2";i.push(Aa(r.modelId,{identifying:!1,[_]:{entityRef:c,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:Pe()},[k]:{entityRef:n,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:u}}))}return i}function _p(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=[zd(n,o),...i.map(u=>Uo(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 p=e.layout.associationLayouts.find(f=>f.associationRef===m.modelId);p&&p.waypoints.length&&c.push(nu(m.modelId,l,s))}for(const m of(a==null?void 0:a.memberNoteRefs)??[]){const p=e.layout.notes.find(f=>f.modelId===m);p&&c.push(Ei(m,{x:p.geo.location.x+l,y:p.geo.location.y+s}))}}return c}function SS(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=Pe(),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}},p={...n.logical,associations:[...n.logical.associations,m]},f=pi(p,s,Pe),h=f.add[0];h&&(m.end2.attributeRef=h.modelId);const g={associationRef:u,waypoints:[],sourceColumnRef:c,targetColumnRef:(h==null?void 0:h.modelId)??d},b=Ra(m,g),_=yr(p,s,f,[]);return i(_.length?at("관계 추가",[b,..._]):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=Pe(),m=Pe(),p=Pe(),f=jt(c.attributes),h=bp(d),g=S=>S&&S.charAt(0).toLowerCase()+S.slice(1),b=new Set(c.attributes.map(S=>S.name)),_=g(d.name);let k=_;for(let S=2;b.has(k);S++)k=`${_}${S}`;const N={modelId:m,name:k,type:d.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:f,dbAttrs:h,embedded:{associationRef:u,embeddableRef:s}},y={modelId:u,end1:{entityRef:l,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:p},end2:{entityRef:s,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:m}},E={associationRef:u,waypoints:[],sourceColumnRef:m,targetColumnRef:void 0};return i(at("임베드 추가",[Yt(l,N),Ra(y,E)])),u},setEmbedCardinality(l,s){var _;if(r(l))return;const c=n.logical.associations.find(k=>k.modelId===l);if(!c)return;let d,u;for(const k of n.logical.entities){const N=k.attributes.find(y=>{var E;return((E=y.embedded)==null?void 0:E.associationRef)===l&&y.attrType==="EMBED_OWN"});if(N){d=k.modelId,u=N;break}}if(!d||!u)return;const m=u.embedded.embeddableRef,p=c.end2.entityRef===m?"end2":"end1",f=c[p];if(f.multiplicity===s)return;const h=k=>k==="ZERO_OR_MORE_INSTANCES"||k==="ONE_OR_MORE_INSTANCES",g=h(f.multiplicity),b=h(s);if(g===b){i(Wt(l,p,{multiplicity:s}));return}if(b)i(at("임베드 컬렉션 전환",[qt(d,u.modelId,{dbAttrs:[]}),Wt(l,p,{multiplicity:s,jpa:{...f.jpa,collectionType:((_=f.jpa)==null?void 0:_.collectionType)??"LIST"}})]));else{const k=n.logical.entities.find(N=>N.modelId===m);if(!k)return;i(at("임베드 단일 전환",[qt(d,u.modelId,{dbAttrs:bp(k)}),Wt(l,p,{multiplicity:s,jpa:{...f.jpa,collectionType:void 0,collectionTable:void 0,orderColumn:void 0}})]))}},removeAssociation(l){if(r(l))return;const s=n.logical.associations.find(f=>f.modelId===l),c=Xd(l);if(!s){i(c);return}for(const f of n.logical.entities){const h=f.attributes.find(g=>{var b;return((b=g.embedded)==null?void 0:b.associationRef)===l});if(h){const g=[];i(at("임베드 삭제",[c,...xn(f.modelId,[h.modelId],g),...tn(n.logical,g)]));return}}const d=s.end2.entityRef,u={...n.logical,associations:n.logical.associations.filter(f=>f.modelId!==l)},m=[],p=gr(u,[d],m);if(s.end1.attributeRef){const f=n.logical.entities.find(g=>g.modelId===s.end1.entityRef),h=f==null?void 0:f.attributes.find(g=>g.modelId===s.end1.attributeRef&&g.attrType==="RELATION_REF");h&&p.push(...xn(f.modelId,[h.modelId],m))}p.push(...tn(n.logical,m)),i(p.length?at("관계 삭제",[c,...p]):c)},setAssociationIdentifying(l,s){if(r(l))return;const c=n.logical.associations.find(h=>h.modelId===l),d=Aa(l,{identifying:s});if(!c||c.identifying===s){i(d);return}const u=c.end2.entityRef,m={...n.logical,associations:n.logical.associations.map(h=>h.modelId===l?{...h,identifying:s}:h)},p=[],f=gr(m,[u],p);f.push(...tn(n.logical,p)),i(f.length?at("식별 관계 변경",[d,...f]):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=n.logical.entities.find(f=>f.modelId===d.end1.entityRef),m=n.logical.entities.find(f=>f.modelId===d.end2.entityRef),p=(u==null?void 0:u.stereotype)==="JPA_EMBEDDABLE"||(m==null?void 0:m.stereotype)==="JPA_EMBEDDABLE";if(u&&m&&!p){if(c.navigable===!0&&!d.end1.attributeRef){const f=sa(d.end2.multiplicity),h=d.end1.navFieldNameHint||da(m.name,f),g=eo(h,new Set(u.attributes.map(N=>N.name))),b=Pe(),_=jt(u.attributes),k={modelId:b,name:g,type:m.name,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:_,dbAttrs:[]};i(at("inverse nav 추가",[Yt(d.end1.entityRef,k),Wt(l,"end1",{...c,attributeRef:b,navFieldNameHint:void 0})]));return}if(c.navigable===!1&&d.end1.attributeRef){const f=d.end1.attributeRef,h=u.attributes.find(k=>k.modelId===f&&k.attrType==="RELATION_REF"),g=Wt(l,"end1",{...c,attributeRef:void 0,navFieldNameHint:(h==null?void 0:h.name)??d.end1.navFieldNameHint}),b=[],_=h?xn(d.end1.entityRef,[f],b):[];i(h?at("inverse nav 제거",[..._,g,...tn(n.logical,b)]):g);return}}}i(Wt(l,s,c))}}}function xS(e){const{state:n,editable:o,run:i,gateEntityLocked:a,embeddableCatalog:r,t:l,emitGateNotice:s,selection:c}=e,d=(u,m,p)=>{if(a(u))return;const f=qt(u,m,p),h=ti(n.logical,u,_=>_.map(k=>k.modelId===m?{...k,...p}:k)),g=[],b=Ui(h,u,g);b.push(...tn(n.logical,g)),i(b.length?at("속성 수정",[f,...b]):f)};return{addPredefinedEmbed(u,m){if(!o.value||a(u))return null;const p=r.value.find(k=>k.type===m),f=n.logical.entities.find(k=>k.modelId===u);if(!p||!f)return null;const h=jt(f.attributes),g=Pe(),b=p.fields.map(()=>({modelId:Pe(),physicalName:"",dataType:""})),_={modelId:g,name:p.defaultName,type:p.type,attrType:"EMBED_PREDEF",identifier:!1,notNull:!1,order:h,dbAttrs:b};return i(Yt(u,_)),g},addSerializedTypeAttribute(u,m){if(!o.value||a(u))return null;const p=n.logical.entities.find(_=>_.modelId===u),f=n.logical.entities.find(_=>_.modelId===m);if(!p||!f||!hn(f.stereotype)||!f.name)return null;const h=f.name.charAt(0).toLowerCase()+f.name.slice(1),g=eo(h,new Set(p.attributes.map(_=>_.name))),b=Pe();return i(Yt(u,{modelId:b,name:g,type:f.name,attrType:"NORMAL",identifier:!1,notNull:!1,order:jt(p.attributes),dbAttrs:[{modelId:Pe(),physicalName:g,dataType:"CLOB"}]})),b},addAttribute(u,m={}){if(!o.value||a(u))return null;const p=n.logical.entities.find(E=>E.modelId===u),f=p?jt(p.attributes):0,h=m.modelId??Pe(),g=m.name??`field${f}`,b={modelId:h,name:g,type:m.type??tl,attrType:m.attrType??"NORMAL",identifier:m.identifier??!1,notNull:m.notNull??!1,order:f,dbAttrs:m.dbAttrs??(p&&hn(p.stereotype)?[]:[{modelId:Pe(),physicalName:g,dataType:"VARCHAR"}]),...m},_=Yt(u,b),k=ti(n.logical,u,E=>[...E,b]),N=[],y=Ui(k,u,N);return y.push(...tn(n.logical,N)),i(y.length?at("속성 추가",[_,...y]):_),h},addDivider(u){if(!o.value||a(u))return null;const m=n.logical.entities.find(g=>g.modelId===u),p=m?jt(m.attributes):0,f=Pe();return i(Yt(u,{modelId:f,name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:p,dbAttrs:[]})),f},updateAttribute(u,m,p){d(u,m,p)},setAttributeGroupCode(u,m,p){d(u,m,{groupCode:p,type:p?to:tl})},setEmbedColumns(u,m,p){var k,N;if(a(u))return;const f=qt(u,m,{dbAttrs:p}),h=(k=n.logical.entities.find(y=>y.modelId===u))==null?void 0:k.attributes.find(y=>y.modelId===m),g=(N=h==null?void 0:h.embedded)==null?void 0:N.associationRef,b=g?n.logical.associations.find(y=>y.modelId===g):void 0,_=[];b&&g&&(b.end1.legacyEmbedRaw&&_.push(Wt(g,"end1",{legacyEmbedRaw:void 0})),b.end2.legacyEmbedRaw&&_.push(Wt(g,"end2",{legacyEmbedRaw:void 0}))),i(_.length?at("임베드 컬럼 수정",[f,..._]):f)},removeAttribute(u,m){if(a(u))return;if(Po(n.logical,u,m)){s(l("em.attr.fkDeleteHint"));return}const p=[],f=xn(u,[m],p),h=ti(n.logical,u,_=>_.filter(k=>k.modelId!==m)),g=[...Ui(h,u,p),...tn(n.logical,p),...yp(n.logical,u,[m])],b=[...f,...g];i(b.length===1?b[0]:at("속성 삭제",b))},removeAttributes(u,m){var k;if(!m.length||a(u))return;const p=m.filter(N=>!Po(n.logical,u,N));if(p.length<m.length&&s(l("em.attr.fkDeleteHint")),!p.length)return;const f=[],h=xn(u,p,f),g=new Set(p),b=ti(n.logical,u,N=>N.filter(y=>!g.has(y.modelId))),_=[...h,...Ui(b,u,f),...tn(n.logical,f),...yp(n.logical,u,p)];i(_.length===1?_[0]:at("속성 삭제",_)),((k=c.value)==null?void 0:k.kind)==="attribute"&&c.value.entityId===u&&(c.value=null)},setAttributeSwatch(u,m,p){i(Ca(u,m,p))},setAttributeSwatches(u,m,p){m.length&&(m.length===1?i(Ca(u,m[0],p)):i(at("속성 색상",m.map(f=>Ca(u,f,p)))))},reorderAttributes(u,m,p){if(!m.length||a(u))return;const f=Dl(u,m,p),h=wS(n.logical,u,m,p);i(h.length?at("속성 재정렬",[f,...h]):f)}}}function RS(e){var i;const n=JSON.parse(JSON.stringify(e));n.modelId=Pe(),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=Pe();o.set(a.modelId,r),a.modelId=r;for(const l of a.dbAttrs)l.modelId=Pe()}for(const a of n.indexes??[]){a.modelId=Pe();for(const r of a.columns)r.columnRef=o.get(r.columnRef)??r.columnRef}for(const a of n.operations??[]){const r=Pe();o.set(a.modelId,r),a.modelId=r}return{clone:n,idMap:o}}const AS=220;function $S(e,n){let i=-1/0;for(const r of e.entityLayouts)i=Math.max(i,r.geo.location.x+(r.geo.size.width||AS));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 Bs=(e,n)=>({x:e.x+n.x,y:e.y+n.y});function TS(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(_=>_.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(_=>_.modelId===d.entityId);if(!g)return;const b=[...g.attributes].sort((_,k)=>_.order-k.order).filter(_=>d.ids.includes(_.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),p=n.layout.entityLayouts.find(g=>g.entityRef===u);if(!m)return;const f=(p==null?void 0:p.geo)??{location:{x:80,y:80},size:{width:220,height:140}};let h;if(p){const{entityRef:g,geo:b,locked:_,...k}=p;Object.keys(k).length&&(h=k)}o.value=JSON.parse(JSON.stringify({kind:"entity",entity:m,geo:f,layoutExtras:h}))},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 f=a.value;if(!f)return[];const h=n.logical.entities.find(y=>y.modelId===f);if(!h)return[];const g=new Set(h.attributes.map(y=>y.name)),b=new Set(h.attributes.flatMap(y=>y.dbAttrs.map(E=>E.physicalName))),_=jt(h.attributes),k=[],N=c.attributes.map((y,E)=>{const S=JSON.parse(JSON.stringify(y));S.modelId=Pe();for(const A of S.dbAttrs)A.modelId=Pe();g.has(S.name)&&(S.name=eo(`${S.name}_copy`,g)),g.add(S.name);for(const A of S.dbAttrs)A.physicalName&&b.has(A.physicalName)&&(A.physicalName=eo(`${A.physicalName}_copy`,b)),A.physicalName&&b.add(A.physicalName);return S.order=_+E,k.push(S.modelId),Yt(f,S)});return l(N.length===1?N[0]:at("속성 붙여넣기",N)),i.value={kind:"attribute",entityId:f,ids:k,anchor:k[k.length-1]},[]}const{clone:d,idMap:u}=RS(c.entity),m={location:{x:c.geo.location.x+40,y:c.geo.location.y+40},size:{...c.geo.size}};let p;if(c.layoutExtras){const f={...c.layoutExtras},h=g=>u.get(g);f.attributeStyles&&(f.attributeStyles=Na(f.attributeStyles,h)),f.operationStyles&&(f.operationStyles=Na(f.operationStyles,h)),p=f}return l(va(d,m,p)),i.value={kind:"entity",id:d.modelId},[d.modelId]},importEntities(c,d,u){if(!r.value)return[];const m=wd(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 p=(u==null?void 0:u.placement)??"append-right",f=p==="append-right"?$S(n.layout,m.layout):p.offset,h=new Map(m.layout.entityLayouts.map(N=>[N.entityRef,N])),g=new Map(m.layout.associationLayouts.map(N=>[N.associationRef,N])),b=new Map(m.layout.groupLayouts.map(N=>[N.groupRef,N])),_=[];let k=80;for(const N of m.logical.entities){const y=h.get(N.modelId),E=y?{location:Bs(y.geo.location,f),size:{...y.geo.size}}:{location:{x:k+=40,y:80},size:{width:220,height:140}};let S;if(y){const{entityRef:A,geo:V,locked:$,...O}=y;S=O}_.push(va(N,E,S))}for(const N of m.logical.associations){const y=g.get(N.modelId),E=y?{...y,waypoints:y.waypoints.map(S=>Bs(S,f))}:{associationRef:N.modelId,waypoints:[]};_.push(Ra(N,E))}for(const N of m.logical.groups){const y=b.get(N.modelId),E=y?{location:Bs(y.geo.location,f),size:{...y.geo.size}}:{location:{x:80,y:80},size:{width:320,height:200}};let S;if(y){const{groupRef:A,geo:V,locked:$,memberNoteRefs:O,...C}=y;S=C}_.push(Sa(N,E,S))}return l(at("다이어그램 가져오기",_)),i.value={kind:"entity",id:m.logical.entities[0].modelId},m.logical.entities.map(N=>N.modelId)}};return s}function MS(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=Pe(),p={modelId:m,name:d,stereotype:"JPA_ENTITY",table:{physicalName:d.toLowerCase()},attributes:[{modelId:Pe(),name:"id",type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:0,dbAttrs:[{modelId:Pe(),physicalName:"id",dataType:"BIGINT"}]}]};return i(va(p,{location:{...u},size:{width:220,height:140}})),m},renameEntity(d,u){a(d)||i(Td(d,u))},updateEntity(d,u){if(a(d))return;const m=Vl(d,u),p=n.logical.entities.find(k=>k.modelId===d),f=p==null?void 0:p.stereotype,h=u.stereotype,g=!!h&&!!p&&!!f&&_t(h)&&!_t(f),b=!!h&&!!p&&!!f&&!_t(h)&&_t(f);if(!!h&&!!p&&!!f&&h!==f&&_t(h)&&_t(f)&&p){const k=n.logical.entities.filter(y=>y.attributes.some(E=>{var S;return((S=E.embedded)==null?void 0:S.embeddableRef)===d}));if(k.length>0){c(s("em.entity.valueTypeSwitchEmbedded",{name:p.name,owners:k.length}));return}const N=gp(p,h);i(N.length?at("직렬화 타입 변환",[m,...N]):m);return}if(h==="SERIALIZED_TYPE"&&p){const k=n.logical.associations.filter(N=>N.end1.entityRef===d||N.end2.entityRef===d);if(k.length>0){c(s("em.entity.serializedTypeHasRelations",{name:p.name,count:k.length}));return}}if(g&&p&&h){const k=p.attributes.filter($=>$.identifier&&!$.derivedFrom).map($=>qt(d,$.modelId,{identifier:!1})),N=ti({...n.logical,entities:n.logical.entities.map($=>$.modelId===d?{...$,stereotype:h}:$)},d,$=>$.map(O=>O.identifier&&!O.derivedFrom?{...O,identifier:!1}:O)),y=[],E=gr(N,[d],y);E.push(...tn(n.logical,y));const S=h==="JPA_EMBEDDABLE"?CS(n.logical,d):[],A=gp(p,h,new Set(y.filter($=>$.entityId===d).map($=>$.attributeId))),V=[m,...k,...E,...S,...A];i(V.length>1?at(h==="SERIALIZED_TYPE"?"직렬화 타입 변환":"임베더블 변환",V):m);return}if(b){const k=vS(n.logical,d),N=[m,...k];i(N.length>1?at("엔터티 전환",N):m);return}i(m)},moveEntity(d,u){a(d)||i(Uo(d,u))},resizeEntity(d,u){a(d)||i(Md(d,u))},removeEntity(d){if(a(d))return;const u=$d(d);if(!n.logical.entities.find(k=>k.modelId===d)){i(u);return}const p=n.logical.associations.filter(k=>k.end1.entityRef===d||k.end2.entityRef===d),f=new Set(p.map(k=>k.modelId)),h=[],g=[];for(const k of n.logical.entities)if(k.modelId!==d)for(const N of k.attributes)N.embedded&&f.has(N.embedded.associationRef)&&h.push(...xn(k.modelId,[N.modelId],g));for(const k of p){if(k.end1.entityRef===d||!k.end1.attributeRef)continue;const N=n.logical.entities.find(E=>E.modelId===k.end1.entityRef),y=N==null?void 0:N.attributes.find(E=>E.modelId===k.end1.attributeRef&&E.attrType==="RELATION_REF");y&&h.push(...xn(N.modelId,[y.modelId],g))}const b={...n.logical,entities:n.logical.entities.filter(k=>k.modelId!==d),associations:n.logical.associations.filter(k=>!f.has(k.modelId))},_=new Set(p.filter(k=>k.end1.entityRef===d&&k.end2.entityRef!==d).map(k=>k.end2.entityRef));h.push(...gr(b,[..._],g)),h.push(...tn(n.logical,g.filter(k=>k.entityId!==d))),i(h.length?at("엔티티 삭제",[u,...h]):u)},setEntitySwatch(d,u){i(Vd(d,u))},setEntityCollapsed(d,u){i(Bd(d,u))},setEntityLocked(d,u){i(Dd(d,u))},isEntityLocked(d){return r(d)},isAssociationLocked(d){return l(d)},collapseAll(){i(Bl(!0))},expandAll(){i(Bl(!1))}}}function VS(e){const{state:n,editable:o,run:i,selection:a,gateEntityLocked:r,gateGroupLocked:l,isGroupLockedFn:s}=e;function c(d){const u=d.map(_=>n.layout.entityLayouts.find(k=>k.entityRef===_)).filter(_=>!!_);if(!u.length)return{location:{x:40,y:40},size:{width:400,height:300}};let m=1/0,p=1/0,f=-1/0,h=-1/0;for(const _ of u){const k=_.geo.size.width||220,N=_.geo.size.height||140;m=Math.min(m,_.geo.location.x),p=Math.min(p,_.geo.location.y),f=Math.max(f,_.geo.location.x+k),h=Math.max(h,_.geo.location.y+N)}const g=40,b=28;return{location:{x:m-g,y:p-g-b},size:{width:f-m+g*2,height:h-p+g*2+b}}}return{dragGroup(d,u,m){l(d)||i(at("그룹 이동",_p(n,d,u,m)))},resizeGroup(d,u){l(d)||i(Fd(d,u))},setGroupSwatch(d,u){i(Ud(d,u))},setGroupLocked(d,u){i(Hd(d,u))},isGroupLocked(d){return s(d)},updateGroup(d,u){l(d)||i(Od(d,u))},createGroup(d,u){if(!o.value||!d.length)return null;const m=[];for(const h of n.logical.groups)for(const g of d)h.memberEntityRefs.includes(g)&&m.push(xa(h.modelId,g));const p=Pe(),f={modelId:p,name:u?{ko:u}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[...d]};return m.push(Sa(f,c(d))),i(at("그룹 생성",m)),a.value=null,p},addEmptyGroup(d,u){if(!o.value)return null;const m=Pe();return i(Sa({modelId:m,name:u?{ko:u}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[]},{location:{...d},size:{width:360,height:260}})),m},removeGroup(d){l(d)||i(Ld(d))},dropEntity(d,u,m){var h;if(r(d))return;const p=((h=n.logical.groups.find(g=>g.memberEntityRefs.includes(d)))==null?void 0:h.modelId)??null,f=[Uo(d,u)];p!==m&&(p&&f.push(xa(p,d)),m&&f.push(Pd(m,d))),i(at("이동",f))},ungroupEntity(d){const u=n.logical.groups.find(m=>m.memberEntityRefs.includes(d));u&&i(xa(u.modelId,d))},dropNote(d,u,m){var h;const p=((h=n.layout.groupLayouts.find(g=>{var b;return(b=g.memberNoteRefs)==null?void 0:b.includes(d)}))==null?void 0:h.groupRef)??null,f=[Ei(d,u)];p!==m&&(p&&f.push(uu(p,d)),m&&f.push(du(m,d))),i(at("이동",f))}}}function BS(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 _=new _u({diagramId:n.layout.diagramId,state:n,transport:e.opTransport,origin:"gui",onFreeze:k=>{i.value=!1,a.value=k},onError:e.onOpError});_.seed((b==null?void 0:b.revSeed)??{}),c=_.attach(g),s=_}const m=t.computed(()=>o.value&&r!==void 0),p=t.ref(0),f=t.computed(()=>o.value&&i.value&&l!==void 0);async function h(g){if(!l||!i.value)return{ok:!1,reason:"unavailable"};let b;try{b=await l(g)}catch(_){return{ok:!1,reason:_ instanceof Error?_.message:String(_)}}return b.ok&&p.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:f,restoreToSeq:h,reloadRequest:p}}function DS(e){const{editable:n,run:o}=e;return{addNote(i="메모",a={x:80,y:80}){if(!n.value)return null;const r=Pe();return o(au({modelId:r,memo:i,geo:{location:{...a},size:{width:200,height:120}}})),r},removeNote(i){o(ru(i))},moveNote(i,a){o(Ei(i,a))},resizeNote(i,a){o(lu(i,a))},setNoteMemo(i,a){o(su(i,a))},setNoteSwatch(i,a){o(cu(i,a))},addNoteConnection(i,a){o(mu(i,a))},removeNoteConnection(i,a){o(fu(i,a))},moveNoteConnectionWaypoint(i,a,r,l){o(pu(i,a,r,l))},addNoteConnectionWaypoint(i,a,r,l){o(hu(i,a,r,l))},removeNoteConnectionWaypoint(i,a,r){o(yu(i,a,r))},clearNoteConnectionWaypoints(i,a){o(gu(i,a))}}}function OS(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 p=o.value,f=(p==null?void 0:p.kind)==="attribute"&&p.entityId===d;if(m==="replace"||!f){o.value={kind:"attribute",entityId:d,ids:[u],anchor:u};return}if(m==="toggle"){const y=p.ids.includes(u),E=y?p.ids.filter(A=>A!==u):[...p.ids,u];if(!E.length){o.value=null;return}const S=y&&p.anchor===u?E[E.length-1]:y?p.anchor:u;o.value={kind:"attribute",entityId:d,ids:E,anchor:S};return}const h=n.logical.entities.find(y=>y.modelId===d),g=[...(h==null?void 0:h.attributes)??[]].sort((y,E)=>y.order-E.order).map(y=>y.modelId),b=g.indexOf(p.anchor),_=g.indexOf(u);if(b<0||_<0){o.value={kind:"attribute",entityId:d,ids:[u],anchor:u};return}const[k,N]=b<=_?[b,_]:[_,b];o.value={kind:"attribute",entityId:d,ids:g.slice(k,N+1),anchor:p.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 p=m.attributes.findIndex(g=>g.modelId===u.anchor);if(p<0)return!1;const f=Math.min(Math.max(p+d,0),m.attributes.length-1);if(f===p)return!0;const h=m.attributes[f].modelId;return o.value={kind:"attribute",entityId:u.entityId,ids:[h],anchor:h},!0},nudgeSelectedAttributes(d){const u=o.value;if((u==null?void 0:u.kind)!=="attribute")return!1;const m=n.logical.entities.find(y=>y.modelId===u.entityId);if(!m)return!1;const p=m.attributes,f=new Set(u.ids),h=p.map((y,E)=>f.has(y.modelId)?E:-1).filter(y=>y>=0);if(!h.length)return!1;const g=Math.min(...h),b=p.filter(y=>!f.has(y.modelId)),_=p.slice(0,g).filter(y=>!f.has(y.modelId)).length;let k;if(d<0){if(_<=0)return!0;k=_-1}else{if(b.length-_<=0)return!0;k=_+1}if(r(u.entityId))return!0;const N=p.filter(y=>f.has(y.modelId)).map(y=>y.modelId);return a(Dl(u.entityId,N,k)),!0},nudgeNodes(d,u,m){if(!d.length||u===0&&m===0)return!1;const p=new Set(n.logical.entities.map(k=>k.modelId)),f=new Set(n.logical.groups.map(k=>k.modelId)),h=new Set(n.layout.notes.map(k=>k.modelId)),g=new Set;for(const k of d){if(!f.has(k))continue;const N=n.logical.groups.find(y=>y.modelId===k);for(const y of(N==null?void 0:N.memberEntityRefs)??[])g.add(y)}const b=[],_=[];for(const k of d)if(f.has(k)){if(s(k))continue;const N=n.layout.groupLayouts.find(A=>A.groupRef===k);if(!N)continue;const y=n.logical.groups.find(A=>A.modelId===k),E=((y==null?void 0:y.memberEntityRefs)??[]).map(A=>{var $;const V=(($=n.layout.entityLayouts.find(O=>O.entityRef===A))==null?void 0:$.geo.location)??{x:0,y:0};return{id:A,location:{x:V.x+u,y:V.y+m}}}),S={x:N.geo.location.x+u,y:N.geo.location.y+m};b.push(at("그룹 이동",_p(n,k,S,E))),_.push("g:"+k)}else if(p.has(k)){if(g.has(k)||l(k))continue;const N=n.layout.entityLayouts.find(y=>y.entityRef===k);if(!N)continue;b.push(Uo(k,{x:N.geo.location.x+u,y:N.geo.location.y+m})),_.push("e:"+k)}else if(h.has(k)){const N=n.layout.notes.find(y=>y.modelId===k);if(!N)continue;b.push(Ei(k,{x:N.geo.location.x+u,y:N.geo.location.y+m})),_.push("n:"+k)}return b.length?(a(at("이동",b,"nudge:"+_.sort().join(","))),!0):!1},requestFocus(d){i.value={id:d,nonce:++c}}}}const Gn=Symbol("editorController");function kp(e="m1",n="d1"){return{logical:{modelId:e,entities:[],associations:[],groups:[]},layout:{diagramId:n,logicalModelRef:e,entityLayouts:[],associationLayouts:[],groupLayouts:[],notes:[]}}}function LS(e=kp(),n={}){var Se,Ge,et;const o=t.reactive(e);let i=new Ml(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.uiLocale??"ko"),m=(te,de)=>en(u.value,te,de),p=t.ref(n.reservedWords),f=t.ref(n.selectableDataTypes),h=t.ref(n.largeEntityThreshold),g=t.ref(n.flagEntitiesWithoutRelations??!1),b=t.ref(!1),_=t.ref(!1),k=t.ref(!1),N=t.ref(0),y=t.ref(null);let E=0;const S=te=>{if(n.onNotice){n.onNotice(te);return}y.value={text:te,id:++E}},A=t.ref(((Se=n.meta)==null?void 0:Se.schemaVersion)??1),V=t.ref(((Ge=n.meta)==null?void 0:Ge.opWriteEnabled)??!1),$=t.ref(((et=n.meta)==null?void 0:et.referenceOnly)??!1),O=t.computed(()=>A.value>=2&&V.value),C=t.ref(!(A.value>=2&&V.value===!1)),R=t.ref("LOGICAL_PHYSICAL"),T=t.ref("straight"),w=t.ref(!0),I=t.ref(!0),v=t.ref(null),B=t.computed(()=>{var te;return((te=v.value)==null?void 0:te.kind)==="attribute"?{entityId:v.value.entityId,attrId:v.value.anchor}:null}),M=t.computed(()=>{var te;return((te=v.value)==null?void 0:te.kind)==="attribute"?v.value.ids:[]}),x=t.computed(()=>{var te,de;return((te=v.value)==null?void 0:te.kind)==="entity"?v.value.id:((de=v.value)==null?void 0:de.kind)==="attribute"?v.value.entityId:null}),P=t.ref(null),Y=t.ref(null),se=t.ref(null),he=t.ref(null),ie=BS({state:o,opMode:O,editable:C,opConflict:se,opTransport:n.opTransport,onOpError:n.onOpError,historyTransport:n.historyTransport,restoreTransport:n.restoreTransport});function fe(){i.onChange(()=>{b.value=i.canUndo,_.value=i.canRedo,k.value=i.isDirty,N.value++})}fe(),ie.setupOpAdapter(i,n.meta);const pe=t.computed(()=>fc(o.logical,o.layout)),ge=t.computed(()=>({reservedWords:p.value,selectableDataTypes:f.value,largeEntityThreshold:h.value,flagEntitiesWithoutRelations:g.value,embeddableCatalog:a.value,superClassCatalog:s.value})),Te=()=>Wr(o.logical,$.value),He=n.validationDebounceMs??250;let De,Z=()=>{};if(He>0){const te=t.shallowRef(ga(Te(),ge.value));let de;Z=()=>{de!==void 0&&(clearTimeout(de),de=void 0),te.value=ga(Te(),ge.value)},t.watch([N,ge,$],()=>{de!==void 0&&clearTimeout(de),de=setTimeout(Z,He)},{flush:"sync"}),De=t.computed(()=>te.value)}else De=t.computed(()=>ga(Te(),ge.value));const re=t.computed(()=>{const te=new Map;for(const de of De.value){if(!de.targetRef)continue;const Le=te.get(de.targetRef);Le?Le.push(de):te.set(de.targetRef,[de])}return te}),ue=1500,z=new Map,L=te=>{const de=Date.now();de-(z.get(te)??0)<ue||(z.set(te,de),S(te))},F=te=>{if(!he.value){if(!C.value){L(m("em.notice.readOnly"));return}try{i.execute(te)}catch(de){console.error(`[command] 적용 실패 — 로컬 상태가 부분 변형됐을 수 있다 (${te.label}):`,de),C.value=!1,he.value={label:te.label}}}},X=te=>o.layout.entityLayouts.some(de=>de.entityRef===te&&!!de.locked),ee=te=>o.layout.groupLayouts.some(de=>de.groupRef===te&&!!de.locked),ke=te=>{const de=o.logical.associations.find(Le=>Le.modelId===te);return!!de&&(X(de.end1.entityRef)||X(de.end2.entityRef))},ye=te=>X(te)?(L(m("em.notice.entityLocked")),!0):!1,Ne=te=>ee(te)?(L(m("em.notice.groupLocked")),!0):!1,we=te=>ke(te)?(L(m("em.notice.assocLocked")),!0):!1,G=TS({state:o,clipboard:Y,selection:v,inspectedEntityId:x,editable:C,run:F}),q=OS({state:o,selection:v,focusRequest:P,run:F,gateEntityLocked:ye,isEntityLockedFn:X,isGroupLockedFn:ee}),W=MS({state:o,editable:C,run:F,gateEntityLocked:ye,isEntityLockedFn:X,isAssocLockedFn:ke,t:m,emitGateNotice:L}),Ce=xS({state:o,editable:C,run:F,gateEntityLocked:ye,embeddableCatalog:a,t:m,emitGateNotice:L,selection:v}),$e=VS({state:o,editable:C,run:F,selection:v,gateEntityLocked:ye,gateGroupLocked:Ne,isGroupLockedFn:ee}),ze=DS({editable:C,run:F}),Fe=SS({state:o,editable:C,run:F,gateEntityLocked:ye,gateAssocLocked:we});return{state:o,resolved:pe,issues:De,issuesByRef:re,flagEntitiesWithoutRelations:g,canUndo:b,canRedo:_,dirty:k,revision:N,notice:y,editable:C,schemaVersion:A,opWriteEnabled:V,opMode:O,opConflict:se,commandFailure:he,historyTransport:ie.historyTransport,historyAvailable:ie.historyAvailable,restoreTransport:ie.restoreTransport,restoreAvailable:ie.restoreAvailable,restoreToSeq:ie.restoreToSeq,reloadRequest:ie.reloadRequest,displayMode:R,routingMode:T,showGrid:w,showMinimap:I,selection:v,selectedAttr:B,selectedAttrIds:M,inspectedEntityId:x,focusRequest:P,clipboard:Y,embeddableCatalog:a,groupCodeCatalog:r,predefinedCustomTypeCatalog:l,superClassCatalog:s,languages:c,userLanguage:d,referenceOnlyDocument:$,uiLocale:u,t:m,selectableDataTypes:f,setEditable(te){C.value=te&&O.value},setEmbeddableCatalog(te){a.value=te},setGroupCodeCatalog(te){r.value=te},setPredefinedCustomTypeCatalog(te){l.value=te},setSuperClassCatalog(te){s.value=te},selectAttribute:q.selectAttribute,moveAttributeFocus:q.moveAttributeFocus,nudgeSelectedAttributes:q.nudgeSelectedAttributes,nudgeNodes:q.nudgeNodes,requestFocus:q.requestFocus,deleteSelection(){if(!C.value)return!1;const te=v.value;if(!te)return!1;if(te.kind==="attribute"){if(ye(te.entityId))return!1;const de=te.ids;if(!de.length)return!1;de.length===1?Ce.removeAttribute(te.entityId,de[0]):Ce.removeAttributes(te.entityId,de)}else if(te.kind==="entity"){if(ye(te.id))return!1;W.removeEntity(te.id)}else if(te.kind==="note")ze.removeNote(te.id);else if(te.kind==="group"){if(Ne(te.id))return!1;$e.removeGroup(te.id)}else Fe.removeAssociation(te.id);return v.value=null,!0},undo:()=>{C.value&&i.undo()},redo:()=>{C.value&&i.redo()},markSaved:()=>{C.value&&(ie.flush(),i.markSavePoint())},loadDiagram(te,de){ie.teardownOpAdapter(),o.logical=te.logical,o.layout=te.layout,i=new Ml(o),fe(),A.value=(de==null?void 0:de.schemaVersion)??1,V.value=(de==null?void 0:de.opWriteEnabled)??!1,$.value=(de==null?void 0:de.referenceOnly)??!1,C.value=!(A.value>=2&&V.value===!1),se.value=null,he.value=null,v.value=null,b.value=i.canUndo,_.value=i.canRedo,k.value=i.isDirty,ie.setupOpAdapter(i,de),Z()},flush:ie.flush,whenOpsSettled:ie.whenOpsSettled,addEntity:W.addEntity,renameEntity:W.renameEntity,updateEntity:W.updateEntity,moveEntity:W.moveEntity,resizeEntity:W.resizeEntity,removeEntity:W.removeEntity,setEntitySwatch:W.setEntitySwatch,setEntityCollapsed:W.setEntityCollapsed,setEntityLocked:W.setEntityLocked,isEntityLocked:W.isEntityLocked,isAssociationLocked:W.isAssociationLocked,collapseAll:W.collapseAll,expandAll:W.expandAll,setAttributeSwatch:Ce.setAttributeSwatch,dragGroup:$e.dragGroup,resizeGroup:$e.resizeGroup,setGroupSwatch:$e.setGroupSwatch,setGroupLocked:$e.setGroupLocked,isGroupLocked:$e.isGroupLocked,updateGroup:$e.updateGroup,createGroup:$e.createGroup,addEmptyGroup:$e.addEmptyGroup,removeGroup:$e.removeGroup,dropEntity:$e.dropEntity,ungroupEntity:$e.ungroupEntity,dropNote:$e.dropNote,addPredefinedEmbed:Ce.addPredefinedEmbed,addSerializedTypeAttribute:Ce.addSerializedTypeAttribute,addAttribute:Ce.addAttribute,addDivider:Ce.addDivider,updateAttribute:Ce.updateAttribute,setAttributeGroupCode:Ce.setAttributeGroupCode,setEmbedColumns:Ce.setEmbedColumns,removeAttribute:Ce.removeAttribute,removeAttributes:Ce.removeAttributes,setAttributeSwatches:Ce.setAttributeSwatches,reorderAttributes:Ce.reorderAttributes,addIndex(te,de){ye(te)||F(Zd(te,de))},updateIndex(te,de,Le){ye(te)||F($a(te,de,Le))},removeIndex(te,de){ye(te)||F(Qd(te,de))},addOperation(te,de={}){if(!C.value||ye(te))return null;const Le=o.logical.entities.find(st=>st.modelId===te),dt=Le!=null&&Le.operations?jt(Le.operations):0,Xe=de.modelId??Pe(),yt={modelId:Xe,name:de.name??`method${dt}`,visibility:de.visibility??"PACKAGE",order:dt,...de};return F(Gd(te,yt)),Xe},updateOperation(te,de,Le){ye(te)||F(Yd(te,de,Le))},removeOperation(te,de){ye(te)||F(qd(te,de))},reorderOperations(te,de,Le){!de.length||ye(te)||F(Wd(te,de,Le))},setOperationSwatch(te,de,Le){F(Jd(te,de,Le))},addAssociation:Fe.addAssociation,addEmbedAssociation:Fe.addEmbedAssociation,setEmbedCardinality:Fe.setEmbedCardinality,removeAssociation:Fe.removeAssociation,setAssociationIdentifying:Fe.setAssociationIdentifying,updateAssociationEnd:Fe.updateAssociationEnd,hasQuickFix(te){if(!C.value)return!1;const de=fl(te,o.logical);return de?de.kind==="setEndCascades"?!ke(de.assocRef):!X(de.entityRef):!1},applyQuickFix(te){if(!C.value)return!1;const de=fl(te,o.logical);if(!de)return!1;if(de.kind==="setIndexColumns")return ye(de.entityRef)?!1:(F($a(de.entityRef,de.indexRef,{columns:de.columns})),!0);if(we(de.assocRef))return!1;const Le=o.logical.associations.find(dt=>dt.modelId===de.assocRef);return Le?(F(Wt(de.assocRef,de.which,{jpa:{...Le[de.which].jpa,cascadeTypes:de.cascades}})),!0):!1},moveWaypoint(te,de,Le){F(eu(te,de,Le))},addWaypoint(te,de,Le){F(iu(te,de,Le))},removeWaypoint(te,de){F(tu(te,de))},clearWaypoints(te){F(ou(te))},addNote:ze.addNote,removeNote:ze.removeNote,moveNote:ze.moveNote,resizeNote:ze.resizeNote,setNoteMemo:ze.setNoteMemo,setNoteSwatch:ze.setNoteSwatch,addNoteConnection:ze.addNoteConnection,removeNoteConnection:ze.removeNoteConnection,moveNoteConnectionWaypoint:ze.moveNoteConnectionWaypoint,addNoteConnectionWaypoint:ze.addNoteConnectionWaypoint,removeNoteConnectionWaypoint:ze.removeNoteConnectionWaypoint,clearNoteConnectionWaypoints:ze.clearNoteConnectionWaypoints,autoLayout(){const te=pc(o.logical,o.layout);te.length&&F(at("자동 배치",te.map(de=>Uo(de.id,de.location))))},copy:G.copy,paste:G.paste,importEntities:G.importEntities}}const br=Symbol("groupHover"),Ep=Symbol("groupDrag"),Co=Symbol("relationHighlight"),Np=Symbol("diffOverlay"),wp=Symbol("nodeInternals"),Ip=Symbol("columnResolution");function PS(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 vp(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let o=0;o<e.length;o++)if(!PS(e[o],n[o]))return!1;return!0}function Cp(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(!vp(e.dbAttrs,n.dbAttrs))return!1}else if(i[r]!==a[r])return!1;return!0}function zS(e,n){if(e.size!==n.size)return!1;for(const o of e)if(!n.has(o))return!1;return!0}function FS(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||!zS(i,a))return!1}for(const[o,i]of e.effectiveAttrs){const a=n.effectiveAttrs.get(o);if(!a||!Cp(i,a))return!1}for(const[o,i]of e.embedCols){const a=n.embedCols.get(o);if(!a||!vp(i,a))return!1}for(const[o,i]of e.collectionTypes)if(n.collectionTypes.get(o)!==i)return!1;return!!US(e.classRows,n.classRows)}function US(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&&!Cp(i.attr,a.attr))return!1}return!0}function HS(){let e;return(n,o)=>e=jS(n,o,e)}function jS(e,n,o){const i=e.entities,a=new Map;let r=null;const l=()=>r??(r=new Map(i.map(s=>[s.modelId,s])));for(const s of i){const c=new Map,d=new Map,u=new Map;let m=null;const p=()=>m??(m=To(Dn(s,i)));for(const k of s.attributes){if(ia(k)){const S=k.dbAttrs[0];if(!(S!=null&&S.physicalName&&(S!=null&&S.dataType))){const A=Zn(k,s,i,e.associations);A&&c.set(k.modelId,{...k,dbAttrs:[{...S,physicalName:(S==null?void 0:S.physicalName)||A.physicalName,dataType:(S==null?void 0:S.dataType)||A.dataType,length:(S==null?void 0:S.length)??A.length,scale:(S==null?void 0:S.scale)??A.scale},...k.dbAttrs.slice(1)]})}}if(k.identifier&&k.attrType==="RELATION_OWN"){const S=Po(e,s.modelId,k.modelId);if(S&&ka(k,S)){const A=c.get(k.modelId)??k,V=k.derivedIdFieldName||gl({...k,derivedIdFieldName:void 0},S,l());V&&c.set(k.modelId,{...A,derivedIdFieldName:V})}}const N=ua(k,e.associations);if(N&&u.set(k.modelId,N),yn(k)){d.set(k.modelId,k.dbAttrs.map((S,A)=>{const V=Zn(k,s,i,e.associations,A);return V?{...S,physicalName:S.physicalName||V.physicalName,dataType:S.dataType||V.dataType,length:S.length??V.length,scale:S.scale??V.scale}:S}));continue}if(!k.attrType.startsWith("EMBED")||k.dbAttrs.length===0)continue;if(k.attrType!=="EMBED_PREDEF"){const S=p();d.set(k.modelId,k.dbAttrs.map((A,V)=>{const $=Qn(A,S);return $?{...A,physicalName:$.physicalName}:bn(k,A,V,s,e)}));continue}const y=n==null?void 0:n.find(S=>S.type===k.type);if(!y)continue;const E=p();d.set(k.modelId,k.dbAttrs.map((S,A)=>{const V=y.fields[A],$=Qn(S,E);return $?{...S,physicalName:$.physicalName,logicalName:S.logicalName??(V==null?void 0:V.logicalName),dataType:S.dataType||(V==null?void 0:V.dataType)||""}:V?{...S,physicalName:S.physicalName||V.physicalName,logicalName:S.logicalName??V.logicalName,dataType:S.dataType||V.dataType,length:S.length??V.length}:S}))}const f=new Map,h=new Map;for(const k of s.attributes){const N=d.get(k.modelId);if(N)for(let y=0;y<N.length;y++){const E=`${k.attrType}\0${k.type??""}\0${y}`,S={attrId:k.modelId,slot:y,name:N[y].physicalName??""},A=h.get(E);A?A.push(S):h.set(E,[S])}}for(const k of h.values()){if(k.length<2)continue;const N=new Map;for(const y of k)N.set(y.name,(N.get(y.name)??0)+1);for(const y of k){if((N.get(y.name)??0)<2)continue;const E=f.get(y.attrId);E?E.add(y.slot):f.set(y.attrId,new Set([y.slot]))}}const g=bl(s,e).fields.map(k=>{var N;return{attr:k.attr,synthetic:k.synthetic,sourceAttrId:k.sourceAttr.modelId,targetName:(N=k.target)==null?void 0:N.name,collection:k.collection}}),b={effectiveAttrs:c,embedCols:d,collectionTypes:u,redundantSlots:f,classRows:g},_=o==null?void 0:o.get(s.modelId);a.set(s.modelId,_&&FS(b,_)?_:b)}return a}const Sp=Symbol("embedSlotCollapse"),xp=(e,n)=>`${e}:${n}`,Rp="all:",Ap="one:",$p="fk:",Tp=e=>`${Rp}${e}`,KS=(e,n)=>`${Ap}${e}:${n}`,GS=(e,n)=>`${$p}${e}:${n}`,YS=e=>e.startsWith($p)||!e.startsWith(Rp)&&!e.startsWith(Ap),qS=["title"],WS={key:0,class:"em-sel","aria-hidden":"true"},JS=["title","aria-expanded","disabled"],XS={class:"em-entity__stereotype"},ZS={key:1,class:"em-entity__name"},QS=["title","aria-expanded"],ex={"aria-hidden":"true"},tx=["data-attr","title","onClick","onPointerdown","onPointermove","onPointerup","onPointercancel"],nx=["onPointerdown"],ox={key:1,class:"em-entity__divider-label"},ix=["title"],ax={class:"em-key-slot"},rx={class:"em-key-slot"},lx=["title","aria-expanded","onClick"],sx=["title","onClick"],cx=["title","aria-expanded","onClick"],dx={key:2,class:"em-entity__type"},ux=["onClick"],mx={class:"em-entity__attrname"},fx={class:"em-entity__type"},px={key:1,class:"em-entity__embed-summary"},hx=["title"],yx=["data-op"],gx=["onPointerdown"],bx={class:"em-entity__op-vis","aria-hidden":"true"},_x=["title"],kx={key:4,class:"em-entity__footer"},Mp=Qe(t.defineComponent({__name:"EntityNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const n=e,o=t.inject(Gn,null),i=(j,K)=>o?o.t(j,K):en("ko",j,K),a=t.computed(()=>(o==null?void 0:o.userLanguage.value)??"ko"),r=oe.useModal();function l(){o&&hr(r,o,n.id)}const s=t.inject(br,null),c=t.inject(Co,null),d=t.inject(Np,null),u=t.computed(()=>{var j;return((j=d==null?void 0:d.marks.value)==null?void 0:j.get(n.id))??null}),m=t.inject(Ip,null),p=t.computed(()=>m==null?void 0:m.value.get(n.id)),f=t.inject(Sp,void 0),h=t.inject(wp,null);t.onUpdated(()=>h==null?void 0:h.mark(n.id));const g=t.computed(()=>!!o&&o.editable.value);function b(){s&&(s.value=n.data.groupRef??null)}function _(){c==null||c.setEntityHover(n.id)}function k(){c==null||c.setEntityHover(null)}const N=t.computed(()=>!!c&&c.primaryEntityIds.value.has(n.id)),y=t.computed(()=>!!c&&c.relatedEntityIds.value.has(n.id)&&!N.value),E=t.computed(()=>{var j;return((j=o==null?void 0:o.selection.value)==null?void 0:j.kind)==="entity"&&o.selection.value.id===n.id}),S=t.computed(()=>!!n.selected&&!E.value),A=t.computed(()=>{var j;return o&&((j=o.selectedAttr.value)==null?void 0:j.entityId)===n.id?new Set(o.selectedAttrIds.value):new Set}),V=t.computed(()=>A.value.size>0);function $(j,K){const ve=K.shiftKey?"range":K.metaKey||K.ctrlKey?"toggle":"replace";o==null||o.selectAttribute(n.id,B(j),ve)}const O=t.computed(()=>!!c&&c.active.value&&!c.relatedEntityIds.value.has(n.id)&&!E.value),C=t.computed(()=>n.data.entity),R=t.computed(()=>_y(C.value,o==null?void 0:o.referenceOnlyDocument.value)),T=t.computed(()=>n.data.displayMode??"LOGICAL_PHYSICAL"),w=t.computed(()=>{var j;if(T.value==="CLASS"){const K=(j=p.value)==null?void 0:j.classRows;if(K)return K.map(ve=>ve.attr)}return[...C.value.attributes].sort((K,ve)=>K.order-ve.order)}),I=t.computed(()=>{var K;const j=T.value==="CLASS"?(K=p.value)==null?void 0:K.classRows:void 0;return new Set((j??[]).filter(ve=>ve.synthetic).map(ve=>ve.attr.modelId))});function v(j){return I.value.has(j.modelId)}function B(j){return P.value.get(j.modelId)??j.modelId}function M(j){return A.value.has(B(j))}function x(j){var K;return!!((K=u.value)!=null&&K.changedAttributeIds.has(B(j)))}const P=t.computed(()=>{var K;const j=new Map;if(T.value!=="CLASS")return j;for(const ve of((K=p.value)==null?void 0:K.classRows)??[])ve.synthetic&&j.set(ve.attr.modelId,ve.sourceAttrId);return j}),Y=t.computed(()=>{var ve;const j=new Map,K=T.value==="CLASS";for(const Re of((ve=p.value)==null?void 0:ve.classRows)??[])!K&&!yn(Re.attr)||(Re.targetName||Re.collection)&&j.set(Re.attr.modelId,{targetName:Re.targetName,collection:Re.collection});return j}),se=t.computed(()=>n.data.collapsed??!1),he=t.computed(()=>n.data.locked??!1),ie=t.computed(()=>g.value&&!he.value);function fe(){g.value&&(o==null||o.setEntityCollapsed(n.id,!se.value))}const pe=t.computed(()=>T.value==="PHYSICAL"||T.value==="LOGICAL_PHYSICAL"),ge=t.computed(()=>{var ve;const j=T.value==="PHYSICAL"||T.value==="LOGICAL_PHYSICAL",K={};for(const Re of w.value){const me=Re.attrType.startsWith("RELATION")&&Re.dbAttrs.length>0,Ue=hn(((ve=C.value)==null?void 0:ve.stereotype)??"UNDEFINED");K[Re.modelId]={pk:Re.identifier,fk:me&&j,required:!Ue&&Re.notNull&&!Re.identifier}}return K});function Te(j){if(!j)return"";const K=[];return j.pk&&j.fk?K.push(i("em.node.keyPfk")):j.pk?K.push(i("em.node.keyPk")):j.fk&&K.push(i("em.node.keyFk")),j.required&&K.push(i("em.node.required")),K.join(" · ")}const He=t.computed(()=>{const j=As($t(n.data.style)),K={};return j&&(K["--em-header-bg"]=j.bar,K["--em-header-fg"]=j.barOn),K});function De(j){var K,ve;return(ve=As($t((K=n.data.attributeStyles)==null?void 0:K[j.modelId])))==null?void 0:ve.text}const Z=t.computed(()=>[...C.value.operations??[]].sort((j,K)=>j.order-K.order)),re=t.computed(()=>T.value==="CLASS"&&Z.value.length>0),ue={PUBLIC:"+",PRIVATE:"-",PROTECTED:"#",PACKAGE:"~"};function z(j){return j?ue[j]:"~"}function L(j){var K,ve;return(ve=As($t((K=n.data.operationStyles)==null?void 0:K[j.modelId])))==null?void 0:ve.text}function F(j,K,ve){switch(T.value){case"CLASS":return[{text:j}];case"PHYSICAL":return[{text:ve||j}];case"LOGICAL":return[K?{text:K}:{text:i("em.node.logicalMissing"),missing:!0}];default:{const Re=K?{text:K}:{text:i("em.node.logicalMissing"),missing:!0};return ve?[Re,{text:` · ${ve}`}]:[Re]}}}function X(j){var K;return((K=p.value)==null?void 0:K.effectiveAttrs.get(j.modelId))??j}function ee(j){var ve,Re,me;if(we(j))return[{text:j.name}];const K=X(j);return F(ke(j),(Re=(ve=K.dbAttrs[0])==null?void 0:ve.logicalName)==null?void 0:Re[a.value],((me=K.dbAttrs[0])==null?void 0:me.physicalName)??"")}function ke(j){return T.value==="CLASS"?j.name:X(j).derivedIdFieldName||j.name}function ye(j){return j.attrType.startsWith("EMBED")&&j.dbAttrs.length>0}const Ne=yn;function we(j){return ye(j)||Ne(j)}function G(j){return Ne(j)?GS(n.id,j.modelId):KS(n.id,j.modelId)}function q(j){return j.attrType==="DIVIDER"}function W(j){var K;return((K=p.value)==null?void 0:K.embedCols.get(j.modelId))??j.dbAttrs}function Ce(j){var K;return(K=p.value)==null?void 0:K.redundantSlots.get(j.modelId)}const $e=t.computed(()=>(f==null?void 0:f.isCollapsed(Tp(n.id)))??!1),ze=t.computed(()=>$e.value&&pe.value?w.value.reduce((j,K)=>we(K)?j+W(K).length:j,0):0),Fe=t.computed(()=>w.value.some(j=>we(j)));function ae(j){const K=Ce(j);return!K||K.size===0?!1:f?f.isCollapsed(xp(n.id,j.modelId)):!1}function Se(j){var K;return ae(j)?((K=Ce(j))==null?void 0:K.size)??0:0}function Ge(j){return f?f.isCollapsed(G(j)):!1}function et(j){var K;return!pe.value||$e.value?null:Ge(j)?"attr":(((K=Ce(j))==null?void 0:K.size)??0)>0?"slot":null}function te(j){return!$e.value&&we(j)}function de(j){return Ge(j)?W(j).length:0}function Le(j){if($e.value||Ge(j))return[];const K=W(j);if(!ae(j))return K;const ve=Ce(j);return K.filter((Re,me)=>!ve.has(me))}function dt(j){f==null||f.toggle(xp(n.id,j.modelId))}function Xe(j){f==null||f.toggle(G(j))}function yt(){f==null||f.toggle(Tp(n.id))}function st(j){var K;return F(j.physicalName,(K=j.logicalName)==null?void 0:K[a.value],j.physicalName)}function ft(j){var Ue;const K=Y.value.get(j.modelId),ve=(K==null?void 0:K.collection)??((Ue=p.value)==null?void 0:Ue.collectionTypes.get(j.modelId)),Re=o?ui(j,Vo(o.state.logical),C.value,o.state.logical):void 0,me=(Re==null?void 0:Re.kind)==="resolved"?Re.entity:void 0;return nl(T.value,X(j),ve,K==null?void 0:K.targetName,me)}const nt=t.computed(()=>{const j={};for(const K of w.value)j[K.modelId]=ft(K);return j}),J=t.computed(()=>{var j,K,ve;return F(C.value.name,(K=(j=C.value.table)==null?void 0:j.logicalName)==null?void 0:K[a.value],((ve=C.value.table)==null?void 0:ve.physicalName)??"")}),ce=t.ref(!1),Ae=t.ref(""),Ee=t.ref(null);async function H(){var j,K;ie.value&&(Ae.value=C.value.name,ce.value=!0,await t.nextTick(),(j=Ee.value)==null||j.focus(),(K=Ee.value)==null||K.select())}function It(){if(!ce.value)return;ce.value=!1;const j=Ae.value.trim();j&&j!==C.value.name&&(o==null||o.renameEntity(n.id,j))}function Rt(){o==null||o.addAttribute(n.id)}function ot(){o==null||o.addDivider(n.id)}const{screenToFlowCoordinate:We,findNode:Ze}=tt(),Q=t.ref(null),Mt=t.computed(()=>{const j=Q.value??n.data.size;return j?{width:`${j.width}px`,minHeight:`${j.height}px`}:void 0});let Vt=null;function Mn(j){var Re,me,Ue;if(!ie.value)return;j.stopPropagation();const K=(Re=Ze(n.id))==null?void 0:Re.dimensions,ve=We({x:j.clientX,y:j.clientY});Vt={fx:ve.x,fy:ve.y,w:(K==null?void 0:K.width)??((me=n.data.size)==null?void 0:me.width)??200,h:(K==null?void 0:K.height)??((Ue=n.data.size)==null?void 0:Ue.height)??120},j.target.setPointerCapture(j.pointerId)}function an(j){if(!Vt)return;const K=We({x:j.clientX,y:j.clientY});Q.value={width:Math.max(40,Vt.w+(K.x-Vt.fx)),height:Math.max(40,Vt.h+(K.y-Vt.fy))}}function be(j){var K,ve,Re;if(Vt&&Q.value&&o){const me=(K=Ze(n.id))==null?void 0:K.dimensions;o.resizeEntity(n.id,{width:Math.round((me==null?void 0:me.width)??Q.value.width),height:Math.round((me==null?void 0:me.height)??Q.value.height)})}Vt=null,Q.value=null,(Re=(ve=j.target).releasePointerCapture)==null||Re.call(ve,j.pointerId)}const mt=t.ref(null),vt=t.ref(null);function D(j,K){if(!ie.value)return;K.stopPropagation(),K.preventDefault();const ve=A.value,Re=ve.has(j.modelId)?new Set(ve):new Set([j.modelId]);vt.value={ids:Re,dropIndex:-1,lineY:0},K.target.setPointerCapture(K.pointerId)}function U(j){if(!vt.value||!mt.value)return;const K=Array.from(mt.value.querySelectorAll(".em-entity__row"));if(!K.length)return;let ve=K.length;for(let Ue=0;Ue<K.length;Ue++){const Ye=K[Ue].getBoundingClientRect();if(j.clientY<Ye.top+Ye.height/2){ve=Ue;break}}const Re=K[K.length-1],me=ve<K.length?K[ve].offsetTop:Re.offsetTop+Re.offsetHeight;vt.value={...vt.value,dropIndex:ve,lineY:me}}function le(){const j=vt.value;if(vt.value=null,!j||j.dropIndex<0)return;const K=w.value,ve=K.filter(pt=>j.ids.has(pt.modelId)).map(pt=>pt.modelId),Re=K.filter((pt,Pt)=>j.ids.has(pt.modelId)&&Pt<j.dropIndex).length,me=j.dropIndex-Re,Ue=K.filter(pt=>!j.ids.has(pt.modelId)).map(pt=>pt.modelId);[...Ue.slice(0,me),...ve,...Ue.slice(me)].join(",")!==K.map(pt=>pt.modelId).join(",")&&(o==null||o.reorderAttributes(n.id,ve,me))}function ne(){vt.value=null}const xe=t.ref(null),Be=t.ref(null);function qe(j,K){ie.value&&(K.stopPropagation(),K.preventDefault(),Be.value={id:j.modelId,dropIndex:-1,lineY:0},K.target.setPointerCapture(K.pointerId))}function je(j){if(!Be.value||!xe.value)return;const K=Array.from(xe.value.querySelectorAll(".em-entity__op-row"));if(!K.length)return;let ve=K.length;for(let Ue=0;Ue<K.length;Ue++){const Ye=K[Ue].getBoundingClientRect();if(j.clientY<Ye.top+Ye.height/2){ve=Ue;break}}const Re=K[K.length-1],me=ve<K.length?K[ve].offsetTop:Re.offsetTop+Re.offsetHeight;Be.value={...Be.value,dropIndex:ve,lineY:me}}function Ie(){const j=Be.value;if(Be.value=null,!j||j.dropIndex<0)return;const ve=Z.value.findIndex(me=>me.modelId===j.id);if(ve<0)return;const Re=j.dropIndex-(ve<j.dropIndex?1:0);Re!==ve&&(o==null||o.reorderOperations(n.id,[j.id],Re))}function Je(){Be.value=null}return(j,K)=>{var ve,Re;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-entity",{"is-hover-origin":N.value,"is-related":y.value,"is-dimmed":O.value,"is-selected":E.value,"is-multi-selected":S.value,"has-focused-attr":V.value,"is-locked":he.value,"is-reference-only":R.value,"is-diff-added":((ve=u.value)==null?void 0:ve.verb)==="added","is-diff-modified":((Re=u.value)==null?void 0:Re.verb)==="modified"}]),tabindex:"-1",title:R.value?i("em.entity.referenceOnlyHint"):void 0,style:t.normalizeStyle(Mt.value),onPointerdown:b,onMouseenter:_,onMouseleave:k,onDblclick:l},[E.value?(t.openBlock(),t.createElementBlock("div",WS,[...K[11]||(K[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(He.value),onDblclick:t.withModifiers(H,["stop"])},[t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__caret nodrag",title:i(se.value?"em.panel.expand":"em.panel.collapse"),"aria-expanded":!se.value,disabled:!g.value,onClick:t.withModifiers(fe,["stop"]),onPointerdown:K[0]||(K[0]=t.withModifiers(()=>{},["stop"])),onDblclick:K[1]||(K[1]=t.withModifiers(()=>{},["stop"]))},t.toDisplayString(se.value?"▸":"▾"),41,JS),t.createElementVNode("span",XS,"«"+t.toDisplayString(t.unref(si)(C.value.stereotype))+"»",1),ce.value?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:0,ref_key:"inputEl",ref:Ee,"onUpdate:modelValue":K[2]||(K[2]=me=>Ae.value=me),class:"em-entity__name-input nodrag",onKeyup:[t.withKeys(It,["enter"]),K[3]||(K[3]=t.withKeys(me=>ce.value=!1,["esc"]))],onBlur:It,onPointerdown:K[4]||(K[4]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,Ae.value]]):(t.openBlock(),t.createElementBlock("span",ZS,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(J.value,(me,Ue)=>(t.openBlock(),t.createElementBlock("span",{key:Ue,class:t.normalizeClass({"em-entity__missing":me.missing})},t.toDisplayString(me.text),3))),128))])),!se.value&&pe.value&&Fe.value?(t.openBlock(),t.createElementBlock("button",{key:2,tabindex:"-1",type:"button",class:"em-entity__embed-all nodrag",title:$e.value?i("em.node.embedAllShow"):i("em.node.embedAllHide"),"aria-expanded":!$e.value,onClick:t.withModifiers(yt,["stop"]),onPointerdown:K[5]||(K[5]=t.withModifiers(()=>{},["stop"])),onDblclick:K[6]||(K[6]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(Ve,{name:"table",size:11}),t.createElementVNode("span",ex,t.toDisplayString($e.value?"▸":"▾"),1)],40,QS)):t.createCommentVNode("",!0),he.value?(t.openBlock(),t.createBlock(Ve,{key:3,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:4,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),se.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("ul",{key:1,ref_key:"attrsUl",ref:mt,class:"em-entity__attrs"},[vt.value&&vt.value.dropIndex>=0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:t.normalizeStyle({top:`${vt.value.lineY}px`}),"aria-hidden":"true"},null,4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.value,me=>{var Ue,Ye,pt,Pt,ta;return t.openBlock(),t.createElementBlock(t.Fragment,{key:me.modelId},[t.createElementVNode("li",{class:t.normalizeClass(["em-entity__row",{"is-attr-selected":M(me),"is-dragging":(Ue=vt.value)==null?void 0:Ue.ids.has(me.modelId),"is-embed":we(me),"is-divider":q(me),"has-embed-badge":!!et(me),nodrag:q(me)&&ie.value,"is-diff-changed":x(me),"is-synthetic":v(me)}]),"data-attr":me.modelId,title:v(me)?i("em.node.derivedIdRow"):void 0,onClick:t.withModifiers(gt=>$(me,gt),["stop"]),onPointerdown:gt=>q(me)?D(me,gt):void 0,onPointermove:gt=>q(me)?U(gt):void 0,onPointerup:gt=>q(me)?le():void 0,onPointercancel:gt=>q(me)?ne():void 0},[ie.value&&!q(me)&&!v(me)?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:gt=>D(me,gt),onPointermove:U,onPointerup:le,onPointercancel:ne,onClick:K[7]||(K[7]=t.withModifiers(()=>{},["stop"]))},"⠿",40,nx)):t.createCommentVNode("",!0),q(me)?(t.openBlock(),t.createElementBlock("span",ox,t.toDisplayString(me.name),1)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createVNode(t.unref(Eo),{id:`l:${me.modelId}`,type:"target",position:t.unref(Oe).Left,class:"em-handle",title:ie.value?i("em.node.connectHint"):void 0},null,8,["id","position","title"]),t.createElementVNode("span",{class:"em-entity__keys",title:Te(ge.value[me.modelId]),"aria-hidden":"true"},[t.createElementVNode("span",ax,[(Ye=ge.value[me.modelId])!=null&&Ye.pk?(t.openBlock(),t.createBlock(Ve,{key:0,name:"key",size:12,class:"em-key is-pk"})):(pt=ge.value[me.modelId])!=null&&pt.required?(t.openBlock(),t.createBlock(Ve,{key:1,name:"asterisk",size:14,class:"em-key is-required"})):t.createCommentVNode("",!0)]),t.createElementVNode("span",rx,[pe.value&&te(me)?(t.openBlock(),t.createElementBlock("button",{key:0,tabindex:"-1",type:"button",class:"em-embed-caret nodrag",title:Ge(me)?i("em.node.embedAttrShow",{count:de(me)}):i("em.node.embedAttrHide"),"aria-expanded":!Ge(me),onClick:t.withModifiers(gt=>Xe(me),["stop"]),onPointerdown:K[8]||(K[8]=t.withModifiers(()=>{},["stop"])),onDblclick:K[9]||(K[9]=t.withModifiers(()=>{},["stop"]))},t.toDisplayString(Ge(me)?"▸":"▾"),41,lx)):we(me)?(t.openBlock(),t.createBlock(Ve,{key:1,name:"table",size:11,class:"em-embed-glyph"})):(Pt=ge.value[me.modelId])!=null&&Pt.fk?(t.openBlock(),t.createBlock(Ve,{key:2,name:"key",size:12,class:"em-key is-fk"})):t.createCommentVNode("",!0)])],8,ix),t.createElementVNode("span",{class:"em-entity__attrname",style:t.normalizeStyle({color:De(me)})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ee(me),(gt,Vn)=>(t.openBlock(),t.createElementBlock("span",{key:Vn,class:t.normalizeClass({"em-entity__missing":gt.missing})},t.toDisplayString(gt.text),3))),128))],4),et(me)==="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:de(me)}),onClick:t.withModifiers(gt=>Xe(me),["stop"])},"+"+t.toDisplayString(de(me)),9,sx)):et(me)==="slot"?(t.openBlock(),t.createElementBlock("button",{key:1,tabindex:"-1",type:"button",class:"em-entity__embed-fold nodrag","data-axis":"slot",title:ae(me)?i("em.node.embedRepeatedShow",{count:((ta=Ce(me))==null?void 0:ta.size)??0}):i("em.node.embedRepeatedHide"),"aria-expanded":!ae(me),onClick:t.withModifiers(gt=>dt(me),["stop"])},t.toDisplayString(ae(me)?`+${Se(me)}`:"−"),9,cx)):t.createCommentVNode("",!0),nt.value[me.modelId]?(t.openBlock(),t.createElementBlock("span",dx,t.toDisplayString(nt.value[me.modelId]),1)):t.createCommentVNode("",!0),t.createVNode(t.unref(Eo),{id:`r:${me.modelId}`,type:"source",position:t.unref(Oe).Right,class:"em-handle",title:ie.value?i("em.node.connectHint"):void 0},null,8,["id","position","title"])],64))],42,tx),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(we(me)&&pe.value?Le(me):[],gt=>(t.openBlock(),t.createElementBlock("li",{key:`${me.modelId}:${gt.modelId}`,class:t.normalizeClass(["em-entity__embed-col",{"is-group-selected":M(me)}]),onClick:t.withModifiers(Vn=>$(me,Vn),["stop"])},[K[12]||(K[12]=t.createElementVNode("span",{class:"em-entity__embed-rail","aria-hidden":"true"},null,-1)),t.createElementVNode("span",mx,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(st(gt),(Vn,Fr)=>(t.openBlock(),t.createElementBlock("span",{key:Fr,class:t.normalizeClass({"em-entity__missing":Vn.missing})},t.toDisplayString(Vn.text),3))),128))]),t.createElementVNode("span",fx,t.toDisplayString(gt.dataType),1)],10,ux))),128))],64)}),128)),ze.value?(t.openBlock(),t.createElementBlock("li",px,[t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__embed-summary-btn nodrag",title:i("em.node.embedAllShow"),onClick:t.withModifiers(yt,["stop"])},[t.createVNode(Ve,{name:"table",size:11}),t.createElementVNode("span",null,t.toDisplayString(i("em.node.embedAllSummary",{n:ze.value})),1)],8,hx)])):t.createCommentVNode("",!0)],512)),!se.value&&re.value?(t.openBlock(),t.createElementBlock("ul",{key:2,ref_key:"opsUl",ref:xe,class:"em-entity__ops"},[Be.value&&Be.value.dropIndex>=0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:t.normalizeStyle({top:`${Be.value.lineY}px`}),"aria-hidden":"true"},null,4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Z.value,me=>{var Ue,Ye;return t.openBlock(),t.createElementBlock("li",{key:me.modelId,class:t.normalizeClass(["em-entity__op-row",{"is-dragging":((Ue=Be.value)==null?void 0:Ue.id)===me.modelId,"is-diff-changed":!!((Ye=u.value)!=null&&Ye.changedOperationIds.has(me.modelId))}]),"data-op":me.modelId},[ie.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:pt=>qe(me,pt),onPointermove:je,onPointerup:Ie,onPointercancel:Je,onClick:K[10]||(K[10]=t.withModifiers(()=>{},["stop"]))},"⠿",40,gx)):t.createCommentVNode("",!0),t.createElementVNode("span",bx,t.toDisplayString(z(me.visibility)),1),t.createElementVNode("span",{class:"em-entity__op-name",style:t.normalizeStyle({color:L(me)})},t.toDisplayString(me.name)+"()",5)],10,yx)}),128))],512)):Z.value.length?(t.openBlock(),t.createElementBlock("div",{key:3,class:"em-entity__ops-summary",title:i("em.node.opsSummaryTitle",{n:Z.value.length})},[t.createVNode(Ve,{name:"method",size:12}),t.createElementVNode("span",null,t.toDisplayString(i("em.node.opsSummary",{n:Z.value.length})),1)],8,_x)):t.createCommentVNode("",!0),ie.value?(t.openBlock(),t.createElementBlock("footer",kx,[t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__add nodrag",onClick:Rt},t.toDisplayString(i("em.node.addAttr")),1),K[13]||(K[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:ot},t.toDisplayString(i("em.node.addDivider")),1)])):t.createCommentVNode("",!0),ie.value&&!ce.value?(t.openBlock(),t.createElementBlock("div",{key:5,class:"em-entity__resize nodrag nopan",onPointerdown:Mn,onPointermove:an,onPointerup:be},null,32)):t.createCommentVNode("",!0)],46,qS)}}}),[["__scopeId","data-v-2bcc3efa"]]),Ex={key:0,class:"em-sel","aria-hidden":"true"},Nx={class:"em-group__label"},wx={class:"em-group__name"},Ix={key:0,class:"em-group__pkg"},vx={key:1,class:"em-group__flag"},Vp=Qe(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(()=>$t(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(Gn,null),s=(C,R)=>l?l.t(C,R):en("ko",C,R),c=t.computed(()=>!!l&&l.editable.value),d=t.computed(()=>{var C;return!!n.id&&((C=l==null?void 0:l.selection.value)==null?void 0:C.kind)==="group"&&l.selection.value.id===n.id}),u=t.computed(()=>!!n.selected&&!d.value),m=t.inject(br,null),p=t.computed(()=>!!n.id&&(m==null?void 0:m.value)===n.id),f=t.inject(Co,null);function h(){n.id&&(f==null||f.setGroupHover(n.id))}function g(){f==null||f.setGroupHover(null)}const b=t.computed(()=>!!f&&f.hoverGroupId.value===n.id),_=t.computed(()=>!!f&&f.hoverGroupId.value!==null&&f.hoverGroupId.value!==n.id),{screenToFlowCoordinate:k,findNode:N}=tt();let y=null,E=null;function S(C){var w;if(!n.id||!c.value)return;C.stopPropagation();const R=((w=N(n.id))==null?void 0:w.dimensions)??{width:400,height:300},T=k({x:C.clientX,y:C.clientY});y={fx:T.x,fy:T.y,w:R.width,h:R.height},C.target.setPointerCapture(C.pointerId)}function A(C){if(!y||!n.id)return;const R=k({x:C.clientX,y:C.clientY});E={width:Math.max(160,y.w+(R.x-y.fx)),height:Math.max(120,y.h+(R.y-y.fy))};const T=N(n.id);T&&(T.style={width:`${E.width}px`,height:`${E.height}px`})}function V(C){var R,T;y&&E&&n.id&&l&&l.resizeGroup(n.id,E),y=null,E=null,(T=(R=C.target).releasePointerCapture)==null||T.call(R,C.pointerId)}const $=t.computed(()=>(l==null?void 0:l.userLanguage.value)??"ko"),O=t.computed(()=>{const C=o.value.name;return(C==null?void 0:C[$.value])||(C==null?void 0:C.ko)||(C==null?void 0:C.en)||(C==null?void 0:C.ja)||(C==null?void 0:C.zh)||o.value.packageName||s("em.group.fallback")});return(C,R)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-group",{"is-drop-target":p.value,"is-hover-origin":b.value,"is-dimmed":_.value,"is-selected":d.value,"is-multi-selected":u.value,"is-locked":i.value}]),tabindex:"-1",style:t.normalizeStyle(r.value),onMouseenter:h,onMouseleave:g},[d.value?(t.openBlock(),t.createElementBlock("div",Ex,[...R[0]||(R[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",Nx,[t.createElementVNode("span",wx,t.toDisplayString(O.value),1),o.value.packageName?(t.openBlock(),t.createElementBlock("span",Ix,t.toDisplayString(o.value.packageName),1)):t.createCommentVNode("",!0),o.value.excludeDDLGeneration?(t.openBlock(),t.createElementBlock("span",vx,t.toDisplayString(s("em.group.ddlExcludeBadge")),1)):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createBlock(Ve,{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:A,onPointerup:V},null,32)):t.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-27b80057"]]),Cx={key:0,class:"em-sel","aria-hidden":"true"},Sx={key:2,class:"em-note__text"},Bp=Qe(t.defineComponent({__name:"NoteNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const n=e,o=t.inject(Gn,null),i=t.inject(br,null),a=t.inject(Co,null),r=t.computed(()=>n.data.note),l=t.computed(()=>!!o&&o.editable.value),s=t.computed(()=>$t(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 p=t.computed(()=>{var w;return((w=a==null?void 0:a.source.value)==null?void 0:w.kind)==="note"&&a.source.value.id===n.id}),f=t.computed(()=>!!a&&a.relatedNoteIds.value.has(n.id)&&!p.value),h=t.computed(()=>{var w;return((w=o==null?void 0:o.selection.value)==null?void 0:w.kind)==="note"&&o.selection.value.id===n.id}),g=t.computed(()=>!!n.selected&&!h.value),b=t.computed(()=>!!a&&a.active.value&&!a.relatedNoteIds.value.has(n.id)&&!h.value),_=[{id:"n-top",pos:Oe.Top},{id:"n-right",pos:Oe.Right},{id:"n-bottom",pos:Oe.Bottom},{id:"n-left",pos:Oe.Left}],k=t.ref(!1),N=t.ref(""),y=t.ref(null);async function E(){var w;l.value&&(N.value=r.value.memo,k.value=!0,await t.nextTick(),(w=y.value)==null||w.focus())}function S(){k.value&&(k.value=!1,N.value!==r.value.memo&&(o==null||o.setNoteMemo(n.id,N.value)))}const{screenToFlowCoordinate:A,findNode:V}=tt();let $=null,O=null;function C(w){var B;if(!l.value)return;w.stopPropagation();const I=((B=V(n.id))==null?void 0:B.dimensions)??r.value.geo.size,v=A({x:w.clientX,y:w.clientY});$={fx:v.x,fy:v.y,w:I.width,h:I.height},w.target.setPointerCapture(w.pointerId)}function R(w){if(!$)return;const I=A({x:w.clientX,y:w.clientY});O={width:Math.max(140,$.w+(I.x-$.fx)),height:Math.max(60,$.h+(I.y-$.fy))};const v=V(n.id);v&&(v.style={width:`${O.width}px`,height:`${O.height}px`})}function T(w){var I,v;$&&O&&o&&o.resizeNote(n.id,O),$=null,O=null,(v=(I=w.target).releasePointerCapture)==null||v.call(I,w.pointerId)}return(w,I)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-note",{"is-hover-origin":p.value,"is-related":f.value,"is-dimmed":b.value,"is-selected":h.value,"is-multi-selected":g.value}]),tabindex:"-1",style:t.normalizeStyle(c.value),onDblclick:E,onPointerdown:d,onMouseenter:u,onMouseleave:m},[h.value?(t.openBlock(),t.createElementBlock("div",Cx,[...I[4]||(I[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),k.value?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:1,ref_key:"area",ref:y,"onUpdate:modelValue":I[0]||(I[0]=v=>N.value=v),class:"em-note__edit nodrag",onBlur:S,onKeydown:I[1]||(I[1]=t.withKeys(v=>k.value=!1,["esc"])),onPointerdown:I[2]||(I[2]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,N.value]]):(t.openBlock(),t.createElementBlock("div",Sx,t.toDisplayString(r.value.memo),1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(_,v=>t.createVNode(t.unref(Eo),{id:v.id,key:v.id,type:"source",position:v.pos,class:"em-note-handle",onPointerdown:I[3]||(I[3]=t.withModifiers(()=>{},["stop"]))},null,8,["id","position"])),64)),l.value&&!k.value?(t.openBlock(),t.createElementBlock("div",{key:3,class:"em-note__resize nodrag nopan",onPointerdown:C,onPointermove:R,onPointerup:T},null,32)):t.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-62a09d8c"]]);function _r(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 ni=.5;function Dp(e,n,o,i,a,r){const l=_r(n),s=_r(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 p=e;const f=(b,_)=>{(Math.abs(b.x-p.x)>=ni||Math.abs(b.y-p.y)>=ni)&&(m.push({a:p,b,seg:_}),p=b)};f(c,0);let h=l.x!==0,g=c;for(let b=1;b<u.length;b++){const _=u[b],k=b<=o.length?b-1:o.length,N=Math.abs(_.x-g.x)<ni,y=Math.abs(_.y-g.y)<ni;N&&y||(N?(f(_,k),h=!1):y?(f(_,k),h=!0):h?(f({x:g.x,y:_.y},k),f(_,k),h=!0):(f({x:_.x,y:g.y},k),f(_,k),h=!1),g=_)}return f(i,o.length),m}function Ds(e,n,o,i,a,r=20){const l=Dp(e,n,o,i,a,r);let s=`M ${Tt(e.x)},${Tt(e.y)}`;for(const c of l)s+=` L ${Tt(c.b.x)},${Tt(c.b.y)}`;return s}const xx=14;function Op(e,n,o,i,a,r=20){return Dp(e,n,o,i,a,r).filter(l=>Math.hypot(l.b.x-l.a.x,l.b.y-l.a.y)>=xx).map(l=>({point:{x:(l.a.x+l.b.x)/2,y:(l.a.y+l.b.y)/2},segIndex:l.seg}))}function Tt(e){return Math.round(e*100)/100}const Rx=36;function Ax(e,n,o=Rx){const i=Math.max(e.x,n.x)+o;return`M ${Tt(e.x)},${Tt(e.y)} L ${Tt(i)},${Tt(e.y)} L ${Tt(i)},${Tt(n.y)} L ${Tt(n.x)},${Tt(n.y)}`}function Os(e,n,o){const i=[e,...n,o];let a=`M ${Tt(i[0].x)},${Tt(i[0].y)}`;for(let r=1;r<i.length;r++)a+=` L ${Tt(i[r].x)},${Tt(i[r].y)}`;return a}function $x(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Lp(e,n){const o=$x(e),i=e.width/2,a=e.height/2,r=n.x-o.x,l=n.y-o.y;if(Math.abs(r)<ni&&Math.abs(l)<ni)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 Pp(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 zp(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 Tx=20,Mx=22,Vx=7,Bx=22,Fp=31,Up=7,Dx=20,Hp=11,jp=11,Ox=Fp+Up;function Lx(e){return e==="NO_INSTANCE_OR_ONE_INSTANCE"||e==="ZERO_OR_MORE_INSTANCES"}function Px(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function kr(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 Kp(e,n){return Math.atan2(n.y-e.y,n.x-e.x)}function Er(e,n,o){return{x:Math.cos(o)*n+e.x,y:Math.sin(o)*n+e.y}}function Gp(e,n,o,i){const a=i/2,r=e.x===n.x&&e.y===n.y?Math.PI/2:Kp(e,n);return[Er(o,a,r-Math.PI/2),Er(o,a,r+Math.PI/2)]}function Yp(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 qp(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=kr(e,n,Tx),[d,u]=Gp(e,n,c,Mx);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}),Lx(o.multiplicity)){const m=kr(e,n,Fp);r.push({cx:m.x,cy:m.y,r:Up})}if(Px(o.multiplicity)){const m=kr(e,n,Vx),[p,f]=Gp(e,n,m,Bx);a.push({x1:c.x,y1:c.y,x2:p.x,y2:p.y}),a.push({x1:c.x,y1:c.y,x2:f.x,y2:f.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=kr(e,n,Dx),d={x:(e.x+c.x)/2,y:(e.y+c.y)/2},u=Kp(e,n),m=Er(d,Hp/2,u-Math.PI/2),p=Er(d,Hp/2,u+Math.PI/2);l.push({points:[e,m,c,p]}),s=c}if(o.navigable&&!o.otherNavigable){const c=Math.atan2(n.x-e.x,n.y-e.y),d=Yp(s,c,jp,!0),u=Yp(s,c,jp,!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 Wp=200,Jp=120,Ls=24;function Xp(e){var a,r;if(!e)return{x:0,y:0,width:Wp,height:Jp};const n=e.computedPosition??e.position??{x:0,y:0},o=((a=e.dimensions)==null?void 0:a.width)||Wp,i=((r=e.dimensions)==null?void 0:r.height)||Jp;return{x:n.x,y:n.y,width:o,height:i}}function Zp(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Ps(e){const n=t.computed(()=>Xp(e.sourceNode())),o=t.computed(()=>Xp(e.targetNode())),i=t.computed(()=>{const d=e.sourceNode(),u=e.targetNode();return!!d&&!!u&&d.id===u.id}),a=t.computed(()=>{var f,h;const d=n.value,u=d.x+d.width;let m=((f=e.sourceRowY)==null?void 0:f.call(e))??d.y+d.height/3,p=((h=e.targetRowY)==null?void 0:h.call(e))??d.y+d.height*2/3;if(Math.abs(p-m)<Ls){const g=(m+p)/2;m=g-Ls/2,p=g+Ls/2}return{source:{x:u,y:m},target:{x:u,y:p}}}),r=t.computed(()=>e.waypoints()[0]??Zp(o.value)),l=t.computed(()=>{const d=e.waypoints();return d[d.length-1]??Zp(n.value)}),s=t.computed(()=>{var u;const d=(u=e.sourceRowY)==null?void 0:u.call(e);return d!=null?Pp(n.value,d,r.value.x):Lp(n.value,r.value)}),c=t.computed(()=>{var u;const d=(u=e.targetRowY)==null?void 0:u.call(e);return d!=null?Pp(o.value,d,l.value.x):Lp(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 zs=Symbol("waypointController"),zx=["d"],Fx=["d"],Ux=["d"],Hx=["x1","y1","x2","y2"],jx=["cx","cy","r"],Kx=["x","y"],Gx=["x","y"],Yx=["cx","cy","onDblclick"],qx=["x","y","onPointerdown","onDblclick"],Qp=Qe(t.defineComponent({inheritAttrs:!1,__name:"AssociationEdge",props:{id:{},sourceY:{},targetY:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,{screenToFlowCoordinate:o}=tt(),i=t.inject(zs),a=t.inject(Gn,null),r=t.computed(()=>!!a&&a.editable.value),l=t.inject(Ep,null),s=t.inject(Co,null),c=t.computed(()=>!!s&&s.relatedEdgeIds.value.has(n.id)),d=t.computed(()=>{var Z;return((Z=a==null?void 0:a.selection.value)==null?void 0:Z.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 Z=l==null?void 0:l.value;if(!Z||!a)return null;const re=a.resolved.value.entities,ue=L=>{var F;return(F=re.find(X=>X.entity.modelId===L))==null?void 0:F.groupRef},z=n.data.association;return ue(z.end1.entityRef)===Z.groupId&&ue(z.end2.entityRef)===Z.groupId?{dx:Z.dx,dy:Z.dy}:null}),p=t.computed(()=>(i==null?void 0:i.points(n.id))??[]),f=t.ref(-1),h=t.ref({x:0,y:0}),g=t.computed(()=>{const Z=m.value;return p.value.map((re,ue)=>ue===f.value?h.value:Z?{x:re.x+Z.dx,y:re.y+Z.dy}:re)}),b=t.computed(()=>{var Z;return!!((Z=n.sourceNode.data)!=null&&Z.collapsed)}),_=t.computed(()=>{var Z;return!!((Z=n.targetNode.data)!=null&&Z.collapsed)}),{source:k,target:N,sourceSide:y,targetSide:E,isSelf:S}=Ps({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>g.value,sourceRowY:()=>n.data.sourceColumnRef&&!b.value?n.sourceY:void 0,targetRowY:()=>n.data.targetColumnRef&&!_.value?n.targetY:void 0}),A=Ox+4,V=t.computed(()=>S.value?Ax(k.value,N.value):(a==null?void 0:a.routingMode.value)==="orthogonal"?Ds(k.value,y.value,g.value,N.value,E.value,A):Os(k.value,g.value,N.value)),$=t.computed(()=>S.value||!r.value?[]:(a==null?void 0:a.routingMode.value)==="orthogonal"?Op(k.value,y.value,g.value,N.value,E.value,A):zp(k.value,g.value,N.value).map((Z,re)=>({point:Z,segIndex:re}))),O=t.computed(()=>S.value||!r.value?[]:g.value),C=ca;function R(Z,re){f.value=Z,h.value={...p.value[Z]},re.target.setPointerCapture(re.pointerId),re.stopPropagation()}function T(Z){if(f.value<0)return;const re=o({x:Z.clientX,y:Z.clientY});h.value={x:re.x,y:re.y}}function w(Z){var re,ue;f.value>=0&&i&&i.movePoint(n.id,f.value,{...h.value}),f.value=-1,(ue=(re=Z.target).releasePointerCapture)==null||ue.call(re,Z.pointerId)}function I(Z,re){re.stopPropagation(),i==null||i.removePoint(n.id,Z)}function v(Z,re){if(!i)return;const ue=o({x:re.clientX,y:re.clientY});i.insertPoint(n.id,Z,{x:ue.x,y:ue.y})}const B=t.computed(()=>C(n.data.association.end1.multiplicity)),M=t.computed(()=>C(n.data.association.end2.multiplicity)),x=t.computed(()=>(a==null?void 0:a.displayMode.value)==="CLASS"?"class":"db"),P=t.computed(()=>x.value==="class"),Y=t.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const Z=_r(y.value);return{x:k.value.x+Z.x*10,y:k.value.y+Z.y*10}}return g.value[0]??N.value}),se=t.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const re=_r(E.value);return{x:N.value.x+re.x*10,y:N.value.y+re.y*10}}const Z=g.value;return Z[Z.length-1]??k.value}),he=t.computed(()=>{const Z=n.data.association;return{multiplicity:Z.end1.multiplicity,navigable:Z.end1.navigable,composition:Z.end1.composition,otherNavigable:Z.end2.navigable}}),ie=t.computed(()=>{const Z=n.data.association;return{multiplicity:Z.end2.multiplicity,navigable:Z.end2.navigable,composition:Z.end2.composition,otherNavigable:Z.end1.navigable}}),fe=t.computed(()=>qp(k.value,Y.value,he.value,x.value)),pe=t.computed(()=>qp(N.value,se.value,ie.value,x.value)),ge=t.computed(()=>[...fe.value.lines,...pe.value.lines]),Te=t.computed(()=>[...fe.value.circles,...pe.value.circles]),He=t.computed(()=>[...fe.value.polygons,...pe.value.polygons].map(Z=>`M${Z.points.map(re=>`${re.x},${re.y}`).join(" L")} Z`)),De=t.computed(()=>({"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}));return(Z,re)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("path",{d:V.value,fill:"none",class:"em-edge__hit"},null,8,zx),t.createElementVNode("path",{d:V.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,Fx),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(He.value,(ue,z)=>(t.openBlock(),t.createElementBlock("path",{key:`mpoly-${z}`,d:ue,class:t.normalizeClass(["em-edge__marker em-edge__marker--fill",De.value])},null,10,Ux))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ge.value,(ue,z)=>(t.openBlock(),t.createElementBlock("line",{key:`mline-${z}`,x1:ue.x1,y1:ue.y1,x2:ue.x2,y2:ue.y2,class:t.normalizeClass(["em-edge__marker",De.value])},null,10,Hx))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Te.value,(ue,z)=>(t.openBlock(),t.createElementBlock("circle",{key:`mcirc-${z}`,cx:ue.cx,cy:ue.cy,r:ue.r,class:t.normalizeClass(["em-edge__marker",De.value])},null,10,jx))),128)),P.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("text",{x:t.unref(k).x+8,y:t.unref(k).y-6,class:t.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},t.toDisplayString(B.value),11,Kx),t.createElementVNode("text",{x:t.unref(N).x-8,y:t.unref(N).y-6,"text-anchor":"end",class:t.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},t.toDisplayString(M.value),11,Gx)],64)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(ue,z)=>(t.openBlock(),t.createElementBlock("circle",{key:`mid-${z}`,cx:ue.point.x,cy:ue.point.y,r:"4",class:t.normalizeClass(["em-edge__mid",{"is-dimmed":u.value}]),onDblclick:t.withModifiers(L=>v(ue.segIndex,L),["stop"])},null,42,Yx))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(O.value,(ue,z)=>(t.openBlock(),t.createElementBlock("rect",{key:`wp-${z}`,x:ue.x-5,y:ue.y-5,width:"10",height:"10",rx:"2",class:t.normalizeClass(["em-edge__waypoint",{"is-dimmed":u.value}]),onPointerdown:L=>R(z,L),onPointermove:T,onPointerup:w,onDblclick:L=>I(z,L)},null,42,qx))),128))],64))}}),[["__scopeId","data-v-5468806a"]]);var Rn=(e=>(e.Lines="lines",e.Dots="dots",e))(Rn||{});const eh=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]}`})},th=function({radius:e,color:n}){return t.h("circle",{cx:e,cy:e,r:e,fill:n})};Rn.Lines+"",Rn.Dots+"";const Wx={[Rn.Dots]:"#81818a",[Rn.Lines]:"#eee"},Jx=["id","x","y","width","height","patternTransform"],Xx={key:2,height:"100",width:"100"},Zx=["fill"],Qx=["x","y","fill"],eR={name:"Background",compatConfig:{MODE:3}},tR=t.defineComponent({...eR,props:{id:{},variant:{default:()=>Rn.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}=tt(),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,p]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],f=[m*l||1+d[0]/2,p*l||1+d[1]/2];return{scaledGap:d,offset:f,size:u}}),a=t.toRef(()=>`pattern-${n}${e.id?`-${e.id}`:""}`),r=t.toRef(()=>e.color||e.patternColor||Wx[e.variant||Rn.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(Rn).Lines?(t.openBlock(),t.createBlock(t.unref(eh),{key:0,size:l.lineWidth,color:r.value,dimensions:i.value.scaledGap},null,8,["size","color","dimensions"])):l.variant===t.unref(Rn).Dots?(t.openBlock(),t.createBlock(t.unref(th),{key:1,color:r.value,radius:i.value.size/2},null,8,["color","radius"])):t.createCommentVNode("",!0),l.bgColor?(t.openBlock(),t.createElementBlock("svg",Xx,[t.createElementVNode("rect",{width:"100%",height:"100%",fill:l.bgColor},null,8,Zx)])):t.createCommentVNode("",!0)])],8,Jx)]),t.createElementVNode("rect",{x:l.x,y:l.y,width:"100%",height:"100%",fill:`url(#${a.value})`},null,8,Qx),t.renderSlot(l.$slots,"default",{id:a.value})],4))}}),nR={name:"ControlButton",compatConfig:{MODE:3}},oR=(e,n)=>{const o=e.__vccOpts||e;for(const[i,a]of n)o[i]=a;return o},iR={type:"button",class:"vue-flow__controls-button"};function aR(e,n,o,i,a,r){return t.openBlock(),t.createElementBlock("button",iR,[t.renderSlot(e.$slots,"default")])}const So=oR(nR,[["render",aR]]),rR={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},lR=[t.createElementVNode("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function sR(e,n){return t.openBlock(),t.createElementBlock("svg",rR,lR)}const cR={render:sR},dR={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},uR=[t.createElementVNode("path",{d:"M0 0h32v4.2H0z"},null,-1)];function mR(e,n){return t.openBlock(),t.createElementBlock("svg",dR,uR)}const fR={render:mR},pR={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},hR=[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 yR(e,n){return t.openBlock(),t.createElementBlock("svg",pR,hR)}const gR={render:yR},bR={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},_R=[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 kR(e,n){return t.openBlock(),t.createElementBlock("svg",bR,_R)}const ER={render:kR},NR={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},wR=[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 IR(e,n){return t.openBlock(),t.createElementBlock("svg",NR,wR)}const vR={render:IR},CR={name:"Controls",compatConfig:{MODE:3}},SR=t.defineComponent({...CR,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>ef.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}=tt(),p=t.toRef(()=>o.value||i.value||a.value),f=t.toRef(()=>d.value.zoom<=u.value),h=t.toRef(()=>d.value.zoom>=m.value);function g(){l(),n("zoomIn")}function b(){s(),n("zoomOut")}function _(){c(e.fitViewParams),n("fitView")}function k(){r(!p.value),n("interactionChange",!p.value)}return(N,y)=>(t.openBlock(),t.createBlock(t.unref(Qf),{class:"vue-flow__controls",position:N.position},{default:t.withCtx(()=>[t.renderSlot(N.$slots,"top"),N.showZoom?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.renderSlot(N.$slots,"control-zoom-in",{},()=>[t.createVNode(So,{class:"vue-flow__controls-zoomin",disabled:h.value,onClick:g},{default:t.withCtx(()=>[t.renderSlot(N.$slots,"icon-zoom-in",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(cR))))])]),_:3},8,["disabled"])]),t.renderSlot(N.$slots,"control-zoom-out",{},()=>[t.createVNode(So,{class:"vue-flow__controls-zoomout",disabled:f.value,onClick:b},{default:t.withCtx(()=>[t.renderSlot(N.$slots,"icon-zoom-out",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(fR))))])]),_:3},8,["disabled"])])],64)):t.createCommentVNode("",!0),N.showFitView?t.renderSlot(N.$slots,"control-fit-view",{key:1},()=>[t.createVNode(So,{class:"vue-flow__controls-fitview",onClick:_},{default:t.withCtx(()=>[t.renderSlot(N.$slots,"icon-fit-view",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(gR))))])]),_:3})]):t.createCommentVNode("",!0),N.showInteractive?t.renderSlot(N.$slots,"control-interactive",{key:2},()=>[N.showInteractive?(t.openBlock(),t.createBlock(So,{key:0,class:"vue-flow__controls-interactive",onClick:k},{default:t.withCtx(()=>[p.value?t.renderSlot(N.$slots,"icon-unlock",{key:0},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(vR))))]):t.createCommentVNode("",!0),p.value?t.createCommentVNode("",!0):t.renderSlot(N.$slots,"icon-lock",{key:1},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(ER))))])]),_:3})):t.createCommentVNode("",!0)]):t.createCommentVNode("",!0),t.renderSlot(N.$slots,"default")]),_:3},8,["position"]))}});var xR={value:()=>{}};function Fs(){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 Nr(o)}function Nr(e){this._=e}function RR(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}})}Nr.prototype=Fs.prototype={constructor:Nr,on:function(e,n){var o=this._,i=RR(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=AR(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]=nh(o[a],e.name,n);else if(n==null)for(a in o)o[a]=nh(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 Nr(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 AR(e,n){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===n)return a.value}function nh(e,n,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=xR,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:n,value:o}),e}var Us="http://www.w3.org/1999/xhtml";const oh={svg:"http://www.w3.org/2000/svg",xhtml:Us,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function wr(e){var n=e+="",o=n.indexOf(":");return o>=0&&(n=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),oh.hasOwnProperty(n)?{space:oh[n],local:e}:e}function $R(e){return function(){var n=this.ownerDocument,o=this.namespaceURI;return o===Us&&n.documentElement.namespaceURI===Us?n.createElement(e):n.createElementNS(o,e)}}function TR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ih(e){var n=wr(e);return(n.local?TR:$R)(n)}function MR(){}function Hs(e){return e==null?MR:function(){return this.querySelector(e)}}function VR(e){typeof e!="function"&&(e=Hs(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 Ht(i,this._parents)}function BR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function DR(){return[]}function ah(e){return e==null?DR:function(){return this.querySelectorAll(e)}}function OR(e){return function(){return BR(e.apply(this,arguments))}}function LR(e){typeof e=="function"?e=OR(e):e=ah(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 Ht(i,a)}function rh(e){return function(){return this.matches(e)}}function lh(e){return function(n){return n.matches(e)}}var PR=Array.prototype.find;function zR(e){return function(){return PR.call(this.children,e)}}function FR(){return this.firstElementChild}function UR(e){return this.select(e==null?FR:zR(typeof e=="function"?e:lh(e)))}var HR=Array.prototype.filter;function jR(){return Array.from(this.children)}function KR(e){return function(){return HR.call(this.children,e)}}function GR(e){return this.selectAll(e==null?jR:KR(typeof e=="function"?e:lh(e)))}function YR(e){typeof e!="function"&&(e=rh(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 Ht(i,this._parents)}function sh(e){return new Array(e.length)}function qR(){return new Ht(this._enter||this._groups.map(sh),this._parents)}function Ir(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Ir.prototype={constructor:Ir,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 WR(e){return function(){return e}}function JR(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 Ir(e,r[l]);for(;l<c;++l)(s=n[l])&&(a[l]=s)}function XR(e,n,o,i,a,r,l){var s,c,d=new Map,u=n.length,m=r.length,p=new Array(u),f;for(s=0;s<u;++s)(c=n[s])&&(p[s]=f=l.call(c,c.__data__,s,n)+"",d.has(f)?a[s]=c:d.set(f,c));for(s=0;s<m;++s)f=l.call(e,r[s],s,r)+"",(c=d.get(f))?(i[s]=c,c.__data__=r[s],d.delete(f)):o[s]=new Ir(e,r[s]);for(s=0;s<u;++s)(c=n[s])&&d.get(p[s])===c&&(a[s]=c)}function ZR(e){return e.__data__}function QR(e,n){if(!arguments.length)return Array.from(this,ZR);var o=n?XR:JR,i=this._parents,a=this._groups;typeof e!="function"&&(e=WR(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],p=m.length,f=eA(e.call(u,u&&u.__data__,d,i)),h=f.length,g=s[d]=new Array(h),b=l[d]=new Array(h),_=c[d]=new Array(p);o(u,m,g,b,_,f,n);for(var k=0,N=0,y,E;k<h;++k)if(y=g[k]){for(k>=N&&(N=k+1);!(E=b[N])&&++N<h;);y._next=E||null}}return l=new Ht(l,i),l._enter=s,l._exit=c,l}function eA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function tA(){return new Ht(this._exit||this._groups.map(sh),this._parents)}function nA(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 oA(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,p=s[c]=new Array(m),f,h=0;h<m;++h)(f=d[h]||u[h])&&(p[h]=f);for(;c<a;++c)s[c]=o[c];return new Ht(s,this._parents)}function iA(){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 aA(e){e||(e=rA);function n(m,p){return m&&p?e(m.__data__,p.__data__):!m-!p}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 Ht(a,this._parents).order()}function rA(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function lA(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function sA(){return Array.from(this)}function cA(){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 dA(){let e=0;for(const n of this)++e;return e}function uA(){return!this.node()}function mA(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 fA(e){return function(){this.removeAttribute(e)}}function pA(e){return function(){this.removeAttributeNS(e.space,e.local)}}function hA(e,n){return function(){this.setAttribute(e,n)}}function yA(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function gA(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function bA(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 _A(e,n){var o=wr(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?pA:fA:typeof n=="function"?o.local?bA:gA:o.local?yA:hA)(o,n))}function ch(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function kA(e){return function(){this.style.removeProperty(e)}}function EA(e,n,o){return function(){this.style.setProperty(e,n,o)}}function NA(e,n,o){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function wA(e,n,o){return arguments.length>1?this.each((n==null?kA:typeof n=="function"?NA:EA)(e,n,o??"")):oi(this.node(),e)}function oi(e,n){return e.style.getPropertyValue(n)||ch(e).getComputedStyle(e,null).getPropertyValue(n)}function IA(e){return function(){delete this[e]}}function vA(e,n){return function(){this[e]=n}}function CA(e,n){return function(){var o=n.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function SA(e,n){return arguments.length>1?this.each((n==null?IA:typeof n=="function"?CA:vA)(e,n)):this.node()[e]}function dh(e){return e.trim().split(/^|\s+/)}function js(e){return e.classList||new uh(e)}function uh(e){this._node=e,this._names=dh(e.getAttribute("class")||"")}uh.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 mh(e,n){for(var o=js(e),i=-1,a=n.length;++i<a;)o.add(n[i])}function fh(e,n){for(var o=js(e),i=-1,a=n.length;++i<a;)o.remove(n[i])}function xA(e){return function(){mh(this,e)}}function RA(e){return function(){fh(this,e)}}function AA(e,n){return function(){(n.apply(this,arguments)?mh:fh)(this,e)}}function $A(e,n){var o=dh(e+"");if(arguments.length<2){for(var i=js(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof n=="function"?AA:n?xA:RA)(o,n))}function TA(){this.textContent=""}function MA(e){return function(){this.textContent=e}}function VA(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function BA(e){return arguments.length?this.each(e==null?TA:(typeof e=="function"?VA:MA)(e)):this.node().textContent}function DA(){this.innerHTML=""}function OA(e){return function(){this.innerHTML=e}}function LA(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function PA(e){return arguments.length?this.each(e==null?DA:(typeof e=="function"?LA:OA)(e)):this.node().innerHTML}function zA(){this.nextSibling&&this.parentNode.appendChild(this)}function FA(){return this.each(zA)}function UA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function HA(){return this.each(UA)}function jA(e){var n=typeof e=="function"?e:ih(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function KA(){return null}function GA(e,n){var o=typeof e=="function"?e:ih(e),i=n==null?KA:typeof n=="function"?n:Hs(n);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function YA(){var e=this.parentNode;e&&e.removeChild(this)}function qA(){return this.each(YA)}function WA(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function JA(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function XA(e){return this.select(e?JA:WA)}function ZA(e){return arguments.length?this.property("__data__",e):this.node().__data__}function QA(e){return function(n){e.call(this,n,this.__data__)}}function e$(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 t$(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 n$(e,n,o){return function(){var i=this.__on,a,r=QA(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 o$(e,n,o){var i=e$(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?n$:t$,a=0;a<r;++a)this.each(s(i[a],n,o));return this}function ph(e,n,o){var i=ch(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 i$(e,n){return function(){return ph(this,e,n)}}function a$(e,n){return function(){return ph(this,e,n.apply(this,arguments))}}function r$(e,n){return this.each((typeof n=="function"?a$:i$)(e,n))}function*l$(){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 hh=[null];function Ht(e,n){this._groups=e,this._parents=n}function Hi(){return new Ht([[document.documentElement]],hh)}function s$(){return this}Ht.prototype=Hi.prototype={constructor:Ht,select:VR,selectAll:LR,selectChild:UR,selectChildren:GR,filter:YR,data:QR,enter:qR,exit:tA,join:nA,merge:oA,selection:s$,order:iA,sort:aA,call:lA,nodes:sA,node:cA,size:dA,empty:uA,each:mA,attr:_A,style:wA,property:SA,classed:$A,text:BA,html:PA,raise:FA,lower:HA,append:jA,insert:GA,remove:qA,clone:XA,datum:ZA,on:o$,dispatch:r$,[Symbol.iterator]:l$};function Yn(e){return typeof e=="string"?new Ht([[document.querySelector(e)]],[document.documentElement]):new Ht([[e]],hh)}function c$(e){let n;for(;n=e.sourceEvent;)e=n;return e}function qn(e,n){if(e=c$(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 Ks={capture:!0,passive:!1};function Gs(e){e.preventDefault(),e.stopImmediatePropagation()}function d$(e){var n=e.document.documentElement,o=Yn(e).on("dragstart.drag",Gs,Ks);"onselectstart"in n?o.on("selectstart.drag",Gs,Ks):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function u$(e,n){var o=e.document.documentElement,i=Yn(e).on("dragstart.drag",null);n&&(i.on("click.drag",Gs,Ks),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 Ys(e,n,o){e.prototype=n.prototype=o,o.constructor=e}function yh(e,n){var o=Object.create(e.prototype);for(var i in n)o[i]=n[i];return o}function ji(){}var Ki=.7,vr=1/Ki,ii="\\s*([+-]?\\d+)\\s*",Gi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",m$=/^#([0-9a-f]{3,8})$/,f$=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),p$=new RegExp(`^rgb\\(${fn},${fn},${fn}\\)$`),h$=new RegExp(`^rgba\\(${ii},${ii},${ii},${Gi}\\)$`),y$=new RegExp(`^rgba\\(${fn},${fn},${fn},${Gi}\\)$`),g$=new RegExp(`^hsl\\(${Gi},${fn},${fn}\\)$`),b$=new RegExp(`^hsla\\(${Gi},${fn},${fn},${Gi}\\)$`),gh={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};Ys(ji,Yi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:bh,formatHex:bh,formatHex8:_$,formatHsl:k$,formatRgb:_h,toString:_h});function bh(){return this.rgb().formatHex()}function _$(){return this.rgb().formatHex8()}function k$(){return Ih(this).formatHsl()}function _h(){return this.rgb().formatRgb()}function Yi(e){var n,o;return e=(e+"").trim().toLowerCase(),(n=m$.exec(e))?(o=n[1].length,n=parseInt(n[1],16),o===6?kh(n):o===3?new Lt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):o===8?Cr(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):o===4?Cr(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=f$.exec(e))?new Lt(n[1],n[2],n[3],1):(n=p$.exec(e))?new Lt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=h$.exec(e))?Cr(n[1],n[2],n[3],n[4]):(n=y$.exec(e))?Cr(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=g$.exec(e))?wh(n[1],n[2]/100,n[3]/100,1):(n=b$.exec(e))?wh(n[1],n[2]/100,n[3]/100,n[4]):gh.hasOwnProperty(e)?kh(gh[e]):e==="transparent"?new Lt(NaN,NaN,NaN,0):null}function kh(e){return new Lt(e>>16&255,e>>8&255,e&255,1)}function Cr(e,n,o,i){return i<=0&&(e=n=o=NaN),new Lt(e,n,o,i)}function E$(e){return e instanceof ji||(e=Yi(e)),e?(e=e.rgb(),new Lt(e.r,e.g,e.b,e.opacity)):new Lt}function qs(e,n,o,i){return arguments.length===1?E$(e):new Lt(e,n,o,i??1)}function Lt(e,n,o,i){this.r=+e,this.g=+n,this.b=+o,this.opacity=+i}Ys(Lt,qs,yh(ji,{brighter(e){return e=e==null?vr:Math.pow(vr,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lt(xo(this.r),xo(this.g),xo(this.b),Sr(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:Eh,formatHex:Eh,formatHex8:N$,formatRgb:Nh,toString:Nh}));function Eh(){return`#${Ro(this.r)}${Ro(this.g)}${Ro(this.b)}`}function N$(){return`#${Ro(this.r)}${Ro(this.g)}${Ro(this.b)}${Ro((isNaN(this.opacity)?1:this.opacity)*255)}`}function Nh(){const e=Sr(this.opacity);return`${e===1?"rgb(":"rgba("}${xo(this.r)}, ${xo(this.g)}, ${xo(this.b)}${e===1?")":`, ${e})`}`}function Sr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ro(e){return e=xo(e),(e<16?"0":"")+e.toString(16)}function wh(e,n,o,i){return i<=0?e=n=o=NaN:o<=0||o>=1?e=n=NaN:n<=0&&(e=NaN),new nn(e,n,o,i)}function Ih(e){if(e instanceof nn)return new nn(e.h,e.s,e.l,e.opacity);if(e instanceof ji||(e=Yi(e)),!e)return new nn;if(e instanceof nn)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 nn(l,s,c,e.opacity)}function w$(e,n,o,i){return arguments.length===1?Ih(e):new nn(e,n,o,i??1)}function nn(e,n,o,i){this.h=+e,this.s=+n,this.l=+o,this.opacity=+i}Ys(nn,w$,yh(ji,{brighter(e){return e=e==null?vr:Math.pow(vr,e),new nn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new nn(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 Lt(Ws(e>=240?e-240:e+120,a,i),Ws(e,a,i),Ws(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new nn(vh(this.h),xr(this.s),xr(this.l),Sr(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=Sr(this.opacity);return`${e===1?"hsl(":"hsla("}${vh(this.h)}, ${xr(this.s)*100}%, ${xr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vh(e){return e=(e||0)%360,e<0?e+360:e}function xr(e){return Math.max(0,Math.min(1,e||0))}function Ws(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 Ch=e=>()=>e;function I$(e,n){return function(o){return e+o*n}}function v$(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 C$(e){return(e=+e)==1?Sh:function(n,o){return o-n?v$(n,o,e):Ch(isNaN(n)?o:n)}}function Sh(e,n){var o=n-e;return o?I$(e,o):Ch(isNaN(e)?n:e)}const xh=(function e(n){var o=C$(n);function i(a,r){var l=o((a=qs(a)).r,(r=qs(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=Sh(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 Wn(e,n){return e=+e,n=+n,function(o){return e*(1-o)+n*o}}var Js=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xs=new RegExp(Js.source,"g");function S$(e){return function(){return e}}function x$(e){return function(n){return e(n)+""}}function R$(e,n){var o=Js.lastIndex=Xs.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",n=n+"";(i=Js.exec(e))&&(a=Xs.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:Wn(i,a)})),o=Xs.lastIndex;return o<n.length&&(r=n.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?x$(c[0].x):S$(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 Rh=180/Math.PI,Zs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ah(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)*Rh,skewX:Math.atan(c)*Rh,scaleX:l,scaleY:s}}var Rr;function A$(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Zs:Ah(n.a,n.b,n.c,n.d,n.e,n.f)}function $$(e){return e==null||(Rr||(Rr=document.createElementNS("http://www.w3.org/2000/svg","g")),Rr.setAttribute("transform",e),!(e=Rr.transform.baseVal.consolidate()))?Zs:(e=e.matrix,Ah(e.a,e.b,e.c,e.d,e.e,e.f))}function $h(e,n,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,p,f,h){if(d!==m||u!==p){var g=f.push("translate(",null,n,null,o);h.push({i:g-4,x:Wn(d,m)},{i:g-2,x:Wn(u,p)})}else(m||p)&&f.push("translate("+m+n+p+o)}function l(d,u,m,p){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),p.push({i:m.push(a(m)+"rotate(",null,i)-2,x:Wn(d,u)})):u&&m.push(a(m)+"rotate("+u+i)}function s(d,u,m,p){d!==u?p.push({i:m.push(a(m)+"skewX(",null,i)-2,x:Wn(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,p,f,h){if(d!==m||u!==p){var g=f.push(a(f)+"scale(",null,",",null,")");h.push({i:g-4,x:Wn(d,m)},{i:g-2,x:Wn(u,p)})}else(m!==1||p!==1)&&f.push(a(f)+"scale("+m+","+p+")")}return function(d,u){var m=[],p=[];return d=e(d),u=e(u),r(d.translateX,d.translateY,u.translateX,u.translateY,m,p),l(d.rotate,u.rotate,m,p),s(d.skewX,u.skewX,m,p),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,m,p),d=u=null,function(f){for(var h=-1,g=p.length,b;++h<g;)m[(b=p[h]).i]=b.x(f);return m.join("")}}}var T$=$h(A$,"px, ","px)","deg)"),M$=$h($$,", ",")",")"),V$=1e-12;function Th(e){return((e=Math.exp(e))+1/e)/2}function B$(e){return((e=Math.exp(e))-1/e)/2}function D$(e){return((e=Math.exp(2*e))-1)/(e+1)}const O$=(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],p=l[2],f=u-s,h=m-c,g=f*f+h*h,b,_;if(g<V$)_=Math.log(p/d)/n,b=function(A){return[s+A*f,c+A*h,d*Math.exp(n*A*_)]};else{var k=Math.sqrt(g),N=(p*p-d*d+i*g)/(2*d*o*k),y=(p*p-d*d-i*g)/(2*p*o*k),E=Math.log(Math.sqrt(N*N+1)-N),S=Math.log(Math.sqrt(y*y+1)-y);_=(S-E)/n,b=function(A){var V=A*_,$=Th(E),O=d/(o*k)*($*D$(n*V+E)-B$(E));return[s+O*f,c+O*h,d*$/Th(n*V+E)]}}return b.duration=_*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,qi=0,Wi=0,Mh=1e3,Ar,Ji,$r=0,Ao=0,Tr=0,Xi=typeof performance=="object"&&performance.now?performance:Date,Vh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Qs(){return Ao||(Vh(L$),Ao=Xi.now()+Tr)}function L$(){Ao=0}function Mr(){this._call=this._time=this._next=null}Mr.prototype=Bh.prototype={constructor:Mr,restart:function(e,n,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?Qs():+o)+(n==null?0:+n),!this._next&&Ji!==this&&(Ji?Ji._next=this:Ar=this,Ji=this),this._call=e,this._time=o,ec()},stop:function(){this._call&&(this._call=null,this._time=1/0,ec())}};function Bh(e,n,o){var i=new Mr;return i.restart(e,n,o),i}function P$(){Qs(),++ai;for(var e=Ar,n;e;)(n=Ao-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ai}function Dh(){Ao=($r=Xi.now())+Tr,ai=qi=0;try{P$()}finally{ai=0,F$(),Ao=0}}function z$(){var e=Xi.now(),n=e-$r;n>Mh&&(Tr-=n,$r=e)}function F$(){for(var e,n=Ar,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:Ar=o);Ji=e,ec(i)}function ec(e){if(!ai){qi&&(qi=clearTimeout(qi));var n=e-Ao;n>24?(e<1/0&&(qi=setTimeout(Dh,e-Xi.now()-Tr)),Wi&&(Wi=clearInterval(Wi))):(Wi||($r=Xi.now(),Wi=setInterval(z$,Mh)),ai=1,Vh(Dh))}}function Oh(e,n,o){var i=new Mr;return n=n==null?0:+n,i.restart(a=>{i.stop(),e(a+n)},n,o),i}var U$=Fs("start","end","cancel","interrupt"),H$=[],Lh=0,Ph=1,tc=2,Vr=3,zh=4,nc=5,Br=6;function Dr(e,n,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;j$(e,o,{name:n,index:i,group:a,on:U$,tween:H$,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Lh})}function oc(e,n){var o=on(e,n);if(o.state>Lh)throw new Error("too late; already scheduled");return o}function pn(e,n){var o=on(e,n);if(o.state>Vr)throw new Error("too late; already running");return o}function on(e,n){var o=e.__transition;if(!o||!(o=o[n]))throw new Error("transition not found");return o}function j$(e,n,o){var i=e.__transition,a;i[n]=o,o.timer=Bh(r,0,o.time);function r(d){o.state=Ph,o.timer.restart(l,o.delay,o.time),o.delay<=d&&l(d-o.delay)}function l(d){var u,m,p,f;if(o.state!==Ph)return c();for(u in i)if(f=i[u],f.name===o.name){if(f.state===Vr)return Oh(l);f.state===zh?(f.state=Br,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<n&&(f.state=Br,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(Oh(function(){o.state===Vr&&(o.state=zh,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=tc,o.on.call("start",e,e.__data__,o.index,o.group),o.state===tc){for(o.state=Vr,a=new Array(p=o.tween.length),u=0,m=-1;u<p;++u)(f=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++m]=f);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=nc,1),m=-1,p=a.length;++m<p;)a[m].call(e,u);o.state===nc&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=Br,o.timer.stop(),delete i[n];for(var d in i)return;delete e.__transition}}function Or(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>tc&&i.state<nc,i.state=Br,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function K$(e){return this.each(function(){Or(this,e)})}function G$(e,n){var o,i;return function(){var a=pn(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 Y$(e,n,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=pn(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 q$(e,n){var o=this._id;if(e+="",arguments.length<2){for(var i=on(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?G$:Y$)(o,e,n))}function ic(e,n,o){var i=e._id;return e.each(function(){var a=pn(this,i);(a.value||(a.value={}))[n]=o.apply(this,arguments)}),function(a){return on(a,i).value[n]}}function Fh(e,n){var o;return(typeof n=="number"?Wn:n instanceof Yi?xh:(o=Yi(n))?(n=o,xh):R$)(e,n)}function W$(e){return function(){this.removeAttribute(e)}}function J$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function X$(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 Z$(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 Q$(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 eT(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 tT(e,n){var o=wr(e),i=o==="transform"?M$:Fh;return this.attrTween(e,typeof n=="function"?(o.local?eT:Q$)(o,i,ic(this,"attr."+e,n)):n==null?(o.local?J$:W$)(o):(o.local?Z$:X$)(o,i,n))}function nT(e,n){return function(o){this.setAttribute(e,n.call(this,o))}}function oT(e,n){return function(o){this.setAttributeNS(e.space,e.local,n.call(this,o))}}function iT(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&oT(e,r)),o}return a._value=n,a}function aT(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&nT(e,r)),o}return a._value=n,a}function rT(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=wr(e);return this.tween(o,(i.local?iT:aT)(i,n))}function lT(e,n){return function(){oc(this,e).delay=+n.apply(this,arguments)}}function sT(e,n){return n=+n,function(){oc(this,e).delay=n}}function cT(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?lT:sT)(n,e)):on(this.node(),n).delay}function dT(e,n){return function(){pn(this,e).duration=+n.apply(this,arguments)}}function uT(e,n){return n=+n,function(){pn(this,e).duration=n}}function mT(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?dT:uT)(n,e)):on(this.node(),n).duration}function fT(e,n){if(typeof n!="function")throw new Error;return function(){pn(this,e).ease=n}}function pT(e){var n=this._id;return arguments.length?this.each(fT(n,e)):on(this.node(),n).ease}function hT(e,n){return function(){var o=n.apply(this,arguments);if(typeof o!="function")throw new Error;pn(this,e).ease=o}}function yT(e){if(typeof e!="function")throw new Error;return this.each(hT(this._id,e))}function gT(e){typeof e!="function"&&(e=rh(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 An(i,this._parents,this._name,this._id)}function bT(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),p,f=0;f<u;++f)(p=c[f]||d[f])&&(m[f]=p);for(;s<i;++s)l[s]=n[s];return new An(l,this._parents,this._name,this._id)}function _T(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 kT(e,n,o){var i,a,r=_T(n)?oc:pn;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(n,o),l.on=a}}function ET(e,n){var o=this._id;return arguments.length<2?on(this.node(),o).on.on(e):this.each(kT(o,e,n))}function NT(e){return function(){var n=this.parentNode;for(var o in this.__transition)if(+o!==e)return;n&&n.removeChild(this)}}function wT(){return this.on("end.remove",NT(this._id))}function IT(e){var n=this._name,o=this._id;typeof e!="function"&&(e=Hs(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,p=0;p<c;++p)(u=s[p])&&(m=e.call(u,u.__data__,p,s))&&("__data__"in u&&(m.__data__=u.__data__),d[p]=m,Dr(d[p],n,o,p,d,on(u,o)));return new An(r,this._parents,n,o)}function vT(e){var n=this._name,o=this._id;typeof e!="function"&&(e=ah(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 p=e.call(u,u.__data__,m,c),f,h=on(u,o),g=0,b=p.length;g<b;++g)(f=p[g])&&Dr(f,n,o,g,p,h);r.push(p),l.push(u)}return new An(r,l,n,o)}var CT=Hi.prototype.constructor;function ST(){return new CT(this._groups,this._parents)}function xT(e,n){var o,i,a;return function(){var r=oi(this,e),l=(this.style.removeProperty(e),oi(this,e));return r===l?null:r===o&&l===i?a:a=n(o=r,i=l)}}function Uh(e){return function(){this.style.removeProperty(e)}}function RT(e,n,o){var i,a=o+"",r;return function(){var l=oi(this,e);return l===a?null:l===i?r:r=n(i=l,o)}}function AT(e,n,o){var i,a,r;return function(){var l=oi(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),oi(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s))}}function $T(e,n){var o,i,a,r="style."+n,l="end."+r,s;return function(){var c=pn(this,e),d=c.on,u=c.value[r]==null?s||(s=Uh(n)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function TT(e,n,o){var i=(e+="")=="transform"?T$:Fh;return n==null?this.styleTween(e,xT(e,i)).on("end.style."+e,Uh(e)):typeof n=="function"?this.styleTween(e,AT(e,i,ic(this,"style."+e,n))).each($T(this._id,e)):this.styleTween(e,RT(e,i,n),o).on("end.style."+e,null)}function MT(e,n,o){return function(i){this.style.setProperty(e,n.call(this,i),o)}}function VT(e,n,o){var i,a;function r(){var l=n.apply(this,arguments);return l!==a&&(i=(a=l)&&MT(e,l,o)),i}return r._value=n,r}function BT(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,VT(e,n,o??""))}function DT(e){return function(){this.textContent=e}}function OT(e){return function(){var n=e(this);this.textContent=n??""}}function LT(e){return this.tween("text",typeof e=="function"?OT(ic(this,"text",e)):DT(e==null?"":e+""))}function PT(e){return function(n){this.textContent=e.call(this,n)}}function zT(e){var n,o;function i(){var a=e.apply(this,arguments);return a!==o&&(n=(o=a)&&PT(a)),n}return i._value=e,i}function FT(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,zT(e))}function UT(){for(var e=this._name,n=this._id,o=Hh(),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=on(c,n);Dr(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new An(i,this._parents,e,o)}function HT(){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=pn(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 jT=0;function An(e,n,o,i){this._groups=e,this._parents=n,this._name=o,this._id=i}function Hh(){return++jT}var $n=Hi.prototype;An.prototype={constructor:An,select:IT,selectAll:vT,selectChild:$n.selectChild,selectChildren:$n.selectChildren,filter:gT,merge:bT,selection:ST,transition:UT,call:$n.call,nodes:$n.nodes,node:$n.node,size:$n.size,empty:$n.empty,each:$n.each,on:ET,attr:tT,attrTween:rT,style:TT,styleTween:BT,text:LT,textTween:FT,remove:wT,tween:q$,delay:cT,duration:mT,ease:pT,easeVarying:yT,end:HT,[Symbol.iterator]:$n[Symbol.iterator]};function KT(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var GT={time:null,delay:0,duration:250,ease:KT};function YT(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 qT(e){var n,o;e instanceof An?(n=e._id,e=e._name):(n=Hh(),(o=GT).time=Qs(),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])&&Dr(c,e,n,d,l,o||YT(c,n));return new An(i,this._parents,e,n)}Hi.prototype.interrupt=K$,Hi.prototype.transition=qT;const Lr=e=>()=>e;function WT(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 Tn(e,n,o){this.k=e,this.x=n,this.y=o}Tn.prototype={constructor:Tn,scale:function(e){return e===1?this:new Tn(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Tn(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 Tn(1,0,0);Tn.prototype;function rc(e){e.stopImmediatePropagation()}function Zi(e){e.preventDefault(),e.stopImmediatePropagation()}function JT(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function XT(){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 jh(){return this.__zoom||ac}function ZT(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function QT(){return navigator.maxTouchPoints||"ontouchstart"in this}function eM(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 tM(){var e=JT,n=XT,o=eM,i=ZT,a=QT,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=O$,d=Fs("start","zoom","end"),u,m,p,f=500,h=150,g=0,b=10;function _(w){w.property("__zoom",jh).on("wheel.zoom",V,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",O).filter(a).on("touchstart.zoom",C).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(w,I,v,B){var M=w.selection?w.selection():w;M.property("__zoom",jh),w!==M?E(w,I,v,B):M.interrupt().each(function(){S(this,arguments).event(B).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},_.scaleBy=function(w,I,v,B){_.scaleTo(w,function(){var M=this.__zoom.k,x=typeof I=="function"?I.apply(this,arguments):I;return M*x},v,B)},_.scaleTo=function(w,I,v,B){_.transform(w,function(){var M=n.apply(this,arguments),x=this.__zoom,P=v==null?y(M):typeof v=="function"?v.apply(this,arguments):v,Y=x.invert(P),se=typeof I=="function"?I.apply(this,arguments):I;return o(N(k(x,se),P,Y),M,l)},v,B)},_.translateBy=function(w,I,v,B){_.transform(w,function(){return o(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof v=="function"?v.apply(this,arguments):v),n.apply(this,arguments),l)},null,B)},_.translateTo=function(w,I,v,B,M){_.transform(w,function(){var x=n.apply(this,arguments),P=this.__zoom,Y=B==null?y(x):typeof B=="function"?B.apply(this,arguments):B;return o(ac.translate(Y[0],Y[1]).scale(P.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof v=="function"?-v.apply(this,arguments):-v),x,l)},B,M)};function k(w,I){return I=Math.max(r[0],Math.min(r[1],I)),I===w.k?w:new Tn(I,w.x,w.y)}function N(w,I,v){var B=I[0]-v[0]*w.k,M=I[1]-v[1]*w.k;return B===w.x&&M===w.y?w:new Tn(w.k,B,M)}function y(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function E(w,I,v,B){w.on("start.zoom",function(){S(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(B).end()}).tween("zoom",function(){var M=this,x=arguments,P=S(M,x).event(B),Y=n.apply(M,x),se=v==null?y(Y):typeof v=="function"?v.apply(M,x):v,he=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),ie=M.__zoom,fe=typeof I=="function"?I.apply(M,x):I,pe=c(ie.invert(se).concat(he/ie.k),fe.invert(se).concat(he/fe.k));return function(ge){if(ge===1)ge=fe;else{var Te=pe(ge),He=he/Te[2];ge=new Tn(He,se[0]-Te[0]*He,se[1]-Te[1]*He)}P.zoom(null,ge)}})}function S(w,I,v){return!v&&w.__zooming||new A(w,I)}function A(w,I){this.that=w,this.args=I,this.active=0,this.sourceEvent=null,this.extent=n.apply(w,I),this.taps=0}A.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,I){return this.mouse&&w!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var I=Yn(this.that).datum();d.call(w,this.that,new WT(w,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),I)}};function V(w,...I){if(!e.apply(this,arguments))return;var v=S(this,I).event(w),B=this.__zoom,M=Math.max(r[0],Math.min(r[1],B.k*Math.pow(2,i.apply(this,arguments)))),x=qn(w);if(v.wheel)(v.mouse[0][0]!==x[0]||v.mouse[0][1]!==x[1])&&(v.mouse[1]=B.invert(v.mouse[0]=x)),clearTimeout(v.wheel);else{if(B.k===M)return;v.mouse=[x,B.invert(x)],Or(this),v.start()}Zi(w),v.wheel=setTimeout(P,h),v.zoom("mouse",o(N(k(B,M),v.mouse[0],v.mouse[1]),v.extent,l));function P(){v.wheel=null,v.end()}}function $(w,...I){if(p||!e.apply(this,arguments))return;var v=w.currentTarget,B=S(this,I,!0).event(w),M=Yn(w.view).on("mousemove.zoom",se,!0).on("mouseup.zoom",he,!0),x=qn(w,v),P=w.clientX,Y=w.clientY;d$(w.view),rc(w),B.mouse=[x,this.__zoom.invert(x)],Or(this),B.start();function se(ie){if(Zi(ie),!B.moved){var fe=ie.clientX-P,pe=ie.clientY-Y;B.moved=fe*fe+pe*pe>g}B.event(ie).zoom("mouse",o(N(B.that.__zoom,B.mouse[0]=qn(ie,v),B.mouse[1]),B.extent,l))}function he(ie){M.on("mousemove.zoom mouseup.zoom",null),u$(ie.view,B.moved),Zi(ie),B.event(ie).end()}}function O(w,...I){if(e.apply(this,arguments)){var v=this.__zoom,B=qn(w.changedTouches?w.changedTouches[0]:w,this),M=v.invert(B),x=v.k*(w.shiftKey?.5:2),P=o(N(k(v,x),B,M),n.apply(this,I),l);Zi(w),s>0?Yn(this).transition().duration(s).call(E,P,B,w):Yn(this).call(_.transform,P,B,w)}}function C(w,...I){if(e.apply(this,arguments)){var v=w.touches,B=v.length,M=S(this,I,w.changedTouches.length===B).event(w),x,P,Y,se;for(rc(w),P=0;P<B;++P)Y=v[P],se=qn(Y,this),se=[se,this.__zoom.invert(se),Y.identifier],M.touch0?!M.touch1&&M.touch0[2]!==se[2]&&(M.touch1=se,M.taps=0):(M.touch0=se,x=!0,M.taps=1+!!u);u&&(u=clearTimeout(u)),x&&(M.taps<2&&(m=se[0],u=setTimeout(function(){u=null},f)),Or(this),M.start())}}function R(w,...I){if(this.__zooming){var v=S(this,I).event(w),B=w.changedTouches,M=B.length,x,P,Y,se;for(Zi(w),x=0;x<M;++x)P=B[x],Y=qn(P,this),v.touch0&&v.touch0[2]===P.identifier?v.touch0[0]=Y:v.touch1&&v.touch1[2]===P.identifier&&(v.touch1[0]=Y);if(P=v.that.__zoom,v.touch1){var he=v.touch0[0],ie=v.touch0[1],fe=v.touch1[0],pe=v.touch1[1],ge=(ge=fe[0]-he[0])*ge+(ge=fe[1]-he[1])*ge,Te=(Te=pe[0]-ie[0])*Te+(Te=pe[1]-ie[1])*Te;P=k(P,Math.sqrt(ge/Te)),Y=[(he[0]+fe[0])/2,(he[1]+fe[1])/2],se=[(ie[0]+pe[0])/2,(ie[1]+pe[1])/2]}else if(v.touch0)Y=v.touch0[0],se=v.touch0[1];else return;v.zoom("touch",o(N(P,Y,se),v.extent,l))}}function T(w,...I){if(this.__zooming){var v=S(this,I).event(w),B=w.changedTouches,M=B.length,x,P;for(rc(w),p&&clearTimeout(p),p=setTimeout(function(){p=null},f),x=0;x<M;++x)P=B[x],v.touch0&&v.touch0[2]===P.identifier?delete v.touch0:v.touch1&&v.touch1[2]===P.identifier&&delete v.touch1;if(v.touch1&&!v.touch0&&(v.touch0=v.touch1,delete v.touch1),v.touch0)v.touch0[1]=this.__zoom.invert(v.touch0[0]);else if(v.end(),v.taps===2&&(P=qn(P,this),Math.hypot(m[0]-P[0],m[1]-P[1])<b)){var Y=Yn(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return _.wheelDelta=function(w){return arguments.length?(i=typeof w=="function"?w:Lr(+w),_):i},_.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Lr(!!w),_):e},_.touchable=function(w){return arguments.length?(a=typeof w=="function"?w:Lr(!!w),_):a},_.extent=function(w){return arguments.length?(n=typeof w=="function"?w:Lr([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),_):n},_.scaleExtent=function(w){return arguments.length?(r[0]=+w[0],r[1]=+w[1],_):[r[0],r[1]]},_.translateExtent=function(w){return arguments.length?(l[0][0]=+w[0][0],l[1][0]=+w[1][0],l[0][1]=+w[0][1],l[1][1]=+w[1][1],_):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},_.constrain=function(w){return arguments.length?(o=w,_):o},_.duration=function(w){return arguments.length?(s=+w,_):s},_.interpolate=function(w){return arguments.length?(c=w,_):c},_.on=function(){var w=d.on.apply(d,arguments);return w===d?_:w},_.clickDistance=function(w){return arguments.length?(g=(w=+w)*w,_):Math.sqrt(g)},_.tapDistance=function(w){return arguments.length?(b=+w,_):b},_}const Kh=Symbol("MiniMapSlots"),nM=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],oM={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},iM=t.defineComponent({...oM,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(Kh),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,p)=>!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,nM))],64)):t.createCommentVNode("",!0)}}),aM=["width","height","viewBox","aria-labelledby"],rM=["id"],lM=["d","fill","stroke","stroke-width"],sM={name:"MiniMap",compatConfig:{MODE:3}},cM=t.defineComponent({...sM,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:p,d3Zoom:f,getNodesInitialized:h}=tt(),g=t.ref();t.provide(Kh,o);const b=t.toRef(()=>{var M;return e.width??((M=i.style)==null?void 0:M.width)??a}),_=t.toRef(()=>{var M;return e.height??((M=i.style)==null?void 0:M.height)??r}),k=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",N=t.computed(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),y=t.computed(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),E=t.computed(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),S=t.computed(()=>ys(h.value.filter(M=>!M.hidden))),A=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})),V=t.computed(()=>h.value&&h.value.length?mN(S.value,A.value):A.value),$=t.computed(()=>{const M=V.value.width/b.value,x=V.value.height/_.value;return Math.max(M,x)}),O=t.computed(()=>{const M=$.value*b.value,x=$.value*_.value,P=e.offsetScale*$.value;return{offset:P,x:V.value.x-(M-V.value.width)/2-P,y:V.value.y-(x-V.value.height)/2-P,width:M+P*2,height:x+P*2}}),C=t.computed(()=>!O.value.x||!O.value.y?"":`
52
+ 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 wt extends Error{constructor(n,...o){var i;super((i=Cf[n])==null?void 0:i.call(Cf,...o)),this.name="VueFlowError",this.code=n,this.args=o}}function Es(e){return"clientX"in e}function wN(e){return"sourceEvent"in e}function mn(e,n){const o=Es(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 zi=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function IN(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 ar(e,n=[1,1]){return{x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}}const vN=()=>!0;function Ns(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function CN(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())tr(a,er(r))>0&&i.push(r);return i}const SN=250;function xN(e,n,o,i){var a,r;let l=[],s=Number.POSITIVE_INFINITY;const c=CN(e,o,n+SN);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:p,y:f}=Qo(d,m,m.position,!0),h=Math.sqrt((p-e.x)**2+(f-e.y)**2);h>n||(h<s?(l=[{...m,x:p,y:f}],s=h):h===s&&l.push({...m,x:p,y:f}))}}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 Sf(e,{handle:n,connectionMode:o,fromNodeId:i,fromHandleId:a,fromType:r,doc:l,lib:s,flowId:c,isValidConnection:d=vN},u,m,p,f){const h=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:_}=mn(e),k=l.elementFromPoint(b,_),N=k!=null&&k.classList.contains(`${s}-flow__handle`)?k:g,y={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const E=xf(void 0,N),S=N.getAttribute("data-nodeid"),A=N.getAttribute("data-handleid"),V=N.classList.contains("connectable"),$=N.classList.contains("connectableend");if(!S||!E)return y;const O={source:h?S:i,sourceHandle:h?A:a,target:h?i:S,targetHandle:h?a:A};y.connection=O;const R=V&&$&&(o===Sn.Strict?h&&E==="source"||!h&&E==="target":S!==i||A!==a);y.isValid=R&&d(O,{nodes:m,edges:u,sourceNode:p(O.source),targetNode:p(O.target)}),y.toHandle=Rf(S,E,A,f,o,!0)}return y}function xf(e,n){return e||(n!=null&&n.classList.contains("target")?"target":n!=null&&n.classList.contains("source")?"source":null)}function RN(e,n){let o=null;return n?o="valid":e&&!n&&(o="invalid"),o}function AN(e,n){let o=null;return n?o=!0:e&&!n&&(o=!1),o}function Rf(e,n,o,i,a,r=!1){var l,s,c;const d=i.get(e);if(!d)return null;const u=a===Sn.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(p=>p.id===o):u==null?void 0:u[0])??null;return m&&r?{...m,...Qo(d,m,m.position,!0)}:m}const ws={[Oe.Left]:Oe.Right,[Oe.Right]:Oe.Left,[Oe.Top]:Oe.Bottom,[Oe.Bottom]:Oe.Top},$N=["production","prod"];function Fi(e,...n){Af()&&console.warn(`[Vue Flow]: ${e}`,...n)}function Af(){return!$N.includes(process.env.NODE_ENV||"")}function $f(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 Is(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 TN(e,n,o,i){if(!e||!e.source||!e.target)return o(new wt(kt.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let a;return Un(e)?a=e:a={...e,id:df(e)},a=sf(a,void 0,i),mN(a,n)?!1:a}function MN(e,n,o,i,a){if(!n.source||!n.target)return a(new wt(kt.EDGE_INVALID,e.id)),!1;if(!o)return a(new wt(kt.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...l}=e;return{...l,id:i?df(n):r,source:n.source,target:n.target,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle}}function Tf(e,n,o){const i={},a=[];for(let r=0;r<e.length;++r){const l=e[r];if(!_o(l)){o(new wt(kt.NODE_INVALID,l==null?void 0:l.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const s=cN(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 wt(kt.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 Mf(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 vs(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}`;Mf("source",c,u,e,a,l),Mf("target",c,d,e,r,s)}}function Vf(e,n){if(e.size!==n.size)return!1;for(const o of e)if(!n.has(o))return!1;return!0}function Cs(e,n,o,i,a,r,l,s){const c=[];for(const d of e){const u=Un(d)?d:TN(d,s,a,r);if(!u)continue;const m=o(u.source),p=o(u.target);if(!m||!p){a(new wt(kt.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!m){a(new wt(kt.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!p){a(new wt(kt.EDGE_TARGET_MISSING,u.id,u.target));continue}if(n&&!n(u,{edges:s,nodes:l,sourceNode:m,targetNode:p})){a(new wt(kt.EDGE_INVALID,u.id));continue}const f=i(u.id);c.push({...sf(u,f,r),sourceNode:m,targetNode:p})}return c}const Bf=Symbol("vueFlow"),Df=Symbol("nodeId"),Of=Symbol("nodeRef"),VN=Symbol("edgeId"),BN=Symbol("edgeRef"),rr=Symbol("slots");function Lf(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:p,findNode:f,multiSelectionActive:h,nodesSelectionActive:g,selectNodesOnDrag:b,removeSelectedElements:_,addSelectedNodes:k,updateNodePositions:N,emits:y}=tt(),{onStart:E,onDrag:S,onStop:A,onClick:V,el:$,disabled:O,id:C,selectable:R,dragHandle:T}=e,w=t.shallowRef(!1);let I=[],v,B=null,M={x:void 0,y:void 0},x={x:0,y:0},P=null,Y=!1,se=!1,he=0,ie=!1;const fe=LN(),pe=({x:re,y:ue})=>{M={x:re,y:ue};let z=!1;if(I=I.map(L=>{const F={x:re-L.distance.x,y:ue-L.distance.y},{computedPosition:X}=ks(L,o.value?ar(F,i.value):F,y.error,l.value,L.parentNode?f(L.parentNode):void 0);return z=z||L.position.x!==X.x||L.position.y!==X.y,L.position=X,L}),se=se||z,!!z&&(N(I,!0,!0),w.value=!0,P)){const[L,F]=_s({id:C,dragItems:I,findNode:f});S({event:P,node:L,nodes:F})}},ge=()=>{if(!B)return;const[re,ue]=gf(x,B,u.value);if(re!==0||ue!==0){const z={x:(M.x??0)-re/c.value.zoom,y:(M.y??0)-ue/c.value.zoom};p({x:re,y:ue})&&pe(z)}he=requestAnimationFrame(ge)},Te=(re,ue)=>{Y=!0;const z=f(C);!b.value&&!h.value&&z&&(z.selected||_()),z&&t.toValue(R)&&b.value&&Is(z,h.value,k,_,g,!1,ue);const L=fe(re.sourceEvent);if(M=L,I=gN(r.value,m.value,L,C),I.length){const[F,X]=_s({id:C,dragItems:I,findNode:f});E({event:re.sourceEvent,node:F,nodes:X})}},He=(re,ue)=>{var z;re.sourceEvent.type==="touchmove"&&re.sourceEvent.touches.length>1||(se=!1,s.value===0&&Te(re,ue),M=fe(re.sourceEvent),B=((z=n.value)==null?void 0:z.getBoundingClientRect())||null,x=mn(re.sourceEvent,B))},De=(re,ue)=>{const z=fe(re.sourceEvent);if(!ie&&Y&&d.value&&(ie=!0,ge()),!Y){const L=z.xSnapped-(M.x??0),F=z.ySnapped-(M.y??0);Math.sqrt(L*L+F*F)>s.value&&Te(re,ue)}(M.x!==z.xSnapped||M.y!==z.ySnapped)&&I.length&&Y&&(P=re.sourceEvent,x=mn(re.sourceEvent,B),pe(z))},Z=re=>{let ue=!1;if(!Y&&!w.value&&!h.value){const z=re.sourceEvent,L=fe(z),F=L.xSnapped-(M.x??0),X=L.ySnapped-(M.y??0),ee=Math.sqrt(F*F+X*X);ee!==0&&ee<=s.value&&(V==null||V(z),ue=!0)}if(I.length&&!ue){se&&(N(I,!1,!1),se=!1);const[z,L]=_s({id:C,dragItems:I,findNode:f});A({event:re.sourceEvent,node:z,nodes:L})}I=[],w.value=!1,ie=!1,Y=!1,M={x:void 0,y:void 0},cancelAnimationFrame(he)};return t.watch([()=>t.toValue(O),$],([re,ue],z,L)=>{if(ue){const F=Jt(ue);re||(v=s1().on("start",X=>He(X,ue)).on("drag",X=>De(X,ue)).on("end",X=>Z(X)).filter(X=>{const ee=X.target,ke=t.toValue(T);return!X.button&&(!a.value||!wf(ee,`.${a.value}`,ue)&&(!ke||wf(ee,ke,ue)))}),F.call(v)),L(()=>{F.on(".drag",null),v&&(v.on("start",null),v.on("drag",null),v.on("end",null))})}}),w}function DN(){return{doubleClick:Me(),click:Me(),mouseEnter:Me(),mouseMove:Me(),mouseLeave:Me(),contextMenu:Me(),updateStart:Me(),update:Me(),updateEnd:Me()}}function ON(e,n){const o=DN();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 LN(){const{viewport:e,snapGrid:n,snapToGrid:o,vueFlowRef:i}=tt();return a=>{var r;const l=((r=i.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},s=wN(a)?a.sourceEvent:a,{x:c,y:d}=mn(s,l),u=Li({x:c,y:d},e.value),{x:m,y:p}=o.value?ar(u,n.value):u;return{xSnapped:m,ySnapped:p,...u}}}function lr(){return!0}function Pf({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:p,nodesConnectable:f,autoPanOnConnect:h,autoPanSpeed:g,findNode:b,panBy:_,startConnection:k,updateConnection:N,endConnection:y,emits:E,viewport:S,edges:A,nodes:V,isValidConnection:$,nodeLookup:O}=tt();let C=null,R=!1,T=null;function w(v){var B;const M=t.toValue(o)==="target",x=Es(v),P=lf(v.target),Y=v.currentTarget;if(Y&&(x&&v.button===0||!x)){let se=function(we){z=mn(we,Z),pe=xN(Li(z,S.value,!1,[1,1]),u.value,O.value,X),L||(F(),L=!0);const G=Sf(we,{handle:pe,connectionMode:d.value,fromNodeId:t.toValue(n),fromHandleId:t.toValue(e),fromType:M?"target":"source",isValidConnection:fe,doc:P,lib:"vue",flowId:s,nodeLookup:O.value},A.value,V.value,b,O.value);T=G.handleDomNode,C=G.connection,R=AN(!!pe,G.isValid);const q={...Ne,isValid:R,to:G.toHandle&&R?Oi({x:G.toHandle.x,y:G.toHandle.y},S.value):z,toHandle:G.toHandle,toPosition:R&&G.toHandle?G.toHandle.position:ws[X.position],toNode:G.toHandle?O.value.get(G.toHandle.nodeId):null};if(R&&pe&&(Ne!=null&&Ne.toHandle)&&q.toHandle&&Ne.toHandle.type===q.toHandle.type&&Ne.toHandle.nodeId===q.toHandle.nodeId&&Ne.toHandle.id===q.toHandle.id&&Ne.to.x===q.to.x&&Ne.to.y===q.to.y)return;const W=pe??G.toHandle;if(N(W&&R?Oi({x:W.x,y:W.y},S.value):z,W,RN(!!W,R)),Ne=q,!pe&&!R&&!T)return Ns(ue);C&&C.source!==C.target&&T&&(Ns(ue),ue=T,T.classList.add("connecting","vue-flow__handle-connecting"),T.classList.toggle("valid",!!R),T.classList.toggle("vue-flow__handle-valid",!!R))},he=function(we){"touches"in we&&we.touches.length>0||((pe||T)&&C&&R&&(r?r(we,C):E.connect(C)),E.connectEnd(we),a&&(l==null||l(we)),Ns(ue),cancelAnimationFrame(ge),y(we),L=!1,R=!1,C=null,T=null,P.removeEventListener("mousemove",se),P.removeEventListener("mouseup",he),P.removeEventListener("touchmove",se),P.removeEventListener("touchend",he))};const ie=b(t.toValue(n));let fe=t.toValue(i)||$.value||lr;!fe&&ie&&(fe=(M?ie.isValidSourcePos:ie.isValidTargetPos)||lr);let pe,ge=0;const{x:Te,y:He}=mn(v),De=xf(t.toValue(a),Y),Z=(B=c.value)==null?void 0:B.getBoundingClientRect();if(!Z||!De)return;const re=Rf(t.toValue(n),De,t.toValue(e),O.value,d.value);if(!re)return;let ue,z=mn(v,Z),L=!1;const F=()=>{if(!h.value)return;const[we,G]=gf(z,Z,g.value);_({x:we,y:G}),ge=requestAnimationFrame(F)},X={...re,nodeId:t.toValue(n),type:De,position:re.position},ee=O.value.get(t.toValue(n)),ye={inProgress:!0,isValid:null,from:Qo(ee,X,Oe.Left,!0),fromHandle:X,fromPosition:X.position,fromNode:ee,to:z,toHandle:null,toPosition:ws[X.position],toNode:null};k({nodeId:t.toValue(n),id:t.toValue(e),type:De,position:(Y==null?void 0:Y.getAttribute("data-handlepos"))||Oe.Top,...z},{x:Te-Z.left,y:He-Z.top}),E.connectStart({event:v,nodeId:t.toValue(n),handleId:t.toValue(e),handleType:De});let Ne=ye;P.addEventListener("mousemove",se),P.addEventListener("mouseup",he),P.addEventListener("touchmove",se),P.addEventListener("touchend",he)}}function I(v){var B,M;if(!m.value)return;const x=t.toValue(o)==="target";if(!p.value){E.clickConnectStart({event:v,nodeId:t.toValue(n),handleId:t.toValue(e)}),k({nodeId:t.toValue(n),type:t.toValue(o),id:t.toValue(e),position:Oe.Top,...mn(v)},void 0,!0);return}let P=t.toValue(i)||$.value||lr;const Y=b(t.toValue(n));if(!P&&Y&&(P=(x?Y.isValidSourcePos:Y.isValidTargetPos)||lr),Y&&(typeof Y.connectable>"u"?f.value:Y.connectable)===!1)return;const se=lf(v.target),he=Sf(v,{handle:{nodeId:t.toValue(n),id:t.toValue(e),type:t.toValue(o),position:Oe.Top,...mn(v)},connectionMode:d.value,fromNodeId:p.value.nodeId,fromHandleId:p.value.id??null,fromType:p.value.type,isValidConnection:P,doc:se,lib:"vue",flowId:s,nodeLookup:O.value},A.value,V.value,b,O.value),ie=((B=he.connection)==null?void 0:B.source)===((M=he.connection)==null?void 0:M.target);he.isValid&&he.connection&&!ie&&E.connect(he.connection),E.clickConnectEnd(v),y(v,!0)}return{handlePointerDown:w,handleClick:I}}function PN(){return t.inject(Df,"")}function zf(e){const n=e??PN()??"",o=t.inject(Of,t.ref(null)),{findNode:i,edges:a,emits:r}=tt(),l=i(n);return l||r.error(new wt(kt.NODE_NOT_FOUND,n)),{id:n,nodeEl:o,node:l,parentNode:t.computed(()=>i(l.parentNode)),connectedEdges:t.computed(()=>ko([l],a.value))}}function zN(){return{doubleClick:Me(),click:Me(),mouseEnter:Me(),mouseMove:Me(),mouseLeave:Me(),contextMenu:Me(),dragStart:Me(),drag:Me(),dragStop:Me()}}function FN(e,n){const o=zN();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 Ff(){const{getSelectedNodes:e,nodeExtent:n,updateNodePositions:o,findNode:i,snapGrid:a,snapToGrid:r,nodesDraggable:l,emits:s}=tt();return(c,d=!1)=>{const u=r.value?a.value[0]:5,m=r.value?a.value[1]:5,p=d?4:1,f=c.x*u*p,h=c.y*m*p,g=[];for(const b of e.value)if(b.draggable||l&&typeof b.draggable>"u"){const _={x:b.computedPosition.x+f,y:b.computedPosition.y+h},{position:k}=ks(b,_,s.error,n.value,b.parentNode?i(b.parentNode):void 0);g.push({id:b.id,position:k,from:b.position,distance:{x:c.x,y:c.y},dimensions:b.dimensions})}o(g,!0,!1)}}const sr=.1,UN=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function Kn(){return Fi("Viewport not initialized yet."),Promise.resolve(!1)}const HN={zoomIn:Kn,zoomOut:Kn,zoomTo:Kn,fitView:Kn,setCenter:Kn,fitBounds:Kn,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:Kn,setTransform:Kn,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function jN(e){function n(i,a){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((a==null?void 0:a.interpolate)==="linear"?xi:ja).scaleBy(Ss(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}=rf({x:-i,y:-a},e.translateExtent),m=Jo.translate(-d,-u).scale(r);e.d3Selection&&e.d3Zoom?(c=e.d3Zoom)==null||c.interpolate((l==null?void 0:l.interpolate)==="linear"?xi:ja).transform(Ss(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"?xi:ja).scaleTo(Ss(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:sr,includeHiddenNodes:!1,duration:0})=>{var r,l;const s=[];for(const p of e.nodes)p.dimensions.width&&p.dimensions.height&&((a==null?void 0:a.includeHiddenNodes)||!p.hidden)&&(!((r=a.nodes)!=null&&r.length)||(l=a.nodes)!=null&&l.length&&a.nodes.includes(p.id))&&s.push(p);if(!s.length)return Promise.resolve(!1);const c=ys(s),{x:d,y:u,zoom:m}=pf(c,e.dimensions.width,e.dimensions.height,a.minZoom??e.minZoom,a.maxZoom??e.maxZoom,a.padding??sr);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:sr})=>{const{x:l,y:s,zoom:c}=pf(a,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding??sr);return o(l,s,c,r)},project:a=>Li(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 Li(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 Oi(s,e.viewport)}return{x:0,y:0}}}:HN)}function Ss(e,n=0,o=UN,i=()=>{}){const a=typeof n=="number"&&n>0;return a||i(),a?e.transition().duration(n).ease(o).on("end",i):e}function KN(e,n,o){const i=t.effectScope(!0);return i.run(()=>{const a=()=>{i.run(()=>{let g,b,_=!!(o.nodes.value.length||o.edges.value.length);g=Ko([e.modelValue,()=>{var k,N;return(N=(k=e.modelValue)==null?void 0:k.value)==null?void 0:N.length}],([k])=>{k&&Array.isArray(k)&&(b==null||b.pause(),o.setElements(k),!b&&!_&&k.length?_=!0:b==null||b.resume())}),b=Ko([o.nodes,o.edges,()=>o.edges.value.length,()=>o.nodes.value.length],([k,N])=>{var y;(y=e.modelValue)!=null&&y.value&&Array.isArray(e.modelValue.value)&&(g==null||g.pause(),e.modelValue.value=[...k,...N],t.nextTick(()=>{g==null||g.resume()}))},{immediate:_}),t.onScopeDispose(()=>{g==null||g.stop(),b==null||b.stop()})})},r=()=>{i.run(()=>{let g,b,_=!!o.nodes.value.length;g=Ko([e.nodes,()=>{var k,N;return(N=(k=e.nodes)==null?void 0:k.value)==null?void 0:N.length}],([k])=>{k&&Array.isArray(k)&&(b==null||b.pause(),o.setNodes(k),!b&&!_&&k.length?_=!0:b==null||b.resume())}),b=Ko([o.nodes,()=>o.nodes.value.length],([k])=>{var N;(N=e.nodes)!=null&&N.value&&Array.isArray(e.nodes.value)&&(g==null||g.pause(),e.nodes.value=[...k],t.nextTick(()=>{g==null||g.resume()}))},{immediate:_}),t.onScopeDispose(()=>{g==null||g.stop(),b==null||b.stop()})})},l=()=>{i.run(()=>{let g,b,_=!!o.edges.value.length;g=Ko([e.edges,()=>{var k,N;return(N=(k=e.edges)==null?void 0:k.value)==null?void 0:N.length}],([k])=>{k&&Array.isArray(k)&&(b==null||b.pause(),o.setEdges(k),!b&&!_&&k.length?_=!0:b==null||b.resume())}),b=Ko([o.edges,()=>o.edges.value.length],([k])=>{var N;(N=e.edges)!=null&&N.value&&Array.isArray(e.edges.value)&&(g==null||g.pause(),e.edges.value=[...k],t.nextTick(()=>{g==null||g.resume()}))},{immediate:_}),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})})},p=()=>{i.run(()=>{const g=async b=>{let _=b;typeof n.autoConnect=="function"&&(_=await n.autoConnect(b)),_!==!1&&o.addEdges([_])};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),k(()=>{o.hooks.value.connect.off(g)})},{immediate:!0})})},f=()=>{const g=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const b of Object.keys(n)){const _=b;if(!g.includes(_)){const k=t.toRef(()=>n[_]),N=o[_];t.isRef(N)&&i.run(()=>{t.watch(k,y=>{Et(y)&&(N.value=y)},{immediate:!0})})}}};(()=>{a(),r(),l(),c(),s(),d(),u(),m(),p(),f()})()}),()=>i.stop()}function GN(){return{edgesChange:Me(),nodesChange:Me(),nodeDoubleClick:Me(),nodeClick:Me(),nodeMouseEnter:Me(),nodeMouseMove:Me(),nodeMouseLeave:Me(),nodeContextMenu:Me(),nodeDragStart:Me(),nodeDrag:Me(),nodeDragStop:Me(),nodesInitialized:Me(),miniMapNodeClick:Me(),miniMapNodeDoubleClick:Me(),miniMapNodeMouseEnter:Me(),miniMapNodeMouseMove:Me(),miniMapNodeMouseLeave:Me(),connect:Me(),connectStart:Me(),connectEnd:Me(),clickConnectStart:Me(),clickConnectEnd:Me(),paneReady:Me(),init:Me(),move:Me(),moveStart:Me(),moveEnd:Me(),selectionDragStart:Me(),selectionDrag:Me(),selectionDragStop:Me(),selectionContextMenu:Me(),selectionStart:Me(),selectionEnd:Me(),viewportChangeStart:Me(),viewportChange:Me(),viewportChangeEnd:Me(),paneScroll:Me(),paneClick:Me(),paneContextMenu:Me(),paneMouseEnter:Me(),paneMouseMove:Me(),paneMouseLeave:Me(),edgeContextMenu:Me(),edgeMouseEnter:Me(),edgeMouseMove:Me(),edgeMouseLeave:Me(),edgeDoubleClick:Me(),edgeClick:Me(),edgeUpdateStart:Me(),edgeUpdate:Me(),edgeUpdateEnd:Me(),updateNodeInternals:Me(),error:Me(e=>Fi(e.message))}}function YN(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),Ni(r.removeEmitter),r.setHasEmitListeners(()=>i(a)),Ni(r.removeHasEmitListeners)}});function i(a){var r;const l=qN(a);return!!((r=o==null?void 0:o.vnode.props)==null?void 0:r[l])}}function qN(e){const[n,...o]=e.split(":");return`on${n.replace(/(?:^|-)(\w)/g,(a,r)=>r.toUpperCase())}${o.length?`:${o.join(":")}`:""}`}function Uf(){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:fs.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Vi.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:go.Bezier,style:{}},connectionMode:Sn.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:zi()?"Meta":"Control",zoomActivationKeyCode:zi()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:GN(),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 WN=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function JN(e,n,o){const i=jN(e),a=z=>{const L=z??[];e.hooks.updateNodeInternals.trigger(L)},r=z=>uN(z,e.nodes,e.edges),l=z=>dN(z,e.nodes,e.edges),s=z=>ko(z,e.edges),c=({id:z,type:L,nodeId:F})=>{var X;const ee=z?`-${L}-${z}`:`-${L}`;return Array.from(((X=e.connectionLookup.get(`${F}${ee}`))==null?void 0:X.values())??[])},d=z=>{if(z)return n.value.get(z)},u=z=>{if(z)return o.value.get(z)},m=(z,L,F)=>{var X,ee;const ke=[];for(const ye of z){const Ne={id:ye.id,type:"position",dragging:F,from:ye.from};if(L&&(Ne.position=ye.position,ye.parentNode)){const we=d(ye.parentNode);Ne.position={x:Ne.position.x-(((X=we==null?void 0:we.computedPosition)==null?void 0:X.x)??0),y:Ne.position.y-(((ee=we==null?void 0:we.computedPosition)==null?void 0:ee.y)??0)}}ke.push(Ne)}ke!=null&&ke.length&&e.hooks.nodesChange.trigger(ke)},p=z=>{if(!e.vueFlowRef)return;const L=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!L)return;const F=window.getComputedStyle(L),{m22:X}=new window.DOMMatrixReadOnly(F.transform),ee=[];for(const ke of z){const ye=ke,Ne=d(ye.id);if(Ne){const we=nr(ye.nodeElement);if(!!(we.width&&we.height&&(Ne.dimensions.width!==we.width||Ne.dimensions.height!==we.height||ye.forceUpdate))){const q=ye.nodeElement.getBoundingClientRect();Ne.dimensions=we,Ne.handleBounds.source=$f("source",ye.nodeElement,q,X,Ne.id),Ne.handleBounds.target=$f("target",ye.nodeElement,q,X,Ne.id),ee.push({id:Ne.id,type:"dimensions",dimensions:we})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&i.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),ee.length&&e.hooks.nodesChange.trigger(ee)},f=(z,L)=>{const F=new Set,X=new Set;for(const ye of z)_o(ye)?F.add(ye.id):Un(ye)&&X.add(ye.id);const ee=jn(n.value,F,!0),ke=jn(o.value,X);if(e.multiSelectionActive){for(const ye of F)ee.push(Hn(ye,L));for(const ye of X)ke.push(Hn(ye,L))}ee.length&&e.hooks.nodesChange.trigger(ee),ke.length&&e.hooks.edgesChange.trigger(ke)},h=z=>{if(e.multiSelectionActive){const L=z.map(F=>Hn(F.id,!0));e.hooks.nodesChange.trigger(L);return}e.hooks.nodesChange.trigger(jn(n.value,new Set(z.map(L=>L.id)),!0)),e.hooks.edgesChange.trigger(jn(o.value))},g=z=>{if(e.multiSelectionActive){const L=z.map(F=>Hn(F.id,!0));e.hooks.edgesChange.trigger(L);return}e.hooks.edgesChange.trigger(jn(o.value,new Set(z.map(L=>L.id)))),e.hooks.nodesChange.trigger(jn(n.value,new Set,!0))},b=z=>{f(z,!0)},_=z=>{const F=(z||e.nodes).map(X=>(X.selected=!1,Hn(X.id,!1)));e.hooks.nodesChange.trigger(F)},k=z=>{const F=(z||e.edges).map(X=>(X.selected=!1,Hn(X.id,!1)));e.hooks.edgesChange.trigger(F)},N=z=>{if(!z||!z.length)return f([],!1);const L=z.reduce((F,X)=>{const ee=Hn(X.id,!1);return _o(X)?F.nodes.push(ee):F.edges.push(ee),F},{nodes:[],edges:[]});L.nodes.length&&e.hooks.nodesChange.trigger(L.nodes),L.edges.length&&e.hooks.edgesChange.trigger(L.edges)},y=z=>{var L;(L=e.d3Zoom)==null||L.scaleExtent([z,e.maxZoom]),e.minZoom=z},E=z=>{var L;(L=e.d3Zoom)==null||L.scaleExtent([e.minZoom,z]),e.maxZoom=z},S=z=>{var L;(L=e.d3Zoom)==null||L.translateExtent(z),e.translateExtent=z},A=z=>{e.nodeExtent=z,a()},V=z=>{var L;(L=e.d3Zoom)==null||L.clickDistance(z)},$=z=>{e.nodesDraggable=z,e.nodesConnectable=z,e.elementsSelectable=z},O=z=>{const L=z instanceof Function?z(e.nodes):z;!e.initialized&&!L.length||(e.nodes=Tf(L,d,e.hooks.error.trigger))},C=z=>{const L=z instanceof Function?z(e.edges):z;if(!e.initialized&&!L.length)return;const F=Cs(L,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);vs(e.connectionLookup,o.value,F),e.edges=F},R=z=>{const L=z instanceof Function?z([...e.nodes,...e.edges]):z;!e.initialized&&!L.length||(O(L.filter(_o)),C(L.filter(Un)))},T=z=>{let L=z instanceof Function?z(e.nodes):z;L=Array.isArray(L)?L:[L];const F=Tf(L,d,e.hooks.error.trigger),X=[];for(const ee of F)X.push(_f(ee));X.length&&e.hooks.nodesChange.trigger(X)},w=z=>{let L=z instanceof Function?z(e.edges):z;L=Array.isArray(L)?L:[L];const F=Cs(L,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),X=[];for(const ee of F)X.push(_f(ee));X.length&&e.hooks.edgesChange.trigger(X)},I=(z,L=!0,F=!1)=>{const X=z instanceof Function?z(e.nodes):z,ee=Array.isArray(X)?X:[X],ke=[],ye=[];function Ne(G){const q=s(G);for(const W of q)(!Et(W.deletable)||W.deletable)&&ye.push(Ef(W.id,W.source,W.target,W.sourceHandle,W.targetHandle))}function we(G){const q=[];for(const W of e.nodes)W.parentNode===G&&q.push(W);if(q.length){for(const W of q)ke.push(kf(W.id));L&&Ne(q);for(const W of q)we(W.id)}}for(const G of ee){const q=typeof G=="string"?d(G):G;q&&(Et(q.deletable)&&!q.deletable||(ke.push(kf(q.id)),L&&Ne([q]),F&&we(q.id)))}ye.length&&e.hooks.edgesChange.trigger(ye),ke.length&&e.hooks.nodesChange.trigger(ke)},v=z=>{const L=z instanceof Function?z(e.edges):z,F=Array.isArray(L)?L:[L],X=[];for(const ee of F){const ke=typeof ee=="string"?u(ee):ee;ke&&(Et(ke.deletable)&&!ke.deletable||X.push(Ef(typeof ee=="string"?ee:ee.id,ke.source,ke.target,ke.sourceHandle,ke.targetHandle)))}e.hooks.edgesChange.trigger(X)},B=(z,L,F=!0)=>{const X=u(z.id);if(!X)return!1;const ee=e.edges.indexOf(X),ke=MN(z,L,X,F,e.hooks.error.trigger);if(ke){const[ye]=Cs([ke],e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((Ne,we)=>we===ee?ye:Ne),vs(e.connectionLookup,o.value,[ye]),ye}return!1},M=(z,L,F={replace:!1})=>{const X=u(z);if(!X)return;const ee=typeof L=="function"?L(X):L;X.data=F.replace?ee:{...X.data,...ee}},x=z=>bf(z,e.nodes),P=z=>{const L=bf(z,e.edges);return vs(e.connectionLookup,o.value,L),L},Y=(z,L,F={replace:!1})=>{const X=d(z);if(!X)return;const ee=typeof L=="function"?L(X):L;F.replace?e.nodes.splice(e.nodes.indexOf(X),1,ee):Object.assign(X,ee)},se=(z,L,F={replace:!1})=>{const X=d(z);if(!X)return;const ee=typeof L=="function"?L(X):L;X.data=F.replace?ee:{...X.data,...ee}},he=(z,L,F=!1)=>{F?e.connectionClickStartHandle=z:e.connectionStartHandle=z,e.connectionEndHandle=null,e.connectionStatus=null,L&&(e.connectionPosition=L)},ie=(z,L=null,F=null)=>{e.connectionStartHandle&&(e.connectionPosition=z,e.connectionEndHandle=L,e.connectionStatus=F)},fe=(z,L)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,L?e.connectionClickStartHandle=null:e.connectionStartHandle=null},pe=z=>{const L=sN(z),F=L?null:Di(z)?z:d(z.id);return!L&&!F?[null,null,L]:[L?z:er(F),F,L]},ge=(z,L=!0,F=e.nodes)=>{const[X,ee,ke]=pe(z);if(!X)return[];const ye=[];for(const Ne of F||e.nodes){if(!ke&&(Ne.id===ee.id||!Ne.computedPosition))continue;const we=er(Ne),G=tr(we,X);(L&&G>0||G>=we.width*we.height||G>=Number(X.width)*Number(X.height))&&ye.push(Ne)}return ye},Te=(z,L,F=!0)=>{const[X]=pe(z);if(!X)return!1;const ee=tr(X,L);return F&&ee>0||ee>=Number(X.width)*Number(X.height)},He=z=>{const{viewport:L,dimensions:F,d3Zoom:X,d3Selection:ee,translateExtent:ke}=e;if(!X||!ee||!z.x&&!z.y)return!1;const ye=Jo.translate(L.x+z.x,L.y+z.y).scale(L.zoom),Ne=[[0,0],[F.width,F.height]],we=X.constrain()(ye,Ne,ke),G=e.viewport.x!==we.x||e.viewport.y!==we.y||e.viewport.zoom!==we.k;return X.transform(ee,we),G},De=z=>{const L=z instanceof Function?z(e):z,F=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Et(L.defaultEdgeOptions)&&(e.defaultEdgeOptions=L.defaultEdgeOptions);const X=L.modelValue||L.nodes||L.edges?[]:void 0;X&&(L.modelValue&&X.push(...L.modelValue),L.nodes&&X.push(...L.nodes),L.edges&&X.push(...L.edges),R(X));const ee=()=>{Et(L.maxZoom)&&E(L.maxZoom),Et(L.minZoom)&&y(L.minZoom),Et(L.translateExtent)&&S(L.translateExtent)};for(const ke of Object.keys(L)){const ye=ke,Ne=L[ye];![...WN,...F].includes(ye)&&Et(Ne)&&(e[ye]=Ne)}Gl(()=>e.d3Zoom).not.toBeNull().then(ee),e.initialized||(e.initialized=!0)};return{updateNodePositions:m,updateNodeDimensions:p,setElements:R,setNodes:O,setEdges:C,addNodes:T,addEdges:w,removeNodes:I,removeEdges:v,findNode:d,findEdge:u,updateEdge:B,updateEdgeData:M,updateNode:Y,updateNodeData:se,applyEdgeChanges:P,applyNodeChanges:x,addSelectedElements:b,addSelectedNodes:h,addSelectedEdges:g,setMinZoom:y,setMaxZoom:E,setTranslateExtent:S,setNodeExtent:A,setPaneClickDistance:V,removeSelectedElements:N,removeSelectedNodes:_,removeSelectedEdges:k,startConnection:he,updateConnection:ie,endConnection:fe,setInteractive:$,setState:De,getIntersectingNodes:ge,getIncomers:r,getOutgoers:l,getConnectedEdges:s,getHandleConnections:c,isNodeIntersecting:Te,panBy:He,fitView:z=>i.value.fitView(z),zoomIn:z=>i.value.zoomIn(z),zoomOut:z=>i.value.zoomOut(z),zoomTo:(z,L)=>i.value.zoomTo(z,L),setViewport:(z,L)=>i.value.setViewport(z,L),setTransform:(z,L)=>i.value.setTransform(z,L),getViewport:()=>i.value.getViewport(),getTransform:()=>i.value.getTransform(),setCenter:(z,L,F)=>i.value.setCenter(z,L,F),fitBounds:(z,L)=>i.value.fitBounds(z,L),project:z=>i.value.project(z),screenToFlowCoordinate:z=>i.value.screenToFlowCoordinate(z),flowToScreenCoordinate:z=>i.value.flowToScreenCoordinate(z),toObject:()=>{const z=[],L=[];for(const F of e.nodes){const{computedPosition:X,handleBounds:ee,selected:ke,dimensions:ye,isParent:Ne,resizing:we,dragging:G,events:q,...W}=F;z.push(W)}for(const F of e.edges){const{selected:X,sourceNode:ee,targetNode:ke,events:ye,...Ne}=F;L.push(Ne)}return JSON.parse(JSON.stringify({nodes:z,edges:L,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:z=>new Promise(L=>{const{nodes:F,edges:X,position:ee,zoom:ke,viewport:ye}=z;F&&O(F),X&&C(X);const[Ne,we]=ye!=null&&ye.x&&(ye!=null&&ye.y)?[ye.x,ye.y]:ee??[null,null];if(Ne&&we){const G=(ye==null?void 0:ye.zoom)||ke||e.viewport.zoom;return Gl(()=>i.value.viewportInitialized).toBe(!0).then(()=>{i.value.setViewport({x:Ne,y:we,zoom:G}).then(()=>{L(!0)})})}else L(!0)}),updateNodeInternals:a,viewportHelper:i,$reset:()=>{const z=Uf();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const L=Jo.translate(z.defaultViewport.x??0,z.defaultViewport.y??0).scale(bo(z.defaultViewport.zoom??1,z.minZoom,z.maxZoom)),F=e.viewportRef.getBoundingClientRect(),X=[[0,0],[F.width,F.height]],ee=e.d3Zoom.constrain()(L,X,z.translateExtent);e.d3Zoom.transform(e.d3Selection,ee)}De(z)},$destroy:()=>{}}}const XN=["data-id","data-handleid","data-nodeid","data-handlepos"],ZN={name:"Handle",compatConfig:{MODE:3}},Eo=t.defineComponent({...ZN,props:{id:{default:null},type:{},position:{default:()=>Oe.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:p}=tt(),{id:f,node:h,nodeEl:g,connectedEdges:b}=zf(),_=t.ref(),k=t.toRef(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),N=t.toRef(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),y=t.toRef(()=>{var C,R,T,w,I,v;return((C=l.value)==null?void 0:C.nodeId)===f&&((R=l.value)==null?void 0:R.id)===e.id&&((T=l.value)==null?void 0:T.type)===i.value||((w=c.value)==null?void 0:w.nodeId)===f&&((I=c.value)==null?void 0:I.id)===e.id&&((v=c.value)==null?void 0:v.type)===i.value}),E=t.toRef(()=>{var C,R,T;return((C=s.value)==null?void 0:C.nodeId)===f&&((R=s.value)==null?void 0:R.id)===e.id&&((T=s.value)==null?void 0:T.type)===i.value}),{handlePointerDown:S,handleClick:A}=Pf({nodeId:f,handleId:e.id,isValidConnection:a,type:i}),V=t.computed(()=>typeof e.connectable=="string"&&e.connectable==="single"?!b.value.some(C=>{const R=C[`${i.value}Handle`];return C[i.value]!==f?!1:R?R===e.id:!0}):typeof e.connectable=="number"?b.value.filter(C=>{const R=C[`${i.value}Handle`];return C[i.value]!==f?!1:R?R===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(h,b.value):Et(e.connectable)?e.connectable:u.value);t.onMounted(()=>{var C;if(!h.dimensions.width||!h.dimensions.height)return;const R=(C=h.handleBounds[i.value])==null?void 0:C.find(x=>x.id===e.id);if(!d.value||R)return;const T=d.value.querySelector(".vue-flow__transformationpane");if(!g.value||!_.value||!T||!e.id)return;const w=g.value.getBoundingClientRect(),I=_.value.getBoundingClientRect(),v=window.getComputedStyle(T),{m22:B}=new window.DOMMatrixReadOnly(v.transform),M={id:e.id,position:e.position,x:(I.left-w.left)/B,y:(I.top-w.top)/B,type:i.value,nodeId:f,...nr(_.value)};h.handleBounds[i.value]=[...h.handleBounds[i.value]??[],M]});function $(C){const R=Es(C);V.value&&k.value&&(R&&C.button===0||!R)&&S(C)}function O(C){!f||!s.value&&!k.value||V.value&&A(C)}return n({handleClick:A,handlePointerDown:S,onClick:O,onPointerDown:$}),(C,R)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"handle",ref:_,"data-id":`${t.unref(r)}-${t.unref(f)}-${e.id}-${i.value}`,"data-handleid":e.id,"data-nodeid":t.unref(f),"data-handlepos":C.position,class:t.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${C.position}`,`vue-flow__handle-${e.id}`,t.unref(m),t.unref(p),i.value,{connectable:V.value,connecting:E.value,connectablestart:k.value,connectableend:N.value,connectionindicator:V.value&&(k.value&&!y.value||N.value&&y.value)}]]),onMousedown:$,onTouchstartPassive:$,onClick:O},[t.renderSlot(C.$slots,"default",{id:C.id})],42,XN))}}),cr=function({sourcePosition:e=Oe.Bottom,targetPosition:n=Oe.Top,label:o,connectable:i=!0,isValidTargetPos:a,isValidSourcePos:r,data:l}){const s=l.label??o;return[t.h(Eo,{type:"target",position:n,connectable:i,isValidConnection:a}),typeof s!="string"&&s?t.h(s):t.h(t.Fragment,[s]),t.h(Eo,{type:"source",position:e,connectable:i,isValidConnection:r})]};cr.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],cr.inheritAttrs=!1,cr.compatConfig={MODE:3};const QN=cr,dr=function({targetPosition:e=Oe.Top,label:n,connectable:o=!0,isValidTargetPos:i,data:a}){const r=a.label??n;return[t.h(Eo,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof r!="string"&&r?t.h(r):t.h(t.Fragment,[r])]};dr.props=["targetPosition","label","isValidTargetPos","connectable","data"],dr.inheritAttrs=!1,dr.compatConfig={MODE:3};const ew=dr,ur=function({sourcePosition:e=Oe.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(Eo,{type:"source",position:e,connectable:o,isValidConnection:i})]};ur.props=["sourcePosition","label","isValidSourcePos","connectable","data"],ur.inheritAttrs=!1,ur.compatConfig={MODE:3};const tw=ur,nw=["transform"],ow=["width","height","x","y","rx","ry"],iw=["y"],aw={name:"EdgeText",compatConfig:{MODE:3}},rw=t.defineComponent({...aw,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,ow)):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,iw)],8,nw))}}),lw=["id","d","marker-end","marker-start"],sw=["d","stroke-width"],cw={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},mr=t.defineComponent({...cw,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,lw),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,sw)):t.createCommentVNode("",!0),l.label&&l.labelX&&l.labelY?(t.openBlock(),t.createBlock(rw,{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 Hf({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 jf({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 fr(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function Kf({pos:e,x1:n,y1:o,x2:i,y2:a,c:r}){let l,s;switch(e){case Oe.Left:l=n-fr(n-i,r),s=o;break;case Oe.Right:l=n+fr(i-n,r),s=o;break;case Oe.Top:l=n,s=o-fr(o-a,r);break;case Oe.Bottom:l=n,s=o+fr(a-o,r);break}return[l,s]}function Gf(e){const{sourceX:n,sourceY:o,sourcePosition:i=Oe.Bottom,targetX:a,targetY:r,targetPosition:l=Oe.Top,curvature:s=.25}=e,[c,d]=Kf({pos:i,x1:n,y1:o,x2:a,y2:r,c:s}),[u,m]=Kf({pos:l,x1:a,y1:r,x2:n,y2:o,c:s}),[p,f,h,g]=jf({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}`,p,f,h,g]}function Yf({pos:e,x1:n,y1:o,x2:i,y2:a}){let r,l;switch(e){case Oe.Left:case Oe.Right:r=.5*(n+i),l=o;break;case Oe.Top:case Oe.Bottom:r=n,l=.5*(o+a);break}return[r,l]}function qf(e){const{sourceX:n,sourceY:o,sourcePosition:i=Oe.Bottom,targetX:a,targetY:r,targetPosition:l=Oe.Top}=e,[s,c]=Yf({pos:i,x1:n,y1:o,x2:a,y2:r}),[d,u]=Yf({pos:l,x1:a,y1:r,x2:n,y2:o}),[m,p,f,h]=jf({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,p,f,h]}const Wf={[Oe.Left]:{x:-1,y:0},[Oe.Right]:{x:1,y:0},[Oe.Top]:{x:0,y:-1},[Oe.Bottom]:{x:0,y:1}};function dw({source:e,sourcePosition:n=Oe.Bottom,target:o}){return n===Oe.Left||n===Oe.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 Jf(e,n){return Math.sqrt((n.x-e.x)**2+(n.y-e.y)**2)}function uw({source:e,sourcePosition:n=Oe.Bottom,target:o,targetPosition:i=Oe.Top,center:a,offset:r}){const l=Wf[n],s=Wf[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=dw({source:c,sourcePosition:n,target:d}),m=u.x!==0?"x":"y",p=u[m];let f,h,g;const b={x:0,y:0},_={x:0,y:0},[k,N,y,E]=Hf({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(l[m]*s[m]===-1){h=a.x??k,g=a.y??N;const A=[{x:h,y:c.y},{x:h,y:d.y}],V=[{x:c.x,y:g},{x:d.x,y:g}];l[m]===p?f=m==="x"?A:V:f=m==="x"?V:A}else{const A=[{x:c.x,y:d.y}],V=[{x:d.x,y:c.y}];if(m==="x"?f=l.x===p?V:A:f=l.y===p?A:V,n===i){const T=Math.abs(e[m]-o[m]);if(T<=r){const w=Math.min(r-1,r-T);l[m]===p?b[m]=(c[m]>e[m]?-1:1)*w:_[m]=(d[m]>o[m]?-1:1)*w}}if(n!==i){const T=m==="x"?"y":"x",w=l[m]===s[T],I=c[T]>d[T],v=c[T]<d[T];(l[m]===1&&(!w&&I||w&&v)||l[m]!==1&&(!w&&v||w&&I))&&(f=m==="x"?A:V)}const $={x:c.x+b.x,y:c.y+b.y},O={x:d.x+_.x,y:d.y+_.y},C=Math.max(Math.abs($.x-f[0].x),Math.abs(O.x-f[0].x)),R=Math.max(Math.abs($.y-f[0].y),Math.abs(O.y-f[0].y));C>=R?(h=($.x+O.x)/2,g=f[0].y):(h=f[0].x,g=($.y+O.y)/2)}return[[e,{x:c.x+b.x,y:c.y+b.y},...f,{x:d.x+_.x,y:d.y+_.y},o],h,g,y,E]}function mw(e,n,o,i){const a=Math.min(Jf(e,n)/2,Jf(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=Oe.Bottom,targetX:a,targetY:r,targetPosition:l=Oe.Top,borderRadius:s=5,centerX:c,centerY:d,offset:u=20}=e,[m,p,f,h,g]=uw({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,N)=>{let y;return N>0&&N<m.length-1?y=mw(m[N-1],k,m[N+1],s):y=`${N===0?"M":"L"}${k.x} ${k.y}`,_+=y,_},""),p,f,h,g]}function fw(e){const{sourceX:n,sourceY:o,targetX:i,targetY:a}=e,[r,l,s,c]=Hf({sourceX:n,sourceY:o,targetX:i,targetY:a});return[`M ${n},${o}L ${i},${a}`,r,l,s,c]}const pw=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]=fw(e);return t.h(mr,{path:o,labelX:i,labelY:a,...n,...e})}}}),Xf=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??Oe.Bottom,targetPosition:e.targetPosition??Oe.Top});return t.h(mr,{path:o,labelX:i,labelY:a,...n,...e})}}}),hw=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(Xf,{...e,...n,borderRadius:0})}}),yw=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]=Gf({...e,sourcePosition:e.sourcePosition??Oe.Bottom,targetPosition:e.targetPosition??Oe.Top});return t.h(mr,{path:o,labelX:i,labelY:a,...n,...e})}}}),gw=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]=qf({...e,sourcePosition:e.sourcePosition??Oe.Bottom,targetPosition:e.targetPosition??Oe.Top});return t.h(mr,{path:o,labelX:i,labelY:a,...n,...e})}}}),bw={input:tw,default:QN,output:ew},_w={default:yw,straight:pw,step:hw,smoothstep:Xf,simplebezier:gw};function kw(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={..._w,...e.edgeTypes},b=Object.keys(g);for(const _ of e.edges)_.type&&!b.includes(_.type)&&(g[_.type]=_.type);return g}),l=t.computed(()=>{const g={...bw,...e.nodeTypes},b=Object.keys(g);for(const _ of e.nodes)_.type&&!b.includes(_.type)&&(g[_.type]=_.type);return g}),s=t.computed(()=>e.onlyRenderVisibleElements?ff(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 _=n.value.get(b.source),k=n.value.get(b.target);EN({sourcePos:_.computedPosition||{x:0,y:0},targetPos:k.computedPosition||{x:0,y:0},sourceWidth:_.dimensions.width,sourceHeight:_.dimensions.height,targetWidth:k.dimensions.width,targetHeight:k.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}),p=t.computed(()=>[...u.value,...m.value]),f=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}),h=t.computed(()=>s.value.length>0&&f.value.length===s.value.length);return{getNode:i,getEdge:a,getElements:d,getEdgeTypes:r,getNodeTypes:l,getEdges:c,getNodes:s,getSelectedElements:p,getSelectedNodes:u,getSelectedEdges:m,getNodesInitialized:f,areNodesInitialized:h}}class No{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)??No.instance;return No.instance=i??new No,o&&(o.config.globalProperties.$vueFlowStorage=No.instance),No.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=Uf(),a=t.reactive(i),r={};for(const[p,f]of Object.entries(a.hooks)){const h=`on${p.charAt(0).toUpperCase()+p.slice(1)}`;r[h]=f.on}const l={};for(const[p,f]of Object.entries(a.hooks))l[p]=f.trigger;const s=t.computed(()=>{const p=new Map;for(const f of a.nodes)p.set(f.id,f);return p}),c=t.computed(()=>{const p=new Map;for(const f of a.edges)p.set(f.id,f);return p}),d=kw(a,s,c),u=JN(a,s,c);u.setState({...a,...o});const m={...r,...d,...u,...gk(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 tt(e){const n=No.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(Bf,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,p,f)=>{const h=b=>{d.applyNodeChanges(b)},g=b=>{d.applyEdgeChanges(b)};m?(d.onNodesChange(h),d.onEdgesChange(g)):(d.hooks.value.nodesChange.off(h),d.hooks.value.edgesChange.off(g)),f(()=>{d.hooks.value.nodesChange.off(h),d.hooks.value.edgesChange.off(g)})},{immediate:!0}),Ni(()=>{if(s){const m=n.get(s.id);m?m.$destroy():Fi(`No store instance found for id ${s.id} in storage.`)}})})}else i&&s.setState(a);if(o&&(t.provide(Bf,s),o.vueFlowId=s.id),i){const c=t.getCurrentInstance();(c==null?void 0:c.type.name)!=="VueFlow"&&s.emits.error(new wt(kt.USEVUEFLOW_OPTIONS))}return s}function Ew(e){const{emits:n,dimensions:o}=tt();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 wt(kt.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 Nw={name:"UserSelection",compatConfig:{MODE:3}},ww=t.defineComponent({...Nw,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))}}),Iw=["tabIndex"],vw={name:"NodesSelection",compatConfig:{MODE:3}},Cw=t.defineComponent({...vw,setup(e){const{emits:n,viewport:o,getSelectedNodes:i,noPanClassName:a,disableKeyboardA11y:r,userSelectionActive:l}=tt(),s=Ff(),c=t.ref(null),d=Lf({el:c,onStart(h){n.selectionDragStart(h),n.nodeDragStart(h)},onDrag(h){n.selectionDrag(h),n.nodeDrag(h)},onStop(h){n.selectionDragStop(h),n.nodeDragStop(h)}});t.onMounted(()=>{var h;r.value||(h=c.value)==null||h.focus({preventScroll:!0})});const u=t.computed(()=>ys(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 p(h){n.selectionContextMenu({event:h,nodes:i.value})}function f(h){r.value||Xo[h.key]&&(h.preventDefault(),s({x:Xo[h.key].x,y:Xo[h.key].y},h.shiftKey))}return(h,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:p,onKeydown:f},null,46,Iw)],6)):t.createCommentVNode("",!0)}});function Sw(e,n){return{x:e.clientX-n.left,y:e.clientY-n.top}}const xw={name:"Pane",compatConfig:{MODE:3}},Rw=t.defineComponent({...xw,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:p,removeEdges:f,selectionMode:h,deleteKeyCode:g,multiSelectionKeyCode:b,multiSelectionActive:_,edgeLookup:k,nodeLookup:N,connectionLookup:y,defaultEdgeOptions:E,connectionStartHandle:S,panOnDrag:A}=tt(),V=t.shallowRef(null),$=t.shallowRef(new Set),O=t.shallowRef(new Set),C=t.shallowRef(null),R=t.toRef(()=>c.value&&(e.isSelecting||r.value)),T=t.toRef(()=>S.value!==null);let w=!1,I=!1;const v=Bi(g,{actInsideInputWithModifier:!1}),B=Bi(b);t.watch(v,fe=>{fe&&(p(m.value),f(u.value),d.value=!1)}),t.watch(B,fe=>{_.value=fe});function M(fe,pe){return ge=>{ge.target===pe&&(fe==null||fe(ge))}}function x(fe){if(w||T.value){w=!1;return}a.paneClick(fe),l(),d.value=!1}function P(fe){var pe;if(Array.isArray(A.value)&&((pe=A.value)!=null&&pe.includes(2))){fe.preventDefault();return}a.paneContextMenu(fe)}function Y(fe){a.paneScroll(fe)}function se(fe){var pe,ge,Te;if(C.value=((pe=n.value)==null?void 0:pe.getBoundingClientRect())??null,!c.value||!e.isSelecting||fe.button!==0||fe.target!==V.value||!C.value)return;(Te=(ge=fe.target)==null?void 0:ge.setPointerCapture)==null||Te.call(ge,fe.pointerId);const{x:He,y:De}=Sw(fe,C.value);I=!0,w=!1,l(),s.value={width:0,height:0,startX:He,startY:De,x:He,y:De},a.selectionStart(fe)}function he(fe){var pe;if(!C.value||!s.value)return;w=!0;const{x:ge,y:Te}=mn(fe,C.value),{startX:He=0,startY:De=0}=s.value,Z={startX:He,startY:De,x:ge<He?ge:He,y:Te<De?Te:De,width:Math.abs(ge-He),height:Math.abs(Te-De)},re=$.value,ue=O.value;$.value=new Set(ff(o.value,Z,i.value,h.value===fs.Partial,!0).map(L=>L.id)),O.value=new Set;const z=((pe=E.value)==null?void 0:pe.selectable)??!0;for(const L of $.value){const F=y.value.get(L);if(F)for(const{edgeId:X}of F.values()){const ee=k.value.get(X);ee&&(ee.selectable??z)&&O.value.add(X)}}if(!Vf(re,$.value)){const L=jn(N.value,$.value,!0);a.nodesChange(L)}if(!Vf(ue,O.value)){const L=jn(k.value,O.value);a.edgesChange(L)}s.value=Z,r.value=!0,d.value=!1}function ie(fe){var pe;fe.button!==0||!I||((pe=fe.target)==null||pe.releasePointerCapture(fe.pointerId),!r.value&&s.value&&fe.target===V.value&&x(fe),r.value=!1,s.value=null,d.value=$.value.size>0,a.selectionEnd(fe),e.selectionKeyPressed&&(w=!1),I=!1)}return(fe,pe)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"container",ref:V,class:t.normalizeClass(["vue-flow__pane vue-flow__container",{selection:fe.isSelecting}]),onClick:pe[0]||(pe[0]=ge=>R.value?void 0:M(x,V.value)(ge)),onContextmenu:pe[1]||(pe[1]=ge=>M(P,V.value)(ge)),onWheelPassive:pe[2]||(pe[2]=ge=>M(Y,V.value)(ge)),onPointerenter:pe[3]||(pe[3]=ge=>R.value?void 0:t.unref(a).paneMouseEnter(ge)),onPointerdown:pe[4]||(pe[4]=ge=>R.value?se(ge):t.unref(a).paneMouseMove(ge)),onPointermove:pe[5]||(pe[5]=ge=>R.value?he(ge):t.unref(a).paneMouseMove(ge)),onPointerup:pe[6]||(pe[6]=ge=>R.value?ie(ge):void 0),onPointerleave:pe[7]||(pe[7]=ge=>t.unref(a).paneMouseLeave(ge))},[t.renderSlot(fe.$slots,"default"),t.unref(r)&&t.unref(s)?(t.openBlock(),t.createBlock(ww,{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(Cw,{key:1})):t.createCommentVNode("",!0)],34))}}),Aw={name:"Transform",compatConfig:{MODE:3}},$w=t.defineComponent({...Aw,setup(e){const{viewport:n,fitViewOnInit:o,fitViewOnInitDone:i}=tt(),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))}}),Tw={name:"Viewport",compatConfig:{MODE:3}},Mw=t.defineComponent({...Tw,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:p,zoomOnPinch:f,zoomOnScroll:h,preventScrolling:g,noWheelClassName:b,noPanClassName:_,emits:k,connectionStartHandle:N,userSelectionActive:y,paneDragging:E,d3Zoom:S,d3Selection:A,d3ZoomHandler:V,viewport:$,viewportRef:O,paneClickDistance:C}=tt();Ew(O);const R=t.shallowRef(!1),T=t.shallowRef(!1);let w=null,I=!1,v=0,B={x:0,y:0,zoom:0};const M=Bi(s),x=Bi(l),P=Bi(r),Y=t.toRef(()=>(!x.value||x.value&&l.value===!0)&&(M.value||m.value)),se=t.toRef(()=>M.value||c.value),he=t.toRef(()=>l.value===!0&&Y.value!==!0),ie=t.toRef(()=>x.value&&l.value!==!0||y.value||he.value),fe=t.toRef(()=>N.value!==null);t.onMounted(()=>{if(!O.value){Fi("Viewport element is missing");return}const De=O.value,Z=De.getBoundingClientRect(),re=tN().clickDistance(C.value).scaleExtent([n.value,o.value]).translateExtent(a.value),ue=Jt(De).call(re),z=ue.on("wheel.zoom"),L=Jo.translate(i.value.x??0,i.value.y??0).scale(bo(i.value.zoom??1,n.value,o.value)),F=[[0,0],[Z.width,Z.height]],X=re.constrain()(L,F,a.value);re.transform(ue,X),re.wheelDelta(gs),S.value=re,A.value=ue,V.value=z,$.value={x:X.x,y:X.y,zoom:X.k},re.on("start",ee=>{var ke;if(!ee.sourceEvent)return null;v=ee.sourceEvent.button,R.value=!0;const ye=Te(ee.transform);((ke=ee.sourceEvent)==null?void 0:ke.type)==="mousedown"&&(E.value=!0),B=ye,k.viewportChangeStart(ye),k.moveStart({event:ee,flowTransform:ye})}),re.on("end",ee=>{if(!ee.sourceEvent)return null;if(R.value=!1,E.value=!1,pe(Y.value,v??0)&&!I&&k.paneContextMenu(ee.sourceEvent),I=!1,ge(B,ee.transform)){const ke=Te(ee.transform);B=ke,k.viewportChangeEnd(ke),k.moveEnd({event:ee,flowTransform:ke})}}),re.filter(ee=>{var ke;const ye=P.value||h.value,Ne=f.value&&ee.ctrlKey,we=ee.button,G=ee.type==="wheel";if(we===1&&ee.type==="mousedown"&&(He(ee,"vue-flow__node")||He(ee,"vue-flow__edge")))return!0;if(!Y.value&&!ye&&!se.value&&!p.value&&!f.value||y.value||fe.value&&!G||!p.value&&ee.type==="dblclick"||He(ee,b.value)&&G||He(ee,_.value)&&(!G||se.value&&G&&!P.value)||!f.value&&ee.ctrlKey&&G||!ye&&!se.value&&!Ne&&G)return!1;if(!f&&ee.type==="touchstart"&&((ke=ee.touches)==null?void 0:ke.length)>1)return ee.preventDefault(),!1;if(!Y.value&&(ee.type==="mousedown"||ee.type==="touchstart")||he.value&&Array.isArray(m.value)&&m.value.includes(0)&&we===0||Array.isArray(m.value)&&!m.value.includes(we)&&(ee.type==="mousedown"||ee.type==="touchstart"))return!1;const q=Array.isArray(m.value)&&m.value.includes(we)||l.value===!0&&Array.isArray(m.value)&&!m.value.includes(0)||!we||we<=1;return(!ee.ctrlKey||M.value||G)&&q}),t.watch([y,Y],()=>{y.value&&!R.value?re.on("zoom",null):y.value||re.on("zoom",ee=>{$.value={x:ee.transform.x,y:ee.transform.y,zoom:ee.transform.k};const ke=Te(ee.transform);I=pe(Y.value,v??0),k.viewportChange(ke),k.move({event:ee,flowTransform:ke})})},{immediate:!0}),t.watch([y,se,d,P,f,g,b],()=>{se.value&&!P.value&&!y.value?ue.on("wheel.zoom",ee=>{if(He(ee,b.value))return!1;const ke=P.value||h.value,ye=f.value&&ee.ctrlKey;if(!(!g.value||se.value||ke||ye))return!1;ee.preventDefault(),ee.stopImmediatePropagation();const we=ue.property("__zoom").k||1,G=zi();if(!M.value&&ee.ctrlKey&&f.value&&G){const ze=sn(ee),Fe=gs(ee),ae=we*2**Fe;re.scaleTo(ue,ae,ze,ee);return}const q=ee.deltaMode===1?20:1;let W=d.value===Vi.Vertical?0:ee.deltaX*q,Ce=d.value===Vi.Horizontal?0:ee.deltaY*q;!G&&ee.shiftKey&&d.value!==Vi.Vertical&&!W&&Ce&&(W=Ce,Ce=0),re.translateBy(ue,-(W/we)*u.value,-(Ce/we)*u.value);const $e=Te(ue.property("__zoom"));w&&clearTimeout(w),T.value?(k.move({event:ee,flowTransform:$e}),k.viewportChange($e),w=setTimeout(()=>{k.moveEnd({event:ee,flowTransform:$e}),k.viewportChangeEnd($e),T.value=!1},150)):(T.value=!0,k.moveStart({event:ee,flowTransform:$e}),k.viewportChangeStart($e))},{passive:!1}):typeof z<"u"&&ue.on("wheel.zoom",function(ee,ke){const ye=!g.value&&ee.type==="wheel"&&!ee.ctrlKey,Ne=P.value||h.value,we=f.value&&ee.ctrlKey;if(!Ne&&!c.value&&!we&&ee.type==="wheel"||ye||He(ee,b.value))return null;ee.preventDefault(),z.call(this,ee,ke)},{passive:!1})},{immediate:!0})});function pe(De,Z){return Z===2&&Array.isArray(De)&&De.includes(2)}function ge(De,Z){return De.x!==Z.x&&!Number.isNaN(Z.x)||De.y!==Z.y&&!Number.isNaN(Z.y)||De.zoom!==Z.k&&!Number.isNaN(Z.k)}function Te(De){return{x:De.x,y:De.y,zoom:De.k}}function He(De,Z){return De.target.closest(`.${Z}`)}return(De,Z)=>(t.openBlock(),t.createElementBlock("div",{ref_key:"viewportRef",ref:O,class:"vue-flow__viewport vue-flow__container"},[t.createVNode(Rw,{"is-selecting":ie.value,"selection-key-pressed":t.unref(x),class:t.normalizeClass({connecting:fe.value,dragging:t.unref(E),draggable:t.unref(m)===!0||Array.isArray(t.unref(m))&&t.unref(m).includes(0)})},{default:t.withCtx(()=>[t.createVNode($w,null,{default:t.withCtx(()=>[t.renderSlot(De.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),Vw=["id"],Bw=["id"],Dw=["id"],Ow={name:"A11yDescriptions",compatConfig:{MODE:3}},Lw=t.defineComponent({...Ow,setup(e){const{id:n,disableKeyboardA11y:o,ariaLiveMessage:i}=tt();return(a,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{id:`${t.unref(nf)}-${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,Vw),t.createElementVNode("div",{id:`${t.unref(of)}-${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,Bw),t.unref(o)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,id:`${t.unref(lN)}-${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,Dw))],64))}});function Pw(){const e=tt();t.watch(()=>e.viewportHelper.value.viewportInitialized,n=>{n&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function zw(e,n,o){return o===Oe.Left?e-n:o===Oe.Right?e+n:e}function Fw(e,n,o){return o===Oe.Top?e-n:o===Oe.Bottom?e+n:e}const Rs=function({radius:e=10,centerX:n=0,centerY:o=0,position:i=Oe.Top,type:a}){return t.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${a}`,cx:zw(n,e,i),cy:Fw(o,e,i),r:e,stroke:"transparent",fill:"transparent"})};Rs.props=["radius","centerX","centerY","position","type"],Rs.compatConfig={MODE:3};const Zf=Rs,Uw=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:p,multiSelectionActive:f,disableKeyboardA11y:h,elementsSelectable:g,edgesUpdatable:b,edgesFocusable:_,hooks:k}=tt(),N=t.computed(()=>u(e.id)),{emit:y,on:E}=ON(N.value,r),S=t.inject(rr),A=t.getCurrentInstance(),V=t.ref(!1),$=t.ref(!1),O=t.ref(""),C=t.ref(null),R=t.ref("source"),T=t.ref(null),w=t.toRef(()=>typeof N.value.selectable>"u"?g.value:N.value.selectable),I=t.toRef(()=>typeof N.value.updatable>"u"?b.value:N.value.updatable),v=t.toRef(()=>typeof N.value.focusable>"u"?_.value:N.value.focusable);t.provide(VN,e.id),t.provide(BN,T);const B=t.computed(()=>N.value.class instanceof Function?N.value.class(N.value):N.value.class),M=t.computed(()=>N.value.style instanceof Function?N.value.style(N.value):N.value.style),x=t.computed(()=>{const L=N.value.type||"default",F=S==null?void 0:S[`edge-${L}`];if(F)return F;let X=N.value.template??c.value[L];if(typeof X=="string"&&A){const ee=Object.keys(A.appContext.components);ee&&ee.includes(L)&&(X=t.resolveComponent(L,!1))}return X&&typeof X!="string"?X:(r.error(new wt(kt.EDGE_TYPE_MISSING,X)),!1)}),{handlePointerDown:P}=Pf({nodeId:O,handleId:C,type:R,isValidConnection:p,edgeUpdaterType:R,onEdgeUpdate:he,onEdgeUpdateEnd:ie});return()=>{const L=m(N.value.source),F=m(N.value.target),X="pathOptions"in N.value?N.value.pathOptions:{};if(!L&&!F)return r.error(new wt(kt.EDGE_SOURCE_TARGET_MISSING,N.value.id,N.value.source,N.value.target)),null;if(!L)return r.error(new wt(kt.EDGE_SOURCE_MISSING,N.value.id,N.value.source)),null;if(!F)return r.error(new wt(kt.EDGE_TARGET_MISSING,N.value.id,N.value.target)),null;if(!N.value||N.value.hidden||L.hidden||F.hidden)return null;let ee;i.value===Sn.Strict?ee=L.handleBounds.source:ee=[...L.handleBounds.source||[],...L.handleBounds.target||[]];const ke=vf(ee,N.value.sourceHandle);let ye;i.value===Sn.Strict?ye=F.handleBounds.target:ye=[...F.handleBounds.target||[],...F.handleBounds.source||[]];const Ne=vf(ye,N.value.targetHandle),we=(ke==null?void 0:ke.position)||Oe.Bottom,G=(Ne==null?void 0:Ne.position)||Oe.Top,{x:q,y:W}=Qo(L,ke,we),{x:Ce,y:$e}=Qo(F,Ne,G);return N.value.sourceX=q,N.value.sourceY=W,N.value.targetX=Ce,N.value.targetY=$e,t.h("g",{ref:T,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${x.value===!1?"default":N.value.type||"default"}`,s.value,B.value,{updating:V.value,selected:N.value.selected,animated:N.value.animated,inactive:!w.value&&!k.value.edgeClick.hasListeners()}],tabIndex:v.value?0:void 0,"aria-label":N.value.ariaLabel===null?void 0:N.value.ariaLabel??`Edge from ${N.value.source} to ${N.value.target}`,"aria-describedby":v.value?`${of}-${n}`:void 0,"aria-roledescription":"edge",role:v.value?"group":"img",...N.value.domAttributes,onClick:pe,onContextmenu:ge,onDblclick:Te,onMouseenter:He,onMousemove:De,onMouseleave:Z,onKeyDown:v.value?z:void 0},[$.value?null:t.h(x.value===!1?c.value.default:x.value,{id:e.id,sourceNode:L,targetNode:F,source:N.value.source,target:N.value.target,type:N.value.type,updatable:I.value,selected:N.value.selected,animated:N.value.animated,label:N.value.label,labelStyle:N.value.labelStyle,labelShowBg:N.value.labelShowBg,labelBgStyle:N.value.labelBgStyle,labelBgPadding:N.value.labelBgPadding,labelBgBorderRadius:N.value.labelBgBorderRadius,data:N.value.data,events:{...N.value.events,...E},style:M.value,markerStart:`url('#${Pi(N.value.markerStart,n)}')`,markerEnd:`url('#${Pi(N.value.markerEnd,n)}')`,sourcePosition:we,targetPosition:G,sourceX:q,sourceY:W,targetX:Ce,targetY:$e,sourceHandleId:N.value.sourceHandle,targetHandleId:N.value.targetHandle,interactionWidth:N.value.interactionWidth,...X}),[I.value==="source"||I.value===!0?[t.h("g",{onMousedown:re,onMouseenter:Y,onMouseout:se},t.h(Zf,{position:we,centerX:q,centerY:W,radius:a.value,type:"source","data-type":"source"}))]:null,I.value==="target"||I.value===!0?[t.h("g",{onMousedown:ue,onMouseenter:Y,onMouseout:se},t.h(Zf,{position:G,centerX:Ce,centerY:$e,radius:a.value,type:"target","data-type":"target"}))]:null]])};function Y(){V.value=!0}function se(){V.value=!1}function he(L,F){y.update({event:L,edge:N.value,connection:F})}function ie(L){y.updateEnd({event:L,edge:N.value}),$.value=!1}function fe(L,F){L.button===0&&($.value=!0,O.value=F?N.value.target:N.value.source,C.value=(F?N.value.targetHandle:N.value.sourceHandle)??null,R.value=F?"target":"source",y.updateStart({event:L,edge:N.value}),P(L))}function pe(L){var F;const X={event:L,edge:N.value};w.value&&(l.value=!1,N.value.selected&&f.value?(d([N.value]),(F=T.value)==null||F.blur()):o([N.value])),y.click(X)}function ge(L){y.contextMenu({event:L,edge:N.value})}function Te(L){y.doubleClick({event:L,edge:N.value})}function He(L){y.mouseEnter({event:L,edge:N.value})}function De(L){y.mouseMove({event:L,edge:N.value})}function Z(L){y.mouseLeave({event:L,edge:N.value})}function re(L){fe(L,!0)}function ue(L){fe(L,!1)}function z(L){var F;!h.value&&af.includes(L.key)&&w.value&&(L.key==="Escape"?((F=T.value)==null||F.blur(),d([u(e.id)])):o([u(e.id)]))}}}),Hw=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}=tt(),p=(e=t.inject(rr))==null?void 0:e["connection-line"],f=t.computed(()=>{var k;return m((k=i.value)==null?void 0:k.nodeId)}),h=t.computed(()=>{var k;return m((k=a.value)==null?void 0:k.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(#${Pi(c.value.markerStart,n)})`:""),_=t.computed(()=>c.value.markerEnd?`url(#${Pi(c.value.markerEnd,n)})`:"");return()=>{var k,N,y;if(!f.value||!i.value)return null;const E=i.value.id,S=i.value.type,A=f.value.handleBounds;let V=(A==null?void 0:A[S])??[];if(o.value===Sn.Loose){const M=(A==null?void 0:A[S==="source"?"target":"source"])??[];V=[...V,...M]}if(!V)return null;const $=(E?V.find(M=>M.id===E):V[0])??null,O=($==null?void 0:$.position)??Oe.Top,{x:C,y:R}=Qo(f.value,$,O);let T=null;h.value&&(o.value===Sn.Strict?T=((k=h.value.handleBounds[S==="source"?"target":"source"])==null?void 0:k.find(M=>{var x;return M.id===((x=a.value)==null?void 0:x.id)}))||null:T=((N=[...h.value.handleBounds.source??[],...h.value.handleBounds.target??[]])==null?void 0:N.find(M=>{var x;return M.id===((x=a.value)==null?void 0:x.id)}))||null);const w=((y=a.value)==null?void 0:y.position)??(O?ws[O]:null);if(!O||!w)return null;const I=l.value??c.value.type??go.Bezier;let v="";const B={sourceX:C,sourceY:R,sourcePosition:O,targetX:g.value.x,targetY:g.value.y,targetPosition:w};return I===go.Bezier?[v]=Gf(B):I===go.Step?[v]=xs({...B,borderRadius:0}):I===go.SmoothStep?[v]=xs(B):I===go.SimpleBezier?[v]=qf(B):v=`M${C},${R} ${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"},p?t.h(p,{sourceX:C,sourceY:R,sourcePosition:O,targetX:g.value.x,targetY:g.value.y,targetPosition:w,sourceNode:f.value,sourceHandle:$,targetNode:h.value,targetHandle:T,markerEnd:_.value,markerStart:b.value,connectionStatus:d.value}):t.h("path",{d:v,class:[c.value.class,d.value,"vue-flow__connection-path"],style:{...s.value,...c.value.style},"marker-end":_.value,"marker-start":b.value})))}}}),jw=["id","markerWidth","markerHeight","markerUnits","orient"],Kw={name:"MarkerType",compatConfig:{MODE:3}},Gw=t.defineComponent({...Kw,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(ps).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(ps).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,jw))}}),Yw={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},qw={name:"MarkerDefinitions",compatConfig:{MODE:3}},Ww=t.defineComponent({...qw,setup(e){const{id:n,edges:o,connectionLineOptions:i,defaultMarkerColor:a}=tt(),r=t.computed(()=>{const l=new Set,s=[],c=d=>{if(d){const u=Pi(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",Yw,[t.createElementVNode("defs",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,c=>(t.openBlock(),t.createBlock(Gw,{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))])]))}}),Jw={name:"Edges",compatConfig:{MODE:3}},Xw=t.defineComponent({...Jw,setup(e){const{findNode:n,getEdges:o,elevateEdgesOnSelect:i}=tt();return(a,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Ww),(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(NN)(l,t.unref(n),t.unref(i))})},[t.createVNode(t.unref(Uw),{id:l.id},null,8,["id"])],4))),128)),t.createVNode(t.unref(Hw))],64))}}),Zw=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:p,elevateNodesOnSelect:f,disableKeyboardA11y:h,ariaLiveMessage:g,snapToGrid:b,snapGrid:_,nodeDragThreshold:k,nodesDraggable:N,elementsSelectable:y,nodesConnectable:E,nodesFocusable:S,hooks:A}=tt(),V=t.ref(null);t.provide(Of,V),t.provide(Df,e.id);const $=t.inject(rr),O=t.getCurrentInstance(),C=Ff(),{node:R,parentNode:T}=zf(e.id),{emit:w,on:I}=FN(R,l),v=t.toRef(()=>typeof R.draggable>"u"?N.value:R.draggable),B=t.toRef(()=>typeof R.selectable>"u"?y.value:R.selectable),M=t.toRef(()=>typeof R.connectable>"u"?E.value:R.connectable),x=t.toRef(()=>typeof R.focusable>"u"?S.value:R.focusable),P=t.computed(()=>B.value||v.value||A.value.nodeClick.hasListeners()||A.value.nodeDoubleClick.hasListeners()||A.value.nodeMouseEnter.hasListeners()||A.value.nodeMouseMove.hasListeners()||A.value.nodeMouseLeave.hasListeners()),Y=t.toRef(()=>!!R.dimensions.width&&!!R.dimensions.height),se=t.computed(()=>{const F=R.type||"default",X=$==null?void 0:$[`node-${F}`];if(X)return X;let ee=R.template||m.value[F];if(typeof ee=="string"&&O){const ke=Object.keys(O.appContext.components);ke&&ke.includes(F)&&(ee=t.resolveComponent(F,!1))}return ee&&typeof ee!="string"?ee:(l.error(new wt(kt.NODE_TYPE_MISSING,ee)),!1)}),he=Lf({id:e.id,el:V,disabled:()=>!v.value,selectable:B,dragHandle:()=>R.dragHandle,onStart(F){w.dragStart(F)},onDrag(F){w.drag(F)},onStop(F){w.dragStop(F)},onClick(F){z(F)}}),ie=t.computed(()=>R.class instanceof Function?R.class(R):R.class),fe=t.computed(()=>{const F=(R.style instanceof Function?R.style(R):R.style)||{},X=R.width instanceof Function?R.width(R):R.width,ee=R.height instanceof Function?R.height(R):R.height;return!F.width&&X&&(F.width=typeof X=="string"?X:`${X}px`),!F.height&&ee&&(F.height=typeof ee=="string"?ee:`${ee}px`),F}),pe=t.toRef(()=>Number(R.zIndex??fe.value.zIndex??0));return u(F=>{(F.includes(e.id)||!F.length)&&Te()}),t.onMounted(()=>{t.watch(()=>R.hidden,(F=!1,X,ee)=>{!F&&V.value&&(e.resizeObserver.observe(V.value),ee(()=>{V.value&&e.resizeObserver.unobserve(V.value)}))},{immediate:!0,flush:"post"})}),t.watch([()=>R.type,()=>R.sourcePosition,()=>R.targetPosition],()=>{t.nextTick(()=>{d([{id:e.id,nodeElement:V.value,forceUpdate:!0}])})}),t.watch([()=>R.position.x,()=>R.position.y,()=>{var F;return(F=T.value)==null?void 0:F.computedPosition.x},()=>{var F;return(F=T.value)==null?void 0:F.computedPosition.y},()=>{var F;return(F=T.value)==null?void 0:F.computedPosition.z},pe,()=>R.selected,()=>R.dimensions.height,()=>R.dimensions.width,()=>{var F;return(F=T.value)==null?void 0:F.dimensions.height},()=>{var F;return(F=T.value)==null?void 0:F.dimensions.width}],([F,X,ee,ke,ye,Ne])=>{const we={x:F,y:X,z:Ne+(f.value&&R.selected?1e3:0)};typeof ee<"u"&&typeof ke<"u"?R.computedPosition=yN({x:ee,y:ke,z:ye},we):R.computedPosition=we},{flush:"post",immediate:!0}),t.watch([()=>R.extent,p],([F,X],[ee,ke])=>{(F!==ee||X!==ke)&&ge()}),R.extent==="parent"||typeof R.extent=="object"&&"range"in R.extent&&R.extent.range==="parent"?Gl(()=>Y).toBe(!0).then(ge):ge(),()=>R.hidden?null:t.h("div",{ref:V,"data-id":R.id,class:["vue-flow__node",`vue-flow__node-${se.value===!1?"default":R.type||"default"}`,{[o.value]:v.value,dragging:he==null?void 0:he.value,draggable:v.value,selected:R.selected,selectable:B.value,parent:R.isParent},ie.value],style:{visibility:Y.value?"visible":"hidden",zIndex:R.computedPosition.z??pe.value,transform:`translate(${R.computedPosition.x}px,${R.computedPosition.y}px)`,pointerEvents:P.value?"all":"none",...fe.value},tabIndex:x.value?0:void 0,role:x.value?"group":void 0,"aria-describedby":h.value?void 0:`${nf}-${n}`,"aria-label":R.ariaLabel,"aria-roledescription":"node",...R.domAttributes,onMouseenter:He,onMousemove:De,onMouseleave:Z,onContextmenu:re,onClick:z,onDblclick:ue,onKeydown:L},[t.h(se.value===!1?m.value.default:se.value,{id:R.id,type:R.type,data:R.data,events:{...R.events,...I},selected:R.selected,resizing:R.resizing,dragging:he.value,connectable:M.value,position:R.computedPosition,dimensions:R.dimensions,isValidTargetPos:R.isValidTargetPos,isValidSourcePos:R.isValidSourcePos,parent:R.parentNode,parentNodeId:R.parentNode,zIndex:R.computedPosition.z??pe.value,targetPosition:R.targetPosition,sourcePosition:R.sourcePosition,label:R.label,dragHandle:R.dragHandle,onUpdateNodeInternals:Te})]);function ge(){const F=R.computedPosition,{computedPosition:X,position:ee}=ks(R,b.value?ar(F,_.value):F,l.error,p.value,T.value);(R.computedPosition.x!==X.x||R.computedPosition.y!==X.y)&&(R.computedPosition={...R.computedPosition,...X}),(R.position.x!==ee.x||R.position.y!==ee.y)&&(R.position=ee)}function Te(){V.value&&d([{id:e.id,nodeElement:V.value,forceUpdate:!0}])}function He(F){he!=null&&he.value||w.mouseEnter({event:F,node:R})}function De(F){he!=null&&he.value||w.mouseMove({event:F,node:R})}function Z(F){he!=null&&he.value||w.mouseLeave({event:F,node:R})}function re(F){return w.contextMenu({event:F,node:R})}function ue(F){return w.doubleClick({event:F,node:R})}function z(F){B.value&&(!i.value||!v.value||k.value>0)&&Is(R,r.value,c,s,a,!1,V.value),w.click({event:F,node:R})}function L(F){if(!(hs(F)||h.value))if(af.includes(F.key)&&B.value){const X=F.key==="Escape";Is(R,r.value,c,s,a,X,V.value)}else v.value&&R.selected&&Xo[F.key]&&(F.preventDefault(),g.value=`Moved selected node ${F.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~R.position.x}, y: ${~~R.position.y}`,C({x:Xo[F.key].x,y:Xo[F.key].y},F.shiftKey))}}});function Qw(e={includeHiddenNodes:!1}){const{nodes:n}=tt();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 eI={class:"vue-flow__nodes vue-flow__container"},tI={name:"Nodes",compatConfig:{MODE:3}},nI=t.defineComponent({...tI,setup(e){const{getNodes:n,updateNodeDimensions:o,emits:i}=tt(),a=Qw(),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",eI,[r.value?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(n),(c,d,u,m)=>{const p=[c.id];if(m&&m.key===c.id&&t.isMemoSame(m,p))return m;const f=(t.openBlock(),t.createBlock(t.unref(Zw),{id:c.id,key:c.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return f.memo=p,f},s,0),128)):t.createCommentVNode("",!0)]))}});function oI(){const{emits:e}=tt();t.onMounted(()=>{if(Af()){const n=document.querySelector(".vue-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.error(new wt(kt.MISSING_STYLES))}})}const iI=t.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),aI={name:"VueFlow",compatConfig:{MODE:3}},rI=t.defineComponent({...aI,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=Yl(i,"modelValue",o),l=Yl(i,"nodes",o),s=Yl(i,"edges",o),c=tt(i),d=KN({modelValue:r,nodes:l,edges:s},i,c);return YN(o,c.hooks),Pw(),oI(),t.provide(rr,a),t.onUnmounted(d),n(c),(u,m)=>(t.openBlock(),t.createElementBlock("div",{ref:t.unref(c).vueFlowRef,class:"vue-flow"},[t.createVNode(Mw,null,{default:t.withCtx(()=>[t.createVNode(Xw),iI,t.createVNode(nI),t.renderSlot(u.$slots,"zoom-pane")]),_:3}),t.renderSlot(u.$slots,"default"),t.createVNode(Lw)],512))}}),lI={name:"Panel",compatConfig:{MODE:3}},Qf=t.defineComponent({...lI,props:{position:{}},setup(e){const n=e,{userSelectionActive:o}=tt(),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))}}),sI=["width","height","innerHTML"],cI=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"/>'};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,sI))}}),Qe=(e,n)=>{const o=e.__vccOpts||e;for(const[i,a]of n)o[i]=a;return o},Ve=Qe(cI,[["__scopeId","data-v-05aac699"]]),wo=["red","amber","green","teal","blue","indigo","violet","pink"],ep={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 dI(e){return typeof e=="string"&&e in ep}const uI={red:0,amber:32,green:145,teal:173,blue:221,indigo:244,violet:262,pink:330},mI=.15;function fI(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 pI(e){if(typeof e!="string")return null;const n=fI(e);if(!n||n.s<mI)return null;let o=null,i=1/0;for(const a of wo){const r=Math.abs(n.h-uI[a]),l=Math.min(r,360-r);l<i&&(i=l,o=a)}return o}function $t(e){var i;const n=(i=e==null?void 0:e.properties)==null?void 0:i.swatch;if(dI(n))return n;const o=e==null?void 0:e.properties;return pI((o==null?void 0:o["background-color"])??(o==null?void 0:o["font-color"])??(o==null?void 0:o.color))}function As(e){return e?{bar:`var(--em-swatch-${e}-bar)`,barOn:`var(--em-swatch-${e}-on)`,text:`var(--em-swatch-${e}-text)`}:null}const hI={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)"},yI={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 tp(e,n=!1){return e?n?yI[e]:hI[e]:null}function Io(e){return ep[e]}function ei(e){return`var(--em-swatch-${e}-bar)`}function gI(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 bI(e,n){const o=gI(n);return o?e(o):n.split("-")[1]??n}function _I(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-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-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 np(e,n){const o=_I(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 kI(e){return e.targetKind==="entity"?e.targetRef:e.contextRef}const EI={class:"em-inline-issue__msgs"},vo=Qe(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(Ve,{name:i[r.value].icon,size:13,class:"em-inline-issue__icon"},null,8,["name"]),t.createElementVNode("span",EI,[(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(np)(t.unref(o).t,c)),1))),128))])],2)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-9f959cc0"]]),NI=["id","aria-selected","aria-controls","tabindex","onClick","onKeydown"],wI={key:0,class:"em-mlang__dot"},II=["id","role","aria-labelledby"],vI=["title"],Qt=Qe(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 _=o.defaultLang;return _&&o.languages.includes(_)?_:o.languages[0]??"ko"}const r=t.computed(()=>o.activeLang!==void 0),l=t.ref(a()),s=t.computed(()=>{const _=o.activeLang;return _&&o.languages.includes(_)?_:r.value?o.languages[0]??"ko":l.value});t.watch(()=>[o.languages,o.defaultLang],()=>{o.languages.includes(l.value)||(l.value=a())});function c(_){var k,N;return!!((N=(k=o.modelValue)==null?void 0:k[_])!=null&&N.trim())}const d=_=>`${o.name}-tab-${_}`,u=t.computed(()=>`${o.name}-panel`),m=t.ref(null);async function p(_){var y,E;const k=o.languages,N=k[(_+k.length)%k.length];N&&(l.value=N,await t.nextTick(),(E=(y=m.value)==null?void 0:y.querySelectorAll('[role="tab"]')[k.indexOf(N)])==null||E.focus())}function f(_){p(o.languages.indexOf(s.value)+_)}const h=t.computed(()=>o.languages.filter(_=>{var k,N;return _!==s.value&&!!((N=(k=o.modelValue)==null?void 0:k[_])!=null&&N.trim())})),g=t.computed(()=>{var _;return((_=o.modelValue)==null?void 0:_[s.value])??""});function b(_){const k={...o.modelValue};_.trim()===""?delete k[s.value]:k[s.value]=_,i("update:modelValue",k)}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,N=>(t.openBlock(),t.createElementBlock("span",{id:d(N),key:N,class:t.normalizeClass(["em-mlang__tab",{"is-active":s.value===N}]),role:"tab","aria-selected":s.value===N,"aria-controls":u.value,tabindex:s.value===N?0:-1,onClick:y=>l.value=N,onKeydown:[t.withKeys(t.withModifiers(y=>l.value=N,["prevent"]),["enter"]),t.withKeys(t.withModifiers(y=>l.value=N,["prevent"]),["space"]),k[0]||(k[0]=t.withKeys(t.withModifiers(y=>f(-1),["prevent"]),["left"])),k[1]||(k[1]=t.withKeys(t.withModifiers(y=>f(1),["prevent"]),["right"])),k[2]||(k[2]=t.withKeys(t.withModifiers(y=>p(0),["prevent"]),["home"])),k[3]||(k[3]=t.withKeys(t.withModifiers(y=>p(e.languages.length-1),["prevent"]),["end"]))]},[t.createTextVNode(t.toDisplayString(N),1),c(N)?(t.openBlock(),t.createElementBlock("span",wI,"•")):t.createCommentVNode("",!0)],42,NI))),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(oe.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(oe.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,II),r.value&&h.value.length?(t.openBlock(),t.createElementBlock("span",{key:1,class:"em-mlang__others",title:h.value.join(", "),"aria-hidden":"true"},"•",8,vI)):t.createCommentVNode("",!0)],2))}}),[["__scopeId","data-v-9cb21667"]]),CI=["disabled"],SI={class:"em-panel__sub-label"},xI={class:"em-field"},RI={class:"em-field"},AI={class:"em-field"},$I={key:0,class:"em-field"},TI={class:"em-field"},MI={class:"em-class"},VI={class:"em-field"},BI={class:"em-field"},DI={key:1,class:"em-attr__navhint"},OI={key:2,class:"em-field"},LI={key:3,class:"em-field"},PI={class:"em-multilang"},zI={class:"em-multilang"},FI={key:4,class:"em-jpa"},UI={class:"em-field"},HI={class:"em-field"},jI={class:"em-field"},KI=["title"],GI={class:"em-swatch"},YI={class:"em-swatch__row"},qI=["title"],WI=["title","onClick"],op=Qe(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(M=>M.modelId===o.entityId)??null),l=t.computed(()=>r.value?a.state.layout.entityLayouts.find(M=>M.entityRef===r.value.modelId)??null:null),s=t.computed(()=>{var M;return $t(((M=l.value)==null?void 0:M.style)??void 0)}),c=["JPA_ENTITY","JPA_EMBEDDABLE","SERIALIZED_TYPE","JPA_MULTI_LANGUAGE_ENTITY","UNDEFINED"],d=["none","LIST","SET","MAP"],u=t.computed(()=>{var M,x;return((x=(M=r.value)==null?void 0:M.serialization)==null?void 0:x.collectionType)??"none"});function m(M){return M==="none"?a.t("em.entity.serializedContainerNone"):M}function p(M){var Y,se;const x=M==="none"?void 0:M,P=x==="MAP"?(se=(Y=r.value)==null?void 0:Y.serialization)==null?void 0:se.mapKeyType:void 0;k({serialization:x?{collectionType:x,...P?{mapKeyType:P}:{}}:null})}function f(M){var P,Y;((Y=(P=r.value)==null?void 0:P.serialization)==null?void 0:Y.collectionType)==="MAP"&&k({serialization:{collectionType:"MAP",...M.trim()?{mapKeyType:M.trim()}:{}}})}const h=[{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=M=>M;function _(M){return M==="inherit"?a.t("em.common.inherit"):M}function k(M){r.value&&a.updateEntity(r.value.modelId,M)}function N(M,x,P){var se;const Y=((se=r.value)==null?void 0:se.table)??{physicalName:""};k(M==="physicalName"?{table:{...Y,physicalName:P}}:{table:{...Y,logicalName:{...Y.logicalName,[x]:P}}})}function y(M){k({description:Object.keys(M).length?M:void 0})}function E(M,x){var P;k({jpaAttrs:{...(P=r.value)==null?void 0:P.jpaAttrs,[M]:x}})}function S(M,x){E(M,x)}const A=t.computed(()=>{var M,x;return((x=(M=r.value)==null?void 0:M.jpaAttrs)==null?void 0:x.discriminatorType)??"inherit"}),V=t.computed(()=>{var M,x;return!((x=(M=r.value)==null?void 0:M.jpaAttrs)!=null&&x.useDiscriminator)});function $(M){E("discriminatorType",M==="inherit"?void 0:M)}function O(M){k({hasPersonalInfo:M})}function C(M){k({referenceOnly:M?!0:void 0})}function R(M){k({superClass:M.trim()||void 0})}function T(M){k({schema:M.trim()||void 0})}function w(M){k({abstractClass:M})}const I=t.computed(()=>{var M,x;return((x=(M=r.value)==null?void 0:M.declarationOfInterfaces)==null?void 0:x.join(", "))??""});function v(M){const x=M.split(",").map(P=>P.trim()).filter(Boolean);k({declarationOfInterfaces:x.length?x:void 0})}function B(M){r.value&&a.setEntitySwatch(r.value.modelId,M)}return(M,x)=>{var P,Y,se,he;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:x[0]||(x[0]=ie=>i("toggle"))},[t.createElementVNode("span",SI,[t.createVNode(Ve,{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(vo,{controller:t.unref(a),"ref-id":e.entityId,class:"em-section__issues"},null,8,["controller","ref-id"]),t.createElementVNode("label",xI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.name")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-name",width:"100%","model-value":r.value.name,"onUpdate:modelValue":x[1]||(x[1]=ie=>k({name:ie}))},null,8,["model-value"])]),t.createElementVNode("label",RI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.stereotype")),1),t.createVNode(t.unref(oe.BSSelect),{"model-value":r.value.stereotype,items:c,"value-provider":b,"label-provider":t.unref(si),"onUpdate:modelValue":x[2]||(x[2]=ie=>k({stereotype:ie}))},null,8,["model-value","label-provider"])]),r.value.stereotype==="SERIALIZED_TYPE"?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",AI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.serializedContainer")),1),t.createVNode(t.unref(oe.BSSelect),{name:"ent-ser-container","model-value":u.value,items:d,"value-provider":b,"label-provider":m,"onUpdate:modelValue":x[3]||(x[3]=ie=>ie&&p(ie))},null,8,["model-value"])]),u.value==="MAP"?(t.openBlock(),t.createElementBlock("label",$I,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.serializedMapKey")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-ser-mapkey",width:"100%",placeholder:t.unref(a).t("em.entity.serializedMapKeyPlaceholder"),"model-value":((P=r.value.serialization)==null?void 0:P.mapKeyType)??"","onUpdate:modelValue":f},null,8,["placeholder","model-value"])])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0),t.createElementVNode("label",TI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.package")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-package",width:"100%","model-value":r.value.packageName??"","onUpdate:modelValue":x[4]||(x[4]=ie=>k({packageName:ie}))},null,8,["model-value"])]),t.createElementVNode("fieldset",MI,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.entity.classLegend")),1),t.createElementVNode("label",VI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.superClass")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-superclass",width:"100%",placeholder:t.unref(a).t("em.entity.superClassPlaceholder"),"model-value":r.value.superClass??"","onUpdate:modelValue":x[5]||(x[5]=ie=>R(ie))},null,8,["placeholder","model-value"])]),t.createElementVNode("label",BI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.interfaces")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-interfaces",width:"100%",placeholder:t.unref(a).t("em.entity.interfacesPlaceholder"),"model-value":I.value,"onUpdate:modelValue":x[6]||(x[6]=ie=>v(ie))},null,8,["placeholder","model-value"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:"ent-abstract",class:"em-check",label:t.unref(a).t("em.entity.abstractClass"),"model-value":!!r.value.abstractClass,"onUpdate:modelValue":x[7]||(x[7]=ie=>w(ie))},null,8,["label","model-value"])]),t.unref(_t)(r.value.stereotype)?(t.openBlock(),t.createElementBlock("p",DI,t.toDisplayString(t.unref(a).t("em.entity.noOwnTableNote")),1)):(t.openBlock(),t.createElementBlock("label",OI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.tablePhysical")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-table",width:"100%","model-value":((Y=r.value.table)==null?void 0:Y.physicalName)??"","onUpdate:modelValue":x[8]||(x[8]=ie=>N("physicalName",null,ie))},null,8,["model-value"])])),t.unref(hn)(r.value.stereotype)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",LI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.schema")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"ent-schema",width:"100%",placeholder:t.unref(a).t("em.entity.schemaPlaceholder"),"model-value":r.value.schema??"","onUpdate:modelValue":x[9]||(x[9]=ie=>T(ie))},null,8,["placeholder","model-value"])])),t.createElementVNode("fieldset",PI,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.entity.tableLogicalLegend")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a).languages.value,ie=>{var fe,pe;return t.openBlock(),t.createElementBlock("label",{key:ie,class:"em-lang"},[t.createElementVNode("span",null,t.toDisplayString(ie),1),t.createVNode(t.unref(oe.BSTextInput),{name:`ent-logical-${ie}`,width:"100%","model-value":((pe=(fe=r.value.table)==null?void 0:fe.logicalName)==null?void 0:pe[ie])??"","onUpdate:modelValue":ge=>N("logicalName",ie,ge)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),t.createElementVNode("fieldset",zI,[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":y},null,8,["languages","default-lang","model-value"])]),t.unref(hn)(r.value.stereotype)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("fieldset",FI,[x[14]||(x[14]=t.createElementVNode("legend",null,"JPA",-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(h,ie=>{var fe;return t.createVNode(t.unref(oe.BSCheckbox),{key:ie.key,name:`jpa-${ie.key}`,class:"em-check",label:ie.label,"model-value":!!((fe=r.value.jpaAttrs)!=null&&fe[ie.key]),"onUpdate:modelValue":pe=>S(ie.key,pe)},null,8,["name","label","model-value","onUpdate:modelValue"])}),64)),t.createElementVNode("label",UI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discColumn")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"disc-col",width:"100%",placeholder:t.unref(a).t("em.entity.discColumnPlaceholder"),disabled:V.value,"model-value":((se=r.value.jpaAttrs)==null?void 0:se.discriminatorColumnName)??"","onUpdate:modelValue":x[10]||(x[10]=ie=>E("discriminatorColumnName",ie.trim()||void 0))},null,8,["placeholder","disabled","model-value"])]),t.createElementVNode("label",HI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discType")),1),t.createVNode(t.unref(oe.BSSelect),{disabled:V.value,"model-value":A.value,items:g,"value-provider":b,"label-provider":_,"onUpdate:modelValue":x[11]||(x[11]=ie=>ie&&$(ie))},null,8,["disabled","model-value"])]),t.createElementVNode("label",jI,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.entity.discLength")),1),t.createVNode(t.unref(oe.BSNumberInput),{name:"disc-len",width:"64px",placeholder:"len",disabled:V.value,"model-value":(he=r.value.jpaAttrs)==null?void 0:he.discriminatorLength,"onUpdate:modelValue":x[12]||(x[12]=ie=>E("discriminatorLength",ie||void 0))},null,8,["disabled","model-value"])])])),t.createVNode(t.unref(oe.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":O},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(oe.BSCheckbox),{name:"ent-reference-only",class:"em-check",label:t.unref(a).t("em.entity.referenceOnly"),"model-value":!!r.value.referenceOnly,"onUpdate:modelValue":C},null,8,["label","model-value"])],8,KI),t.createElementVNode("fieldset",GI,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(a).t("em.entity.headerColor")),1),t.createElementVNode("div",YI,[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:x[13]||(x[13]=ie=>B(null))},"∅",10,qI),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),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(ei)(ie)}),title:t.unref(a).t(t.unref(Io)(ie)),onClick:fe=>B(ie)},null,14,WI))),128))])])],64)):t.createCommentVNode("",!0)],8,CI)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-1b3b91f5"]]),JI=["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"],ip=["inherit","true","false"],pr="__OWN__";function ap(e,n){const o=t.computed(()=>e.state.logical.entities.find(J=>J.modelId===n())??null),i=t.computed(()=>{var J;return _t(((J=o.value)==null?void 0:J.stereotype)??"UNDEFINED")}),a=t.computed(()=>{var J;return hn(((J=o.value)==null?void 0:J.stereotype)??"UNDEFINED")}),r=t.computed(()=>new Set(e.selectedAttrIds.value));function l(J){return J==="none"?e.t("em.common.noneParen"):J}const s=J=>J;function c(J,ce){o.value&&e.updateAttribute(o.value.modelId,J.modelId,ce)}const d=t.computed(()=>jr(e.state.logical.associations));function u(J){if(!o.value)return;const ce=Po(e.state.logical,o.value.modelId,J.modelId);return ce&&ka(J,ce)?ce:void 0}function m(J){return!!u(J)}function p(J){return m(J)?J.derivedIdFieldName??"":J.name??""}function f(J){const ce=u(J);if(!ce)return e.t("em.attr.namePlaceholder");const Ae=new Map(e.state.logical.entities.map(Ee=>[Ee.modelId,Ee]));return gl({...J,derivedIdFieldName:void 0},ce,Ae)||e.t("em.attr.namePlaceholder")}function h(J,ce){m(J)?c(J,{derivedIdFieldName:ce||void 0}):c(J,{name:ce})}function g(J){return J.name??""}function b(J,ce){c(J,{name:ce})}function _(J){return!!o.value&&Kr(J,o.value,d.value)}function k(J){var Ee,H;const ce=(Ee=J.derivedFrom)==null?void 0:Ee.associationRef,Ae=(H=o.value)==null?void 0:H.attributes.find(It=>{var Rt;return It.attrType==="RELATION_OWN"&&((Rt=It.derivedFrom)==null?void 0:Rt.associationRef)===ce&&d.value.has(It.modelId)});return e.t("em.attr.joinColumnOnlyNote",{anchor:(Ae==null?void 0:Ae.name)||e.t("em.attr.nameless")})}function N(J){return!!o.value&&!!Po(e.state.logical,o.value.modelId,J.modelId)}function y(J,ce){c(J,{naturalId:ce||void 0,naturalIdMutable:ce?J.naturalIdMutable:void 0})}function E(){return{naturalId:void 0,naturalIdMutable:void 0}}function S(J,ce){c(J,{identifier:ce,...ce?E():{}})}function A(J,ce){c(J,{transient:ce||void 0,...ce?E():{}})}function V(J){return!!J.transient||J.attrType==="RELATION_REF"}function $(J){return ia(J)}function O(J,ce=0){var Ae;return((Ae=Zn(J,o.value,e.state.logical.entities,e.state.logical.associations,ce))==null?void 0:Ae.physicalName)||void 0}const C=J=>J.value,R=J=>J.label;function T(J,ce){if(!ce)return;const Ae=se.value.find(Ee=>Ee.type===ce);if(Ae){const Ee=J.dbAttrs[0]??{modelId:J.modelId+".c",physicalName:J.name,dataType:"VARCHAR"};c(J,{type:ce,customType:void 0,dbAttrs:[{...Ee,dataType:Ae.dataType,length:Ae.length,scale:Ae.scale}]});return}c(J,ce===_n?{type:ce}:{type:ce,customType:void 0})}function w(J,ce){c(J,{customType:ce.trim()===""?void 0:ce})}function I(J,ce){if(J.attrType==="RELATION_REF")return;const Ee={...J.dbAttrs[0]??{modelId:J.modelId+".c",physicalName:J.name,dataType:"VARCHAR"},...ce};ce.dataType!==void 0&&!el.has(Ee.dataType)&&(Ee.scale=void 0),c(J,{dbAttrs:[Ee]})}function v(J){var ce;return el.has(((ce=J.dbAttrs[0])==null?void 0:ce.dataType)??"")}function B(J){return!v(J)&&!$(J)&&!V(J)?e.t("em.attr.scaleTypeHint"):void 0}function M(J,ce){I(J,{logicalName:Object.keys(ce).length?ce:void 0})}function x(J,ce){c(J,{description:Object.keys(ce).length?ce:void 0})}function P(J){return J.personalInfoAttributeType??"none"}function Y(J,ce){c(J,{personalInfoAttributeType:ce==="none"?void 0:ce})}const se=t.computed(()=>e.predefinedCustomTypeCatalog.value),he=t.computed(()=>[...Vo(e.state.logical).keys()].sort()),ie=t.computed(()=>e.embeddableCatalog.value);function fe(J){var ce,Ae,Ee;return((ce=J.label)==null?void 0:ce[e.userLanguage.value])??((Ae=J.label)==null?void 0:Ae.ko)??((Ee=J.label)==null?void 0:Ee.en)??J.type}const pe=t.computed(()=>e.groupCodeCatalog.value);function ge(J){var ce;return((ce=pe.value.find(Ae=>Ae.groupCode===J.groupCode))==null?void 0:ce.codes)??[]}function Te(J){return["none",...ge(J)]}function He(J){return J==="none"?"none":J.code}function De(J){var Ae,Ee,H;if(J==="none")return e.t("em.common.noneParen");const ce=((Ae=J.label)==null?void 0:Ae[e.userLanguage.value])??((Ee=J.label)==null?void 0:Ee.ko)??((H=J.label)==null?void 0:H.en);return ce?`${J.code} (${ce})`:J.code}function Z(J,ce){o.value&&e.setAttributeGroupCode(o.value.modelId,J.modelId,ce)}function re(J,ce){c(J,{defaultValue:ce==="none"?void 0:ce})}function ue(J,ce){c(J,{defaultValue:ce.trim()===""?void 0:ce})}function z(J){return J.attrType.startsWith("EMBED")&&J.dbAttrs.length>0}const L=yn;function F(J){return z(J)||L(J)}function X(J,ce,Ae){const Ee=J.dbAttrs.map((H,It)=>{if(It!==ce)return H;const Rt={...H,...Ae};for(const ot of Object.keys(Ae))Ae[ot]===void 0&&delete Rt[ot];return Rt});o.value&&e.setEmbedColumns(o.value.modelId,J.modelId,Ee)}function ee(J,ce,Ae){X(J,ce,{logicalName:Object.keys(Ae).length?Ae:void 0})}function ke(J,ce){var H,It,Rt;if(L(J)){const ot=Zn(J,o.value,e.state.logical.entities,e.state.logical.associations,ce);return ot?{physicalName:ot.physicalName,dataType:ot.dataType,length:ot.length,scale:ot.scale,logicalName:ot.logicalName}:void 0}if(J.attrType==="EMBED_PREDEF"){const ot=(H=e.embeddableCatalog.value.find(We=>We.type===J.type))==null?void 0:H.fields[ce];return ot?{name:ot.name,physicalName:ot.physicalName,dataType:ot.dataType,length:ot.length,scale:ot.scale,shareable:ot.shareable,logicalName:ot.logicalName}:void 0}const Ae=(It=J.embedded)==null?void 0:It.embeddableRef;if(!Ae)return;const Ee=(Rt=e.state.logical.entities.find(ot=>ot.modelId===Ae))==null?void 0:Rt.attributes.flatMap(ot=>ot.dbAttrs)[ce];return Ee?{physicalName:Ee.physicalName,dataType:Ee.dataType,length:Ee.length,scale:Ee.scale,logicalName:Ee.logicalName}:void 0}function ye(J,ce){var Ae,Ee;return((Ae=ke(J,ce))==null?void 0:Ae.dataType)||((Ee=J.dbAttrs[ce])==null?void 0:Ee.dataType)||""}function Ne(J,ce){var Ae,Ee;return((Ae=ke(J,ce))==null?void 0:Ae.length)??((Ee=J.dbAttrs[ce])==null?void 0:Ee.length)}function we(J,ce){var Ae,Ee;return((Ae=ke(J,ce))==null?void 0:Ae.scale)??((Ee=J.dbAttrs[ce])==null?void 0:Ee.scale)}function G(J){return e.t(L(J)?"em.attr.fkFixedHint":"em.attr.embedFixedHint")}const q=ip;function W(J){return J==="inherit"?e.t("em.common.inherit"):J}function Ce(J){return(J==null?void 0:J.updatable)===void 0?"inherit":J.updatable?"true":"false"}function $e(J,ce,Ae){X(J,ce,{updatable:Ae==="inherit"?void 0:Ae==="true"})}function ze(J,ce){I(J,{updatable:ce==="inherit"?void 0:ce==="true"})}const Fe=ip;function ae(J){return J==="inherit"?e.t("em.common.inherit"):J}function Se(J){return(J==null?void 0:J.insertable)===void 0?"inherit":J.insertable?"true":"false"}function Ge(J,ce,Ae){X(J,ce,{insertable:Ae==="inherit"?void 0:Ae==="true"})}function et(J,ce){I(J,{insertable:ce==="inherit"?void 0:ce==="true"})}const te=t.computed(()=>o.value?Gr(o.value,e.state.logical.entities):[]),de=t.computed(()=>To(te.value.flatMap(J=>J.attributes.flatMap(ce=>ce.dbAttrs)))),Le=t.computed(()=>te.value.flatMap(J=>J.attributes.filter(ce=>ce.attrType==="NORMAL"&&ce.dbAttrs.length===1&&ce.dbAttrs[0]).map(ce=>{var Ae;return{modelId:ce.dbAttrs[0].modelId,physical:ce.dbAttrs[0].physicalName||ce.name,isCurrency:ce.type==="Currency",ownerName:J.modelId===((Ae=o.value)==null?void 0:Ae.modelId)?void 0:J.name}})));function dt(){const J=[...Le.value].sort((ce,Ae)=>Number(Ae.isCurrency)-Number(ce.isCurrency));return[pr,...J.map(ce=>ce.modelId)]}function Xe(J){if(J===pr)return e.t("em.attr.sharedOwn");const ce=Le.value.find(Ee=>Ee.modelId===J);if(!ce)return J;const Ae=ce.ownerName?`${ce.ownerName}.`:"";return e.t("em.attr.sharedRef",{owner:Ae,physical:ce.physical,mode:ce.isCurrency?e.t("em.attr.currencyMode"):e.t("em.attr.sharedMode")})}function yt(J){return(J==null?void 0:J.sharedColumnRef)??pr}function st(J,ce,Ae){X(J,ce,{sharedColumnRef:Ae===pr?void 0:Ae})}function ft(J){return(J==null?void 0:J.sharedColumnRef)!=null}function nt(J){var ce;return((ce=Qn(J,de.value))==null?void 0:ce.physicalName)??""}return{entity:o,isValueType:i,isColumnless:a,focusedAttrIds:r,personalInfoItems:JI,piiLabel:l,idn:s,setAttr:c,isDerivedIdRow:m,rowName:p,rowNamePlaceholder:f,setRowName:h,assocFieldName:g,setAssocFieldName:b,nameLocked:_,nameLockedHint:k,isManagedFk:N,setNaturalId:y,clearNaturalIdPatch:E,setIdentifier:S,setTransient:A,dbLocked:V,fkDerived:$,fkOriginPhysical:O,typeValueOf:C,typeLabelOf:R,setAttrType:T,setAttrCustomType:w,setDb:I,scaleApplicable:v,scaleHint:B,setDbLogical:M,setAttrDescription:x,attrPiiValue:P,setAttrPii:Y,predefinedCustomTypeCatalog:se,serializedTypeNames:he,embeddableCatalog:ie,predefinedLabel:fe,groupCodeCatalog:pe,attrGroupCodes:ge,attrCodeItems:Te,codeValueOf:He,codeLabelOf:De,setAttrGroupCode:Z,setAttrCode:re,setAttrDefaultValue:ue,isEmbedExpanded:z,isMultiColFk:L,hasColumnSlots:F,setDbAt:X,setDbLogicalAt:ee,colSlotMeta:ke,fixedDataType:ye,fixedLength:Ne,fixedScale:we,slotFixedHint:G,updatableItems:q,updatableLabel:W,updatableValue:Ce,setUpdatableAt:$e,setUpdatable:ze,insertableItems:Fe,insertableLabel:ae,insertableValue:Se,setInsertableAt:Ge,setInsertable:et,scopeEntities:te,columnsById:de,sharedCandidates:Le,sharedItems:dt,sharedLabel:Xe,sharedValue:yt,setSharedAt:st,isShared:ft,sharedPhysical:nt}}const rp={"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.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.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.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.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.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.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.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.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.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"},lp={"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.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.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.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.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.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.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.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.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.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":"未指定"},sp={"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.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.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.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.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.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.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.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.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.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":"미지정"},XI=["ko","en","ja"],$s={ko:sp,en:rp,ja:lp};function en(e,n,o){let a=($s[e]??$s.ko)[n]??$s.ko[n]??n;return o&&(a=a.replace(/\{(\w+)\}/g,(r,l)=>l in o?String(o[l]):r)),a}const cp=["ko","en","ja","zh"];function ZI(e){if(e)for(const n of cp){const o=e[n];if(o)return o}}function Ts(e){const n=ZI(e.label);return n?`${e.groupCode} (${n})`:e.groupCode}function QI(e,n){const o=n.trim().toLowerCase();return o?e.filter(i=>i.groupCode.toLowerCase().includes(o)?!0:cp.some(a=>{var r,l;return(l=(r=i.label)==null?void 0:r[a])==null?void 0:l.toLowerCase().includes(o)})):e}const ev=["aria-expanded","placeholder"],tv=["aria-selected","onClick","onMouseenter"],nv={key:0,class:"gcc__opt gcc__opt--empty"},dp=Qe(t.defineComponent({__name:"GroupCodeCombobox",props:{modelValue:{},items:{},locale:{}},emits:["update:modelValue"],setup(e,{emit:n}){const o=e,i=n,a=($,O)=>en(o.locale??"ko",$,O),r=t.ref(),l=t.ref(),s=t.ref(),c=t.ref(""),d=t.ref(!1),u=t.ref(-1),m=t.ref({}),p=t.computed(()=>o.items.find($=>$.groupCode===o.modelValue)),f=t.computed(()=>p.value?Ts(p.value):"");t.watch(f,$=>{d.value||(c.value=$)},{immediate:!0});const h=t.computed(()=>c.value===f.value?o.items:QI(o.items,c.value));function g(){var O;const $=(O=r.value)==null?void 0:O.getBoundingClientRect();$&&(m.value={left:`${$.left}px`,top:`${$.bottom}px`,width:`${$.width}px`})}function b(){d.value=!0,g(),u.value=Math.max(0,h.value.findIndex($=>$.groupCode===o.modelValue)),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),document.addEventListener("mousedown",V)}function _(){d.value=!1,window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g),document.removeEventListener("mousedown",V)}t.onBeforeUnmount(_);function k(){b(),t.nextTick(()=>{var $;return($=l.value)==null?void 0:$.select()})}function N(){d.value||b(),u.value=0}function y($){i("update:modelValue",$.groupCode),c.value=Ts($),_()}function E(){i("update:modelValue",void 0),c.value="",_()}function S(){c.value.trim()===""?E():(c.value=f.value,_())}function A($){var O;if($.key==="ArrowDown")d.value||b(),u.value=Math.min(u.value+1,h.value.length-1),$.preventDefault();else if($.key==="ArrowUp")u.value=Math.max(u.value-1,0),$.preventDefault();else if($.key==="Enter"){const C=h.value[u.value];C&&y(C),$.preventDefault()}else $.key==="Escape"&&(c.value=f.value,_(),(O=l.value)==null||O.blur())}function V($){var C,R;const O=$.target;!((C=r.value)!=null&&C.contains(O))&&!((R=s.value)!=null&&R.contains(O))&&S()}return($,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]=C=>c.value=C),class:"gcc__input",type:"text",role:"combobox",autocomplete:"off","aria-expanded":d.value,placeholder:a("em.groupCode.searchPlaceholder"),onFocus:k,onInput:N,onKeydown:A},null,40,ev),[[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:E},t.toDisplayString(a("em.common.noneParen")),33),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,(C,R)=>(t.openBlock(),t.createElementBlock("li",{key:C.groupCode,class:t.normalizeClass(["gcc__opt",{"is-active":R===u.value,"is-selected":C.groupCode===e.modelValue}]),role:"option","aria-selected":C.groupCode===e.modelValue,onMousedown:O[2]||(O[2]=t.withModifiers(()=>{},["prevent"])),onClick:T=>y(C),onMouseenter:T=>u.value=R},t.toDisplayString(t.unref(Ts)(C)),43,tv))),128)),h.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("li",nv,t.toDisplayString(a("em.groupCode.noMatch")),1))],4)):t.createCommentVNode("",!0)]))],512))}}),[["__scopeId","data-v-431f9333"]]),ov=["aria-labelledby"],iv=["aria-checked","tabindex","onClick","onKeydown"],up=Qe(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,iv))),128))],8,ov))}}),[["__scopeId","data-v-5c793bbb"]]),av=["disabled"],rv={class:"em-aw__toolbar"},lv={class:"em-aw__count"},sv={class:"em-aw__scroll"},cv={class:"em-aw__table"},dv={class:"c-name"},uv={class:"c-type"},mv={class:"c-logical"},fv=["id"],pv={class:"c-col"},hv={class:"c-constraints"},yv={class:"c-del"},gv={class:"c-expand"},bv=["title","onClick","onKeydown"],_v=["title"],kv=["title"],Ev={key:1,class:"em-aw__muted"},Nv=["title"],wv=["title"],Iv=["title"],vv={class:"em-aw__cflags"},Cv=["title"],Sv={key:0,class:"em-aw__embed-col"},xv={class:"em-aw__embed-label"},Rv=["title"],Av={colspan:"8"},$v={class:"em-aw__detail"},Tv={class:"em-aw__dgroup"},Mv=["title"],Vv={class:"em-aw__df"},Bv={class:"em-aw__df"},Dv={class:"em-aw__dgroup"},Ov={key:0,class:"em-aw__dgroup"},Lv={class:"em-aw__df"},Pv={key:0,class:"em-aw__df"},zv={class:"em-aw__df"},Fv={class:"em-aw__dgroup em-aw__ddesc"},Uv={class:"c-expand"},Hv=["title","onClick","onKeydown"],jv={key:1,class:"em-aw__caret is-static","aria-hidden":"true"},Kv=["title"],Gv=["title"],Yv=["colspan"],qv=["title"],Wv={class:"em-aw__cflags"},Jv=["title"],Xv={colspan:"8"},Zv={class:"em-aw__detail"},Qv={class:"em-aw__dgroup em-aw__ddesc"},eC={class:"c-expand"},tC=["title","onClick","onKeydown"],nC={class:"em-aw__embed-label"},oC=["title"],iC=["title"],aC={class:"em-aw__ro"},rC=["title"],lC={class:"em-aw__ro"},sC=["title"],cC={class:"em-aw__ro"},dC={key:0,class:"em-aw__detail-row em-aw__embed-detail"},uC={colspan:"8"},mC={class:"em-aw__detail"},fC={class:"em-aw__dgroup"},pC={key:0,class:"em-aw__df"},hC={class:"em-aw__df"},yC={class:"em-aw__df"},gC={key:0},bC={colspan:"99",class:"em-aw__empty"},_C=6,mp=5,kC=Qe(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,setAttr:u,isDerivedIdRow:m,rowName:p,rowNamePlaceholder:f,setRowName:h,assocFieldName:g,setAssocFieldName:b,nameLocked:_,nameLockedHint:k,isManagedFk:N,setNaturalId:y,setIdentifier:E,setTransient:S,dbLocked:A,fkDerived:V,fkOriginPhysical:$,typeValueOf:O,typeLabelOf:C,setAttrType:R,setAttrCustomType:T,setDb:w,scaleApplicable:I,scaleHint:v,setDbLogical:B,attrPiiValue:M,setAttrPii:x,predefinedCustomTypeCatalog:P,serializedTypeNames:Y,embeddableCatalog:se,predefinedLabel:he,groupCodeCatalog:ie,attrGroupCodes:fe,attrCodeItems:pe,codeValueOf:ge,codeLabelOf:Te,setAttrGroupCode:He,setAttrCode:De,setAttrDefaultValue:Z,setAttrDescription:re,hasColumnSlots:ue,isMultiColFk:z,setDbAt:L,setDbLogicalAt:F,colSlotMeta:X,fixedDataType:ee,fixedLength:ke,fixedScale:ye,slotFixedHint:Ne,updatableItems:we,updatableLabel:G,updatableValue:q,setUpdatableAt:W,setUpdatable:Ce,insertableItems:$e,insertableLabel:ze,insertableValue:Fe,setInsertableAt:ae,setInsertable:Se,sharedItems:Ge,sharedLabel:et,sharedValue:te,setSharedAt:de,isShared:Le,sharedPhysical:dt}=ap(o,()=>n.entityId),Xe=t.computed(()=>{var Ae;return[...((Ae=i.value)==null?void 0:Ae.attributes)??[]].sort((Ee,H)=>Ee.order-H.order)}),yt=t.computed(()=>{var Ae;return(((Ae=i.value)==null?void 0:Ae.attributes)??[]).filter(Ee=>Ee.attrType!=="DIVIDER").length}),st=t.ref(new Set);function ft(Ae){return st.value.has(Ae)}function nt(Ae){const Ee=new Set(st.value);Ee.has(Ae)?Ee.delete(Ae):Ee.add(Ae),st.value=Ee}const J=t.ref(o.userLanguage.value);function ce(Ae){!Ae||!i.value||o.addPredefinedEmbed(i.value.modelId,Ae)}return(Ae,Ee)=>t.unref(i)?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-aw",disabled:!t.unref(o).editable.value},[t.createElementVNode("div",rv,[t.createElementVNode("span",lv,t.toDisplayString(t.unref(o).t("em.attr.section",{n:yt.value})),1),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:Ee[0]||(Ee[0]=H=>t.unref(o).addAttribute(t.unref(i).modelId))},null,8,["caption"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t("em.attr.addDivider"),onClick:Ee[1]||(Ee[1]=H=>t.unref(o).addDivider(t.unref(i).modelId))},null,8,["caption"]),t.unref(se).length?(t.openBlock(),t.createBlock(t.unref(oe.BSSelect),{key:0,width:"140px",placeholder:t.unref(o).t("em.attr.addEmbeddable"),"model-value":void 0,items:t.unref(se),"value-provider":H=>H.type,"label-provider":t.unref(he),"onUpdate:modelValue":ce},null,8,["placeholder","items","value-provider","label-provider"])):t.createCommentVNode("",!0)]),t.createElementVNode("div",sv,[t.createElementVNode("table",cv,[t.createElementVNode("thead",null,[t.createElementVNode("tr",null,[Ee[3]||(Ee[3]=t.createElementVNode("th",{class:"c-expand"},null,-1)),t.createElementVNode("th",dv,t.toDisplayString(t.unref(o).t("em.attr.namePlaceholder")),1),t.createElementVNode("th",uv,t.toDisplayString(t.unref(o).t("em.attr.typePlaceholder")),1),t.createElementVNode("th",mv,[t.createElementVNode("span",{id:`aw-logical-head-${t.unref(i).modelId}`},t.toDisplayString(t.unref(o).t("em.attr.logicalPlaceholder")),9,fv),t.createVNode(up,{modelValue:J.value,"onUpdate:modelValue":Ee[2]||(Ee[2]=H=>J.value=H),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",pv,t.toDisplayString(t.unref(o).t("em.attr.columnPhysical")),1),Ee[4]||(Ee[4]=t.createElementVNode("th",{class:"c-dtype"},"dataType",-1)),Ee[5]||(Ee[5]=t.createElementVNode("th",{class:"c-len"},"len",-1)),t.createElementVNode("th",hv,t.toDisplayString(t.unref(o).t("em.attr.constraints")),1),Ee[6]||(Ee[6]=t.createElementVNode("th",{class:"c-del"},null,-1))])]),t.createElementVNode("tbody",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Xe.value,H=>{var It,Rt,ot,We,Ze,Q,Mt,Vt,Mn,an;return t.openBlock(),t.createElementBlock(t.Fragment,{key:H.modelId},[H.attrType==="DIVIDER"?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["em-aw__divider-row",{"is-focused":t.unref(l).has(H.modelId)}])},[Ee[7]||(Ee[7]=t.createElementVNode("td",{class:"c-expand"},null,-1)),t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-divlabel-${H.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.dividerLabelPlaceholder"),"model-value":H.name,"onUpdate:modelValue":_e=>t.unref(u)(H,{name:_e})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",{colspan:_C,class:"em-aw__divider-note"},t.toDisplayString(t.unref(o).t("em.attr.dividerNote")),1),t.createElementVNode("td",yv,[t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:_e=>t.unref(o).removeAttribute(t.unref(i).modelId,H.modelId)},null,8,["onClick"])])],2)):t.unref(ue)(H)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("tr",{class:t.normalizeClass(["em-aw__embed-parent",{"is-focused":t.unref(l).has(H.modelId)}])},[t.createElementVNode("td",Uv,[t.unref(z)(H)?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(["em-aw__caret",{"is-open":ft(H.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ft(H.modelId)?"em.attr.detailCollapse":"em.attr.detailExpand"),onClick:_e=>nt(H.modelId),onKeydown:[t.withKeys(t.withModifiers(_e=>nt(H.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(_e=>nt(H.modelId),["prevent"]),["space"])]},[t.createVNode(Ve,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,Hv)):(t.openBlock(),t.createElementBlock("span",jv,[t.createVNode(Ve,{name:"chevron",size:14,class:"em-aw__caret-ic"})]))]),t.createElementVNode("td",{title:t.unref(_)(H)?t.unref(k)(H):void 0},[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-name-${H.modelId}`,width:"100%",disabled:t.unref(_)(H),placeholder:t.unref(f)(H),"model-value":t.unref(p)(H),"onUpdate:modelValue":_e=>t.unref(h)(H,_e)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])],8,Kv),t.createElementVNode("td",{title:t.unref(V)(H)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-type-${H.modelId}`,width:"100%",disabled:"","model-value":H.type},null,8,["name","model-value"])],8,Gv),t.createElementVNode("td",{colspan:t.unref(z)(H)?mp-1:mp,class:"em-aw__embed-note"},t.toDisplayString(t.unref(z)(H)?t.unref(o).t("em.attr.fkChildCols",{n:H.dbAttrs.length}):t.unref(o).t("em.attr.embedChildCols",{n:H.dbAttrs.length})),9,Yv),t.unref(z)(H)?(t.openBlock(),t.createElementBlock("td",{key:0,class:"c-constraints",title:t.unref(o).t("em.attr.fkDerivedNote")},[t.createElementVNode("div",Wv,[t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-pk-${H.modelId}`,label:"PK","model-value":H.identifier,disabled:"","onUpdate:modelValue":_e=>t.unref(E)(H,_e)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-nn-${H.modelId}`,label:"NN","model-value":H.notNull,disabled:"","onUpdate:modelValue":_e=>t.unref(u)(H,{notNull:_e})},null,8,["name","model-value","onUpdate:modelValue"])])],8,qv)):t.createCommentVNode("",!0),t.createElementVNode("td",{class:"c-del",title:t.unref(N)(H)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:_e=>t.unref(o).removeAttribute(t.unref(i).modelId,H.modelId)},null,8,["onClick"])],8,Jv)],2),t.unref(z)(H)&&ft(H.modelId)?(t.openBlock(),t.createElementBlock("tr",{key:0,class:t.normalizeClass(["em-aw__detail-row",{"is-focused":t.unref(l).has(H.modelId)}])},[Ee[15]||(Ee[15]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",Xv,[t.createElementVNode("div",Zv,[t.createElementVNode("fieldset",Qv,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`aw-desc-${H.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":H.description,"onUpdate:modelValue":_e=>t.unref(re)(H,_e)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])])])],2)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(H.dbAttrs,(_e,mt)=>{var vt,D,U,le,ne,xe,Be,qe;return t.openBlock(),t.createElementBlock(t.Fragment,{key:_e.modelId},[t.createElementVNode("tr",{class:t.normalizeClass(["em-aw__embed-col",{"em-aw__open":ft(_e.modelId)}])},[t.createElementVNode("td",eC,[t.createElementVNode("span",{class:t.normalizeClass(["em-aw__caret",{"is-open":ft(_e.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ft(_e.modelId)?"em.attr.overrideCollapse":"em.attr.overrideExpand"),onClick:je=>nt(_e.modelId),onKeydown:[t.withKeys(t.withModifiers(je=>nt(_e.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(je=>nt(_e.modelId),["prevent"]),["space"])]},[t.createVNode(Ve,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,tC)]),t.createElementVNode("td",nC,"↳ "+t.toDisplayString(((vt=t.unref(X)(H,mt))==null?void 0:vt.name)??((D=t.unref(X)(H,mt))==null?void 0:D.physicalName)??t.unref(o).t("em.attr.colFallback",{n:mt+1})),1),Ee[16]||(Ee[16]=t.createElementVNode("td",null,null,-1)),t.createElementVNode("td",null,[t.createVNode(Qt,{name:`aw-embed-logical-${_e.modelId}`,languages:t.unref(o).languages.value,"active-lang":J.value,placeholder:((le=(U=t.unref(X)(H,mt))==null?void 0:U.logicalName)==null?void 0:le[J.value])??((xe=(ne=t.unref(X)(H,mt))==null?void 0:ne.logicalName)==null?void 0:xe.ko)??t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":_e.logicalName,"onUpdate:modelValue":je=>t.unref(F)(H,mt,je)},null,8,["name","languages","active-lang","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",{title:t.unref(Le)(_e)?t.unref(o).t("em.attr.embedSharedHint"):void 0},[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-embed-col-${_e.modelId}`,width:"100%",disabled:t.unref(Le)(_e),placeholder:((Be=t.unref(X)(H,mt))==null?void 0:Be.physicalName)??t.unref(o).t("em.attr.columnPlaceholder"),"model-value":t.unref(Le)(_e)?t.unref(dt)(_e):_e.physicalName,"onUpdate:modelValue":je=>t.unref(L)(H,mt,{physicalName:je})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(vo,{controller:t.unref(o),"ref-id":_e.modelId},null,8,["controller","ref-id"])],8,oC),t.createElementVNode("td",{title:t.unref(Ne)(H)},[t.createElementVNode("span",aC,t.toDisplayString(t.unref(ee)(H,mt)),1)],8,iC),t.createElementVNode("td",{title:t.unref(Ne)(H)},[t.createElementVNode("span",lC,t.toDisplayString(t.unref(ke)(H,mt)??""),1)],8,rC),t.createElementVNode("td",{class:"c-constraints",title:t.unref(Ne)(H)},[t.createElementVNode("span",cC,t.toDisplayString(t.unref(ye)(H,mt)!=null?`scale ${t.unref(ye)(H,mt)}`:""),1)],8,sC),Ee[17]||(Ee[17]=t.createElementVNode("td",null,null,-1))],2),ft(_e.modelId)?(t.openBlock(),t.createElementBlock("tr",dC,[Ee[20]||(Ee[20]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",uC,[t.createElementVNode("div",mC,[t.createElementVNode("fieldset",fC,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.attr.overrideLegend")),1),(qe=t.unref(X)(H,mt))!=null&&qe.shareable?(t.openBlock(),t.createElementBlock("label",pC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.currencyColumn")),1),t.createVNode(t.unref(oe.BSSelect),{width:"150px","model-value":t.unref(te)(_e),items:t.unref(Ge)(),"value-provider":t.unref(d),"label-provider":t.unref(et),"onUpdate:modelValue":je=>je&&t.unref(de)(H,mt,je)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.createElementVNode("label",hC,[Ee[18]||(Ee[18]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"110px",disabled:t.unref(Le)(_e),"model-value":t.unref(Le)(_e)?"false":t.unref(Fe)(_e),items:t.unref($e),"value-provider":t.unref(d),"label-provider":t.unref(ze),"onUpdate:modelValue":je=>je&&t.unref(ae)(H,mt,je)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",yC,[Ee[19]||(Ee[19]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"110px",disabled:t.unref(Le)(_e),"model-value":t.unref(Le)(_e)?"false":t.unref(q)(_e),items:t.unref(we),"value-provider":t.unref(d),"label-provider":t.unref(G),"onUpdate:modelValue":je=>je&&t.unref(W)(H,mt,je)},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(H.modelId),"em-aw__open":ft(H.modelId)})},[t.createElementVNode("td",gv,[t.createElementVNode("span",{class:t.normalizeClass(["em-aw__caret",{"is-open":ft(H.modelId)}]),role:"button",tabindex:"0",title:t.unref(o).t(ft(H.modelId)?"em.attr.detailCollapse":"em.attr.detailExpand"),onClick:_e=>nt(H.modelId),onKeydown:[t.withKeys(t.withModifiers(_e=>nt(H.modelId),["prevent"]),["enter"]),t.withKeys(t.withModifiers(_e=>nt(H.modelId),["prevent"]),["space"])]},[t.createVNode(Ve,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,bv)]),t.createElementVNode("td",{title:t.unref(_)(H)?t.unref(k)(H):t.unref(m)(H)?t.unref(o).t("em.attr.derivedIdNote"):void 0},[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-name-${H.modelId}`,width:"100%",disabled:t.unref(_)(H),placeholder:t.unref(f)(H),"model-value":t.unref(p)(H),"onUpdate:modelValue":_e=>t.unref(h)(H,_e)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])],8,_v),t.createElementVNode("td",{title:t.unref(V)(H)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(oe.BSSelect),{name:`aw-type-${H.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.typePlaceholder"),disabled:!!H.groupCode||H.attrType==="RELATION_REF"||t.unref(V)(H),items:t.unref(Pc)(H.type,t.unref(P),t.unref(Y)),"value-provider":t.unref(O),"label-provider":t.unref(C),"model-value":H.type,"onUpdate:modelValue":_e=>t.unref(R)(H,_e)},null,8,["name","placeholder","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),H.type===t.unref(_n)&&!t.unref(V)(H)?(t.openBlock(),t.createBlock(t.unref(oe.BSTextInput),{key:0,name:`aw-customtype-${H.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.customTypePlaceholder"),"model-value":H.customType??"","onUpdate:modelValue":_e=>t.unref(T)(H,_e)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])):t.createCommentVNode("",!0)],8,kv),t.createElementVNode("td",null,[H.attrType!=="RELATION_REF"?(t.openBlock(),t.createBlock(Qt,{key:0,name:`aw-logical-${H.modelId}`,languages:t.unref(o).languages.value,"active-lang":J.value,placeholder:t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":(It=H.dbAttrs[0])==null?void 0:It.logicalName,"onUpdate:modelValue":_e=>t.unref(B)(H,_e)},null,8,["name","languages","active-lang","placeholder","model-value","onUpdate:modelValue"])):(t.openBlock(),t.createElementBlock("span",Ev,"—"))]),t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSTextInput),{name:`aw-col-${H.modelId}`,width:"100%",placeholder:t.unref($)(H)??t.unref(o).t("em.attr.columnPlaceholder"),disabled:t.unref(r)||t.unref(A)(H),"model-value":((Rt=H.dbAttrs[0])==null?void 0:Rt.physicalName)??"","onUpdate:modelValue":_e=>t.unref(w)(H,{physicalName:_e})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),t.createVNode(vo,{controller:t.unref(o),"ref-id":(ot=H.dbAttrs[0])==null?void 0:ot.modelId},null,8,["controller","ref-id"])]),t.createElementVNode("td",{title:t.unref(r)?t.unref(o).t("em.attr.serializedNoColumnNote"):t.unref(V)(H)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(oe.BSSelect),{name:`aw-dtype-${H.modelId}`,width:"100%",placeholder:"dataType",disabled:t.unref(r)||t.unref(A)(H)||t.unref(V)(H),items:t.unref(Dc)(((We=H.dbAttrs[0])==null?void 0:We.dataType)??"",t.unref(o).selectableDataTypes.value),"value-provider":t.unref(d),"label-provider":t.unref(Qr),"model-value":((Ze=H.dbAttrs[0])==null?void 0:Ze.dataType)??"","onUpdate:modelValue":_e=>_e&&t.unref(w)(H,{dataType:_e})},null,8,["name","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"])],8,Nv),t.createElementVNode("td",{title:t.unref(V)(H)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createVNode(t.unref(oe.BSNumberInput),{name:`aw-len-${H.modelId}`,width:"100%",placeholder:"len",disabled:t.unref(A)(H)||t.unref(V)(H),"model-value":(Q=H.dbAttrs[0])==null?void 0:Q.length,"onUpdate:modelValue":_e=>t.unref(w)(H,{length:_e||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,wv),t.createElementVNode("td",{class:"c-constraints",title:t.unref(V)(H)?t.unref(o).t("em.attr.fkDerivedNote"):void 0},[t.createElementVNode("div",vv,[t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-pk-${H.modelId}`,label:"PK","model-value":H.identifier,disabled:t.unref(a)||t.unref(A)(H)||t.unref(V)(H),"onUpdate:modelValue":_e=>t.unref(E)(H,_e)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-nn-${H.modelId}`,label:"NN","model-value":t.unref(r)?!1:H.notNull,disabled:t.unref(r)||t.unref(A)(H)||t.unref(V)(H),"onUpdate:modelValue":_e=>t.unref(u)(H,{notNull:_e})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-uq-${H.modelId}`,label:"UQ","model-value":!!((Mt=H.dbAttrs[0])!=null&&Mt.unique),disabled:t.unref(A)(H)||t.unref(V)(H),"onUpdate:modelValue":_e=>t.unref(w)(H,{unique:_e})},null,8,["name","model-value","disabled","onUpdate:modelValue"])])],8,Iv),t.createElementVNode("td",{class:"c-del",title:t.unref(N)(H)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:_e=>t.unref(o).removeAttribute(t.unref(i).modelId,H.modelId)},null,8,["onClick"])],8,Cv)],2),t.unref(m)(H)?(t.openBlock(),t.createElementBlock("tr",Sv,[Ee[8]||(Ee[8]=t.createElementVNode("td",{class:"c-expand"},null,-1)),t.createElementVNode("td",xv,"↳ "+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(oe.BSTextInput),{name:`aw-assocname-${H.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.namePlaceholder"),"model-value":t.unref(g)(H),"onUpdate:modelValue":_e=>t.unref(b)(H,_e)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])],8,Rv)])):t.createCommentVNode("",!0),ft(H.modelId)?(t.openBlock(),t.createElementBlock("tr",{key:1,class:t.normalizeClass(["em-aw__detail-row",{"is-focused":t.unref(l).has(H.modelId)}])},[Ee[14]||(Ee[14]=t.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),t.createElementVNode("td",Av,[t.createElementVNode("div",$v,[t.createElementVNode("fieldset",Tv,[Ee[12]||(Ee[12]=t.createElementVNode("legend",null,"DB",-1)),t.createElementVNode("label",{class:"em-aw__df",title:t.unref(v)(H)},[Ee[9]||(Ee[9]=t.createElementVNode("span",null,"scale",-1)),t.createVNode(t.unref(oe.BSNumberInput),{name:`aw-scale-${H.modelId}`,width:"72px",placeholder:"scale",disabled:t.unref(A)(H)||t.unref(V)(H)||!t.unref(I)(H),"model-value":(Vt=H.dbAttrs[0])==null?void 0:Vt.scale,"onUpdate:modelValue":_e=>t.unref(w)(H,{scale:_e||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,Mv),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-ai-${H.modelId}`,label:"Auto Increment","model-value":!!((Mn=H.dbAttrs[0])!=null&&Mn.autoIncrement),disabled:t.unref(A)(H)||t.unref(V)(H)||!H.identifier,"onUpdate:modelValue":_e=>t.unref(w)(H,{autoIncrement:_e})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createElementVNode("label",Vv,[Ee[10]||(Ee[10]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(oe.BSSelect),{name:`aw-ins-${H.modelId}`,width:"110px",disabled:t.unref(A)(H),"model-value":t.unref(Fe)(H.dbAttrs[0]),items:t.unref($e),"value-provider":t.unref(d),"label-provider":t.unref(ze),"onUpdate:modelValue":_e=>_e&&t.unref(Se)(H,_e)},null,8,["name","disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",Bv,[Ee[11]||(Ee[11]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(oe.BSSelect),{name:`aw-upd-${H.modelId}`,width:"110px",disabled:t.unref(A)(H),"model-value":t.unref(q)(H.dbAttrs[0]),items:t.unref(we),"value-provider":t.unref(d),"label-provider":t.unref(G),"onUpdate:modelValue":_e=>_e&&t.unref(Ce)(H,_e)},null,8,["name","disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])])]),t.createElementVNode("fieldset",Dv,[Ee[13]||(Ee[13]=t.createElementVNode("legend",null,"JPA",-1)),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-tr-${H.modelId}`,label:"@Transient","model-value":!!H.transient,disabled:H.identifier||t.unref(V)(H),"onUpdate:modelValue":_e=>t.unref(S)(H,_e)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-nid-${H.modelId}`,label:"@NaturalId","model-value":!!H.naturalId,disabled:H.identifier||t.unref(A)(H)||t.unref(V)(H),"onUpdate:modelValue":_e=>t.unref(y)(H,_e)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{class:"em-aw__dsub",name:`aw-nidm-${H.modelId}`,label:"mutable","model-value":!!H.naturalIdMutable,disabled:t.unref(A)(H)||!H.naturalId,"onUpdate:modelValue":_e=>t.unref(u)(H,{naturalIdMutable:_e||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`aw-mv-${H.modelId}`,label:"Multi-Value (Set)","model-value":!!((an=H.dbAttrs[0])!=null&&an.multiValue),disabled:t.unref(A)(H)||t.unref(V)(H),"onUpdate:modelValue":_e=>t.unref(w)(H,{multiValue:_e||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),t.unref(V)(H)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("fieldset",Ov,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.attr.semanticLegend")),1),t.createElementVNode("label",Lv,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createVNode(t.unref(oe.BSSelect),{width:"150px","model-value":t.unref(M)(H),items:t.unref(s),"value-provider":t.unref(d),"label-provider":t.unref(c),"onUpdate:modelValue":_e=>_e&&t.unref(x)(H,_e)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.unref(ie).length?(t.openBlock(),t.createElementBlock("label",Pv,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.codeGroup")),1),t.createVNode(dp,{"model-value":H.groupCode,items:t.unref(ie),locale:t.unref(o).uiLocale.value,"onUpdate:modelValue":_e=>t.unref(He)(H,_e)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.createElementVNode("label",zv,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.defaultValue")),1),t.unref(fe)(H).length?(t.openBlock(),t.createBlock(t.unref(oe.BSSelect),{key:0,width:"150px","model-value":H.defaultValue??"none",items:t.unref(pe)(H),"value-provider":t.unref(ge),"label-provider":t.unref(Te),"onUpdate:modelValue":_e=>_e&&t.unref(De)(H,_e)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])):(t.openBlock(),t.createBlock(t.unref(oe.BSTextInput),{key:1,name:`aw-default-${H.modelId}`,width:"150px",placeholder:t.unref(o).t("em.attr.defaultValue"),"model-value":H.defaultValue??"","onUpdate:modelValue":_e=>t.unref(Z)(H,_e)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))])])),t.createElementVNode("fieldset",Fv,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`aw-desc-${H.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":H.description,"onUpdate:modelValue":_e=>t.unref(re)(H,_e)},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",gC,[t.createElementVNode("td",bC,t.toDisplayString(t.unref(o).t("em.attr.empty")),1)]))])])])],8,av)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-2bbe40a8"]]);function Ms(e,n){return n&&n!==e?`${e} (${n})`:e}function fp(e,n,o){const i=e.dbAttrs[n];return i?di(e,i,n,o.entity,o.logical,{embeddableCatalog:o.embeddableCatalog}):""}function EC(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}):Ms(o,fp(e,0,n))}function Vs(e,n){var l;if(Xn(e)){const s=(l=n.inherited)==null?void 0:l.find(c=>c.modelId===e);return s?Ms(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 Ms(i,fp(o,r<0?0:r,n))}function pp(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:EC(o,e)});continue}for(const a of i)n.push({ref:a.modelId,label:Vs(a.modelId,e)})}}return n}const NC=["disabled"],wC={class:"em-idxw__list"},IC={class:"em-idxw__list-head"},vC=["aria-label"],CC=["aria-current","onClick","onKeydown"],SC={class:"em-idxw__item-name"},xC={key:0,class:"em-idxw__badge"},RC={class:"em-idxw__item-cnt"},AC={key:0,class:"em-idxw__empty"},$C={key:0,class:"em-idxw__edit"},TC={class:"em-idxw__form"},MC={class:"em-field em-idxw__name"},VC={class:"em-field"},BC=["value","placeholder"],DC={class:"em-idxw__transfer"},OC={class:"em-idxw__pane"},LC={class:"em-idxw__pane-head"},PC=["aria-label"],zC=["aria-pressed","onClick","onKeydown"],FC=["title"],UC={key:0,class:"em-idxw__empty"},HC={class:"em-idxw__arrows"},jC={class:"em-idxw__pane"},KC={class:"em-idxw__pane-head"},GC={class:"em-idxw__col-name"},YC=["title"],qC={class:"em-idxw__col-ops"},WC=["title","disabled","onClick"],JC=["title","disabled","onClick"],XC=["title","onClick"],ZC={key:0,class:"em-idxw__empty"},QC={key:1,class:"em-idxw__edit em-idxw__edit--empty"},eS=Qe(t.defineComponent({__name:"EntityIndexesWide",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=t.computed(()=>o.state.logical.entities.find(T=>T.modelId===n.entityId)??null),a=t.computed(()=>{var T;return((T=i.value)==null?void 0:T.indexes)??[]}),r=t.computed(()=>{var T;return((T=i.value)==null?void 0:T.attributes)??[]}),l=t.ref(null),s=t.ref(null);t.watch(a,T=>{var w;T.some(I=>I.modelId===s.value)||(s.value=((w=T[0])==null?void 0:w.modelId)??null)},{immediate:!0});const c=t.computed(()=>a.value.find(T=>T.modelId===s.value)??null),d=t.computed(()=>i.value?ci(i.value,o.superClassCatalog.value):[]),u=t.computed(()=>Jn(r.value)),m=T=>u.value.canon(T),p=t.computed(()=>{var T;return new Set((((T=c.value)==null?void 0:T.columns)??[]).map(w=>m(w.columnRef)))}),f=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 h(T){return T.physicalName&&T.physicalName!==T.field?`${T.field} (${T.physicalName})`:T.field}function g(T){return Vs(T,f.value)}const b=t.computed(()=>[...pp(f.value).filter(T=>!p.value.has(m(T.ref))).map(T=>({ref:T.ref,label:T.label,inherited:!1})),...d.value.filter(T=>!p.value.has(m(T.modelId))).map(T=>({ref:T.modelId,label:h(T),inherited:!0}))]),_=t.ref(new Set);t.watch(s,()=>_.value=new Set);function k(T){return Xn(T)}function N(T,w){i.value&&o.updateIndex(i.value.modelId,T,w)}function y(){var w;if(!i.value)return;const T=Pe();o.addIndex(i.value.modelId,{modelId:T,name:`idx_${(((w=i.value.indexes)==null?void 0:w.length)??0)+1}`,unique:!1,columns:[]}),s.value=T}function E(T){i.value&&o.removeIndex(i.value.modelId,T)}function S(T){c.value&&N(c.value.modelId,{parameters:T.trim()===""?void 0:T})}function A(T){const w=new Set(_.value);w.has(T)?w.delete(T):w.add(T),_.value=w}function V(){const T=c.value;if(!T||!_.value.size)return;const w=[..._.value].map(I=>({columnRef:I,descending:!1}));N(T.modelId,{columns:[...T.columns,...w]}),_.value=new Set}function $(T){const w=c.value;w&&N(w.modelId,{columns:w.columns.filter((I,v)=>v!==T)})}function O(T,w){const I=c.value;I&&N(I.modelId,{columns:I.columns.map((v,B)=>B===T?{...v,descending:w}:v)})}function C(T,w){const I=c.value;if(!I)return;const v=T+w;if(v<0||v>=I.columns.length)return;const B=[...I.columns];[B[T],B[v]]=[B[v],B[T]],N(I.modelId,{columns:B}),R(v,w)}async function R(T,w){var x,P;await t.nextTick();const I=(x=l.value)==null?void 0:x.querySelectorAll(".em-idxw__col--idx")[T];if(!I)return;const v=Y=>I.querySelector(`[data-move="${Y}"]`),B=v(w<0?"up":"down"),M=v(w<0?"down":"up");(P=B&&!B.disabled?B:M)==null||P.focus()}return(T,w)=>i.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-idxw",disabled:!t.unref(o).editable.value},[t.createElementVNode("aside",wC,[t.createElementVNode("div",IC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.index.section",{n:a.value.length})),1),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:y},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,I=>(t.openBlock(),t.createElementBlock("li",{key:I.modelId,class:t.normalizeClass(["em-idxw__item",{"is-active":I.modelId===s.value}]),role:"button",tabindex:"0","aria-current":I.modelId===s.value?"true":void 0,onClick:v=>s.value=I.modelId,onKeydown:[t.withKeys(t.withModifiers(v=>s.value=I.modelId,["prevent"]),["enter"]),t.withKeys(t.withModifiers(v=>s.value=I.modelId,["prevent"]),["space"])]},[t.createElementVNode("span",SC,t.toDisplayString(I.name||t.unref(o).t("em.attr.nameless")),1),I.unique?(t.openBlock(),t.createElementBlock("span",xC,"UQ")):t.createCommentVNode("",!0),t.createElementVNode("span",RC,t.toDisplayString(I.columns.length),1)],42,CC))),128))],8,vC),a.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",AC,t.toDisplayString(t.unref(o).t("em.index.empty")),1))]),c.value?(t.openBlock(),t.createElementBlock("section",$C,[t.createElementVNode("div",TC,[t.createElementVNode("label",MC,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.index.namePlaceholder")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"idxw-name",width:"100%","model-value":c.value.name,"onUpdate:modelValue":w[0]||(w[0]=I=>N(c.value.modelId,{name:I}))},null,8,["model-value"]),t.createVNode(vo,{controller:t.unref(o),"ref-id":c.value.modelId},null,8,["controller","ref-id"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:"idxw-uq",class:"em-check em-idxw__uq",label:"unique","model-value":c.value.unique,"onUpdate:modelValue":w[1]||(w[1]=I=>N(c.value.modelId,{unique:I}))},null,8,["model-value"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn em-idxw__del",caption:t.unref(o).t("em.index.delete"),onClick:w[2]||(w[2]=I=>E(c.value.modelId))},null,8,["caption"])]),t.createElementVNode("label",VC,[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:w[3]||(w[3]=I=>S(I.target.value))},null,40,BC)]),t.createElementVNode("div",DC,[t.createElementVNode("div",OC,[t.createElementVNode("div",LC,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,I=>(t.openBlock(),t.createElementBlock("li",{key:I.ref,class:t.normalizeClass(["em-idxw__col",{"is-sel":_.value.has(I.ref)}]),role:"button",tabindex:"0","aria-pressed":_.value.has(I.ref),onClick:v=>A(I.ref),onKeydown:[t.withKeys(t.withModifiers(v=>A(I.ref),["prevent"]),["enter"]),t.withKeys(t.withModifiers(v=>A(I.ref),["prevent"]),["space"])]},[t.createTextVNode(t.toDisplayString(I.label),1),I.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,FC)):t.createCommentVNode("",!0)],42,zC))),128))],8,PC),b.value.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",UC,t.toDisplayString(t.unref(o).t("em.index.allColumnsUsed")),1))]),t.createElementVNode("div",HC,[t.createVNode(t.unref(oe.BSButton),{caption:t.unref(o).t("em.index.addArrow"),disabled:!_.value.size,onClick:V},null,8,["caption","disabled"])]),t.createElementVNode("div",jC,[t.createElementVNode("div",KC,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,(I,v)=>(t.openBlock(),t.createElementBlock("li",{key:v,class:"em-idxw__col em-idxw__col--idx"},[t.createElementVNode("span",GC,[t.createTextVNode(t.toDisplayString(g(I.columnRef)),1),k(I.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,YC)):t.createCommentVNode("",!0)]),t.createVNode(t.unref(oe.BSCheckbox),{name:`idxw-desc-${v}`,class:"em-check",label:"DESC","model-value":I.descending,"onUpdate:modelValue":B=>O(v,B)},null,8,["name","model-value","onUpdate:modelValue"]),t.createElementVNode("span",qC,[t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn","data-move":"up",title:t.unref(o).t("em.index.moveUp"),disabled:v===0,onClick:B=>C(v,-1)},"↑",8,WC),t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn","data-move":"down",title:t.unref(o).t("em.index.moveDown"),disabled:v===c.value.columns.length-1,onClick:B=>C(v,1)},"↓",8,JC),t.createElementVNode("button",{type:"button",class:"em-idxw__opbtn em-idxw__opbtn--del",title:t.unref(o).t("em.index.removeColumn"),onClick:B=>$(v)},"✕",8,XC)])]))),128)),c.value.columns.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("li",ZC,t.toDisplayString(t.unref(o).t("em.index.noColumns")),1))],512)])])])):(t.openBlock(),t.createElementBlock("section",QC,t.toDisplayString(t.unref(o).t("em.index.selectPrompt")),1))],8,NC)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-76dd7610"]]),tS={class:"em-op-src"},nS=["placeholder"],oS={class:"em-op-src__actions"},hp=Qe(t.defineComponent({__name:"OperationSourceEditor",props:{operationName:{},sourceCode:{},onSave:{type:Function},locale:{}},setup(e){const n=e,o=oe.useModalHandle(),i=(l,s)=>en(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(oe.BSModalFrame),{title:i("em.opSource.title",{name:n.operationName})},{default:t.withCtx(()=>[t.createElementVNode("div",tS,[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,nS),[[t.vModelText,a.value]]),t.createElementVNode("div",oS,[t.createVNode(t.unref(oe.BSButton),{caption:i("em.common.save"),onClick:r},null,8,["caption"]),t.createVNode(t.unref(oe.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"]]),iS=["disabled"],aS={class:"em-ow__toolbar"},rS={class:"em-ow__count"},lS={class:"em-ow__scroll"},sS={class:"em-ow__table"},cS={class:"c-name"},dS={class:"c-desc"},uS=["id"],mS={class:"c-pii"},fS={class:"c-src"},pS={class:"c-del"},hS={key:0},yS={colspan:"6",class:"em-ow__empty"},gS=Qe(t.defineComponent({__name:"EntityOperationsWide",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=oe.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)=>_.order-k.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,_){a.value&&o.updateOperation(a.value.modelId,b.modelId,_)}function p(b,_){m(b,{description:Object.keys(_).length?_:void 0})}function f(b){return b.personalInfoAttributeType??"none"}function h(b,_){m(b,{personalInfoAttributeType:_==="none"?void 0:_})}function g(b){i.openModal({component:hp,bind:{operationName:b.name,sourceCode:b.sourceCode??"",locale:o.uiLocale.value,onSave:_=>m(b,{sourceCode:_})}})}return(b,_)=>{var k,N;return a.value?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-ow",disabled:!t.unref(o).editable.value},[t.createElementVNode("div",aS,[t.createElementVNode("span",rS,t.toDisplayString(t.unref(o).t("em.op.section",{n:((k=a.value.operations)==null?void 0:k.length)??0})),1),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:_[0]||(_[0]=y=>t.unref(o).addOperation(a.value.modelId))},null,8,["caption"])]),t.createElementVNode("div",lS,[t.createElementVNode("table",sS,[t.createElementVNode("thead",null,[t.createElementVNode("tr",null,[t.createElementVNode("th",cS,t.toDisplayString(t.unref(o).t("em.attr.namePlaceholder")),1),_[2]||(_[2]=t.createElementVNode("th",{class:"c-vis"},"visibility",-1)),t.createElementVNode("th",dS,[t.createElementVNode("span",{id:`ow-desc-head-${a.value.modelId}`},t.toDisplayString(t.unref(o).t("em.common.description")),9,uS),t.createVNode(up,{modelValue:l.value,"onUpdate:modelValue":_[1]||(_[1]=y=>l.value=y),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",mS,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createElementVNode("th",fS,t.toDisplayString(t.unref(o).t("em.op.body")),1),_[3]||(_[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,y=>(t.openBlock(),t.createElementBlock("tr",{key:y.modelId},[t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSTextInput),{name:`ow-name-${y.modelId}`,width:"100%",placeholder:t.unref(o).t("em.op.namePlaceholder"),"model-value":y.name,"onUpdate:modelValue":E=>m(y,{name:E})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSSelect),{width:"100%","model-value":y.visibility??"PACKAGE",items:s,"value-provider":u,"label-provider":u,"onUpdate:modelValue":E=>E&&m(y,{visibility:E})},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(Qt,{name:`ow-desc-${y.modelId}`,languages:t.unref(o).languages.value,"active-lang":l.value,"model-value":y.description,"onUpdate:modelValue":E=>p(y,E)},null,8,["name","languages","active-lang","model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSSelect),{width:"100%","model-value":f(y),items:c,"value-provider":u,"label-provider":d,"onUpdate:modelValue":E=>E&&h(y,E)},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("td",null,[t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t(y.sourceCode?"em.op.bodyDirty":"em.op.body"),onClick:E=>g(y)},null,8,["caption","onClick"])]),t.createElementVNode("td",pS,[t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:E=>t.unref(o).removeOperation(a.value.modelId,y.modelId)},null,8,["onClick"])])]))),128)),(N=a.value.operations)!=null&&N.length?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("tr",hS,[t.createElementVNode("td",yS,t.toDisplayString(t.unref(o).t("em.op.empty")),1)]))])])])],8,iS)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-743b04a6"]]),bS={class:"em-detail__tabs"},_S=["onClick"],kS={key:0,class:"em-detail__lock"},ES=["disabled"],NS={key:0,class:"em-detail__narrow"},wS=Qe(t.defineComponent({__name:"EntityDetailModal",props:{controller:{},entityId:{}},setup(e){const n=e,o=n.controller,i=oe.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(oe.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",bS,[(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:p=>s.value=m.key},t.toDisplayString(t.unref(o).t(m.labelKey)),11,_S)),64))]),a.value?(t.openBlock(),t.createElementBlock("div",kS,[t.createVNode(Ve,{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",NS,[t.createVNode(op,{controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])])):s.value==="columns"?(t.openBlock(),t.createBlock(kC,{key:1,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])):s.value==="indexes"?(t.openBlock(),t.createBlock(eS,{key:2,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"])):(t.openBlock(),t.createBlock(gS,{key:3,controller:t.unref(o),"entity-id":r.value.modelId},null,8,["controller","entity-id"]))],10,ES)],2)):t.createCommentVNode("",!0)]),_:1},8,["title"])}}}),[["__scopeId","data-v-328396cc"]]);function hr(e,n,o){e.openModal({component:wS,bind:{controller:t.markRaw(n),entityId:o}})}function xn(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=>jd(e,r))}function tn(e,n){if(!n.length)return[];const o=new Map;for(const{entityId:a,attributeId:r}of n){const l=o.get(a)??[];l.push(r),o.set(a,l)}const i=[];for(const[a,r]of o){const l=e.entities.find(s=>s.modelId===a);if(l)for(const s of Nu(l,r))i.push($a(a,s.indexRef,{columns:s.columns}))}return i}function yr(e,n,o,i){var c;const a=[];a.push(...xn(n,o.remove,i));for(const d of o.update)a.push(qt(n,d.attributeId,d.patch));for(const d of o.add)a.push(Yt(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 p=l.filter(f=>{var h;return((h=f.derivedFrom)==null?void 0:h.associationRef)===d.modelId&&f.dbAttrs.length>0}).sort((f,h)=>f.order-h.order)[0];p&&a.push(Wt(d.modelId,"end2",{attributeRef:p.modelId}))}return a}function ti(e,n,o){return{...e,entities:e.entities.map(i=>i.modelId===n?{...i,attributes:o(i.attributes)}:i)}}function Ui(e,n,o){const i=[];for(const[a,r]of cl(e,n,Pe))i.push(...yr(e,a,r,o));for(const a of wu(e,n,Pe))i.push(qt(a.entityId,a.attributeId,{dbAttrs:a.dbAttrs}));return i}function IS(e,n,o,i){const a=e.entities.find(l=>l.modelId===n);if(!a)return[];const r=Il([...a.attributes].sort((l,s)=>l.order-s.order),o,i).map(l=>l.modelId);return Iu(e,n,r).map(l=>qt(l.entityId,l.attributeId,{dbAttrs:l.dbAttrs}))}function yp(e,n,o){return vu(e,n,o).map(i=>qt(i.entityId,i.attributeId,{dbAttrs:i.dbAttrs}))}function vS(e,n,o){const i=new Set(o.remove);return ti(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 gr(e,n,o){const i=[];for(const{entityId:a,plan:r}of nd(e,n,Pe))i.push(...yr(e,a,r,o));return i}function gp(e,n,o=new Set){var r,l;if(!hn(n))return[];const i=[];for(const s of e.attributes){if(o.has(s.modelId))continue;const c={};s.dbAttrs.length>0&&(c.dbAttrs=[]),s.notNull&&(c.notNull=!1),Object.keys(c).length>0&&i.push(qt(e.modelId,s.modelId,c))}const a={};return(r=e.table)!=null&&r.physicalName&&(a.table=null),(l=e.indexes)!=null&&l.length&&(a.indexes=[]),e.schema&&(a.schema=null),e.jpaAttrs&&(a.jpaAttrs=null),Object.keys(a).length>0&&i.push(Vl(e.modelId,a)),i}function bp(e){return gn(e).map(n=>({...n.col,modelId:Pe()}))}function CS(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),p=new Set(o.attributes.map(h=>h.name));let f="id";for(let h=2;p.has(f);h++)f=`id${h}`;a={modelId:Pe(),name:f,type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:m,dbAttrs:[{modelId:Pe(),physicalName:f.toLowerCase(),dataType:"BIGINT"}]},i.push(Yt(n,a))}const r=[];for(const m of e.entities)for(const p of m.attributes){if(((u=p.embedded)==null?void 0:u.embeddableRef)!==n)continue;const f=e.associations.find(_=>_.modelId===p.embedded.associationRef);if(!f)continue;const h=f.end1.entityRef===m.modelId,g=h?f.end1:f.end2,b=h?f.end2:f.end1;r.push({ownerId:m.modelId,dispId:p.modelId,assocId:f.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 p=new Set(r.filter(f=>f.ownerId===m.modelId).map(f=>f.dispId));return p.size?{...m,attributes:m.attributes.filter(f=>!p.has(f.modelId))}:m}),associations:e.associations.map(m=>{const p=r.find(f=>f.assocId===m.modelId);return p?{...m,end1:p.end1,end2:p.end2}:m})},s=pi(l,n,Pe);for(const m of r){const p=s.add.find(f=>{var h;return((h=f.derivedFrom)==null?void 0:h.associationRef)===m.assocId});p&&(m.end2.attributeRef=p.modelId)}const c=[];for(const m of r)i.push(...xn(m.ownerId,[m.dispId],c)),i.push(Aa(m.assocId,{end1:m.end1,end2:m.end2}));i.push(...yr(l,n,s,c));const d=vS(l,n,s);return i.push(...Ui(d,n,c)),i.push(...tn(e,c)),i}function SS(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(N=>N.modelId===c);if(!d||d.attributes.some(N=>{var y;return((y=N.embedded)==null?void 0:y.associationRef)===r.modelId}))continue;const u=Pe(),m=jt(d.attributes),p=new Set(d.attributes.map(N=>N.name)),f=a(o.name);let h=f;for(let N=2;p.has(h);N++)h=`${f}${N}`;const g=o.attributes.filter(N=>!N.identifier&&!N.derivedFrom).flatMap(N=>N.dbAttrs).map(N=>({...N,modelId:Pe()})),b={modelId:u,name:h,type:o.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:m,dbAttrs:g,embedded:{associationRef:r.modelId,embeddableRef:n}};i.push(Yt(c,b));const _=l?"end2":"end1",k=l?"end1":"end2";i.push(Aa(r.modelId,{identifying:!1,[_]:{entityRef:c,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:Pe()},[k]:{entityRef:n,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:u}}))}return i}function _p(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=[zd(n,o),...i.map(u=>Uo(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 p=e.layout.associationLayouts.find(f=>f.associationRef===m.modelId);p&&p.waypoints.length&&c.push(nu(m.modelId,l,s))}for(const m of(a==null?void 0:a.memberNoteRefs)??[]){const p=e.layout.notes.find(f=>f.modelId===m);p&&c.push(Ei(m,{x:p.geo.location.x+l,y:p.geo.location.y+s}))}}return c}function xS(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=Pe(),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}},p={...n.logical,associations:[...n.logical.associations,m]},f=pi(p,s,Pe),h=f.add[0];h&&(m.end2.attributeRef=h.modelId);const g={associationRef:u,waypoints:[],sourceColumnRef:c,targetColumnRef:(h==null?void 0:h.modelId)??d},b=Ra(m,g),_=yr(p,s,f,[]);return i(_.length?at("관계 추가",[b,..._]):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=Pe(),m=Pe(),p=Pe(),f=jt(c.attributes),h=bp(d),g=S=>S&&S.charAt(0).toLowerCase()+S.slice(1),b=new Set(c.attributes.map(S=>S.name)),_=g(d.name);let k=_;for(let S=2;b.has(k);S++)k=`${_}${S}`;const N={modelId:m,name:k,type:d.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:f,dbAttrs:h,embedded:{associationRef:u,embeddableRef:s}},y={modelId:u,end1:{entityRef:l,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:p},end2:{entityRef:s,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:m}},E={associationRef:u,waypoints:[],sourceColumnRef:m,targetColumnRef:void 0};return i(at("임베드 추가",[Yt(l,N),Ra(y,E)])),u},setEmbedCardinality(l,s){var _;if(r(l))return;const c=n.logical.associations.find(k=>k.modelId===l);if(!c)return;let d,u;for(const k of n.logical.entities){const N=k.attributes.find(y=>{var E;return((E=y.embedded)==null?void 0:E.associationRef)===l&&y.attrType==="EMBED_OWN"});if(N){d=k.modelId,u=N;break}}if(!d||!u)return;const m=u.embedded.embeddableRef,p=c.end2.entityRef===m?"end2":"end1",f=c[p];if(f.multiplicity===s)return;const h=k=>k==="ZERO_OR_MORE_INSTANCES"||k==="ONE_OR_MORE_INSTANCES",g=h(f.multiplicity),b=h(s);if(g===b){i(Wt(l,p,{multiplicity:s}));return}if(b)i(at("임베드 컬렉션 전환",[qt(d,u.modelId,{dbAttrs:[]}),Wt(l,p,{multiplicity:s,jpa:{...f.jpa,collectionType:((_=f.jpa)==null?void 0:_.collectionType)??"LIST"}})]));else{const k=n.logical.entities.find(N=>N.modelId===m);if(!k)return;i(at("임베드 단일 전환",[qt(d,u.modelId,{dbAttrs:bp(k)}),Wt(l,p,{multiplicity:s,jpa:{...f.jpa,collectionType:void 0,collectionTable:void 0,orderColumn:void 0}})]))}},removeAssociation(l){if(r(l))return;const s=n.logical.associations.find(f=>f.modelId===l),c=Xd(l);if(!s){i(c);return}for(const f of n.logical.entities){const h=f.attributes.find(g=>{var b;return((b=g.embedded)==null?void 0:b.associationRef)===l});if(h){const g=[];i(at("임베드 삭제",[c,...xn(f.modelId,[h.modelId],g),...tn(n.logical,g)]));return}}const d=s.end2.entityRef,u={...n.logical,associations:n.logical.associations.filter(f=>f.modelId!==l)},m=[],p=gr(u,[d],m);if(s.end1.attributeRef){const f=n.logical.entities.find(g=>g.modelId===s.end1.entityRef),h=f==null?void 0:f.attributes.find(g=>g.modelId===s.end1.attributeRef&&g.attrType==="RELATION_REF");h&&p.push(...xn(f.modelId,[h.modelId],m))}p.push(...tn(n.logical,m)),i(p.length?at("관계 삭제",[c,...p]):c)},setAssociationIdentifying(l,s){if(r(l))return;const c=n.logical.associations.find(h=>h.modelId===l),d=Aa(l,{identifying:s});if(!c||c.identifying===s){i(d);return}const u=c.end2.entityRef,m={...n.logical,associations:n.logical.associations.map(h=>h.modelId===l?{...h,identifying:s}:h)},p=[],f=gr(m,[u],p);f.push(...tn(n.logical,p)),i(f.length?at("식별 관계 변경",[d,...f]):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=n.logical.entities.find(f=>f.modelId===d.end1.entityRef),m=n.logical.entities.find(f=>f.modelId===d.end2.entityRef),p=(u==null?void 0:u.stereotype)==="JPA_EMBEDDABLE"||(m==null?void 0:m.stereotype)==="JPA_EMBEDDABLE";if(u&&m&&!p){if(c.navigable===!0&&!d.end1.attributeRef){const f=sa(d.end2.multiplicity),h=d.end1.navFieldNameHint||da(m.name,f),g=eo(h,new Set(u.attributes.map(N=>N.name))),b=Pe(),_=jt(u.attributes),k={modelId:b,name:g,type:m.name,attrType:"RELATION_REF",identifier:!1,notNull:!1,order:_,dbAttrs:[]};i(at("inverse nav 추가",[Yt(d.end1.entityRef,k),Wt(l,"end1",{...c,attributeRef:b,navFieldNameHint:void 0})]));return}if(c.navigable===!1&&d.end1.attributeRef){const f=d.end1.attributeRef,h=u.attributes.find(k=>k.modelId===f&&k.attrType==="RELATION_REF"),g=Wt(l,"end1",{...c,attributeRef:void 0,navFieldNameHint:(h==null?void 0:h.name)??d.end1.navFieldNameHint}),b=[],_=h?xn(d.end1.entityRef,[f],b):[];i(h?at("inverse nav 제거",[..._,g,...tn(n.logical,b)]):g);return}}}i(Wt(l,s,c))}}}function RS(e){const{state:n,editable:o,run:i,gateEntityLocked:a,embeddableCatalog:r,t:l,emitGateNotice:s,selection:c}=e,d=(u,m,p)=>{if(a(u))return;const f=qt(u,m,p),h=ti(n.logical,u,_=>_.map(k=>k.modelId===m?{...k,...p}:k)),g=[],b=Ui(h,u,g);b.push(...tn(n.logical,g)),i(b.length?at("속성 수정",[f,...b]):f)};return{addPredefinedEmbed(u,m){if(!o.value||a(u))return null;const p=r.value.find(k=>k.type===m),f=n.logical.entities.find(k=>k.modelId===u);if(!p||!f)return null;const h=jt(f.attributes),g=Pe(),b=p.fields.map(()=>({modelId:Pe(),physicalName:"",dataType:""})),_={modelId:g,name:p.defaultName,type:p.type,attrType:"EMBED_PREDEF",identifier:!1,notNull:!1,order:h,dbAttrs:b};return i(Yt(u,_)),g},addSerializedTypeAttribute(u,m){if(!o.value||a(u))return null;const p=n.logical.entities.find(_=>_.modelId===u),f=n.logical.entities.find(_=>_.modelId===m);if(!p||!f||!hn(f.stereotype)||!f.name)return null;const h=f.name.charAt(0).toLowerCase()+f.name.slice(1),g=eo(h,new Set(p.attributes.map(_=>_.name))),b=Pe();return i(Yt(u,{modelId:b,name:g,type:f.name,attrType:"NORMAL",identifier:!1,notNull:!1,order:jt(p.attributes),dbAttrs:[{modelId:Pe(),physicalName:g,dataType:"CLOB"}]})),b},addAttribute(u,m={}){if(!o.value||a(u))return null;const p=n.logical.entities.find(E=>E.modelId===u),f=p?jt(p.attributes):0,h=m.modelId??Pe(),g=m.name??`field${f}`,b={modelId:h,name:g,type:m.type??tl,attrType:m.attrType??"NORMAL",identifier:m.identifier??!1,notNull:m.notNull??!1,order:f,dbAttrs:m.dbAttrs??(p&&hn(p.stereotype)?[]:[{modelId:Pe(),physicalName:g,dataType:"VARCHAR"}]),...m},_=Yt(u,b),k=ti(n.logical,u,E=>[...E,b]),N=[],y=Ui(k,u,N);return y.push(...tn(n.logical,N)),i(y.length?at("속성 추가",[_,...y]):_),h},addDivider(u){if(!o.value||a(u))return null;const m=n.logical.entities.find(g=>g.modelId===u),p=m?jt(m.attributes):0,f=Pe();return i(Yt(u,{modelId:f,name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:p,dbAttrs:[]})),f},updateAttribute(u,m,p){d(u,m,p)},setAttributeGroupCode(u,m,p){d(u,m,{groupCode:p,type:p?to:tl})},setEmbedColumns(u,m,p){var k,N;if(a(u))return;const f=qt(u,m,{dbAttrs:p}),h=(k=n.logical.entities.find(y=>y.modelId===u))==null?void 0:k.attributes.find(y=>y.modelId===m),g=(N=h==null?void 0:h.embedded)==null?void 0:N.associationRef,b=g?n.logical.associations.find(y=>y.modelId===g):void 0,_=[];b&&g&&(b.end1.legacyEmbedRaw&&_.push(Wt(g,"end1",{legacyEmbedRaw:void 0})),b.end2.legacyEmbedRaw&&_.push(Wt(g,"end2",{legacyEmbedRaw:void 0}))),i(_.length?at("임베드 컬럼 수정",[f,..._]):f)},removeAttribute(u,m){if(a(u))return;if(Po(n.logical,u,m)){s(l("em.attr.fkDeleteHint"));return}const p=[],f=xn(u,[m],p),h=ti(n.logical,u,_=>_.filter(k=>k.modelId!==m)),g=[...Ui(h,u,p),...tn(n.logical,p),...yp(n.logical,u,[m])],b=[...f,...g];i(b.length===1?b[0]:at("속성 삭제",b))},removeAttributes(u,m){var k;if(!m.length||a(u))return;const p=m.filter(N=>!Po(n.logical,u,N));if(p.length<m.length&&s(l("em.attr.fkDeleteHint")),!p.length)return;const f=[],h=xn(u,p,f),g=new Set(p),b=ti(n.logical,u,N=>N.filter(y=>!g.has(y.modelId))),_=[...h,...Ui(b,u,f),...tn(n.logical,f),...yp(n.logical,u,p)];i(_.length===1?_[0]:at("속성 삭제",_)),((k=c.value)==null?void 0:k.kind)==="attribute"&&c.value.entityId===u&&(c.value=null)},setAttributeSwatch(u,m,p){i(Ca(u,m,p))},setAttributeSwatches(u,m,p){m.length&&(m.length===1?i(Ca(u,m[0],p)):i(at("속성 색상",m.map(f=>Ca(u,f,p)))))},reorderAttributes(u,m,p){if(!m.length||a(u))return;const f=Dl(u,m,p),h=IS(n.logical,u,m,p);i(h.length?at("속성 재정렬",[f,...h]):f)}}}function AS(e){var i;const n=JSON.parse(JSON.stringify(e));n.modelId=Pe(),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=Pe();o.set(a.modelId,r),a.modelId=r;for(const l of a.dbAttrs)l.modelId=Pe()}for(const a of n.indexes??[]){a.modelId=Pe();for(const r of a.columns)r.columnRef=o.get(r.columnRef)??r.columnRef}for(const a of n.operations??[]){const r=Pe();o.set(a.modelId,r),a.modelId=r}return{clone:n,idMap:o}}const $S=220;function TS(e,n){let i=-1/0;for(const r of e.entityLayouts)i=Math.max(i,r.geo.location.x+(r.geo.size.width||$S));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 Bs=(e,n)=>({x:e.x+n.x,y:e.y+n.y});function MS(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(_=>_.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(_=>_.modelId===d.entityId);if(!g)return;const b=[...g.attributes].sort((_,k)=>_.order-k.order).filter(_=>d.ids.includes(_.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),p=n.layout.entityLayouts.find(g=>g.entityRef===u);if(!m)return;const f=(p==null?void 0:p.geo)??{location:{x:80,y:80},size:{width:220,height:140}};let h;if(p){const{entityRef:g,geo:b,locked:_,...k}=p;Object.keys(k).length&&(h=k)}o.value=JSON.parse(JSON.stringify({kind:"entity",entity:m,geo:f,layoutExtras:h}))},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 f=a.value;if(!f)return[];const h=n.logical.entities.find(y=>y.modelId===f);if(!h)return[];const g=new Set(h.attributes.map(y=>y.name)),b=new Set(h.attributes.flatMap(y=>y.dbAttrs.map(E=>E.physicalName))),_=jt(h.attributes),k=[],N=c.attributes.map((y,E)=>{const S=JSON.parse(JSON.stringify(y));S.modelId=Pe();for(const A of S.dbAttrs)A.modelId=Pe();g.has(S.name)&&(S.name=eo(`${S.name}_copy`,g)),g.add(S.name);for(const A of S.dbAttrs)A.physicalName&&b.has(A.physicalName)&&(A.physicalName=eo(`${A.physicalName}_copy`,b)),A.physicalName&&b.add(A.physicalName);return S.order=_+E,k.push(S.modelId),Yt(f,S)});return l(N.length===1?N[0]:at("속성 붙여넣기",N)),i.value={kind:"attribute",entityId:f,ids:k,anchor:k[k.length-1]},[]}const{clone:d,idMap:u}=AS(c.entity),m={location:{x:c.geo.location.x+40,y:c.geo.location.y+40},size:{...c.geo.size}};let p;if(c.layoutExtras){const f={...c.layoutExtras},h=g=>u.get(g);f.attributeStyles&&(f.attributeStyles=Na(f.attributeStyles,h)),f.operationStyles&&(f.operationStyles=Na(f.operationStyles,h)),p=f}return l(va(d,m,p)),i.value={kind:"entity",id:d.modelId},[d.modelId]},importEntities(c,d,u){if(!r.value)return[];const m=wd(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 p=(u==null?void 0:u.placement)??"append-right",f=p==="append-right"?TS(n.layout,m.layout):p.offset,h=new Map(m.layout.entityLayouts.map(N=>[N.entityRef,N])),g=new Map(m.layout.associationLayouts.map(N=>[N.associationRef,N])),b=new Map(m.layout.groupLayouts.map(N=>[N.groupRef,N])),_=[];let k=80;for(const N of m.logical.entities){const y=h.get(N.modelId),E=y?{location:Bs(y.geo.location,f),size:{...y.geo.size}}:{location:{x:k+=40,y:80},size:{width:220,height:140}};let S;if(y){const{entityRef:A,geo:V,locked:$,...O}=y;S=O}_.push(va(N,E,S))}for(const N of m.logical.associations){const y=g.get(N.modelId),E=y?{...y,waypoints:y.waypoints.map(S=>Bs(S,f))}:{associationRef:N.modelId,waypoints:[]};_.push(Ra(N,E))}for(const N of m.logical.groups){const y=b.get(N.modelId),E=y?{location:Bs(y.geo.location,f),size:{...y.geo.size}}:{location:{x:80,y:80},size:{width:320,height:200}};let S;if(y){const{groupRef:A,geo:V,locked:$,memberNoteRefs:O,...C}=y;S=C}_.push(Sa(N,E,S))}return l(at("다이어그램 가져오기",_)),i.value={kind:"entity",id:m.logical.entities[0].modelId},m.logical.entities.map(N=>N.modelId)}};return s}function VS(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=Pe(),p={modelId:m,name:d,stereotype:"JPA_ENTITY",table:{physicalName:d.toLowerCase()},attributes:[{modelId:Pe(),name:"id",type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:0,dbAttrs:[{modelId:Pe(),physicalName:"id",dataType:"BIGINT"}]}]};return i(va(p,{location:{...u},size:{width:220,height:140}})),m},renameEntity(d,u){a(d)||i(Td(d,u))},updateEntity(d,u){if(a(d))return;const m=Vl(d,u),p=n.logical.entities.find(k=>k.modelId===d),f=p==null?void 0:p.stereotype,h=u.stereotype,g=!!h&&!!p&&!!f&&_t(h)&&!_t(f),b=!!h&&!!p&&!!f&&!_t(h)&&_t(f);if(!!h&&!!p&&!!f&&h!==f&&_t(h)&&_t(f)&&p){const k=n.logical.entities.filter(y=>y.attributes.some(E=>{var S;return((S=E.embedded)==null?void 0:S.embeddableRef)===d}));if(k.length>0){c(s("em.entity.valueTypeSwitchEmbedded",{name:p.name,owners:k.length}));return}const N=gp(p,h);i(N.length?at("직렬화 타입 변환",[m,...N]):m);return}if(h==="SERIALIZED_TYPE"&&p){const k=n.logical.associations.filter(N=>N.end1.entityRef===d||N.end2.entityRef===d);if(k.length>0){c(s("em.entity.serializedTypeHasRelations",{name:p.name,count:k.length}));return}}if(g&&p&&h){const k=p.attributes.filter($=>$.identifier&&!$.derivedFrom).map($=>qt(d,$.modelId,{identifier:!1})),N=ti({...n.logical,entities:n.logical.entities.map($=>$.modelId===d?{...$,stereotype:h}:$)},d,$=>$.map(O=>O.identifier&&!O.derivedFrom?{...O,identifier:!1}:O)),y=[],E=gr(N,[d],y);E.push(...tn(n.logical,y));const S=h==="JPA_EMBEDDABLE"?SS(n.logical,d):[],A=gp(p,h,new Set(y.filter($=>$.entityId===d).map($=>$.attributeId))),V=[m,...k,...E,...S,...A];i(V.length>1?at(h==="SERIALIZED_TYPE"?"직렬화 타입 변환":"임베더블 변환",V):m);return}if(b){const k=CS(n.logical,d),N=[m,...k];i(N.length>1?at("엔터티 전환",N):m);return}i(m)},moveEntity(d,u){a(d)||i(Uo(d,u))},resizeEntity(d,u){a(d)||i(Md(d,u))},removeEntity(d){if(a(d))return;const u=$d(d);if(!n.logical.entities.find(k=>k.modelId===d)){i(u);return}const p=n.logical.associations.filter(k=>k.end1.entityRef===d||k.end2.entityRef===d),f=new Set(p.map(k=>k.modelId)),h=[],g=[];for(const k of n.logical.entities)if(k.modelId!==d)for(const N of k.attributes)N.embedded&&f.has(N.embedded.associationRef)&&h.push(...xn(k.modelId,[N.modelId],g));for(const k of p){if(k.end1.entityRef===d||!k.end1.attributeRef)continue;const N=n.logical.entities.find(E=>E.modelId===k.end1.entityRef),y=N==null?void 0:N.attributes.find(E=>E.modelId===k.end1.attributeRef&&E.attrType==="RELATION_REF");y&&h.push(...xn(N.modelId,[y.modelId],g))}const b={...n.logical,entities:n.logical.entities.filter(k=>k.modelId!==d),associations:n.logical.associations.filter(k=>!f.has(k.modelId))},_=new Set(p.filter(k=>k.end1.entityRef===d&&k.end2.entityRef!==d).map(k=>k.end2.entityRef));h.push(...gr(b,[..._],g)),h.push(...tn(n.logical,g.filter(k=>k.entityId!==d))),i(h.length?at("엔티티 삭제",[u,...h]):u)},setEntitySwatch(d,u){i(Vd(d,u))},setEntityCollapsed(d,u){i(Bd(d,u))},setEntityLocked(d,u){i(Dd(d,u))},isEntityLocked(d){return r(d)},isAssociationLocked(d){return l(d)},collapseAll(){i(Bl(!0))},expandAll(){i(Bl(!1))}}}function BS(e){const{state:n,editable:o,run:i,selection:a,gateEntityLocked:r,gateGroupLocked:l,isGroupLockedFn:s}=e;function c(d){const u=d.map(_=>n.layout.entityLayouts.find(k=>k.entityRef===_)).filter(_=>!!_);if(!u.length)return{location:{x:40,y:40},size:{width:400,height:300}};let m=1/0,p=1/0,f=-1/0,h=-1/0;for(const _ of u){const k=_.geo.size.width||220,N=_.geo.size.height||140;m=Math.min(m,_.geo.location.x),p=Math.min(p,_.geo.location.y),f=Math.max(f,_.geo.location.x+k),h=Math.max(h,_.geo.location.y+N)}const g=40,b=28;return{location:{x:m-g,y:p-g-b},size:{width:f-m+g*2,height:h-p+g*2+b}}}return{dragGroup(d,u,m){l(d)||i(at("그룹 이동",_p(n,d,u,m)))},resizeGroup(d,u){l(d)||i(Fd(d,u))},setGroupSwatch(d,u){i(Ud(d,u))},setGroupLocked(d,u){i(Hd(d,u))},isGroupLocked(d){return s(d)},updateGroup(d,u){l(d)||i(Od(d,u))},createGroup(d,u){if(!o.value||!d.length)return null;const m=[];for(const h of n.logical.groups)for(const g of d)h.memberEntityRefs.includes(g)&&m.push(xa(h.modelId,g));const p=Pe(),f={modelId:p,name:u?{ko:u}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[...d]};return m.push(Sa(f,c(d))),i(at("그룹 생성",m)),a.value=null,p},addEmptyGroup(d,u){if(!o.value)return null;const m=Pe();return i(Sa({modelId:m,name:u?{ko:u}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[]},{location:{...d},size:{width:360,height:260}})),m},removeGroup(d){l(d)||i(Ld(d))},dropEntity(d,u,m){var h;if(r(d))return;const p=((h=n.logical.groups.find(g=>g.memberEntityRefs.includes(d)))==null?void 0:h.modelId)??null,f=[Uo(d,u)];p!==m&&(p&&f.push(xa(p,d)),m&&f.push(Pd(m,d))),i(at("이동",f))},ungroupEntity(d){const u=n.logical.groups.find(m=>m.memberEntityRefs.includes(d));u&&i(xa(u.modelId,d))},dropNote(d,u,m){var h;const p=((h=n.layout.groupLayouts.find(g=>{var b;return(b=g.memberNoteRefs)==null?void 0:b.includes(d)}))==null?void 0:h.groupRef)??null,f=[Ei(d,u)];p!==m&&(p&&f.push(uu(p,d)),m&&f.push(du(m,d))),i(at("이동",f))}}}function DS(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 _=new _u({diagramId:n.layout.diagramId,state:n,transport:e.opTransport,origin:"gui",onFreeze:k=>{i.value=!1,a.value=k},onError:e.onOpError});_.seed((b==null?void 0:b.revSeed)??{}),c=_.attach(g),s=_}const m=t.computed(()=>o.value&&r!==void 0),p=t.ref(0),f=t.computed(()=>o.value&&i.value&&l!==void 0);async function h(g){if(!l||!i.value)return{ok:!1,reason:"unavailable"};let b;try{b=await l(g)}catch(_){return{ok:!1,reason:_ instanceof Error?_.message:String(_)}}return b.ok&&p.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:f,restoreToSeq:h,reloadRequest:p}}function OS(e){const{editable:n,run:o}=e;return{addNote(i="메모",a={x:80,y:80}){if(!n.value)return null;const r=Pe();return o(au({modelId:r,memo:i,geo:{location:{...a},size:{width:200,height:120}}})),r},removeNote(i){o(ru(i))},moveNote(i,a){o(Ei(i,a))},resizeNote(i,a){o(lu(i,a))},setNoteMemo(i,a){o(su(i,a))},setNoteSwatch(i,a){o(cu(i,a))},addNoteConnection(i,a){o(mu(i,a))},removeNoteConnection(i,a){o(fu(i,a))},moveNoteConnectionWaypoint(i,a,r,l){o(pu(i,a,r,l))},addNoteConnectionWaypoint(i,a,r,l){o(hu(i,a,r,l))},removeNoteConnectionWaypoint(i,a,r){o(yu(i,a,r))},clearNoteConnectionWaypoints(i,a){o(gu(i,a))}}}function LS(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 p=o.value,f=(p==null?void 0:p.kind)==="attribute"&&p.entityId===d;if(m==="replace"||!f){o.value={kind:"attribute",entityId:d,ids:[u],anchor:u};return}if(m==="toggle"){const y=p.ids.includes(u),E=y?p.ids.filter(A=>A!==u):[...p.ids,u];if(!E.length){o.value=null;return}const S=y&&p.anchor===u?E[E.length-1]:y?p.anchor:u;o.value={kind:"attribute",entityId:d,ids:E,anchor:S};return}const h=n.logical.entities.find(y=>y.modelId===d),g=[...(h==null?void 0:h.attributes)??[]].sort((y,E)=>y.order-E.order).map(y=>y.modelId),b=g.indexOf(p.anchor),_=g.indexOf(u);if(b<0||_<0){o.value={kind:"attribute",entityId:d,ids:[u],anchor:u};return}const[k,N]=b<=_?[b,_]:[_,b];o.value={kind:"attribute",entityId:d,ids:g.slice(k,N+1),anchor:p.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 p=m.attributes.findIndex(g=>g.modelId===u.anchor);if(p<0)return!1;const f=Math.min(Math.max(p+d,0),m.attributes.length-1);if(f===p)return!0;const h=m.attributes[f].modelId;return o.value={kind:"attribute",entityId:u.entityId,ids:[h],anchor:h},!0},nudgeSelectedAttributes(d){const u=o.value;if((u==null?void 0:u.kind)!=="attribute")return!1;const m=n.logical.entities.find(y=>y.modelId===u.entityId);if(!m)return!1;const p=m.attributes,f=new Set(u.ids),h=p.map((y,E)=>f.has(y.modelId)?E:-1).filter(y=>y>=0);if(!h.length)return!1;const g=Math.min(...h),b=p.filter(y=>!f.has(y.modelId)),_=p.slice(0,g).filter(y=>!f.has(y.modelId)).length;let k;if(d<0){if(_<=0)return!0;k=_-1}else{if(b.length-_<=0)return!0;k=_+1}if(r(u.entityId))return!0;const N=p.filter(y=>f.has(y.modelId)).map(y=>y.modelId);return a(Dl(u.entityId,N,k)),!0},nudgeNodes(d,u,m){if(!d.length||u===0&&m===0)return!1;const p=new Set(n.logical.entities.map(k=>k.modelId)),f=new Set(n.logical.groups.map(k=>k.modelId)),h=new Set(n.layout.notes.map(k=>k.modelId)),g=new Set;for(const k of d){if(!f.has(k))continue;const N=n.logical.groups.find(y=>y.modelId===k);for(const y of(N==null?void 0:N.memberEntityRefs)??[])g.add(y)}const b=[],_=[];for(const k of d)if(f.has(k)){if(s(k))continue;const N=n.layout.groupLayouts.find(A=>A.groupRef===k);if(!N)continue;const y=n.logical.groups.find(A=>A.modelId===k),E=((y==null?void 0:y.memberEntityRefs)??[]).map(A=>{var $;const V=(($=n.layout.entityLayouts.find(O=>O.entityRef===A))==null?void 0:$.geo.location)??{x:0,y:0};return{id:A,location:{x:V.x+u,y:V.y+m}}}),S={x:N.geo.location.x+u,y:N.geo.location.y+m};b.push(at("그룹 이동",_p(n,k,S,E))),_.push("g:"+k)}else if(p.has(k)){if(g.has(k)||l(k))continue;const N=n.layout.entityLayouts.find(y=>y.entityRef===k);if(!N)continue;b.push(Uo(k,{x:N.geo.location.x+u,y:N.geo.location.y+m})),_.push("e:"+k)}else if(h.has(k)){const N=n.layout.notes.find(y=>y.modelId===k);if(!N)continue;b.push(Ei(k,{x:N.geo.location.x+u,y:N.geo.location.y+m})),_.push("n:"+k)}return b.length?(a(at("이동",b,"nudge:"+_.sort().join(","))),!0):!1},requestFocus(d){i.value={id:d,nonce:++c}}}}const Gn=Symbol("editorController");function kp(e="m1",n="d1"){return{logical:{modelId:e,entities:[],associations:[],groups:[]},layout:{diagramId:n,logicalModelRef:e,entityLayouts:[],associationLayouts:[],groupLayouts:[],notes:[]}}}function PS(e=kp(),n={}){var Se,Ge,et;const o=t.reactive(e);let i=new Ml(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.uiLocale??"ko"),m=(te,de)=>en(u.value,te,de),p=t.ref(n.reservedWords),f=t.ref(n.selectableDataTypes),h=t.ref(n.largeEntityThreshold),g=t.ref(n.flagEntitiesWithoutRelations??!1),b=t.ref(!1),_=t.ref(!1),k=t.ref(!1),N=t.ref(0),y=t.ref(null);let E=0;const S=te=>{if(n.onNotice){n.onNotice(te);return}y.value={text:te,id:++E}},A=t.ref(((Se=n.meta)==null?void 0:Se.schemaVersion)??1),V=t.ref(((Ge=n.meta)==null?void 0:Ge.opWriteEnabled)??!1),$=t.ref(((et=n.meta)==null?void 0:et.referenceOnly)??!1),O=t.computed(()=>A.value>=2&&V.value),C=t.ref(!(A.value>=2&&V.value===!1)),R=t.ref("LOGICAL_PHYSICAL"),T=t.ref("straight"),w=t.ref(!0),I=t.ref(!0),v=t.ref(null),B=t.computed(()=>{var te;return((te=v.value)==null?void 0:te.kind)==="attribute"?{entityId:v.value.entityId,attrId:v.value.anchor}:null}),M=t.computed(()=>{var te;return((te=v.value)==null?void 0:te.kind)==="attribute"?v.value.ids:[]}),x=t.computed(()=>{var te,de;return((te=v.value)==null?void 0:te.kind)==="entity"?v.value.id:((de=v.value)==null?void 0:de.kind)==="attribute"?v.value.entityId:null}),P=t.ref(null),Y=t.ref(null),se=t.ref(null),he=t.ref(null),ie=DS({state:o,opMode:O,editable:C,opConflict:se,opTransport:n.opTransport,onOpError:n.onOpError,historyTransport:n.historyTransport,restoreTransport:n.restoreTransport});function fe(){i.onChange(()=>{b.value=i.canUndo,_.value=i.canRedo,k.value=i.isDirty,N.value++})}fe(),ie.setupOpAdapter(i,n.meta);const pe=t.computed(()=>fc(o.logical,o.layout)),ge=t.computed(()=>({reservedWords:p.value,selectableDataTypes:f.value,largeEntityThreshold:h.value,flagEntitiesWithoutRelations:g.value,embeddableCatalog:a.value,superClassCatalog:s.value})),Te=()=>Wr(o.logical,$.value),He=n.validationDebounceMs??250;let De,Z=()=>{};if(He>0){const te=t.shallowRef(ga(Te(),ge.value));let de;Z=()=>{de!==void 0&&(clearTimeout(de),de=void 0),te.value=ga(Te(),ge.value)},t.watch([N,ge,$],()=>{de!==void 0&&clearTimeout(de),de=setTimeout(Z,He)},{flush:"sync"}),De=t.computed(()=>te.value)}else De=t.computed(()=>ga(Te(),ge.value));const re=t.computed(()=>{const te=new Map;for(const de of De.value){if(!de.targetRef)continue;const Le=te.get(de.targetRef);Le?Le.push(de):te.set(de.targetRef,[de])}return te}),ue=1500,z=new Map,L=te=>{const de=Date.now();de-(z.get(te)??0)<ue||(z.set(te,de),S(te))},F=te=>{if(!he.value){if(!C.value){L(m("em.notice.readOnly"));return}try{i.execute(te)}catch(de){console.error(`[command] 적용 실패 — 로컬 상태가 부분 변형됐을 수 있다 (${te.label}):`,de),C.value=!1,he.value={label:te.label}}}},X=te=>o.layout.entityLayouts.some(de=>de.entityRef===te&&!!de.locked),ee=te=>o.layout.groupLayouts.some(de=>de.groupRef===te&&!!de.locked),ke=te=>{const de=o.logical.associations.find(Le=>Le.modelId===te);return!!de&&(X(de.end1.entityRef)||X(de.end2.entityRef))},ye=te=>X(te)?(L(m("em.notice.entityLocked")),!0):!1,Ne=te=>ee(te)?(L(m("em.notice.groupLocked")),!0):!1,we=te=>ke(te)?(L(m("em.notice.assocLocked")),!0):!1,G=MS({state:o,clipboard:Y,selection:v,inspectedEntityId:x,editable:C,run:F}),q=LS({state:o,selection:v,focusRequest:P,run:F,gateEntityLocked:ye,isEntityLockedFn:X,isGroupLockedFn:ee}),W=VS({state:o,editable:C,run:F,gateEntityLocked:ye,isEntityLockedFn:X,isAssocLockedFn:ke,t:m,emitGateNotice:L}),Ce=RS({state:o,editable:C,run:F,gateEntityLocked:ye,embeddableCatalog:a,t:m,emitGateNotice:L,selection:v}),$e=BS({state:o,editable:C,run:F,selection:v,gateEntityLocked:ye,gateGroupLocked:Ne,isGroupLockedFn:ee}),ze=OS({editable:C,run:F}),Fe=xS({state:o,editable:C,run:F,gateEntityLocked:ye,gateAssocLocked:we});return{state:o,resolved:pe,issues:De,issuesByRef:re,flagEntitiesWithoutRelations:g,canUndo:b,canRedo:_,dirty:k,revision:N,notice:y,editable:C,schemaVersion:A,opWriteEnabled:V,opMode:O,opConflict:se,commandFailure:he,historyTransport:ie.historyTransport,historyAvailable:ie.historyAvailable,restoreTransport:ie.restoreTransport,restoreAvailable:ie.restoreAvailable,restoreToSeq:ie.restoreToSeq,reloadRequest:ie.reloadRequest,displayMode:R,routingMode:T,showGrid:w,showMinimap:I,selection:v,selectedAttr:B,selectedAttrIds:M,inspectedEntityId:x,focusRequest:P,clipboard:Y,embeddableCatalog:a,groupCodeCatalog:r,predefinedCustomTypeCatalog:l,superClassCatalog:s,languages:c,userLanguage:d,referenceOnlyDocument:$,uiLocale:u,t:m,selectableDataTypes:f,setEditable(te){C.value=te&&O.value},setEmbeddableCatalog(te){a.value=te},setGroupCodeCatalog(te){r.value=te},setPredefinedCustomTypeCatalog(te){l.value=te},setSuperClassCatalog(te){s.value=te},selectAttribute:q.selectAttribute,moveAttributeFocus:q.moveAttributeFocus,nudgeSelectedAttributes:q.nudgeSelectedAttributes,nudgeNodes:q.nudgeNodes,requestFocus:q.requestFocus,deleteSelection(){if(!C.value)return!1;const te=v.value;if(!te)return!1;if(te.kind==="attribute"){if(ye(te.entityId))return!1;const de=te.ids;if(!de.length)return!1;de.length===1?Ce.removeAttribute(te.entityId,de[0]):Ce.removeAttributes(te.entityId,de)}else if(te.kind==="entity"){if(ye(te.id))return!1;W.removeEntity(te.id)}else if(te.kind==="note")ze.removeNote(te.id);else if(te.kind==="group"){if(Ne(te.id))return!1;$e.removeGroup(te.id)}else Fe.removeAssociation(te.id);return v.value=null,!0},undo:()=>{C.value&&i.undo()},redo:()=>{C.value&&i.redo()},markSaved:()=>{C.value&&(ie.flush(),i.markSavePoint())},loadDiagram(te,de){ie.teardownOpAdapter(),o.logical=te.logical,o.layout=te.layout,i=new Ml(o),fe(),A.value=(de==null?void 0:de.schemaVersion)??1,V.value=(de==null?void 0:de.opWriteEnabled)??!1,$.value=(de==null?void 0:de.referenceOnly)??!1,C.value=!(A.value>=2&&V.value===!1),se.value=null,he.value=null,v.value=null,b.value=i.canUndo,_.value=i.canRedo,k.value=i.isDirty,ie.setupOpAdapter(i,de),Z()},flush:ie.flush,whenOpsSettled:ie.whenOpsSettled,addEntity:W.addEntity,renameEntity:W.renameEntity,updateEntity:W.updateEntity,moveEntity:W.moveEntity,resizeEntity:W.resizeEntity,removeEntity:W.removeEntity,setEntitySwatch:W.setEntitySwatch,setEntityCollapsed:W.setEntityCollapsed,setEntityLocked:W.setEntityLocked,isEntityLocked:W.isEntityLocked,isAssociationLocked:W.isAssociationLocked,collapseAll:W.collapseAll,expandAll:W.expandAll,setAttributeSwatch:Ce.setAttributeSwatch,dragGroup:$e.dragGroup,resizeGroup:$e.resizeGroup,setGroupSwatch:$e.setGroupSwatch,setGroupLocked:$e.setGroupLocked,isGroupLocked:$e.isGroupLocked,updateGroup:$e.updateGroup,createGroup:$e.createGroup,addEmptyGroup:$e.addEmptyGroup,removeGroup:$e.removeGroup,dropEntity:$e.dropEntity,ungroupEntity:$e.ungroupEntity,dropNote:$e.dropNote,addPredefinedEmbed:Ce.addPredefinedEmbed,addSerializedTypeAttribute:Ce.addSerializedTypeAttribute,addAttribute:Ce.addAttribute,addDivider:Ce.addDivider,updateAttribute:Ce.updateAttribute,setAttributeGroupCode:Ce.setAttributeGroupCode,setEmbedColumns:Ce.setEmbedColumns,removeAttribute:Ce.removeAttribute,removeAttributes:Ce.removeAttributes,setAttributeSwatches:Ce.setAttributeSwatches,reorderAttributes:Ce.reorderAttributes,addIndex(te,de){ye(te)||F(Zd(te,de))},updateIndex(te,de,Le){ye(te)||F($a(te,de,Le))},removeIndex(te,de){ye(te)||F(Qd(te,de))},addOperation(te,de={}){if(!C.value||ye(te))return null;const Le=o.logical.entities.find(st=>st.modelId===te),dt=Le!=null&&Le.operations?jt(Le.operations):0,Xe=de.modelId??Pe(),yt={modelId:Xe,name:de.name??`method${dt}`,visibility:de.visibility??"PACKAGE",order:dt,...de};return F(Gd(te,yt)),Xe},updateOperation(te,de,Le){ye(te)||F(Yd(te,de,Le))},removeOperation(te,de){ye(te)||F(qd(te,de))},reorderOperations(te,de,Le){!de.length||ye(te)||F(Wd(te,de,Le))},setOperationSwatch(te,de,Le){F(Jd(te,de,Le))},addAssociation:Fe.addAssociation,addEmbedAssociation:Fe.addEmbedAssociation,setEmbedCardinality:Fe.setEmbedCardinality,removeAssociation:Fe.removeAssociation,setAssociationIdentifying:Fe.setAssociationIdentifying,updateAssociationEnd:Fe.updateAssociationEnd,hasQuickFix(te){if(!C.value)return!1;const de=fl(te,o.logical);return de?de.kind==="setEndCascades"?!ke(de.assocRef):!X(de.entityRef):!1},applyQuickFix(te){if(!C.value)return!1;const de=fl(te,o.logical);if(!de)return!1;if(de.kind==="setIndexColumns")return ye(de.entityRef)?!1:(F($a(de.entityRef,de.indexRef,{columns:de.columns})),!0);if(we(de.assocRef))return!1;const Le=o.logical.associations.find(dt=>dt.modelId===de.assocRef);return Le?(F(Wt(de.assocRef,de.which,{jpa:{...Le[de.which].jpa,cascadeTypes:de.cascades}})),!0):!1},moveWaypoint(te,de,Le){F(eu(te,de,Le))},addWaypoint(te,de,Le){F(iu(te,de,Le))},removeWaypoint(te,de){F(tu(te,de))},clearWaypoints(te){F(ou(te))},addNote:ze.addNote,removeNote:ze.removeNote,moveNote:ze.moveNote,resizeNote:ze.resizeNote,setNoteMemo:ze.setNoteMemo,setNoteSwatch:ze.setNoteSwatch,addNoteConnection:ze.addNoteConnection,removeNoteConnection:ze.removeNoteConnection,moveNoteConnectionWaypoint:ze.moveNoteConnectionWaypoint,addNoteConnectionWaypoint:ze.addNoteConnectionWaypoint,removeNoteConnectionWaypoint:ze.removeNoteConnectionWaypoint,clearNoteConnectionWaypoints:ze.clearNoteConnectionWaypoints,autoLayout(){const te=pc(o.logical,o.layout);te.length&&F(at("자동 배치",te.map(de=>Uo(de.id,de.location))))},copy:G.copy,paste:G.paste,importEntities:G.importEntities}}const br=Symbol("groupHover"),Ep=Symbol("groupDrag"),Co=Symbol("relationHighlight"),Np=Symbol("diffOverlay"),wp=Symbol("nodeInternals"),Ip=Symbol("columnResolution");function zS(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 vp(e,n){if(e===n)return!0;if(e.length!==n.length)return!1;for(let o=0;o<e.length;o++)if(!zS(e[o],n[o]))return!1;return!0}function Cp(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(!vp(e.dbAttrs,n.dbAttrs))return!1}else if(i[r]!==a[r])return!1;return!0}function FS(e,n){if(e.size!==n.size)return!1;for(const o of e)if(!n.has(o))return!1;return!0}function US(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||!FS(i,a))return!1}for(const[o,i]of e.effectiveAttrs){const a=n.effectiveAttrs.get(o);if(!a||!Cp(i,a))return!1}for(const[o,i]of e.embedCols){const a=n.embedCols.get(o);if(!a||!vp(i,a))return!1}for(const[o,i]of e.collectionTypes)if(n.collectionTypes.get(o)!==i)return!1;return!!HS(e.classRows,n.classRows)}function HS(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&&!Cp(i.attr,a.attr))return!1}return!0}function jS(){let e;return(n,o)=>e=KS(n,o,e)}function KS(e,n,o){const i=e.entities,a=new Map;let r=null;const l=()=>r??(r=new Map(i.map(s=>[s.modelId,s])));for(const s of i){const c=new Map,d=new Map,u=new Map;let m=null;const p=()=>m??(m=To(Dn(s,i)));for(const k of s.attributes){if(ia(k)){const S=k.dbAttrs[0];if(!(S!=null&&S.physicalName&&(S!=null&&S.dataType))){const A=Zn(k,s,i,e.associations);A&&c.set(k.modelId,{...k,dbAttrs:[{...S,physicalName:(S==null?void 0:S.physicalName)||A.physicalName,dataType:(S==null?void 0:S.dataType)||A.dataType,length:(S==null?void 0:S.length)??A.length,scale:(S==null?void 0:S.scale)??A.scale},...k.dbAttrs.slice(1)]})}}if(k.identifier&&k.attrType==="RELATION_OWN"){const S=Po(e,s.modelId,k.modelId);if(S&&ka(k,S)){const A=c.get(k.modelId)??k,V=k.derivedIdFieldName||gl({...k,derivedIdFieldName:void 0},S,l());V&&c.set(k.modelId,{...A,derivedIdFieldName:V})}}const N=ua(k,e.associations);if(N&&u.set(k.modelId,N),yn(k)){d.set(k.modelId,k.dbAttrs.map((S,A)=>{const V=Zn(k,s,i,e.associations,A);return V?{...S,physicalName:S.physicalName||V.physicalName,dataType:S.dataType||V.dataType,length:S.length??V.length,scale:S.scale??V.scale}:S}));continue}if(!k.attrType.startsWith("EMBED")||k.dbAttrs.length===0)continue;if(k.attrType!=="EMBED_PREDEF"){const S=p();d.set(k.modelId,k.dbAttrs.map((A,V)=>{const $=Qn(A,S);return $?{...A,physicalName:$.physicalName}:bn(k,A,V,s,e)}));continue}const y=n==null?void 0:n.find(S=>S.type===k.type);if(!y)continue;const E=p();d.set(k.modelId,k.dbAttrs.map((S,A)=>{const V=y.fields[A],$=Qn(S,E);return $?{...S,physicalName:$.physicalName,logicalName:S.logicalName??(V==null?void 0:V.logicalName),dataType:S.dataType||(V==null?void 0:V.dataType)||""}:V?{...S,physicalName:S.physicalName||V.physicalName,logicalName:S.logicalName??V.logicalName,dataType:S.dataType||V.dataType,length:S.length??V.length}:S}))}const f=new Map,h=new Map;for(const k of s.attributes){const N=d.get(k.modelId);if(N)for(let y=0;y<N.length;y++){const E=`${k.attrType}\0${k.type??""}\0${y}`,S={attrId:k.modelId,slot:y,name:N[y].physicalName??""},A=h.get(E);A?A.push(S):h.set(E,[S])}}for(const k of h.values()){if(k.length<2)continue;const N=new Map;for(const y of k)N.set(y.name,(N.get(y.name)??0)+1);for(const y of k){if((N.get(y.name)??0)<2)continue;const E=f.get(y.attrId);E?E.add(y.slot):f.set(y.attrId,new Set([y.slot]))}}const g=bl(s,e).fields.map(k=>{var N;return{attr:k.attr,synthetic:k.synthetic,sourceAttrId:k.sourceAttr.modelId,targetName:(N=k.target)==null?void 0:N.name,collection:k.collection}}),b={effectiveAttrs:c,embedCols:d,collectionTypes:u,redundantSlots:f,classRows:g},_=o==null?void 0:o.get(s.modelId);a.set(s.modelId,_&&US(b,_)?_:b)}return a}const Sp=Symbol("embedSlotCollapse"),xp=(e,n)=>`${e}:${n}`,Rp="all:",Ap="one:",$p="fk:",Tp=e=>`${Rp}${e}`,GS=(e,n)=>`${Ap}${e}:${n}`,YS=(e,n)=>`${$p}${e}:${n}`,qS=e=>e.startsWith($p)||!e.startsWith(Rp)&&!e.startsWith(Ap),WS=["title"],JS={key:0,class:"em-sel","aria-hidden":"true"},XS=["title","aria-expanded","disabled"],ZS={class:"em-entity__stereotype"},QS={key:1,class:"em-entity__name"},ex=["title","aria-expanded"],tx={"aria-hidden":"true"},nx=["data-attr","title","onClick","onPointerdown","onPointermove","onPointerup","onPointercancel"],ox=["onPointerdown"],ix={key:1,class:"em-entity__divider-label"},ax=["title"],rx={class:"em-key-slot"},lx={class:"em-key-slot"},sx=["title","aria-expanded","onClick"],cx=["title","onClick"],dx=["title","aria-expanded","onClick"],ux={key:2,class:"em-entity__type"},mx=["onClick"],fx={class:"em-entity__attrname"},px={class:"em-entity__type"},hx={key:1,class:"em-entity__embed-summary"},yx=["title"],gx=["data-op"],bx=["onPointerdown"],_x={class:"em-entity__op-vis","aria-hidden":"true"},kx=["title"],Ex={key:4,class:"em-entity__footer"},Mp=Qe(t.defineComponent({__name:"EntityNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const n=e,o=t.inject(Gn,null),i=(j,K)=>o?o.t(j,K):en("ko",j,K),a=t.computed(()=>(o==null?void 0:o.userLanguage.value)??"ko"),r=oe.useModal();function l(){o&&hr(r,o,n.id)}const s=t.inject(br,null),c=t.inject(Co,null),d=t.inject(Np,null),u=t.computed(()=>{var j;return((j=d==null?void 0:d.marks.value)==null?void 0:j.get(n.id))??null}),m=t.inject(Ip,null),p=t.computed(()=>m==null?void 0:m.value.get(n.id)),f=t.inject(Sp,void 0),h=t.inject(wp,null);t.onUpdated(()=>h==null?void 0:h.mark(n.id));const g=t.computed(()=>!!o&&o.editable.value);function b(){s&&(s.value=n.data.groupRef??null)}function _(){c==null||c.setEntityHover(n.id)}function k(){c==null||c.setEntityHover(null)}const N=t.computed(()=>!!c&&c.primaryEntityIds.value.has(n.id)),y=t.computed(()=>!!c&&c.relatedEntityIds.value.has(n.id)&&!N.value),E=t.computed(()=>{var j;return((j=o==null?void 0:o.selection.value)==null?void 0:j.kind)==="entity"&&o.selection.value.id===n.id}),S=t.computed(()=>!!n.selected&&!E.value),A=t.computed(()=>{var j;return o&&((j=o.selectedAttr.value)==null?void 0:j.entityId)===n.id?new Set(o.selectedAttrIds.value):new Set}),V=t.computed(()=>A.value.size>0);function $(j,K){const ve=K.shiftKey?"range":K.metaKey||K.ctrlKey?"toggle":"replace";o==null||o.selectAttribute(n.id,B(j),ve)}const O=t.computed(()=>!!c&&c.active.value&&!c.relatedEntityIds.value.has(n.id)&&!E.value),C=t.computed(()=>n.data.entity),R=t.computed(()=>_y(C.value,o==null?void 0:o.referenceOnlyDocument.value)),T=t.computed(()=>n.data.displayMode??"LOGICAL_PHYSICAL"),w=t.computed(()=>{var j;if(T.value==="CLASS"){const K=(j=p.value)==null?void 0:j.classRows;if(K)return K.map(ve=>ve.attr)}return[...C.value.attributes].sort((K,ve)=>K.order-ve.order)}),I=t.computed(()=>{var K;const j=T.value==="CLASS"?(K=p.value)==null?void 0:K.classRows:void 0;return new Set((j??[]).filter(ve=>ve.synthetic).map(ve=>ve.attr.modelId))});function v(j){return I.value.has(j.modelId)}function B(j){return P.value.get(j.modelId)??j.modelId}function M(j){return A.value.has(B(j))}function x(j){var K;return!!((K=u.value)!=null&&K.changedAttributeIds.has(B(j)))}const P=t.computed(()=>{var K;const j=new Map;if(T.value!=="CLASS")return j;for(const ve of((K=p.value)==null?void 0:K.classRows)??[])ve.synthetic&&j.set(ve.attr.modelId,ve.sourceAttrId);return j}),Y=t.computed(()=>{var ve;const j=new Map,K=T.value==="CLASS";for(const Re of((ve=p.value)==null?void 0:ve.classRows)??[])!K&&!yn(Re.attr)||(Re.targetName||Re.collection)&&j.set(Re.attr.modelId,{targetName:Re.targetName,collection:Re.collection});return j}),se=t.computed(()=>n.data.collapsed??!1),he=t.computed(()=>n.data.locked??!1),ie=t.computed(()=>g.value&&!he.value);function fe(){g.value&&(o==null||o.setEntityCollapsed(n.id,!se.value))}const pe=t.computed(()=>T.value==="PHYSICAL"||T.value==="LOGICAL_PHYSICAL"),ge=t.computed(()=>{var ve;const j=T.value==="PHYSICAL"||T.value==="LOGICAL_PHYSICAL",K={};for(const Re of w.value){const me=Re.attrType.startsWith("RELATION")&&Re.dbAttrs.length>0,Ue=hn(((ve=C.value)==null?void 0:ve.stereotype)??"UNDEFINED");K[Re.modelId]={pk:Re.identifier,fk:me&&j,required:!Ue&&Re.notNull&&!Re.identifier}}return K});function Te(j){if(!j)return"";const K=[];return j.pk&&j.fk?K.push(i("em.node.keyPfk")):j.pk?K.push(i("em.node.keyPk")):j.fk&&K.push(i("em.node.keyFk")),j.required&&K.push(i("em.node.required")),K.join(" · ")}const He=t.computed(()=>{const j=As($t(n.data.style)),K={};return j&&(K["--em-header-bg"]=j.bar,K["--em-header-fg"]=j.barOn),K});function De(j){var K,ve;return(ve=As($t((K=n.data.attributeStyles)==null?void 0:K[j.modelId])))==null?void 0:ve.text}const Z=t.computed(()=>[...C.value.operations??[]].sort((j,K)=>j.order-K.order)),re=t.computed(()=>T.value==="CLASS"&&Z.value.length>0),ue={PUBLIC:"+",PRIVATE:"-",PROTECTED:"#",PACKAGE:"~"};function z(j){return j?ue[j]:"~"}function L(j){var K,ve;return(ve=As($t((K=n.data.operationStyles)==null?void 0:K[j.modelId])))==null?void 0:ve.text}function F(j,K,ve){switch(T.value){case"CLASS":return[{text:j}];case"PHYSICAL":return[{text:ve||j}];case"LOGICAL":return[K?{text:K}:{text:i("em.node.logicalMissing"),missing:!0}];default:{const Re=K?{text:K}:{text:i("em.node.logicalMissing"),missing:!0};return ve?[Re,{text:` · ${ve}`}]:[Re]}}}function X(j){var K;return((K=p.value)==null?void 0:K.effectiveAttrs.get(j.modelId))??j}function ee(j){var ve,Re,me;if(we(j))return[{text:j.name}];const K=X(j);return F(ke(j),(Re=(ve=K.dbAttrs[0])==null?void 0:ve.logicalName)==null?void 0:Re[a.value],((me=K.dbAttrs[0])==null?void 0:me.physicalName)??"")}function ke(j){return T.value==="CLASS"?j.name:X(j).derivedIdFieldName||j.name}function ye(j){return j.attrType.startsWith("EMBED")&&j.dbAttrs.length>0}const Ne=yn;function we(j){return ye(j)||Ne(j)}function G(j){return Ne(j)?YS(n.id,j.modelId):GS(n.id,j.modelId)}function q(j){return j.attrType==="DIVIDER"}function W(j){var K;return((K=p.value)==null?void 0:K.embedCols.get(j.modelId))??j.dbAttrs}function Ce(j){var K;return(K=p.value)==null?void 0:K.redundantSlots.get(j.modelId)}const $e=t.computed(()=>(f==null?void 0:f.isCollapsed(Tp(n.id)))??!1),ze=t.computed(()=>$e.value&&pe.value?w.value.reduce((j,K)=>we(K)?j+W(K).length:j,0):0),Fe=t.computed(()=>w.value.some(j=>we(j)));function ae(j){const K=Ce(j);return!K||K.size===0?!1:f?f.isCollapsed(xp(n.id,j.modelId)):!1}function Se(j){var K;return ae(j)?((K=Ce(j))==null?void 0:K.size)??0:0}function Ge(j){return f?f.isCollapsed(G(j)):!1}function et(j){var K;return!pe.value||$e.value?null:Ge(j)?"attr":(((K=Ce(j))==null?void 0:K.size)??0)>0?"slot":null}function te(j){return!$e.value&&we(j)}function de(j){return Ge(j)?W(j).length:0}function Le(j){if($e.value||Ge(j))return[];const K=W(j);if(!ae(j))return K;const ve=Ce(j);return K.filter((Re,me)=>!ve.has(me))}function dt(j){f==null||f.toggle(xp(n.id,j.modelId))}function Xe(j){f==null||f.toggle(G(j))}function yt(){f==null||f.toggle(Tp(n.id))}function st(j){var K;return F(j.physicalName,(K=j.logicalName)==null?void 0:K[a.value],j.physicalName)}function ft(j){var Ue;const K=Y.value.get(j.modelId),ve=(K==null?void 0:K.collection)??((Ue=p.value)==null?void 0:Ue.collectionTypes.get(j.modelId)),Re=o?ui(j,Vo(o.state.logical),C.value,o.state.logical):void 0,me=(Re==null?void 0:Re.kind)==="resolved"?Re.entity:void 0;return nl(T.value,X(j),ve,K==null?void 0:K.targetName,me)}const nt=t.computed(()=>{const j={};for(const K of w.value)j[K.modelId]=ft(K);return j}),J=t.computed(()=>{var j,K,ve;return F(C.value.name,(K=(j=C.value.table)==null?void 0:j.logicalName)==null?void 0:K[a.value],((ve=C.value.table)==null?void 0:ve.physicalName)??"")}),ce=t.ref(!1),Ae=t.ref(""),Ee=t.ref(null);async function H(){var j,K;ie.value&&(Ae.value=C.value.name,ce.value=!0,await t.nextTick(),(j=Ee.value)==null||j.focus(),(K=Ee.value)==null||K.select())}function It(){if(!ce.value)return;ce.value=!1;const j=Ae.value.trim();j&&j!==C.value.name&&(o==null||o.renameEntity(n.id,j))}function Rt(){o==null||o.addAttribute(n.id)}function ot(){o==null||o.addDivider(n.id)}const{screenToFlowCoordinate:We,findNode:Ze}=tt(),Q=t.ref(null),Mt=t.computed(()=>{const j=Q.value??n.data.size;return j?{width:`${j.width}px`,minHeight:`${j.height}px`}:void 0});let Vt=null;function Mn(j){var Re,me,Ue;if(!ie.value)return;j.stopPropagation();const K=(Re=Ze(n.id))==null?void 0:Re.dimensions,ve=We({x:j.clientX,y:j.clientY});Vt={fx:ve.x,fy:ve.y,w:(K==null?void 0:K.width)??((me=n.data.size)==null?void 0:me.width)??200,h:(K==null?void 0:K.height)??((Ue=n.data.size)==null?void 0:Ue.height)??120},j.target.setPointerCapture(j.pointerId)}function an(j){if(!Vt)return;const K=We({x:j.clientX,y:j.clientY});Q.value={width:Math.max(40,Vt.w+(K.x-Vt.fx)),height:Math.max(40,Vt.h+(K.y-Vt.fy))}}function _e(j){var K,ve,Re;if(Vt&&Q.value&&o){const me=(K=Ze(n.id))==null?void 0:K.dimensions;o.resizeEntity(n.id,{width:Math.round((me==null?void 0:me.width)??Q.value.width),height:Math.round((me==null?void 0:me.height)??Q.value.height)})}Vt=null,Q.value=null,(Re=(ve=j.target).releasePointerCapture)==null||Re.call(ve,j.pointerId)}const mt=t.ref(null),vt=t.ref(null);function D(j,K){if(!ie.value)return;K.stopPropagation(),K.preventDefault();const ve=A.value,Re=ve.has(j.modelId)?new Set(ve):new Set([j.modelId]);vt.value={ids:Re,dropIndex:-1,lineY:0},K.target.setPointerCapture(K.pointerId)}function U(j){if(!vt.value||!mt.value)return;const K=Array.from(mt.value.querySelectorAll(".em-entity__row"));if(!K.length)return;let ve=K.length;for(let Ue=0;Ue<K.length;Ue++){const Ye=K[Ue].getBoundingClientRect();if(j.clientY<Ye.top+Ye.height/2){ve=Ue;break}}const Re=K[K.length-1],me=ve<K.length?K[ve].offsetTop:Re.offsetTop+Re.offsetHeight;vt.value={...vt.value,dropIndex:ve,lineY:me}}function le(){const j=vt.value;if(vt.value=null,!j||j.dropIndex<0)return;const K=w.value,ve=K.filter(pt=>j.ids.has(pt.modelId)).map(pt=>pt.modelId),Re=K.filter((pt,Pt)=>j.ids.has(pt.modelId)&&Pt<j.dropIndex).length,me=j.dropIndex-Re,Ue=K.filter(pt=>!j.ids.has(pt.modelId)).map(pt=>pt.modelId);[...Ue.slice(0,me),...ve,...Ue.slice(me)].join(",")!==K.map(pt=>pt.modelId).join(",")&&(o==null||o.reorderAttributes(n.id,ve,me))}function ne(){vt.value=null}const xe=t.ref(null),Be=t.ref(null);function qe(j,K){ie.value&&(K.stopPropagation(),K.preventDefault(),Be.value={id:j.modelId,dropIndex:-1,lineY:0},K.target.setPointerCapture(K.pointerId))}function je(j){if(!Be.value||!xe.value)return;const K=Array.from(xe.value.querySelectorAll(".em-entity__op-row"));if(!K.length)return;let ve=K.length;for(let Ue=0;Ue<K.length;Ue++){const Ye=K[Ue].getBoundingClientRect();if(j.clientY<Ye.top+Ye.height/2){ve=Ue;break}}const Re=K[K.length-1],me=ve<K.length?K[ve].offsetTop:Re.offsetTop+Re.offsetHeight;Be.value={...Be.value,dropIndex:ve,lineY:me}}function Ie(){const j=Be.value;if(Be.value=null,!j||j.dropIndex<0)return;const ve=Z.value.findIndex(me=>me.modelId===j.id);if(ve<0)return;const Re=j.dropIndex-(ve<j.dropIndex?1:0);Re!==ve&&(o==null||o.reorderOperations(n.id,[j.id],Re))}function Je(){Be.value=null}return(j,K)=>{var ve,Re;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-entity",{"is-hover-origin":N.value,"is-related":y.value,"is-dimmed":O.value,"is-selected":E.value,"is-multi-selected":S.value,"has-focused-attr":V.value,"is-locked":he.value,"is-reference-only":R.value,"is-diff-added":((ve=u.value)==null?void 0:ve.verb)==="added","is-diff-modified":((Re=u.value)==null?void 0:Re.verb)==="modified"}]),tabindex:"-1",title:R.value?i("em.entity.referenceOnlyHint"):void 0,style:t.normalizeStyle(Mt.value),onPointerdown:b,onMouseenter:_,onMouseleave:k,onDblclick:l},[E.value?(t.openBlock(),t.createElementBlock("div",JS,[...K[11]||(K[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(He.value),onDblclick:t.withModifiers(H,["stop"])},[t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__caret nodrag",title:i(se.value?"em.panel.expand":"em.panel.collapse"),"aria-expanded":!se.value,disabled:!g.value,onClick:t.withModifiers(fe,["stop"]),onPointerdown:K[0]||(K[0]=t.withModifiers(()=>{},["stop"])),onDblclick:K[1]||(K[1]=t.withModifiers(()=>{},["stop"]))},t.toDisplayString(se.value?"▸":"▾"),41,XS),t.createElementVNode("span",ZS,"«"+t.toDisplayString(t.unref(si)(C.value.stereotype))+"»",1),ce.value?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:0,ref_key:"inputEl",ref:Ee,"onUpdate:modelValue":K[2]||(K[2]=me=>Ae.value=me),class:"em-entity__name-input nodrag",onKeyup:[t.withKeys(It,["enter"]),K[3]||(K[3]=t.withKeys(me=>ce.value=!1,["esc"]))],onBlur:It,onPointerdown:K[4]||(K[4]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,Ae.value]]):(t.openBlock(),t.createElementBlock("span",QS,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(J.value,(me,Ue)=>(t.openBlock(),t.createElementBlock("span",{key:Ue,class:t.normalizeClass({"em-entity__missing":me.missing})},t.toDisplayString(me.text),3))),128))])),!se.value&&pe.value&&Fe.value?(t.openBlock(),t.createElementBlock("button",{key:2,tabindex:"-1",type:"button",class:"em-entity__embed-all nodrag",title:$e.value?i("em.node.embedAllShow"):i("em.node.embedAllHide"),"aria-expanded":!$e.value,onClick:t.withModifiers(yt,["stop"]),onPointerdown:K[5]||(K[5]=t.withModifiers(()=>{},["stop"])),onDblclick:K[6]||(K[6]=t.withModifiers(()=>{},["stop"]))},[t.createVNode(Ve,{name:"table",size:11}),t.createElementVNode("span",tx,t.toDisplayString($e.value?"▸":"▾"),1)],40,ex)):t.createCommentVNode("",!0),he.value?(t.openBlock(),t.createBlock(Ve,{key:3,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:4,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),se.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("ul",{key:1,ref_key:"attrsUl",ref:mt,class:"em-entity__attrs"},[vt.value&&vt.value.dropIndex>=0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:t.normalizeStyle({top:`${vt.value.lineY}px`}),"aria-hidden":"true"},null,4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(w.value,me=>{var Ue,Ye,pt,Pt,ta;return t.openBlock(),t.createElementBlock(t.Fragment,{key:me.modelId},[t.createElementVNode("li",{class:t.normalizeClass(["em-entity__row",{"is-attr-selected":M(me),"is-dragging":(Ue=vt.value)==null?void 0:Ue.ids.has(me.modelId),"is-embed":we(me),"is-divider":q(me),"has-embed-badge":!!et(me),nodrag:q(me)&&ie.value,"is-diff-changed":x(me),"is-synthetic":v(me)}]),"data-attr":me.modelId,title:v(me)?i("em.node.derivedIdRow"):void 0,onClick:t.withModifiers(gt=>$(me,gt),["stop"]),onPointerdown:gt=>q(me)?D(me,gt):void 0,onPointermove:gt=>q(me)?U(gt):void 0,onPointerup:gt=>q(me)?le():void 0,onPointercancel:gt=>q(me)?ne():void 0},[ie.value&&!q(me)&&!v(me)?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:gt=>D(me,gt),onPointermove:U,onPointerup:le,onPointercancel:ne,onClick:K[7]||(K[7]=t.withModifiers(()=>{},["stop"]))},"⠿",40,ox)):t.createCommentVNode("",!0),q(me)?(t.openBlock(),t.createElementBlock("span",ix,t.toDisplayString(me.name),1)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createVNode(t.unref(Eo),{id:`l:${me.modelId}`,type:"target",position:t.unref(Oe).Left,class:"em-handle",title:ie.value?i("em.node.connectHint"):void 0},null,8,["id","position","title"]),t.createElementVNode("span",{class:"em-entity__keys",title:Te(ge.value[me.modelId]),"aria-hidden":"true"},[t.createElementVNode("span",rx,[(Ye=ge.value[me.modelId])!=null&&Ye.pk?(t.openBlock(),t.createBlock(Ve,{key:0,name:"key",size:12,class:"em-key is-pk"})):(pt=ge.value[me.modelId])!=null&&pt.required?(t.openBlock(),t.createBlock(Ve,{key:1,name:"asterisk",size:14,class:"em-key is-required"})):t.createCommentVNode("",!0)]),t.createElementVNode("span",lx,[pe.value&&te(me)?(t.openBlock(),t.createElementBlock("button",{key:0,tabindex:"-1",type:"button",class:"em-embed-caret nodrag",title:Ge(me)?i("em.node.embedAttrShow",{count:de(me)}):i("em.node.embedAttrHide"),"aria-expanded":!Ge(me),onClick:t.withModifiers(gt=>Xe(me),["stop"]),onPointerdown:K[8]||(K[8]=t.withModifiers(()=>{},["stop"])),onDblclick:K[9]||(K[9]=t.withModifiers(()=>{},["stop"]))},t.toDisplayString(Ge(me)?"▸":"▾"),41,sx)):we(me)?(t.openBlock(),t.createBlock(Ve,{key:1,name:"table",size:11,class:"em-embed-glyph"})):(Pt=ge.value[me.modelId])!=null&&Pt.fk?(t.openBlock(),t.createBlock(Ve,{key:2,name:"key",size:12,class:"em-key is-fk"})):t.createCommentVNode("",!0)])],8,ax),t.createElementVNode("span",{class:"em-entity__attrname",style:t.normalizeStyle({color:De(me)})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ee(me),(gt,Vn)=>(t.openBlock(),t.createElementBlock("span",{key:Vn,class:t.normalizeClass({"em-entity__missing":gt.missing})},t.toDisplayString(gt.text),3))),128))],4),et(me)==="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:de(me)}),onClick:t.withModifiers(gt=>Xe(me),["stop"])},"+"+t.toDisplayString(de(me)),9,cx)):et(me)==="slot"?(t.openBlock(),t.createElementBlock("button",{key:1,tabindex:"-1",type:"button",class:"em-entity__embed-fold nodrag","data-axis":"slot",title:ae(me)?i("em.node.embedRepeatedShow",{count:((ta=Ce(me))==null?void 0:ta.size)??0}):i("em.node.embedRepeatedHide"),"aria-expanded":!ae(me),onClick:t.withModifiers(gt=>dt(me),["stop"])},t.toDisplayString(ae(me)?`+${Se(me)}`:"−"),9,dx)):t.createCommentVNode("",!0),nt.value[me.modelId]?(t.openBlock(),t.createElementBlock("span",ux,t.toDisplayString(nt.value[me.modelId]),1)):t.createCommentVNode("",!0),t.createVNode(t.unref(Eo),{id:`r:${me.modelId}`,type:"source",position:t.unref(Oe).Right,class:"em-handle",title:ie.value?i("em.node.connectHint"):void 0},null,8,["id","position","title"])],64))],42,nx),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(we(me)&&pe.value?Le(me):[],gt=>(t.openBlock(),t.createElementBlock("li",{key:`${me.modelId}:${gt.modelId}`,class:t.normalizeClass(["em-entity__embed-col",{"is-group-selected":M(me)}]),onClick:t.withModifiers(Vn=>$(me,Vn),["stop"])},[K[12]||(K[12]=t.createElementVNode("span",{class:"em-entity__embed-rail","aria-hidden":"true"},null,-1)),t.createElementVNode("span",fx,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(st(gt),(Vn,Fr)=>(t.openBlock(),t.createElementBlock("span",{key:Fr,class:t.normalizeClass({"em-entity__missing":Vn.missing})},t.toDisplayString(Vn.text),3))),128))]),t.createElementVNode("span",px,t.toDisplayString(gt.dataType),1)],10,mx))),128))],64)}),128)),ze.value?(t.openBlock(),t.createElementBlock("li",hx,[t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__embed-summary-btn nodrag",title:i("em.node.embedAllShow"),onClick:t.withModifiers(yt,["stop"])},[t.createVNode(Ve,{name:"table",size:11}),t.createElementVNode("span",null,t.toDisplayString(i("em.node.embedAllSummary",{n:ze.value})),1)],8,yx)])):t.createCommentVNode("",!0)],512)),!se.value&&re.value?(t.openBlock(),t.createElementBlock("ul",{key:2,ref_key:"opsUl",ref:xe,class:"em-entity__ops"},[Be.value&&Be.value.dropIndex>=0?(t.openBlock(),t.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:t.normalizeStyle({top:`${Be.value.lineY}px`}),"aria-hidden":"true"},null,4)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Z.value,me=>{var Ue,Ye;return t.openBlock(),t.createElementBlock("li",{key:me.modelId,class:t.normalizeClass(["em-entity__op-row",{"is-dragging":((Ue=Be.value)==null?void 0:Ue.id)===me.modelId,"is-diff-changed":!!((Ye=u.value)!=null&&Ye.changedOperationIds.has(me.modelId))}]),"data-op":me.modelId},[ie.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:pt=>qe(me,pt),onPointermove:je,onPointerup:Ie,onPointercancel:Je,onClick:K[10]||(K[10]=t.withModifiers(()=>{},["stop"]))},"⠿",40,bx)):t.createCommentVNode("",!0),t.createElementVNode("span",_x,t.toDisplayString(z(me.visibility)),1),t.createElementVNode("span",{class:"em-entity__op-name",style:t.normalizeStyle({color:L(me)})},t.toDisplayString(me.name)+"()",5)],10,gx)}),128))],512)):Z.value.length?(t.openBlock(),t.createElementBlock("div",{key:3,class:"em-entity__ops-summary",title:i("em.node.opsSummaryTitle",{n:Z.value.length})},[t.createVNode(Ve,{name:"method",size:12}),t.createElementVNode("span",null,t.toDisplayString(i("em.node.opsSummary",{n:Z.value.length})),1)],8,kx)):t.createCommentVNode("",!0),ie.value?(t.openBlock(),t.createElementBlock("footer",Ex,[t.createElementVNode("button",{tabindex:"-1",type:"button",class:"em-entity__add nodrag",onClick:Rt},t.toDisplayString(i("em.node.addAttr")),1),K[13]||(K[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:ot},t.toDisplayString(i("em.node.addDivider")),1)])):t.createCommentVNode("",!0),ie.value&&!ce.value?(t.openBlock(),t.createElementBlock("div",{key:5,class:"em-entity__resize nodrag nopan",onPointerdown:Mn,onPointermove:an,onPointerup:_e},null,32)):t.createCommentVNode("",!0)],46,WS)}}}),[["__scopeId","data-v-2bcc3efa"]]),Nx={key:0,class:"em-sel","aria-hidden":"true"},wx={class:"em-group__label"},Ix={class:"em-group__name"},vx={key:0,class:"em-group__pkg"},Cx={key:1,class:"em-group__flag"},Vp=Qe(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(()=>$t(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(Gn,null),s=(C,R)=>l?l.t(C,R):en("ko",C,R),c=t.computed(()=>!!l&&l.editable.value),d=t.computed(()=>{var C;return!!n.id&&((C=l==null?void 0:l.selection.value)==null?void 0:C.kind)==="group"&&l.selection.value.id===n.id}),u=t.computed(()=>!!n.selected&&!d.value),m=t.inject(br,null),p=t.computed(()=>!!n.id&&(m==null?void 0:m.value)===n.id),f=t.inject(Co,null);function h(){n.id&&(f==null||f.setGroupHover(n.id))}function g(){f==null||f.setGroupHover(null)}const b=t.computed(()=>!!f&&f.hoverGroupId.value===n.id),_=t.computed(()=>!!f&&f.hoverGroupId.value!==null&&f.hoverGroupId.value!==n.id),{screenToFlowCoordinate:k,findNode:N}=tt();let y=null,E=null;function S(C){var w;if(!n.id||!c.value)return;C.stopPropagation();const R=((w=N(n.id))==null?void 0:w.dimensions)??{width:400,height:300},T=k({x:C.clientX,y:C.clientY});y={fx:T.x,fy:T.y,w:R.width,h:R.height},C.target.setPointerCapture(C.pointerId)}function A(C){if(!y||!n.id)return;const R=k({x:C.clientX,y:C.clientY});E={width:Math.max(160,y.w+(R.x-y.fx)),height:Math.max(120,y.h+(R.y-y.fy))};const T=N(n.id);T&&(T.style={width:`${E.width}px`,height:`${E.height}px`})}function V(C){var R,T;y&&E&&n.id&&l&&l.resizeGroup(n.id,E),y=null,E=null,(T=(R=C.target).releasePointerCapture)==null||T.call(R,C.pointerId)}const $=t.computed(()=>(l==null?void 0:l.userLanguage.value)??"ko"),O=t.computed(()=>{const C=o.value.name;return(C==null?void 0:C[$.value])||(C==null?void 0:C.ko)||(C==null?void 0:C.en)||(C==null?void 0:C.ja)||(C==null?void 0:C.zh)||o.value.packageName||s("em.group.fallback")});return(C,R)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-group",{"is-drop-target":p.value,"is-hover-origin":b.value,"is-dimmed":_.value,"is-selected":d.value,"is-multi-selected":u.value,"is-locked":i.value}]),tabindex:"-1",style:t.normalizeStyle(r.value),onMouseenter:h,onMouseleave:g},[d.value?(t.openBlock(),t.createElementBlock("div",Nx,[...R[0]||(R[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",wx,[t.createElementVNode("span",Ix,t.toDisplayString(O.value),1),o.value.packageName?(t.openBlock(),t.createElementBlock("span",vx,t.toDisplayString(o.value.packageName),1)):t.createCommentVNode("",!0),o.value.excludeDDLGeneration?(t.openBlock(),t.createElementBlock("span",Cx,t.toDisplayString(s("em.group.ddlExcludeBadge")),1)):t.createCommentVNode("",!0),i.value?(t.openBlock(),t.createBlock(Ve,{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:A,onPointerup:V},null,32)):t.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-27b80057"]]),Sx={key:0,class:"em-sel","aria-hidden":"true"},xx={key:2,class:"em-note__text"},Bp=Qe(t.defineComponent({__name:"NoteNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const n=e,o=t.inject(Gn,null),i=t.inject(br,null),a=t.inject(Co,null),r=t.computed(()=>n.data.note),l=t.computed(()=>!!o&&o.editable.value),s=t.computed(()=>$t(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 p=t.computed(()=>{var w;return((w=a==null?void 0:a.source.value)==null?void 0:w.kind)==="note"&&a.source.value.id===n.id}),f=t.computed(()=>!!a&&a.relatedNoteIds.value.has(n.id)&&!p.value),h=t.computed(()=>{var w;return((w=o==null?void 0:o.selection.value)==null?void 0:w.kind)==="note"&&o.selection.value.id===n.id}),g=t.computed(()=>!!n.selected&&!h.value),b=t.computed(()=>!!a&&a.active.value&&!a.relatedNoteIds.value.has(n.id)&&!h.value),_=[{id:"n-top",pos:Oe.Top},{id:"n-right",pos:Oe.Right},{id:"n-bottom",pos:Oe.Bottom},{id:"n-left",pos:Oe.Left}],k=t.ref(!1),N=t.ref(""),y=t.ref(null);async function E(){var w;l.value&&(N.value=r.value.memo,k.value=!0,await t.nextTick(),(w=y.value)==null||w.focus())}function S(){k.value&&(k.value=!1,N.value!==r.value.memo&&(o==null||o.setNoteMemo(n.id,N.value)))}const{screenToFlowCoordinate:A,findNode:V}=tt();let $=null,O=null;function C(w){var B;if(!l.value)return;w.stopPropagation();const I=((B=V(n.id))==null?void 0:B.dimensions)??r.value.geo.size,v=A({x:w.clientX,y:w.clientY});$={fx:v.x,fy:v.y,w:I.width,h:I.height},w.target.setPointerCapture(w.pointerId)}function R(w){if(!$)return;const I=A({x:w.clientX,y:w.clientY});O={width:Math.max(140,$.w+(I.x-$.fx)),height:Math.max(60,$.h+(I.y-$.fy))};const v=V(n.id);v&&(v.style={width:`${O.width}px`,height:`${O.height}px`})}function T(w){var I,v;$&&O&&o&&o.resizeNote(n.id,O),$=null,O=null,(v=(I=w.target).releasePointerCapture)==null||v.call(I,w.pointerId)}return(w,I)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["em-note",{"is-hover-origin":p.value,"is-related":f.value,"is-dimmed":b.value,"is-selected":h.value,"is-multi-selected":g.value}]),tabindex:"-1",style:t.normalizeStyle(c.value),onDblclick:E,onPointerdown:d,onMouseenter:u,onMouseleave:m},[h.value?(t.openBlock(),t.createElementBlock("div",Sx,[...I[4]||(I[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),k.value?t.withDirectives((t.openBlock(),t.createElementBlock("textarea",{key:1,ref_key:"area",ref:y,"onUpdate:modelValue":I[0]||(I[0]=v=>N.value=v),class:"em-note__edit nodrag",onBlur:S,onKeydown:I[1]||(I[1]=t.withKeys(v=>k.value=!1,["esc"])),onPointerdown:I[2]||(I[2]=t.withModifiers(()=>{},["stop"]))},null,544)),[[t.vModelText,N.value]]):(t.openBlock(),t.createElementBlock("div",xx,t.toDisplayString(r.value.memo),1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(_,v=>t.createVNode(t.unref(Eo),{id:v.id,key:v.id,type:"source",position:v.pos,class:"em-note-handle",onPointerdown:I[3]||(I[3]=t.withModifiers(()=>{},["stop"]))},null,8,["id","position"])),64)),l.value&&!k.value?(t.openBlock(),t.createElementBlock("div",{key:3,class:"em-note__resize nodrag nopan",onPointerdown:C,onPointermove:R,onPointerup:T},null,32)):t.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-62a09d8c"]]);function _r(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 ni=.5;function Dp(e,n,o,i,a,r){const l=_r(n),s=_r(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 p=e;const f=(b,_)=>{(Math.abs(b.x-p.x)>=ni||Math.abs(b.y-p.y)>=ni)&&(m.push({a:p,b,seg:_}),p=b)};f(c,0);let h=l.x!==0,g=c;for(let b=1;b<u.length;b++){const _=u[b],k=b<=o.length?b-1:o.length,N=Math.abs(_.x-g.x)<ni,y=Math.abs(_.y-g.y)<ni;N&&y||(N?(f(_,k),h=!1):y?(f(_,k),h=!0):h?(f({x:g.x,y:_.y},k),f(_,k),h=!0):(f({x:_.x,y:g.y},k),f(_,k),h=!1),g=_)}return f(i,o.length),m}function Ds(e,n,o,i,a,r=20){const l=Dp(e,n,o,i,a,r);let s=`M ${Tt(e.x)},${Tt(e.y)}`;for(const c of l)s+=` L ${Tt(c.b.x)},${Tt(c.b.y)}`;return s}const Rx=14;function Op(e,n,o,i,a,r=20){return Dp(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 Tt(e){return Math.round(e*100)/100}const Ax=36;function $x(e,n,o=Ax){const i=Math.max(e.x,n.x)+o;return`M ${Tt(e.x)},${Tt(e.y)} L ${Tt(i)},${Tt(e.y)} L ${Tt(i)},${Tt(n.y)} L ${Tt(n.x)},${Tt(n.y)}`}function Os(e,n,o){const i=[e,...n,o];let a=`M ${Tt(i[0].x)},${Tt(i[0].y)}`;for(let r=1;r<i.length;r++)a+=` L ${Tt(i[r].x)},${Tt(i[r].y)}`;return a}function Tx(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Lp(e,n){const o=Tx(e),i=e.width/2,a=e.height/2,r=n.x-o.x,l=n.y-o.y;if(Math.abs(r)<ni&&Math.abs(l)<ni)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 Pp(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 zp(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 Mx=20,Vx=22,Bx=7,Dx=22,Fp=31,Up=7,Ox=20,Hp=11,jp=11,Lx=Fp+Up;function Px(e){return e==="NO_INSTANCE_OR_ONE_INSTANCE"||e==="ZERO_OR_MORE_INSTANCES"}function zx(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function kr(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 Kp(e,n){return Math.atan2(n.y-e.y,n.x-e.x)}function Er(e,n,o){return{x:Math.cos(o)*n+e.x,y:Math.sin(o)*n+e.y}}function Gp(e,n,o,i){const a=i/2,r=e.x===n.x&&e.y===n.y?Math.PI/2:Kp(e,n);return[Er(o,a,r-Math.PI/2),Er(o,a,r+Math.PI/2)]}function Yp(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 qp(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=kr(e,n,Mx),[d,u]=Gp(e,n,c,Vx);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}),Px(o.multiplicity)){const m=kr(e,n,Fp);r.push({cx:m.x,cy:m.y,r:Up})}if(zx(o.multiplicity)){const m=kr(e,n,Bx),[p,f]=Gp(e,n,m,Dx);a.push({x1:c.x,y1:c.y,x2:p.x,y2:p.y}),a.push({x1:c.x,y1:c.y,x2:f.x,y2:f.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=kr(e,n,Ox),d={x:(e.x+c.x)/2,y:(e.y+c.y)/2},u=Kp(e,n),m=Er(d,Hp/2,u-Math.PI/2),p=Er(d,Hp/2,u+Math.PI/2);l.push({points:[e,m,c,p]}),s=c}if(o.navigable&&!o.otherNavigable){const c=Math.atan2(n.x-e.x,n.y-e.y),d=Yp(s,c,jp,!0),u=Yp(s,c,jp,!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 Wp=200,Jp=120,Ls=24;function Xp(e){var a,r;if(!e)return{x:0,y:0,width:Wp,height:Jp};const n=e.computedPosition??e.position??{x:0,y:0},o=((a=e.dimensions)==null?void 0:a.width)||Wp,i=((r=e.dimensions)==null?void 0:r.height)||Jp;return{x:n.x,y:n.y,width:o,height:i}}function Zp(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Ps(e){const n=t.computed(()=>Xp(e.sourceNode())),o=t.computed(()=>Xp(e.targetNode())),i=t.computed(()=>{const d=e.sourceNode(),u=e.targetNode();return!!d&&!!u&&d.id===u.id}),a=t.computed(()=>{var f,h;const d=n.value,u=d.x+d.width;let m=((f=e.sourceRowY)==null?void 0:f.call(e))??d.y+d.height/3,p=((h=e.targetRowY)==null?void 0:h.call(e))??d.y+d.height*2/3;if(Math.abs(p-m)<Ls){const g=(m+p)/2;m=g-Ls/2,p=g+Ls/2}return{source:{x:u,y:m},target:{x:u,y:p}}}),r=t.computed(()=>e.waypoints()[0]??Zp(o.value)),l=t.computed(()=>{const d=e.waypoints();return d[d.length-1]??Zp(n.value)}),s=t.computed(()=>{var u;const d=(u=e.sourceRowY)==null?void 0:u.call(e);return d!=null?Pp(n.value,d,r.value.x):Lp(n.value,r.value)}),c=t.computed(()=>{var u;const d=(u=e.targetRowY)==null?void 0:u.call(e);return d!=null?Pp(o.value,d,l.value.x):Lp(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 zs=Symbol("waypointController"),Fx=["d"],Ux=["d"],Hx=["d"],jx=["x1","y1","x2","y2"],Kx=["cx","cy","r"],Gx=["x","y"],Yx=["x","y"],qx=["cx","cy","onDblclick"],Wx=["x","y","onPointerdown","onDblclick"],Qp=Qe(t.defineComponent({inheritAttrs:!1,__name:"AssociationEdge",props:{id:{},sourceY:{},targetY:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,{screenToFlowCoordinate:o}=tt(),i=t.inject(zs),a=t.inject(Gn,null),r=t.computed(()=>!!a&&a.editable.value),l=t.inject(Ep,null),s=t.inject(Co,null),c=t.computed(()=>!!s&&s.relatedEdgeIds.value.has(n.id)),d=t.computed(()=>{var Z;return((Z=a==null?void 0:a.selection.value)==null?void 0:Z.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 Z=l==null?void 0:l.value;if(!Z||!a)return null;const re=a.resolved.value.entities,ue=L=>{var F;return(F=re.find(X=>X.entity.modelId===L))==null?void 0:F.groupRef},z=n.data.association;return ue(z.end1.entityRef)===Z.groupId&&ue(z.end2.entityRef)===Z.groupId?{dx:Z.dx,dy:Z.dy}:null}),p=t.computed(()=>(i==null?void 0:i.points(n.id))??[]),f=t.ref(-1),h=t.ref({x:0,y:0}),g=t.computed(()=>{const Z=m.value;return p.value.map((re,ue)=>ue===f.value?h.value:Z?{x:re.x+Z.dx,y:re.y+Z.dy}:re)}),b=t.computed(()=>{var Z;return!!((Z=n.sourceNode.data)!=null&&Z.collapsed)}),_=t.computed(()=>{var Z;return!!((Z=n.targetNode.data)!=null&&Z.collapsed)}),{source:k,target:N,sourceSide:y,targetSide:E,isSelf:S}=Ps({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>g.value,sourceRowY:()=>n.data.sourceColumnRef&&!b.value?n.sourceY:void 0,targetRowY:()=>n.data.targetColumnRef&&!_.value?n.targetY:void 0}),A=Lx+4,V=t.computed(()=>S.value?$x(k.value,N.value):(a==null?void 0:a.routingMode.value)==="orthogonal"?Ds(k.value,y.value,g.value,N.value,E.value,A):Os(k.value,g.value,N.value)),$=t.computed(()=>S.value||!r.value?[]:(a==null?void 0:a.routingMode.value)==="orthogonal"?Op(k.value,y.value,g.value,N.value,E.value,A):zp(k.value,g.value,N.value).map((Z,re)=>({point:Z,segIndex:re}))),O=t.computed(()=>S.value||!r.value?[]:g.value),C=ca;function R(Z,re){f.value=Z,h.value={...p.value[Z]},re.target.setPointerCapture(re.pointerId),re.stopPropagation()}function T(Z){if(f.value<0)return;const re=o({x:Z.clientX,y:Z.clientY});h.value={x:re.x,y:re.y}}function w(Z){var re,ue;f.value>=0&&i&&i.movePoint(n.id,f.value,{...h.value}),f.value=-1,(ue=(re=Z.target).releasePointerCapture)==null||ue.call(re,Z.pointerId)}function I(Z,re){re.stopPropagation(),i==null||i.removePoint(n.id,Z)}function v(Z,re){if(!i)return;const ue=o({x:re.clientX,y:re.clientY});i.insertPoint(n.id,Z,{x:ue.x,y:ue.y})}const B=t.computed(()=>C(n.data.association.end1.multiplicity)),M=t.computed(()=>C(n.data.association.end2.multiplicity)),x=t.computed(()=>(a==null?void 0:a.displayMode.value)==="CLASS"?"class":"db"),P=t.computed(()=>x.value==="class"),Y=t.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const Z=_r(y.value);return{x:k.value.x+Z.x*10,y:k.value.y+Z.y*10}}return g.value[0]??N.value}),se=t.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const re=_r(E.value);return{x:N.value.x+re.x*10,y:N.value.y+re.y*10}}const Z=g.value;return Z[Z.length-1]??k.value}),he=t.computed(()=>{const Z=n.data.association;return{multiplicity:Z.end1.multiplicity,navigable:Z.end1.navigable,composition:Z.end1.composition,otherNavigable:Z.end2.navigable}}),ie=t.computed(()=>{const Z=n.data.association;return{multiplicity:Z.end2.multiplicity,navigable:Z.end2.navigable,composition:Z.end2.composition,otherNavigable:Z.end1.navigable}}),fe=t.computed(()=>qp(k.value,Y.value,he.value,x.value)),pe=t.computed(()=>qp(N.value,se.value,ie.value,x.value)),ge=t.computed(()=>[...fe.value.lines,...pe.value.lines]),Te=t.computed(()=>[...fe.value.circles,...pe.value.circles]),He=t.computed(()=>[...fe.value.polygons,...pe.value.polygons].map(Z=>`M${Z.points.map(re=>`${re.x},${re.y}`).join(" L")} Z`)),De=t.computed(()=>({"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}));return(Z,re)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("path",{d:V.value,fill:"none",class:"em-edge__hit"},null,8,Fx),t.createElementVNode("path",{d:V.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,Ux),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(He.value,(ue,z)=>(t.openBlock(),t.createElementBlock("path",{key:`mpoly-${z}`,d:ue,class:t.normalizeClass(["em-edge__marker em-edge__marker--fill",De.value])},null,10,Hx))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ge.value,(ue,z)=>(t.openBlock(),t.createElementBlock("line",{key:`mline-${z}`,x1:ue.x1,y1:ue.y1,x2:ue.x2,y2:ue.y2,class:t.normalizeClass(["em-edge__marker",De.value])},null,10,jx))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Te.value,(ue,z)=>(t.openBlock(),t.createElementBlock("circle",{key:`mcirc-${z}`,cx:ue.cx,cy:ue.cy,r:ue.r,class:t.normalizeClass(["em-edge__marker",De.value])},null,10,Kx))),128)),P.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("text",{x:t.unref(k).x+8,y:t.unref(k).y-6,class:t.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},t.toDisplayString(B.value),11,Gx),t.createElementVNode("text",{x:t.unref(N).x-8,y:t.unref(N).y-6,"text-anchor":"end",class:t.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},t.toDisplayString(M.value),11,Yx)],64)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList($.value,(ue,z)=>(t.openBlock(),t.createElementBlock("circle",{key:`mid-${z}`,cx:ue.point.x,cy:ue.point.y,r:"4",class:t.normalizeClass(["em-edge__mid",{"is-dimmed":u.value}]),onDblclick:t.withModifiers(L=>v(ue.segIndex,L),["stop"])},null,42,qx))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(O.value,(ue,z)=>(t.openBlock(),t.createElementBlock("rect",{key:`wp-${z}`,x:ue.x-5,y:ue.y-5,width:"10",height:"10",rx:"2",class:t.normalizeClass(["em-edge__waypoint",{"is-dimmed":u.value}]),onPointerdown:L=>R(z,L),onPointermove:T,onPointerup:w,onDblclick:L=>I(z,L)},null,42,Wx))),128))],64))}}),[["__scopeId","data-v-5468806a"]]);var Rn=(e=>(e.Lines="lines",e.Dots="dots",e))(Rn||{});const eh=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]}`})},th=function({radius:e,color:n}){return t.h("circle",{cx:e,cy:e,r:e,fill:n})};Rn.Lines+"",Rn.Dots+"";const Jx={[Rn.Dots]:"#81818a",[Rn.Lines]:"#eee"},Xx=["id","x","y","width","height","patternTransform"],Zx={key:2,height:"100",width:"100"},Qx=["fill"],eR=["x","y","fill"],tR={name:"Background",compatConfig:{MODE:3}},nR=t.defineComponent({...tR,props:{id:{},variant:{default:()=>Rn.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}=tt(),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,p]=Array.isArray(e.offset)?e.offset:[e.offset,e.offset],f=[m*l||1+d[0]/2,p*l||1+d[1]/2];return{scaledGap:d,offset:f,size:u}}),a=t.toRef(()=>`pattern-${n}${e.id?`-${e.id}`:""}`),r=t.toRef(()=>e.color||e.patternColor||Jx[e.variant||Rn.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(Rn).Lines?(t.openBlock(),t.createBlock(t.unref(eh),{key:0,size:l.lineWidth,color:r.value,dimensions:i.value.scaledGap},null,8,["size","color","dimensions"])):l.variant===t.unref(Rn).Dots?(t.openBlock(),t.createBlock(t.unref(th),{key:1,color:r.value,radius:i.value.size/2},null,8,["color","radius"])):t.createCommentVNode("",!0),l.bgColor?(t.openBlock(),t.createElementBlock("svg",Zx,[t.createElementVNode("rect",{width:"100%",height:"100%",fill:l.bgColor},null,8,Qx)])):t.createCommentVNode("",!0)])],8,Xx)]),t.createElementVNode("rect",{x:l.x,y:l.y,width:"100%",height:"100%",fill:`url(#${a.value})`},null,8,eR),t.renderSlot(l.$slots,"default",{id:a.value})],4))}}),oR={name:"ControlButton",compatConfig:{MODE:3}},iR=(e,n)=>{const o=e.__vccOpts||e;for(const[i,a]of n)o[i]=a;return o},aR={type:"button",class:"vue-flow__controls-button"};function rR(e,n,o,i,a,r){return t.openBlock(),t.createElementBlock("button",aR,[t.renderSlot(e.$slots,"default")])}const So=iR(oR,[["render",rR]]),lR={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},sR=[t.createElementVNode("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function cR(e,n){return t.openBlock(),t.createElementBlock("svg",lR,sR)}const dR={render:cR},uR={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},mR=[t.createElementVNode("path",{d:"M0 0h32v4.2H0z"},null,-1)];function fR(e,n){return t.openBlock(),t.createElementBlock("svg",uR,mR)}const pR={render:fR},hR={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},yR=[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 gR(e,n){return t.openBlock(),t.createElementBlock("svg",hR,yR)}const bR={render:gR},_R={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},kR=[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 ER(e,n){return t.openBlock(),t.createElementBlock("svg",_R,kR)}const NR={render:ER},wR={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},IR=[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 vR(e,n){return t.openBlock(),t.createElementBlock("svg",wR,IR)}const CR={render:vR},SR={name:"Controls",compatConfig:{MODE:3}},xR=t.defineComponent({...SR,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>ef.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}=tt(),p=t.toRef(()=>o.value||i.value||a.value),f=t.toRef(()=>d.value.zoom<=u.value),h=t.toRef(()=>d.value.zoom>=m.value);function g(){l(),n("zoomIn")}function b(){s(),n("zoomOut")}function _(){c(e.fitViewParams),n("fitView")}function k(){r(!p.value),n("interactionChange",!p.value)}return(N,y)=>(t.openBlock(),t.createBlock(t.unref(Qf),{class:"vue-flow__controls",position:N.position},{default:t.withCtx(()=>[t.renderSlot(N.$slots,"top"),N.showZoom?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.renderSlot(N.$slots,"control-zoom-in",{},()=>[t.createVNode(So,{class:"vue-flow__controls-zoomin",disabled:h.value,onClick:g},{default:t.withCtx(()=>[t.renderSlot(N.$slots,"icon-zoom-in",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(dR))))])]),_:3},8,["disabled"])]),t.renderSlot(N.$slots,"control-zoom-out",{},()=>[t.createVNode(So,{class:"vue-flow__controls-zoomout",disabled:f.value,onClick:b},{default:t.withCtx(()=>[t.renderSlot(N.$slots,"icon-zoom-out",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(pR))))])]),_:3},8,["disabled"])])],64)):t.createCommentVNode("",!0),N.showFitView?t.renderSlot(N.$slots,"control-fit-view",{key:1},()=>[t.createVNode(So,{class:"vue-flow__controls-fitview",onClick:_},{default:t.withCtx(()=>[t.renderSlot(N.$slots,"icon-fit-view",{},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(bR))))])]),_:3})]):t.createCommentVNode("",!0),N.showInteractive?t.renderSlot(N.$slots,"control-interactive",{key:2},()=>[N.showInteractive?(t.openBlock(),t.createBlock(So,{key:0,class:"vue-flow__controls-interactive",onClick:k},{default:t.withCtx(()=>[p.value?t.renderSlot(N.$slots,"icon-unlock",{key:0},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(CR))))]):t.createCommentVNode("",!0),p.value?t.createCommentVNode("",!0):t.renderSlot(N.$slots,"icon-lock",{key:1},()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(t.unref(NR))))])]),_:3})):t.createCommentVNode("",!0)]):t.createCommentVNode("",!0),t.renderSlot(N.$slots,"default")]),_:3},8,["position"]))}});var RR={value:()=>{}};function Fs(){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 Nr(o)}function Nr(e){this._=e}function AR(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}})}Nr.prototype=Fs.prototype={constructor:Nr,on:function(e,n){var o=this._,i=AR(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=$R(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]=nh(o[a],e.name,n);else if(n==null)for(a in o)o[a]=nh(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 Nr(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 $R(e,n){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===n)return a.value}function nh(e,n,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===n){e[i]=RR,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:n,value:o}),e}var Us="http://www.w3.org/1999/xhtml";const oh={svg:"http://www.w3.org/2000/svg",xhtml:Us,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function wr(e){var n=e+="",o=n.indexOf(":");return o>=0&&(n=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),oh.hasOwnProperty(n)?{space:oh[n],local:e}:e}function TR(e){return function(){var n=this.ownerDocument,o=this.namespaceURI;return o===Us&&n.documentElement.namespaceURI===Us?n.createElement(e):n.createElementNS(o,e)}}function MR(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ih(e){var n=wr(e);return(n.local?MR:TR)(n)}function VR(){}function Hs(e){return e==null?VR:function(){return this.querySelector(e)}}function BR(e){typeof e!="function"&&(e=Hs(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 Ht(i,this._parents)}function DR(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function OR(){return[]}function ah(e){return e==null?OR:function(){return this.querySelectorAll(e)}}function LR(e){return function(){return DR(e.apply(this,arguments))}}function PR(e){typeof e=="function"?e=LR(e):e=ah(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 Ht(i,a)}function rh(e){return function(){return this.matches(e)}}function lh(e){return function(n){return n.matches(e)}}var zR=Array.prototype.find;function FR(e){return function(){return zR.call(this.children,e)}}function UR(){return this.firstElementChild}function HR(e){return this.select(e==null?UR:FR(typeof e=="function"?e:lh(e)))}var jR=Array.prototype.filter;function KR(){return Array.from(this.children)}function GR(e){return function(){return jR.call(this.children,e)}}function YR(e){return this.selectAll(e==null?KR:GR(typeof e=="function"?e:lh(e)))}function qR(e){typeof e!="function"&&(e=rh(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 Ht(i,this._parents)}function sh(e){return new Array(e.length)}function WR(){return new Ht(this._enter||this._groups.map(sh),this._parents)}function Ir(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Ir.prototype={constructor:Ir,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 JR(e){return function(){return e}}function XR(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 Ir(e,r[l]);for(;l<c;++l)(s=n[l])&&(a[l]=s)}function ZR(e,n,o,i,a,r,l){var s,c,d=new Map,u=n.length,m=r.length,p=new Array(u),f;for(s=0;s<u;++s)(c=n[s])&&(p[s]=f=l.call(c,c.__data__,s,n)+"",d.has(f)?a[s]=c:d.set(f,c));for(s=0;s<m;++s)f=l.call(e,r[s],s,r)+"",(c=d.get(f))?(i[s]=c,c.__data__=r[s],d.delete(f)):o[s]=new Ir(e,r[s]);for(s=0;s<u;++s)(c=n[s])&&d.get(p[s])===c&&(a[s]=c)}function QR(e){return e.__data__}function eA(e,n){if(!arguments.length)return Array.from(this,QR);var o=n?ZR:XR,i=this._parents,a=this._groups;typeof e!="function"&&(e=JR(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],p=m.length,f=tA(e.call(u,u&&u.__data__,d,i)),h=f.length,g=s[d]=new Array(h),b=l[d]=new Array(h),_=c[d]=new Array(p);o(u,m,g,b,_,f,n);for(var k=0,N=0,y,E;k<h;++k)if(y=g[k]){for(k>=N&&(N=k+1);!(E=b[N])&&++N<h;);y._next=E||null}}return l=new Ht(l,i),l._enter=s,l._exit=c,l}function tA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nA(){return new Ht(this._exit||this._groups.map(sh),this._parents)}function oA(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 iA(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,p=s[c]=new Array(m),f,h=0;h<m;++h)(f=d[h]||u[h])&&(p[h]=f);for(;c<a;++c)s[c]=o[c];return new Ht(s,this._parents)}function aA(){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 rA(e){e||(e=lA);function n(m,p){return m&&p?e(m.__data__,p.__data__):!m-!p}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 Ht(a,this._parents).order()}function lA(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function sA(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function cA(){return Array.from(this)}function dA(){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 uA(){let e=0;for(const n of this)++e;return e}function mA(){return!this.node()}function fA(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 pA(e){return function(){this.removeAttribute(e)}}function hA(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yA(e,n){return function(){this.setAttribute(e,n)}}function gA(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function bA(e,n){return function(){var o=n.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function _A(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 kA(e,n){var o=wr(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?hA:pA:typeof n=="function"?o.local?_A:bA:o.local?gA:yA)(o,n))}function ch(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function EA(e){return function(){this.style.removeProperty(e)}}function NA(e,n,o){return function(){this.style.setProperty(e,n,o)}}function wA(e,n,o){return function(){var i=n.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function IA(e,n,o){return arguments.length>1?this.each((n==null?EA:typeof n=="function"?wA:NA)(e,n,o??"")):oi(this.node(),e)}function oi(e,n){return e.style.getPropertyValue(n)||ch(e).getComputedStyle(e,null).getPropertyValue(n)}function vA(e){return function(){delete this[e]}}function CA(e,n){return function(){this[e]=n}}function SA(e,n){return function(){var o=n.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function xA(e,n){return arguments.length>1?this.each((n==null?vA:typeof n=="function"?SA:CA)(e,n)):this.node()[e]}function dh(e){return e.trim().split(/^|\s+/)}function js(e){return e.classList||new uh(e)}function uh(e){this._node=e,this._names=dh(e.getAttribute("class")||"")}uh.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 mh(e,n){for(var o=js(e),i=-1,a=n.length;++i<a;)o.add(n[i])}function fh(e,n){for(var o=js(e),i=-1,a=n.length;++i<a;)o.remove(n[i])}function RA(e){return function(){mh(this,e)}}function AA(e){return function(){fh(this,e)}}function $A(e,n){return function(){(n.apply(this,arguments)?mh:fh)(this,e)}}function TA(e,n){var o=dh(e+"");if(arguments.length<2){for(var i=js(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof n=="function"?$A:n?RA:AA)(o,n))}function MA(){this.textContent=""}function VA(e){return function(){this.textContent=e}}function BA(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function DA(e){return arguments.length?this.each(e==null?MA:(typeof e=="function"?BA:VA)(e)):this.node().textContent}function OA(){this.innerHTML=""}function LA(e){return function(){this.innerHTML=e}}function PA(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function zA(e){return arguments.length?this.each(e==null?OA:(typeof e=="function"?PA:LA)(e)):this.node().innerHTML}function FA(){this.nextSibling&&this.parentNode.appendChild(this)}function UA(){return this.each(FA)}function HA(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jA(){return this.each(HA)}function KA(e){var n=typeof e=="function"?e:ih(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function GA(){return null}function YA(e,n){var o=typeof e=="function"?e:ih(e),i=n==null?GA:typeof n=="function"?n:Hs(n);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function qA(){var e=this.parentNode;e&&e.removeChild(this)}function WA(){return this.each(qA)}function JA(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function XA(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function ZA(e){return this.select(e?XA:JA)}function QA(e){return arguments.length?this.property("__data__",e):this.node().__data__}function e$(e){return function(n){e.call(this,n,this.__data__)}}function t$(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 n$(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 o$(e,n,o){return function(){var i=this.__on,a,r=e$(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 i$(e,n,o){var i=t$(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?o$:n$,a=0;a<r;++a)this.each(s(i[a],n,o));return this}function ph(e,n,o){var i=ch(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 a$(e,n){return function(){return ph(this,e,n)}}function r$(e,n){return function(){return ph(this,e,n.apply(this,arguments))}}function l$(e,n){return this.each((typeof n=="function"?r$:a$)(e,n))}function*s$(){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 hh=[null];function Ht(e,n){this._groups=e,this._parents=n}function Hi(){return new Ht([[document.documentElement]],hh)}function c$(){return this}Ht.prototype=Hi.prototype={constructor:Ht,select:BR,selectAll:PR,selectChild:HR,selectChildren:YR,filter:qR,data:eA,enter:WR,exit:nA,join:oA,merge:iA,selection:c$,order:aA,sort:rA,call:sA,nodes:cA,node:dA,size:uA,empty:mA,each:fA,attr:kA,style:IA,property:xA,classed:TA,text:DA,html:zA,raise:UA,lower:jA,append:KA,insert:YA,remove:WA,clone:ZA,datum:QA,on:i$,dispatch:l$,[Symbol.iterator]:s$};function Yn(e){return typeof e=="string"?new Ht([[document.querySelector(e)]],[document.documentElement]):new Ht([[e]],hh)}function d$(e){let n;for(;n=e.sourceEvent;)e=n;return e}function qn(e,n){if(e=d$(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 Ks={capture:!0,passive:!1};function Gs(e){e.preventDefault(),e.stopImmediatePropagation()}function u$(e){var n=e.document.documentElement,o=Yn(e).on("dragstart.drag",Gs,Ks);"onselectstart"in n?o.on("selectstart.drag",Gs,Ks):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function m$(e,n){var o=e.document.documentElement,i=Yn(e).on("dragstart.drag",null);n&&(i.on("click.drag",Gs,Ks),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 Ys(e,n,o){e.prototype=n.prototype=o,o.constructor=e}function yh(e,n){var o=Object.create(e.prototype);for(var i in n)o[i]=n[i];return o}function ji(){}var Ki=.7,vr=1/Ki,ii="\\s*([+-]?\\d+)\\s*",Gi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",f$=/^#([0-9a-f]{3,8})$/,p$=new RegExp(`^rgb\\(${ii},${ii},${ii}\\)$`),h$=new RegExp(`^rgb\\(${fn},${fn},${fn}\\)$`),y$=new RegExp(`^rgba\\(${ii},${ii},${ii},${Gi}\\)$`),g$=new RegExp(`^rgba\\(${fn},${fn},${fn},${Gi}\\)$`),b$=new RegExp(`^hsl\\(${Gi},${fn},${fn}\\)$`),_$=new RegExp(`^hsla\\(${Gi},${fn},${fn},${Gi}\\)$`),gh={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};Ys(ji,Yi,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:bh,formatHex:bh,formatHex8:k$,formatHsl:E$,formatRgb:_h,toString:_h});function bh(){return this.rgb().formatHex()}function k$(){return this.rgb().formatHex8()}function E$(){return Ih(this).formatHsl()}function _h(){return this.rgb().formatRgb()}function Yi(e){var n,o;return e=(e+"").trim().toLowerCase(),(n=f$.exec(e))?(o=n[1].length,n=parseInt(n[1],16),o===6?kh(n):o===3?new Lt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):o===8?Cr(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):o===4?Cr(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=p$.exec(e))?new Lt(n[1],n[2],n[3],1):(n=h$.exec(e))?new Lt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=y$.exec(e))?Cr(n[1],n[2],n[3],n[4]):(n=g$.exec(e))?Cr(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=b$.exec(e))?wh(n[1],n[2]/100,n[3]/100,1):(n=_$.exec(e))?wh(n[1],n[2]/100,n[3]/100,n[4]):gh.hasOwnProperty(e)?kh(gh[e]):e==="transparent"?new Lt(NaN,NaN,NaN,0):null}function kh(e){return new Lt(e>>16&255,e>>8&255,e&255,1)}function Cr(e,n,o,i){return i<=0&&(e=n=o=NaN),new Lt(e,n,o,i)}function N$(e){return e instanceof ji||(e=Yi(e)),e?(e=e.rgb(),new Lt(e.r,e.g,e.b,e.opacity)):new Lt}function qs(e,n,o,i){return arguments.length===1?N$(e):new Lt(e,n,o,i??1)}function Lt(e,n,o,i){this.r=+e,this.g=+n,this.b=+o,this.opacity=+i}Ys(Lt,qs,yh(ji,{brighter(e){return e=e==null?vr:Math.pow(vr,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new Lt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Lt(xo(this.r),xo(this.g),xo(this.b),Sr(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:Eh,formatHex:Eh,formatHex8:w$,formatRgb:Nh,toString:Nh}));function Eh(){return`#${Ro(this.r)}${Ro(this.g)}${Ro(this.b)}`}function w$(){return`#${Ro(this.r)}${Ro(this.g)}${Ro(this.b)}${Ro((isNaN(this.opacity)?1:this.opacity)*255)}`}function Nh(){const e=Sr(this.opacity);return`${e===1?"rgb(":"rgba("}${xo(this.r)}, ${xo(this.g)}, ${xo(this.b)}${e===1?")":`, ${e})`}`}function Sr(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ro(e){return e=xo(e),(e<16?"0":"")+e.toString(16)}function wh(e,n,o,i){return i<=0?e=n=o=NaN:o<=0||o>=1?e=n=NaN:n<=0&&(e=NaN),new nn(e,n,o,i)}function Ih(e){if(e instanceof nn)return new nn(e.h,e.s,e.l,e.opacity);if(e instanceof ji||(e=Yi(e)),!e)return new nn;if(e instanceof nn)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 nn(l,s,c,e.opacity)}function I$(e,n,o,i){return arguments.length===1?Ih(e):new nn(e,n,o,i??1)}function nn(e,n,o,i){this.h=+e,this.s=+n,this.l=+o,this.opacity=+i}Ys(nn,I$,yh(ji,{brighter(e){return e=e==null?vr:Math.pow(vr,e),new nn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ki:Math.pow(Ki,e),new nn(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 Lt(Ws(e>=240?e-240:e+120,a,i),Ws(e,a,i),Ws(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new nn(vh(this.h),xr(this.s),xr(this.l),Sr(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=Sr(this.opacity);return`${e===1?"hsl(":"hsla("}${vh(this.h)}, ${xr(this.s)*100}%, ${xr(this.l)*100}%${e===1?")":`, ${e})`}`}}));function vh(e){return e=(e||0)%360,e<0?e+360:e}function xr(e){return Math.max(0,Math.min(1,e||0))}function Ws(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 Ch=e=>()=>e;function v$(e,n){return function(o){return e+o*n}}function C$(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 S$(e){return(e=+e)==1?Sh:function(n,o){return o-n?C$(n,o,e):Ch(isNaN(n)?o:n)}}function Sh(e,n){var o=n-e;return o?v$(e,o):Ch(isNaN(e)?n:e)}const xh=(function e(n){var o=S$(n);function i(a,r){var l=o((a=qs(a)).r,(r=qs(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=Sh(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 Wn(e,n){return e=+e,n=+n,function(o){return e*(1-o)+n*o}}var Js=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xs=new RegExp(Js.source,"g");function x$(e){return function(){return e}}function R$(e){return function(n){return e(n)+""}}function A$(e,n){var o=Js.lastIndex=Xs.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",n=n+"";(i=Js.exec(e))&&(a=Xs.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:Wn(i,a)})),o=Xs.lastIndex;return o<n.length&&(r=n.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?R$(c[0].x):x$(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 Rh=180/Math.PI,Zs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Ah(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)*Rh,skewX:Math.atan(c)*Rh,scaleX:l,scaleY:s}}var Rr;function $$(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Zs:Ah(n.a,n.b,n.c,n.d,n.e,n.f)}function T$(e){return e==null||(Rr||(Rr=document.createElementNS("http://www.w3.org/2000/svg","g")),Rr.setAttribute("transform",e),!(e=Rr.transform.baseVal.consolidate()))?Zs:(e=e.matrix,Ah(e.a,e.b,e.c,e.d,e.e,e.f))}function $h(e,n,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,p,f,h){if(d!==m||u!==p){var g=f.push("translate(",null,n,null,o);h.push({i:g-4,x:Wn(d,m)},{i:g-2,x:Wn(u,p)})}else(m||p)&&f.push("translate("+m+n+p+o)}function l(d,u,m,p){d!==u?(d-u>180?u+=360:u-d>180&&(d+=360),p.push({i:m.push(a(m)+"rotate(",null,i)-2,x:Wn(d,u)})):u&&m.push(a(m)+"rotate("+u+i)}function s(d,u,m,p){d!==u?p.push({i:m.push(a(m)+"skewX(",null,i)-2,x:Wn(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,p,f,h){if(d!==m||u!==p){var g=f.push(a(f)+"scale(",null,",",null,")");h.push({i:g-4,x:Wn(d,m)},{i:g-2,x:Wn(u,p)})}else(m!==1||p!==1)&&f.push(a(f)+"scale("+m+","+p+")")}return function(d,u){var m=[],p=[];return d=e(d),u=e(u),r(d.translateX,d.translateY,u.translateX,u.translateY,m,p),l(d.rotate,u.rotate,m,p),s(d.skewX,u.skewX,m,p),c(d.scaleX,d.scaleY,u.scaleX,u.scaleY,m,p),d=u=null,function(f){for(var h=-1,g=p.length,b;++h<g;)m[(b=p[h]).i]=b.x(f);return m.join("")}}}var M$=$h($$,"px, ","px)","deg)"),V$=$h(T$,", ",")",")"),B$=1e-12;function Th(e){return((e=Math.exp(e))+1/e)/2}function D$(e){return((e=Math.exp(e))-1/e)/2}function O$(e){return((e=Math.exp(2*e))-1)/(e+1)}const L$=(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],p=l[2],f=u-s,h=m-c,g=f*f+h*h,b,_;if(g<B$)_=Math.log(p/d)/n,b=function(A){return[s+A*f,c+A*h,d*Math.exp(n*A*_)]};else{var k=Math.sqrt(g),N=(p*p-d*d+i*g)/(2*d*o*k),y=(p*p-d*d-i*g)/(2*p*o*k),E=Math.log(Math.sqrt(N*N+1)-N),S=Math.log(Math.sqrt(y*y+1)-y);_=(S-E)/n,b=function(A){var V=A*_,$=Th(E),O=d/(o*k)*($*O$(n*V+E)-D$(E));return[s+O*f,c+O*h,d*$/Th(n*V+E)]}}return b.duration=_*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,qi=0,Wi=0,Mh=1e3,Ar,Ji,$r=0,Ao=0,Tr=0,Xi=typeof performance=="object"&&performance.now?performance:Date,Vh=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Qs(){return Ao||(Vh(P$),Ao=Xi.now()+Tr)}function P$(){Ao=0}function Mr(){this._call=this._time=this._next=null}Mr.prototype=Bh.prototype={constructor:Mr,restart:function(e,n,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?Qs():+o)+(n==null?0:+n),!this._next&&Ji!==this&&(Ji?Ji._next=this:Ar=this,Ji=this),this._call=e,this._time=o,ec()},stop:function(){this._call&&(this._call=null,this._time=1/0,ec())}};function Bh(e,n,o){var i=new Mr;return i.restart(e,n,o),i}function z$(){Qs(),++ai;for(var e=Ar,n;e;)(n=Ao-e._time)>=0&&e._call.call(void 0,n),e=e._next;--ai}function Dh(){Ao=($r=Xi.now())+Tr,ai=qi=0;try{z$()}finally{ai=0,U$(),Ao=0}}function F$(){var e=Xi.now(),n=e-$r;n>Mh&&(Tr-=n,$r=e)}function U$(){for(var e,n=Ar,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:Ar=o);Ji=e,ec(i)}function ec(e){if(!ai){qi&&(qi=clearTimeout(qi));var n=e-Ao;n>24?(e<1/0&&(qi=setTimeout(Dh,e-Xi.now()-Tr)),Wi&&(Wi=clearInterval(Wi))):(Wi||($r=Xi.now(),Wi=setInterval(F$,Mh)),ai=1,Vh(Dh))}}function Oh(e,n,o){var i=new Mr;return n=n==null?0:+n,i.restart(a=>{i.stop(),e(a+n)},n,o),i}var H$=Fs("start","end","cancel","interrupt"),j$=[],Lh=0,Ph=1,tc=2,Vr=3,zh=4,nc=5,Br=6;function Dr(e,n,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;K$(e,o,{name:n,index:i,group:a,on:H$,tween:j$,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Lh})}function oc(e,n){var o=on(e,n);if(o.state>Lh)throw new Error("too late; already scheduled");return o}function pn(e,n){var o=on(e,n);if(o.state>Vr)throw new Error("too late; already running");return o}function on(e,n){var o=e.__transition;if(!o||!(o=o[n]))throw new Error("transition not found");return o}function K$(e,n,o){var i=e.__transition,a;i[n]=o,o.timer=Bh(r,0,o.time);function r(d){o.state=Ph,o.timer.restart(l,o.delay,o.time),o.delay<=d&&l(d-o.delay)}function l(d){var u,m,p,f;if(o.state!==Ph)return c();for(u in i)if(f=i[u],f.name===o.name){if(f.state===Vr)return Oh(l);f.state===zh?(f.state=Br,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<n&&(f.state=Br,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(Oh(function(){o.state===Vr&&(o.state=zh,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=tc,o.on.call("start",e,e.__data__,o.index,o.group),o.state===tc){for(o.state=Vr,a=new Array(p=o.tween.length),u=0,m=-1;u<p;++u)(f=o.tween[u].value.call(e,e.__data__,o.index,o.group))&&(a[++m]=f);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=nc,1),m=-1,p=a.length;++m<p;)a[m].call(e,u);o.state===nc&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=Br,o.timer.stop(),delete i[n];for(var d in i)return;delete e.__transition}}function Or(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>tc&&i.state<nc,i.state=Br,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function G$(e){return this.each(function(){Or(this,e)})}function Y$(e,n){var o,i;return function(){var a=pn(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 q$(e,n,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=pn(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 W$(e,n){var o=this._id;if(e+="",arguments.length<2){for(var i=on(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?Y$:q$)(o,e,n))}function ic(e,n,o){var i=e._id;return e.each(function(){var a=pn(this,i);(a.value||(a.value={}))[n]=o.apply(this,arguments)}),function(a){return on(a,i).value[n]}}function Fh(e,n){var o;return(typeof n=="number"?Wn:n instanceof Yi?xh:(o=Yi(n))?(n=o,xh):A$)(e,n)}function J$(e){return function(){this.removeAttribute(e)}}function X$(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Z$(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 Q$(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 eT(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 tT(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 nT(e,n){var o=wr(e),i=o==="transform"?V$:Fh;return this.attrTween(e,typeof n=="function"?(o.local?tT:eT)(o,i,ic(this,"attr."+e,n)):n==null?(o.local?X$:J$)(o):(o.local?Q$:Z$)(o,i,n))}function oT(e,n){return function(o){this.setAttribute(e,n.call(this,o))}}function iT(e,n){return function(o){this.setAttributeNS(e.space,e.local,n.call(this,o))}}function aT(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&iT(e,r)),o}return a._value=n,a}function rT(e,n){var o,i;function a(){var r=n.apply(this,arguments);return r!==i&&(o=(i=r)&&oT(e,r)),o}return a._value=n,a}function lT(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=wr(e);return this.tween(o,(i.local?aT:rT)(i,n))}function sT(e,n){return function(){oc(this,e).delay=+n.apply(this,arguments)}}function cT(e,n){return n=+n,function(){oc(this,e).delay=n}}function dT(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?sT:cT)(n,e)):on(this.node(),n).delay}function uT(e,n){return function(){pn(this,e).duration=+n.apply(this,arguments)}}function mT(e,n){return n=+n,function(){pn(this,e).duration=n}}function fT(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?uT:mT)(n,e)):on(this.node(),n).duration}function pT(e,n){if(typeof n!="function")throw new Error;return function(){pn(this,e).ease=n}}function hT(e){var n=this._id;return arguments.length?this.each(pT(n,e)):on(this.node(),n).ease}function yT(e,n){return function(){var o=n.apply(this,arguments);if(typeof o!="function")throw new Error;pn(this,e).ease=o}}function gT(e){if(typeof e!="function")throw new Error;return this.each(yT(this._id,e))}function bT(e){typeof e!="function"&&(e=rh(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 An(i,this._parents,this._name,this._id)}function _T(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),p,f=0;f<u;++f)(p=c[f]||d[f])&&(m[f]=p);for(;s<i;++s)l[s]=n[s];return new An(l,this._parents,this._name,this._id)}function kT(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 ET(e,n,o){var i,a,r=kT(n)?oc:pn;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(n,o),l.on=a}}function NT(e,n){var o=this._id;return arguments.length<2?on(this.node(),o).on.on(e):this.each(ET(o,e,n))}function wT(e){return function(){var n=this.parentNode;for(var o in this.__transition)if(+o!==e)return;n&&n.removeChild(this)}}function IT(){return this.on("end.remove",wT(this._id))}function vT(e){var n=this._name,o=this._id;typeof e!="function"&&(e=Hs(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,p=0;p<c;++p)(u=s[p])&&(m=e.call(u,u.__data__,p,s))&&("__data__"in u&&(m.__data__=u.__data__),d[p]=m,Dr(d[p],n,o,p,d,on(u,o)));return new An(r,this._parents,n,o)}function CT(e){var n=this._name,o=this._id;typeof e!="function"&&(e=ah(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 p=e.call(u,u.__data__,m,c),f,h=on(u,o),g=0,b=p.length;g<b;++g)(f=p[g])&&Dr(f,n,o,g,p,h);r.push(p),l.push(u)}return new An(r,l,n,o)}var ST=Hi.prototype.constructor;function xT(){return new ST(this._groups,this._parents)}function RT(e,n){var o,i,a;return function(){var r=oi(this,e),l=(this.style.removeProperty(e),oi(this,e));return r===l?null:r===o&&l===i?a:a=n(o=r,i=l)}}function Uh(e){return function(){this.style.removeProperty(e)}}function AT(e,n,o){var i,a=o+"",r;return function(){var l=oi(this,e);return l===a?null:l===i?r:r=n(i=l,o)}}function $T(e,n,o){var i,a,r;return function(){var l=oi(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),oi(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=n(i=l,s))}}function TT(e,n){var o,i,a,r="style."+n,l="end."+r,s;return function(){var c=pn(this,e),d=c.on,u=c.value[r]==null?s||(s=Uh(n)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function MT(e,n,o){var i=(e+="")=="transform"?M$:Fh;return n==null?this.styleTween(e,RT(e,i)).on("end.style."+e,Uh(e)):typeof n=="function"?this.styleTween(e,$T(e,i,ic(this,"style."+e,n))).each(TT(this._id,e)):this.styleTween(e,AT(e,i,n),o).on("end.style."+e,null)}function VT(e,n,o){return function(i){this.style.setProperty(e,n.call(this,i),o)}}function BT(e,n,o){var i,a;function r(){var l=n.apply(this,arguments);return l!==a&&(i=(a=l)&&VT(e,l,o)),i}return r._value=n,r}function DT(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,BT(e,n,o??""))}function OT(e){return function(){this.textContent=e}}function LT(e){return function(){var n=e(this);this.textContent=n??""}}function PT(e){return this.tween("text",typeof e=="function"?LT(ic(this,"text",e)):OT(e==null?"":e+""))}function zT(e){return function(n){this.textContent=e.call(this,n)}}function FT(e){var n,o;function i(){var a=e.apply(this,arguments);return a!==o&&(n=(o=a)&&zT(a)),n}return i._value=e,i}function UT(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,FT(e))}function HT(){for(var e=this._name,n=this._id,o=Hh(),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=on(c,n);Dr(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new An(i,this._parents,e,o)}function jT(){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=pn(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 KT=0;function An(e,n,o,i){this._groups=e,this._parents=n,this._name=o,this._id=i}function Hh(){return++KT}var $n=Hi.prototype;An.prototype={constructor:An,select:vT,selectAll:CT,selectChild:$n.selectChild,selectChildren:$n.selectChildren,filter:bT,merge:_T,selection:xT,transition:HT,call:$n.call,nodes:$n.nodes,node:$n.node,size:$n.size,empty:$n.empty,each:$n.each,on:NT,attr:nT,attrTween:lT,style:MT,styleTween:DT,text:PT,textTween:UT,remove:IT,tween:W$,delay:dT,duration:fT,ease:hT,easeVarying:gT,end:jT,[Symbol.iterator]:$n[Symbol.iterator]};function GT(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var YT={time:null,delay:0,duration:250,ease:GT};function qT(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 WT(e){var n,o;e instanceof An?(n=e._id,e=e._name):(n=Hh(),(o=YT).time=Qs(),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])&&Dr(c,e,n,d,l,o||qT(c,n));return new An(i,this._parents,e,n)}Hi.prototype.interrupt=G$,Hi.prototype.transition=WT;const Lr=e=>()=>e;function JT(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 Tn(e,n,o){this.k=e,this.x=n,this.y=o}Tn.prototype={constructor:Tn,scale:function(e){return e===1?this:new Tn(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Tn(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 Tn(1,0,0);Tn.prototype;function rc(e){e.stopImmediatePropagation()}function Zi(e){e.preventDefault(),e.stopImmediatePropagation()}function XT(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function ZT(){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 jh(){return this.__zoom||ac}function QT(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function eM(){return navigator.maxTouchPoints||"ontouchstart"in this}function tM(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 nM(){var e=XT,n=ZT,o=tM,i=QT,a=eM,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=L$,d=Fs("start","zoom","end"),u,m,p,f=500,h=150,g=0,b=10;function _(w){w.property("__zoom",jh).on("wheel.zoom",V,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",O).filter(a).on("touchstart.zoom",C).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(w,I,v,B){var M=w.selection?w.selection():w;M.property("__zoom",jh),w!==M?E(w,I,v,B):M.interrupt().each(function(){S(this,arguments).event(B).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},_.scaleBy=function(w,I,v,B){_.scaleTo(w,function(){var M=this.__zoom.k,x=typeof I=="function"?I.apply(this,arguments):I;return M*x},v,B)},_.scaleTo=function(w,I,v,B){_.transform(w,function(){var M=n.apply(this,arguments),x=this.__zoom,P=v==null?y(M):typeof v=="function"?v.apply(this,arguments):v,Y=x.invert(P),se=typeof I=="function"?I.apply(this,arguments):I;return o(N(k(x,se),P,Y),M,l)},v,B)},_.translateBy=function(w,I,v,B){_.transform(w,function(){return o(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof v=="function"?v.apply(this,arguments):v),n.apply(this,arguments),l)},null,B)},_.translateTo=function(w,I,v,B,M){_.transform(w,function(){var x=n.apply(this,arguments),P=this.__zoom,Y=B==null?y(x):typeof B=="function"?B.apply(this,arguments):B;return o(ac.translate(Y[0],Y[1]).scale(P.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof v=="function"?-v.apply(this,arguments):-v),x,l)},B,M)};function k(w,I){return I=Math.max(r[0],Math.min(r[1],I)),I===w.k?w:new Tn(I,w.x,w.y)}function N(w,I,v){var B=I[0]-v[0]*w.k,M=I[1]-v[1]*w.k;return B===w.x&&M===w.y?w:new Tn(w.k,B,M)}function y(w){return[(+w[0][0]+ +w[1][0])/2,(+w[0][1]+ +w[1][1])/2]}function E(w,I,v,B){w.on("start.zoom",function(){S(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){S(this,arguments).event(B).end()}).tween("zoom",function(){var M=this,x=arguments,P=S(M,x).event(B),Y=n.apply(M,x),se=v==null?y(Y):typeof v=="function"?v.apply(M,x):v,he=Math.max(Y[1][0]-Y[0][0],Y[1][1]-Y[0][1]),ie=M.__zoom,fe=typeof I=="function"?I.apply(M,x):I,pe=c(ie.invert(se).concat(he/ie.k),fe.invert(se).concat(he/fe.k));return function(ge){if(ge===1)ge=fe;else{var Te=pe(ge),He=he/Te[2];ge=new Tn(He,se[0]-Te[0]*He,se[1]-Te[1]*He)}P.zoom(null,ge)}})}function S(w,I,v){return!v&&w.__zooming||new A(w,I)}function A(w,I){this.that=w,this.args=I,this.active=0,this.sourceEvent=null,this.extent=n.apply(w,I),this.taps=0}A.prototype={event:function(w){return w&&(this.sourceEvent=w),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(w,I){return this.mouse&&w!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&w!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&w!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(w){var I=Yn(this.that).datum();d.call(w,this.that,new JT(w,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),I)}};function V(w,...I){if(!e.apply(this,arguments))return;var v=S(this,I).event(w),B=this.__zoom,M=Math.max(r[0],Math.min(r[1],B.k*Math.pow(2,i.apply(this,arguments)))),x=qn(w);if(v.wheel)(v.mouse[0][0]!==x[0]||v.mouse[0][1]!==x[1])&&(v.mouse[1]=B.invert(v.mouse[0]=x)),clearTimeout(v.wheel);else{if(B.k===M)return;v.mouse=[x,B.invert(x)],Or(this),v.start()}Zi(w),v.wheel=setTimeout(P,h),v.zoom("mouse",o(N(k(B,M),v.mouse[0],v.mouse[1]),v.extent,l));function P(){v.wheel=null,v.end()}}function $(w,...I){if(p||!e.apply(this,arguments))return;var v=w.currentTarget,B=S(this,I,!0).event(w),M=Yn(w.view).on("mousemove.zoom",se,!0).on("mouseup.zoom",he,!0),x=qn(w,v),P=w.clientX,Y=w.clientY;u$(w.view),rc(w),B.mouse=[x,this.__zoom.invert(x)],Or(this),B.start();function se(ie){if(Zi(ie),!B.moved){var fe=ie.clientX-P,pe=ie.clientY-Y;B.moved=fe*fe+pe*pe>g}B.event(ie).zoom("mouse",o(N(B.that.__zoom,B.mouse[0]=qn(ie,v),B.mouse[1]),B.extent,l))}function he(ie){M.on("mousemove.zoom mouseup.zoom",null),m$(ie.view,B.moved),Zi(ie),B.event(ie).end()}}function O(w,...I){if(e.apply(this,arguments)){var v=this.__zoom,B=qn(w.changedTouches?w.changedTouches[0]:w,this),M=v.invert(B),x=v.k*(w.shiftKey?.5:2),P=o(N(k(v,x),B,M),n.apply(this,I),l);Zi(w),s>0?Yn(this).transition().duration(s).call(E,P,B,w):Yn(this).call(_.transform,P,B,w)}}function C(w,...I){if(e.apply(this,arguments)){var v=w.touches,B=v.length,M=S(this,I,w.changedTouches.length===B).event(w),x,P,Y,se;for(rc(w),P=0;P<B;++P)Y=v[P],se=qn(Y,this),se=[se,this.__zoom.invert(se),Y.identifier],M.touch0?!M.touch1&&M.touch0[2]!==se[2]&&(M.touch1=se,M.taps=0):(M.touch0=se,x=!0,M.taps=1+!!u);u&&(u=clearTimeout(u)),x&&(M.taps<2&&(m=se[0],u=setTimeout(function(){u=null},f)),Or(this),M.start())}}function R(w,...I){if(this.__zooming){var v=S(this,I).event(w),B=w.changedTouches,M=B.length,x,P,Y,se;for(Zi(w),x=0;x<M;++x)P=B[x],Y=qn(P,this),v.touch0&&v.touch0[2]===P.identifier?v.touch0[0]=Y:v.touch1&&v.touch1[2]===P.identifier&&(v.touch1[0]=Y);if(P=v.that.__zoom,v.touch1){var he=v.touch0[0],ie=v.touch0[1],fe=v.touch1[0],pe=v.touch1[1],ge=(ge=fe[0]-he[0])*ge+(ge=fe[1]-he[1])*ge,Te=(Te=pe[0]-ie[0])*Te+(Te=pe[1]-ie[1])*Te;P=k(P,Math.sqrt(ge/Te)),Y=[(he[0]+fe[0])/2,(he[1]+fe[1])/2],se=[(ie[0]+pe[0])/2,(ie[1]+pe[1])/2]}else if(v.touch0)Y=v.touch0[0],se=v.touch0[1];else return;v.zoom("touch",o(N(P,Y,se),v.extent,l))}}function T(w,...I){if(this.__zooming){var v=S(this,I).event(w),B=w.changedTouches,M=B.length,x,P;for(rc(w),p&&clearTimeout(p),p=setTimeout(function(){p=null},f),x=0;x<M;++x)P=B[x],v.touch0&&v.touch0[2]===P.identifier?delete v.touch0:v.touch1&&v.touch1[2]===P.identifier&&delete v.touch1;if(v.touch1&&!v.touch0&&(v.touch0=v.touch1,delete v.touch1),v.touch0)v.touch0[1]=this.__zoom.invert(v.touch0[0]);else if(v.end(),v.taps===2&&(P=qn(P,this),Math.hypot(m[0]-P[0],m[1]-P[1])<b)){var Y=Yn(this).on("dblclick.zoom");Y&&Y.apply(this,arguments)}}}return _.wheelDelta=function(w){return arguments.length?(i=typeof w=="function"?w:Lr(+w),_):i},_.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Lr(!!w),_):e},_.touchable=function(w){return arguments.length?(a=typeof w=="function"?w:Lr(!!w),_):a},_.extent=function(w){return arguments.length?(n=typeof w=="function"?w:Lr([[+w[0][0],+w[0][1]],[+w[1][0],+w[1][1]]]),_):n},_.scaleExtent=function(w){return arguments.length?(r[0]=+w[0],r[1]=+w[1],_):[r[0],r[1]]},_.translateExtent=function(w){return arguments.length?(l[0][0]=+w[0][0],l[1][0]=+w[1][0],l[0][1]=+w[0][1],l[1][1]=+w[1][1],_):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},_.constrain=function(w){return arguments.length?(o=w,_):o},_.duration=function(w){return arguments.length?(s=+w,_):s},_.interpolate=function(w){return arguments.length?(c=w,_):c},_.on=function(){var w=d.on.apply(d,arguments);return w===d?_:w},_.clickDistance=function(w){return arguments.length?(g=(w=+w)*w,_):Math.sqrt(g)},_.tapDistance=function(w){return arguments.length?(b=+w,_):b},_}const Kh=Symbol("MiniMapSlots"),oM=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],iM={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},aM=t.defineComponent({...iM,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(Kh),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,p)=>!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,oM))],64)):t.createCommentVNode("",!0)}}),rM=["width","height","viewBox","aria-labelledby"],lM=["id"],sM=["d","fill","stroke","stroke-width"],cM={name:"MiniMap",compatConfig:{MODE:3}},dM=t.defineComponent({...cM,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:p,d3Zoom:f,getNodesInitialized:h}=tt(),g=t.ref();t.provide(Kh,o);const b=t.toRef(()=>{var M;return e.width??((M=i.style)==null?void 0:M.width)??a}),_=t.toRef(()=>{var M;return e.height??((M=i.style)==null?void 0:M.height)??r}),k=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",N=t.computed(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),y=t.computed(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),E=t.computed(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),S=t.computed(()=>ys(h.value.filter(M=>!M.hidden))),A=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})),V=t.computed(()=>h.value&&h.value.length?fN(S.value,A.value):A.value),$=t.computed(()=>{const M=V.value.width/b.value,x=V.value.height/_.value;return Math.max(M,x)}),O=t.computed(()=>{const M=$.value*b.value,x=$.value*_.value,P=e.offsetScale*$.value;return{offset:P,x:V.value.x-(M-V.value.width)/2-P,y:V.value.y-(x-V.value.height)/2-P,width:M+P*2,height:x+P*2}}),C=t.computed(()=>!O.value.x||!O.value.y?"":`
53
53
  M${O.value.x-O.value.offset},${O.value.y-O.value.offset}
54
54
  h${O.value.width+O.value.offset*2}
55
55
  v${O.value.height+O.value.offset*2}
@@ -62,5 +62,5 @@ Edge: ${e}`,USEVUEFLOW_OPTIONS:()=>"The options parameter is deprecated and will
62
62
  h${-(A.value.width-2*e.maskBorderRadius)}
63
63
  a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
64
64
  v${-(A.value.height-2*e.maskBorderRadius)}
65
- a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);t.watchEffect(M=>{if(g.value){const x=Yn(g.value),P=he=>{if(he.sourceEvent.type!=="wheel"||!p.value||!f.value)return;const ie=he.sourceEvent.ctrlKey&&zi()?10:1,fe=-he.sourceEvent.deltaY*(he.sourceEvent.deltaMode===1?.05:he.sourceEvent.deltaMode?1:.002)*e.zoomStep,pe=c.value.zoom*2**(fe*ie);f.value.scaleTo(p.value,pe)},Y=he=>{if(he.sourceEvent.type!=="mousemove"||!p.value||!f.value)return;const ie=$.value*Math.max(1,c.value.zoom)*(e.inversePan?-1:1),fe={x:c.value.x-he.sourceEvent.movementX*ie,y:c.value.y-he.sourceEvent.movementY*ie},pe=[[0,0],[u.value.width,u.value.height]],ge=ac.translate(fe.x,fe.y).scale(c.value.zoom),Te=f.value.constrain()(ge,pe,d.value);f.value.transform(p.value,Te)},se=tM().wheelDelta(he=>gs(he)*(e.zoomStep/10)).on("zoom",e.pannable?Y:()=>{}).on("zoom.wheel",e.zoomable?P:()=>{});x.call(se),M(()=>{x.on("zoom",null)})}},{flush:"post"});function R(M){const[x,P]=qn(M);n("click",{event:M,position:{x,y:P}})}function T(M,x){const P={event:M,node:x,connectedEdges:ko([x],s.value)};m.miniMapNodeClick(P),n("nodeClick",P)}function w(M,x){const P={event:M,node:x,connectedEdges:ko([x],s.value)};m.miniMapNodeDoubleClick(P),n("nodeDblclick",P)}function I(M,x){const P={event:M,node:x,connectedEdges:ko([x],s.value)};m.miniMapNodeMouseEnter(P),n("nodeMouseenter",P)}function v(M,x){const P={event:M,node:x,connectedEdges:ko([x],s.value)};m.miniMapNodeMouseMove(P),n("nodeMousemove",P)}function B(M,x){const P={event:M,node:x,connectedEdges:ko([x],s.value)};m.miniMapNodeMouseLeave(P),n("nodeMouseleave",P)}return(M,x)=>(t.openBlock(),t.createBlock(t.unref(Qf),{position:M.position,class:t.normalizeClass(["vue-flow__minimap",{pannable:M.pannable,zoomable:M.zoomable}])},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{ref_key:"el",ref:g,width:b.value,height:_.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:R},[M.ariaLabel?(t.openBlock(),t.createElementBlock("title",{key:0,id:`vue-flow__minimap-${t.unref(l)}`},t.toDisplayString(M.ariaLabel),9,rM)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(h),P=>(t.openBlock(),t.createBlock(iM,{id:P.id,key:P.id,f:"",position:P.computedPosition,dimensions:P.dimensions,selected:P.selected,dragging:P.dragging,style:t.normalizeStyle(P.style),class:t.normalizeClass(E.value(P)),color:N.value(P),"border-radius":M.nodeBorderRadius,"stroke-color":y.value(P),"stroke-width":M.nodeStrokeWidth,"shape-rendering":t.unref(k),type:P.type,hidden:P.hidden,onClick:Y=>T(Y,P),onDblclick:Y=>w(Y,P),onMouseenter:Y=>I(Y,P),onMousemove:Y=>v(Y,P),onMouseleave:Y=>B(Y,P)},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:C.value,fill:M.maskColor,stroke:M.maskStrokeColor,"stroke-width":M.maskStrokeWidth,"fill-rule":"evenodd"},null,8,lM)],8,aM))]),_:1},8,["position","class"]))}}),dM=["d"],uM=["cx","cy","onDblclick"],mM=["x","y","onPointerdown","onDblclick"],fM=Qe(t.defineComponent({inheritAttrs:!1,__name:"NoteConnectionEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,{screenToFlowCoordinate:o}=tt(),i=t.inject(zs),a=t.inject(Gn,null),r=t.computed(()=>!!a&&a.editable.value),l=t.inject(Co,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((V,$)=>$===d.value?u.value:V)),{source:p,target:f,sourceSide:h,targetSide:g}=Ps({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>m.value}),b=t.computed(()=>(a==null?void 0:a.routingMode.value)==="orthogonal"?Ds(p.value,h.value,m.value,f.value,g.value):Os(p.value,m.value,f.value)),_=t.computed(()=>r.value?(a==null?void 0:a.routingMode.value)==="orthogonal"?Op(p.value,h.value,m.value,f.value,g.value):zp(p.value,m.value,f.value).map((V,$)=>({point:V,segIndex:$})):[]),k=t.computed(()=>r.value?m.value:[]);function N(V,$){d.value=V,u.value={...c.value[V]},$.target.setPointerCapture($.pointerId),$.stopPropagation()}function y(V){if(d.value<0)return;const $=o({x:V.clientX,y:V.clientY});u.value={x:$.x,y:$.y}}function E(V){var $,O;d.value>=0&&i&&i.movePoint(n.id,d.value,{...u.value}),d.value=-1,(O=($=V.target).releasePointerCapture)==null||O.call($,V.pointerId)}function S(V,$){$.stopPropagation(),i==null||i.removePoint(n.id,V)}function A(V,$){if(!i)return;const O=o({x:$.clientX,y:$.clientY});i.insertPoint(n.id,V,{x:O.x,y:O.y})}return(V,$)=>(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,dM),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(O,C)=>(t.openBlock(),t.createElementBlock("circle",{key:`mid-${C}`,cx:O.point.x,cy:O.point.y,r:"4",class:t.normalizeClass(["em-note-edge__mid",{"is-dimmed":s.value}]),onDblclick:t.withModifiers(R=>A(O.segIndex,R),["stop"])},null,42,uM))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.value,(O,C)=>(t.openBlock(),t.createElementBlock("rect",{key:`wp-${C}`,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:R=>N(C,R),onPointermove:y,onPointerup:E,onDblclick:R=>S(C,R)},null,42,mM))),128))],64))}}),[["__scopeId","data-v-8515def1"]]),pM=["d"],hM=Qe(t.defineComponent({inheritAttrs:!1,__name:"SerializedTypeEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,o=t.inject(Gn,null),i=t.inject(Co,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}=Ps({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>[]}),d=t.computed(()=>(o==null?void 0:o.routingMode.value)==="orthogonal"?Ds(r.value,s.value,[],l.value,c.value):Os(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,pM))}}),[["__scopeId","data-v-67430658"]]),yM=["data-theme"],gM={key:0,class:"em-ctx__sep",role:"separator"},bM=["aria-label"],_M={class:"em-ctx__swatches-label","aria-hidden":"true"},kM={class:"em-ctx__chips",role:"none"},EM=["aria-checked","aria-label","title","onClick"],NM=["aria-checked","aria-label","title","onClick"],wM=["disabled","onClick"],IM={class:"em-ctx__icon"},vM={class:"em-ctx__caption"},CM=Qe(t.defineComponent({__name:"EmContextMenu",props:{locale:{}},setup(e,{expose:n}){const o=e,i=(N,y)=>en(o.locale??"ko",N,y),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(N,y){var A,V;r.value=y,l.value=(A=N.target)!=null&&A.closest('[data-theme="dark"]')?"dark":void 0,d=document.activeElement,c.x=N.clientX,c.y=N.clientY,a.value=!0,window.addEventListener("keydown",b),window.addEventListener("resize",p),await t.nextTick();const E=s.value;if(!E)return;const S=E.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)),(V=f()[0])==null||V.focus()}function p(){if(!a.value)return;a.value=!1,r.value=[],window.removeEventListener("keydown",b),window.removeEventListener("resize",p);const N=d;d=null,N!=null&&N.isConnected&&N.focus()}function f(){const N=s.value;if(!N)return[];const y=[];for(const E of Array.from(N.children))if(E.classList.contains("em-ctx__item"))E.disabled||y.push(E);else if(E.classList.contains("em-ctx__swatches")){const S=Array.from(E.querySelectorAll(".em-ctx__chip"));S.length&&y.push(S.find(A=>A===document.activeElement)??S[0])}return y}function h(N){var A;const y=f();if(!y.length)return;const E=y.indexOf(document.activeElement),S=E<0?N>0?0:y.length-1:(E+N+y.length)%y.length;(A=y[S])==null||A.focus()}function g(N){var A,V;const y=(A=document.activeElement)==null?void 0:A.closest(".em-ctx__swatches");if(!y)return!1;const E=Array.from(y.querySelectorAll(".em-ctx__chip")),S=E.indexOf(document.activeElement);return S<0?!1:((V=E[(S+N+E.length)%E.length])==null||V.focus(),!0)}function b(N){var y,E;switch(N.key){case"Escape":N.stopPropagation(),p();return;case"ArrowDown":N.preventDefault(),h(1);return;case"ArrowUp":N.preventDefault(),h(-1);return;case"ArrowRight":g(1)&&N.preventDefault();return;case"ArrowLeft":g(-1)&&N.preventDefault();return;case"Home":N.preventDefault(),(y=f()[0])==null||y.focus();return;case"End":{N.preventDefault();const S=f();(E=S[S.length-1])==null||E.focus();return}case"Tab":N.preventDefault(),h(N.shiftKey?-1:1)}}function _(N){N.disabled||(N.handler(),p())}function k(N,y){N.onPick(y),p()}return t.onBeforeUnmount(p),n({open:m,close:p}),(N,y)=>(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:p,onContextmenu:t.withModifiers(p,["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:y[0]||(y[0]=t.withModifiers(()=>{},["prevent"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,(E,S)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:S},[E.type==="separator"?(t.openBlock(),t.createElementBlock("div",gM)):E.type==="swatches"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"em-ctx__swatches",role:"group","aria-label":E.caption},[t.createElementVNode("span",_M,t.toDisplayString(E.caption),1),t.createElementVNode("div",kM,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-ctx__chip em-ctx__chip--none",{"is-on":E.current===null}]),role:"menuitemradio","aria-checked":E.current===null,"aria-label":i("em.swatch.none"),title:i("em.swatch.none"),onClick:A=>k(E,null)},null,10,EM),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),A=>(t.openBlock(),t.createElementBlock("button",{key:A,type:"button",class:t.normalizeClass(["em-ctx__chip",{"is-on":E.current===A}]),style:t.normalizeStyle({background:t.unref(ei)(A)}),role:"menuitemradio","aria-checked":E.current===A,"aria-label":i(t.unref(Io)(A)),title:i(t.unref(Io)(A)),onClick:V=>k(E,A)},null,14,NM))),128))])],8,bM)):(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:t.normalizeClass(["em-ctx__item",{"is-danger":E.danger,"is-disabled":E.disabled}]),disabled:E.disabled,role:"menuitem",onClick:A=>_(E)},[t.createElementVNode("span",IM,[E.icon?(t.openBlock(),t.createBlock(Ve,{key:0,name:E.icon,size:15},null,8,["name"])):t.createCommentVNode("",!0)]),t.createElementVNode("span",vM,t.toDisplayString(E.caption),1)],10,wM))],64))),128))],36)],8,yM)):t.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-2f05239a"]]);function lc(e,n){return`serialized:${e}:${n}`}function Gh(e){const n=Vo(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=ui(a,n,i,e);if(r.kind!=="resolved")continue;const l=r.entity;if(l.modelId===i.modelId)continue;const s=lc(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 Yh(e,n){return n?`${e}:${n}`:e}function qh(e,n){var o;if(!e||typeof window>"u")return{};try{const i=(o=window.sessionStorage)==null?void 0:o.getItem(Yh(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 SM(e,n,o){var i,a;if(!(!e||typeof window>"u"))try{const r=Yh(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 Wh(e){const n=()=>{var s;return(s=e.scope)==null?void 0:s.call(e)},o=t.ref(qh(e.storageKey,n()));e.scope&&t.watch(()=>e.scope(),s=>o.value=qh(e.storageKey,s)),t.watch(o,s=>SM(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 sc=[".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 ri(e){const n=getComputedStyle(e);return!(n.display==="none"||n.visibility==="hidden"||parseFloat(n.opacity)===0)}function xM(e){return e.childElementCount>0?!1:(e.textContent??"").trim().length>0}function RM(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 h=l.length?a.getBoundingClientRect():e.getBoundingClientRect();if(h.width===0&&h.height===0)return[];const g=n(h.left,h.top+h.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,p=0;const f=()=>{const h=d.trim();if(h){const g=n(m,(u+p)/2);c.push({...i,x:g.x,y:g.y,text:h})}d=""};for(let h=0;h<s.length;h++){a.setStart(r,h),a.setEnd(r,h+1);const g=a.getBoundingClientRect();u===null||Math.abs(g.top-u)>1?(f(),u=g.top,m=g.left,p=g.bottom,d=s[h]):(d+=s[h],p=Math.max(p,g.bottom))}return f(),c}function Pr(e,n){const o=[];for(const i of e.querySelectorAll("*"))xM(i)&&(i.closest(sc)||ri(i)&&o.push(...RM(i,n)));return o}function Qi(e){return Math.round(e*100)/100}function AM(e,n){const o=[];for(const i of e.querySelectorAll("svg.em-icon")){if(i.closest(sc)||!ri(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="${Qi(r.x)}" y="${Qi(r.y)}" width="${Qi(l.x-r.x)}" height="${Qi(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 $M(e){const n=[];for(const o of e.querySelectorAll(".em-edge__marker")){if(!ri(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=>Qi(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 Jh(e,n,o){const i=[];for(const a of e.querySelectorAll("*")){if(a===n||a.closest(sc)||!ri(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 ea(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 cc(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 TM(e){const n=e.vueFlowRef.value;if(!n)throw new Error("캔버스가 렌더되지 않아 SVG로 내보낼 수 없습니다.");const o=(f,h)=>e.screenToFlowCoordinate({x:f,y:h}),i=[],a=[],r=[],l=[],s={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(const f of e.nodes.value){const h=n.querySelector(`.vue-flow__node[data-id="${CSS.escape(f.id)}"]`);if(!h||!ri(h))continue;const g=h.firstElementChild;if(g)if(f.type==="group"){const b=ea(g,o);cc(s,b),i.push({...b,texts:[]});const _=g.querySelector(".em-group__label");_&&i.push({...ea(_,o),stroke:"none",texts:[]}),i.push({...b,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:Pr(g,o)})}else if(f.type==="note"){const b={...ea(g,o),texts:Pr(g,o),lines:Jh(g,g,o)};cc(s,b),r.push(b)}else{const b=ea(g,o);cc(s,b);const _=b.radius??{tl:0,tr:0};a.push({...b,stroke:"none",texts:[]});const k=g.querySelector(".em-entity__header");if(k){const N=ea(k,o);a.push({x:b.x,y:b.y,w:b.w,h:N.y+N.h-b.y,fill:N.fill,stroke:"none",radius:{tl:_.tl,tr:_.tr,br:0,bl:0},texts:[]})}a.push({...b,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:Pr(g,o),lines:Jh(g,g,o),icons:AM(g,o)}),a.push({...b,fill:"none",texts:[]})}}for(const f of n.querySelectorAll(".vue-flow__edge")){const h=f.querySelector("path.em-edge__path, path.em-note-edge__path");if(!h||!ri(h))continue;const g=h.getAttribute("d");if(!g)continue;const b=getComputedStyle(h),_=b.strokeDasharray,k=$M(f);l.push({d:g,stroke:b.stroke,strokeWidth:parseFloat(b.strokeWidth)||1.5,strokeDasharray:_&&_!=="none"?_:void 0,labels:Pr(f,o),markers:k.length?k: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 dc(e){return Xc(TM(e))}function Xh(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 Zh(e,n="diagram.svg"){const o=dc(e);Xh(new Blob([o],{type:"image/svg+xml;charset=utf-8"}),n)}function MM(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 Qh(e,n="diagram.png",o=2){const i=dc(e),{w:a,h:r}=MM(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,p)=>{s.onload=()=>m(),s.onerror=()=>p(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 변환 실패");Xh(u,n)}finally{URL.revokeObjectURL(l)}}const VM={class:"em-shortcuts"},BM={class:"em-shortcuts__list"},DM={class:"em-shortcuts__title"},OM={class:"em-shortcuts__keys"},LM={class:"em-shortcuts__kbd"},PM={key:0,class:"em-shortcuts__plus"},zM={class:"em-shortcuts__desc"},FM={class:"em-shortcuts__actions"},ey=Qe(t.defineComponent({__name:"ShortcutHelpModal",props:{locale:{}},setup(e){const n=e,o=oe.useModalHandle(),i=(s,c)=>en(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(oe.BSModalFrame),{title:i("em.shortcuts.title")},{default:t.withCtx(()=>[t.createElementVNode("div",VM,[t.createElementVNode("div",BM,[(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",DM,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",OM,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.keys,(m,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m+p},[t.createElementVNode("kbd",LM,t.toDisplayString(m),1),p<u.keys.length-1?(t.openBlock(),t.createElementBlock("span",PM,"+")):t.createCommentVNode("",!0)],64))),128))]),t.createElementVNode("span",zM,t.toDisplayString(u.desc),1)]))),128))]))),128))]),t.createElementVNode("div",FM,[t.createVNode(t.unref(oe.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 li(...e){return e.filter(o=>!!o).join(" ").toLowerCase().trim()||void 0}function UM(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 HM=["aria-label"],jM=["aria-activedescendant","aria-label","placeholder"],KM={id:"em-cmdk-listbox",class:"em-cmdk__results",role:"listbox"},GM=["aria-label"],YM={class:"em-cmdk__section","aria-hidden":"true"},qM=["id","aria-selected","onMouseenter","onClick"],WM={class:"em-cmdk__label"},JM={key:0,class:"em-cmdk__tag"},XM={key:1,class:"em-cmdk__sub"},ZM=["aria-label"],QM={class:"em-cmdk__section","aria-hidden":"true"},e2=["id","aria-selected","aria-disabled","onMouseenter","onClick"],t2={class:"em-cmdk__label"},n2={key:1,class:"em-cmdk__empty"},o2=Qe(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 E=c.value,S=a.state.logical.entities.map(V=>{var $,O,C,R,T,w;return{type:"goto",kind:"entity",id:V.modelId,label:((O=($=V.table)==null?void 0:$.logicalName)==null?void 0:O[E])||V.name,sub:(C=V.table)==null?void 0:C.physicalName,match:li(V.name,(T=(R=V.table)==null?void 0:R.logicalName)==null?void 0:T[E],(w=V.table)==null?void 0:w.physicalName)??""}}),A=a.state.logical.groups.map(V=>{var $,O,C,R;return{type:"goto",kind:"group",id:V.modelId,label:(($=V.name)==null?void 0:$[E])||((O=V.name)==null?void 0:O.ko)||V.packageName||a.t("em.cmd.groupTag"),tag:a.t("em.cmd.groupTag"),match:li((C=V.name)==null?void 0:C[E],(R=V.name)==null?void 0:R.ko,V.packageName)??""}});return[...S,...A]}),u={LOGICAL:"em.displayMode.logical",PHYSICAL:"em.displayMode.physical",LOGICAL_PHYSICAL:"em.displayMode.logicalPhysical",CLASS:"em.displayMode.class"},m=t.computed(()=>{const E=[];a.editable.value&&(E.push({type:"action",id:"undo",label:a.t("em.toolbar.undo"),run:()=>a.undo(),disabled:!a.canUndo.value}),E.push({type:"action",id:"redo",label:a.t("em.toolbar.redo"),run:()=>a.redo(),disabled:!a.canRedo.value}),E.push({type:"action",id:"autolayout",label:a.t("em.palette.autoLayout"),run:()=>a.autoLayout()}),E.push({type:"action",id:"collapseAll",label:a.t("em.panel.collapseAll"),run:()=>a.collapseAll()}),E.push({type:"action",id:"expandAll",label:a.t("em.panel.expandAll"),run:()=>a.expandAll()})),E.push({type:"action",id:"grid",label:a.t("em.toolbar.grid"),run:()=>a.showGrid.value=!a.showGrid.value}),E.push({type:"action",id:"minimap",label:a.t("em.toolbar.minimap"),run:()=>a.showMinimap.value=!a.showMinimap.value}),E.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"])E.push({type:"action",id:`dm-${S}`,label:a.t(u[S]),run:()=>a.displayMode.value=S});return E});function p(E,S){return E.label.toLowerCase().includes(S)}const f=t.computed(()=>{const E=r.value.trim().toLowerCase();return E?d.value.filter(S=>S.match.includes(E)):d.value}),h=t.computed(()=>{const E=r.value.trim().toLowerCase();return E?m.value.filter(S=>p(S,E)):m.value}),g=t.computed(()=>[...f.value,...h.value]);t.watch([f,h],()=>{l.value=0});function b(E){return g.value.indexOf(E)}const _=E=>`em-cmdk-opt-${E}`,k=t.computed(()=>g.value[l.value]?_(l.value):void 0);t.watch(l,async()=>{var S;await t.nextTick();const E=k.value;E&&((S=document.getElementById(E))==null||S.scrollIntoView({block:"nearest"}))});function N(E){if(E.type==="goto")a.selection.value={kind:E.kind,id:E.id},a.requestFocus(E.id);else{if(E.disabled)return;E.run()}i("close")}function y(E){if(E.key==="Escape"){i("close"),E.preventDefault();return}if(E.key==="ArrowDown"){l.value=Math.min(l.value+1,g.value.length-1),E.preventDefault();return}if(E.key==="ArrowUp"){l.value=Math.max(l.value-1,0),E.preventDefault();return}if(E.key==="Enter"){const S=g.value[l.value];S&&N(S),E.preventDefault();return}E.key==="Tab"&&E.preventDefault()}return t.nextTick(()=>{var E;return(E=s.value)==null?void 0:E.focus()}),(E,S)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createElementVNode("div",{class:"em-cmdk__backdrop",onPointerdown:S[1]||(S[1]=t.withModifiers(A=>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]=A=>r.value=A),class:"em-cmdk__input",type:"text",role:"combobox","aria-expanded":"true","aria-autocomplete":"list",autocomplete:"off","aria-controls":"em-cmdk-listbox","aria-activedescendant":k.value,"aria-label":t.unref(a).t("em.cmd.placeholder"),placeholder:t.unref(a).t("em.cmd.placeholder"),onKeydown:y},null,40,jM),[[t.vModelText,r.value]]),t.createElementVNode("div",KM,[g.value.length?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[f.value.length?(t.openBlock(),t.createElementBlock("div",{key:0,role:"group","aria-label":t.unref(a).t("em.cmd.sectionGoto")},[t.createElementVNode("div",YM,t.toDisplayString(t.unref(a).t("em.cmd.sectionGoto")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,A=>(t.openBlock(),t.createElementBlock("button",{id:_(b(A)),key:A.id,type:"button",tabindex:"-1",class:t.normalizeClass(["em-cmdk__item",{"is-active":b(A)===l.value}]),role:"option","aria-selected":b(A)===l.value,onMouseenter:V=>l.value=b(A),onClick:V=>N(A)},[t.createElementVNode("span",WM,t.toDisplayString(A.label),1),A.tag?(t.openBlock(),t.createElementBlock("span",JM,t.toDisplayString(A.tag),1)):A.sub?(t.openBlock(),t.createElementBlock("span",XM,t.toDisplayString(A.sub),1)):t.createCommentVNode("",!0)],42,qM))),128))],8,GM)):t.createCommentVNode("",!0),h.value.length?(t.openBlock(),t.createElementBlock("div",{key:1,role:"group","aria-label":t.unref(a).t("em.cmd.sectionActions")},[t.createElementVNode("div",QM,t.toDisplayString(t.unref(a).t("em.cmd.sectionActions")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,A=>(t.openBlock(),t.createElementBlock("button",{id:_(b(A)),key:A.id,type:"button",tabindex:"-1",class:t.normalizeClass(["em-cmdk__item",{"is-active":b(A)===l.value,"is-disabled":A.disabled}]),role:"option","aria-selected":b(A)===l.value,"aria-disabled":A.disabled||void 0,onMouseenter:V=>l.value=b(A),onClick:V=>N(A)},[t.createElementVNode("span",t2,t.toDisplayString(A.label),1)],42,e2))),128))],8,ZM)):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock("div",n2,t.toDisplayString(t.unref(a).t("em.cmd.empty")),1))])],8,HM)],32)]))}}),[["__scopeId","data-v-fcf574c4"]]);function i2(e){return e?e.kind==="missing"?{titleKey:"em.conflict.lockedTitle",detailKey:"em.conflict.missingDetail"}:{titleKey:"em.conflict.lockedTitle",detailKey:"em.conflict.changedDetail"}:null}const a2={key:0,class:"em-canvas__empty","aria-hidden":"true"},r2={class:"em-canvas__empty-title"},l2=["innerHTML"],s2=["innerHTML"],c2=["innerHTML"],d2={key:1,class:"em-canvas__empty-title"},u2={key:0,class:"em-conflict-banner",role:"alert","aria-live":"assertive"},m2={class:"em-conflict-banner__body"},f2={class:"em-conflict-banner__title"},p2={class:"em-conflict-banner__detail"},h2={key:0,class:"em-toast",role:"status","aria-live":"polite"},uc="nc:",ty=Qe(t.defineComponent({__name:"DiagramCanvas",props:{controller:{},diffMarks:{},embedCollapseStorageKey:{}},setup(e,{expose:n}){const o=e,i=o.controller,a=oe.useModal(),r=t.ref(!1),l=t.ref(null);let s;function c(D){l.value=D,s&&clearTimeout(s),s=setTimeout(()=>l.value=null,3200)}t.watch(()=>i.notice.value,D=>{D&&c(D.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 D=i2(i.opConflict.value);return D?{title:i.t(D.titleKey),detail:i.t(D.detailKey)}:null}),u=t.ref(!1),m=t.ref(!1),p={x:0,y:0};function f(D){p.x=D.clientX,p.y=D.clientY}const h=t.ref(null);t.provide(br,h);const g=t.ref(null);t.provide(Ep,g);const b=t.ref(null),_=t.computed(()=>{const D=b.value,U=new Set;if(!D)return U;if(D.kind==="entity")U.add(D.id);else if(D.kind==="group"){const le=i.resolved.value.groups.find(ne=>ne.group.modelId===D.id);for(const ne of(le==null?void 0:le.group.memberEntityRefs)??[])U.add(ne)}return U}),k=t.computed(()=>{const D=b.value,U=new Set(_.value),le=new Set,ne=new Set;if(!D)return{related:U,edges:le,notes:ne};if(D.kind==="note"){ne.add(D.id);for(const Be of i.resolved.value.noteConnections)Be.noteRef===D.id&&U.add(Be.targetRef);return{related:U,edges:le,notes:ne}}const xe=_.value;if(!xe.size)return{related:U,edges:le,notes:ne};for(const Be of i.resolved.value.associations){const{end1:qe,end2:je}=Be.association;(xe.has(qe.entityRef)||xe.has(je.entityRef))&&(le.add(Be.association.modelId),U.add(qe.entityRef),U.add(je.entityRef))}for(const Be of i.resolved.value.noteConnections)U.has(Be.targetRef)&&ne.add(Be.noteRef);return{related:U,edges:le,notes:ne}});t.provide(Co,{source:b,active:t.computed(()=>b.value!==null),primaryEntityIds:_,relatedEntityIds:t.computed(()=>k.value.related),relatedEdgeIds:t.computed(()=>k.value.edges),relatedNoteIds:t.computed(()=>k.value.notes),hoverGroupId:t.computed(()=>{var D;return((D=b.value)==null?void 0:D.kind)==="group"?b.value.id:null}),setEntityHover:D=>{g.value||m.value||(b.value=D?{kind:"entity",id:D}:null)},setGroupHover:D=>{g.value||m.value||(b.value=D?{kind:"group",id:D}:null)},setNoteHover:D=>{g.value||m.value||(b.value=D?{kind:"note",id:D}:null)}}),t.provide(Gn,i);const N=HS(),y=t.computed(()=>N(i.state.logical,i.embeddableCatalog.value));t.provide(Ip,y);const E=Wh({expandableKeys:()=>[],defaultCollapsed:YS,storageKey:o.embedCollapseStorageKey,scope:()=>i.state.layout.diagramId});t.provide(Sp,{isCollapsed:E.isCollapsed,toggle:E.toggle}),t.provide(Np,{marks:t.toRef(o,"diffMarks")});function S(D,U){return`${uc}${D}:${U}`}function A(D){if(!D.startsWith(uc))return null;const[U,le]=D.slice(uc.length).split(":");return U&&le?{noteRef:U,targetRef:le}:null}t.provide(zs,{points:D=>{var le,ne;const U=A(D);return U?((le=i.resolved.value.noteConnections.find(xe=>xe.noteRef===U.noteRef&&xe.targetRef===U.targetRef))==null?void 0:le.waypoints)??[]:((ne=i.resolved.value.associations.find(xe=>xe.association.modelId===D))==null?void 0:ne.waypoints)??[]},movePoint:(D,U,le)=>{const ne=A(D);ne?i.moveNoteConnectionWaypoint(ne.noteRef,ne.targetRef,U,le):i.moveWaypoint(D,U,le)},insertPoint:(D,U,le)=>{const ne=A(D);ne?i.addNoteConnectionWaypoint(ne.noteRef,ne.targetRef,U,le):i.addWaypoint(D,U,le)},removePoint:(D,U)=>{const le=A(D);le?i.removeNoteConnectionWaypoint(le.noteRef,le.targetRef,U):i.removeWaypoint(D,U)}});const V=tt(),{nodes:$,edges:O,findNode:C,findEdge:R,addNodes:T,addEdges:w,removeNodes:I,removeEdges:v,fitView:B,setCenter:M,getViewport:x,screenToFlowCoordinate:P,getSelectedNodes:Y,updateNodeInternals:se}=V,he=t.ref(!1);async function ie(D){he.value=!0,await t.nextTick(),await new Promise(U=>requestAnimationFrame(()=>U(null)));try{return await D()}finally{he.value=!1}}async function fe(){try{await ie(()=>Zh(V))}catch(D){console.error("[entity-modeler] SVG export failed",D),c(i.t("em.canvas.exportFailed"))}}async function pe(){try{await ie(()=>Qh(V))}catch(D){console.error("[entity-modeler] PNG export failed",D),c(i.t("em.canvas.exportFailed"))}}n({exportSvg:fe,exportPng:pe,fitView:B});const ge=t.computed(()=>i.resolved.value.entities.length===0);function Te(){const D=x(),{width:U,height:le}=V.dimensions.value;return{x:(U/2-D.x)/D.zoom,y:(le/2-D.y)/D.zoom}}function He(){const D=Te();i.addEntity("NewEntity",{x:D.x,y:D.y})}function De(){const D=Te();i.addNote("메모",{x:D.x,y:D.y})}function Z(D){for(const U of i.resolved.value.groups){const{location:le,size:ne}=U.geo;if(D.x>=le.x&&D.x<=le.x+ne.width&&D.y>=le.y&&D.y<=le.y+ne.height)return U.group.modelId}return null}function re(D,U){return D.x===U.x&&D.y===U.y}function ue(D,U){return(D==null?void 0:D.width)===(U==null?void 0:U.width)&&(D==null?void 0:D.height)===(U==null?void 0:U.height)}function z(D,U){return D.entity===U.entity&&D.displayMode===U.displayMode&&D.collapsed===U.collapsed&&D.locked===U.locked&&D.groupRef===U.groupRef&&ue(D.size,U.size)&&D.style===U.style&&D.attributeStyles===U.attributeStyles&&D.operationStyles===U.operationStyles}function L(D,U){const le=Object.keys(D);if(le.length!==Object.keys(U).length)return!1;for(const ne of le)if(ne==="geo"){const xe=D.geo,Be=U.geo;if(!re(xe.location,Be.location)||!ue(xe.size,Be.size))return!1}else if(D[ne]!==U[ne])return!1;return!0}function F(){const D=i.resolved.value,U=new Map(D.groups.map(Ie=>[Ie.group.modelId,Ie.geo])),le=new Set(D.groups.map(Ie=>Ie.group.modelId)),ne=new Set([...le,...D.entities.map(Ie=>Ie.entity.modelId),...D.notes.map(Ie=>Ie.note.modelId)]);for(const Ie of[...$.value])ne.has(Ie.id)||I([Ie.id]);for(const Ie of D.groups){const Je=Ie.group.modelId,j={width:`${Ie.geo.size.width}px`,height:`${Ie.geo.size.height}px`},K={group:Ie.group,style:Ie.style,locked:Ie.locked},ve=Ie.locked?!1:void 0,Re=C(Je);if(Re){re(Re.position,Ie.geo.location)||(Re.position={...Ie.geo.location});const me=Re.data;(me.group!==K.group||me.style!==K.style||me.locked!==K.locked)&&(Re.data=K);const Ue=Re.style;((Ue==null?void 0:Ue.width)!==j.width||(Ue==null?void 0:Ue.height)!==j.height)&&(Re.style=j),Re.draggable!==ve&&(Re.draggable=ve)}else T([{id:Je,type:"group",position:{...Ie.geo.location},draggable:ve,style:j,data:K}])}for(const Ie of D.entities){const Je=Ie.entity.modelId,j=Ie.groupRef&&le.has(Ie.groupRef)?Ie.groupRef:void 0,K={entity:Ie.entity,displayMode:i.displayMode.value,collapsed:Ie.collapsed,locked:Ie.locked,groupRef:j,size:Ie.geo.size,style:Ie.style,attributeStyles:Ie.attributeStyles,operationStyles:Ie.operationStyles},ve=Ie.locked?!1:void 0,Re=Ie.locked?!1:void 0,me=j?U.get(j):void 0,Ue=me?{x:Ie.geo.location.x-me.location.x,y:Ie.geo.location.y-me.location.y}:{...Ie.geo.location},Ye=C(Je);Ye?(re(Ye.position,Ue)||(Ye.position=Ue),z(Ye.data,K)||(Ye.data=K),Ye.parentNode!==j&&(Ye.parentNode=j),Ye.draggable!==ve&&(Ye.draggable=ve),Ye.connectable!==Re&&(Ye.connectable=Re)):T([{id:Je,type:"entity",position:Ue,parentNode:j,draggable:ve,connectable:Re,data:K}])}for(const Ie of D.notes){const Je=Ie.note,j=Je.modelId,K=Ie.groupRef&&le.has(Ie.groupRef)?Ie.groupRef:void 0,ve={note:Je,groupRef:K},Re={width:`${Je.geo.size.width}px`,height:`${Je.geo.size.height}px`},me=K?U.get(K):void 0,Ue=me?{x:Je.geo.location.x-me.location.x,y:Je.geo.location.y-me.location.y}:{...Je.geo.location},Ye=C(j);if(Ye){re(Ye.position,Ue)||(Ye.position=Ue);const pt=Ye.data;(pt.groupRef!==K||!L(pt.note,Je))&&(Ye.data=ve);const Pt=Ye.style;((Pt==null?void 0:Pt.width)!==Re.width||(Pt==null?void 0:Pt.height)!==Re.height)&&(Ye.style=Re),Ye.parentNode!==K&&(Ye.parentNode=K)}else T([{id:j,type:"note",position:Ue,parentNode:K,style:Re,data:ve}])}const xe=new Map(D.associations.map(Ie=>[Ie.association.modelId,Ie])),Be=new Set(D.noteConnections.map(Ie=>S(Ie.noteRef,Ie.targetRef))),qe=Gh(i.state.logical).filter(Ie=>C(Ie.consumerRef)&&C(Ie.typeRef)),je=new Set(qe.map(Ie=>lc(Ie.consumerRef,Ie.typeRef)));for(const Ie of[...O.value])!xe.has(Ie.id)&&!Be.has(Ie.id)&&!je.has(Ie.id)&&v([Ie.id]);for(const[Ie,Je]of xe){const j={id:Ie,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}},K=R(Ie);if(K){const ve=K.data;(ve.association!==j.data.association||ve.sourceColumnRef!==j.data.sourceColumnRef||ve.targetColumnRef!==j.data.targetColumnRef)&&(K.data=j.data),K.sourceHandle!==j.sourceHandle&&(K.sourceHandle=j.sourceHandle),K.targetHandle!==j.targetHandle&&(K.targetHandle=j.targetHandle)}else w([j])}for(const Ie of D.noteConnections){const Je=S(Ie.noteRef,Ie.targetRef),j={noteRef:Ie.noteRef,targetRef:Ie.targetRef};R(Je)||w([{id:Je,type:"note-connection",source:Ie.noteRef,target:Ie.targetRef,data:j}])}for(const Ie of qe){const Je=lc(Ie.consumerRef,Ie.typeRef),j={consumerRef:Ie.consumerRef,typeRef:Ie.typeRef,usageCount:Ie.usageCount},K=R(Je);K?K.data.usageCount!==j.usageCount&&(K.data=j):w([{id:Je,type:"serialized-type",source:Ie.consumerRef,target:Ie.typeRef,data:j}])}}const X=new Set;let ee=!1,ke=!1;const ye=new Map;function Ne(D){const U=document.querySelector(`.vue-flow__node[data-id="${CSS.escape(D)}"]`);if(!U)return null;let le=`${U.offsetHeight}`;for(const ne of U.querySelectorAll(".em-entity__row"))le+=`|${ne.dataset.attr}:${ne.offsetTop}`;return le}function we(){ke=!1;const D=ee;ee=!1;const U=[...X];if(X.clear(),D){se();for(const ne of $.value){const xe=Ne(ne.id);xe!==null&&ye.set(ne.id,xe)}return}const le=[];for(const ne of U){const xe=Ne(ne);if(xe===null){ye.delete(ne);continue}ye.get(ne)!==xe&&(ye.set(ne,xe),le.push(ne))}le.length&&se(le)}function G(D){if(D)for(const U of D)X.add(U);else ee=!0;ke||(ke=!0,t.nextTick(()=>requestAnimationFrame(we)))}t.provide(wp,{mark:D=>G([D])});function q(){const D=Y.value.map(le=>le.id);if(D.length)return D;const U=i.selection.value;return U&&(U.kind==="entity"||U.kind==="note"||U.kind==="group")?[U.id]:[]}function W(){return Y.value.filter(D=>D.type==="entity").map(D=>D.id)}function Ce(){return Y.value.filter(D=>D.type==="group").map(D=>D.id)}function $e(D){var U;return[...((U=i.state.logical.groups.find(le=>le.modelId===D))==null?void 0:U.memberEntityRefs)??[]]}function ze(){const D=Ce().flatMap($e);return[...new Set([...W(),...D])]}function Fe(){return Ce().length>0||W().length>1}function ae(){Fe()?i.copy(ze()):i.copy()}async function Se(D){if(!D.length)return;await t.nextTick();const U=Y.value;U.length&&V.removeSelectedNodes(U);const le=D.map(ne=>C(ne)).filter(ne=>!!ne);le.length&&V.addSelectedNodes(le)}function Ge(D){if(Fe()&&W().includes(D)){const U=ze();return{caption:i.t("em.ctx.copyN",{n:U.length}),icon:"copy",handler:()=>i.copy(U)}}return{caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:D},i.copy()}}}function et(D){var xe;const U=D.target;if(U&&(U.tagName==="INPUT"||U.tagName==="TEXTAREA"||U.isContentEditable))return;if(D.key==="?"){a.openModal({component:ey,bind:{locale:i.uiLocale.value}}),D.preventDefault();return}if((D.metaKey||D.ctrlKey)&&D.key.toLowerCase()==="k"){r.value=!0,D.preventDefault();return}if(!i.editable.value){(D.metaKey||D.ctrlKey)&&D.key.toLowerCase()==="c"&&(ae(),D.preventDefault());return}if(D.key==="Delete"||D.key==="Backspace"){i.deleteSelection()&&D.preventDefault();return}if(D.key==="ArrowUp"||D.key==="ArrowDown"||D.key==="ArrowLeft"||D.key==="ArrowRight"){if(((xe=i.selection.value)==null?void 0:xe.kind)==="attribute"){if(D.key==="ArrowUp"||D.key==="ArrowDown"){const Ie=D.key==="ArrowDown"?1:-1;(D.altKey?i.nudgeSelectedAttributes(Ie):i.moveAttributeFocus(Ie))&&D.preventDefault()}return}const Be=D.shiftKey?10:1,qe=D.key==="ArrowLeft"?-Be:D.key==="ArrowRight"?Be:0,je=D.key==="ArrowUp"?-Be:D.key==="ArrowDown"?Be:0;i.nudgeNodes(q(),qe,je)&&D.preventDefault();return}if(!(D.metaKey||D.ctrlKey))return;const ne=D.key.toLowerCase();ne==="c"?(ae(),D.preventDefault()):ne==="v"?(Se(i.paste()),D.preventDefault()):ne==="z"&&(D.shiftKey?i.redo():i.undo(),D.preventDefault())}t.onMounted(async()=>{F(),await t.nextTick(),B(),G(),window.addEventListener("keydown",et),window.addEventListener("pointerup",te),window.addEventListener("pointermove",f,{passive:!0})}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",et),window.removeEventListener("pointerup",te),window.removeEventListener("pointermove",f)});function te(){h.value=null}function de(){m.value=!0,b.value=null}function Le(){var ne;m.value=!1;const D=(ne=document.elementFromPoint(p.x,p.y))==null?void 0:ne.closest(".vue-flow__node"),U=D==null?void 0:D.dataset.id;if(!U){b.value=null;return}const le=D.classList.contains("vue-flow__node-group")?"group":D.classList.contains("vue-flow__node-note")?"note":"entity";b.value={kind:le,id:U}}const dt=t.computed(()=>Gh(i.state.logical).map(D=>`${D.consumerRef}>${D.typeRef}:${D.usageCount}`).sort().join("|"));t.watch([()=>i.resolved.value,()=>i.displayMode.value,()=>dt.value],F),t.watch(()=>i.resolved.value,D=>{const U=b.value;if(!U)return;(U.kind==="entity"?D.entities.some(ne=>ne.entity.modelId===U.id):U.kind==="group"?D.groups.some(ne=>ne.group.modelId===U.id):D.notes.some(ne=>ne.note.modelId===U.id))||(b.value=null)});function Xe(D){const U=D.computedPosition??D.position,le=D.dimensions??{width:0,height:0};return{x:U.x+le.width/2,y:U.y+le.height/2}}function yt(D){const U=D.node;if(U){if(b.value=null,U.type==="group"){const le=i.resolved.value.groups.find(ne=>ne.group.modelId===U.id);g.value=le?{groupId:U.id,dx:U.position.x-le.geo.location.x,dy:U.position.y-le.geo.location.y}:null,h.value=null;return}if(U.type!=="entity"&&U.type!=="note"){h.value=null;return}h.value=Z(Xe(U))}}function st(D){var ne;h.value=null,g.value=null;const U=(ne=D.nodes)!=null&&ne.length?D.nodes:[D.node],le=U.filter(xe=>(xe==null?void 0:xe.type)==="group");if(le.length){for(const xe of le){if(!xe)continue;const Be=i.resolved.value.entities.filter(qe=>qe.groupRef===xe.id).map(qe=>{const je=C(qe.entity.modelId),Ie=(je==null?void 0:je.computedPosition)??(je==null?void 0:je.position)??{x:0,y:0};return{id:qe.entity.modelId,location:{x:Ie.x,y:Ie.y}}});i.dragGroup(xe.id,{x:xe.position.x,y:xe.position.y},Be)}return}for(const xe of U){if(!xe||xe.type==="group")continue;const Be=xe.computedPosition??xe.position,qe=xe.dimensions??{width:0,height:0},je={x:Be.x+qe.width/2,y:Be.y+qe.height/2};xe.type==="note"?i.dropNote(xe.id,{x:Be.x,y:Be.y},Z(je)):i.dropEntity(xe.id,{x:Be.x,y:Be.y},Z(je))}}function ft(D){var j,K,ve,Re,me;if(!i.editable.value||!D.source||!D.target)return;const U=((j=C(D.source))==null?void 0:j.type)==="note",le=((K=C(D.target))==null?void 0:K.type)==="note";if(U||le){if(U&&le)return;const Ue=U?D.source:D.target,Ye=U?D.target:D.source;((ve=C(Ye))==null?void 0:ve.type)==="entity"&&i.addNoteConnection(Ue,Ye);return}const ne=Ue=>{var Ye;return(Ye=i.state.logical.entities.find(pt=>pt.modelId===Ue))==null?void 0:Ye.stereotype},xe=ne(D.source)==="JPA_EMBEDDABLE",Be=ne(D.target)==="JPA_EMBEDDABLE";if(xe||Be){if(xe&&Be)return;const Ue=xe?D.source:D.target,Ye=xe?D.target:D.source;i.addEmbedAssociation(Ye,Ue);return}const qe=ne(D.source)==="SERIALIZED_TYPE",je=ne(D.target)==="SERIALIZED_TYPE";if(qe||je){const Ue=je?D.target:D.source,Ye=je?D.source:D.target;Ue!==Ye&&i.addSerializedTypeAttribute(Ye,Ue);return}const Ie=(Re=D.sourceHandle)!=null&&Re.startsWith("r:")?D.sourceHandle.slice(2):void 0,Je=(me=D.targetHandle)!=null&&me.startsWith("l:")?D.targetHandle.slice(2):void 0;i.addAssociation(D.source,D.target,Ie,Je)}const nt=t.ref(null);function J(D,U){var ne;const le=i.state.layout.entityLayouts.find(xe=>xe.entityRef===D);return $t((ne=le==null?void 0:le.attributeStyles)==null?void 0:ne[U])}function ce(D,U){var ne;const le=i.state.layout.entityLayouts.find(xe=>xe.entityRef===D);return $t((ne=le==null?void 0:le.operationStyles)==null?void 0:ne[U])}function Ae(D){var U;return $t((U=i.state.layout.groupLayouts.find(le=>le.groupRef===D))==null?void 0:U.style)}function Ee(D){var U;return $t((U=i.state.layout.notes.find(le=>le.modelId===D))==null?void 0:U.style)}function H(D){var xe,Be;if(D.preventDefault(),!i.editable.value)return;const U=()=>P({x:D.clientX,y:D.clientY}),le=[{caption:i.t("em.ctx.addEntity"),icon:"add-entity",handler:()=>{const qe=U();i.addEntity("NewEntity",{x:qe.x,y:qe.y})}},{caption:i.t("em.ctx.addNote"),icon:"note",handler:()=>{const qe=U();i.addNote("메모",{x:qe.x,y:qe.y})}},{caption:i.t("em.ctx.addGroup"),icon:"folder",handler:()=>{const qe=U();i.addEmptyGroup({x:qe.x,y:qe.y})}}],ne=(xe=i.clipboard.value)==null?void 0:xe.kind;(ne==="entity"||ne==="entities")&&le.push({caption:i.t("em.ctx.paste"),icon:"clipboard",handler:()=>Se(i.paste())}),i.resolved.value.entities.length>0&&le.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()}),(Be=nt.value)==null||Be.open(D,le)}function It({event:D,node:U}){var Ie,Je,j,K,ve,Re,me,Ue,Ye,pt,Pt,ta,gt,Vn,Fr,ry,ly,sy,cy;const le=D;if(le.preventDefault(),!i.editable.value){if(U.type==="group"||U.type==="note")return;const it=(Je=(Ie=le.target)==null?void 0:Ie.closest("[data-attr]"))==null?void 0:Je.dataset.attr;if(it){const bt=i.selection.value;(bt==null?void 0:bt.kind)==="attribute"&&bt.entityId===U.id&&bt.ids.includes(it)||i.selectAttribute(U.id,it);const Bn=((j=i.selection.value)==null?void 0:j.kind)==="attribute"&&i.selection.value.entityId===U.id?[...i.selection.value.ids]:[it];(K=nt.value)==null||K.open(le,[{caption:Bn.length>1?i.t("em.ctx.copyN",{n:Bn.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}(ve=nt.value)==null||ve.open(le,[{caption:i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>hr(a,i,U.id)},Ge(U.id)]);return}if(U.type==="group"){const it=i.isGroupLocked(U.id),bt=[];it||bt.push({type:"swatches",caption:i.t("em.common.color"),current:Ae(U.id),onPick:Bn=>i.setGroupSwatch(U.id,Bn)},{type:"separator"});const Ct=Fe()&&Ce().includes(U.id)?ze():$e(U.id);Ct.length&&bt.push({caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy(Ct)}),bt.push({caption:it?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:it?"unlock":"lock",handler:()=>i.setGroupLocked(U.id,!it)}),it||bt.push({type:"separator"},{caption:i.t("em.ctx.ungroup"),icon:"trash",danger:!0,handler:()=>i.removeGroup(U.id)}),(Re=nt.value)==null||Re.open(le,bt);return}if(U.type==="note"){(me=nt.value)==null||me.open(le,[{type:"swatches",caption:i.t("em.common.color"),current:Ee(U.id),onPick:it=>i.setNoteSwatch(U.id,it)},{type:"separator"},{caption:i.t("em.ctx.deleteNote"),icon:"trash",danger:!0,handler:()=>i.removeNote(U.id)}]);return}const ne=(Ye=(Ue=le.target)==null?void 0:Ue.closest("[data-attr]"))==null?void 0:Ye.dataset.attr;if(ne){const it=i.selection.value;(it==null?void 0:it.kind)==="attribute"&&it.entityId===U.id&&it.ids.includes(ne)||i.selectAttribute(U.id,ne);const Ct=((pt=i.selection.value)==null?void 0:pt.kind)==="attribute"&&i.selection.value.entityId===U.id?[...i.selection.value.ids]:[ne];if(i.isEntityLocked(U.id)){(Pt=nt.value)==null||Pt.open(le,[{caption:Ct.length>1?i.t("em.ctx.copyN",{n:Ct.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}const Bn=Ct.length>1,mc=[{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(U.id)},{type:"swatches",caption:Bn?i.t("em.ctx.colorN",{n:Ct.length}):i.t("em.common.color"),current:Bn?null:J(U.id,ne),onPick:$O=>i.setAttributeSwatches(U.id,Ct,$O)},{type:"separator"},{caption:Bn?i.t("em.ctx.copyN",{n:Ct.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}],na=i.clipboard.value;(na==null?void 0:na.kind)==="attribute"&&mc.push({caption:na.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:na.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:U.id},i.paste()}}),mc.push({type:"separator"},{caption:Bn?i.t("em.ctx.deleteAttrN",{n:Ct.length}):i.t("em.ctx.deleteAttr"),icon:"trash",danger:!0,handler:()=>i.removeAttributes(U.id,Ct)}),(ta=nt.value)==null||ta.open(le,mc);return}const xe=(Vn=(gt=le.target)==null?void 0:gt.closest("[data-op]"))==null?void 0:Vn.dataset.op;if(xe){if(i.isEntityLocked(U.id))return;(Fr=nt.value)==null||Fr.open(le,[{caption:i.t("em.ctx.addOperation"),icon:"method",handler:()=>i.addOperation(U.id)},{type:"swatches",caption:i.t("em.common.color"),current:ce(U.id,xe),onPick:it=>i.setOperationSwatch(U.id,xe,it)},{type:"separator"},{caption:i.t("em.ctx.deleteOperation"),icon:"trash",danger:!0,handler:()=>i.removeOperation(U.id,xe)}]);return}const Be=i.resolved.value.entities.find(it=>it.entity.modelId===U.id),qe=!!(Be!=null&&Be.locked),je=[{caption:qe?i.t("em.ctx.viewDetail"):i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>hr(a,i,U.id)}];if(!qe){je.push({type:"separator"},{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(U.id)},{caption:i.t("em.ctx.addMethod"),icon:"method",handler:()=>i.addOperation(U.id)},{caption:i.t("em.ctx.groupInto"),icon:"folder",handler:()=>{const bt=Y.value.filter(Ct=>Ct.type==="entity").map(Ct=>Ct.id);i.createGroup(bt.includes(U.id)&&bt.length?bt:[U.id])}},{caption:i.t("em.ctx.addSelfAssoc"),icon:"arrow-lr",handler:()=>i.addAssociation(U.id,U.id)});const it=i.embeddableCatalog.value;if(it.length){je.push({type:"separator"});for(const bt of it){const Ct=((ry=bt.label)==null?void 0:ry[i.userLanguage.value])??((ly=bt.label)==null?void 0:ly.ko)??((sy=bt.label)==null?void 0:sy.en)??bt.type;je.push({caption:i.t("em.ctx.addEmbeddableNamed",{label:Ct}),icon:"link",handler:()=>i.addPredefinedEmbed(U.id,bt.type)})}}}if(je.push({type:"separator"}),je.push({caption:Be!=null&&Be.collapsed?i.t("em.panel.expand"):i.t("em.panel.collapse"),icon:Be!=null&&Be.collapsed?"expand-all":"collapse-all",handler:()=>i.setEntityCollapsed(U.id,!(Be!=null&&Be.collapsed))}),Be!=null&&Be.groupRef&&!qe&&je.push({caption:i.t("em.ctx.ungroupEntity"),icon:"folder",handler:()=>i.ungroupEntity(U.id)}),je.push({caption:qe?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:qe?"unlock":"lock",handler:()=>i.setEntityLocked(U.id,!qe)}),je.push(Ge(U.id)),!qe){const it=i.clipboard.value;(it==null?void 0:it.kind)==="attribute"&&je.push({caption:it.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:it.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:U.id},i.paste()}}),je.push({type:"separator"}),je.push({caption:i.t("em.ctx.deleteEntity"),icon:"trash",danger:!0,handler:()=>i.removeEntity(U.id)})}(cy=nt.value)==null||cy.open(le,je)}function Rt({event:D,edge:U}){var Be,qe;const le=D;if(le.preventDefault(),!i.editable.value)return;const ne=A(U.id);if(ne){(Be=nt.value)==null||Be.open(le,[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearNoteConnectionWaypoints(ne.noteRef,ne.targetRef)},{type:"separator"},{caption:i.t("em.ctx.deleteConnection"),icon:"trash",danger:!0,handler:()=>i.removeNoteConnection(ne.noteRef,ne.targetRef)}]);return}const xe=[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearWaypoints(U.id)}];i.isAssociationLocked(U.id)||xe.push({type:"separator"},{caption:i.t("em.ctx.deleteAssociation"),icon:"trash",danger:!0,handler:()=>i.removeAssociation(U.id)}),(qe=nt.value)==null||qe.open(le,xe)}function ot(D){return D==="group"?"group":D==="note"?"note":"entity"}function We({node:D}){if(Y.value.length>1){i.selection.value=null;return}i.selection.value={kind:ot(D.type),id:D.id}}function Ze({nodes:D}){D.length>1&&(i.selection.value=null)}function Q({edge:D}){const U=A(D.id);i.selection.value=U?{kind:"note",id:U.noteRef}:{kind:"association",id:D.id}}function Mt(D){const U=i.selection.value;return!!U&&U.kind!=="attribute"&&U.id===D.id}function Vt(D){var U,le;return Mt(D)?D.type==="group"?"color-mix(in srgb, var(--em-selection) 22%, transparent)":"var(--em-selection)":D.type==="note"?"var(--em-note-soft)":D.type==="group"?tp($t((U=D.data)==null?void 0:U.style),!0)??"var(--em-mm-group)":tp($t((le=D.data)==null?void 0:le.style))??"var(--em-mm-entity)"}function Mn(D){return Mt(D)?"var(--em-selection)":D.type==="note"?"var(--em-note-accent)":D.type==="group"?"var(--em-node-border)":"var(--em-on-surface-muted)"}function an(D,U){M(D,U,{zoom:x().zoom,duration:350})}t.watch(()=>i.focusRequest.value,D=>{if(!D)return;const U=C(D.id);if(!U)return;const le=U.computedPosition??U.position,ne=U.dimensions??{width:0,height:0};an(le.x+ne.width/2,le.y+ne.height/2)});function be({position:D}){an(D.x,D.y)}function mt({node:D}){i.selection.value={kind:ot(D.type),id:D.id};const U=D.computedPosition??D.position,le=D.dimensions??{width:0,height:0};an(U.x+le.width/2,U.y+le.height/2)}function vt({node:D}){B({nodes:[D.id],duration:350,maxZoom:1.2,padding:.6})}return(D,U)=>(t.openBlock(),t.createElementBlock("div",{tabindex:"-1",class:t.normalizeClass(["em-canvas",{"is-connecting":u.value,"is-panning":m.value}])},[t.createVNode(t.unref(aI),{"min-zoom":.2,"max-zoom":2,"only-render-visible-elements":!he.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(Sn).Loose,"pan-on-scroll":"","zoom-on-scroll":!1,"zoom-on-pinch":!0,"zoom-on-double-click":!1,"zoom-activation-key-code":["Meta","Control"],onMoveStart:de,onMoveEnd:Le,onConnect:ft,onConnectStart:U[1]||(U[1]=le=>u.value=!0),onConnectEnd:U[2]||(U[2]=le=>u.value=!1),onNodeDrag:yt,onNodeDragStop:st,onNodeClick:We,onEdgeClick:Q,onSelectionChange:Ze,onPaneClick:U[3]||(U[3]=le=>t.unref(i).selection.value=null),onPaneContextMenu:H,onNodeContextMenu:It,onEdgeContextMenu:Rt},{"node-group":t.withCtx(le=>[t.createVNode(Vp,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),"node-entity":t.withCtx(le=>[t.createVNode(Mp,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),"node-note":t.withCtx(le=>[t.createVNode(Bp,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),"edge-association":t.withCtx(le=>[t.createVNode(Qp,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),"edge-note-connection":t.withCtx(le=>[t.createVNode(fM,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),"edge-serialized-type":t.withCtx(le=>[t.createVNode(hM,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),default:t.withCtx(()=>[t.unref(i).showGrid.value?(t.openBlock(),t.createBlock(t.unref(tR),{key:0,gap:16,"pattern-color":"var(--em-border)"})):t.createCommentVNode("",!0),t.createVNode(t.unref(SR),{"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(So),{class:"em-palette__group-start",title:t.unref(i).t("em.ctx.addEntity"),onClick:He},{default:t.withCtx(()=>[t.createVNode(Ve,{name:"add-entity",size:14})]),_:1},8,["title"]),t.createVNode(t.unref(So),{title:t.unref(i).t("em.ctx.addNote"),onClick:De},{default:t.withCtx(()=>[t.createVNode(Ve,{name:"note",size:14})]),_:1},8,["title"]),t.createVNode(t.unref(So),{title:t.unref(i).t("em.palette.autoLayout"),onClick:U[0]||(U[0]=le=>t.unref(i).autoLayout())},{default:t.withCtx(()=>[t.createVNode(Ve,{name:"auto-layout",size:14})]),_:1},8,["title"])],64)):t.createCommentVNode("",!0)]),_:1}),t.unref(i).showMinimap.value?(t.openBlock(),t.createBlock(t.unref(cM),{key:1,pannable:"",width:224,height:160,"node-color":Vt,"node-stroke-color":Mn,"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:be,onNodeClick:mt,onNodeDblclick:vt})):t.createCommentVNode("",!0)]),_:1},8,["only-render-visible-elements","nodes-draggable","nodes-connectable","connection-mode"]),ge.value?(t.openBlock(),t.createElementBlock("div",a2,[t.unref(i).editable.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("p",r2,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,l2),t.createElementVNode("p",{class:"em-canvas__empty-hint",innerHTML:t.unref(i).t("em.canvas.emptyConnectHint")},null,8,s2),t.createElementVNode("p",{class:"em-canvas__empty-hint em-canvas__empty-sub",innerHTML:t.unref(i).t("em.canvas.emptyShortcutHint")},null,8,c2)],64)):(t.openBlock(),t.createElementBlock("p",d2,t.toDisplayString(t.unref(i).t("em.canvas.emptyReadonly")),1))])):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createBlock(o2,{key:1,controller:t.unref(i),onClose:U[4]||(U[4]=le=>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",u2,[t.createVNode(Ve,{name:"alert-triangle",size:16,class:"em-conflict-banner__icon"}),t.createElementVNode("div",m2,[t.createElementVNode("strong",f2,t.toDisplayString(d.value.title),1),t.createElementVNode("span",p2,t.toDisplayString(d.value.detail),1)])])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(CM,{ref_key:"menuRef",ref:nt,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",h2,t.toDisplayString(l.value),1)):t.createCommentVNode("",!0)]),_:1})]))],2))}}),[["__scopeId","data-v-284ee242"]]),y2={class:"em-explorer em-scroll-overlay"},g2={class:"em-explorer__search"},b2=["placeholder","aria-label"],_2=["aria-label","title"],k2={key:0,class:"em-explorer__empty"},E2=["aria-label"],N2=["data-key","aria-level","aria-posinset","aria-setsize","aria-expanded","aria-selected","tabindex","onClick","onDblclick","onFocus","onKeydown"],w2=["onClick"],I2=["title"],v2={class:"em-key-slot"},C2={class:"em-key-slot"},S2={class:"em-explorer__label"},x2={key:2,class:"em-explorer__sr"},ny=Qe(t.defineComponent({__name:"DiagramExplorer",props:{controller:{},storageKey:{}},setup(e,{expose:n}){const o=e,i=o.controller,a=oe.useModal(),r=t.computed(()=>{var He,De;const T=i.resolved.value,w=i.displayMode.value,I=i.userLanguage.value,v=Z=>{var re,ue,z;return aa(w,Z.name,(ue=(re=Z.table)==null?void 0:re.logicalName)==null?void 0:ue[I],(z=Z.table)==null?void 0:z.physicalName,i.t("em.node.logicalMissing"))},B=w==="PHYSICAL"||w==="LOGICAL_PHYSICAL",M=Z=>{const re=Z.attrType.startsWith("RELATION")&&Z.dbAttrs.length>0;return{icon:Z.attrType.startsWith("RELATION")?"link":"field",keyMarks:{pk:Z.identifier,fk:re&&B}}},x=Z=>Z.attrType.startsWith("EMBED")&&Z.dbAttrs.length>0,P=Z=>x(Z)||yn(Z),Y=w==="PHYSICAL"||w==="LOGICAL_PHYSICAL",se=(Z,re)=>{if(yn(Z)){const z=i.state.logical.entities,L=z.find(F=>F.modelId===re);return Z.dbAttrs.map((F,X)=>{const ee=Zn(Z,L,z,i.state.logical.associations,X);return ee?{...F,physicalName:F.physicalName||ee.physicalName,logicalName:F.logicalName??ee.logicalName,dataType:F.dataType||ee.dataType}:F})}if(Z.attrType!=="EMBED_PREDEF")return Z.dbAttrs;const ue=i.embeddableCatalog.value.find(z=>z.type===Z.type);return ue?Z.dbAttrs.map((z,L)=>{const F=ue.fields[L];return F?{...z,physicalName:z.physicalName||F.physicalName,logicalName:z.logicalName??F.logicalName,dataType:z.dataType||F.dataType,length:z.length??F.length}:z}):Z.dbAttrs},he=(Z,re)=>{const ue=ui(Z,Vo(i.state.logical),re,i.state.logical);return ue.kind==="resolved"?ue.entity:void 0},ie=(Z,re,ue)=>{var X,ee,ke,ye,Ne,we,G,q,W;const z={entityId:re,attrId:Z.modelId};if(P(Z)){const Ce=nl(w,Z,ue==null?void 0:ue.collection,ue==null?void 0:ue.targetName,he(Z));return{key:`attr:${Z.modelId}`,label:Z.name+(Ce?` : ${Ce}`:""),icon:"table",attrRef:z,focusId:re,matchText:li(Z.name,(ee=(X=Z.dbAttrs[0])==null?void 0:X.logicalName)==null?void 0:ee[I],(ke=Z.dbAttrs[0])==null?void 0:ke.physicalName),children:Y?se(Z,re).map($e=>{var ze,Fe;return{key:`attr:${Z.modelId}:col:${$e.modelId}`,label:aa(w,$e.physicalName,(ze=$e.logicalName)==null?void 0:ze[I],$e.physicalName,i.t("em.node.logicalMissing"))+($e.dataType?` : ${$e.dataType}`:""),icon:"field",attrRef:z,focusId:re,matchText:li($e.physicalName,(Fe=$e.logicalName)==null?void 0:Fe[I]),children:[]}}):[]}}const L=(ue==null?void 0:ue.collection)??ua(Z,i.state.logical.associations),F=nl(w,Z,L,ue==null?void 0:ue.targetName,he(Z));return{key:`attr:${Z.modelId}`,label:aa(w,Z.name,(Ne=(ye=Z.dbAttrs[0])==null?void 0:ye.logicalName)==null?void 0:Ne[I],(we=Z.dbAttrs[0])==null?void 0:we.physicalName,i.t("em.node.logicalMissing"))+(F?` : ${F}`:""),...M(Z),attrRef:z,focusId:re,matchText:li(Z.name,(q=(G=Z.dbAttrs[0])==null?void 0:G.logicalName)==null?void 0:q[I],(W=Z.dbAttrs[0])==null?void 0:W.physicalName),children:[]}},fe=Z=>{var ee,ke,ye;const re=Z.entity,ue=w==="CLASS",L=ue||re.attributes.some(yn)?bl(re,i.state.logical):void 0,F=ue&&L?L.fields.map(Ne=>Ne.attr):[...re.attributes].sort((Ne,we)=>Ne.order-we.order),X=new Map(((L==null?void 0:L.fields)??[]).filter(Ne=>(ue||yn(Ne.attr))&&(Ne.target||Ne.collection)).map(Ne=>{var we;return[Ne.attr.modelId,{targetName:(we=Ne.target)==null?void 0:we.name,collection:Ne.collection}]}));return{key:`entity:${re.modelId}`,label:v(re),icon:"table",selectKind:"entity",selectId:re.modelId,focusId:re.modelId,matchText:li(re.name,(ke=(ee=re.table)==null?void 0:ee.logicalName)==null?void 0:ke[I],(ye=re.table)==null?void 0:ye.physicalName),children:F.map(Ne=>ie(Ne,re.modelId,X.get(Ne.modelId)))}},pe=new Map,ge=[];for(const Z of T.entities)if(Z.groupRef){const re=pe.get(Z.groupRef)??[];re.push(Z),pe.set(Z.groupRef,re)}else ge.push(Z);const Te=[];for(const Z of T.groups){const re=Z.group;Te.push({key:`group:${re.modelId}`,label:((He=re.name)==null?void 0:He[I])||((De=re.name)==null?void 0:De.ko)||re.packageName||i.t("em.explorer.groupFallback"),icon:"folder",focusId:re.modelId,children:(pe.get(re.modelId)??[]).map(fe)})}for(const Z of ge)Te.push(fe(Z));if(T.associations.length){const Z=new Map(T.entities.map(re=>[re.entity.modelId,v(re.entity)]));Te.push({key:"section:associations",label:i.t("em.explorer.associations",{n:T.associations.length}),icon:"arrow-lr",children:T.associations.map(re=>{const ue=re.association,z=Z.get(ue.end1.entityRef)??ue.end1.entityRef,L=Z.get(ue.end2.entityRef)??ue.end2.entityRef;return{key:`assoc:${ue.modelId}`,label:`${z} — ${L}`,icon:"arrow-lr",selectKind:"association",selectId:ue.modelId,children:[]}})})}return T.notes.length&&Te.push({key:"section:notes",label:i.t("em.explorer.notes",{n:T.notes.length}),icon:"note",children:T.notes.map(({note:Z})=>{var re;return{key:`note:${Z.modelId}`,label:((re=Z.memo.split(`
66
- `)[0])==null?void 0:re.slice(0,30))||i.t("em.explorer.emptyNote"),icon:"note",selectKind:"note",selectId:Z.modelId,focusId:Z.modelId,children:[]}})}),{key:"root",label:i.state.layout.name||i.t("em.explorer.diagram"),icon:"network",children:Te}});function l(T){return T?T.pk&&T.fk?i.t("em.node.keyPfk"):T.pk?i.t("em.node.keyPk"):T.fk?i.t("em.node.keyFk"):"":""}const s=t.computed(()=>{const T=[],w=I=>{if(I.children.length){I.key!=="root"&&T.push(I.key);for(const v of I.children)w(v)}};return w(r.value),T}),c=T=>T.startsWith("entity:")||T==="section:associations",{isCollapsed:d,toggle:u,toggleAll:m,allExpanded:p}=Wh({expandableKeys:()=>s.value,defaultCollapsed:c,storageKey:o.storageKey,scope:()=>i.state.layout.diagramId}),f=t.ref(""),h=t.ref(null),g=t.computed(()=>f.value.trim().length>0),b=t.computed(()=>{const T=[];if(g.value){const I=UM(r.value,f.value.trim().toLowerCase()),v=(B,M,x,P,Y)=>{if(!I.has(B.key))return;T.push({node:B,depth:M,parentKey:x,posinset:P,setsize:Y});const se=B.children.filter(he=>I.has(he.key));se.forEach((he,ie)=>v(he,M+1,B.key,ie+1,se.length))};return v(r.value,0,null,1,1),T}const w=(I,v,B,M,x)=>{T.push({node:I,depth:v,parentKey:B,posinset:M,setsize:x}),d(I.key)||I.children.forEach((P,Y)=>w(P,v+1,I.key,Y+1,I.children.length))};return w(r.value,0,null,1,1),T}),_=t.ref(null),k=t.ref(null),N=t.computed(()=>{var w;const T=b.value;return k.value&&T.some(I=>I.node.key===k.value)?k.value:((w=T[0])==null?void 0:w.node.key)??null}),y=T=>!g.value&&d(T);async function E(T){var w,I;T&&(k.value=T,await t.nextTick(),(I=(w=_.value)==null?void 0:w.querySelector(`[data-key="${T}"]`))==null||I.focus())}function S(T,w){var B,M,x,P,Y;const I=b.value,v=I.findIndex(se=>se.node.key===w.node.key);switch(T.key){case"ArrowDown":T.preventDefault(),E((B=I[v+1])==null?void 0:B.node.key);return;case"ArrowUp":T.preventDefault(),E((M=I[v-1])==null?void 0:M.node.key);return;case"Home":T.preventDefault(),E((x=I[0])==null?void 0:x.node.key);return;case"End":T.preventDefault(),E((P=I[I.length-1])==null?void 0:P.node.key);return;case"ArrowRight":if(T.preventDefault(),!w.node.children.length)return;y(w.node.key)?u(w.node.key):E((Y=I[v+1])==null?void 0:Y.node.key);return;case"ArrowLeft":T.preventDefault(),w.node.children.length&&!y(w.node.key)?u(w.node.key):E(w.parentKey);return;case"Enter":case" ":T.preventDefault(),C(w.node,T);return;case"F2":T.preventDefault(),R(w.node)}}const A=t.computed(()=>g.value&&b.value.length<=1);function V(T){var v;if(T.key!=="/"||T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;const w=T.target,I=w==null?void 0:w.tagName;I==="INPUT"||I==="TEXTAREA"||I==="SELECT"||w!=null&&w.isContentEditable||(T.preventDefault(),(v=h.value)==null||v.focus())}t.onMounted(()=>window.addEventListener("keydown",V)),t.onBeforeUnmount(()=>window.removeEventListener("keydown",V)),n({toggleAll:m,allExpanded:p,hasExpandable:t.computed(()=>s.value.length>0)});function $(T){const w=i.selection.value;return T.attrRef?(w==null?void 0:w.kind)==="attribute"&&w.entityId===T.attrRef.entityId&&w.ids.includes(T.attrRef.attrId):!!w&&w.kind!=="attribute"&&!!T.selectId&&T.selectKind===w.kind&&T.selectId===w.id}function O(T){const w=i.selection.value;return T.selectKind==="entity"&&(w==null?void 0:w.kind)==="attribute"&&w.entityId===T.selectId}function C(T,w){if(T.attrRef){const I=w.shiftKey?"range":w.metaKey||w.ctrlKey?"toggle":"replace";i.selectAttribute(T.attrRef.entityId,T.attrRef.attrId,I)}else T.selectKind&&T.selectId&&(i.selection.value={kind:T.selectKind,id:T.selectId});T.focusId&&i.requestFocus(T.focusId)}function R(T){T.selectKind==="entity"&&T.selectId&&hr(a,i,T.selectId)}return(T,w)=>(t.openBlock(),t.createElementBlock("section",y2,[t.createElementVNode("div",g2,[t.createVNode(Ve,{name:"search",size:14,class:"em-explorer__search-icon"}),t.withDirectives(t.createElementVNode("input",{ref_key:"searchInput",ref:h,"onUpdate:modelValue":w[0]||(w[0]=I=>f.value=I),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:w[1]||(w[1]=t.withKeys(I=>f.value="",["esc"]))},null,40,b2),[[t.vModelText,f.value]]),f.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:w[2]||(w[2]=I=>f.value="")},[t.createVNode(Ve,{name:"x",size:13})],8,_2)):t.createCommentVNode("",!0)]),A.value?(t.openBlock(),t.createElementBlock("p",k2,t.toDisplayString(t.unref(i).t("em.explorer.noMatches")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"rowsEl",ref:_,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,I=>(t.openBlock(),t.createElementBlock("div",{key:I.node.key,class:t.normalizeClass(["em-explorer__row",{"is-active":$(I.node),"is-focus-parent":O(I.node),"is-selectable":!!I.node.selectKind||!!I.node.attrRef||!!I.node.focusId}]),"data-key":I.node.key,role:"treeitem","aria-level":I.depth+1,"aria-posinset":I.posinset,"aria-setsize":I.setsize,"aria-expanded":I.node.children.length?!y(I.node.key):void 0,"aria-selected":$(I.node),tabindex:I.node.key===N.value?0:-1,style:t.normalizeStyle({paddingLeft:4+I.depth*14+"px"}),onClick:v=>C(I.node,v),onDblclick:v=>R(I.node),onFocus:v=>k.value=I.node.key,onKeydown:v=>S(v,I)},[t.createElementVNode("span",{class:t.normalizeClass(["em-explorer__chevron",{"is-leaf":!I.node.children.length,"is-open":!y(I.node.key)}]),onClick:t.withModifiers(v=>I.node.children.length&&t.unref(u)(I.node.key),["stop"])},[I.node.children.length?(t.openBlock(),t.createBlock(Ve,{key:0,name:"chevron",size:14})):t.createCommentVNode("",!0)],10,w2),I.node.keyMarks?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-explorer__keys",title:l(I.node.keyMarks),"aria-hidden":"true"},[t.createElementVNode("span",v2,[I.node.keyMarks.pk?(t.openBlock(),t.createBlock(Ve,{key:0,name:"key",size:14,class:"em-key is-pk"})):I.node.keyMarks.fk?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Ve,{key:1,class:"em-explorer__icon",name:I.node.icon,size:14},null,8,["name"]))]),t.createElementVNode("span",C2,[I.node.keyMarks.fk?(t.openBlock(),t.createBlock(Ve,{key:0,name:"key",size:14,class:"em-key is-fk"})):t.createCommentVNode("",!0)])],8,I2)):(t.openBlock(),t.createBlock(Ve,{key:1,class:"em-explorer__icon",name:I.node.icon,size:15},null,8,["name"])),t.createElementVNode("span",S2,t.toDisplayString(I.node.label),1),l(I.node.keyMarks)?(t.openBlock(),t.createElementBlock("span",x2,t.toDisplayString(l(I.node.keyMarks)),1)):t.createCommentVNode("",!0)],46,N2))),128))],8,E2)]))}}),[["__scopeId","data-v-9124d45b"]]),R2={class:"em-text-export"},A2=["id","aria-selected","tabindex","onClick"],$2=["aria-labelledby"],T2={class:"em-text-export__actions"},M2=Qe(t.defineComponent({__name:"TextExportModal",props:{formats:{},title:{},locale:{}},setup(e){const n=e,o=oe.useModalHandle(),i=(m,p)=>en(n.locale??"ko",m,p),a=t.ref(0);function r(){return n.formats[a.value]??n.formats[0]}const l=t.ref(null);async function s(m){var p,f;a.value=m,await t.nextTick(),(f=(p=l.value)==null?void 0:p.querySelectorAll('[role="tab"]')[m])==null||f.focus()}function c(m){const p=n.formats.length;p&&s((a.value+m+p)%p)}async function d(){try{await navigator.clipboard.writeText(r().content),oe.showNotification(i("em.export.copied"),"info")}catch{oe.showNotification(i("em.export.copyFailed"),"error")}}function u(){const m=r(),p=new Blob([m.content],{type:"text/plain;charset=utf-8"}),f=URL.createObjectURL(p);try{const h=document.createElement("a");h.href=f,h.download=m.filename,document.body.appendChild(h),h.click(),h.remove()}finally{URL.revokeObjectURL(f)}}return(m,p)=>(t.openBlock(),t.createBlock(t.unref(oe.BSModalFrame),{title:n.title??i("em.export.title")},{default:t.withCtx(()=>[t.createElementVNode("div",R2,[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,(f,h)=>(t.openBlock(),t.createElementBlock("button",{id:`em-text-export-tab-${h}`,key:f.key,type:"button",role:"tab",class:t.normalizeClass(["em-text-export__tab",{"is-active":h===a.value}]),"aria-selected":h===a.value,"aria-controls":"em-text-export-panel",tabindex:h===a.value?0:-1,onClick:g=>a.value=h,onKeydown:[p[0]||(p[0]=t.withKeys(t.withModifiers(g=>c(-1),["prevent"]),["left"])),p[1]||(p[1]=t.withKeys(t.withModifiers(g=>c(1),["prevent"]),["right"])),p[2]||(p[2]=t.withKeys(t.withModifiers(g=>s(0),["prevent"]),["home"])),p[3]||(p[3]=t.withKeys(t.withModifiers(g=>s(n.formats.length-1),["prevent"]),["end"]))]},t.toDisplayString(f.label),43,A2))),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,$2),t.createElementVNode("div",T2,[t.createVNode(t.unref(oe.BSButton),{caption:i("em.export.copy"),onClick:d},null,8,["caption"]),t.createVNode(t.unref(oe.BSButton),{caption:i("em.export.download"),onClick:u},null,8,["caption"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:i("em.common.close"),onClick:p[4]||(p[4]=f=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-74551f98"]]),V2={class:"em-text-import"},B2=["aria-label"],D2=["aria-checked","tabindex","onClick"],O2=["placeholder"],L2={class:"em-text-import__status"},P2={class:"em-text-import__ok"},z2={key:0,class:"em-text-import__warn"},F2={key:1,class:"em-text-import__err"},U2={key:2,class:"em-text-import__err"},H2={key:3,class:"em-text-import__err"},j2={class:"em-text-import__actions"},K2=Qe(t.defineComponent({__name:"TextImportModal",props:{onImport:{type:Function},locale:{}},setup(e){const n=e,o=oe.useModalHandle(),i=(g,b)=>en(n.locale??"ko",g,b),a=t.ref(""),r=t.ref("auto"),l=[{key:"auto",labelKey:"em.import.formatAuto"},{key:"mermaid",labelKey:"em.import.formatMermaid"},{key:"ddl",labelKey:"em.import.formatDdl"},{key:"json",labelKey:"em.import.formatJson"}],s=t.ref(null);async function c(g){var _,k;const b=l[(g+l.length)%l.length];b&&(r.value=b.key,await t.nextTick(),(k=(_=s.value)==null?void 0:_.querySelectorAll('[role="radio"]')[l.indexOf(b)])==null||k.focus())}function d(g){c(l.findIndex(b=>b.key===r.value)+g)}function u(g){return g?g.startsWith("{")?"json":/\berdiagram\b/i.test(g)?"mermaid":/\bcreate\s+table\b/i.test(g)?"ddl":null:null}const m=t.computed(()=>r.value==="auto"?u(a.value.trim()):r.value),p=t.computed(()=>{const g=a.value.trim();if(!g)return{status:"empty"};const b=m.value;if(!b)return{status:"unknown"};try{let _,k=[];return b==="json"?_=Wc(g):b==="mermaid"?_=Fc(g):(_=Kc(g),k=ol(g).warnings),_.logical.entities.length===0?{status:"emptyParse"}:{status:"ok",source:_,warnings:k}}catch(_){return{status:"error",message:_ instanceof Error?_.message:String(_)}}}),f=t.computed(()=>p.value.status==="ok");function h(){const g=p.value;g.status!=="ok"||!g.source||(n.onImport(g.source),o.close())}return(g,b)=>(t.openBlock(),t.createBlock(t.unref(oe.BSModalFrame),{title:i("em.import.title")},{default:t.withCtx(()=>[t.createElementVNode("div",V2,[t.createElementVNode("div",{ref_key:"fmtEl",ref:s,class:"em-text-import__formats",role:"radiogroup","aria-label":i("em.import.formatGroup")},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(l,_=>t.createElementVNode("button",{key:_.key,type:"button",role:"radio",class:t.normalizeClass(["em-text-import__fmt",{"is-active":_.key===r.value}]),"aria-checked":_.key===r.value,tabindex:_.key===r.value?0:-1,onClick:k=>r.value=_.key,onKeydown:[b[0]||(b[0]=t.withKeys(t.withModifiers(k=>d(-1),["prevent"]),["left"])),b[1]||(b[1]=t.withKeys(t.withModifiers(k=>d(1),["prevent"]),["right"])),b[2]||(b[2]=t.withKeys(t.withModifiers(k=>c(0),["prevent"]),["home"])),b[3]||(b[3]=t.withKeys(t.withModifiers(k=>c(l.length-1),["prevent"]),["end"]))]},t.toDisplayString(i(_.labelKey)),43,D2)),64))],8,B2),t.withDirectives(t.createElementVNode("textarea",{"onUpdate:modelValue":b[4]||(b[4]=_=>a.value=_),class:"em-text-import__input",placeholder:i("em.import.placeholder"),spellcheck:"false"},null,8,O2),[[t.vModelText,a.value]]),t.createElementVNode("div",L2,[p.value.status==="ok"&&p.value.source?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("span",P2,t.toDisplayString(i("em.import.detected",{format:i(`em.import.format${m.value==="json"?"Json":m.value==="ddl"?"Ddl":"Mermaid"}`)}))+" · "+t.toDisplayString(i("em.import.summary",{entities:p.value.source.logical.entities.length,relations:p.value.source.logical.associations.length})),1),p.value.warnings&&p.value.warnings.length?(t.openBlock(),t.createElementBlock("span",z2," ⚠ "+t.toDisplayString(i("em.import.warnings",{n:p.value.warnings.length})),1)):t.createCommentVNode("",!0)],64)):p.value.status==="error"?(t.openBlock(),t.createElementBlock("span",F2,t.toDisplayString(i("em.import.error",{message:p.value.message??""})),1)):p.value.status==="unknown"?(t.openBlock(),t.createElementBlock("span",U2,t.toDisplayString(i("em.import.unknownFormat")),1)):p.value.status==="emptyParse"?(t.openBlock(),t.createElementBlock("span",H2,t.toDisplayString(i("em.import.emptyParse")),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",j2,[t.createVNode(t.unref(oe.BSButton),{caption:i("em.import.confirm"),disabled:!f.value,onClick:h},null,8,["caption","disabled"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:i("em.common.close"),onClick:b[5]||(b[5]=_=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-1059c939"]]),G2={class:"em-toolbar"},Y2=["title"],q2={class:"em-toolbar__mode"},oy=Qe(t.defineComponent({__name:"EditorToolbar",props:{controller:{},historyOpen:{type:Boolean}},emits:["exportSvg","exportPng","toggleHistory"],setup(e,{emit:n}){const i=e.controller,a=n,r=oe.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:h=>i.displayMode.value=h});function c(){i.routingMode.value=i.routingMode.value==="straight"?"orthogonal":"straight"}const d=t.computed(()=>{const h=i.resolved.value.entities;return h.length>0&&h.every(g=>g.collapsed)});function u(){d.value?i.expandAll():i.collapseAll()}function m(){const h=Wr(i.state.logical,i.referenceOnlyDocument.value);r.openModal({component:M2,bind:{title:i.t("em.toolbar.exportText"),locale:i.uiLocale.value,formats:[{key:"text",label:i.t("em.export.formatText"),content:Sc(h,{embeddableCatalog:i.embeddableCatalog.value}),filename:"diagram.txt"},{key:"mermaid-er",label:i.t("em.export.formatMermaidEr"),content:Jr(h,"er",{embeddableCatalog:i.embeddableCatalog.value}),filename:"diagram.er.mmd"},{key:"mermaid-class",label:i.t("em.export.formatMermaidClass"),content:Jr(h,"class"),filename:"diagram.class.mmd"},{key:"ddl",label:i.t("em.export.formatDdl"),content:Gc(h,"postgres",{embeddableCatalog:i.embeddableCatalog.value}),filename:"schema.sql"},{key:"json",label:i.t("em.export.formatJson"),content:qc(h,i.state.layout),filename:"diagram.json"}]}})}function p(){r.openModal({component:K2,bind:{locale:i.uiLocale.value,onImport:h=>{i.importEntities(h,h.logical.entities.map(g=>g.modelId))}}})}function f(){r.openModal({component:ey,bind:{locale:i.uiLocale.value}})}return(h,g)=>(t.openBlock(),t.createElementBlock("div",G2,[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,Y2)):t.createCommentVNode("",!0),t.createVNode(t.unref(oe.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(Ve,{name:"undo",size:16})]),_:1},8,["tooltip","disabled"]),t.createVNode(t.unref(oe.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(Ve,{name:"redo",size:16})]),_:1},8,["tooltip","disabled"]),g[9]||(g[9]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),t.createElementVNode("label",q2,[t.createTextVNode(t.toDisplayString(t.unref(i).t("em.toolbar.displayLabel"))+" ",1),t.createVNode(t.unref(oe.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(oe.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(Ve,{name:"route",size:16})]),_:1},8,["caption","tooltip"]),t.createVNode(t.unref(oe.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(Ve,{name:"grid",size:16})]),_:1},8,["class","caption","tooltip"]),t.createVNode(t.unref(oe.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(Ve,{name:"map",size:16})]),_:1},8,["class","caption","tooltip"]),t.createVNode(t.unref(oe.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(Ve,{name:d.value?"expand-all":"collapse-all",size:16},null,8,["name"])]),_:1},8,["caption","disabled"]),g[10]||(g[10]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.import"),disabled:!t.unref(i).editable.value,onClick:p},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"clipboard",size:16})]),_:1},8,["tooltip","disabled"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportText"),onClick:m},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"file-text",size:16})]),_:1},8,["tooltip"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportSvg"),onClick:g[5]||(g[5]=b=>a("exportSvg"))},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"image",size:16})]),_:1},8,["tooltip"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportPng"),onClick:g[6]||(g[6]=b=>a("exportPng"))},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"camera",size:16})]),_:1},8,["tooltip"]),g[11]||(g[11]=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(oe.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[7]||(g[7]=b=>a("toggleHistory"))},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"history",size:16})]),_:1},8,["class","caption","tooltip"]),g[8]||(g[8]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1))],64)):t.createCommentVNode("",!0),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-toolbar__icon-btn em-toolbar__help",tooltip:t.unref(i).t("em.toolbar.shortcuts"),onClick:f},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"help",size:16})]),_:1},8,["tooltip"])]))}}),[["__scopeId","data-v-ba562aa2"]]),W2=["title"],J2=["title"],X2=["disabled","aria-pressed"],Z2=["disabled","aria-pressed"],Q2=Qe(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=>en(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(Ve,{name:"lock",size:14}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.frozen")),1)],8,W2)):(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(Ve,{name:"eye",size:13}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.view")),1)],10,X2),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(Ve,{name:"pencil",size:13}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.edit")),1)],10,Z2)],10,J2))}}),[["__scopeId","data-v-2b5162b7"]]),eV=["disabled"],tV={class:"em-panel__sub"},nV={class:"em-nav"},oV={key:0,class:"em-nav__divider","aria-hidden":"true"},iV={key:1},aV=["onClick","onKeydown"],rV={class:"em-nav__name"},lV=["title"],sV={key:0,class:"em-panel__note"},cV=["data-attr-block"],dV={key:0,class:"em-embed-col__label"},uV={class:"em-attr__row"},mV=["title"],fV={key:1,class:"em-attr__row"},pV={key:2,class:"em-embed-cols"},hV={class:"em-embed-col"},yV={class:"em-embed-col__label"},gV={class:"em-attr__row"},bV={class:"em-attr__navhint"},_V={key:3,class:"em-attr__navhint"},kV={key:4,class:"em-attr__navhint"},EV={key:0,class:"em-attr__navhint"},NV={class:"em-attr__row"},wV={class:"em-attr__row"},IV=["title"],vV={class:"em-attr__flags"},CV={class:"em-attr__pii"},SV={class:"em-attr__pii"},xV={key:1,class:"em-attr__pii"},RV={key:2,class:"em-attr__pii em-attr__codetop"},AV={class:"em-multilang"},$V={key:6,class:"em-embed-cols"},TV={key:0,class:"em-attr__navhint"},MV={class:"em-embed-col__label"},VV={class:"em-attr__row"},BV=["title"],DV=["title"],OV=["title"],LV={class:"em-attr__row"},PV={key:0,class:"em-embed-upd"},zV={key:1,class:"em-attr__navhint"},FV={class:"em-embed-upd"},UV={class:"em-embed-upd"},HV={class:"em-attr__flags"},jV={class:"em-multilang"},KV={class:"em-swatch__row em-attr__swatch"},GV=["title","onClick"],YV=["title","onClick"],qV={key:0,class:"em-attr__swatch-hint"},WV=Qe(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,setAttr:u,isDerivedIdRow:m,rowName:p,rowNamePlaceholder:f,setRowName:h,assocFieldName:g,setAssocFieldName:b,nameLocked:_,nameLockedHint:k,isManagedFk:N,setNaturalId:y,setIdentifier:E,setTransient:S,dbLocked:A,fkDerived:V,fkOriginPhysical:$,typeValueOf:O,typeLabelOf:C,setAttrType:R,setAttrCustomType:T,setDb:w,scaleApplicable:I,scaleHint:v,setDbLogical:B,setAttrDescription:M,attrPiiValue:x,setAttrPii:P,predefinedCustomTypeCatalog:Y,serializedTypeNames:se,embeddableCatalog:he,predefinedLabel:ie,groupCodeCatalog:fe,attrGroupCodes:pe,attrCodeItems:ge,codeValueOf:Te,codeLabelOf:He,setAttrGroupCode:De,setAttrCode:Z,setAttrDefaultValue:re,hasColumnSlots:ue,isMultiColFk:z,setDbAt:L,setDbLogicalAt:F,colSlotMeta:X,fixedDataType:ee,fixedLength:ke,fixedScale:ye,slotFixedHint:Ne,updatableItems:we,updatableLabel:G,updatableValue:q,setUpdatableAt:W,setUpdatable:Ce,insertableItems:$e,insertableLabel:ze,insertableValue:Fe,setInsertableAt:ae,setInsertable:Se,sharedItems:Ge,sharedLabel:et,sharedValue:te,setSharedAt:de,isShared:Le,sharedPhysical:dt}=ap(o,()=>n.entityId),Xe=t.computed(()=>i.value?o.state.layout.entityLayouts.find(We=>We.entityRef===i.value.modelId)??null:null),yt=t.computed(()=>{var We;return((We=i.value)==null?void 0:We.attributes.filter(Ze=>Ze.attrType!=="DIVIDER"))??[]}),st=t.computed(()=>{var We;return((We=i.value)==null?void 0:We.attributes)??[]}),ft=t.computed(()=>yt.value.filter(We=>l.value.has(We.modelId)));function nt(We){return{pk:We.identifier,fk:We.attrType.startsWith("RELATION")&&We.dbAttrs.length>0,required:We.notNull&&!We.identifier}}function J(We){const Ze=nt(We),Q=[Ze.pk&&"PK",Ze.fk&&"FK",Ze.required&&"NOT NULL"].filter(Boolean);return Q.length?Q.join(" · "):void 0}function ce(We,Ze){i.value&&o.selectAttribute(i.value.modelId,We.modelId,Ze.shiftKey?"range":Ze.metaKey||Ze.ctrlKey?"toggle":"replace")}function Ae(We){var Ze,Q;return $t((Q=(Ze=Xe.value)==null?void 0:Ze.attributeStyles)==null?void 0:Q[We.modelId])}function Ee(We){return l.value.size>1&&l.value.has(We.modelId)}function H(We,Ze){if(!i.value)return;const Q=Ee(We)?o.selectedAttrIds.value:[We.modelId];o.setAttributeSwatches(i.value.modelId,Q,Ze)}const It=t.ref(void 0);function Rt(We){if(!We||!i.value)return;const Ze=o.addPredefinedEmbed(i.value.modelId,We);Ze&&o.selectAttribute(i.value.modelId,Ze),It.value=void 0}function ot(){if(!i.value)return;const We=o.addAttribute(i.value.modelId);We&&o.selectAttribute(i.value.modelId,We)}return(We,Ze)=>t.unref(i)?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!t.unref(o).editable.value},[t.createElementVNode("h4",tV,[t.createTextVNode(t.toDisplayString(t.unref(o).t("em.attr.section",{n:yt.value.length}))+" ",1),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:ot},null,8,["caption"]),t.unref(he).length?(t.openBlock(),t.createBlock(t.unref(oe.BSSelect),{key:0,width:"120px",placeholder:t.unref(o).t("em.attr.addEmbeddable"),"model-value":It.value,items:t.unref(he),"value-provider":Q=>Q.type,"label-provider":t.unref(ie),"onUpdate:modelValue":Rt},null,8,["placeholder","model-value","items","value-provider","label-provider"])):t.createCommentVNode("",!0)]),t.createElementVNode("ul",nV,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(st.value,Q=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:Q.modelId},[Q.attrType==="DIVIDER"?(t.openBlock(),t.createElementBlock("li",oV,[...Ze[0]||(Ze[0]=[t.createElementVNode("hr",null,null,-1)])])):(t.openBlock(),t.createElementBlock("li",iV,[t.createElementVNode("div",{class:t.normalizeClass(["em-nav__item",{"is-selected":t.unref(l).has(Q.modelId)}]),role:"button",tabindex:"0",onClick:Mt=>ce(Q,Mt),onKeydown:[t.withKeys(t.withModifiers(Mt=>ce(Q,Mt),["prevent"]),["enter"]),t.withKeys(t.withModifiers(Mt=>ce(Q,Mt),["prevent"]),["space"])]},[t.createElementVNode("span",rV,t.toDisplayString(Q.name||t.unref(o).t("em.attr.nameless")),1),t.createElementVNode("span",{class:"em-nav__marks",title:J(Q)},[nt(Q).pk?(t.openBlock(),t.createBlock(Ve,{key:0,name:"key",size:12,class:"em-nav-key is-pk"})):nt(Q).required?(t.openBlock(),t.createBlock(Ve,{key:1,name:"asterisk",size:14,class:"em-nav-key is-required"})):t.createCommentVNode("",!0),nt(Q).fk?(t.openBlock(),t.createBlock(Ve,{key:2,name:"key",size:12,class:"em-nav-key is-fk"})):t.createCommentVNode("",!0)],8,lV)],42,aV)]))],64))),128))]),yt.value.length&&!ft.value.length?(t.openBlock(),t.createElementBlock("p",sV,t.toDisplayString(t.unref(o).t("em.attr.selectHint")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ft.value,Q=>{var Mt,Vt,Mn,an,be,mt,vt,D,U,le;return t.openBlock(),t.createElementBlock("div",{key:Q.modelId,class:t.normalizeClass(["em-attr",{"is-focused":t.unref(l).has(Q.modelId)}]),"data-attr-block":Q.modelId},[t.unref(m)(Q)?(t.openBlock(),t.createElementBlock("span",dV,t.toDisplayString(t.unref(o).t("em.attr.derivedIdField")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",uV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`attr-name-${Q.modelId}`,width:"100%",disabled:t.unref(_)(Q),title:t.unref(_)(Q)?t.unref(k)(Q):t.unref(m)(Q)?t.unref(o).t("em.attr.derivedIdNote"):void 0,placeholder:t.unref(f)(Q),"model-value":t.unref(p)(Q),"onUpdate:modelValue":ne=>t.unref(h)(Q,ne)},null,8,["name","disabled","title","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSSelect),{name:`attr-type-${Q.modelId}`,width:"84px",placeholder:t.unref(o).t("em.attr.typePlaceholder"),disabled:Q.attrType.startsWith("EMBED")||!!Q.groupCode||Q.attrType==="RELATION_REF"||t.unref(V)(Q),items:t.unref(Pc)(Q.type,t.unref(Y),t.unref(se)),"value-provider":t.unref(O),"label-provider":t.unref(C),"model-value":Q.type,"onUpdate:modelValue":ne=>t.unref(R)(Q,ne)},null,8,["name","placeholder","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(N)(Q)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:ne=>t.unref(o).removeAttribute(t.unref(i).modelId,Q.modelId)},null,8,["onClick"])],8,mV)]),Q.type===t.unref(_n)&&!t.unref(V)(Q)?(t.openBlock(),t.createElementBlock("div",fV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`attr-customtype-${Q.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.customTypePlaceholder"),"model-value":Q.customType??"","onUpdate:modelValue":ne=>t.unref(T)(Q,ne)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(m)(Q)?(t.openBlock(),t.createElementBlock("div",pV,[t.createElementVNode("div",hV,[t.createElementVNode("span",yV,t.toDisplayString(t.unref(o).t("em.attr.assocField")),1),t.createElementVNode("div",gV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`attr-assocname-${Q.modelId}`,width:"100%",title:t.unref(o).t("em.attr.derivedIdNote"),placeholder:t.unref(o).t("em.attr.namePlaceholder"),"model-value":t.unref(g)(Q),"onUpdate:modelValue":ne=>t.unref(b)(Q,ne)},null,8,["name","title","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("p",bV,t.toDisplayString(t.unref(o).t("em.attr.derivedIdNote")),1)])])):t.createCommentVNode("",!0),Q.attrType==="RELATION_REF"?(t.openBlock(),t.createElementBlock("p",_V,t.toDisplayString(t.unref(o).t("em.attr.inverseNavHint")),1)):t.createCommentVNode("",!0),t.unref(r)?(t.openBlock(),t.createElementBlock("p",kV,t.toDisplayString(t.unref(o).t("em.attr.serializedNoColumnNote")),1)):t.unref(ue)(Q)?(t.openBlock(),t.createElementBlock("div",$V,[t.unref(z)(Q)?(t.openBlock(),t.createElementBlock("p",TV,t.toDisplayString(t.unref(o).t("em.attr.fkDerivedNote")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Q.dbAttrs,(ne,xe)=>{var Be,qe,je,Ie,Je,j,K,ve;return t.openBlock(),t.createElementBlock("div",{key:ne.modelId,class:"em-embed-col"},[t.createElementVNode("span",MV,t.toDisplayString(((Be=t.unref(X)(Q,xe))==null?void 0:Be.name)??((qe=t.unref(X)(Q,xe))==null?void 0:qe.physicalName)??t.unref(o).t("em.attr.colFallback",{n:xe+1})),1),t.createElementVNode("div",VV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`embed-col-${ne.modelId}`,width:"100%",disabled:t.unref(Le)(ne),placeholder:((je=t.unref(X)(Q,xe))==null?void 0:je.physicalName)??t.unref(o).t("em.attr.columnPlaceholder"),"model-value":t.unref(Le)(ne)?t.unref(dt)(ne):ne.physicalName,"onUpdate:modelValue":Re=>t.unref(L)(Q,xe,{physicalName:Re})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(Ne)(Q)},[t.createVNode(t.unref(oe.BSTextInput),{name:`embed-dtype-${ne.modelId}`,width:"84px",disabled:"","model-value":t.unref(ee)(Q,xe)},null,8,["name","model-value"])],8,BV),t.createElementVNode("span",{title:t.unref(Ne)(Q)},[t.createVNode(t.unref(oe.BSNumberInput),{name:`embed-len-${ne.modelId}`,width:"48px",disabled:"","model-value":t.unref(ke)(Q,xe)},null,8,["name","model-value"])],8,DV),t.createElementVNode("span",{title:t.unref(Ne)(Q)},[t.createVNode(t.unref(oe.BSNumberInput),{name:`embed-scale-${ne.modelId}`,width:"48px",disabled:"","model-value":t.unref(ye)(Q,xe)},null,8,["name","model-value"])],8,OV)]),t.createVNode(vo,{controller:t.unref(o),"ref-id":ne.modelId},null,8,["controller","ref-id"]),t.createElementVNode("div",LV,[t.createVNode(Qt,{class:"grow",name:`embed-logical-${ne.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,placeholder:((Je=(Ie=t.unref(X)(Q,xe))==null?void 0:Ie.logicalName)==null?void 0:Je[t.unref(o).userLanguage.value])??((K=(j=t.unref(X)(Q,xe))==null?void 0:j.logicalName)==null?void 0:K.ko)??t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":ne.logicalName,"onUpdate:modelValue":Re=>t.unref(F)(Q,xe,Re)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),(ve=t.unref(X)(Q,xe))!=null&&ve.shareable?(t.openBlock(),t.createElementBlock("label",PV,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.currencyColumn")),1),t.createVNode(t.unref(oe.BSSelect),{width:"110px","model-value":t.unref(te)(ne),items:t.unref(Ge)(),"value-provider":t.unref(d),"label-provider":t.unref(et),"onUpdate:modelValue":Re=>Re&&t.unref(de)(Q,xe,Re)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(Le)(ne)?(t.openBlock(),t.createElementBlock("p",zV,t.toDisplayString(t.unref(o).t("em.attr.embedSharedHint")),1)):t.createCommentVNode("",!0),t.createElementVNode("label",FV,[Ze[3]||(Ze[3]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"110px",disabled:t.unref(Le)(ne),"model-value":t.unref(Le)(ne)?"false":t.unref(Fe)(ne),items:t.unref($e),"value-provider":t.unref(d),"label-provider":t.unref(ze),"onUpdate:modelValue":Re=>Re&&t.unref(ae)(Q,xe,Re)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",UV,[Ze[4]||(Ze[4]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"110px",disabled:t.unref(Le)(ne),"model-value":t.unref(Le)(ne)?"false":t.unref(q)(ne),items:t.unref(we),"value-provider":t.unref(d),"label-provider":t.unref(G),"onUpdate:modelValue":Re=>Re&&t.unref(W)(Q,xe,Re)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])])])}),128)),t.unref(z)(Q)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",HV,[t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-pk-${Q.modelId}`,label:"Primary Key","model-value":Q.identifier,disabled:"","onUpdate:modelValue":ne=>t.unref(E)(Q,ne)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-nn-${Q.modelId}`,label:"Not Null","model-value":Q.notNull,disabled:"","onUpdate:modelValue":ne=>t.unref(u)(Q,{notNull:ne})},null,8,["name","model-value","onUpdate:modelValue"])]),t.createElementVNode("fieldset",jV,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`attr-desc-${Q.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":Q.description,"onUpdate:modelValue":ne=>t.unref(M)(Q,ne)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[t.unref(V)(Q)?(t.openBlock(),t.createElementBlock("p",EV,t.toDisplayString(t.unref(o).t("em.attr.fkDerivedNote")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",NV,[t.createVNode(Qt,{class:"grow",name:`attr-logical-${Q.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,placeholder:t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":(Mt=Q.dbAttrs[0])==null?void 0:Mt.logicalName,"onUpdate:modelValue":ne=>t.unref(B)(Q,ne)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("div",wV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`attr-col-${Q.modelId}`,width:"100%",placeholder:t.unref($)(Q)??t.unref(o).t("em.attr.columnPlaceholder"),disabled:t.unref(A)(Q),"model-value":((Vt=Q.dbAttrs[0])==null?void 0:Vt.physicalName)??"","onUpdate:modelValue":ne=>t.unref(w)(Q,{physicalName:ne})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSSelect),{name:`attr-dtype-${Q.modelId}`,width:"84px",placeholder:"dataType",disabled:t.unref(A)(Q)||t.unref(V)(Q),items:t.unref(Dc)(((Mn=Q.dbAttrs[0])==null?void 0:Mn.dataType)??"",t.unref(o).selectableDataTypes.value),"value-provider":t.unref(d),"label-provider":t.unref(Qr),"model-value":((an=Q.dbAttrs[0])==null?void 0:an.dataType)??"","onUpdate:modelValue":ne=>ne&&t.unref(w)(Q,{dataType:ne})},null,8,["name","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSNumberInput),{name:`attr-len-${Q.modelId}`,width:"48px",placeholder:"len",disabled:t.unref(A)(Q)||t.unref(V)(Q),"model-value":(be=Q.dbAttrs[0])==null?void 0:be.length,"onUpdate:modelValue":ne=>t.unref(w)(Q,{length:ne||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(v)(Q)},[t.createVNode(t.unref(oe.BSNumberInput),{name:`attr-scale-${Q.modelId}`,width:"48px",placeholder:"scale",disabled:t.unref(A)(Q)||t.unref(V)(Q)||!t.unref(I)(Q),"model-value":(mt=Q.dbAttrs[0])==null?void 0:mt.scale,"onUpdate:modelValue":ne=>t.unref(w)(Q,{scale:ne||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,IV)]),t.createVNode(vo,{controller:t.unref(o),"ref-id":(vt=Q.dbAttrs[0])==null?void 0:vt.modelId},null,8,["controller","ref-id"]),t.createElementVNode("div",vV,[t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-pk-${Q.modelId}`,label:"Primary Key","model-value":Q.identifier,disabled:t.unref(a)||t.unref(A)(Q)||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(E)(Q,ne)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-nn-${Q.modelId}`,label:"Not Null","model-value":Q.notNull,disabled:t.unref(A)(Q)||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(u)(Q,{notNull:ne})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-uq-${Q.modelId}`,label:"Unique","model-value":!!((D=Q.dbAttrs[0])!=null&&D.unique),disabled:t.unref(A)(Q)||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(w)(Q,{unique:ne})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-ai-${Q.modelId}`,label:"Auto Increment","model-value":!!((U=Q.dbAttrs[0])!=null&&U.autoIncrement),disabled:t.unref(A)(Q)||t.unref(V)(Q)||!Q.identifier,"onUpdate:modelValue":ne=>t.unref(w)(Q,{autoIncrement:ne})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-tr-${Q.modelId}`,label:"@Transient","model-value":!!Q.transient,disabled:Q.identifier||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(S)(Q,ne)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-nid-${Q.modelId}`,label:"@NaturalId","model-value":!!Q.naturalId,disabled:Q.identifier||t.unref(A)(Q)||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(y)(Q,ne)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{class:"em-attr__flag-sub",name:`attr-nidm-${Q.modelId}`,label:"mutable","model-value":!!Q.naturalIdMutable,disabled:t.unref(A)(Q)||!Q.naturalId,"onUpdate:modelValue":ne=>t.unref(u)(Q,{naturalIdMutable:ne||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-mv-${Q.modelId}`,label:"Multi-Value (Set)","model-value":!!((le=Q.dbAttrs[0])!=null&&le.multiValue),disabled:t.unref(A)(Q)||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(w)(Q,{multiValue:ne||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),t.createElementVNode("label",CV,[Ze[1]||(Ze[1]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"100%",disabled:t.unref(A)(Q),"model-value":t.unref(Fe)(Q.dbAttrs[0]),items:t.unref($e),"value-provider":t.unref(d),"label-provider":t.unref(ze),"onUpdate:modelValue":ne=>ne&&t.unref(Se)(Q,ne)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",SV,[Ze[2]||(Ze[2]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"100%",disabled:t.unref(A)(Q),"model-value":t.unref(q)(Q.dbAttrs[0]),items:t.unref(we),"value-provider":t.unref(d),"label-provider":t.unref(G),"onUpdate:modelValue":ne=>ne&&t.unref(Ce)(Q,ne)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.unref(V)(Q)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",xV,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createVNode(t.unref(oe.BSSelect),{width:"100%","model-value":t.unref(x)(Q),items:t.unref(s),"value-provider":t.unref(d),"label-provider":t.unref(c),"onUpdate:modelValue":ne=>ne&&t.unref(P)(Q,ne)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])),t.unref(fe).length&&!t.unref(V)(Q)?(t.openBlock(),t.createElementBlock("label",RV,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.codeGroup")),1),t.createVNode(dp,{"model-value":Q.groupCode,items:t.unref(fe),locale:t.unref(o).uiLocale.value,"onUpdate:modelValue":ne=>t.unref(De)(Q,ne)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(V)(Q)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",{key:3,class:t.normalizeClass(["em-attr__pii",{"em-attr__codetop":!t.unref(fe).length}])},[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.defaultValue")),1),t.unref(pe)(Q).length?(t.openBlock(),t.createBlock(t.unref(oe.BSSelect),{key:0,width:"100%","model-value":Q.defaultValue??"none",items:t.unref(ge)(Q),"value-provider":t.unref(Te),"label-provider":t.unref(He),"onUpdate:modelValue":ne=>ne&&t.unref(Z)(Q,ne)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])):(t.openBlock(),t.createBlock(t.unref(oe.BSTextInput),{key:1,name:`attr-default-${Q.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.defaultValue"),"model-value":Q.defaultValue??"","onUpdate:modelValue":ne=>t.unref(re)(Q,ne)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))],2)),t.createElementVNode("fieldset",AV,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`attr-desc-${Q.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":Q.description,"onUpdate:modelValue":ne=>t.unref(M)(Q,ne)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)),t.createElementVNode("div",KV,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":Ae(Q)===null}]),title:t.unref(o).t("em.swatch.none"),onClick:ne=>H(Q,null)},"∅",10,GV),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),ne=>(t.openBlock(),t.createElementBlock("button",{key:ne,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":Ae(Q)===ne}]),style:t.normalizeStyle({background:t.unref(ei)(ne)}),title:t.unref(o).t(t.unref(Io)(ne)),onClick:xe=>H(Q,ne)},null,14,YV))),128)),Ee(Q)?(t.openBlock(),t.createElementBlock("span",qV,t.toDisplayString(t.unref(o).t("em.attr.batchHint",{n:t.unref(l).size})),1)):t.createCommentVNode("",!0)])],10,cV)}),128))],8,eV)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-0ece25e9"]]),JV=["disabled"],XV={class:"em-panel__sub-label"},ZV={class:"em-attr__row"},QV={class:"em-field em-idx-params"},eB=["value","placeholder","onChange"],tB=Qe(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(E=>E.modelId===o.entityId)??null),l=t.computed(()=>r.value?ci(r.value,a.superClassCatalog.value):[]),s=t.computed(()=>{var E;return Jn(((E=r.value)==null?void 0:E.attributes)??[])}),c=E=>s.value.canon(E),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(()=>[...pp(d.value).map(E=>({value:E.ref,label:E.label})),...l.value.map(E=>({value:E.modelId,label:a.t("em.index.inherited",{field:E.field})}))]);function m(E,S){var O;const A=new Set(E.columns.filter((C,R)=>R!==S).map(C=>c(C.columnRef))),V=u.value.filter(C=>!A.has(c(C.value))),$=(O=E.columns[S])==null?void 0:O.columnRef;return $&&!V.some(C=>C.value===$)&&V.push({value:$,label:p($)}),V}function p(E){return Vs(E,d.value)}function f(E){const S=new Set(E.columns.map(A=>c(A.columnRef)));return u.value.filter(A=>!S.has(c(A.value)))}function h(){var S;if(!r.value)return;const E=u.value[0];a.addIndex(r.value.modelId,{modelId:Pe(),name:`idx_${(((S=r.value.indexes)==null?void 0:S.length)??0)+1}`,unique:!1,columns:E?[{columnRef:E.value,descending:!1}]:[]})}function g(E,S){r.value&&a.updateIndex(r.value.modelId,E,S)}function b(E){const S=f(E)[0];S&&g(E.modelId,{columns:[...E.columns,{columnRef:S.value,descending:!1}]})}function _(E,S,A){g(E.modelId,{columns:E.columns.map((V,$)=>$===S?{...V,columnRef:A}:V)})}function k(E,S,A){g(E.modelId,{columns:E.columns.map((V,$)=>$===S?{...V,descending:A}:V)})}function N(E,S){g(E.modelId,{columns:E.columns.filter((A,V)=>V!==S)})}function y(E,S){g(E.modelId,{parameters:S.trim()===""?void 0:S})}return(E,S)=>{var A;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]=V=>e.collapsible&&i("toggle"))},[t.createElementVNode("span",XV,[e.collapsible?(t.openBlock(),t.createBlock(Ve,{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:((A=r.value.indexes)==null?void 0:A.length)??0})),1)]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(a).t("em.common.add"),onClick:t.withModifiers(h,["stop"])},null,8,["caption"])],2),!e.collapsible||!e.collapsed?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(r.value.indexes??[],V=>(t.openBlock(),t.createElementBlock("div",{key:V.modelId,class:"em-attr"},[t.createElementVNode("div",ZV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`idx-name-${V.modelId}`,width:"100%",placeholder:t.unref(a).t("em.index.namePlaceholder"),"model-value":V.name,"onUpdate:modelValue":$=>g(V.modelId,{name:$})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`idx-uq-${V.modelId}`,class:"em-check",label:"UQ","model-value":V.unique,"onUpdate:modelValue":$=>g(V.modelId,{unique:$})},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:$=>t.unref(a).removeIndex(r.value.modelId,V.modelId)},null,8,["onClick"])]),t.createVNode(vo,{controller:t.unref(a),"ref-id":V.modelId},null,8,["controller","ref-id"]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.columns,($,O)=>(t.openBlock(),t.createElementBlock("div",{key:O,class:"em-attr__row"},[t.createVNode(t.unref(oe.BSSelect),{class:"grow","model-value":$.columnRef,items:m(V,O),"value-provider":C=>C.value,"label-provider":C=>C.label,"onUpdate:modelValue":C=>C&&_(V,O,C)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`idx-${V.modelId}-desc-${O}`,class:"em-check",label:"DESC","model-value":$.descending,"onUpdate:modelValue":C=>k(V,O,C)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:"−",onClick:C=>N(V,O)},null,8,["onClick"])]))),128)),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(a).t("em.index.addColumn"),disabled:!f(V).length,onClick:$=>b(V)},null,8,["caption","disabled","onClick"]),t.createElementVNode("label",QV,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.index.condition")),1),t.createElementVNode("textarea",{class:"em-textarea",value:V.parameters??"",rows:"2",placeholder:t.unref(a).t("em.index.conditionPlaceholder"),onChange:$=>y(V,$.target.value)},null,40,eB)])]))),128)):t.createCommentVNode("",!0)],8,JV)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-ee0032b1"]]),nB=["disabled"],oB={class:"em-panel__sub-label"},iB={class:"em-attr__row"},aB={class:"em-attr__row"},rB={class:"em-multilang"},lB={class:"em-attr__pii"},sB={class:"em-swatch__row em-attr__swatch"},cB=["title","onClick"],dB=["title","onClick"],uB=Qe(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=oe.useModal(),l=t.computed(()=>a.state.logical.entities.find(N=>N.modelId===o.entityId)??null),s=t.computed(()=>l.value?a.state.layout.entityLayouts.find(N=>N.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(N){return N==="none"?a.t("em.common.noneParen"):N}const m=N=>N;function p(N,y){l.value&&a.updateOperation(l.value.modelId,N.modelId,y)}function f(N,y){p(N,{description:Object.keys(y).length?y:void 0})}function h(N){return N.personalInfoAttributeType??"none"}function g(N,y){p(N,{personalInfoAttributeType:y==="none"?void 0:y})}function b(N){var y,E;return $t((E=(y=s.value)==null?void 0:y.operationStyles)==null?void 0:E[N.modelId])}function _(N,y){l.value&&a.setOperationSwatch(l.value.modelId,N.modelId,y)}function k(N){r.openModal({component:hp,bind:{operationName:N.name,sourceCode:N.sourceCode??"",locale:a.uiLocale.value,onSave:y=>p(N,{sourceCode:y})}})}return(N,y)=>{var E;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:y[1]||(y[1]=S=>e.collapsible&&i("toggle"))},[t.createElementVNode("span",oB,[e.collapsible?(t.openBlock(),t.createBlock(Ve,{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:((E=l.value.operations)==null?void 0:E.length)??0})),1)]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(a).t("em.common.add"),onClick:y[0]||(y[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",iB,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`op-name-${S.modelId}`,width:"100%",placeholder:t.unref(a).t("em.op.namePlaceholder"),"model-value":S.name,"onUpdate:modelValue":A=>p(S,{name:A})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSSelect),{width:"96px","model-value":S.visibility??"PACKAGE",items:c,"value-provider":m,"label-provider":m,"onUpdate:modelValue":A=>A&&p(S,{visibility:A})},null,8,["model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:A=>t.unref(a).removeOperation(l.value.modelId,S.modelId)},null,8,["onClick"])]),t.createElementVNode("div",aB,[t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(a).t(S.sourceCode?"em.op.editBodyDirty":"em.op.editBody"),onClick:A=>k(S)},null,8,["caption","onClick"])]),t.createElementVNode("fieldset",rB,[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":A=>f(S,A)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])]),t.createElementVNode("label",lB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.attr.pii")),1),t.createVNode(t.unref(oe.BSSelect),{width:"100%","model-value":h(S),items:d,"value-provider":m,"label-provider":u,"onUpdate:modelValue":A=>A&&g(S,A)},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("div",sB,[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:A=>_(S,null)},"∅",10,cB),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),A=>(t.openBlock(),t.createElementBlock("button",{key:A,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":b(S)===A}]),style:t.normalizeStyle({background:t.unref(ei)(A)}),title:t.unref(a).t(t.unref(Io)(A)),onClick:V=>_(S,A)},null,14,dB))),128))])]))),128)):t.createCommentVNode("",!0)],8,nB)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-04208206"]]),mB=["title"],fB={class:"em-panel__head"},pB={class:"em-panel__head-row"},hB=["title"],yB={class:"em-panel__context"},gB={key:0,class:"em-panel__lock"},bB=["disabled"],_B={key:0,class:"em-attr__navhint"},kB={key:0,class:"em-panel__note"},EB={key:1,class:"em-panel__note"},NB={key:2,class:"em-jpa"},wB={class:"em-field"},IB={class:"em-field"},vB={class:"em-field"},CB={key:0,class:"em-field"},SB={class:"em-panel__note"},xB={class:"em-panel__sub"},RB={class:"em-field"},AB={class:"em-field"},$B={class:"em-jpa"},TB={key:0,class:"em-panel__note"},MB={key:1,class:"em-panel__note"},VB={class:"em-jpa"},BB={class:"em-field"},DB={key:0,class:"em-panel__note"},OB={class:"em-field"},LB={class:"em-multilang"},PB={class:"em-field"},zB=["value"],FB={class:"em-field"},UB={class:"em-swatch"},HB={class:"em-swatch__row"},jB=["title"],KB=["title","onClick"],GB={class:"em-panel__note"},YB={class:"em-field"},qB=["value"],WB={class:"em-swatch"},JB={class:"em-swatch__row"},XB=["title"],ZB=["title","onClick"],iy=Qe(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 G;return(G=r.value)==null?void 0:G.focus()}});const l=i.controller,s=t.computed(()=>l.selection.value),c=t.computed(()=>l.inspectedEntityId.value),d=t.computed(()=>{const G=c.value;return G?l.state.logical.entities.find(q=>q.modelId===G)??null:null}),u=t.computed(()=>{const G=s.value;if((G==null?void 0:G.kind)==="association")return l.isAssociationLocked(G.id);const q=c.value;return!!q&&l.isEntityLocked(q)}),m=t.computed(()=>{var G;return((G=l.selectedAttr.value)==null?void 0:G.attrId)??null}),p=t.computed(()=>new Set(l.selectedAttrIds.value)),f=t.computed(()=>m.value!==null),h=t.ref({});t.watch(f,()=>{h.value={}});function g(G){return h.value[G]??f.value}function b(G){h.value={...h.value,[G]:!g(G)}}const _=t.computed(()=>{var W;const G=d.value;if(!G)return l.t("em.entity.fallback");const q=(W=G.table)==null?void 0:W.physicalName;return q?`${G.name} (${q})`:G.name}),k=t.computed(()=>{const G=s.value;return(G==null?void 0:G.kind)==="association"?l.state.logical.associations.find(q=>q.modelId===G.id)??null:null}),N=t.computed(()=>{const G=s.value;return(G==null?void 0:G.kind)==="group"?l.state.logical.groups.find(q=>q.modelId===G.id)??null:null}),y=t.computed(()=>{const G=s.value;return(G==null?void 0:G.kind)==="note"?l.state.layout.notes.find(q=>q.modelId===G.id)??null:null}),E=t.computed(()=>{var q,W;const G=(q=N.value)==null?void 0:q.name;return(G==null?void 0:G[l.userLanguage.value])||(G==null?void 0:G.ko)||(G==null?void 0:G.en)||(G==null?void 0:G.ja)||(G==null?void 0:G.zh)||((W=N.value)==null?void 0:W.packageName)||l.t("em.group.fallback")}),S=t.computed(()=>{if(d.value){const G=p.value.size;if(G>1)return l.t("em.inspector.ctxEntityAttrs",{name:d.value.name,n:G});if(m.value){const q=d.value.attributes.find(W=>W.modelId===m.value);return(q==null?void 0:q.attrType)==="DIVIDER"?l.t("em.inspector.ctxEntityDivider",{name:d.value.name}):l.t("em.inspector.ctxEntityAttr",{name:d.value.name,attr:(q==null?void 0:q.name)??""})}return l.t("em.inspector.ctxEntity",{name:d.value.name})}if(k.value){const G=q=>{var W;return((W=l.state.logical.entities.find(Ce=>Ce.modelId===q))==null?void 0:W.name)??q};return l.t("em.inspector.ctxAssoc",{a:G(k.value.end1.entityRef),b:G(k.value.end2.entityRef)})}return N.value?l.t("em.inspector.ctxGroup",{name:E.value}):y.value?l.t("em.inspector.ctxNote"):l.t("em.inspector.ctxNone")}),A=["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"],V=["EXACTLY_ONE_INSTANCE","NO_INSTANCE_OR_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES"],$={EXACTLY_ONE_INSTANCE:"em.embed.card1",NO_INSTANCE_OR_ONE_INSTANCE:"em.embed.card01",ZERO_OR_MORE_INSTANCES:"em.embed.card0N"},O=G=>{const q=$[G];return q?l.t(q):G},C=G=>{var q;return((q=l.state.logical.entities.find(W=>W.modelId===G))==null?void 0:q.name)??G},R=["ALL","PERSIST","MERGE","REMOVE","REFRESH","DETACH"],T=["LIST","SET"],w=["inherit","LAZY","EAGER"],I=G=>G;function v(G){return G==="inherit"?l.t("em.common.inherit"):G}const B=t.computed(()=>!!k.value&&k.value.end1.entityRef===k.value.end2.entityRef);function M(G,q){k.value&&l.updateAssociationEnd(k.value.modelId,G,q)}function x(G){return Z.value?G:G==="end1"?"end2":"end1"}function P(G){var $e;const q=($e=k.value)==null?void 0:$e[G];if(!(q!=null&&q.attributeRef))return;const W=l.state.logical.entities.find(ze=>ze.modelId===q.entityRef),Ce=W==null?void 0:W.attributes.find(ze=>ze.modelId===q.attributeRef);return Ce&&(Ce.attrType==="RELATION_OWN"||Ce.attrType==="RELATION_REF")?Ce.name:void 0}function Y(G,q){var Ce;const W=(Ce=k.value)==null?void 0:Ce[G];W!=null&&W.attributeRef&&l.updateAttribute(W.entityRef,W.attributeRef,{name:q})}function se(G){var ze;const q=P(G);if(q!==void 0)return q;const W=(ze=k.value)==null?void 0:ze[G];if(W!=null&&W.navFieldNameHint)return W.navFieldNameHint;const Ce=G==="end1"?"end2":"end1",$e=l.state.logical.entities.find(Fe=>{var ae;return Fe.modelId===((ae=k.value)==null?void 0:ae[Ce].entityRef)});return $e?da($e.name,sa(k.value[Ce].multiplicity)):""}function he(G){return!!Z.value||P(G)!==void 0}function ie(G){k.value&&!B.value&&l.setAssociationIdentifying(k.value.modelId,G)}function fe(G){var q,W,Ce;return!!((Ce=(W=(q=k.value)==null?void 0:q[G].jpa)==null?void 0:W.cascadeTypes)!=null&&Ce.includes("ALL"))}function pe(G,q,W){var ze,Fe;const Ce=(ze=k.value)==null?void 0:ze[G];if(q==="ALL"&&W){M(G,{jpa:{...Ce==null?void 0:Ce.jpa,cascadeTypes:["ALL"]}});return}const $e=new Set(((Fe=Ce==null?void 0:Ce.jpa)==null?void 0:Fe.cascadeTypes)??[]);W?$e.add(q):$e.delete(q),M(G,{jpa:{...Ce==null?void 0:Ce.jpa,cascadeTypes:[...$e]}})}function ge(G,q){var Ce;const W=(Ce=k.value)==null?void 0:Ce[G];M(G,{jpa:{...W==null?void 0:W.jpa,...q}})}function Te(G){var q,W;return((W=(q=k.value)==null?void 0:q[G].jpa)==null?void 0:W.fetchType)??"inherit"}function He(G,q){ge(G,{fetchType:q==="inherit"?void 0:q})}function De(G){var W;const q=(W=k.value)==null?void 0:W[G==="end1"?"end2":"end1"];return(q==null?void 0:q.multiplicity)==="ZERO_OR_MORE_INSTANCES"||(q==null?void 0:q.multiplicity)==="ONE_OR_MORE_INSTANCES"}const Z=t.computed(()=>{const G=k.value;if(!G)return null;for(const q of l.state.logical.entities){const W=q.attributes.find(Fe=>{var ae;return((ae=Fe.embedded)==null?void 0:ae.associationRef)===G.modelId&&Fe.attrType==="EMBED_OWN"});if(!W)continue;const Ce=G.end2.entityRef===W.embedded.embeddableRef?"end2":"end1",$e=G[Ce].multiplicity,ze=G[Ce].jpa;return{which:Ce,cardinality:$e,isCollection:$e==="ZERO_OR_MORE_INSTANCES"||$e==="ONE_OR_MORE_INSTANCES",collectionType:(ze==null?void 0:ze.collectionType)??"LIST",collectionTable:(ze==null?void 0:ze.collectionTable)??"",orderColumn:(ze==null?void 0:ze.orderColumn)??""}}return null});function re(G){k.value&&l.setEmbedCardinality(k.value.modelId,G)}function ue(G){const q=Z.value;q&&ge(q.which,G==="SET"?{collectionType:"SET",orderColumn:void 0}:{collectionType:"LIST"})}function z(G){const q=Z.value;q&&ge(q.which,{collectionTable:G.trim()||void 0})}function L(G){const q=Z.value;q&&ge(q.which,{orderColumn:G.trim()||void 0})}function F(G){N.value&&l.updateGroup(N.value.modelId,G)}function X(G,q){var W;F({name:{...(W=N.value)==null?void 0:W.name,[G]:q}})}const ee=t.computed(()=>{var G;return N.value?$t((G=l.state.layout.groupLayouts.find(q=>q.groupRef===N.value.modelId))==null?void 0:G.style):null});function ke(G){N.value&&l.setGroupSwatch(N.value.modelId,G)}function ye(G){y.value&&l.setNoteMemo(y.value.modelId,G)}const Ne=t.computed(()=>{var G;return $t((G=y.value)==null?void 0:G.style)});function we(G){y.value&&l.setNoteSwatch(y.value.modelId,G)}return(G,q)=>(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:q[0]||(q[0]=(...W)=>e.startResize&&e.startResize(...W))},null,42,mB),t.createElementVNode("header",fB,[t.createElementVNode("div",pB,[q[14]||(q[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:q[1]||(q[1]=W=>a("collapse"))},[t.createVNode(Ve,{name:"panel-right-close",size:16})],8,hB)]),t.createElementVNode("p",yB,t.toDisplayString(S.value),1),u.value&&c.value?(t.openBlock(),t.createElementBlock("div",gB,[t.createVNode(Ve,{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:q[2]||(q[2]=W=>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(op,{controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("basics"),title:_.value,onToggle:q[3]||(q[3]=W=>b("basics"))},null,8,["controller","entity-id","collapsed","title"]),t.createVNode(WV,{controller:t.unref(l),"entity-id":d.value.modelId},null,8,["controller","entity-id"]),t.unref(hn)(d.value.stereotype)?(t.openBlock(),t.createElementBlock("p",_B,t.toDisplayString(t.unref(l).t("em.entity.noIndexNote")),1)):(t.openBlock(),t.createBlock(tB,{key:1,controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("index"),onToggle:q[4]||(q[4]=W=>b("index"))},null,8,["controller","entity-id","collapsed"])),t.createVNode(uB,{controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("ops"),onToggle:q[5]||(q[5]=W=>b("ops"))},null,8,["controller","entity-id","collapsed"])],64)):t.createCommentVNode("",!0),k.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(t.unref(oe.BSCheckbox),{name:"assoc-identifying",class:"em-check",label:t.unref(l).t("em.assoc.identifying"),"model-value":!!k.value.identifying,disabled:B.value||!!Z.value,"onUpdate:modelValue":ie},null,8,["label","model-value","disabled"]),B.value?(t.openBlock(),t.createElementBlock("p",kB,t.toDisplayString(t.unref(l).t("em.assoc.selfNoIdentifying")),1)):Z.value?(t.openBlock(),t.createElementBlock("p",EB,t.toDisplayString(t.unref(l).t("em.assoc.embedNoIdentifying")),1)):t.createCommentVNode("",!0),Z.value?(t.openBlock(),t.createElementBlock("fieldset",NB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.embed.legend")),1),t.createElementVNode("label",wB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.embed.cardinality")),1),t.createVNode(t.unref(oe.BSSelect),{"model-value":Z.value.cardinality,items:V,"value-provider":I,"label-provider":O,"onUpdate:modelValue":q[6]||(q[6]=W=>W&&re(W))},null,8,["model-value"])]),Z.value.isCollection?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",IB,[q[15]||(q[15]=t.createElementVNode("span",null,"collectionType",-1)),t.createVNode(t.unref(oe.BSSelect),{"model-value":Z.value.collectionType,items:T,"value-provider":I,"label-provider":I,"onUpdate:modelValue":q[7]||(q[7]=W=>W&&ue(W))},null,8,["model-value"])]),t.createElementVNode("label",vB,[q[16]||(q[16]=t.createElementVNode("span",null,"collectionTable",-1)),t.createVNode(t.unref(oe.BSTextInput),{name:"embed-coll-table",width:"100%",placeholder:t.unref(l).t("em.embed.collectionTablePlaceholder"),"model-value":Z.value.collectionTable,"onUpdate:modelValue":z},null,8,["placeholder","model-value"])]),Z.value.collectionType==="LIST"?(t.openBlock(),t.createElementBlock("label",CB,[q[17]||(q[17]=t.createElementVNode("span",null,"orderColumn",-1)),t.createVNode(t.unref(oe.BSTextInput),{name:"embed-order-col",width:"100%",placeholder:t.unref(l).t("em.embed.orderColumnPlaceholder"),"model-value":Z.value.orderColumn,"onUpdate:modelValue":L},null,8,["placeholder","model-value"])])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0),t.createElementVNode("p",SB,t.toDisplayString(t.unref(l).t("em.embed.ownerFixedNote")),1)])):t.createCommentVNode("",!0),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(["end1","end2"],W=>{var Ce,$e,ze;return t.withDirectives(t.createElementVNode("div",{key:W,class:"em-end"},[t.createElementVNode("h4",xB,t.toDisplayString(W)+" → "+t.toDisplayString(C(k.value[W].entityRef)),1),Z.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",RB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.assoc.multiplicity")),1),t.createVNode(t.unref(oe.BSSelect),{"model-value":k.value[W].multiplicity,items:A,"value-provider":I,"label-provider":t.unref(ca),"onUpdate:modelValue":Fe=>M(W,{multiplicity:Fe})},null,8,["model-value","label-provider","onUpdate:modelValue"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:`${x(W)}-navigable`,class:"em-check",label:"navigable",title:x(W)==="end2"?t.unref(l).t("em.assoc.ownerNavFixed"):void 0,disabled:x(W)==="end2","model-value":x(W)==="end2"?!0:k.value[x(W)].navigable,"onUpdate:modelValue":Fe=>M(x(W),{navigable:Fe})},null,8,["name","title","disabled","model-value","onUpdate:modelValue"]),t.createElementVNode("label",AB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.assoc.navFieldName")),1),t.createVNode(t.unref(oe.BSTextInput),{name:`${x(W)}-navname`,width:"100%",disabled:!he(x(W)),placeholder:t.unref(l).t("em.attr.namePlaceholder"),"model-value":se(x(W)),"onUpdate:modelValue":Fe=>Y(x(W),Fe)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:`${x(W)}-composition`,class:"em-check",label:"composition","model-value":k.value[x(W)].composition,"onUpdate:modelValue":Fe=>M(x(W),{composition:Fe})},null,8,["name","model-value","onUpdate:modelValue"])],64)),t.createElementVNode("fieldset",$B,[q[18]||(q[18]=t.createElementVNode("legend",null,"cascade",-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(R,Fe=>{var ae,Se;return t.createVNode(t.unref(oe.BSCheckbox),{key:Fe,name:`${x(W)}-cascade-${Fe}`,class:"em-check",label:Fe,"model-value":!!((Se=(ae=k.value[x(W)].jpa)==null?void 0:ae.cascadeTypes)!=null&&Se.includes(Fe)),disabled:!he(x(W))||Fe!=="ALL"&&fe(x(W)),"onUpdate:modelValue":Ge=>pe(x(W),Fe,Ge)},null,8,["name","label","model-value","disabled","onUpdate:modelValue"])}),64)),he(x(W))?fe(x(W))?(t.openBlock(),t.createElementBlock("p",MB,t.toDisplayString(t.unref(l).t("em.assoc.cascadeAllNote")),1)):t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("p",TB,t.toDisplayString(t.unref(l).t("em.assoc.navRequiredNote")),1))]),t.createElementVNode("fieldset",VB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.assoc.jpaDetails")),1),t.createElementVNode("label",BB,[q[19]||(q[19]=t.createElementVNode("span",null,"fetchType",-1)),t.createVNode(t.unref(oe.BSSelect),{disabled:!he(x(W)),"model-value":Te(x(W)),items:w,"value-provider":I,"label-provider":v,"onUpdate:modelValue":Fe=>Fe&&He(x(W),Fe)},null,8,["disabled","model-value","onUpdate:modelValue"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:`${x(W)}-orphan`,class:"em-check",label:"orphanRemoval","model-value":!!((Ce=k.value[x(W)].jpa)!=null&&Ce.orphanRemoval),disabled:!he(x(W))||De(W),"onUpdate:modelValue":Fe=>ge(x(W),{orphanRemoval:Fe})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),De(W)&&(($e=k.value[x(W)].jpa)!=null&&$e.orphanRemoval)?(t.openBlock(),t.createElementBlock("p",DB,t.toDisplayString(t.unref(l).t("em.assoc.orphanRemovalNote")),1)):t.createCommentVNode("",!0),t.createElementVNode("label",OB,[q[20]||(q[20]=t.createElementVNode("span",null,"orderBy",-1)),t.createVNode(t.unref(oe.BSTextInput),{name:`${x(W)}-orderby`,width:"100%",disabled:!he(x(W)),placeholder:t.unref(l).t("em.assoc.orderByPlaceholder"),"model-value":((ze=k.value[x(W)].jpa)==null?void 0:ze.orderBy)??"","onUpdate:modelValue":Fe=>ge(x(W),{orderBy:Fe.trim()||void 0})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])])])]),[[t.vShow,!Z.value||W===Z.value.which]])}),64))],64)):t.createCommentVNode("",!0),N.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("fieldset",LB,[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,W=>{var Ce;return t.openBlock(),t.createElementBlock("label",{key:W,class:"em-lang"},[t.createElementVNode("span",null,t.toDisplayString(W),1),t.createVNode(t.unref(oe.BSTextInput),{name:`grp-name-${W}`,width:"100%","model-value":((Ce=N.value.name)==null?void 0:Ce[W])??"","onUpdate:modelValue":$e=>X(W,$e)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),t.createElementVNode("label",PB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.common.description")),1),t.createElementVNode("textarea",{class:"em-textarea",value:N.value.description??"",rows:"3",onChange:q[8]||(q[8]=W=>F({description:W.target.value}))},null,40,zB)]),t.createElementVNode("label",FB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.entity.package")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"grp-package",width:"100%","model-value":N.value.packageName??"","onUpdate:modelValue":q[9]||(q[9]=W=>F({packageName:W}))},null,8,["model-value"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:"grp-exclude-ddl",class:"em-check",label:t.unref(l).t("em.group.excludeDDL"),"model-value":N.value.excludeDDLGeneration,"onUpdate:modelValue":q[10]||(q[10]=W=>F({excludeDDLGeneration:W}))},null,8,["label","model-value"]),t.createElementVNode("fieldset",UB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.common.color")),1),t.createElementVNode("div",HB,[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:q[11]||(q[11]=W=>ke(null))},"∅",10,jB),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),W=>(t.openBlock(),t.createElementBlock("button",{key:W,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":ee.value===W}]),style:t.normalizeStyle({background:t.unref(ei)(W)}),title:t.unref(l).t(t.unref(Io)(W)),onClick:Ce=>ke(W)},null,14,KB))),128))])]),t.createElementVNode("p",GB,t.toDisplayString(t.unref(l).t("em.group.members",{n:N.value.memberEntityRefs.length})),1)],64)):t.createCommentVNode("",!0),y.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createElementVNode("label",YB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.common.memo")),1),t.createElementVNode("textarea",{class:"em-textarea",value:y.value.memo,rows:"6",onChange:q[12]||(q[12]=W=>ye(W.target.value))},null,40,qB)]),t.createElementVNode("fieldset",WB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.common.color")),1),t.createElementVNode("div",JB,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":Ne.value===null}]),title:t.unref(l).t("em.swatch.none"),onClick:q[13]||(q[13]=W=>we(null))},"∅",10,XB),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),W=>(t.openBlock(),t.createElementBlock("button",{key:W,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":Ne.value===W}]),style:t.normalizeStyle({background:t.unref(ei)(W)}),title:t.unref(l).t(t.unref(Io)(W)),onClick:Ce=>we(W)},null,14,ZB))),128))])])],64)):t.createCommentVNode("",!0)],8,bB)],4))}}),[["__scopeId","data-v-d79a8574"]]),QB=["title"],eD={class:"em-validation__title"},tD=["title","onClick"],nD={key:0,class:"em-validation__body"},oD={class:"em-validation__opt"},iD={key:0,class:"em-validation__empty"},aD={key:1,class:"em-validation__empty"},rD={key:2,class:"em-validation__list"},lD=["onClick"],sD={class:"em-validation__item-msg"},cD={key:0,class:"em-validation__item-entity"},dD=["title","onClick"],uD=["title"],mD=Qe(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=_I(g);if(!b)return null;const _=a.value.get(b);return _===void 0?null:_.trim()===""?o.t("em.validation.nameless"):_}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:np(o.t,g),category:gI(o.t,g.ruleId)}))),m=t.ref(!1);function p(g){c.value[g]=!c.value[g]}function f(g){if(!m.value){m.value=!0;return}p(g)}function h(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]=_=>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(Ve,{name:"chevron",size:14,class:t.normalizeClass([{"is-open":m.value},"em-validation__chevron"])},null,8,["class"]),t.createElementVNode("span",eD,t.toDisplayString(t.unref(o).t("em.validation.title")),1)],8,QB),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"],_=>t.createElementVNode("button",{key:_,type:"button",class:t.normalizeClass(["em-validation__count",[`is-${_}`,{"is-off":!c.value[_]}]]),title:m.value?t.unref(o).t(c.value[_]?"em.validation.hideSeverity":"em.validation.showSeverity",{label:t.unref(o).t(l[_].labelKey)}):t.unref(o).t("em.validation.expandPanel"),onClick:k=>f(_)},[t.createVNode(Ve,{name:l[_].icon,size:14},null,8,["name"]),t.createElementVNode("span",null,t.toDisplayString(s.value[_]),1)],10,tD)),64))])]),m.value?(t.openBlock(),t.createElementBlock("div",nD,[t.createElementVNode("label",oD,[t.createVNode(t.unref(oe.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]=_=>t.unref(o).flagEntitiesWithoutRelations.value=_)},null,8,["label","model-value"])]),i.value.length===0?(t.openBlock(),t.createElementBlock("p",iD,t.toDisplayString(t.unref(o).t("em.validation.noIssues")),1)):d.value.length===0?(t.openBlock(),t.createElementBlock("p",aD,t.toDisplayString(t.unref(o).t("em.validation.noVisibleIssues")),1)):(t.openBlock(),t.createElementBlock("ul",rD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,({issue:_,entityName:k,message:N,category:y},E)=>(t.openBlock(),t.createElementBlock("li",{key:`${_.ruleId}:${_.targetRef??"model"}:${E}`,class:t.normalizeClass(["em-validation__item",[`is-${_.severity}`,{"is-clickable":!!_.targetRef}]]),onClick:S=>h(_)},[t.createVNode(Ve,{name:l[_.severity].icon,size:15,class:"em-validation__item-icon"},null,8,["name"]),t.createElementVNode("span",sD,[k?(t.openBlock(),t.createElementBlock("span",cD,t.toDisplayString(k),1)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(N),1)]),t.unref(o).hasQuickFix(_)?(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(_),["stop"])},t.toDisplayString(t.unref(o).t("em.validation.quickFix")),9,dD)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:"em-validation__item-cat",title:_.ruleId},t.toDisplayString(y),9,uD)],10,lD))),128))]))])):t.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-251fd3f0"]]),fD={class:"em-history"},pD={class:"em-history__head"},hD={class:"em-history__title"},yD={class:"em-history__head-actions"},gD=["title","disabled"],bD=["title"],_D={class:"em-history__filters"},kD={class:"em-history__filter"},ED={class:"em-history__filters em-history__filters--period"},ND={class:"em-history__filter-label"},wD=["title","aria-label","max"],ID=["title","aria-label","min"],vD=["title"],CD={key:0,class:"em-history__diffbar"},SD={class:"em-history__diffbar-range"},xD={class:"em-history__diffbar-count"},RD={class:"em-history__body"},AD={key:0,class:"em-history__empty"},$D={key:1,class:"em-history__diff-list"},TD=["onClick"],MD={class:"em-history__action-head"},VD={class:"em-history__action-name"},BD={key:0,class:"em-history__fields"},DD={class:"em-history__fname"},OD={key:0,class:"em-history__old"},LD={class:"em-history__val"},PD={key:1,class:"em-history__empty"},zD={key:2,class:"em-history__empty is-error"},FD={key:3,class:"em-history__empty"},UD={key:4,class:"em-history__list"},HD=["onClick"],jD={class:"em-history__summary"},KD={class:"em-history__seq"},GD={class:"em-history__gmeta"},YD={class:"em-history__who"},qD={key:0,class:"em-history__time"},WD={key:1,class:"em-history__restored-from"},JD=["onClick"],XD={key:0,class:"em-history__detail"},ZD={class:"em-history__action-head"},QD={class:"em-history__action-name"},eO={key:0,class:"em-history__fields"},tO={class:"em-history__fname"},nO={key:0,class:"em-history__old"},oO={class:"em-history__val"},iO={class:"em-history__preview"},aO=["disabled"],rO={key:0,class:"em-history__diff-list is-preview"},lO={class:"em-history__action-head"},sO={class:"em-history__action-name"},cO={key:0,class:"em-history__fields"},dO={class:"em-history__fname"},uO={key:0,class:"em-history__old"},mO={class:"em-history__val"},fO={class:"em-history__confirm-row"},pO={class:"em-history__confirm-msg"},hO=["disabled","onClick"],yO=["disabled"],gO=["onClick"],zr=50,bO=Qe(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((ae,Se)=>Se.seq>ae?Se.seq:ae,-1/0));async function u(ae){if(a.historyTransport){l.value=!0,s.value=null;try{const Se=!(ae!=null&&ae.full)&&r.value.length>0&&Number.isFinite(d.value),Ge=await a.historyTransport(Se?d.value:void 0);if(!Se)r.value=Ge;else if(Ge.length){const et=new Set(r.value.map(de=>de.seq)),te=Ge.filter(de=>!et.has(de.seq));te.length&&(r.value=[...r.value,...te])}c.value=!0}catch(Se){s.value=Se instanceof Error?Se.message:a.t("em.history.loadError")}finally{l.value=!1}}}async function m(){await a.whenOpsSettled(),await u()}const p=t.ref(null),f=t.ref(null);t.watch(()=>o.open,ae=>{ae?m():(p.value=null,f.value=null)},{immediate:!0});let h=null;t.watch(()=>a.revision.value,()=>{o.open&&(h&&clearTimeout(h),h=setTimeout(()=>void m(),500))}),t.watch(()=>a.reloadRequest.value,()=>{o.open&&m()});const g=t.computed(()=>new Map(a.state.logical.entities.map(ae=>[ae.modelId,ae]))),b=t.computed(()=>new Map(a.state.logical.associations.map(ae=>[ae.modelId,ae]))),_=t.computed(()=>{const ae=a.userLanguage.value;return new Map((a.state.logical.groups??[]).map(Se=>{var Ge,et;return[Se.modelId,Se.packageName||((Ge=Se.name)==null?void 0:Ge[ae])||((et=Se.name)==null?void 0:et.ko)||Se.modelId]}))});function k(ae){var te,de,Le,dt,Xe,yt,st;const Se=b.value.get(ae);if(!Se)return a.t("em.history.assocFallback");if((te=Se.description)!=null&&te.trim())return Se.description.trim();const Ge=(dt=(Le=g.value.get((de=Se.end1)==null?void 0:de.entityRef))==null?void 0:Le.name)==null?void 0:dt.trim(),et=(st=(yt=g.value.get((Xe=Se.end2)==null?void 0:Xe.entityRef))==null?void 0:yt.name)==null?void 0:st.trim();return Ge&&et?`${Ge}→${et}`:a.t("em.history.assocFallback")}function N(ae){var Se,Ge,et,te;if(ae.kind==="entity")return((Ge=(Se=g.value.get(ae.ref))==null?void 0:Se.name)==null?void 0:Ge.trim())||a.t("em.attr.nameless");if(ae.kind==="attribute"||ae.kind==="operation"||ae.kind==="index"){const de=ae.entityRef?g.value.get(ae.entityRef):void 0,dt=((ae.kind==="attribute"?de==null?void 0:de.attributes:ae.kind==="operation"?de==null?void 0:de.operations:de==null?void 0:de.indexes)??[]).find(yt=>yt.modelId===ae.ref),Xe=(et=de==null?void 0:de.name)==null?void 0:et.trim();return`${Xe?Xe+".":""}${((te=dt==null?void 0:dt.name)==null?void 0:te.trim())||ae.ref}`}return ae.kind==="association"?k(ae.ref):ae.kind==="associationEnd"?`${k(ae.ref)}(${ae.end})`:ae.kind==="group"?a.t("em.history.groupSubject",{name:_.value.get(ae.ref)??ae.ref}):ae.ref}const y={entity:"table",attribute:"field",operation:"method",index:"key",association:"link",associationEnd:"link",group:"folder"},E={add:"em.history.verbAdd",update:"em.history.verbUpdate",remove:"em.history.verbRemove"},S=t.ref("all"),A=[{v:"all",labelKey:"em.history.filterAll"},{v:"edit",labelKey:"em.history.kindEdit"},{v:"restore",labelKey:"em.history.kindRestore"}],V=t.computed({get:()=>S.value,set:ae=>{ae&&(S.value=ae)}}),$=t.computed(()=>$l(r.value)),O=t.computed(()=>$.value.length?$.value[0].seq:null),C=t.computed(()=>S.value==="all"?$.value:$.value.filter(ae=>(ae.kind??"edit")===S.value)),R=t.ref(zr),T=t.ref(""),w=t.ref(""),I=t.computed(()=>!!T.value||!!w.value);function v(){T.value="",w.value=""}const B=t.computed(()=>{const ae=T.value?new Date(`${T.value}T00:00:00`).getTime():null,Se=w.value?new Date(`${w.value}T23:59:59.999`).getTime():null;return ae==null&&Se==null?C.value:C.value.filter(Ge=>{if(Ge.ts==null)return!1;const et=new Date(Ge.ts).getTime();return!(isNaN(et)||ae!=null&&et<ae||Se!=null&&et>Se)})}),M=t.computed(()=>B.value.slice(0,R.value)),x=t.computed(()=>Math.max(0,B.value.length-R.value));function P(){R.value+=zr}t.watch([S,T,w],()=>{R.value=zr}),t.watch(()=>o.open,ae=>{ae&&(R.value=zr,v())});function Y(ae){return ae===void 0?"—":ae===null?a.t("em.history.emptyValue"):typeof ae=="object"?JSON.stringify(ae):String(ae)}function se(ae){const Se=N(ae.subject);if(ae.verb==="add")return a.t("em.history.summaryAdd",{name:Se});if(ae.verb==="remove")return a.t("em.history.summaryRemove",{name:Se});if(ae.fields.length===1){const Ge=ae.fields[0];return`${Se}.${Ge.field} ${Ge.oldValue!==void 0?Y(Ge.oldValue)+"→":""}${Y(Ge.value)}`}return a.t("em.history.summaryFields",{name:Se,n:ae.fields.length})}function he(ae){return ae.actions.length===0?a.t("em.history.noChange"):ae.actions.length===1?se(ae.actions[0]):a.t("em.history.summaryMore",{summary:se(ae.actions[0]),n:ae.actions.length-1})}const ie=t.ref(new Set);function fe(ae){const Se=new Set(ie.value);Se.has(ae)?Se.delete(ae):Se.add(ae),ie.value=Se}function pe(ae){if(ae==null)return"";const Se=new Date(ae);return isNaN(Se.getTime())?String(ae):Se.toLocaleString()}function ge(ae){const Se=ae.author,Ge=ae.origin;return Se&&Ge?`${Se}(${Ge})`:Se||(Ge?`(${Ge})`:"—")}const Te=t.computed(()=>p.value==null?null:Tl(r.value,{fromSeq:p.value,...f.value!=null?{toSeq:f.value}:{}}));t.watch(()=>Te.value?Rd(Te.value):null,ae=>i("diffChange",ae));function He(ae){p.value=ae,f.value=null,q.value=null}function De(){p.value=null,f.value=null}const Z=t.computed(()=>$.value.map(ae=>ae.seq)),re=t.computed(()=>O.value??1/0),ue=t.computed(()=>f.value??re.value),z=t.computed(()=>f.value??re.value),L=t.computed(()=>Z.value.filter(ae=>ae<ue.value).map(ae=>({v:ae}))),F=t.computed(()=>Z.value.filter(ae=>p.value!=null&&ae>p.value).map(ae=>({v:ae})));function X(ae){ae!=null&&(p.value=ae,f.value!=null&&f.value<=ae&&(f.value=null))}function ee(ae){ae!=null&&(f.value=ae>=re.value?null:ae)}function ke(ae){return ae>=re.value?a.t("em.history.diff.current"):`#${ae}`}function ye(ae){return ae.kind==="entity"?g.value.has(ae.ref)?ae.ref:null:(ae.kind==="attribute"||ae.kind==="operation"||ae.kind==="index")&&ae.entityRef?g.value.has(ae.entityRef)?ae.entityRef:null:ae.kind==="group"&&_.value.has(ae.ref)?ae.ref:null}function Ne(ae){const Se=ye(ae);Se&&a.requestFocus(Se)}const we={added:"em.history.verbAdd",modified:"em.history.verbUpdate",removed:"em.history.verbRemove"},G={added:"add",modified:"update",removed:"remove"},q=t.ref(null),W=t.ref(!1),Ce=t.computed(()=>q.value==null?null:Tl(r.value,{fromSeq:q.value})),$e=t.ref(!1);function ze(ae){q.value=ae,$e.value=!1}async function Fe(ae){W.value=!0;try{const Se=await a.restoreToSeq(ae);Se.ok?(p.value=null,f.value=null):s.value=a.t("em.history.restoreFailed",{reason:Se.reason??a.t("em.history.unknown")})}finally{W.value=!1,q.value=null}}return(ae,Se)=>(t.openBlock(),t.createBlock(t.Transition,{name:"em-history"},{default:t.withCtx(()=>{var Ge,et;return[t.withDirectives(t.createElementVNode("section",fD,[t.createElementVNode("header",pD,[t.createElementVNode("div",hD,[t.createVNode(Ve,{name:"undo",size:15}),t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.history.title")),1)]),t.createElementVNode("div",yD,[t.createElementVNode("button",{type:"button",class:"em-history__btn",title:t.unref(a).t("em.history.refresh"),disabled:l.value,onClick:Se[0]||(Se[0]=te=>u({full:!0}))},[t.createVNode(Ve,{name:"redo",size:15})],8,gD),t.createElementVNode("button",{type:"button",class:"em-history__btn",title:t.unref(a).t("em.common.close"),onClick:Se[1]||(Se[1]=te=>i("close"))},[t.createVNode(Ve,{name:"panel-close",size:15})],8,bD)])]),t.createElementVNode("div",_D,[t.createElementVNode("label",kD,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.toolbar.displayLabel")),1),t.createVNode(t.unref(oe.BSSelect),{modelValue:V.value,"onUpdate:modelValue":Se[2]||(Se[2]=te=>V.value=te),items:A,"value-provider":te=>te.v,"label-provider":te=>t.unref(a).t(te.labelKey)},null,8,["modelValue","value-provider","label-provider"])])]),t.createElementVNode("div",ED,[t.createElementVNode("span",ND,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:w.value||void 0,"onUpdate:modelValue":Se[3]||(Se[3]=te=>T.value=te)},null,8,wD),[[t.vModelText,T.value]]),Se[9]||(Se[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:T.value||void 0,"onUpdate:modelValue":Se[4]||(Se[4]=te=>w.value=te)},null,8,ID),[[t.vModelText,w.value]]),I.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-history__period-reset",title:t.unref(a).t("em.history.periodReset"),onClick:v},[t.createVNode(Ve,{name:"x",size:12})],8,vD)):t.createCommentVNode("",!0)]),p.value!=null?(t.openBlock(),t.createElementBlock("div",CD,[t.createElementVNode("div",SD,[t.createVNode(t.unref(oe.BSSelect),{class:"em-history__range-sel","model-value":p.value??void 0,items:L.value,"value-provider":te=>te.v,"label-provider":te=>`#${te.v}`,"onUpdate:modelValue":Se[5]||(Se[5]=te=>X(te??null))},null,8,["model-value","items","value-provider","label-provider"]),t.createVNode(Ve,{name:"arrow-lr",size:12,class:"em-history__diffbar-arrow"}),t.createVNode(t.unref(oe.BSSelect),{class:"em-history__range-sel","model-value":z.value,items:F.value,"value-provider":te=>te.v,"label-provider":te=>ke(te.v),"onUpdate:modelValue":Se[6]||(Se[6]=te=>ee(te??null))},null,8,["model-value","items","value-provider","label-provider"])]),t.createElementVNode("span",xD,t.toDisplayString(t.unref(a).t("em.history.diff.count",{n:((Ge=Te.value)==null?void 0:Ge.entries.length)??0})),1),t.createElementVNode("button",{type:"button",class:"em-history__diffbar-exit",onClick:De},t.toDisplayString(t.unref(a).t("em.history.diff.exit")),1)])):t.createCommentVNode("",!0),t.createElementVNode("div",RD,[p.value!=null?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[(et=Te.value)!=null&&et.entries.length?(t.openBlock(),t.createElementBlock("ul",$D,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Te.value.entries,(te,de)=>(t.openBlock(),t.createElementBlock("li",{key:de,class:t.normalizeClass(["em-history__diff-entry",{"is-focusable":!!ye(te.subject)}]),onClick:Le=>Ne(te.subject)},[t.createElementVNode("div",MD,[t.createVNode(Ve,{name:y[te.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",VD,t.toDisplayString(N(te.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${G[te.verb]}`])},t.toDisplayString(t.unref(a).t(we[te.verb])),3)]),te.fields.length?(t.openBlock(),t.createElementBlock("ul",BD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(te.fields,(Le,dt)=>(t.openBlock(),t.createElementBlock("li",{key:dt,class:"em-history__field"},[t.createElementVNode("span",DD,t.toDisplayString(Le.field),1),Le.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",OD,t.toDisplayString(Y(Le.oldValue)),1)):t.createCommentVNode("",!0),Le.oldValue!==void 0?(t.openBlock(),t.createBlock(Ve,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",LD,t.toDisplayString(Y(Le.value)),1)]))),128))])):t.createCommentVNode("",!0)],10,TD))),128))])):(t.openBlock(),t.createElementBlock("p",AD,t.toDisplayString(t.unref(a).t("em.history.diff.empty")),1))],64)):l.value&&!c.value?(t.openBlock(),t.createElementBlock("p",PD,t.toDisplayString(t.unref(a).t("em.history.loading")),1)):s.value?(t.openBlock(),t.createElementBlock("p",zD,t.toDisplayString(s.value),1)):B.value.length===0?(t.openBlock(),t.createElementBlock("p",FD,t.toDisplayString(c.value?t.unref(a).t("em.history.emptyLoaded"):t.unref(a).t("em.history.emptyNotLoaded")),1)):(t.openBlock(),t.createElementBlock("ul",UD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(M.value,te=>{var de,Le,dt;return t.openBlock(),t.createElementBlock("li",{key:te.seq,class:t.normalizeClass(["em-history__group",[`is-${te.kind??"edit"}`]])},[t.createElementVNode("div",{class:"em-history__ghead",onClick:Xe=>fe(te.seq)},[t.createVNode(Ve,{name:"chevron",size:13,class:t.normalizeClass(["em-history__chevron",{"is-open":ie.value.has(te.seq)}])},null,8,["class"]),t.createElementVNode("span",{class:t.normalizeClass(["em-history__kind",`is-${te.kind??"edit"}`])},t.toDisplayString(t.unref(a).t(te.kind==="restore"?"em.history.kindRestore":"em.history.kindEdit")),3),t.createElementVNode("span",jD,t.toDisplayString(he(te)),1),t.createElementVNode("span",KD,"#"+t.toDisplayString(te.seq),1)],8,HD),t.createElementVNode("div",GD,[t.createElementVNode("span",YD,t.toDisplayString(ge(te)),1),te.ts?(t.openBlock(),t.createElementBlock("span",qD,t.toDisplayString(pe(te.ts)),1)):t.createCommentVNode("",!0),te.kind==="restore"&&te.restoredFromSeq!=null?(t.openBlock(),t.createElementBlock("span",WD,"← #"+t.toDisplayString(te.restoredFromSeq),1)):t.createCommentVNode("",!0),te.seq!==O.value?(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:"em-history__compare-btn",onClick:t.withModifiers(Xe=>He(te.seq),["stop"])},t.toDisplayString(t.unref(a).t("em.history.diff.compare")),9,JD)):t.createCommentVNode("",!0)]),ie.value.has(te.seq)?(t.openBlock(),t.createElementBlock("div",XD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(te.actions,(Xe,yt)=>(t.openBlock(),t.createElementBlock("div",{key:yt,class:"em-history__action"},[t.createElementVNode("div",ZD,[t.createVNode(Ve,{name:y[Xe.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",QD,t.toDisplayString(N(Xe.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${Xe.verb}`])},t.toDisplayString(t.unref(a).t(E[Xe.verb])),3)]),Xe.fields.length?(t.openBlock(),t.createElementBlock("ul",eO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Xe.fields,(st,ft)=>(t.openBlock(),t.createElementBlock("li",{key:ft,class:"em-history__field"},[t.createElementVNode("span",tO,t.toDisplayString(st.field),1),st.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",nO,t.toDisplayString(Y(st.oldValue)),1)):t.createCommentVNode("",!0),st.oldValue!==void 0?(t.openBlock(),t.createBlock(Ve,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",oO,t.toDisplayString(Y(st.value)),1)]))),128))])):t.createCommentVNode("",!0)]))),128))])):t.createCommentVNode("",!0),t.unref(a).restoreAvailable.value&&te.seq!==O.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["em-history__restore",{"is-confirming":q.value===te.seq}])},[q.value===te.seq?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",iO,[t.createElementVNode("button",{type:"button",class:"em-history__preview-toggle",disabled:!((de=Ce.value)!=null&&de.entries.length),onClick:Se[7]||(Se[7]=Xe=>$e.value=!$e.value)},[t.createVNode(Ve,{name:"chevron",size:11,class:t.normalizeClass(["em-history__chevron",{"is-open":$e.value}])},null,8,["class"]),t.createTextVNode(" "+t.toDisplayString((Le=Ce.value)!=null&&Le.entries.length?t.unref(a).t("em.history.diff.restorePreview",{n:Ce.value.entries.length}):t.unref(a).t("em.history.diff.restorePreviewNone")),1)],8,aO),$e.value&&((dt=Ce.value)!=null&&dt.entries.length)?(t.openBlock(),t.createElementBlock("ul",rO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Ce.value.entries,(Xe,yt)=>(t.openBlock(),t.createElementBlock("li",{key:yt,class:"em-history__diff-entry"},[t.createElementVNode("div",lO,[t.createVNode(Ve,{name:y[Xe.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",sO,t.toDisplayString(N(Xe.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${G[Xe.verb]}`])},t.toDisplayString(t.unref(a).t(we[Xe.verb])),3)]),Xe.fields.length?(t.openBlock(),t.createElementBlock("ul",cO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Xe.fields,(st,ft)=>(t.openBlock(),t.createElementBlock("li",{key:ft,class:"em-history__field"},[t.createElementVNode("span",dO,t.toDisplayString(st.field),1),st.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",uO,t.toDisplayString(Y(st.oldValue)),1)):t.createCommentVNode("",!0),st.oldValue!==void 0?(t.openBlock(),t.createBlock(Ve,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",mO,t.toDisplayString(Y(st.value)),1)]))),128))])):t.createCommentVNode("",!0)]))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("div",fO,[t.createElementVNode("span",pO,t.toDisplayString(t.unref(a).t("em.history.confirmRestore")),1),t.createElementVNode("button",{type:"button",class:"em-history__confirm-yes",disabled:W.value,onClick:Xe=>Fe(te.seq)},t.toDisplayString(t.unref(a).t("em.history.doRestore")),9,hO),t.createElementVNode("button",{type:"button",class:"em-history__confirm-no",disabled:W.value,onClick:Se[8]||(Se[8]=Xe=>q.value=null)},t.toDisplayString(t.unref(a).t("em.history.cancel")),9,yO)])],64)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:"em-history__restore-btn",onClick:Xe=>ze(te.seq)},[t.createVNode(Ve,{name:"undo",size:12}),t.createTextVNode(" "+t.toDisplayString(t.unref(a).t("em.history.restoreToHere")),1)],8,gO))],2)):t.createCommentVNode("",!0)],2)}),128))])),p.value==null&&x.value>0?(t.openBlock(),t.createElementBlock("button",{key:5,type:"button",class:"em-history__load-more",onClick:P},t.toDisplayString(t.unref(a).t("em.history.loadMore",{n:x.value})),1)):t.createCommentVNode("",!0)])],512),[[t.vShow,e.open]])]}),_:1}))}}),[["__scopeId","data-v-471d6cf8"]]);function _O(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 ay(e){const n=t.ref(_O(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 kO={class:"em-modeler"},EO={class:"em-modeler__body"},NO={class:"em-drawer__inner"},wO={class:"em-drawer__head"},IO={class:"em-drawer__actions"},vO=["title"],CO=["title"],SO=["title"],xO=["title"],RO=["title"],AO=Qe(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(y){t.nextTick(()=>{const E=y();E&&("focusCollapse"in E?E.focusCollapse():E.focus())})}function c(y){n.value=y,s(()=>y?i.value:a.value)}function d(y){o.value=y,s(()=>y?l.value:r.value)}const u=t.ref(!1),m=t.shallowRef(null),{width:p,dragging:f,startResize:h}=ay({initial:260,min:260,max:560,edge:"right",storageKey:"em.explorerWidth"}),{width:g,dragging:b,startResize:_}=ay({initial:320,min:320,max:640,edge:"left",storageKey:"em.panelWidth"}),k=t.ref(null),N=t.ref(null);return(y,E)=>{var S,A,V;return t.openBlock(),t.createElementBlock("div",kO,[t.createVNode(oy,{controller:e.controller,"history-open":u.value,onExportSvg:E[0]||(E[0]=$=>{var O;return(O=k.value)==null?void 0:O.exportSvg()}),onExportPng:E[1]||(E[1]=$=>{var O;return(O=k.value)==null?void 0:O.exportPng()}),onToggleHistory:E[2]||(E[2]=$=>u.value=!u.value)},null,8,["controller","history-open"]),t.createElementVNode("div",EO,[t.createElementVNode("aside",{class:t.normalizeClass(["em-drawer",{"is-collapsed":!n.value}]),style:t.normalizeStyle({width:t.unref(p)+"px"})},[t.createElementVNode("div",NO,[t.createElementVNode("header",wO,[E[11]||(E[11]=t.createElementVNode("span",null,"Diagram Explorer",-1)),t.createElementVNode("div",IO,[(S=N.value)!=null&&S.hasExpandable?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-drawer__btn",title:e.controller.t((A=N.value)!=null&&A.allExpanded?"em.panel.collapseAll":"em.panel.expandAll"),onClick:E[3]||(E[3]=$=>{var O;return(O=N.value)==null?void 0:O.toggleAll()})},[t.createVNode(Ve,{name:(V=N.value)!=null&&V.allExpanded?"collapse-all":"expand-all",size:16},null,8,["name"])],8,vO)):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:E[4]||(E[4]=$=>c(!1))},[t.createVNode(Ve,{name:"panel-close",size:16})],8,CO)])]),t.createVNode(ny,{ref_key:"explorer",ref:N,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(f)}]),title:e.controller.t("em.panel.resizeWidth"),onPointerdown:E[5]||(E[5]=(...$)=>t.unref(h)&&t.unref(h)(...$))},null,42,SO),[[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:E[6]||(E[6]=$=>c(!0))},[t.createVNode(Ve,{name:"panel-open",size:18})],8,xO),[[t.vShow,!n.value]])]),_:1}),t.createElementVNode("div",{class:t.normalizeClass(["em-modeler__canvas",{"is-drawer-open":n.value,"is-resizing":t.unref(f),"is-inspector-collapsed":!o.value}]),style:t.normalizeStyle({"--em-drawer-shift":t.unref(p)-6+"px"})},[t.createVNode(ty,{ref_key:"canvas",ref:k,controller:e.controller,"diff-marks":m.value,"embed-collapse-storage-key":"em.embedCollapsed"},null,8,["controller","diff-marks"])],6),t.withDirectives(t.createVNode(iy,{ref_key:"inspectorRef",ref:l,controller:e.controller,width:t.unref(g),resizing:t.unref(b),"start-resize":t.unref(_),onCollapse:E[7]||(E[7]=$=>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:E[8]||(E[8]=$=>d(!0))},[t.createVNode(Ve,{name:"panel-right-open",size:18})],8,RO),[[t.vShow,!o.value]])]),_:1}),t.createVNode(bO,{controller:e.controller,open:u.value,onClose:E[9]||(E[9]=$=>u.value=!1),onDiffChange:E[10]||(E[10]=$=>m.value=$)},null,8,["controller","open"])]),t.createVNode(mD,{controller:e.controller,"panel-width":t.unref(g),"inspector-open":o.value},null,8,["controller","panel-width","inspector-open"])])}}}),[["__scopeId","data-v-1e5c0922"]]);_e.APPLY_MODEL_OPS_INPUT_SCHEMA=C_,_e.AssociationEdge=Qp,_e.CUSTOM_TYPE_VALUE=_n,_e.CommandStack=Ml,_e.DEFAULT_JAVA_TYPE=tl,_e.DIAGRAM_JSON_FORMAT=al,_e.DIAGRAM_JSON_VERSION=rl,_e.DiagramCanvas=ty,_e.DiagramExplorer=ny,_e.EDITOR=Gn,_e.EditModeToggle=Q2,_e.EditorToolbar=oy,_e.EntityModeler=AO,_e.EntityNode=Mp,_e.GROUP_CODE_ENUM_VALUE=to,_e.GroupNode=Vp,_e.INHERITED_REF_PREFIX=oa,_e.InvalidDiagramJsonError=io,_e.JAVA_TYPES=fi,_e.NoteNode=Bp,_e.OpSyncAdapter=_u,_e.PHYSICAL_NAME_MAX_LENGTH=hi,_e.PropertyPanel=iy,_e.RevCache=bu,_e.SELECTABLE_JAVA_TYPES=Lc,_e.SYMBOLIC_OP_KINDS=ku,_e.SYMBOLIC_OP_SCHEMA=ju,_e.UI_LOCALES=JI,_e.applyDocumentReferenceOnly=Wr,_e.buildAgentBatch=S_,_e.buildDiagramSvg=dc,_e.buildDiffMarks=Rd,_e.collectSharedColumns=Dn,_e.commands=Sb,_e.computeAutoLayout=pc,_e.createEditorController=LS,_e.dedupeModelIds=tb,_e.defaultMermaidDialect=Ny,_e.defaultSqlDialect=eg,_e.diagramToJson=qc,_e.displayLabel=aa,_e.emptyState=kp,_e.entityModelToDdl=Gc,_e.entityModelToMermaid=Jr,_e.entityModelToText=Sc,_e.exportDiagramPng=Qh,_e.exportDiagramSvg=Zh,_e.fromPersisted=em,_e.isGeneratable=cd,_e.isInheritedColumnRef=Xn,_e.isValueTypeStereotype=_t,_e.javaTypeLabel=no,_e.makeInheritedColumnRef=gc,_e.mergeDiagram=wd,_e.mermaidErToImportSource=Fc,_e.migrateLegacyMoney=eb,_e.multiplicityLabel=ca,_e.newId=Pe,_e.packEntityBoxes=Ur,_e.parseDiagramJson=Wc,_e.parseInheritedColumnRef=Hr,_e.parseMermaidEr=zc,_e.parseSqlDdl=ol,_e.planHealBackfillOps=lk,_e.projectActionLog=$l,_e.projectEntityAudit=Sd,_e.projectFieldAudit=Ln,_e.projectInheritedColumns=ci,_e.projectSeqDiff=Tl,_e.renderDiagramSvg=Xc,_e.resolveColumnPhysicalName=di,_e.resolveDiagram=fc,_e.resolveEffectiveColumn=bn,_e.resolveQuickFix=fl,_e.resolveSharedColumn=Qn,_e.resolveSymbolicOps=r_,_e.restoreDeepEqual=lo,_e.scaffoldEntityJava=Rg,_e.sharedColumnScopeEntities=Gr,_e.sqlDdlToImportSource=Kc,_e.stereotypeLabel=si,_e.synthesizeRestoreOps=fb,_e.toPersisted=ik,_e.toPersistedV2=ak,_e.translate=en,_e.uiMessagesEn=rp,_e.uiMessagesJa=lp,_e.uiMessagesKo=sp,_e.validateModel=ga,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})}));
65
+ a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);t.watchEffect(M=>{if(g.value){const x=Yn(g.value),P=he=>{if(he.sourceEvent.type!=="wheel"||!p.value||!f.value)return;const ie=he.sourceEvent.ctrlKey&&zi()?10:1,fe=-he.sourceEvent.deltaY*(he.sourceEvent.deltaMode===1?.05:he.sourceEvent.deltaMode?1:.002)*e.zoomStep,pe=c.value.zoom*2**(fe*ie);f.value.scaleTo(p.value,pe)},Y=he=>{if(he.sourceEvent.type!=="mousemove"||!p.value||!f.value)return;const ie=$.value*Math.max(1,c.value.zoom)*(e.inversePan?-1:1),fe={x:c.value.x-he.sourceEvent.movementX*ie,y:c.value.y-he.sourceEvent.movementY*ie},pe=[[0,0],[u.value.width,u.value.height]],ge=ac.translate(fe.x,fe.y).scale(c.value.zoom),Te=f.value.constrain()(ge,pe,d.value);f.value.transform(p.value,Te)},se=nM().wheelDelta(he=>gs(he)*(e.zoomStep/10)).on("zoom",e.pannable?Y:()=>{}).on("zoom.wheel",e.zoomable?P:()=>{});x.call(se),M(()=>{x.on("zoom",null)})}},{flush:"post"});function R(M){const[x,P]=qn(M);n("click",{event:M,position:{x,y:P}})}function T(M,x){const P={event:M,node:x,connectedEdges:ko([x],s.value)};m.miniMapNodeClick(P),n("nodeClick",P)}function w(M,x){const P={event:M,node:x,connectedEdges:ko([x],s.value)};m.miniMapNodeDoubleClick(P),n("nodeDblclick",P)}function I(M,x){const P={event:M,node:x,connectedEdges:ko([x],s.value)};m.miniMapNodeMouseEnter(P),n("nodeMouseenter",P)}function v(M,x){const P={event:M,node:x,connectedEdges:ko([x],s.value)};m.miniMapNodeMouseMove(P),n("nodeMousemove",P)}function B(M,x){const P={event:M,node:x,connectedEdges:ko([x],s.value)};m.miniMapNodeMouseLeave(P),n("nodeMouseleave",P)}return(M,x)=>(t.openBlock(),t.createBlock(t.unref(Qf),{position:M.position,class:t.normalizeClass(["vue-flow__minimap",{pannable:M.pannable,zoomable:M.zoomable}])},{default:t.withCtx(()=>[(t.openBlock(),t.createElementBlock("svg",{ref_key:"el",ref:g,width:b.value,height:_.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:R},[M.ariaLabel?(t.openBlock(),t.createElementBlock("title",{key:0,id:`vue-flow__minimap-${t.unref(l)}`},t.toDisplayString(M.ariaLabel),9,lM)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(h),P=>(t.openBlock(),t.createBlock(aM,{id:P.id,key:P.id,f:"",position:P.computedPosition,dimensions:P.dimensions,selected:P.selected,dragging:P.dragging,style:t.normalizeStyle(P.style),class:t.normalizeClass(E.value(P)),color:N.value(P),"border-radius":M.nodeBorderRadius,"stroke-color":y.value(P),"stroke-width":M.nodeStrokeWidth,"shape-rendering":t.unref(k),type:P.type,hidden:P.hidden,onClick:Y=>T(Y,P),onDblclick:Y=>w(Y,P),onMouseenter:Y=>I(Y,P),onMousemove:Y=>v(Y,P),onMouseleave:Y=>B(Y,P)},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:C.value,fill:M.maskColor,stroke:M.maskStrokeColor,"stroke-width":M.maskStrokeWidth,"fill-rule":"evenodd"},null,8,sM)],8,rM))]),_:1},8,["position","class"]))}}),uM=["d"],mM=["cx","cy","onDblclick"],fM=["x","y","onPointerdown","onDblclick"],pM=Qe(t.defineComponent({inheritAttrs:!1,__name:"NoteConnectionEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,{screenToFlowCoordinate:o}=tt(),i=t.inject(zs),a=t.inject(Gn,null),r=t.computed(()=>!!a&&a.editable.value),l=t.inject(Co,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((V,$)=>$===d.value?u.value:V)),{source:p,target:f,sourceSide:h,targetSide:g}=Ps({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>m.value}),b=t.computed(()=>(a==null?void 0:a.routingMode.value)==="orthogonal"?Ds(p.value,h.value,m.value,f.value,g.value):Os(p.value,m.value,f.value)),_=t.computed(()=>r.value?(a==null?void 0:a.routingMode.value)==="orthogonal"?Op(p.value,h.value,m.value,f.value,g.value):zp(p.value,m.value,f.value).map((V,$)=>({point:V,segIndex:$})):[]),k=t.computed(()=>r.value?m.value:[]);function N(V,$){d.value=V,u.value={...c.value[V]},$.target.setPointerCapture($.pointerId),$.stopPropagation()}function y(V){if(d.value<0)return;const $=o({x:V.clientX,y:V.clientY});u.value={x:$.x,y:$.y}}function E(V){var $,O;d.value>=0&&i&&i.movePoint(n.id,d.value,{...u.value}),d.value=-1,(O=($=V.target).releasePointerCapture)==null||O.call($,V.pointerId)}function S(V,$){$.stopPropagation(),i==null||i.removePoint(n.id,V)}function A(V,$){if(!i)return;const O=o({x:$.clientX,y:$.clientY});i.insertPoint(n.id,V,{x:O.x,y:O.y})}return(V,$)=>(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,uM),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.value,(O,C)=>(t.openBlock(),t.createElementBlock("circle",{key:`mid-${C}`,cx:O.point.x,cy:O.point.y,r:"4",class:t.normalizeClass(["em-note-edge__mid",{"is-dimmed":s.value}]),onDblclick:t.withModifiers(R=>A(O.segIndex,R),["stop"])},null,42,mM))),128)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(k.value,(O,C)=>(t.openBlock(),t.createElementBlock("rect",{key:`wp-${C}`,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:R=>N(C,R),onPointermove:y,onPointerup:E,onDblclick:R=>S(C,R)},null,42,fM))),128))],64))}}),[["__scopeId","data-v-8515def1"]]),hM=["d"],yM=Qe(t.defineComponent({inheritAttrs:!1,__name:"SerializedTypeEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const n=e,o=t.inject(Gn,null),i=t.inject(Co,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}=Ps({sourceNode:()=>n.sourceNode,targetNode:()=>n.targetNode,waypoints:()=>[]}),d=t.computed(()=>(o==null?void 0:o.routingMode.value)==="orthogonal"?Ds(r.value,s.value,[],l.value,c.value):Os(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,hM))}}),[["__scopeId","data-v-67430658"]]),gM=["data-theme"],bM={key:0,class:"em-ctx__sep",role:"separator"},_M=["aria-label"],kM={class:"em-ctx__swatches-label","aria-hidden":"true"},EM={class:"em-ctx__chips",role:"none"},NM=["aria-checked","aria-label","title","onClick"],wM=["aria-checked","aria-label","title","onClick"],IM=["disabled","onClick"],vM={class:"em-ctx__icon"},CM={class:"em-ctx__caption"},SM=Qe(t.defineComponent({__name:"EmContextMenu",props:{locale:{}},setup(e,{expose:n}){const o=e,i=(N,y)=>en(o.locale??"ko",N,y),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(N,y){var A,V;r.value=y,l.value=(A=N.target)!=null&&A.closest('[data-theme="dark"]')?"dark":void 0,d=document.activeElement,c.x=N.clientX,c.y=N.clientY,a.value=!0,window.addEventListener("keydown",b),window.addEventListener("resize",p),await t.nextTick();const E=s.value;if(!E)return;const S=E.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)),(V=f()[0])==null||V.focus()}function p(){if(!a.value)return;a.value=!1,r.value=[],window.removeEventListener("keydown",b),window.removeEventListener("resize",p);const N=d;d=null,N!=null&&N.isConnected&&N.focus()}function f(){const N=s.value;if(!N)return[];const y=[];for(const E of Array.from(N.children))if(E.classList.contains("em-ctx__item"))E.disabled||y.push(E);else if(E.classList.contains("em-ctx__swatches")){const S=Array.from(E.querySelectorAll(".em-ctx__chip"));S.length&&y.push(S.find(A=>A===document.activeElement)??S[0])}return y}function h(N){var A;const y=f();if(!y.length)return;const E=y.indexOf(document.activeElement),S=E<0?N>0?0:y.length-1:(E+N+y.length)%y.length;(A=y[S])==null||A.focus()}function g(N){var A,V;const y=(A=document.activeElement)==null?void 0:A.closest(".em-ctx__swatches");if(!y)return!1;const E=Array.from(y.querySelectorAll(".em-ctx__chip")),S=E.indexOf(document.activeElement);return S<0?!1:((V=E[(S+N+E.length)%E.length])==null||V.focus(),!0)}function b(N){var y,E;switch(N.key){case"Escape":N.stopPropagation(),p();return;case"ArrowDown":N.preventDefault(),h(1);return;case"ArrowUp":N.preventDefault(),h(-1);return;case"ArrowRight":g(1)&&N.preventDefault();return;case"ArrowLeft":g(-1)&&N.preventDefault();return;case"Home":N.preventDefault(),(y=f()[0])==null||y.focus();return;case"End":{N.preventDefault();const S=f();(E=S[S.length-1])==null||E.focus();return}case"Tab":N.preventDefault(),h(N.shiftKey?-1:1)}}function _(N){N.disabled||(N.handler(),p())}function k(N,y){N.onPick(y),p()}return t.onBeforeUnmount(p),n({open:m,close:p}),(N,y)=>(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:p,onContextmenu:t.withModifiers(p,["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:y[0]||(y[0]=t.withModifiers(()=>{},["prevent"]))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,(E,S)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:S},[E.type==="separator"?(t.openBlock(),t.createElementBlock("div",bM)):E.type==="swatches"?(t.openBlock(),t.createElementBlock("div",{key:1,class:"em-ctx__swatches",role:"group","aria-label":E.caption},[t.createElementVNode("span",kM,t.toDisplayString(E.caption),1),t.createElementVNode("div",EM,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-ctx__chip em-ctx__chip--none",{"is-on":E.current===null}]),role:"menuitemradio","aria-checked":E.current===null,"aria-label":i("em.swatch.none"),title:i("em.swatch.none"),onClick:A=>k(E,null)},null,10,NM),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),A=>(t.openBlock(),t.createElementBlock("button",{key:A,type:"button",class:t.normalizeClass(["em-ctx__chip",{"is-on":E.current===A}]),style:t.normalizeStyle({background:t.unref(ei)(A)}),role:"menuitemradio","aria-checked":E.current===A,"aria-label":i(t.unref(Io)(A)),title:i(t.unref(Io)(A)),onClick:V=>k(E,A)},null,14,wM))),128))])],8,_M)):(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:t.normalizeClass(["em-ctx__item",{"is-danger":E.danger,"is-disabled":E.disabled}]),disabled:E.disabled,role:"menuitem",onClick:A=>_(E)},[t.createElementVNode("span",vM,[E.icon?(t.openBlock(),t.createBlock(Ve,{key:0,name:E.icon,size:15},null,8,["name"])):t.createCommentVNode("",!0)]),t.createElementVNode("span",CM,t.toDisplayString(E.caption),1)],10,IM))],64))),128))],36)],8,gM)):t.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-2f05239a"]]);function lc(e,n){return`serialized:${e}:${n}`}function Gh(e){const n=Vo(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=ui(a,n,i,e);if(r.kind!=="resolved")continue;const l=r.entity;if(l.modelId===i.modelId)continue;const s=lc(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 Yh(e,n){return n?`${e}:${n}`:e}function qh(e,n){var o;if(!e||typeof window>"u")return{};try{const i=(o=window.sessionStorage)==null?void 0:o.getItem(Yh(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 xM(e,n,o){var i,a;if(!(!e||typeof window>"u"))try{const r=Yh(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 Wh(e){const n=()=>{var s;return(s=e.scope)==null?void 0:s.call(e)},o=t.ref(qh(e.storageKey,n()));e.scope&&t.watch(()=>e.scope(),s=>o.value=qh(e.storageKey,s)),t.watch(o,s=>xM(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 sc=[".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 ri(e){const n=getComputedStyle(e);return!(n.display==="none"||n.visibility==="hidden"||parseFloat(n.opacity)===0)}function RM(e){return e.childElementCount>0?!1:(e.textContent??"").trim().length>0}function AM(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 h=l.length?a.getBoundingClientRect():e.getBoundingClientRect();if(h.width===0&&h.height===0)return[];const g=n(h.left,h.top+h.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,p=0;const f=()=>{const h=d.trim();if(h){const g=n(m,(u+p)/2);c.push({...i,x:g.x,y:g.y,text:h})}d=""};for(let h=0;h<s.length;h++){a.setStart(r,h),a.setEnd(r,h+1);const g=a.getBoundingClientRect();u===null||Math.abs(g.top-u)>1?(f(),u=g.top,m=g.left,p=g.bottom,d=s[h]):(d+=s[h],p=Math.max(p,g.bottom))}return f(),c}function Pr(e,n){const o=[];for(const i of e.querySelectorAll("*"))RM(i)&&(i.closest(sc)||ri(i)&&o.push(...AM(i,n)));return o}function Qi(e){return Math.round(e*100)/100}function $M(e,n){const o=[];for(const i of e.querySelectorAll("svg.em-icon")){if(i.closest(sc)||!ri(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="${Qi(r.x)}" y="${Qi(r.y)}" width="${Qi(l.x-r.x)}" height="${Qi(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 TM(e){const n=[];for(const o of e.querySelectorAll(".em-edge__marker")){if(!ri(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=>Qi(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 Jh(e,n,o){const i=[];for(const a of e.querySelectorAll("*")){if(a===n||a.closest(sc)||!ri(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 ea(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 cc(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 MM(e){const n=e.vueFlowRef.value;if(!n)throw new Error("캔버스가 렌더되지 않아 SVG로 내보낼 수 없습니다.");const o=(f,h)=>e.screenToFlowCoordinate({x:f,y:h}),i=[],a=[],r=[],l=[],s={minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};for(const f of e.nodes.value){const h=n.querySelector(`.vue-flow__node[data-id="${CSS.escape(f.id)}"]`);if(!h||!ri(h))continue;const g=h.firstElementChild;if(g)if(f.type==="group"){const b=ea(g,o);cc(s,b),i.push({...b,texts:[]});const _=g.querySelector(".em-group__label");_&&i.push({...ea(_,o),stroke:"none",texts:[]}),i.push({...b,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:Pr(g,o)})}else if(f.type==="note"){const b={...ea(g,o),texts:Pr(g,o),lines:Jh(g,g,o)};cc(s,b),r.push(b)}else{const b=ea(g,o);cc(s,b);const _=b.radius??{tl:0,tr:0};a.push({...b,stroke:"none",texts:[]});const k=g.querySelector(".em-entity__header");if(k){const N=ea(k,o);a.push({x:b.x,y:b.y,w:b.w,h:N.y+N.h-b.y,fill:N.fill,stroke:"none",radius:{tl:_.tl,tr:_.tr,br:0,bl:0},texts:[]})}a.push({...b,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:Pr(g,o),lines:Jh(g,g,o),icons:$M(g,o)}),a.push({...b,fill:"none",texts:[]})}}for(const f of n.querySelectorAll(".vue-flow__edge")){const h=f.querySelector("path.em-edge__path, path.em-note-edge__path");if(!h||!ri(h))continue;const g=h.getAttribute("d");if(!g)continue;const b=getComputedStyle(h),_=b.strokeDasharray,k=TM(f);l.push({d:g,stroke:b.stroke,strokeWidth:parseFloat(b.strokeWidth)||1.5,strokeDasharray:_&&_!=="none"?_:void 0,labels:Pr(f,o),markers:k.length?k: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 dc(e){return Xc(MM(e))}function Xh(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 Zh(e,n="diagram.svg"){const o=dc(e);Xh(new Blob([o],{type:"image/svg+xml;charset=utf-8"}),n)}function VM(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 Qh(e,n="diagram.png",o=2){const i=dc(e),{w:a,h:r}=VM(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,p)=>{s.onload=()=>m(),s.onerror=()=>p(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 변환 실패");Xh(u,n)}finally{URL.revokeObjectURL(l)}}const BM={class:"em-shortcuts"},DM={class:"em-shortcuts__list"},OM={class:"em-shortcuts__title"},LM={class:"em-shortcuts__keys"},PM={class:"em-shortcuts__kbd"},zM={key:0,class:"em-shortcuts__plus"},FM={class:"em-shortcuts__desc"},UM={class:"em-shortcuts__actions"},ey=Qe(t.defineComponent({__name:"ShortcutHelpModal",props:{locale:{}},setup(e){const n=e,o=oe.useModalHandle(),i=(s,c)=>en(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(oe.BSModalFrame),{title:i("em.shortcuts.title")},{default:t.withCtx(()=>[t.createElementVNode("div",BM,[t.createElementVNode("div",DM,[(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",OM,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",LM,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.keys,(m,p)=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:m+p},[t.createElementVNode("kbd",PM,t.toDisplayString(m),1),p<u.keys.length-1?(t.openBlock(),t.createElementBlock("span",zM,"+")):t.createCommentVNode("",!0)],64))),128))]),t.createElementVNode("span",FM,t.toDisplayString(u.desc),1)]))),128))]))),128))]),t.createElementVNode("div",UM,[t.createVNode(t.unref(oe.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 li(...e){return e.filter(o=>!!o).join(" ").toLowerCase().trim()||void 0}function HM(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 jM=["aria-label"],KM=["aria-activedescendant","aria-label","placeholder"],GM={id:"em-cmdk-listbox",class:"em-cmdk__results",role:"listbox"},YM=["aria-label"],qM={class:"em-cmdk__section","aria-hidden":"true"},WM=["id","aria-selected","onMouseenter","onClick"],JM={class:"em-cmdk__label"},XM={key:0,class:"em-cmdk__tag"},ZM={key:1,class:"em-cmdk__sub"},QM=["aria-label"],e2={class:"em-cmdk__section","aria-hidden":"true"},t2=["id","aria-selected","aria-disabled","onMouseenter","onClick"],n2={class:"em-cmdk__label"},o2={key:1,class:"em-cmdk__empty"},i2=Qe(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 E=c.value,S=a.state.logical.entities.map(V=>{var $,O,C,R,T,w;return{type:"goto",kind:"entity",id:V.modelId,label:((O=($=V.table)==null?void 0:$.logicalName)==null?void 0:O[E])||V.name,sub:(C=V.table)==null?void 0:C.physicalName,match:li(V.name,(T=(R=V.table)==null?void 0:R.logicalName)==null?void 0:T[E],(w=V.table)==null?void 0:w.physicalName)??""}}),A=a.state.logical.groups.map(V=>{var $,O,C,R;return{type:"goto",kind:"group",id:V.modelId,label:(($=V.name)==null?void 0:$[E])||((O=V.name)==null?void 0:O.ko)||V.packageName||a.t("em.cmd.groupTag"),tag:a.t("em.cmd.groupTag"),match:li((C=V.name)==null?void 0:C[E],(R=V.name)==null?void 0:R.ko,V.packageName)??""}});return[...S,...A]}),u={LOGICAL:"em.displayMode.logical",PHYSICAL:"em.displayMode.physical",LOGICAL_PHYSICAL:"em.displayMode.logicalPhysical",CLASS:"em.displayMode.class"},m=t.computed(()=>{const E=[];a.editable.value&&(E.push({type:"action",id:"undo",label:a.t("em.toolbar.undo"),run:()=>a.undo(),disabled:!a.canUndo.value}),E.push({type:"action",id:"redo",label:a.t("em.toolbar.redo"),run:()=>a.redo(),disabled:!a.canRedo.value}),E.push({type:"action",id:"autolayout",label:a.t("em.palette.autoLayout"),run:()=>a.autoLayout()}),E.push({type:"action",id:"collapseAll",label:a.t("em.panel.collapseAll"),run:()=>a.collapseAll()}),E.push({type:"action",id:"expandAll",label:a.t("em.panel.expandAll"),run:()=>a.expandAll()})),E.push({type:"action",id:"grid",label:a.t("em.toolbar.grid"),run:()=>a.showGrid.value=!a.showGrid.value}),E.push({type:"action",id:"minimap",label:a.t("em.toolbar.minimap"),run:()=>a.showMinimap.value=!a.showMinimap.value}),E.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"])E.push({type:"action",id:`dm-${S}`,label:a.t(u[S]),run:()=>a.displayMode.value=S});return E});function p(E,S){return E.label.toLowerCase().includes(S)}const f=t.computed(()=>{const E=r.value.trim().toLowerCase();return E?d.value.filter(S=>S.match.includes(E)):d.value}),h=t.computed(()=>{const E=r.value.trim().toLowerCase();return E?m.value.filter(S=>p(S,E)):m.value}),g=t.computed(()=>[...f.value,...h.value]);t.watch([f,h],()=>{l.value=0});function b(E){return g.value.indexOf(E)}const _=E=>`em-cmdk-opt-${E}`,k=t.computed(()=>g.value[l.value]?_(l.value):void 0);t.watch(l,async()=>{var S;await t.nextTick();const E=k.value;E&&((S=document.getElementById(E))==null||S.scrollIntoView({block:"nearest"}))});function N(E){if(E.type==="goto")a.selection.value={kind:E.kind,id:E.id},a.requestFocus(E.id);else{if(E.disabled)return;E.run()}i("close")}function y(E){if(E.key==="Escape"){i("close"),E.preventDefault();return}if(E.key==="ArrowDown"){l.value=Math.min(l.value+1,g.value.length-1),E.preventDefault();return}if(E.key==="ArrowUp"){l.value=Math.max(l.value-1,0),E.preventDefault();return}if(E.key==="Enter"){const S=g.value[l.value];S&&N(S),E.preventDefault();return}E.key==="Tab"&&E.preventDefault()}return t.nextTick(()=>{var E;return(E=s.value)==null?void 0:E.focus()}),(E,S)=>(t.openBlock(),t.createBlock(t.Teleport,{to:"body"},[t.createElementVNode("div",{class:"em-cmdk__backdrop",onPointerdown:S[1]||(S[1]=t.withModifiers(A=>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]=A=>r.value=A),class:"em-cmdk__input",type:"text",role:"combobox","aria-expanded":"true","aria-autocomplete":"list",autocomplete:"off","aria-controls":"em-cmdk-listbox","aria-activedescendant":k.value,"aria-label":t.unref(a).t("em.cmd.placeholder"),placeholder:t.unref(a).t("em.cmd.placeholder"),onKeydown:y},null,40,KM),[[t.vModelText,r.value]]),t.createElementVNode("div",GM,[g.value.length?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[f.value.length?(t.openBlock(),t.createElementBlock("div",{key:0,role:"group","aria-label":t.unref(a).t("em.cmd.sectionGoto")},[t.createElementVNode("div",qM,t.toDisplayString(t.unref(a).t("em.cmd.sectionGoto")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(f.value,A=>(t.openBlock(),t.createElementBlock("button",{id:_(b(A)),key:A.id,type:"button",tabindex:"-1",class:t.normalizeClass(["em-cmdk__item",{"is-active":b(A)===l.value}]),role:"option","aria-selected":b(A)===l.value,onMouseenter:V=>l.value=b(A),onClick:V=>N(A)},[t.createElementVNode("span",JM,t.toDisplayString(A.label),1),A.tag?(t.openBlock(),t.createElementBlock("span",XM,t.toDisplayString(A.tag),1)):A.sub?(t.openBlock(),t.createElementBlock("span",ZM,t.toDisplayString(A.sub),1)):t.createCommentVNode("",!0)],42,WM))),128))],8,YM)):t.createCommentVNode("",!0),h.value.length?(t.openBlock(),t.createElementBlock("div",{key:1,role:"group","aria-label":t.unref(a).t("em.cmd.sectionActions")},[t.createElementVNode("div",e2,t.toDisplayString(t.unref(a).t("em.cmd.sectionActions")),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(h.value,A=>(t.openBlock(),t.createElementBlock("button",{id:_(b(A)),key:A.id,type:"button",tabindex:"-1",class:t.normalizeClass(["em-cmdk__item",{"is-active":b(A)===l.value,"is-disabled":A.disabled}]),role:"option","aria-selected":b(A)===l.value,"aria-disabled":A.disabled||void 0,onMouseenter:V=>l.value=b(A),onClick:V=>N(A)},[t.createElementVNode("span",n2,t.toDisplayString(A.label),1)],42,t2))),128))],8,QM)):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock("div",o2,t.toDisplayString(t.unref(a).t("em.cmd.empty")),1))])],8,jM)],32)]))}}),[["__scopeId","data-v-fcf574c4"]]);function a2(e){return e?e.kind==="missing"?{titleKey:"em.conflict.lockedTitle",detailKey:"em.conflict.missingDetail"}:{titleKey:"em.conflict.lockedTitle",detailKey:"em.conflict.changedDetail"}:null}const r2={key:0,class:"em-canvas__empty","aria-hidden":"true"},l2={class:"em-canvas__empty-title"},s2=["innerHTML"],c2=["innerHTML"],d2=["innerHTML"],u2={key:1,class:"em-canvas__empty-title"},m2={key:0,class:"em-conflict-banner",role:"alert","aria-live":"assertive"},f2={class:"em-conflict-banner__body"},p2={class:"em-conflict-banner__title"},h2={class:"em-conflict-banner__detail"},y2={key:0,class:"em-toast",role:"status","aria-live":"polite"},uc="nc:",ty=Qe(t.defineComponent({__name:"DiagramCanvas",props:{controller:{},diffMarks:{},embedCollapseStorageKey:{}},setup(e,{expose:n}){const o=e,i=o.controller,a=oe.useModal(),r=t.ref(!1),l=t.ref(null);let s;function c(D){l.value=D,s&&clearTimeout(s),s=setTimeout(()=>l.value=null,3200)}t.watch(()=>i.notice.value,D=>{D&&c(D.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 D=a2(i.opConflict.value);return D?{title:i.t(D.titleKey),detail:i.t(D.detailKey)}:null}),u=t.ref(!1),m=t.ref(!1),p={x:0,y:0};function f(D){p.x=D.clientX,p.y=D.clientY}const h=t.ref(null);t.provide(br,h);const g=t.ref(null);t.provide(Ep,g);const b=t.ref(null),_=t.computed(()=>{const D=b.value,U=new Set;if(!D)return U;if(D.kind==="entity")U.add(D.id);else if(D.kind==="group"){const le=i.resolved.value.groups.find(ne=>ne.group.modelId===D.id);for(const ne of(le==null?void 0:le.group.memberEntityRefs)??[])U.add(ne)}return U}),k=t.computed(()=>{const D=b.value,U=new Set(_.value),le=new Set,ne=new Set;if(!D)return{related:U,edges:le,notes:ne};if(D.kind==="note"){ne.add(D.id);for(const Be of i.resolved.value.noteConnections)Be.noteRef===D.id&&U.add(Be.targetRef);return{related:U,edges:le,notes:ne}}const xe=_.value;if(!xe.size)return{related:U,edges:le,notes:ne};for(const Be of i.resolved.value.associations){const{end1:qe,end2:je}=Be.association;(xe.has(qe.entityRef)||xe.has(je.entityRef))&&(le.add(Be.association.modelId),U.add(qe.entityRef),U.add(je.entityRef))}for(const Be of i.resolved.value.noteConnections)U.has(Be.targetRef)&&ne.add(Be.noteRef);return{related:U,edges:le,notes:ne}});t.provide(Co,{source:b,active:t.computed(()=>b.value!==null),primaryEntityIds:_,relatedEntityIds:t.computed(()=>k.value.related),relatedEdgeIds:t.computed(()=>k.value.edges),relatedNoteIds:t.computed(()=>k.value.notes),hoverGroupId:t.computed(()=>{var D;return((D=b.value)==null?void 0:D.kind)==="group"?b.value.id:null}),setEntityHover:D=>{g.value||m.value||(b.value=D?{kind:"entity",id:D}:null)},setGroupHover:D=>{g.value||m.value||(b.value=D?{kind:"group",id:D}:null)},setNoteHover:D=>{g.value||m.value||(b.value=D?{kind:"note",id:D}:null)}}),t.provide(Gn,i);const N=jS(),y=t.computed(()=>N(i.state.logical,i.embeddableCatalog.value));t.provide(Ip,y);const E=Wh({expandableKeys:()=>[],defaultCollapsed:qS,storageKey:o.embedCollapseStorageKey,scope:()=>i.state.layout.diagramId});t.provide(Sp,{isCollapsed:E.isCollapsed,toggle:E.toggle}),t.provide(Np,{marks:t.toRef(o,"diffMarks")});function S(D,U){return`${uc}${D}:${U}`}function A(D){if(!D.startsWith(uc))return null;const[U,le]=D.slice(uc.length).split(":");return U&&le?{noteRef:U,targetRef:le}:null}t.provide(zs,{points:D=>{var le,ne;const U=A(D);return U?((le=i.resolved.value.noteConnections.find(xe=>xe.noteRef===U.noteRef&&xe.targetRef===U.targetRef))==null?void 0:le.waypoints)??[]:((ne=i.resolved.value.associations.find(xe=>xe.association.modelId===D))==null?void 0:ne.waypoints)??[]},movePoint:(D,U,le)=>{const ne=A(D);ne?i.moveNoteConnectionWaypoint(ne.noteRef,ne.targetRef,U,le):i.moveWaypoint(D,U,le)},insertPoint:(D,U,le)=>{const ne=A(D);ne?i.addNoteConnectionWaypoint(ne.noteRef,ne.targetRef,U,le):i.addWaypoint(D,U,le)},removePoint:(D,U)=>{const le=A(D);le?i.removeNoteConnectionWaypoint(le.noteRef,le.targetRef,U):i.removeWaypoint(D,U)}});const V=tt(),{nodes:$,edges:O,findNode:C,findEdge:R,addNodes:T,addEdges:w,removeNodes:I,removeEdges:v,fitView:B,setCenter:M,getViewport:x,screenToFlowCoordinate:P,getSelectedNodes:Y,updateNodeInternals:se}=V,he=t.ref(!1);async function ie(D){he.value=!0,await t.nextTick(),await new Promise(U=>requestAnimationFrame(()=>U(null)));try{return await D()}finally{he.value=!1}}async function fe(){try{await ie(()=>Zh(V))}catch(D){console.error("[entity-modeler] SVG export failed",D),c(i.t("em.canvas.exportFailed"))}}async function pe(){try{await ie(()=>Qh(V))}catch(D){console.error("[entity-modeler] PNG export failed",D),c(i.t("em.canvas.exportFailed"))}}n({exportSvg:fe,exportPng:pe,fitView:B});const ge=t.computed(()=>i.resolved.value.entities.length===0);function Te(){const D=x(),{width:U,height:le}=V.dimensions.value;return{x:(U/2-D.x)/D.zoom,y:(le/2-D.y)/D.zoom}}function He(){const D=Te();i.addEntity("NewEntity",{x:D.x,y:D.y})}function De(){const D=Te();i.addNote("메모",{x:D.x,y:D.y})}function Z(D){for(const U of i.resolved.value.groups){const{location:le,size:ne}=U.geo;if(D.x>=le.x&&D.x<=le.x+ne.width&&D.y>=le.y&&D.y<=le.y+ne.height)return U.group.modelId}return null}function re(D,U){return D.x===U.x&&D.y===U.y}function ue(D,U){return(D==null?void 0:D.width)===(U==null?void 0:U.width)&&(D==null?void 0:D.height)===(U==null?void 0:U.height)}function z(D,U){return D.entity===U.entity&&D.displayMode===U.displayMode&&D.collapsed===U.collapsed&&D.locked===U.locked&&D.groupRef===U.groupRef&&ue(D.size,U.size)&&D.style===U.style&&D.attributeStyles===U.attributeStyles&&D.operationStyles===U.operationStyles}function L(D,U){const le=Object.keys(D);if(le.length!==Object.keys(U).length)return!1;for(const ne of le)if(ne==="geo"){const xe=D.geo,Be=U.geo;if(!re(xe.location,Be.location)||!ue(xe.size,Be.size))return!1}else if(D[ne]!==U[ne])return!1;return!0}function F(){const D=i.resolved.value,U=new Map(D.groups.map(Ie=>[Ie.group.modelId,Ie.geo])),le=new Set(D.groups.map(Ie=>Ie.group.modelId)),ne=new Set([...le,...D.entities.map(Ie=>Ie.entity.modelId),...D.notes.map(Ie=>Ie.note.modelId)]);for(const Ie of[...$.value])ne.has(Ie.id)||I([Ie.id]);for(const Ie of D.groups){const Je=Ie.group.modelId,j={width:`${Ie.geo.size.width}px`,height:`${Ie.geo.size.height}px`},K={group:Ie.group,style:Ie.style,locked:Ie.locked},ve=Ie.locked?!1:void 0,Re=C(Je);if(Re){re(Re.position,Ie.geo.location)||(Re.position={...Ie.geo.location});const me=Re.data;(me.group!==K.group||me.style!==K.style||me.locked!==K.locked)&&(Re.data=K);const Ue=Re.style;((Ue==null?void 0:Ue.width)!==j.width||(Ue==null?void 0:Ue.height)!==j.height)&&(Re.style=j),Re.draggable!==ve&&(Re.draggable=ve)}else T([{id:Je,type:"group",position:{...Ie.geo.location},draggable:ve,style:j,data:K}])}for(const Ie of D.entities){const Je=Ie.entity.modelId,j=Ie.groupRef&&le.has(Ie.groupRef)?Ie.groupRef:void 0,K={entity:Ie.entity,displayMode:i.displayMode.value,collapsed:Ie.collapsed,locked:Ie.locked,groupRef:j,size:Ie.geo.size,style:Ie.style,attributeStyles:Ie.attributeStyles,operationStyles:Ie.operationStyles},ve=Ie.locked?!1:void 0,Re=Ie.locked?!1:void 0,me=j?U.get(j):void 0,Ue=me?{x:Ie.geo.location.x-me.location.x,y:Ie.geo.location.y-me.location.y}:{...Ie.geo.location},Ye=C(Je);Ye?(re(Ye.position,Ue)||(Ye.position=Ue),z(Ye.data,K)||(Ye.data=K),Ye.parentNode!==j&&(Ye.parentNode=j),Ye.draggable!==ve&&(Ye.draggable=ve),Ye.connectable!==Re&&(Ye.connectable=Re)):T([{id:Je,type:"entity",position:Ue,parentNode:j,draggable:ve,connectable:Re,data:K}])}for(const Ie of D.notes){const Je=Ie.note,j=Je.modelId,K=Ie.groupRef&&le.has(Ie.groupRef)?Ie.groupRef:void 0,ve={note:Je,groupRef:K},Re={width:`${Je.geo.size.width}px`,height:`${Je.geo.size.height}px`},me=K?U.get(K):void 0,Ue=me?{x:Je.geo.location.x-me.location.x,y:Je.geo.location.y-me.location.y}:{...Je.geo.location},Ye=C(j);if(Ye){re(Ye.position,Ue)||(Ye.position=Ue);const pt=Ye.data;(pt.groupRef!==K||!L(pt.note,Je))&&(Ye.data=ve);const Pt=Ye.style;((Pt==null?void 0:Pt.width)!==Re.width||(Pt==null?void 0:Pt.height)!==Re.height)&&(Ye.style=Re),Ye.parentNode!==K&&(Ye.parentNode=K)}else T([{id:j,type:"note",position:Ue,parentNode:K,style:Re,data:ve}])}const xe=new Map(D.associations.map(Ie=>[Ie.association.modelId,Ie])),Be=new Set(D.noteConnections.map(Ie=>S(Ie.noteRef,Ie.targetRef))),qe=Gh(i.state.logical).filter(Ie=>C(Ie.consumerRef)&&C(Ie.typeRef)),je=new Set(qe.map(Ie=>lc(Ie.consumerRef,Ie.typeRef)));for(const Ie of[...O.value])!xe.has(Ie.id)&&!Be.has(Ie.id)&&!je.has(Ie.id)&&v([Ie.id]);for(const[Ie,Je]of xe){const j={id:Ie,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}},K=R(Ie);if(K){const ve=K.data;(ve.association!==j.data.association||ve.sourceColumnRef!==j.data.sourceColumnRef||ve.targetColumnRef!==j.data.targetColumnRef)&&(K.data=j.data),K.sourceHandle!==j.sourceHandle&&(K.sourceHandle=j.sourceHandle),K.targetHandle!==j.targetHandle&&(K.targetHandle=j.targetHandle)}else w([j])}for(const Ie of D.noteConnections){const Je=S(Ie.noteRef,Ie.targetRef),j={noteRef:Ie.noteRef,targetRef:Ie.targetRef};R(Je)||w([{id:Je,type:"note-connection",source:Ie.noteRef,target:Ie.targetRef,data:j}])}for(const Ie of qe){const Je=lc(Ie.consumerRef,Ie.typeRef),j={consumerRef:Ie.consumerRef,typeRef:Ie.typeRef,usageCount:Ie.usageCount},K=R(Je);K?K.data.usageCount!==j.usageCount&&(K.data=j):w([{id:Je,type:"serialized-type",source:Ie.consumerRef,target:Ie.typeRef,data:j}])}}const X=new Set;let ee=!1,ke=!1;const ye=new Map;function Ne(D){const U=document.querySelector(`.vue-flow__node[data-id="${CSS.escape(D)}"]`);if(!U)return null;let le=`${U.offsetHeight}`;for(const ne of U.querySelectorAll(".em-entity__row"))le+=`|${ne.dataset.attr}:${ne.offsetTop}`;return le}function we(){ke=!1;const D=ee;ee=!1;const U=[...X];if(X.clear(),D){se();for(const ne of $.value){const xe=Ne(ne.id);xe!==null&&ye.set(ne.id,xe)}return}const le=[];for(const ne of U){const xe=Ne(ne);if(xe===null){ye.delete(ne);continue}ye.get(ne)!==xe&&(ye.set(ne,xe),le.push(ne))}le.length&&se(le)}function G(D){if(D)for(const U of D)X.add(U);else ee=!0;ke||(ke=!0,t.nextTick(()=>requestAnimationFrame(we)))}t.provide(wp,{mark:D=>G([D])});function q(){const D=Y.value.map(le=>le.id);if(D.length)return D;const U=i.selection.value;return U&&(U.kind==="entity"||U.kind==="note"||U.kind==="group")?[U.id]:[]}function W(){return Y.value.filter(D=>D.type==="entity").map(D=>D.id)}function Ce(){return Y.value.filter(D=>D.type==="group").map(D=>D.id)}function $e(D){var U;return[...((U=i.state.logical.groups.find(le=>le.modelId===D))==null?void 0:U.memberEntityRefs)??[]]}function ze(){const D=Ce().flatMap($e);return[...new Set([...W(),...D])]}function Fe(){return Ce().length>0||W().length>1}function ae(){Fe()?i.copy(ze()):i.copy()}async function Se(D){if(!D.length)return;await t.nextTick();const U=Y.value;U.length&&V.removeSelectedNodes(U);const le=D.map(ne=>C(ne)).filter(ne=>!!ne);le.length&&V.addSelectedNodes(le)}function Ge(D){if(Fe()&&W().includes(D)){const U=ze();return{caption:i.t("em.ctx.copyN",{n:U.length}),icon:"copy",handler:()=>i.copy(U)}}return{caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:D},i.copy()}}}function et(D){var xe;const U=D.target;if(U&&(U.tagName==="INPUT"||U.tagName==="TEXTAREA"||U.isContentEditable))return;if(D.key==="?"){a.openModal({component:ey,bind:{locale:i.uiLocale.value}}),D.preventDefault();return}if((D.metaKey||D.ctrlKey)&&D.key.toLowerCase()==="k"){r.value=!0,D.preventDefault();return}if(!i.editable.value){(D.metaKey||D.ctrlKey)&&D.key.toLowerCase()==="c"&&(ae(),D.preventDefault());return}if(D.key==="Delete"||D.key==="Backspace"){i.deleteSelection()&&D.preventDefault();return}if(D.key==="ArrowUp"||D.key==="ArrowDown"||D.key==="ArrowLeft"||D.key==="ArrowRight"){if(((xe=i.selection.value)==null?void 0:xe.kind)==="attribute"){if(D.key==="ArrowUp"||D.key==="ArrowDown"){const Ie=D.key==="ArrowDown"?1:-1;(D.altKey?i.nudgeSelectedAttributes(Ie):i.moveAttributeFocus(Ie))&&D.preventDefault()}return}const Be=D.shiftKey?10:1,qe=D.key==="ArrowLeft"?-Be:D.key==="ArrowRight"?Be:0,je=D.key==="ArrowUp"?-Be:D.key==="ArrowDown"?Be:0;i.nudgeNodes(q(),qe,je)&&D.preventDefault();return}if(!(D.metaKey||D.ctrlKey))return;const ne=D.key.toLowerCase();ne==="c"?(ae(),D.preventDefault()):ne==="v"?(Se(i.paste()),D.preventDefault()):ne==="z"&&(D.shiftKey?i.redo():i.undo(),D.preventDefault())}t.onMounted(async()=>{F(),await t.nextTick(),B(),G(),window.addEventListener("keydown",et),window.addEventListener("pointerup",te),window.addEventListener("pointermove",f,{passive:!0})}),t.onBeforeUnmount(()=>{window.removeEventListener("keydown",et),window.removeEventListener("pointerup",te),window.removeEventListener("pointermove",f)});function te(){h.value=null}function de(){m.value=!0,b.value=null}function Le(){var ne;m.value=!1;const D=(ne=document.elementFromPoint(p.x,p.y))==null?void 0:ne.closest(".vue-flow__node"),U=D==null?void 0:D.dataset.id;if(!U){b.value=null;return}const le=D.classList.contains("vue-flow__node-group")?"group":D.classList.contains("vue-flow__node-note")?"note":"entity";b.value={kind:le,id:U}}const dt=t.computed(()=>Gh(i.state.logical).map(D=>`${D.consumerRef}>${D.typeRef}:${D.usageCount}`).sort().join("|"));t.watch([()=>i.resolved.value,()=>i.displayMode.value,()=>dt.value],F),t.watch(()=>i.resolved.value,D=>{const U=b.value;if(!U)return;(U.kind==="entity"?D.entities.some(ne=>ne.entity.modelId===U.id):U.kind==="group"?D.groups.some(ne=>ne.group.modelId===U.id):D.notes.some(ne=>ne.note.modelId===U.id))||(b.value=null)});function Xe(D){const U=D.computedPosition??D.position,le=D.dimensions??{width:0,height:0};return{x:U.x+le.width/2,y:U.y+le.height/2}}function yt(D){const U=D.node;if(U){if(b.value=null,U.type==="group"){const le=i.resolved.value.groups.find(ne=>ne.group.modelId===U.id);g.value=le?{groupId:U.id,dx:U.position.x-le.geo.location.x,dy:U.position.y-le.geo.location.y}:null,h.value=null;return}if(U.type!=="entity"&&U.type!=="note"){h.value=null;return}h.value=Z(Xe(U))}}function st(D){var ne;h.value=null,g.value=null;const U=(ne=D.nodes)!=null&&ne.length?D.nodes:[D.node],le=U.filter(xe=>(xe==null?void 0:xe.type)==="group");if(le.length){for(const xe of le){if(!xe)continue;const Be=i.resolved.value.entities.filter(qe=>qe.groupRef===xe.id).map(qe=>{const je=C(qe.entity.modelId),Ie=(je==null?void 0:je.computedPosition)??(je==null?void 0:je.position)??{x:0,y:0};return{id:qe.entity.modelId,location:{x:Ie.x,y:Ie.y}}});i.dragGroup(xe.id,{x:xe.position.x,y:xe.position.y},Be)}return}for(const xe of U){if(!xe||xe.type==="group")continue;const Be=xe.computedPosition??xe.position,qe=xe.dimensions??{width:0,height:0},je={x:Be.x+qe.width/2,y:Be.y+qe.height/2};xe.type==="note"?i.dropNote(xe.id,{x:Be.x,y:Be.y},Z(je)):i.dropEntity(xe.id,{x:Be.x,y:Be.y},Z(je))}}function ft(D){var j,K,ve,Re,me;if(!i.editable.value||!D.source||!D.target)return;const U=((j=C(D.source))==null?void 0:j.type)==="note",le=((K=C(D.target))==null?void 0:K.type)==="note";if(U||le){if(U&&le)return;const Ue=U?D.source:D.target,Ye=U?D.target:D.source;((ve=C(Ye))==null?void 0:ve.type)==="entity"&&i.addNoteConnection(Ue,Ye);return}const ne=Ue=>{var Ye;return(Ye=i.state.logical.entities.find(pt=>pt.modelId===Ue))==null?void 0:Ye.stereotype},xe=ne(D.source)==="JPA_EMBEDDABLE",Be=ne(D.target)==="JPA_EMBEDDABLE";if(xe||Be){if(xe&&Be)return;const Ue=xe?D.source:D.target,Ye=xe?D.target:D.source;i.addEmbedAssociation(Ye,Ue);return}const qe=ne(D.source)==="SERIALIZED_TYPE",je=ne(D.target)==="SERIALIZED_TYPE";if(qe||je){const Ue=je?D.target:D.source,Ye=je?D.source:D.target;Ue!==Ye&&i.addSerializedTypeAttribute(Ye,Ue);return}const Ie=(Re=D.sourceHandle)!=null&&Re.startsWith("r:")?D.sourceHandle.slice(2):void 0,Je=(me=D.targetHandle)!=null&&me.startsWith("l:")?D.targetHandle.slice(2):void 0;i.addAssociation(D.source,D.target,Ie,Je)}const nt=t.ref(null);function J(D,U){var ne;const le=i.state.layout.entityLayouts.find(xe=>xe.entityRef===D);return $t((ne=le==null?void 0:le.attributeStyles)==null?void 0:ne[U])}function ce(D,U){var ne;const le=i.state.layout.entityLayouts.find(xe=>xe.entityRef===D);return $t((ne=le==null?void 0:le.operationStyles)==null?void 0:ne[U])}function Ae(D){var U;return $t((U=i.state.layout.groupLayouts.find(le=>le.groupRef===D))==null?void 0:U.style)}function Ee(D){var U;return $t((U=i.state.layout.notes.find(le=>le.modelId===D))==null?void 0:U.style)}function H(D){var xe,Be;if(D.preventDefault(),!i.editable.value)return;const U=()=>P({x:D.clientX,y:D.clientY}),le=[{caption:i.t("em.ctx.addEntity"),icon:"add-entity",handler:()=>{const qe=U();i.addEntity("NewEntity",{x:qe.x,y:qe.y})}},{caption:i.t("em.ctx.addNote"),icon:"note",handler:()=>{const qe=U();i.addNote("메모",{x:qe.x,y:qe.y})}},{caption:i.t("em.ctx.addGroup"),icon:"folder",handler:()=>{const qe=U();i.addEmptyGroup({x:qe.x,y:qe.y})}}],ne=(xe=i.clipboard.value)==null?void 0:xe.kind;(ne==="entity"||ne==="entities")&&le.push({caption:i.t("em.ctx.paste"),icon:"clipboard",handler:()=>Se(i.paste())}),i.resolved.value.entities.length>0&&le.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()}),(Be=nt.value)==null||Be.open(D,le)}function It({event:D,node:U}){var Ie,Je,j,K,ve,Re,me,Ue,Ye,pt,Pt,ta,gt,Vn,Fr,ry,ly,sy,cy;const le=D;if(le.preventDefault(),!i.editable.value){if(U.type==="group"||U.type==="note")return;const it=(Je=(Ie=le.target)==null?void 0:Ie.closest("[data-attr]"))==null?void 0:Je.dataset.attr;if(it){const bt=i.selection.value;(bt==null?void 0:bt.kind)==="attribute"&&bt.entityId===U.id&&bt.ids.includes(it)||i.selectAttribute(U.id,it);const Bn=((j=i.selection.value)==null?void 0:j.kind)==="attribute"&&i.selection.value.entityId===U.id?[...i.selection.value.ids]:[it];(K=nt.value)==null||K.open(le,[{caption:Bn.length>1?i.t("em.ctx.copyN",{n:Bn.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}(ve=nt.value)==null||ve.open(le,[{caption:i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>hr(a,i,U.id)},Ge(U.id)]);return}if(U.type==="group"){const it=i.isGroupLocked(U.id),bt=[];it||bt.push({type:"swatches",caption:i.t("em.common.color"),current:Ae(U.id),onPick:Bn=>i.setGroupSwatch(U.id,Bn)},{type:"separator"});const Ct=Fe()&&Ce().includes(U.id)?ze():$e(U.id);Ct.length&&bt.push({caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy(Ct)}),bt.push({caption:it?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:it?"unlock":"lock",handler:()=>i.setGroupLocked(U.id,!it)}),it||bt.push({type:"separator"},{caption:i.t("em.ctx.ungroup"),icon:"trash",danger:!0,handler:()=>i.removeGroup(U.id)}),(Re=nt.value)==null||Re.open(le,bt);return}if(U.type==="note"){(me=nt.value)==null||me.open(le,[{type:"swatches",caption:i.t("em.common.color"),current:Ee(U.id),onPick:it=>i.setNoteSwatch(U.id,it)},{type:"separator"},{caption:i.t("em.ctx.deleteNote"),icon:"trash",danger:!0,handler:()=>i.removeNote(U.id)}]);return}const ne=(Ye=(Ue=le.target)==null?void 0:Ue.closest("[data-attr]"))==null?void 0:Ye.dataset.attr;if(ne){const it=i.selection.value;(it==null?void 0:it.kind)==="attribute"&&it.entityId===U.id&&it.ids.includes(ne)||i.selectAttribute(U.id,ne);const Ct=((pt=i.selection.value)==null?void 0:pt.kind)==="attribute"&&i.selection.value.entityId===U.id?[...i.selection.value.ids]:[ne];if(i.isEntityLocked(U.id)){(Pt=nt.value)==null||Pt.open(le,[{caption:Ct.length>1?i.t("em.ctx.copyN",{n:Ct.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}const Bn=Ct.length>1,mc=[{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(U.id)},{type:"swatches",caption:Bn?i.t("em.ctx.colorN",{n:Ct.length}):i.t("em.common.color"),current:Bn?null:J(U.id,ne),onPick:TO=>i.setAttributeSwatches(U.id,Ct,TO)},{type:"separator"},{caption:Bn?i.t("em.ctx.copyN",{n:Ct.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}],na=i.clipboard.value;(na==null?void 0:na.kind)==="attribute"&&mc.push({caption:na.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:na.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:U.id},i.paste()}}),mc.push({type:"separator"},{caption:Bn?i.t("em.ctx.deleteAttrN",{n:Ct.length}):i.t("em.ctx.deleteAttr"),icon:"trash",danger:!0,handler:()=>i.removeAttributes(U.id,Ct)}),(ta=nt.value)==null||ta.open(le,mc);return}const xe=(Vn=(gt=le.target)==null?void 0:gt.closest("[data-op]"))==null?void 0:Vn.dataset.op;if(xe){if(i.isEntityLocked(U.id))return;(Fr=nt.value)==null||Fr.open(le,[{caption:i.t("em.ctx.addOperation"),icon:"method",handler:()=>i.addOperation(U.id)},{type:"swatches",caption:i.t("em.common.color"),current:ce(U.id,xe),onPick:it=>i.setOperationSwatch(U.id,xe,it)},{type:"separator"},{caption:i.t("em.ctx.deleteOperation"),icon:"trash",danger:!0,handler:()=>i.removeOperation(U.id,xe)}]);return}const Be=i.resolved.value.entities.find(it=>it.entity.modelId===U.id),qe=!!(Be!=null&&Be.locked),je=[{caption:qe?i.t("em.ctx.viewDetail"):i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>hr(a,i,U.id)}];if(!qe){je.push({type:"separator"},{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(U.id)},{caption:i.t("em.ctx.addMethod"),icon:"method",handler:()=>i.addOperation(U.id)},{caption:i.t("em.ctx.groupInto"),icon:"folder",handler:()=>{const bt=Y.value.filter(Ct=>Ct.type==="entity").map(Ct=>Ct.id);i.createGroup(bt.includes(U.id)&&bt.length?bt:[U.id])}},{caption:i.t("em.ctx.addSelfAssoc"),icon:"arrow-lr",handler:()=>i.addAssociation(U.id,U.id)});const it=i.embeddableCatalog.value;if(it.length){je.push({type:"separator"});for(const bt of it){const Ct=((ry=bt.label)==null?void 0:ry[i.userLanguage.value])??((ly=bt.label)==null?void 0:ly.ko)??((sy=bt.label)==null?void 0:sy.en)??bt.type;je.push({caption:i.t("em.ctx.addEmbeddableNamed",{label:Ct}),icon:"link",handler:()=>i.addPredefinedEmbed(U.id,bt.type)})}}}if(je.push({type:"separator"}),je.push({caption:Be!=null&&Be.collapsed?i.t("em.panel.expand"):i.t("em.panel.collapse"),icon:Be!=null&&Be.collapsed?"expand-all":"collapse-all",handler:()=>i.setEntityCollapsed(U.id,!(Be!=null&&Be.collapsed))}),Be!=null&&Be.groupRef&&!qe&&je.push({caption:i.t("em.ctx.ungroupEntity"),icon:"folder",handler:()=>i.ungroupEntity(U.id)}),je.push({caption:qe?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:qe?"unlock":"lock",handler:()=>i.setEntityLocked(U.id,!qe)}),je.push(Ge(U.id)),!qe){const it=i.clipboard.value;(it==null?void 0:it.kind)==="attribute"&&je.push({caption:it.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:it.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:U.id},i.paste()}}),je.push({type:"separator"}),je.push({caption:i.t("em.ctx.deleteEntity"),icon:"trash",danger:!0,handler:()=>i.removeEntity(U.id)})}(cy=nt.value)==null||cy.open(le,je)}function Rt({event:D,edge:U}){var Be,qe;const le=D;if(le.preventDefault(),!i.editable.value)return;const ne=A(U.id);if(ne){(Be=nt.value)==null||Be.open(le,[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearNoteConnectionWaypoints(ne.noteRef,ne.targetRef)},{type:"separator"},{caption:i.t("em.ctx.deleteConnection"),icon:"trash",danger:!0,handler:()=>i.removeNoteConnection(ne.noteRef,ne.targetRef)}]);return}const xe=[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearWaypoints(U.id)}];i.isAssociationLocked(U.id)||xe.push({type:"separator"},{caption:i.t("em.ctx.deleteAssociation"),icon:"trash",danger:!0,handler:()=>i.removeAssociation(U.id)}),(qe=nt.value)==null||qe.open(le,xe)}function ot(D){return D==="group"?"group":D==="note"?"note":"entity"}function We({node:D}){if(Y.value.length>1){i.selection.value=null;return}i.selection.value={kind:ot(D.type),id:D.id}}function Ze({nodes:D}){D.length>1&&(i.selection.value=null)}function Q({edge:D}){const U=A(D.id);i.selection.value=U?{kind:"note",id:U.noteRef}:{kind:"association",id:D.id}}function Mt(D){const U=i.selection.value;return!!U&&U.kind!=="attribute"&&U.id===D.id}function Vt(D){var U,le;return Mt(D)?D.type==="group"?"color-mix(in srgb, var(--em-selection) 22%, transparent)":"var(--em-selection)":D.type==="note"?"var(--em-note-soft)":D.type==="group"?tp($t((U=D.data)==null?void 0:U.style),!0)??"var(--em-mm-group)":tp($t((le=D.data)==null?void 0:le.style))??"var(--em-mm-entity)"}function Mn(D){return Mt(D)?"var(--em-selection)":D.type==="note"?"var(--em-note-accent)":D.type==="group"?"var(--em-node-border)":"var(--em-on-surface-muted)"}function an(D,U){M(D,U,{zoom:x().zoom,duration:350})}t.watch(()=>i.focusRequest.value,D=>{if(!D)return;const U=C(D.id);if(!U)return;const le=U.computedPosition??U.position,ne=U.dimensions??{width:0,height:0};an(le.x+ne.width/2,le.y+ne.height/2)});function _e({position:D}){an(D.x,D.y)}function mt({node:D}){i.selection.value={kind:ot(D.type),id:D.id};const U=D.computedPosition??D.position,le=D.dimensions??{width:0,height:0};an(U.x+le.width/2,U.y+le.height/2)}function vt({node:D}){B({nodes:[D.id],duration:350,maxZoom:1.2,padding:.6})}return(D,U)=>(t.openBlock(),t.createElementBlock("div",{tabindex:"-1",class:t.normalizeClass(["em-canvas",{"is-connecting":u.value,"is-panning":m.value}])},[t.createVNode(t.unref(rI),{"min-zoom":.2,"max-zoom":2,"only-render-visible-elements":!he.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(Sn).Loose,"pan-on-scroll":"","zoom-on-scroll":!1,"zoom-on-pinch":!0,"zoom-on-double-click":!1,"zoom-activation-key-code":["Meta","Control"],onMoveStart:de,onMoveEnd:Le,onConnect:ft,onConnectStart:U[1]||(U[1]=le=>u.value=!0),onConnectEnd:U[2]||(U[2]=le=>u.value=!1),onNodeDrag:yt,onNodeDragStop:st,onNodeClick:We,onEdgeClick:Q,onSelectionChange:Ze,onPaneClick:U[3]||(U[3]=le=>t.unref(i).selection.value=null),onPaneContextMenu:H,onNodeContextMenu:It,onEdgeContextMenu:Rt},{"node-group":t.withCtx(le=>[t.createVNode(Vp,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),"node-entity":t.withCtx(le=>[t.createVNode(Mp,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),"node-note":t.withCtx(le=>[t.createVNode(Bp,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),"edge-association":t.withCtx(le=>[t.createVNode(Qp,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),"edge-note-connection":t.withCtx(le=>[t.createVNode(pM,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),"edge-serialized-type":t.withCtx(le=>[t.createVNode(yM,t.normalizeProps(t.guardReactiveProps(le)),null,16)]),default:t.withCtx(()=>[t.unref(i).showGrid.value?(t.openBlock(),t.createBlock(t.unref(nR),{key:0,gap:16,"pattern-color":"var(--em-border)"})):t.createCommentVNode("",!0),t.createVNode(t.unref(xR),{"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(So),{class:"em-palette__group-start",title:t.unref(i).t("em.ctx.addEntity"),onClick:He},{default:t.withCtx(()=>[t.createVNode(Ve,{name:"add-entity",size:14})]),_:1},8,["title"]),t.createVNode(t.unref(So),{title:t.unref(i).t("em.ctx.addNote"),onClick:De},{default:t.withCtx(()=>[t.createVNode(Ve,{name:"note",size:14})]),_:1},8,["title"]),t.createVNode(t.unref(So),{title:t.unref(i).t("em.palette.autoLayout"),onClick:U[0]||(U[0]=le=>t.unref(i).autoLayout())},{default:t.withCtx(()=>[t.createVNode(Ve,{name:"auto-layout",size:14})]),_:1},8,["title"])],64)):t.createCommentVNode("",!0)]),_:1}),t.unref(i).showMinimap.value?(t.openBlock(),t.createBlock(t.unref(dM),{key:1,pannable:"",width:224,height:160,"node-color":Vt,"node-stroke-color":Mn,"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:_e,onNodeClick:mt,onNodeDblclick:vt})):t.createCommentVNode("",!0)]),_:1},8,["only-render-visible-elements","nodes-draggable","nodes-connectable","connection-mode"]),ge.value?(t.openBlock(),t.createElementBlock("div",r2,[t.unref(i).editable.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("p",l2,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,s2),t.createElementVNode("p",{class:"em-canvas__empty-hint",innerHTML:t.unref(i).t("em.canvas.emptyConnectHint")},null,8,c2),t.createElementVNode("p",{class:"em-canvas__empty-hint em-canvas__empty-sub",innerHTML:t.unref(i).t("em.canvas.emptyShortcutHint")},null,8,d2)],64)):(t.openBlock(),t.createElementBlock("p",u2,t.toDisplayString(t.unref(i).t("em.canvas.emptyReadonly")),1))])):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createBlock(i2,{key:1,controller:t.unref(i),onClose:U[4]||(U[4]=le=>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",m2,[t.createVNode(Ve,{name:"alert-triangle",size:16,class:"em-conflict-banner__icon"}),t.createElementVNode("div",f2,[t.createElementVNode("strong",p2,t.toDisplayString(d.value.title),1),t.createElementVNode("span",h2,t.toDisplayString(d.value.detail),1)])])):t.createCommentVNode("",!0)]),_:1}),t.createVNode(SM,{ref_key:"menuRef",ref:nt,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",y2,t.toDisplayString(l.value),1)):t.createCommentVNode("",!0)]),_:1})]))],2))}}),[["__scopeId","data-v-284ee242"]]),g2={class:"em-explorer em-scroll-overlay"},b2={class:"em-explorer__search"},_2=["placeholder","aria-label"],k2=["aria-label","title"],E2={key:0,class:"em-explorer__empty"},N2=["aria-label"],w2=["data-key","aria-level","aria-posinset","aria-setsize","aria-expanded","aria-selected","tabindex","onClick","onDblclick","onFocus","onKeydown"],I2=["onClick"],v2=["title"],C2={class:"em-key-slot"},S2={class:"em-key-slot"},x2={class:"em-explorer__label"},R2={key:2,class:"em-explorer__sr"},ny=Qe(t.defineComponent({__name:"DiagramExplorer",props:{controller:{},storageKey:{}},setup(e,{expose:n}){const o=e,i=o.controller,a=oe.useModal(),r=t.computed(()=>{var He,De;const T=i.resolved.value,w=i.displayMode.value,I=i.userLanguage.value,v=Z=>{var re,ue,z;return aa(w,Z.name,(ue=(re=Z.table)==null?void 0:re.logicalName)==null?void 0:ue[I],(z=Z.table)==null?void 0:z.physicalName,i.t("em.node.logicalMissing"))},B=w==="PHYSICAL"||w==="LOGICAL_PHYSICAL",M=Z=>{const re=Z.attrType.startsWith("RELATION")&&Z.dbAttrs.length>0;return{icon:Z.attrType.startsWith("RELATION")?"link":"field",keyMarks:{pk:Z.identifier,fk:re&&B}}},x=Z=>Z.attrType.startsWith("EMBED")&&Z.dbAttrs.length>0,P=Z=>x(Z)||yn(Z),Y=w==="PHYSICAL"||w==="LOGICAL_PHYSICAL",se=(Z,re)=>{if(yn(Z)){const z=i.state.logical.entities,L=z.find(F=>F.modelId===re);return Z.dbAttrs.map((F,X)=>{const ee=Zn(Z,L,z,i.state.logical.associations,X);return ee?{...F,physicalName:F.physicalName||ee.physicalName,logicalName:F.logicalName??ee.logicalName,dataType:F.dataType||ee.dataType}:F})}if(Z.attrType!=="EMBED_PREDEF")return Z.dbAttrs;const ue=i.embeddableCatalog.value.find(z=>z.type===Z.type);return ue?Z.dbAttrs.map((z,L)=>{const F=ue.fields[L];return F?{...z,physicalName:z.physicalName||F.physicalName,logicalName:z.logicalName??F.logicalName,dataType:z.dataType||F.dataType,length:z.length??F.length}:z}):Z.dbAttrs},he=(Z,re)=>{const ue=ui(Z,Vo(i.state.logical),re,i.state.logical);return ue.kind==="resolved"?ue.entity:void 0},ie=(Z,re,ue)=>{var X,ee,ke,ye,Ne,we,G,q,W;const z={entityId:re,attrId:Z.modelId};if(P(Z)){const Ce=nl(w,Z,ue==null?void 0:ue.collection,ue==null?void 0:ue.targetName,he(Z));return{key:`attr:${Z.modelId}`,label:Z.name+(Ce?` : ${Ce}`:""),icon:"table",attrRef:z,focusId:re,matchText:li(Z.name,(ee=(X=Z.dbAttrs[0])==null?void 0:X.logicalName)==null?void 0:ee[I],(ke=Z.dbAttrs[0])==null?void 0:ke.physicalName),children:Y?se(Z,re).map($e=>{var ze,Fe;return{key:`attr:${Z.modelId}:col:${$e.modelId}`,label:aa(w,$e.physicalName,(ze=$e.logicalName)==null?void 0:ze[I],$e.physicalName,i.t("em.node.logicalMissing"))+($e.dataType?` : ${$e.dataType}`:""),icon:"field",attrRef:z,focusId:re,matchText:li($e.physicalName,(Fe=$e.logicalName)==null?void 0:Fe[I]),children:[]}}):[]}}const L=(ue==null?void 0:ue.collection)??ua(Z,i.state.logical.associations),F=nl(w,Z,L,ue==null?void 0:ue.targetName,he(Z));return{key:`attr:${Z.modelId}`,label:aa(w,Z.name,(Ne=(ye=Z.dbAttrs[0])==null?void 0:ye.logicalName)==null?void 0:Ne[I],(we=Z.dbAttrs[0])==null?void 0:we.physicalName,i.t("em.node.logicalMissing"))+(F?` : ${F}`:""),...M(Z),attrRef:z,focusId:re,matchText:li(Z.name,(q=(G=Z.dbAttrs[0])==null?void 0:G.logicalName)==null?void 0:q[I],(W=Z.dbAttrs[0])==null?void 0:W.physicalName),children:[]}},fe=Z=>{var ee,ke,ye;const re=Z.entity,ue=w==="CLASS",L=ue||re.attributes.some(yn)?bl(re,i.state.logical):void 0,F=ue&&L?L.fields.map(Ne=>Ne.attr):[...re.attributes].sort((Ne,we)=>Ne.order-we.order),X=new Map(((L==null?void 0:L.fields)??[]).filter(Ne=>(ue||yn(Ne.attr))&&(Ne.target||Ne.collection)).map(Ne=>{var we;return[Ne.attr.modelId,{targetName:(we=Ne.target)==null?void 0:we.name,collection:Ne.collection}]}));return{key:`entity:${re.modelId}`,label:v(re),icon:"table",selectKind:"entity",selectId:re.modelId,focusId:re.modelId,matchText:li(re.name,(ke=(ee=re.table)==null?void 0:ee.logicalName)==null?void 0:ke[I],(ye=re.table)==null?void 0:ye.physicalName),children:F.map(Ne=>ie(Ne,re.modelId,X.get(Ne.modelId)))}},pe=new Map,ge=[];for(const Z of T.entities)if(Z.groupRef){const re=pe.get(Z.groupRef)??[];re.push(Z),pe.set(Z.groupRef,re)}else ge.push(Z);const Te=[];for(const Z of T.groups){const re=Z.group;Te.push({key:`group:${re.modelId}`,label:((He=re.name)==null?void 0:He[I])||((De=re.name)==null?void 0:De.ko)||re.packageName||i.t("em.explorer.groupFallback"),icon:"folder",focusId:re.modelId,children:(pe.get(re.modelId)??[]).map(fe)})}for(const Z of ge)Te.push(fe(Z));if(T.associations.length){const Z=new Map(T.entities.map(re=>[re.entity.modelId,v(re.entity)]));Te.push({key:"section:associations",label:i.t("em.explorer.associations",{n:T.associations.length}),icon:"arrow-lr",children:T.associations.map(re=>{const ue=re.association,z=Z.get(ue.end1.entityRef)??ue.end1.entityRef,L=Z.get(ue.end2.entityRef)??ue.end2.entityRef;return{key:`assoc:${ue.modelId}`,label:`${z} — ${L}`,icon:"arrow-lr",selectKind:"association",selectId:ue.modelId,children:[]}})})}return T.notes.length&&Te.push({key:"section:notes",label:i.t("em.explorer.notes",{n:T.notes.length}),icon:"note",children:T.notes.map(({note:Z})=>{var re;return{key:`note:${Z.modelId}`,label:((re=Z.memo.split(`
66
+ `)[0])==null?void 0:re.slice(0,30))||i.t("em.explorer.emptyNote"),icon:"note",selectKind:"note",selectId:Z.modelId,focusId:Z.modelId,children:[]}})}),{key:"root",label:i.state.layout.name||i.t("em.explorer.diagram"),icon:"network",children:Te}});function l(T){return T?T.pk&&T.fk?i.t("em.node.keyPfk"):T.pk?i.t("em.node.keyPk"):T.fk?i.t("em.node.keyFk"):"":""}const s=t.computed(()=>{const T=[],w=I=>{if(I.children.length){I.key!=="root"&&T.push(I.key);for(const v of I.children)w(v)}};return w(r.value),T}),c=T=>T.startsWith("entity:")||T==="section:associations",{isCollapsed:d,toggle:u,toggleAll:m,allExpanded:p}=Wh({expandableKeys:()=>s.value,defaultCollapsed:c,storageKey:o.storageKey,scope:()=>i.state.layout.diagramId}),f=t.ref(""),h=t.ref(null),g=t.computed(()=>f.value.trim().length>0),b=t.computed(()=>{const T=[];if(g.value){const I=HM(r.value,f.value.trim().toLowerCase()),v=(B,M,x,P,Y)=>{if(!I.has(B.key))return;T.push({node:B,depth:M,parentKey:x,posinset:P,setsize:Y});const se=B.children.filter(he=>I.has(he.key));se.forEach((he,ie)=>v(he,M+1,B.key,ie+1,se.length))};return v(r.value,0,null,1,1),T}const w=(I,v,B,M,x)=>{T.push({node:I,depth:v,parentKey:B,posinset:M,setsize:x}),d(I.key)||I.children.forEach((P,Y)=>w(P,v+1,I.key,Y+1,I.children.length))};return w(r.value,0,null,1,1),T}),_=t.ref(null),k=t.ref(null),N=t.computed(()=>{var w;const T=b.value;return k.value&&T.some(I=>I.node.key===k.value)?k.value:((w=T[0])==null?void 0:w.node.key)??null}),y=T=>!g.value&&d(T);async function E(T){var w,I;T&&(k.value=T,await t.nextTick(),(I=(w=_.value)==null?void 0:w.querySelector(`[data-key="${T}"]`))==null||I.focus())}function S(T,w){var B,M,x,P,Y;const I=b.value,v=I.findIndex(se=>se.node.key===w.node.key);switch(T.key){case"ArrowDown":T.preventDefault(),E((B=I[v+1])==null?void 0:B.node.key);return;case"ArrowUp":T.preventDefault(),E((M=I[v-1])==null?void 0:M.node.key);return;case"Home":T.preventDefault(),E((x=I[0])==null?void 0:x.node.key);return;case"End":T.preventDefault(),E((P=I[I.length-1])==null?void 0:P.node.key);return;case"ArrowRight":if(T.preventDefault(),!w.node.children.length)return;y(w.node.key)?u(w.node.key):E((Y=I[v+1])==null?void 0:Y.node.key);return;case"ArrowLeft":T.preventDefault(),w.node.children.length&&!y(w.node.key)?u(w.node.key):E(w.parentKey);return;case"Enter":case" ":T.preventDefault(),C(w.node,T);return;case"F2":T.preventDefault(),R(w.node)}}const A=t.computed(()=>g.value&&b.value.length<=1);function V(T){var v;if(T.key!=="/"||T.metaKey||T.ctrlKey||T.altKey||T.shiftKey)return;const w=T.target,I=w==null?void 0:w.tagName;I==="INPUT"||I==="TEXTAREA"||I==="SELECT"||w!=null&&w.isContentEditable||(T.preventDefault(),(v=h.value)==null||v.focus())}t.onMounted(()=>window.addEventListener("keydown",V)),t.onBeforeUnmount(()=>window.removeEventListener("keydown",V)),n({toggleAll:m,allExpanded:p,hasExpandable:t.computed(()=>s.value.length>0)});function $(T){const w=i.selection.value;return T.attrRef?(w==null?void 0:w.kind)==="attribute"&&w.entityId===T.attrRef.entityId&&w.ids.includes(T.attrRef.attrId):!!w&&w.kind!=="attribute"&&!!T.selectId&&T.selectKind===w.kind&&T.selectId===w.id}function O(T){const w=i.selection.value;return T.selectKind==="entity"&&(w==null?void 0:w.kind)==="attribute"&&w.entityId===T.selectId}function C(T,w){if(T.attrRef){const I=w.shiftKey?"range":w.metaKey||w.ctrlKey?"toggle":"replace";i.selectAttribute(T.attrRef.entityId,T.attrRef.attrId,I)}else T.selectKind&&T.selectId&&(i.selection.value={kind:T.selectKind,id:T.selectId});T.focusId&&i.requestFocus(T.focusId)}function R(T){T.selectKind==="entity"&&T.selectId&&hr(a,i,T.selectId)}return(T,w)=>(t.openBlock(),t.createElementBlock("section",g2,[t.createElementVNode("div",b2,[t.createVNode(Ve,{name:"search",size:14,class:"em-explorer__search-icon"}),t.withDirectives(t.createElementVNode("input",{ref_key:"searchInput",ref:h,"onUpdate:modelValue":w[0]||(w[0]=I=>f.value=I),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:w[1]||(w[1]=t.withKeys(I=>f.value="",["esc"]))},null,40,_2),[[t.vModelText,f.value]]),f.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:w[2]||(w[2]=I=>f.value="")},[t.createVNode(Ve,{name:"x",size:13})],8,k2)):t.createCommentVNode("",!0)]),A.value?(t.openBlock(),t.createElementBlock("p",E2,t.toDisplayString(t.unref(i).t("em.explorer.noMatches")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_key:"rowsEl",ref:_,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,I=>(t.openBlock(),t.createElementBlock("div",{key:I.node.key,class:t.normalizeClass(["em-explorer__row",{"is-active":$(I.node),"is-focus-parent":O(I.node),"is-selectable":!!I.node.selectKind||!!I.node.attrRef||!!I.node.focusId}]),"data-key":I.node.key,role:"treeitem","aria-level":I.depth+1,"aria-posinset":I.posinset,"aria-setsize":I.setsize,"aria-expanded":I.node.children.length?!y(I.node.key):void 0,"aria-selected":$(I.node),tabindex:I.node.key===N.value?0:-1,style:t.normalizeStyle({paddingLeft:4+I.depth*14+"px"}),onClick:v=>C(I.node,v),onDblclick:v=>R(I.node),onFocus:v=>k.value=I.node.key,onKeydown:v=>S(v,I)},[t.createElementVNode("span",{class:t.normalizeClass(["em-explorer__chevron",{"is-leaf":!I.node.children.length,"is-open":!y(I.node.key)}]),onClick:t.withModifiers(v=>I.node.children.length&&t.unref(u)(I.node.key),["stop"])},[I.node.children.length?(t.openBlock(),t.createBlock(Ve,{key:0,name:"chevron",size:14})):t.createCommentVNode("",!0)],10,I2),I.node.keyMarks?(t.openBlock(),t.createElementBlock("span",{key:0,class:"em-explorer__keys",title:l(I.node.keyMarks),"aria-hidden":"true"},[t.createElementVNode("span",C2,[I.node.keyMarks.pk?(t.openBlock(),t.createBlock(Ve,{key:0,name:"key",size:14,class:"em-key is-pk"})):I.node.keyMarks.fk?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(Ve,{key:1,class:"em-explorer__icon",name:I.node.icon,size:14},null,8,["name"]))]),t.createElementVNode("span",S2,[I.node.keyMarks.fk?(t.openBlock(),t.createBlock(Ve,{key:0,name:"key",size:14,class:"em-key is-fk"})):t.createCommentVNode("",!0)])],8,v2)):(t.openBlock(),t.createBlock(Ve,{key:1,class:"em-explorer__icon",name:I.node.icon,size:15},null,8,["name"])),t.createElementVNode("span",x2,t.toDisplayString(I.node.label),1),l(I.node.keyMarks)?(t.openBlock(),t.createElementBlock("span",R2,t.toDisplayString(l(I.node.keyMarks)),1)):t.createCommentVNode("",!0)],46,w2))),128))],8,N2)]))}}),[["__scopeId","data-v-9124d45b"]]),A2={class:"em-text-export"},$2=["id","aria-selected","tabindex","onClick"],T2=["aria-labelledby"],M2={class:"em-text-export__actions"},V2=Qe(t.defineComponent({__name:"TextExportModal",props:{formats:{},title:{},locale:{}},setup(e){const n=e,o=oe.useModalHandle(),i=(m,p)=>en(n.locale??"ko",m,p),a=t.ref(0);function r(){return n.formats[a.value]??n.formats[0]}const l=t.ref(null);async function s(m){var p,f;a.value=m,await t.nextTick(),(f=(p=l.value)==null?void 0:p.querySelectorAll('[role="tab"]')[m])==null||f.focus()}function c(m){const p=n.formats.length;p&&s((a.value+m+p)%p)}async function d(){try{await navigator.clipboard.writeText(r().content),oe.showNotification(i("em.export.copied"),"info")}catch{oe.showNotification(i("em.export.copyFailed"),"error")}}function u(){const m=r(),p=new Blob([m.content],{type:"text/plain;charset=utf-8"}),f=URL.createObjectURL(p);try{const h=document.createElement("a");h.href=f,h.download=m.filename,document.body.appendChild(h),h.click(),h.remove()}finally{URL.revokeObjectURL(f)}}return(m,p)=>(t.openBlock(),t.createBlock(t.unref(oe.BSModalFrame),{title:n.title??i("em.export.title")},{default:t.withCtx(()=>[t.createElementVNode("div",A2,[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,(f,h)=>(t.openBlock(),t.createElementBlock("button",{id:`em-text-export-tab-${h}`,key:f.key,type:"button",role:"tab",class:t.normalizeClass(["em-text-export__tab",{"is-active":h===a.value}]),"aria-selected":h===a.value,"aria-controls":"em-text-export-panel",tabindex:h===a.value?0:-1,onClick:g=>a.value=h,onKeydown:[p[0]||(p[0]=t.withKeys(t.withModifiers(g=>c(-1),["prevent"]),["left"])),p[1]||(p[1]=t.withKeys(t.withModifiers(g=>c(1),["prevent"]),["right"])),p[2]||(p[2]=t.withKeys(t.withModifiers(g=>s(0),["prevent"]),["home"])),p[3]||(p[3]=t.withKeys(t.withModifiers(g=>s(n.formats.length-1),["prevent"]),["end"]))]},t.toDisplayString(f.label),43,$2))),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,T2),t.createElementVNode("div",M2,[t.createVNode(t.unref(oe.BSButton),{caption:i("em.export.copy"),onClick:d},null,8,["caption"]),t.createVNode(t.unref(oe.BSButton),{caption:i("em.export.download"),onClick:u},null,8,["caption"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:i("em.common.close"),onClick:p[4]||(p[4]=f=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-74551f98"]]),B2={class:"em-text-import"},D2=["aria-label"],O2=["aria-checked","tabindex","onClick"],L2=["placeholder"],P2={class:"em-text-import__status"},z2={class:"em-text-import__ok"},F2={key:0,class:"em-text-import__warn"},U2={key:1,class:"em-text-import__err"},H2={key:2,class:"em-text-import__err"},j2={key:3,class:"em-text-import__err"},K2={class:"em-text-import__actions"},G2=Qe(t.defineComponent({__name:"TextImportModal",props:{onImport:{type:Function},locale:{}},setup(e){const n=e,o=oe.useModalHandle(),i=(g,b)=>en(n.locale??"ko",g,b),a=t.ref(""),r=t.ref("auto"),l=[{key:"auto",labelKey:"em.import.formatAuto"},{key:"mermaid",labelKey:"em.import.formatMermaid"},{key:"ddl",labelKey:"em.import.formatDdl"},{key:"json",labelKey:"em.import.formatJson"}],s=t.ref(null);async function c(g){var _,k;const b=l[(g+l.length)%l.length];b&&(r.value=b.key,await t.nextTick(),(k=(_=s.value)==null?void 0:_.querySelectorAll('[role="radio"]')[l.indexOf(b)])==null||k.focus())}function d(g){c(l.findIndex(b=>b.key===r.value)+g)}function u(g){return g?g.startsWith("{")?"json":/\berdiagram\b/i.test(g)?"mermaid":/\bcreate\s+table\b/i.test(g)?"ddl":null:null}const m=t.computed(()=>r.value==="auto"?u(a.value.trim()):r.value),p=t.computed(()=>{const g=a.value.trim();if(!g)return{status:"empty"};const b=m.value;if(!b)return{status:"unknown"};try{let _,k=[];return b==="json"?_=Wc(g):b==="mermaid"?_=Fc(g):(_=Kc(g),k=ol(g).warnings),_.logical.entities.length===0?{status:"emptyParse"}:{status:"ok",source:_,warnings:k}}catch(_){return{status:"error",message:_ instanceof Error?_.message:String(_)}}}),f=t.computed(()=>p.value.status==="ok");function h(){const g=p.value;g.status!=="ok"||!g.source||(n.onImport(g.source),o.close())}return(g,b)=>(t.openBlock(),t.createBlock(t.unref(oe.BSModalFrame),{title:i("em.import.title")},{default:t.withCtx(()=>[t.createElementVNode("div",B2,[t.createElementVNode("div",{ref_key:"fmtEl",ref:s,class:"em-text-import__formats",role:"radiogroup","aria-label":i("em.import.formatGroup")},[(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(l,_=>t.createElementVNode("button",{key:_.key,type:"button",role:"radio",class:t.normalizeClass(["em-text-import__fmt",{"is-active":_.key===r.value}]),"aria-checked":_.key===r.value,tabindex:_.key===r.value?0:-1,onClick:k=>r.value=_.key,onKeydown:[b[0]||(b[0]=t.withKeys(t.withModifiers(k=>d(-1),["prevent"]),["left"])),b[1]||(b[1]=t.withKeys(t.withModifiers(k=>d(1),["prevent"]),["right"])),b[2]||(b[2]=t.withKeys(t.withModifiers(k=>c(0),["prevent"]),["home"])),b[3]||(b[3]=t.withKeys(t.withModifiers(k=>c(l.length-1),["prevent"]),["end"]))]},t.toDisplayString(i(_.labelKey)),43,O2)),64))],8,D2),t.withDirectives(t.createElementVNode("textarea",{"onUpdate:modelValue":b[4]||(b[4]=_=>a.value=_),class:"em-text-import__input",placeholder:i("em.import.placeholder"),spellcheck:"false"},null,8,L2),[[t.vModelText,a.value]]),t.createElementVNode("div",P2,[p.value.status==="ok"&&p.value.source?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("span",z2,t.toDisplayString(i("em.import.detected",{format:i(`em.import.format${m.value==="json"?"Json":m.value==="ddl"?"Ddl":"Mermaid"}`)}))+" · "+t.toDisplayString(i("em.import.summary",{entities:p.value.source.logical.entities.length,relations:p.value.source.logical.associations.length})),1),p.value.warnings&&p.value.warnings.length?(t.openBlock(),t.createElementBlock("span",F2," ⚠ "+t.toDisplayString(i("em.import.warnings",{n:p.value.warnings.length})),1)):t.createCommentVNode("",!0)],64)):p.value.status==="error"?(t.openBlock(),t.createElementBlock("span",U2,t.toDisplayString(i("em.import.error",{message:p.value.message??""})),1)):p.value.status==="unknown"?(t.openBlock(),t.createElementBlock("span",H2,t.toDisplayString(i("em.import.unknownFormat")),1)):p.value.status==="emptyParse"?(t.openBlock(),t.createElementBlock("span",j2,t.toDisplayString(i("em.import.emptyParse")),1)):t.createCommentVNode("",!0)]),t.createElementVNode("div",K2,[t.createVNode(t.unref(oe.BSButton),{caption:i("em.import.confirm"),disabled:!f.value,onClick:h},null,8,["caption","disabled"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:i("em.common.close"),onClick:b[5]||(b[5]=_=>t.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-1059c939"]]),Y2={class:"em-toolbar"},q2=["title"],W2={class:"em-toolbar__mode"},oy=Qe(t.defineComponent({__name:"EditorToolbar",props:{controller:{},historyOpen:{type:Boolean}},emits:["exportSvg","exportPng","toggleHistory"],setup(e,{emit:n}){const i=e.controller,a=n,r=oe.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:h=>i.displayMode.value=h});function c(){i.routingMode.value=i.routingMode.value==="straight"?"orthogonal":"straight"}const d=t.computed(()=>{const h=i.resolved.value.entities;return h.length>0&&h.every(g=>g.collapsed)});function u(){d.value?i.expandAll():i.collapseAll()}function m(){const h=Wr(i.state.logical,i.referenceOnlyDocument.value);r.openModal({component:V2,bind:{title:i.t("em.toolbar.exportText"),locale:i.uiLocale.value,formats:[{key:"text",label:i.t("em.export.formatText"),content:Sc(h,{embeddableCatalog:i.embeddableCatalog.value}),filename:"diagram.txt"},{key:"mermaid-er",label:i.t("em.export.formatMermaidEr"),content:Jr(h,"er",{embeddableCatalog:i.embeddableCatalog.value}),filename:"diagram.er.mmd"},{key:"mermaid-class",label:i.t("em.export.formatMermaidClass"),content:Jr(h,"class"),filename:"diagram.class.mmd"},{key:"ddl",label:i.t("em.export.formatDdl"),content:Gc(h,"postgres",{embeddableCatalog:i.embeddableCatalog.value}),filename:"schema.sql"},{key:"json",label:i.t("em.export.formatJson"),content:qc(h,i.state.layout),filename:"diagram.json"}]}})}function p(){r.openModal({component:G2,bind:{locale:i.uiLocale.value,onImport:h=>{i.importEntities(h,h.logical.entities.map(g=>g.modelId))}}})}function f(){r.openModal({component:ey,bind:{locale:i.uiLocale.value}})}return(h,g)=>(t.openBlock(),t.createElementBlock("div",Y2,[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,q2)):t.createCommentVNode("",!0),t.createVNode(t.unref(oe.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(Ve,{name:"undo",size:16})]),_:1},8,["tooltip","disabled"]),t.createVNode(t.unref(oe.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(Ve,{name:"redo",size:16})]),_:1},8,["tooltip","disabled"]),g[9]||(g[9]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),t.createElementVNode("label",W2,[t.createTextVNode(t.toDisplayString(t.unref(i).t("em.toolbar.displayLabel"))+" ",1),t.createVNode(t.unref(oe.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(oe.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(Ve,{name:"route",size:16})]),_:1},8,["caption","tooltip"]),t.createVNode(t.unref(oe.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(Ve,{name:"grid",size:16})]),_:1},8,["class","caption","tooltip"]),t.createVNode(t.unref(oe.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(Ve,{name:"map",size:16})]),_:1},8,["class","caption","tooltip"]),t.createVNode(t.unref(oe.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(Ve,{name:d.value?"expand-all":"collapse-all",size:16},null,8,["name"])]),_:1},8,["caption","disabled"]),g[10]||(g[10]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.import"),disabled:!t.unref(i).editable.value,onClick:p},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"clipboard",size:16})]),_:1},8,["tooltip","disabled"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportText"),onClick:m},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"file-text",size:16})]),_:1},8,["tooltip"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportSvg"),onClick:g[5]||(g[5]=b=>a("exportSvg"))},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"image",size:16})]),_:1},8,["tooltip"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:t.unref(i).t("em.toolbar.exportPng"),onClick:g[6]||(g[6]=b=>a("exportPng"))},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"camera",size:16})]),_:1},8,["tooltip"]),g[11]||(g[11]=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(oe.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[7]||(g[7]=b=>a("toggleHistory"))},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"history",size:16})]),_:1},8,["class","caption","tooltip"]),g[8]||(g[8]=t.createElementVNode("span",{class:"em-toolbar__sep"},null,-1))],64)):t.createCommentVNode("",!0),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-toolbar__icon-btn em-toolbar__help",tooltip:t.unref(i).t("em.toolbar.shortcuts"),onClick:f},{left:t.withCtx(()=>[t.createVNode(Ve,{name:"help",size:16})]),_:1},8,["tooltip"])]))}}),[["__scopeId","data-v-ba562aa2"]]),J2=["title"],X2=["title"],Z2=["disabled","aria-pressed"],Q2=["disabled","aria-pressed"],eV=Qe(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=>en(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(Ve,{name:"lock",size:14}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.frozen")),1)],8,J2)):(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(Ve,{name:"eye",size:13}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.view")),1)],10,Z2),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(Ve,{name:"pencil",size:13}),t.createElementVNode("span",null,t.toDisplayString(a("em.mode.edit")),1)],10,Q2)],10,X2))}}),[["__scopeId","data-v-2b5162b7"]]),tV=["disabled"],nV={class:"em-panel__sub"},oV={class:"em-nav"},iV={key:0,class:"em-nav__divider","aria-hidden":"true"},aV={key:1},rV=["onClick","onKeydown"],lV={class:"em-nav__name"},sV=["title"],cV={key:0,class:"em-panel__note"},dV=["data-attr-block"],uV={key:0,class:"em-embed-col__label"},mV={class:"em-attr__row"},fV=["title"],pV={key:1,class:"em-attr__row"},hV={key:2,class:"em-embed-cols"},yV={class:"em-embed-col"},gV={class:"em-embed-col__label"},bV={class:"em-attr__row"},_V={class:"em-attr__navhint"},kV={key:3,class:"em-attr__navhint"},EV={key:4,class:"em-attr__navhint"},NV={key:0,class:"em-attr__navhint"},wV={class:"em-attr__row"},IV={class:"em-attr__row"},vV=["title"],CV={class:"em-attr__flags"},SV={class:"em-attr__pii"},xV={class:"em-attr__pii"},RV={key:1,class:"em-attr__pii"},AV={key:2,class:"em-attr__pii em-attr__codetop"},$V={class:"em-multilang"},TV={key:6,class:"em-embed-cols"},MV={key:0,class:"em-attr__navhint"},VV={class:"em-embed-col__label"},BV={class:"em-attr__row"},DV=["title"],OV=["title"],LV=["title"],PV={class:"em-attr__row"},zV={key:0,class:"em-embed-upd"},FV={key:1,class:"em-attr__navhint"},UV={class:"em-embed-upd"},HV={class:"em-embed-upd"},jV={class:"em-attr__flags"},KV={class:"em-multilang"},GV={class:"em-swatch__row em-attr__swatch"},YV=["title","onClick"],qV=["title","onClick"],WV={key:0,class:"em-attr__swatch-hint"},JV=Qe(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,setAttr:u,isDerivedIdRow:m,rowName:p,rowNamePlaceholder:f,setRowName:h,assocFieldName:g,setAssocFieldName:b,nameLocked:_,nameLockedHint:k,isManagedFk:N,setNaturalId:y,setIdentifier:E,setTransient:S,dbLocked:A,fkDerived:V,fkOriginPhysical:$,typeValueOf:O,typeLabelOf:C,setAttrType:R,setAttrCustomType:T,setDb:w,scaleApplicable:I,scaleHint:v,setDbLogical:B,setAttrDescription:M,attrPiiValue:x,setAttrPii:P,predefinedCustomTypeCatalog:Y,serializedTypeNames:se,embeddableCatalog:he,predefinedLabel:ie,groupCodeCatalog:fe,attrGroupCodes:pe,attrCodeItems:ge,codeValueOf:Te,codeLabelOf:He,setAttrGroupCode:De,setAttrCode:Z,setAttrDefaultValue:re,hasColumnSlots:ue,isMultiColFk:z,setDbAt:L,setDbLogicalAt:F,colSlotMeta:X,fixedDataType:ee,fixedLength:ke,fixedScale:ye,slotFixedHint:Ne,updatableItems:we,updatableLabel:G,updatableValue:q,setUpdatableAt:W,setUpdatable:Ce,insertableItems:$e,insertableLabel:ze,insertableValue:Fe,setInsertableAt:ae,setInsertable:Se,sharedItems:Ge,sharedLabel:et,sharedValue:te,setSharedAt:de,isShared:Le,sharedPhysical:dt}=ap(o,()=>n.entityId),Xe=t.computed(()=>i.value?o.state.layout.entityLayouts.find(We=>We.entityRef===i.value.modelId)??null:null),yt=t.computed(()=>{var We;return((We=i.value)==null?void 0:We.attributes.filter(Ze=>Ze.attrType!=="DIVIDER"))??[]}),st=t.computed(()=>{var We;return((We=i.value)==null?void 0:We.attributes)??[]}),ft=t.computed(()=>yt.value.filter(We=>l.value.has(We.modelId)));function nt(We){return{pk:We.identifier,fk:We.attrType.startsWith("RELATION")&&We.dbAttrs.length>0,required:We.notNull&&!We.identifier}}function J(We){const Ze=nt(We),Q=[Ze.pk&&"PK",Ze.fk&&"FK",Ze.required&&"NOT NULL"].filter(Boolean);return Q.length?Q.join(" · "):void 0}function ce(We,Ze){i.value&&o.selectAttribute(i.value.modelId,We.modelId,Ze.shiftKey?"range":Ze.metaKey||Ze.ctrlKey?"toggle":"replace")}function Ae(We){var Ze,Q;return $t((Q=(Ze=Xe.value)==null?void 0:Ze.attributeStyles)==null?void 0:Q[We.modelId])}function Ee(We){return l.value.size>1&&l.value.has(We.modelId)}function H(We,Ze){if(!i.value)return;const Q=Ee(We)?o.selectedAttrIds.value:[We.modelId];o.setAttributeSwatches(i.value.modelId,Q,Ze)}const It=t.ref(void 0);function Rt(We){if(!We||!i.value)return;const Ze=o.addPredefinedEmbed(i.value.modelId,We);Ze&&o.selectAttribute(i.value.modelId,Ze),It.value=void 0}function ot(){if(!i.value)return;const We=o.addAttribute(i.value.modelId);We&&o.selectAttribute(i.value.modelId,We)}return(We,Ze)=>t.unref(i)?(t.openBlock(),t.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!t.unref(o).editable.value},[t.createElementVNode("h4",nV,[t.createTextVNode(t.toDisplayString(t.unref(o).t("em.attr.section",{n:yt.value.length}))+" ",1),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(o).t("em.common.add"),onClick:ot},null,8,["caption"]),t.unref(he).length?(t.openBlock(),t.createBlock(t.unref(oe.BSSelect),{key:0,width:"120px",placeholder:t.unref(o).t("em.attr.addEmbeddable"),"model-value":It.value,items:t.unref(he),"value-provider":Q=>Q.type,"label-provider":t.unref(ie),"onUpdate:modelValue":Rt},null,8,["placeholder","model-value","items","value-provider","label-provider"])):t.createCommentVNode("",!0)]),t.createElementVNode("ul",oV,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(st.value,Q=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:Q.modelId},[Q.attrType==="DIVIDER"?(t.openBlock(),t.createElementBlock("li",iV,[...Ze[0]||(Ze[0]=[t.createElementVNode("hr",null,null,-1)])])):(t.openBlock(),t.createElementBlock("li",aV,[t.createElementVNode("div",{class:t.normalizeClass(["em-nav__item",{"is-selected":t.unref(l).has(Q.modelId)}]),role:"button",tabindex:"0",onClick:Mt=>ce(Q,Mt),onKeydown:[t.withKeys(t.withModifiers(Mt=>ce(Q,Mt),["prevent"]),["enter"]),t.withKeys(t.withModifiers(Mt=>ce(Q,Mt),["prevent"]),["space"])]},[t.createElementVNode("span",lV,t.toDisplayString(Q.name||t.unref(o).t("em.attr.nameless")),1),t.createElementVNode("span",{class:"em-nav__marks",title:J(Q)},[nt(Q).pk?(t.openBlock(),t.createBlock(Ve,{key:0,name:"key",size:12,class:"em-nav-key is-pk"})):nt(Q).required?(t.openBlock(),t.createBlock(Ve,{key:1,name:"asterisk",size:14,class:"em-nav-key is-required"})):t.createCommentVNode("",!0),nt(Q).fk?(t.openBlock(),t.createBlock(Ve,{key:2,name:"key",size:12,class:"em-nav-key is-fk"})):t.createCommentVNode("",!0)],8,sV)],42,rV)]))],64))),128))]),yt.value.length&&!ft.value.length?(t.openBlock(),t.createElementBlock("p",cV,t.toDisplayString(t.unref(o).t("em.attr.selectHint")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(ft.value,Q=>{var Mt,Vt,Mn,an,_e,mt,vt,D,U,le;return t.openBlock(),t.createElementBlock("div",{key:Q.modelId,class:t.normalizeClass(["em-attr",{"is-focused":t.unref(l).has(Q.modelId)}]),"data-attr-block":Q.modelId},[t.unref(m)(Q)?(t.openBlock(),t.createElementBlock("span",uV,t.toDisplayString(t.unref(o).t("em.attr.derivedIdField")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",mV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`attr-name-${Q.modelId}`,width:"100%",disabled:t.unref(_)(Q),title:t.unref(_)(Q)?t.unref(k)(Q):t.unref(m)(Q)?t.unref(o).t("em.attr.derivedIdNote"):void 0,placeholder:t.unref(f)(Q),"model-value":t.unref(p)(Q),"onUpdate:modelValue":ne=>t.unref(h)(Q,ne)},null,8,["name","disabled","title","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSSelect),{name:`attr-type-${Q.modelId}`,width:"84px",placeholder:t.unref(o).t("em.attr.typePlaceholder"),disabled:Q.attrType.startsWith("EMBED")||!!Q.groupCode||Q.attrType==="RELATION_REF"||t.unref(V)(Q),items:t.unref(Pc)(Q.type,t.unref(Y),t.unref(se)),"value-provider":t.unref(O),"label-provider":t.unref(C),"model-value":Q.type,"onUpdate:modelValue":ne=>t.unref(R)(Q,ne)},null,8,["name","placeholder","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(N)(Q)?t.unref(o).t("em.attr.fkDeleteHint"):void 0},[t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:ne=>t.unref(o).removeAttribute(t.unref(i).modelId,Q.modelId)},null,8,["onClick"])],8,fV)]),Q.type===t.unref(_n)&&!t.unref(V)(Q)?(t.openBlock(),t.createElementBlock("div",pV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`attr-customtype-${Q.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.customTypePlaceholder"),"model-value":Q.customType??"","onUpdate:modelValue":ne=>t.unref(T)(Q,ne)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(m)(Q)?(t.openBlock(),t.createElementBlock("div",hV,[t.createElementVNode("div",yV,[t.createElementVNode("span",gV,t.toDisplayString(t.unref(o).t("em.attr.assocField")),1),t.createElementVNode("div",bV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`attr-assocname-${Q.modelId}`,width:"100%",title:t.unref(o).t("em.attr.derivedIdNote"),placeholder:t.unref(o).t("em.attr.namePlaceholder"),"model-value":t.unref(g)(Q),"onUpdate:modelValue":ne=>t.unref(b)(Q,ne)},null,8,["name","title","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("p",_V,t.toDisplayString(t.unref(o).t("em.attr.derivedIdNote")),1)])])):t.createCommentVNode("",!0),Q.attrType==="RELATION_REF"?(t.openBlock(),t.createElementBlock("p",kV,t.toDisplayString(t.unref(o).t("em.attr.inverseNavHint")),1)):t.createCommentVNode("",!0),t.unref(r)?(t.openBlock(),t.createElementBlock("p",EV,t.toDisplayString(t.unref(o).t("em.attr.serializedNoColumnNote")),1)):t.unref(ue)(Q)?(t.openBlock(),t.createElementBlock("div",TV,[t.unref(z)(Q)?(t.openBlock(),t.createElementBlock("p",MV,t.toDisplayString(t.unref(o).t("em.attr.fkDerivedNote")),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Q.dbAttrs,(ne,xe)=>{var Be,qe,je,Ie,Je,j,K,ve;return t.openBlock(),t.createElementBlock("div",{key:ne.modelId,class:"em-embed-col"},[t.createElementVNode("span",VV,t.toDisplayString(((Be=t.unref(X)(Q,xe))==null?void 0:Be.name)??((qe=t.unref(X)(Q,xe))==null?void 0:qe.physicalName)??t.unref(o).t("em.attr.colFallback",{n:xe+1})),1),t.createElementVNode("div",BV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`embed-col-${ne.modelId}`,width:"100%",disabled:t.unref(Le)(ne),placeholder:((je=t.unref(X)(Q,xe))==null?void 0:je.physicalName)??t.unref(o).t("em.attr.columnPlaceholder"),"model-value":t.unref(Le)(ne)?t.unref(dt)(ne):ne.physicalName,"onUpdate:modelValue":Re=>t.unref(L)(Q,xe,{physicalName:Re})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(Ne)(Q)},[t.createVNode(t.unref(oe.BSTextInput),{name:`embed-dtype-${ne.modelId}`,width:"84px",disabled:"","model-value":t.unref(ee)(Q,xe)},null,8,["name","model-value"])],8,DV),t.createElementVNode("span",{title:t.unref(Ne)(Q)},[t.createVNode(t.unref(oe.BSNumberInput),{name:`embed-len-${ne.modelId}`,width:"48px",disabled:"","model-value":t.unref(ke)(Q,xe)},null,8,["name","model-value"])],8,OV),t.createElementVNode("span",{title:t.unref(Ne)(Q)},[t.createVNode(t.unref(oe.BSNumberInput),{name:`embed-scale-${ne.modelId}`,width:"48px",disabled:"","model-value":t.unref(ye)(Q,xe)},null,8,["name","model-value"])],8,LV)]),t.createVNode(vo,{controller:t.unref(o),"ref-id":ne.modelId},null,8,["controller","ref-id"]),t.createElementVNode("div",PV,[t.createVNode(Qt,{class:"grow",name:`embed-logical-${ne.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,placeholder:((Je=(Ie=t.unref(X)(Q,xe))==null?void 0:Ie.logicalName)==null?void 0:Je[t.unref(o).userLanguage.value])??((K=(j=t.unref(X)(Q,xe))==null?void 0:j.logicalName)==null?void 0:K.ko)??t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":ne.logicalName,"onUpdate:modelValue":Re=>t.unref(F)(Q,xe,Re)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),(ve=t.unref(X)(Q,xe))!=null&&ve.shareable?(t.openBlock(),t.createElementBlock("label",zV,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.currencyColumn")),1),t.createVNode(t.unref(oe.BSSelect),{width:"110px","model-value":t.unref(te)(ne),items:t.unref(Ge)(),"value-provider":t.unref(d),"label-provider":t.unref(et),"onUpdate:modelValue":Re=>Re&&t.unref(de)(Q,xe,Re)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(Le)(ne)?(t.openBlock(),t.createElementBlock("p",FV,t.toDisplayString(t.unref(o).t("em.attr.embedSharedHint")),1)):t.createCommentVNode("",!0),t.createElementVNode("label",UV,[Ze[3]||(Ze[3]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"110px",disabled:t.unref(Le)(ne),"model-value":t.unref(Le)(ne)?"false":t.unref(Fe)(ne),items:t.unref($e),"value-provider":t.unref(d),"label-provider":t.unref(ze),"onUpdate:modelValue":Re=>Re&&t.unref(ae)(Q,xe,Re)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",HV,[Ze[4]||(Ze[4]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"110px",disabled:t.unref(Le)(ne),"model-value":t.unref(Le)(ne)?"false":t.unref(q)(ne),items:t.unref(we),"value-provider":t.unref(d),"label-provider":t.unref(G),"onUpdate:modelValue":Re=>Re&&t.unref(W)(Q,xe,Re)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])])])}),128)),t.unref(z)(Q)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",jV,[t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-pk-${Q.modelId}`,label:"Primary Key","model-value":Q.identifier,disabled:"","onUpdate:modelValue":ne=>t.unref(E)(Q,ne)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-nn-${Q.modelId}`,label:"Not Null","model-value":Q.notNull,disabled:"","onUpdate:modelValue":ne=>t.unref(u)(Q,{notNull:ne})},null,8,["name","model-value","onUpdate:modelValue"])]),t.createElementVNode("fieldset",KV,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`attr-desc-${Q.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":Q.description,"onUpdate:modelValue":ne=>t.unref(M)(Q,ne)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)):t.createCommentVNode("",!0)])):(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[t.unref(V)(Q)?(t.openBlock(),t.createElementBlock("p",NV,t.toDisplayString(t.unref(o).t("em.attr.fkDerivedNote")),1)):t.createCommentVNode("",!0),t.createElementVNode("div",wV,[t.createVNode(Qt,{class:"grow",name:`attr-logical-${Q.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,placeholder:t.unref(o).t("em.attr.logicalPlaceholder"),"model-value":(Mt=Q.dbAttrs[0])==null?void 0:Mt.logicalName,"onUpdate:modelValue":ne=>t.unref(B)(Q,ne)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),t.createElementVNode("div",IV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`attr-col-${Q.modelId}`,width:"100%",placeholder:t.unref($)(Q)??t.unref(o).t("em.attr.columnPlaceholder"),disabled:t.unref(A)(Q),"model-value":((Vt=Q.dbAttrs[0])==null?void 0:Vt.physicalName)??"","onUpdate:modelValue":ne=>t.unref(w)(Q,{physicalName:ne})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSSelect),{name:`attr-dtype-${Q.modelId}`,width:"84px",placeholder:"dataType",disabled:t.unref(A)(Q)||t.unref(V)(Q),items:t.unref(Dc)(((Mn=Q.dbAttrs[0])==null?void 0:Mn.dataType)??"",t.unref(o).selectableDataTypes.value),"value-provider":t.unref(d),"label-provider":t.unref(Qr),"model-value":((an=Q.dbAttrs[0])==null?void 0:an.dataType)??"","onUpdate:modelValue":ne=>ne&&t.unref(w)(Q,{dataType:ne})},null,8,["name","disabled","items","value-provider","label-provider","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSNumberInput),{name:`attr-len-${Q.modelId}`,width:"48px",placeholder:"len",disabled:t.unref(A)(Q)||t.unref(V)(Q),"model-value":(_e=Q.dbAttrs[0])==null?void 0:_e.length,"onUpdate:modelValue":ne=>t.unref(w)(Q,{length:ne||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),t.createElementVNode("span",{title:t.unref(v)(Q)},[t.createVNode(t.unref(oe.BSNumberInput),{name:`attr-scale-${Q.modelId}`,width:"48px",placeholder:"scale",disabled:t.unref(A)(Q)||t.unref(V)(Q)||!t.unref(I)(Q),"model-value":(mt=Q.dbAttrs[0])==null?void 0:mt.scale,"onUpdate:modelValue":ne=>t.unref(w)(Q,{scale:ne||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])],8,vV)]),t.createVNode(vo,{controller:t.unref(o),"ref-id":(vt=Q.dbAttrs[0])==null?void 0:vt.modelId},null,8,["controller","ref-id"]),t.createElementVNode("div",CV,[t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-pk-${Q.modelId}`,label:"Primary Key","model-value":Q.identifier,disabled:t.unref(a)||t.unref(A)(Q)||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(E)(Q,ne)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-nn-${Q.modelId}`,label:"Not Null","model-value":Q.notNull,disabled:t.unref(A)(Q)||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(u)(Q,{notNull:ne})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-uq-${Q.modelId}`,label:"Unique","model-value":!!((D=Q.dbAttrs[0])!=null&&D.unique),disabled:t.unref(A)(Q)||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(w)(Q,{unique:ne})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-ai-${Q.modelId}`,label:"Auto Increment","model-value":!!((U=Q.dbAttrs[0])!=null&&U.autoIncrement),disabled:t.unref(A)(Q)||t.unref(V)(Q)||!Q.identifier,"onUpdate:modelValue":ne=>t.unref(w)(Q,{autoIncrement:ne})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-tr-${Q.modelId}`,label:"@Transient","model-value":!!Q.transient,disabled:Q.identifier||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(S)(Q,ne)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-nid-${Q.modelId}`,label:"@NaturalId","model-value":!!Q.naturalId,disabled:Q.identifier||t.unref(A)(Q)||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(y)(Q,ne)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{class:"em-attr__flag-sub",name:`attr-nidm-${Q.modelId}`,label:"mutable","model-value":!!Q.naturalIdMutable,disabled:t.unref(A)(Q)||!Q.naturalId,"onUpdate:modelValue":ne=>t.unref(u)(Q,{naturalIdMutable:ne||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`attr-mv-${Q.modelId}`,label:"Multi-Value (Set)","model-value":!!((le=Q.dbAttrs[0])!=null&&le.multiValue),disabled:t.unref(A)(Q)||t.unref(V)(Q),"onUpdate:modelValue":ne=>t.unref(w)(Q,{multiValue:ne||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),t.createElementVNode("label",SV,[Ze[1]||(Ze[1]=t.createElementVNode("span",null,"insertable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"100%",disabled:t.unref(A)(Q),"model-value":t.unref(Fe)(Q.dbAttrs[0]),items:t.unref($e),"value-provider":t.unref(d),"label-provider":t.unref(ze),"onUpdate:modelValue":ne=>ne&&t.unref(Se)(Q,ne)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.createElementVNode("label",xV,[Ze[2]||(Ze[2]=t.createElementVNode("span",null,"updatable",-1)),t.createVNode(t.unref(oe.BSSelect),{width:"100%",disabled:t.unref(A)(Q),"model-value":t.unref(q)(Q.dbAttrs[0]),items:t.unref(we),"value-provider":t.unref(d),"label-provider":t.unref(G),"onUpdate:modelValue":ne=>ne&&t.unref(Ce)(Q,ne)},null,8,["disabled","model-value","items","value-provider","label-provider","onUpdate:modelValue"])]),t.unref(V)(Q)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",RV,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.pii")),1),t.createVNode(t.unref(oe.BSSelect),{width:"100%","model-value":t.unref(x)(Q),items:t.unref(s),"value-provider":t.unref(d),"label-provider":t.unref(c),"onUpdate:modelValue":ne=>ne&&t.unref(P)(Q,ne)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])])),t.unref(fe).length&&!t.unref(V)(Q)?(t.openBlock(),t.createElementBlock("label",AV,[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.codeGroup")),1),t.createVNode(dp,{"model-value":Q.groupCode,items:t.unref(fe),locale:t.unref(o).uiLocale.value,"onUpdate:modelValue":ne=>t.unref(De)(Q,ne)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):t.createCommentVNode("",!0),t.unref(V)(Q)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("label",{key:3,class:t.normalizeClass(["em-attr__pii",{"em-attr__codetop":!t.unref(fe).length}])},[t.createElementVNode("span",null,t.toDisplayString(t.unref(o).t("em.attr.defaultValue")),1),t.unref(pe)(Q).length?(t.openBlock(),t.createBlock(t.unref(oe.BSSelect),{key:0,width:"100%","model-value":Q.defaultValue??"none",items:t.unref(ge)(Q),"value-provider":t.unref(Te),"label-provider":t.unref(He),"onUpdate:modelValue":ne=>ne&&t.unref(Z)(Q,ne)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"])):(t.openBlock(),t.createBlock(t.unref(oe.BSTextInput),{key:1,name:`attr-default-${Q.modelId}`,width:"100%",placeholder:t.unref(o).t("em.attr.defaultValue"),"model-value":Q.defaultValue??"","onUpdate:modelValue":ne=>t.unref(re)(Q,ne)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))],2)),t.createElementVNode("fieldset",$V,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(o).t("em.common.description")),1),t.createVNode(Qt,{multiline:"",name:`attr-desc-${Q.modelId}`,languages:t.unref(o).languages.value,"default-lang":t.unref(o).userLanguage.value,"model-value":Q.description,"onUpdate:modelValue":ne=>t.unref(M)(Q,ne)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)),t.createElementVNode("div",GV,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":Ae(Q)===null}]),title:t.unref(o).t("em.swatch.none"),onClick:ne=>H(Q,null)},"∅",10,YV),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),ne=>(t.openBlock(),t.createElementBlock("button",{key:ne,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":Ae(Q)===ne}]),style:t.normalizeStyle({background:t.unref(ei)(ne)}),title:t.unref(o).t(t.unref(Io)(ne)),onClick:xe=>H(Q,ne)},null,14,qV))),128)),Ee(Q)?(t.openBlock(),t.createElementBlock("span",WV,t.toDisplayString(t.unref(o).t("em.attr.batchHint",{n:t.unref(l).size})),1)):t.createCommentVNode("",!0)])],10,dV)}),128))],8,tV)):t.createCommentVNode("",!0)}}),[["__scopeId","data-v-0ece25e9"]]),XV=["disabled"],ZV={class:"em-panel__sub-label"},QV={class:"em-attr__row"},eB={class:"em-field em-idx-params"},tB=["value","placeholder","onChange"],nB=Qe(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(E=>E.modelId===o.entityId)??null),l=t.computed(()=>r.value?ci(r.value,a.superClassCatalog.value):[]),s=t.computed(()=>{var E;return Jn(((E=r.value)==null?void 0:E.attributes)??[])}),c=E=>s.value.canon(E),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(()=>[...pp(d.value).map(E=>({value:E.ref,label:E.label})),...l.value.map(E=>({value:E.modelId,label:a.t("em.index.inherited",{field:E.field})}))]);function m(E,S){var O;const A=new Set(E.columns.filter((C,R)=>R!==S).map(C=>c(C.columnRef))),V=u.value.filter(C=>!A.has(c(C.value))),$=(O=E.columns[S])==null?void 0:O.columnRef;return $&&!V.some(C=>C.value===$)&&V.push({value:$,label:p($)}),V}function p(E){return Vs(E,d.value)}function f(E){const S=new Set(E.columns.map(A=>c(A.columnRef)));return u.value.filter(A=>!S.has(c(A.value)))}function h(){var S;if(!r.value)return;const E=u.value[0];a.addIndex(r.value.modelId,{modelId:Pe(),name:`idx_${(((S=r.value.indexes)==null?void 0:S.length)??0)+1}`,unique:!1,columns:E?[{columnRef:E.value,descending:!1}]:[]})}function g(E,S){r.value&&a.updateIndex(r.value.modelId,E,S)}function b(E){const S=f(E)[0];S&&g(E.modelId,{columns:[...E.columns,{columnRef:S.value,descending:!1}]})}function _(E,S,A){g(E.modelId,{columns:E.columns.map((V,$)=>$===S?{...V,columnRef:A}:V)})}function k(E,S,A){g(E.modelId,{columns:E.columns.map((V,$)=>$===S?{...V,descending:A}:V)})}function N(E,S){g(E.modelId,{columns:E.columns.filter((A,V)=>V!==S)})}function y(E,S){g(E.modelId,{parameters:S.trim()===""?void 0:S})}return(E,S)=>{var A;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]=V=>e.collapsible&&i("toggle"))},[t.createElementVNode("span",ZV,[e.collapsible?(t.openBlock(),t.createBlock(Ve,{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:((A=r.value.indexes)==null?void 0:A.length)??0})),1)]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(a).t("em.common.add"),onClick:t.withModifiers(h,["stop"])},null,8,["caption"])],2),!e.collapsible||!e.collapsed?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(r.value.indexes??[],V=>(t.openBlock(),t.createElementBlock("div",{key:V.modelId,class:"em-attr"},[t.createElementVNode("div",QV,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`idx-name-${V.modelId}`,width:"100%",placeholder:t.unref(a).t("em.index.namePlaceholder"),"model-value":V.name,"onUpdate:modelValue":$=>g(V.modelId,{name:$})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`idx-uq-${V.modelId}`,class:"em-check",label:"UQ","model-value":V.unique,"onUpdate:modelValue":$=>g(V.modelId,{unique:$})},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:$=>t.unref(a).removeIndex(r.value.modelId,V.modelId)},null,8,["onClick"])]),t.createVNode(vo,{controller:t.unref(a),"ref-id":V.modelId},null,8,["controller","ref-id"]),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(V.columns,($,O)=>(t.openBlock(),t.createElementBlock("div",{key:O,class:"em-attr__row"},[t.createVNode(t.unref(oe.BSSelect),{class:"grow","model-value":$.columnRef,items:m(V,O),"value-provider":C=>C.value,"label-provider":C=>C.label,"onUpdate:modelValue":C=>C&&_(V,O,C)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSCheckbox),{name:`idx-${V.modelId}-desc-${O}`,class:"em-check",label:"DESC","model-value":$.descending,"onUpdate:modelValue":C=>k(V,O,C)},null,8,["name","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:"−",onClick:C=>N(V,O)},null,8,["onClick"])]))),128)),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(a).t("em.index.addColumn"),disabled:!f(V).length,onClick:$=>b(V)},null,8,["caption","disabled","onClick"]),t.createElementVNode("label",eB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.index.condition")),1),t.createElementVNode("textarea",{class:"em-textarea",value:V.parameters??"",rows:"2",placeholder:t.unref(a).t("em.index.conditionPlaceholder"),onChange:$=>y(V,$.target.value)},null,40,tB)])]))),128)):t.createCommentVNode("",!0)],8,XV)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-ee0032b1"]]),oB=["disabled"],iB={class:"em-panel__sub-label"},aB={class:"em-attr__row"},rB={class:"em-attr__row"},lB={class:"em-multilang"},sB={class:"em-attr__pii"},cB={class:"em-swatch__row em-attr__swatch"},dB=["title","onClick"],uB=["title","onClick"],mB=Qe(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=oe.useModal(),l=t.computed(()=>a.state.logical.entities.find(N=>N.modelId===o.entityId)??null),s=t.computed(()=>l.value?a.state.layout.entityLayouts.find(N=>N.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(N){return N==="none"?a.t("em.common.noneParen"):N}const m=N=>N;function p(N,y){l.value&&a.updateOperation(l.value.modelId,N.modelId,y)}function f(N,y){p(N,{description:Object.keys(y).length?y:void 0})}function h(N){return N.personalInfoAttributeType??"none"}function g(N,y){p(N,{personalInfoAttributeType:y==="none"?void 0:y})}function b(N){var y,E;return $t((E=(y=s.value)==null?void 0:y.operationStyles)==null?void 0:E[N.modelId])}function _(N,y){l.value&&a.setOperationSwatch(l.value.modelId,N.modelId,y)}function k(N){r.openModal({component:hp,bind:{operationName:N.name,sourceCode:N.sourceCode??"",locale:a.uiLocale.value,onSave:y=>p(N,{sourceCode:y})}})}return(N,y)=>{var E;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:y[1]||(y[1]=S=>e.collapsible&&i("toggle"))},[t.createElementVNode("span",iB,[e.collapsible?(t.openBlock(),t.createBlock(Ve,{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:((E=l.value.operations)==null?void 0:E.length)??0})),1)]),t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(a).t("em.common.add"),onClick:y[0]||(y[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",aB,[t.createVNode(t.unref(oe.BSTextInput),{class:"grow",name:`op-name-${S.modelId}`,width:"100%",placeholder:t.unref(a).t("em.op.namePlaceholder"),"model-value":S.name,"onUpdate:modelValue":A=>p(S,{name:A})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSSelect),{width:"96px","model-value":S.visibility??"PACKAGE",items:c,"value-provider":m,"label-provider":m,"onUpdate:modelValue":A=>A&&p(S,{visibility:A})},null,8,["model-value","onUpdate:modelValue"]),t.createVNode(t.unref(oe.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:A=>t.unref(a).removeOperation(l.value.modelId,S.modelId)},null,8,["onClick"])]),t.createElementVNode("div",rB,[t.createVNode(t.unref(oe.BSButton),{variant:"text",caption:t.unref(a).t(S.sourceCode?"em.op.editBodyDirty":"em.op.editBody"),onClick:A=>k(S)},null,8,["caption","onClick"])]),t.createElementVNode("fieldset",lB,[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":A=>f(S,A)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])]),t.createElementVNode("label",sB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.attr.pii")),1),t.createVNode(t.unref(oe.BSSelect),{width:"100%","model-value":h(S),items:d,"value-provider":m,"label-provider":u,"onUpdate:modelValue":A=>A&&g(S,A)},null,8,["model-value","onUpdate:modelValue"])]),t.createElementVNode("div",cB,[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:A=>_(S,null)},"∅",10,dB),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),A=>(t.openBlock(),t.createElementBlock("button",{key:A,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":b(S)===A}]),style:t.normalizeStyle({background:t.unref(ei)(A)}),title:t.unref(a).t(t.unref(Io)(A)),onClick:V=>_(S,A)},null,14,uB))),128))])]))),128)):t.createCommentVNode("",!0)],8,oB)):t.createCommentVNode("",!0)}}}),[["__scopeId","data-v-04208206"]]),fB=["title"],pB={class:"em-panel__head"},hB={class:"em-panel__head-row"},yB=["title"],gB={class:"em-panel__context"},bB={key:0,class:"em-panel__lock"},_B=["disabled"],kB={key:0,class:"em-attr__navhint"},EB={key:0,class:"em-panel__note"},NB={key:1,class:"em-panel__note"},wB={key:2,class:"em-jpa"},IB={class:"em-field"},vB={class:"em-field"},CB={class:"em-field"},SB={key:0,class:"em-field"},xB={class:"em-panel__note"},RB={class:"em-panel__sub"},AB={class:"em-field"},$B={class:"em-field"},TB={class:"em-jpa"},MB={key:0,class:"em-panel__note"},VB={key:1,class:"em-panel__note"},BB={class:"em-jpa"},DB={class:"em-field"},OB={key:0,class:"em-panel__note"},LB={class:"em-field"},PB={class:"em-multilang"},zB={class:"em-field"},FB=["value"],UB={class:"em-field"},HB={class:"em-swatch"},jB={class:"em-swatch__row"},KB=["title"],GB=["title","onClick"],YB={class:"em-panel__note"},qB={class:"em-field"},WB=["value"],JB={class:"em-swatch"},XB={class:"em-swatch__row"},ZB=["title"],QB=["title","onClick"],iy=Qe(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 G;return(G=r.value)==null?void 0:G.focus()}});const l=i.controller,s=t.computed(()=>l.selection.value),c=t.computed(()=>l.inspectedEntityId.value),d=t.computed(()=>{const G=c.value;return G?l.state.logical.entities.find(q=>q.modelId===G)??null:null}),u=t.computed(()=>{const G=s.value;if((G==null?void 0:G.kind)==="association")return l.isAssociationLocked(G.id);const q=c.value;return!!q&&l.isEntityLocked(q)}),m=t.computed(()=>{var G;return((G=l.selectedAttr.value)==null?void 0:G.attrId)??null}),p=t.computed(()=>new Set(l.selectedAttrIds.value)),f=t.computed(()=>m.value!==null),h=t.ref({});t.watch(f,()=>{h.value={}});function g(G){return h.value[G]??f.value}function b(G){h.value={...h.value,[G]:!g(G)}}const _=t.computed(()=>{var W;const G=d.value;if(!G)return l.t("em.entity.fallback");const q=(W=G.table)==null?void 0:W.physicalName;return q?`${G.name} (${q})`:G.name}),k=t.computed(()=>{const G=s.value;return(G==null?void 0:G.kind)==="association"?l.state.logical.associations.find(q=>q.modelId===G.id)??null:null}),N=t.computed(()=>{const G=s.value;return(G==null?void 0:G.kind)==="group"?l.state.logical.groups.find(q=>q.modelId===G.id)??null:null}),y=t.computed(()=>{const G=s.value;return(G==null?void 0:G.kind)==="note"?l.state.layout.notes.find(q=>q.modelId===G.id)??null:null}),E=t.computed(()=>{var q,W;const G=(q=N.value)==null?void 0:q.name;return(G==null?void 0:G[l.userLanguage.value])||(G==null?void 0:G.ko)||(G==null?void 0:G.en)||(G==null?void 0:G.ja)||(G==null?void 0:G.zh)||((W=N.value)==null?void 0:W.packageName)||l.t("em.group.fallback")}),S=t.computed(()=>{if(d.value){const G=p.value.size;if(G>1)return l.t("em.inspector.ctxEntityAttrs",{name:d.value.name,n:G});if(m.value){const q=d.value.attributes.find(W=>W.modelId===m.value);return(q==null?void 0:q.attrType)==="DIVIDER"?l.t("em.inspector.ctxEntityDivider",{name:d.value.name}):l.t("em.inspector.ctxEntityAttr",{name:d.value.name,attr:(q==null?void 0:q.name)??""})}return l.t("em.inspector.ctxEntity",{name:d.value.name})}if(k.value){const G=q=>{var W;return((W=l.state.logical.entities.find(Ce=>Ce.modelId===q))==null?void 0:W.name)??q};return l.t("em.inspector.ctxAssoc",{a:G(k.value.end1.entityRef),b:G(k.value.end2.entityRef)})}return N.value?l.t("em.inspector.ctxGroup",{name:E.value}):y.value?l.t("em.inspector.ctxNote"):l.t("em.inspector.ctxNone")}),A=["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"],V=["EXACTLY_ONE_INSTANCE","NO_INSTANCE_OR_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES"],$={EXACTLY_ONE_INSTANCE:"em.embed.card1",NO_INSTANCE_OR_ONE_INSTANCE:"em.embed.card01",ZERO_OR_MORE_INSTANCES:"em.embed.card0N"},O=G=>{const q=$[G];return q?l.t(q):G},C=G=>{var q;return((q=l.state.logical.entities.find(W=>W.modelId===G))==null?void 0:q.name)??G},R=["ALL","PERSIST","MERGE","REMOVE","REFRESH","DETACH"],T=["LIST","SET"],w=["inherit","LAZY","EAGER"],I=G=>G;function v(G){return G==="inherit"?l.t("em.common.inherit"):G}const B=t.computed(()=>!!k.value&&k.value.end1.entityRef===k.value.end2.entityRef);function M(G,q){k.value&&l.updateAssociationEnd(k.value.modelId,G,q)}function x(G){return Z.value?G:G==="end1"?"end2":"end1"}function P(G){var $e;const q=($e=k.value)==null?void 0:$e[G];if(!(q!=null&&q.attributeRef))return;const W=l.state.logical.entities.find(ze=>ze.modelId===q.entityRef),Ce=W==null?void 0:W.attributes.find(ze=>ze.modelId===q.attributeRef);return Ce&&(Ce.attrType==="RELATION_OWN"||Ce.attrType==="RELATION_REF")?Ce.name:void 0}function Y(G,q){var Ce;const W=(Ce=k.value)==null?void 0:Ce[G];W!=null&&W.attributeRef&&l.updateAttribute(W.entityRef,W.attributeRef,{name:q})}function se(G){var ze;const q=P(G);if(q!==void 0)return q;const W=(ze=k.value)==null?void 0:ze[G];if(W!=null&&W.navFieldNameHint)return W.navFieldNameHint;const Ce=G==="end1"?"end2":"end1",$e=l.state.logical.entities.find(Fe=>{var ae;return Fe.modelId===((ae=k.value)==null?void 0:ae[Ce].entityRef)});return $e?da($e.name,sa(k.value[Ce].multiplicity)):""}function he(G){return!!Z.value||P(G)!==void 0}function ie(G){k.value&&!B.value&&l.setAssociationIdentifying(k.value.modelId,G)}function fe(G){var q,W,Ce;return!!((Ce=(W=(q=k.value)==null?void 0:q[G].jpa)==null?void 0:W.cascadeTypes)!=null&&Ce.includes("ALL"))}function pe(G,q,W){var ze,Fe;const Ce=(ze=k.value)==null?void 0:ze[G];if(q==="ALL"&&W){M(G,{jpa:{...Ce==null?void 0:Ce.jpa,cascadeTypes:["ALL"]}});return}const $e=new Set(((Fe=Ce==null?void 0:Ce.jpa)==null?void 0:Fe.cascadeTypes)??[]);W?$e.add(q):$e.delete(q),M(G,{jpa:{...Ce==null?void 0:Ce.jpa,cascadeTypes:[...$e]}})}function ge(G,q){var Ce;const W=(Ce=k.value)==null?void 0:Ce[G];M(G,{jpa:{...W==null?void 0:W.jpa,...q}})}function Te(G){var q,W;return((W=(q=k.value)==null?void 0:q[G].jpa)==null?void 0:W.fetchType)??"inherit"}function He(G,q){ge(G,{fetchType:q==="inherit"?void 0:q})}function De(G){var W;const q=(W=k.value)==null?void 0:W[G==="end1"?"end2":"end1"];return(q==null?void 0:q.multiplicity)==="ZERO_OR_MORE_INSTANCES"||(q==null?void 0:q.multiplicity)==="ONE_OR_MORE_INSTANCES"}const Z=t.computed(()=>{const G=k.value;if(!G)return null;for(const q of l.state.logical.entities){const W=q.attributes.find(Fe=>{var ae;return((ae=Fe.embedded)==null?void 0:ae.associationRef)===G.modelId&&Fe.attrType==="EMBED_OWN"});if(!W)continue;const Ce=G.end2.entityRef===W.embedded.embeddableRef?"end2":"end1",$e=G[Ce].multiplicity,ze=G[Ce].jpa;return{which:Ce,cardinality:$e,isCollection:$e==="ZERO_OR_MORE_INSTANCES"||$e==="ONE_OR_MORE_INSTANCES",collectionType:(ze==null?void 0:ze.collectionType)??"LIST",collectionTable:(ze==null?void 0:ze.collectionTable)??"",orderColumn:(ze==null?void 0:ze.orderColumn)??""}}return null});function re(G){k.value&&l.setEmbedCardinality(k.value.modelId,G)}function ue(G){const q=Z.value;q&&ge(q.which,G==="SET"?{collectionType:"SET",orderColumn:void 0}:{collectionType:"LIST"})}function z(G){const q=Z.value;q&&ge(q.which,{collectionTable:G.trim()||void 0})}function L(G){const q=Z.value;q&&ge(q.which,{orderColumn:G.trim()||void 0})}function F(G){N.value&&l.updateGroup(N.value.modelId,G)}function X(G,q){var W;F({name:{...(W=N.value)==null?void 0:W.name,[G]:q}})}const ee=t.computed(()=>{var G;return N.value?$t((G=l.state.layout.groupLayouts.find(q=>q.groupRef===N.value.modelId))==null?void 0:G.style):null});function ke(G){N.value&&l.setGroupSwatch(N.value.modelId,G)}function ye(G){y.value&&l.setNoteMemo(y.value.modelId,G)}const Ne=t.computed(()=>{var G;return $t((G=y.value)==null?void 0:G.style)});function we(G){y.value&&l.setNoteSwatch(y.value.modelId,G)}return(G,q)=>(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:q[0]||(q[0]=(...W)=>e.startResize&&e.startResize(...W))},null,42,fB),t.createElementVNode("header",pB,[t.createElementVNode("div",hB,[q[14]||(q[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:q[1]||(q[1]=W=>a("collapse"))},[t.createVNode(Ve,{name:"panel-right-close",size:16})],8,yB)]),t.createElementVNode("p",gB,t.toDisplayString(S.value),1),u.value&&c.value?(t.openBlock(),t.createElementBlock("div",bB,[t.createVNode(Ve,{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:q[2]||(q[2]=W=>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(op,{controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("basics"),title:_.value,onToggle:q[3]||(q[3]=W=>b("basics"))},null,8,["controller","entity-id","collapsed","title"]),t.createVNode(JV,{controller:t.unref(l),"entity-id":d.value.modelId},null,8,["controller","entity-id"]),t.unref(hn)(d.value.stereotype)?(t.openBlock(),t.createElementBlock("p",kB,t.toDisplayString(t.unref(l).t("em.entity.noIndexNote")),1)):(t.openBlock(),t.createBlock(nB,{key:1,controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("index"),onToggle:q[4]||(q[4]=W=>b("index"))},null,8,["controller","entity-id","collapsed"])),t.createVNode(mB,{controller:t.unref(l),"entity-id":d.value.modelId,collapsible:"",collapsed:g("ops"),onToggle:q[5]||(q[5]=W=>b("ops"))},null,8,["controller","entity-id","collapsed"])],64)):t.createCommentVNode("",!0),k.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createVNode(t.unref(oe.BSCheckbox),{name:"assoc-identifying",class:"em-check",label:t.unref(l).t("em.assoc.identifying"),"model-value":!!k.value.identifying,disabled:B.value||!!Z.value,"onUpdate:modelValue":ie},null,8,["label","model-value","disabled"]),B.value?(t.openBlock(),t.createElementBlock("p",EB,t.toDisplayString(t.unref(l).t("em.assoc.selfNoIdentifying")),1)):Z.value?(t.openBlock(),t.createElementBlock("p",NB,t.toDisplayString(t.unref(l).t("em.assoc.embedNoIdentifying")),1)):t.createCommentVNode("",!0),Z.value?(t.openBlock(),t.createElementBlock("fieldset",wB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.embed.legend")),1),t.createElementVNode("label",IB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.embed.cardinality")),1),t.createVNode(t.unref(oe.BSSelect),{"model-value":Z.value.cardinality,items:V,"value-provider":I,"label-provider":O,"onUpdate:modelValue":q[6]||(q[6]=W=>W&&re(W))},null,8,["model-value"])]),Z.value.isCollection?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",vB,[q[15]||(q[15]=t.createElementVNode("span",null,"collectionType",-1)),t.createVNode(t.unref(oe.BSSelect),{"model-value":Z.value.collectionType,items:T,"value-provider":I,"label-provider":I,"onUpdate:modelValue":q[7]||(q[7]=W=>W&&ue(W))},null,8,["model-value"])]),t.createElementVNode("label",CB,[q[16]||(q[16]=t.createElementVNode("span",null,"collectionTable",-1)),t.createVNode(t.unref(oe.BSTextInput),{name:"embed-coll-table",width:"100%",placeholder:t.unref(l).t("em.embed.collectionTablePlaceholder"),"model-value":Z.value.collectionTable,"onUpdate:modelValue":z},null,8,["placeholder","model-value"])]),Z.value.collectionType==="LIST"?(t.openBlock(),t.createElementBlock("label",SB,[q[17]||(q[17]=t.createElementVNode("span",null,"orderColumn",-1)),t.createVNode(t.unref(oe.BSTextInput),{name:"embed-order-col",width:"100%",placeholder:t.unref(l).t("em.embed.orderColumnPlaceholder"),"model-value":Z.value.orderColumn,"onUpdate:modelValue":L},null,8,["placeholder","model-value"])])):t.createCommentVNode("",!0)],64)):t.createCommentVNode("",!0),t.createElementVNode("p",xB,t.toDisplayString(t.unref(l).t("em.embed.ownerFixedNote")),1)])):t.createCommentVNode("",!0),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(["end1","end2"],W=>{var Ce,$e,ze;return t.withDirectives(t.createElementVNode("div",{key:W,class:"em-end"},[t.createElementVNode("h4",RB,t.toDisplayString(W)+" → "+t.toDisplayString(C(k.value[W].entityRef)),1),Z.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("label",AB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.assoc.multiplicity")),1),t.createVNode(t.unref(oe.BSSelect),{"model-value":k.value[W].multiplicity,items:A,"value-provider":I,"label-provider":t.unref(ca),"onUpdate:modelValue":Fe=>M(W,{multiplicity:Fe})},null,8,["model-value","label-provider","onUpdate:modelValue"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:`${x(W)}-navigable`,class:"em-check",label:"navigable",title:x(W)==="end2"?t.unref(l).t("em.assoc.ownerNavFixed"):void 0,disabled:x(W)==="end2","model-value":x(W)==="end2"?!0:k.value[x(W)].navigable,"onUpdate:modelValue":Fe=>M(x(W),{navigable:Fe})},null,8,["name","title","disabled","model-value","onUpdate:modelValue"]),t.createElementVNode("label",$B,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.assoc.navFieldName")),1),t.createVNode(t.unref(oe.BSTextInput),{name:`${x(W)}-navname`,width:"100%",disabled:!he(x(W)),placeholder:t.unref(l).t("em.attr.namePlaceholder"),"model-value":se(x(W)),"onUpdate:modelValue":Fe=>Y(x(W),Fe)},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:`${x(W)}-composition`,class:"em-check",label:"composition","model-value":k.value[x(W)].composition,"onUpdate:modelValue":Fe=>M(x(W),{composition:Fe})},null,8,["name","model-value","onUpdate:modelValue"])],64)),t.createElementVNode("fieldset",TB,[q[18]||(q[18]=t.createElementVNode("legend",null,"cascade",-1)),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(R,Fe=>{var ae,Se;return t.createVNode(t.unref(oe.BSCheckbox),{key:Fe,name:`${x(W)}-cascade-${Fe}`,class:"em-check",label:Fe,"model-value":!!((Se=(ae=k.value[x(W)].jpa)==null?void 0:ae.cascadeTypes)!=null&&Se.includes(Fe)),disabled:!he(x(W))||Fe!=="ALL"&&fe(x(W)),"onUpdate:modelValue":Ge=>pe(x(W),Fe,Ge)},null,8,["name","label","model-value","disabled","onUpdate:modelValue"])}),64)),he(x(W))?fe(x(W))?(t.openBlock(),t.createElementBlock("p",VB,t.toDisplayString(t.unref(l).t("em.assoc.cascadeAllNote")),1)):t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("p",MB,t.toDisplayString(t.unref(l).t("em.assoc.navRequiredNote")),1))]),t.createElementVNode("fieldset",BB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.assoc.jpaDetails")),1),t.createElementVNode("label",DB,[q[19]||(q[19]=t.createElementVNode("span",null,"fetchType",-1)),t.createVNode(t.unref(oe.BSSelect),{disabled:!he(x(W)),"model-value":Te(x(W)),items:w,"value-provider":I,"label-provider":v,"onUpdate:modelValue":Fe=>Fe&&He(x(W),Fe)},null,8,["disabled","model-value","onUpdate:modelValue"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:`${x(W)}-orphan`,class:"em-check",label:"orphanRemoval","model-value":!!((Ce=k.value[x(W)].jpa)!=null&&Ce.orphanRemoval),disabled:!he(x(W))||De(W),"onUpdate:modelValue":Fe=>ge(x(W),{orphanRemoval:Fe})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),De(W)&&(($e=k.value[x(W)].jpa)!=null&&$e.orphanRemoval)?(t.openBlock(),t.createElementBlock("p",OB,t.toDisplayString(t.unref(l).t("em.assoc.orphanRemovalNote")),1)):t.createCommentVNode("",!0),t.createElementVNode("label",LB,[q[20]||(q[20]=t.createElementVNode("span",null,"orderBy",-1)),t.createVNode(t.unref(oe.BSTextInput),{name:`${x(W)}-orderby`,width:"100%",disabled:!he(x(W)),placeholder:t.unref(l).t("em.assoc.orderByPlaceholder"),"model-value":((ze=k.value[x(W)].jpa)==null?void 0:ze.orderBy)??"","onUpdate:modelValue":Fe=>ge(x(W),{orderBy:Fe.trim()||void 0})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"])])])]),[[t.vShow,!Z.value||W===Z.value.which]])}),64))],64)):t.createCommentVNode("",!0),N.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("fieldset",PB,[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,W=>{var Ce;return t.openBlock(),t.createElementBlock("label",{key:W,class:"em-lang"},[t.createElementVNode("span",null,t.toDisplayString(W),1),t.createVNode(t.unref(oe.BSTextInput),{name:`grp-name-${W}`,width:"100%","model-value":((Ce=N.value.name)==null?void 0:Ce[W])??"","onUpdate:modelValue":$e=>X(W,$e)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),t.createElementVNode("label",zB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.common.description")),1),t.createElementVNode("textarea",{class:"em-textarea",value:N.value.description??"",rows:"3",onChange:q[8]||(q[8]=W=>F({description:W.target.value}))},null,40,FB)]),t.createElementVNode("label",UB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.entity.package")),1),t.createVNode(t.unref(oe.BSTextInput),{name:"grp-package",width:"100%","model-value":N.value.packageName??"","onUpdate:modelValue":q[9]||(q[9]=W=>F({packageName:W}))},null,8,["model-value"])]),t.createVNode(t.unref(oe.BSCheckbox),{name:"grp-exclude-ddl",class:"em-check",label:t.unref(l).t("em.group.excludeDDL"),"model-value":N.value.excludeDDLGeneration,"onUpdate:modelValue":q[10]||(q[10]=W=>F({excludeDDLGeneration:W}))},null,8,["label","model-value"]),t.createElementVNode("fieldset",HB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.common.color")),1),t.createElementVNode("div",jB,[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:q[11]||(q[11]=W=>ke(null))},"∅",10,KB),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),W=>(t.openBlock(),t.createElementBlock("button",{key:W,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":ee.value===W}]),style:t.normalizeStyle({background:t.unref(ei)(W)}),title:t.unref(l).t(t.unref(Io)(W)),onClick:Ce=>ke(W)},null,14,GB))),128))])]),t.createElementVNode("p",YB,t.toDisplayString(t.unref(l).t("em.group.members",{n:N.value.memberEntityRefs.length})),1)],64)):t.createCommentVNode("",!0),y.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createElementVNode("label",qB,[t.createElementVNode("span",null,t.toDisplayString(t.unref(l).t("em.common.memo")),1),t.createElementVNode("textarea",{class:"em-textarea",value:y.value.memo,rows:"6",onChange:q[12]||(q[12]=W=>ye(W.target.value))},null,40,WB)]),t.createElementVNode("fieldset",JB,[t.createElementVNode("legend",null,t.toDisplayString(t.unref(l).t("em.common.color")),1),t.createElementVNode("div",XB,[t.createElementVNode("button",{type:"button",class:t.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":Ne.value===null}]),title:t.unref(l).t("em.swatch.none"),onClick:q[13]||(q[13]=W=>we(null))},"∅",10,ZB),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(wo),W=>(t.openBlock(),t.createElementBlock("button",{key:W,type:"button",class:t.normalizeClass(["em-swatch__chip",{"is-on":Ne.value===W}]),style:t.normalizeStyle({background:t.unref(ei)(W)}),title:t.unref(l).t(t.unref(Io)(W)),onClick:Ce=>we(W)},null,14,QB))),128))])])],64)):t.createCommentVNode("",!0)],8,_B)],4))}}),[["__scopeId","data-v-d79a8574"]]),eD=["title"],tD={class:"em-validation__title"},nD=["title","onClick"],oD={key:0,class:"em-validation__body"},iD={class:"em-validation__opt"},aD={key:0,class:"em-validation__empty"},rD={key:1,class:"em-validation__empty"},lD={key:2,class:"em-validation__list"},sD=["onClick"],cD={class:"em-validation__item-msg"},dD={key:0,class:"em-validation__item-entity"},uD=["title","onClick"],mD=["title"],fD=Qe(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=kI(g);if(!b)return null;const _=a.value.get(b);return _===void 0?null:_.trim()===""?o.t("em.validation.nameless"):_}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:np(o.t,g),category:bI(o.t,g.ruleId)}))),m=t.ref(!1);function p(g){c.value[g]=!c.value[g]}function f(g){if(!m.value){m.value=!0;return}p(g)}function h(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]=_=>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(Ve,{name:"chevron",size:14,class:t.normalizeClass([{"is-open":m.value},"em-validation__chevron"])},null,8,["class"]),t.createElementVNode("span",tD,t.toDisplayString(t.unref(o).t("em.validation.title")),1)],8,eD),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"],_=>t.createElementVNode("button",{key:_,type:"button",class:t.normalizeClass(["em-validation__count",[`is-${_}`,{"is-off":!c.value[_]}]]),title:m.value?t.unref(o).t(c.value[_]?"em.validation.hideSeverity":"em.validation.showSeverity",{label:t.unref(o).t(l[_].labelKey)}):t.unref(o).t("em.validation.expandPanel"),onClick:k=>f(_)},[t.createVNode(Ve,{name:l[_].icon,size:14},null,8,["name"]),t.createElementVNode("span",null,t.toDisplayString(s.value[_]),1)],10,nD)),64))])]),m.value?(t.openBlock(),t.createElementBlock("div",oD,[t.createElementVNode("label",iD,[t.createVNode(t.unref(oe.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]=_=>t.unref(o).flagEntitiesWithoutRelations.value=_)},null,8,["label","model-value"])]),i.value.length===0?(t.openBlock(),t.createElementBlock("p",aD,t.toDisplayString(t.unref(o).t("em.validation.noIssues")),1)):d.value.length===0?(t.openBlock(),t.createElementBlock("p",rD,t.toDisplayString(t.unref(o).t("em.validation.noVisibleIssues")),1)):(t.openBlock(),t.createElementBlock("ul",lD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(u.value,({issue:_,entityName:k,message:N,category:y},E)=>(t.openBlock(),t.createElementBlock("li",{key:`${_.ruleId}:${_.targetRef??"model"}:${E}`,class:t.normalizeClass(["em-validation__item",[`is-${_.severity}`,{"is-clickable":!!_.targetRef}]]),onClick:S=>h(_)},[t.createVNode(Ve,{name:l[_.severity].icon,size:15,class:"em-validation__item-icon"},null,8,["name"]),t.createElementVNode("span",cD,[k?(t.openBlock(),t.createElementBlock("span",dD,t.toDisplayString(k),1)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(N),1)]),t.unref(o).hasQuickFix(_)?(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(_),["stop"])},t.toDisplayString(t.unref(o).t("em.validation.quickFix")),9,uD)):t.createCommentVNode("",!0),t.createElementVNode("span",{class:"em-validation__item-cat",title:_.ruleId},t.toDisplayString(y),9,mD)],10,sD))),128))]))])):t.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-251fd3f0"]]),pD={class:"em-history"},hD={class:"em-history__head"},yD={class:"em-history__title"},gD={class:"em-history__head-actions"},bD=["title","disabled"],_D=["title"],kD={class:"em-history__filters"},ED={class:"em-history__filter"},ND={class:"em-history__filters em-history__filters--period"},wD={class:"em-history__filter-label"},ID=["title","aria-label","max"],vD=["title","aria-label","min"],CD=["title"],SD={key:0,class:"em-history__diffbar"},xD={class:"em-history__diffbar-range"},RD={class:"em-history__diffbar-count"},AD={class:"em-history__body"},$D={key:0,class:"em-history__empty"},TD={key:1,class:"em-history__diff-list"},MD=["onClick"],VD={class:"em-history__action-head"},BD={class:"em-history__action-name"},DD={key:0,class:"em-history__fields"},OD={class:"em-history__fname"},LD={key:0,class:"em-history__old"},PD={class:"em-history__val"},zD={key:1,class:"em-history__empty"},FD={key:2,class:"em-history__empty is-error"},UD={key:3,class:"em-history__empty"},HD={key:4,class:"em-history__list"},jD=["onClick"],KD={class:"em-history__summary"},GD={class:"em-history__seq"},YD={class:"em-history__gmeta"},qD={class:"em-history__who"},WD={key:0,class:"em-history__time"},JD={key:1,class:"em-history__restored-from"},XD=["onClick"],ZD={key:0,class:"em-history__detail"},QD={class:"em-history__action-head"},eO={class:"em-history__action-name"},tO={key:0,class:"em-history__fields"},nO={class:"em-history__fname"},oO={key:0,class:"em-history__old"},iO={class:"em-history__val"},aO={class:"em-history__preview"},rO=["disabled"],lO={key:0,class:"em-history__diff-list is-preview"},sO={class:"em-history__action-head"},cO={class:"em-history__action-name"},dO={key:0,class:"em-history__fields"},uO={class:"em-history__fname"},mO={key:0,class:"em-history__old"},fO={class:"em-history__val"},pO={class:"em-history__confirm-row"},hO={class:"em-history__confirm-msg"},yO=["disabled","onClick"],gO=["disabled"],bO=["onClick"],zr=50,_O=Qe(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((ae,Se)=>Se.seq>ae?Se.seq:ae,-1/0));async function u(ae){if(a.historyTransport){l.value=!0,s.value=null;try{const Se=!(ae!=null&&ae.full)&&r.value.length>0&&Number.isFinite(d.value),Ge=await a.historyTransport(Se?d.value:void 0);if(!Se)r.value=Ge;else if(Ge.length){const et=new Set(r.value.map(de=>de.seq)),te=Ge.filter(de=>!et.has(de.seq));te.length&&(r.value=[...r.value,...te])}c.value=!0}catch(Se){s.value=Se instanceof Error?Se.message:a.t("em.history.loadError")}finally{l.value=!1}}}async function m(){await a.whenOpsSettled(),await u()}const p=t.ref(null),f=t.ref(null);t.watch(()=>o.open,ae=>{ae?m():(p.value=null,f.value=null)},{immediate:!0});let h=null;t.watch(()=>a.revision.value,()=>{o.open&&(h&&clearTimeout(h),h=setTimeout(()=>void m(),500))}),t.watch(()=>a.reloadRequest.value,()=>{o.open&&m()});const g=t.computed(()=>new Map(a.state.logical.entities.map(ae=>[ae.modelId,ae]))),b=t.computed(()=>new Map(a.state.logical.associations.map(ae=>[ae.modelId,ae]))),_=t.computed(()=>{const ae=a.userLanguage.value;return new Map((a.state.logical.groups??[]).map(Se=>{var Ge,et;return[Se.modelId,Se.packageName||((Ge=Se.name)==null?void 0:Ge[ae])||((et=Se.name)==null?void 0:et.ko)||Se.modelId]}))});function k(ae){var te,de,Le,dt,Xe,yt,st;const Se=b.value.get(ae);if(!Se)return a.t("em.history.assocFallback");if((te=Se.description)!=null&&te.trim())return Se.description.trim();const Ge=(dt=(Le=g.value.get((de=Se.end1)==null?void 0:de.entityRef))==null?void 0:Le.name)==null?void 0:dt.trim(),et=(st=(yt=g.value.get((Xe=Se.end2)==null?void 0:Xe.entityRef))==null?void 0:yt.name)==null?void 0:st.trim();return Ge&&et?`${Ge}→${et}`:a.t("em.history.assocFallback")}function N(ae){var Se,Ge,et,te;if(ae.kind==="entity")return((Ge=(Se=g.value.get(ae.ref))==null?void 0:Se.name)==null?void 0:Ge.trim())||a.t("em.attr.nameless");if(ae.kind==="attribute"||ae.kind==="operation"||ae.kind==="index"){const de=ae.entityRef?g.value.get(ae.entityRef):void 0,dt=((ae.kind==="attribute"?de==null?void 0:de.attributes:ae.kind==="operation"?de==null?void 0:de.operations:de==null?void 0:de.indexes)??[]).find(yt=>yt.modelId===ae.ref),Xe=(et=de==null?void 0:de.name)==null?void 0:et.trim();return`${Xe?Xe+".":""}${((te=dt==null?void 0:dt.name)==null?void 0:te.trim())||ae.ref}`}return ae.kind==="association"?k(ae.ref):ae.kind==="associationEnd"?`${k(ae.ref)}(${ae.end})`:ae.kind==="group"?a.t("em.history.groupSubject",{name:_.value.get(ae.ref)??ae.ref}):ae.ref}const y={entity:"table",attribute:"field",operation:"method",index:"key",association:"link",associationEnd:"link",group:"folder"},E={add:"em.history.verbAdd",update:"em.history.verbUpdate",remove:"em.history.verbRemove"},S=t.ref("all"),A=[{v:"all",labelKey:"em.history.filterAll"},{v:"edit",labelKey:"em.history.kindEdit"},{v:"restore",labelKey:"em.history.kindRestore"}],V=t.computed({get:()=>S.value,set:ae=>{ae&&(S.value=ae)}}),$=t.computed(()=>$l(r.value)),O=t.computed(()=>$.value.length?$.value[0].seq:null),C=t.computed(()=>S.value==="all"?$.value:$.value.filter(ae=>(ae.kind??"edit")===S.value)),R=t.ref(zr),T=t.ref(""),w=t.ref(""),I=t.computed(()=>!!T.value||!!w.value);function v(){T.value="",w.value=""}const B=t.computed(()=>{const ae=T.value?new Date(`${T.value}T00:00:00`).getTime():null,Se=w.value?new Date(`${w.value}T23:59:59.999`).getTime():null;return ae==null&&Se==null?C.value:C.value.filter(Ge=>{if(Ge.ts==null)return!1;const et=new Date(Ge.ts).getTime();return!(isNaN(et)||ae!=null&&et<ae||Se!=null&&et>Se)})}),M=t.computed(()=>B.value.slice(0,R.value)),x=t.computed(()=>Math.max(0,B.value.length-R.value));function P(){R.value+=zr}t.watch([S,T,w],()=>{R.value=zr}),t.watch(()=>o.open,ae=>{ae&&(R.value=zr,v())});function Y(ae){return ae===void 0?"—":ae===null?a.t("em.history.emptyValue"):typeof ae=="object"?JSON.stringify(ae):String(ae)}function se(ae){const Se=N(ae.subject);if(ae.verb==="add")return a.t("em.history.summaryAdd",{name:Se});if(ae.verb==="remove")return a.t("em.history.summaryRemove",{name:Se});if(ae.fields.length===1){const Ge=ae.fields[0];return`${Se}.${Ge.field} ${Ge.oldValue!==void 0?Y(Ge.oldValue)+"→":""}${Y(Ge.value)}`}return a.t("em.history.summaryFields",{name:Se,n:ae.fields.length})}function he(ae){return ae.actions.length===0?a.t("em.history.noChange"):ae.actions.length===1?se(ae.actions[0]):a.t("em.history.summaryMore",{summary:se(ae.actions[0]),n:ae.actions.length-1})}const ie=t.ref(new Set);function fe(ae){const Se=new Set(ie.value);Se.has(ae)?Se.delete(ae):Se.add(ae),ie.value=Se}function pe(ae){if(ae==null)return"";const Se=new Date(ae);return isNaN(Se.getTime())?String(ae):Se.toLocaleString()}function ge(ae){const Se=ae.author,Ge=ae.origin;return Se&&Ge?`${Se}(${Ge})`:Se||(Ge?`(${Ge})`:"—")}const Te=t.computed(()=>p.value==null?null:Tl(r.value,{fromSeq:p.value,...f.value!=null?{toSeq:f.value}:{}}));t.watch(()=>Te.value?Rd(Te.value):null,ae=>i("diffChange",ae));function He(ae){p.value=ae,f.value=null,q.value=null}function De(){p.value=null,f.value=null}const Z=t.computed(()=>$.value.map(ae=>ae.seq)),re=t.computed(()=>O.value??1/0),ue=t.computed(()=>f.value??re.value),z=t.computed(()=>f.value??re.value),L=t.computed(()=>Z.value.filter(ae=>ae<ue.value).map(ae=>({v:ae}))),F=t.computed(()=>Z.value.filter(ae=>p.value!=null&&ae>p.value).map(ae=>({v:ae})));function X(ae){ae!=null&&(p.value=ae,f.value!=null&&f.value<=ae&&(f.value=null))}function ee(ae){ae!=null&&(f.value=ae>=re.value?null:ae)}function ke(ae){return ae>=re.value?a.t("em.history.diff.current"):`#${ae}`}function ye(ae){return ae.kind==="entity"?g.value.has(ae.ref)?ae.ref:null:(ae.kind==="attribute"||ae.kind==="operation"||ae.kind==="index")&&ae.entityRef?g.value.has(ae.entityRef)?ae.entityRef:null:ae.kind==="group"&&_.value.has(ae.ref)?ae.ref:null}function Ne(ae){const Se=ye(ae);Se&&a.requestFocus(Se)}const we={added:"em.history.verbAdd",modified:"em.history.verbUpdate",removed:"em.history.verbRemove"},G={added:"add",modified:"update",removed:"remove"},q=t.ref(null),W=t.ref(!1),Ce=t.computed(()=>q.value==null?null:Tl(r.value,{fromSeq:q.value})),$e=t.ref(!1);function ze(ae){q.value=ae,$e.value=!1}async function Fe(ae){W.value=!0;try{const Se=await a.restoreToSeq(ae);Se.ok?(p.value=null,f.value=null):s.value=a.t("em.history.restoreFailed",{reason:Se.reason??a.t("em.history.unknown")})}finally{W.value=!1,q.value=null}}return(ae,Se)=>(t.openBlock(),t.createBlock(t.Transition,{name:"em-history"},{default:t.withCtx(()=>{var Ge,et;return[t.withDirectives(t.createElementVNode("section",pD,[t.createElementVNode("header",hD,[t.createElementVNode("div",yD,[t.createVNode(Ve,{name:"undo",size:15}),t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.history.title")),1)]),t.createElementVNode("div",gD,[t.createElementVNode("button",{type:"button",class:"em-history__btn",title:t.unref(a).t("em.history.refresh"),disabled:l.value,onClick:Se[0]||(Se[0]=te=>u({full:!0}))},[t.createVNode(Ve,{name:"redo",size:15})],8,bD),t.createElementVNode("button",{type:"button",class:"em-history__btn",title:t.unref(a).t("em.common.close"),onClick:Se[1]||(Se[1]=te=>i("close"))},[t.createVNode(Ve,{name:"panel-close",size:15})],8,_D)])]),t.createElementVNode("div",kD,[t.createElementVNode("label",ED,[t.createElementVNode("span",null,t.toDisplayString(t.unref(a).t("em.toolbar.displayLabel")),1),t.createVNode(t.unref(oe.BSSelect),{modelValue:V.value,"onUpdate:modelValue":Se[2]||(Se[2]=te=>V.value=te),items:A,"value-provider":te=>te.v,"label-provider":te=>t.unref(a).t(te.labelKey)},null,8,["modelValue","value-provider","label-provider"])])]),t.createElementVNode("div",ND,[t.createElementVNode("span",wD,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:w.value||void 0,"onUpdate:modelValue":Se[3]||(Se[3]=te=>T.value=te)},null,8,ID),[[t.vModelText,T.value]]),Se[9]||(Se[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:T.value||void 0,"onUpdate:modelValue":Se[4]||(Se[4]=te=>w.value=te)},null,8,vD),[[t.vModelText,w.value]]),I.value?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-history__period-reset",title:t.unref(a).t("em.history.periodReset"),onClick:v},[t.createVNode(Ve,{name:"x",size:12})],8,CD)):t.createCommentVNode("",!0)]),p.value!=null?(t.openBlock(),t.createElementBlock("div",SD,[t.createElementVNode("div",xD,[t.createVNode(t.unref(oe.BSSelect),{class:"em-history__range-sel","model-value":p.value??void 0,items:L.value,"value-provider":te=>te.v,"label-provider":te=>`#${te.v}`,"onUpdate:modelValue":Se[5]||(Se[5]=te=>X(te??null))},null,8,["model-value","items","value-provider","label-provider"]),t.createVNode(Ve,{name:"arrow-lr",size:12,class:"em-history__diffbar-arrow"}),t.createVNode(t.unref(oe.BSSelect),{class:"em-history__range-sel","model-value":z.value,items:F.value,"value-provider":te=>te.v,"label-provider":te=>ke(te.v),"onUpdate:modelValue":Se[6]||(Se[6]=te=>ee(te??null))},null,8,["model-value","items","value-provider","label-provider"])]),t.createElementVNode("span",RD,t.toDisplayString(t.unref(a).t("em.history.diff.count",{n:((Ge=Te.value)==null?void 0:Ge.entries.length)??0})),1),t.createElementVNode("button",{type:"button",class:"em-history__diffbar-exit",onClick:De},t.toDisplayString(t.unref(a).t("em.history.diff.exit")),1)])):t.createCommentVNode("",!0),t.createElementVNode("div",AD,[p.value!=null?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[(et=Te.value)!=null&&et.entries.length?(t.openBlock(),t.createElementBlock("ul",TD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Te.value.entries,(te,de)=>(t.openBlock(),t.createElementBlock("li",{key:de,class:t.normalizeClass(["em-history__diff-entry",{"is-focusable":!!ye(te.subject)}]),onClick:Le=>Ne(te.subject)},[t.createElementVNode("div",VD,[t.createVNode(Ve,{name:y[te.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",BD,t.toDisplayString(N(te.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${G[te.verb]}`])},t.toDisplayString(t.unref(a).t(we[te.verb])),3)]),te.fields.length?(t.openBlock(),t.createElementBlock("ul",DD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(te.fields,(Le,dt)=>(t.openBlock(),t.createElementBlock("li",{key:dt,class:"em-history__field"},[t.createElementVNode("span",OD,t.toDisplayString(Le.field),1),Le.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",LD,t.toDisplayString(Y(Le.oldValue)),1)):t.createCommentVNode("",!0),Le.oldValue!==void 0?(t.openBlock(),t.createBlock(Ve,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",PD,t.toDisplayString(Y(Le.value)),1)]))),128))])):t.createCommentVNode("",!0)],10,MD))),128))])):(t.openBlock(),t.createElementBlock("p",$D,t.toDisplayString(t.unref(a).t("em.history.diff.empty")),1))],64)):l.value&&!c.value?(t.openBlock(),t.createElementBlock("p",zD,t.toDisplayString(t.unref(a).t("em.history.loading")),1)):s.value?(t.openBlock(),t.createElementBlock("p",FD,t.toDisplayString(s.value),1)):B.value.length===0?(t.openBlock(),t.createElementBlock("p",UD,t.toDisplayString(c.value?t.unref(a).t("em.history.emptyLoaded"):t.unref(a).t("em.history.emptyNotLoaded")),1)):(t.openBlock(),t.createElementBlock("ul",HD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(M.value,te=>{var de,Le,dt;return t.openBlock(),t.createElementBlock("li",{key:te.seq,class:t.normalizeClass(["em-history__group",[`is-${te.kind??"edit"}`]])},[t.createElementVNode("div",{class:"em-history__ghead",onClick:Xe=>fe(te.seq)},[t.createVNode(Ve,{name:"chevron",size:13,class:t.normalizeClass(["em-history__chevron",{"is-open":ie.value.has(te.seq)}])},null,8,["class"]),t.createElementVNode("span",{class:t.normalizeClass(["em-history__kind",`is-${te.kind??"edit"}`])},t.toDisplayString(t.unref(a).t(te.kind==="restore"?"em.history.kindRestore":"em.history.kindEdit")),3),t.createElementVNode("span",KD,t.toDisplayString(he(te)),1),t.createElementVNode("span",GD,"#"+t.toDisplayString(te.seq),1)],8,jD),t.createElementVNode("div",YD,[t.createElementVNode("span",qD,t.toDisplayString(ge(te)),1),te.ts?(t.openBlock(),t.createElementBlock("span",WD,t.toDisplayString(pe(te.ts)),1)):t.createCommentVNode("",!0),te.kind==="restore"&&te.restoredFromSeq!=null?(t.openBlock(),t.createElementBlock("span",JD,"← #"+t.toDisplayString(te.restoredFromSeq),1)):t.createCommentVNode("",!0),te.seq!==O.value?(t.openBlock(),t.createElementBlock("button",{key:2,type:"button",class:"em-history__compare-btn",onClick:t.withModifiers(Xe=>He(te.seq),["stop"])},t.toDisplayString(t.unref(a).t("em.history.diff.compare")),9,XD)):t.createCommentVNode("",!0)]),ie.value.has(te.seq)?(t.openBlock(),t.createElementBlock("div",ZD,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(te.actions,(Xe,yt)=>(t.openBlock(),t.createElementBlock("div",{key:yt,class:"em-history__action"},[t.createElementVNode("div",QD,[t.createVNode(Ve,{name:y[Xe.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",eO,t.toDisplayString(N(Xe.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${Xe.verb}`])},t.toDisplayString(t.unref(a).t(E[Xe.verb])),3)]),Xe.fields.length?(t.openBlock(),t.createElementBlock("ul",tO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Xe.fields,(st,ft)=>(t.openBlock(),t.createElementBlock("li",{key:ft,class:"em-history__field"},[t.createElementVNode("span",nO,t.toDisplayString(st.field),1),st.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",oO,t.toDisplayString(Y(st.oldValue)),1)):t.createCommentVNode("",!0),st.oldValue!==void 0?(t.openBlock(),t.createBlock(Ve,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",iO,t.toDisplayString(Y(st.value)),1)]))),128))])):t.createCommentVNode("",!0)]))),128))])):t.createCommentVNode("",!0),t.unref(a).restoreAvailable.value&&te.seq!==O.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(["em-history__restore",{"is-confirming":q.value===te.seq}])},[q.value===te.seq?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",aO,[t.createElementVNode("button",{type:"button",class:"em-history__preview-toggle",disabled:!((de=Ce.value)!=null&&de.entries.length),onClick:Se[7]||(Se[7]=Xe=>$e.value=!$e.value)},[t.createVNode(Ve,{name:"chevron",size:11,class:t.normalizeClass(["em-history__chevron",{"is-open":$e.value}])},null,8,["class"]),t.createTextVNode(" "+t.toDisplayString((Le=Ce.value)!=null&&Le.entries.length?t.unref(a).t("em.history.diff.restorePreview",{n:Ce.value.entries.length}):t.unref(a).t("em.history.diff.restorePreviewNone")),1)],8,rO),$e.value&&((dt=Ce.value)!=null&&dt.entries.length)?(t.openBlock(),t.createElementBlock("ul",lO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Ce.value.entries,(Xe,yt)=>(t.openBlock(),t.createElementBlock("li",{key:yt,class:"em-history__diff-entry"},[t.createElementVNode("div",sO,[t.createVNode(Ve,{name:y[Xe.subject.kind],size:12},null,8,["name"]),t.createElementVNode("span",cO,t.toDisplayString(N(Xe.subject)),1),t.createElementVNode("span",{class:t.normalizeClass(["em-history__verb",`is-${G[Xe.verb]}`])},t.toDisplayString(t.unref(a).t(we[Xe.verb])),3)]),Xe.fields.length?(t.openBlock(),t.createElementBlock("ul",dO,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(Xe.fields,(st,ft)=>(t.openBlock(),t.createElementBlock("li",{key:ft,class:"em-history__field"},[t.createElementVNode("span",uO,t.toDisplayString(st.field),1),st.oldValue!==void 0?(t.openBlock(),t.createElementBlock("span",mO,t.toDisplayString(Y(st.oldValue)),1)):t.createCommentVNode("",!0),st.oldValue!==void 0?(t.openBlock(),t.createBlock(Ve,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):t.createCommentVNode("",!0),t.createElementVNode("span",fO,t.toDisplayString(Y(st.value)),1)]))),128))])):t.createCommentVNode("",!0)]))),128))])):t.createCommentVNode("",!0)]),t.createElementVNode("div",pO,[t.createElementVNode("span",hO,t.toDisplayString(t.unref(a).t("em.history.confirmRestore")),1),t.createElementVNode("button",{type:"button",class:"em-history__confirm-yes",disabled:W.value,onClick:Xe=>Fe(te.seq)},t.toDisplayString(t.unref(a).t("em.history.doRestore")),9,yO),t.createElementVNode("button",{type:"button",class:"em-history__confirm-no",disabled:W.value,onClick:Se[8]||(Se[8]=Xe=>q.value=null)},t.toDisplayString(t.unref(a).t("em.history.cancel")),9,gO)])],64)):(t.openBlock(),t.createElementBlock("button",{key:1,type:"button",class:"em-history__restore-btn",onClick:Xe=>ze(te.seq)},[t.createVNode(Ve,{name:"undo",size:12}),t.createTextVNode(" "+t.toDisplayString(t.unref(a).t("em.history.restoreToHere")),1)],8,bO))],2)):t.createCommentVNode("",!0)],2)}),128))])),p.value==null&&x.value>0?(t.openBlock(),t.createElementBlock("button",{key:5,type:"button",class:"em-history__load-more",onClick:P},t.toDisplayString(t.unref(a).t("em.history.loadMore",{n:x.value})),1)):t.createCommentVNode("",!0)])],512),[[t.vShow,e.open]])]}),_:1}))}}),[["__scopeId","data-v-471d6cf8"]]);function kO(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 ay(e){const n=t.ref(kO(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 EO={class:"em-modeler"},NO={class:"em-modeler__body"},wO={class:"em-drawer__inner"},IO={class:"em-drawer__head"},vO={class:"em-drawer__actions"},CO=["title"],SO=["title"],xO=["title"],RO=["title"],AO=["title"],$O=Qe(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(y){t.nextTick(()=>{const E=y();E&&("focusCollapse"in E?E.focusCollapse():E.focus())})}function c(y){n.value=y,s(()=>y?i.value:a.value)}function d(y){o.value=y,s(()=>y?l.value:r.value)}const u=t.ref(!1),m=t.shallowRef(null),{width:p,dragging:f,startResize:h}=ay({initial:260,min:260,max:560,edge:"right",storageKey:"em.explorerWidth"}),{width:g,dragging:b,startResize:_}=ay({initial:320,min:320,max:640,edge:"left",storageKey:"em.panelWidth"}),k=t.ref(null),N=t.ref(null);return(y,E)=>{var S,A,V;return t.openBlock(),t.createElementBlock("div",EO,[t.createVNode(oy,{controller:e.controller,"history-open":u.value,onExportSvg:E[0]||(E[0]=$=>{var O;return(O=k.value)==null?void 0:O.exportSvg()}),onExportPng:E[1]||(E[1]=$=>{var O;return(O=k.value)==null?void 0:O.exportPng()}),onToggleHistory:E[2]||(E[2]=$=>u.value=!u.value)},null,8,["controller","history-open"]),t.createElementVNode("div",NO,[t.createElementVNode("aside",{class:t.normalizeClass(["em-drawer",{"is-collapsed":!n.value}]),style:t.normalizeStyle({width:t.unref(p)+"px"})},[t.createElementVNode("div",wO,[t.createElementVNode("header",IO,[E[11]||(E[11]=t.createElementVNode("span",null,"Diagram Explorer",-1)),t.createElementVNode("div",vO,[(S=N.value)!=null&&S.hasExpandable?(t.openBlock(),t.createElementBlock("button",{key:0,type:"button",class:"em-drawer__btn",title:e.controller.t((A=N.value)!=null&&A.allExpanded?"em.panel.collapseAll":"em.panel.expandAll"),onClick:E[3]||(E[3]=$=>{var O;return(O=N.value)==null?void 0:O.toggleAll()})},[t.createVNode(Ve,{name:(V=N.value)!=null&&V.allExpanded?"collapse-all":"expand-all",size:16},null,8,["name"])],8,CO)):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:E[4]||(E[4]=$=>c(!1))},[t.createVNode(Ve,{name:"panel-close",size:16})],8,SO)])]),t.createVNode(ny,{ref_key:"explorer",ref:N,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(f)}]),title:e.controller.t("em.panel.resizeWidth"),onPointerdown:E[5]||(E[5]=(...$)=>t.unref(h)&&t.unref(h)(...$))},null,42,xO),[[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:E[6]||(E[6]=$=>c(!0))},[t.createVNode(Ve,{name:"panel-open",size:18})],8,RO),[[t.vShow,!n.value]])]),_:1}),t.createElementVNode("div",{class:t.normalizeClass(["em-modeler__canvas",{"is-drawer-open":n.value,"is-resizing":t.unref(f),"is-inspector-collapsed":!o.value}]),style:t.normalizeStyle({"--em-drawer-shift":t.unref(p)-6+"px"})},[t.createVNode(ty,{ref_key:"canvas",ref:k,controller:e.controller,"diff-marks":m.value,"embed-collapse-storage-key":"em.embedCollapsed"},null,8,["controller","diff-marks"])],6),t.withDirectives(t.createVNode(iy,{ref_key:"inspectorRef",ref:l,controller:e.controller,width:t.unref(g),resizing:t.unref(b),"start-resize":t.unref(_),onCollapse:E[7]||(E[7]=$=>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:E[8]||(E[8]=$=>d(!0))},[t.createVNode(Ve,{name:"panel-right-open",size:18})],8,AO),[[t.vShow,!o.value]])]),_:1}),t.createVNode(_O,{controller:e.controller,open:u.value,onClose:E[9]||(E[9]=$=>u.value=!1),onDiffChange:E[10]||(E[10]=$=>m.value=$)},null,8,["controller","open"])]),t.createVNode(fD,{controller:e.controller,"panel-width":t.unref(g),"inspector-open":o.value},null,8,["controller","panel-width","inspector-open"])])}}}),[["__scopeId","data-v-1e5c0922"]]);be.APPLY_MODEL_OPS_INPUT_SCHEMA=S_,be.AssociationEdge=Qp,be.CUSTOM_TYPE_VALUE=_n,be.CommandStack=Ml,be.DEFAULT_JAVA_TYPE=tl,be.DIAGRAM_JSON_FORMAT=al,be.DIAGRAM_JSON_VERSION=rl,be.DiagramCanvas=ty,be.DiagramExplorer=ny,be.EDITOR=Gn,be.EditModeToggle=eV,be.EditorToolbar=oy,be.EntityModeler=$O,be.EntityNode=Mp,be.GROUP_CODE_ENUM_VALUE=to,be.GroupNode=Vp,be.INHERITED_REF_PREFIX=oa,be.InvalidDiagramJsonError=io,be.JAVA_TYPES=fi,be.LIB_VERSION=ob,be.NoteNode=Bp,be.OpSyncAdapter=_u,be.PHYSICAL_NAME_MAX_LENGTH=hi,be.PropertyPanel=iy,be.RevCache=bu,be.SELECTABLE_JAVA_TYPES=Lc,be.SYMBOLIC_OP_KINDS=ku,be.SYMBOLIC_OP_SCHEMA=ju,be.UI_LOCALES=XI,be.applyDocumentReferenceOnly=Wr,be.buildAgentBatch=x_,be.buildDiagramSvg=dc,be.buildDiffMarks=Rd,be.collectSharedColumns=Dn,be.commands=xb,be.computeAutoLayout=pc,be.createEditorController=PS,be.dedupeModelIds=tb,be.defaultMermaidDialect=Ny,be.defaultSqlDialect=eg,be.diagramToJson=qc,be.displayLabel=aa,be.emptyState=kp,be.entityModelToDdl=Gc,be.entityModelToMermaid=Jr,be.entityModelToText=Sc,be.exportDiagramPng=Qh,be.exportDiagramSvg=Zh,be.fromPersisted=em,be.isGeneratable=cd,be.isInheritedColumnRef=Xn,be.isValueTypeStereotype=_t,be.javaTypeLabel=no,be.makeInheritedColumnRef=gc,be.mergeDiagram=wd,be.mermaidErToImportSource=Fc,be.migrateLegacyMoney=eb,be.multiplicityLabel=ca,be.newId=Pe,be.packEntityBoxes=Ur,be.parseDiagramJson=Wc,be.parseInheritedColumnRef=Hr,be.parseMermaidEr=zc,be.parseSqlDdl=ol,be.planHealBackfillOps=sk,be.projectActionLog=$l,be.projectEntityAudit=Sd,be.projectFieldAudit=Ln,be.projectInheritedColumns=ci,be.projectSeqDiff=Tl,be.renderDiagramSvg=Xc,be.resolveColumnPhysicalName=di,be.resolveDiagram=fc,be.resolveEffectiveColumn=bn,be.resolveQuickFix=fl,be.resolveSharedColumn=Qn,be.resolveSymbolicOps=l_,be.restoreDeepEqual=lo,be.scaffoldEntityJava=Rg,be.sharedColumnScopeEntities=Gr,be.sqlDdlToImportSource=Kc,be.stereotypeLabel=si,be.synthesizeRestoreOps=pb,be.toPersisted=ak,be.toPersistedV2=rk,be.translate=en,be.uiMessagesEn=rp,be.uiMessagesJa=lp,be.uiMessagesKo=sp,be.validateModel=ga,Object.defineProperty(be,Symbol.toStringTag,{value:"Module"})}));