@g1cloud/entity-modeler-next 5.0.0-alpha.25 → 5.0.0-alpha.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entity-modeler-next.css +1 -1
- package/dist/entity-modeler.js +6986 -6986
- package/dist/entity-modeler.umd.cjs +20 -20
- package/package.json +1 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
`).trim()}function Jm(e){return e==="CLASS"?"class":"er"}function Da(e,t){return t==="class"?nf(e):Qm(e)}function
|
|
3
|
-
`)}function ef(e){return e&&e!=="UNDEFINED"?e:null}function tf(e){return(e??"").trim().replace(/</g,"~").replace(/>/g,"~").replace(/[^0-9A-Za-z_~]/g,"")||"any"}function nf(e){const t=
|
|
4
|
-
`)}function of(e){return e.end1.composition||e.end2.composition?"*--":e.end2.navigable||e.end1.navigable?"-->":"--"}const af=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function dt(e){return e.replace(af,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ae(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function Al(e){return`<text ${[`x="${Ae(e.x)}"`,`y="${Ae(e.y)}"`,`fill="${dt(e.fill)}"`,`font-size="${Ae(e.fontSize)}"`,e.fontFamily?`font-family="${dt(e.fontFamily)}"`:"",e.fontWeight!=null?`font-weight="${dt(String(e.fontWeight))}"`:"",e.fontStyle&&e.fontStyle!=="normal"?`font-style="${dt(e.fontStyle)}"`:"",e.anchor&&e.anchor!=="start"?`text-anchor="${e.anchor}"`:"",'dominant-baseline="central"'].filter(Boolean).join(" ")}>${dt(e.text)}</text>`}function rf(e){return`<line x1="${Ae(e.x1)}" y1="${Ae(e.y)}" x2="${Ae(e.x2)}" y2="${Ae(e.y)}" stroke="${dt(e.stroke)}" stroke-width="${Ae(e.strokeWidth??1)}" />`}function lf(e){return e==null?{tl:0,tr:0,br:0,bl:0}:typeof e=="number"?{tl:e,tr:e,br:e,bl:e}:e}function sf(e,t,o,i,a){return[`M${Ae(e+a.tl)},${Ae(t)}`,`L${Ae(e+o-a.tr)},${Ae(t)}`,a.tr?`Q${Ae(e+o)},${Ae(t)} ${Ae(e+o)},${Ae(t+a.tr)}`:"",`L${Ae(e+o)},${Ae(t+i-a.br)}`,a.br?`Q${Ae(e+o)},${Ae(t+i)} ${Ae(e+o-a.br)},${Ae(t+i)}`:"",`L${Ae(e+a.bl)},${Ae(t+i)}`,a.bl?`Q${Ae(e)},${Ae(t+i)} ${Ae(e)},${Ae(t+i-a.bl)}`:"",`L${Ae(e)},${Ae(t+a.tl)}`,a.tl?`Q${Ae(e)},${Ae(t)} ${Ae(e+a.tl)},${Ae(t)}`:"","Z"].filter(Boolean).join(" ")}function Pa(e){const t=lf(e.radius),o=t.tl||t.tr||t.br||t.bl,i=[`fill="${dt(e.fill)}"`,`stroke="${dt(e.stroke)}"`,`stroke-width="${Ae(e.strokeWidth??1)}"`,e.strokeDasharray?`stroke-dasharray="${dt(e.strokeDasharray)}"`:"",e.opacity!=null?`opacity="${Ae(e.opacity)}"`:""].filter(Boolean),r=[o?`<path d="${sf(e.x,e.y,e.w,e.h,t)}" ${i.join(" ")} />`:`<rect x="${Ae(e.x)}" y="${Ae(e.y)}" width="${Ae(e.w)}" height="${Ae(e.h)}" ${i.join(" ")} />`];for(const l of e.lines??[])r.push(rf(l));for(const l of e.texts)r.push(Al(l));for(const l of e.icons??[])r.push(l);return`<g>${r.join("")}</g>`}function cf(e){const o=[`<path ${[`d="${dt(e.d)}"`,'fill="none"',`stroke="${dt(e.stroke)}"`,`stroke-width="${Ae(e.strokeWidth)}"`,e.strokeDasharray?`stroke-dasharray="${dt(e.strokeDasharray)}"`:""].filter(Boolean).join(" ")} />`];for(const i of e.markers??[])o.push(i);for(const i of e.labels)o.push(Al(i));return`<g>${o.join("")}</g>`}function Tl(e){const{x:t,y:o,w:i,h:a}=e.viewBox,r=[];e.background&&r.push(`<rect x="${Ae(t)}" y="${Ae(o)}" width="${Ae(i)}" height="${Ae(a)}" fill="${dt(e.background)}" />`);for(const l of e.groups)r.push(Pa(l));for(const l of e.edges)r.push(cf(l));for(const l of e.entities)r.push(Pa(l));for(const l of e.notes)r.push(Pa(l));return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${Ae(t)} ${Ae(o)} ${Ae(i)} ${Ae(a)}" width="${Ae(i)}" height="${Ae(a)}">`+r.join("")+"</svg>"}const df=["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"],uf=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"]),mf=df.filter(e=>!uf.has(e)),ff={TIMESTAMP_WITH_TIMEZONE:"TIMESTAMP WITH TIME ZONE",BIG_SERIAL:"BIGSERIAL",DOUBLE:"DOUBLE PRECISION"};function La(e){return ff[e]??e}const pf=new Set(["CHAR","VARCHAR","NCHAR","NVARCHAR","BINARY","VARBINARY","NUMERIC","DECIMAL"]),ao=new Set(["NUMERIC","DECIMAL"]);function Vl(e,t=mf){const o=[...t];return e&&!o.includes(e)?[e,...o]:o}const kt="CustomType",In="GroupCodeEnum",za="String",oi=[{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:In,label:"GroupCodeEnum"},{value:"CustomMoneyType",label:"Money"},{value:kt,label:"CustomType"}],hf=new Map(oi.map(e=>[e.value,e.label]));function Sn(e){return hf.get(e)??e}const yf=new Set([In,"CustomMoneyType"]),Ml=oi.filter(e=>!yf.has(e.value)).map(e=>e.value===kt?{...e,label:"CustomType (사용자정의)"}:e);function Bl(e,t=[]){const o=t.map(a=>{var l,s;const r=((l=a.label)==null?void 0:l.ko)??((s=a.label)==null?void 0:s.en);return{value:a.type,label:r?`${a.type} (${r})`:a.type}}),i=[...Ml,...o];return e&&!i.some(a=>a.value===e)?[{value:e,label:Sn(e)},...i]:i}function gf(e){return e.attrType.startsWith("EMBED")&&e.dbAttrs.length>0}function Ua(e,t){var r;if(!e.embedded||!e.attrType.startsWith("EMBED"))return;const o=t.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 Ha(e,t,o){var i;return t.attrType==="DIVIDER"||e==="LOGICAL"?"":o&&t.attrType.startsWith("EMBED")?`${o==="SET"?"Set":"List"}<${Sn(t.type)}>`:gf(t)?Sn(t.type):e==="CLASS"?t.type===kt&&t.customType||Sn(t.type):La(((i=t.dbAttrs[0])==null?void 0:i.dataType)??"")}function ii(e,t){if(e.stereotype!=="JPA_EMBEDDABLE")return[e];const o=t.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 en(e,t){return ii(e,t).flatMap(o=>o.attributes.flatMap(i=>i.dbAttrs))}function tn(e){const t=new Map;for(const o of e)t.set(o.modelId,o);return t}function $n(e,t){if(e.sharedColumnRef==null)return null;const o=t.get(e.sharedColumnRef);return o?{physicalName:o.physicalName,insertable:!1,updatable:!1}:null}const ro=63;function ai(e){if(!e)return null;const t=e.length;return t>ro?t:null}function Dl(e){return e.dataType?e.length==null?e.dataType:e.scale==null?`${e.dataType}(${e.length})`:`${e.dataType}(${e.length},${e.scale})`:"(미지정)"}function ft(e){return!e||e.trim()===""}function lo(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function bf(e){const t=new Map;for(const u of e.associations){if(u.identifying!==!0||u.end1.entityRef===u.end2.entityRef)continue;const m=t.get(u.end1.entityRef)??[];m.push(u.end2.entityRef),t.set(u.end1.entityRef,m)}const o=0,i=1,a=2,r=new Map,l=[],s=[],c=new Set,d=u=>{r.set(u,i),l.push(u);for(const m of t.get(u)??[]){const p=r.get(m)??o;if(p===o)d(m);else if(p===i){const f=l.slice(l.indexOf(m)),y=[...f].sort().join(" ");c.has(y)||(c.add(y),s.push(f))}}l.pop(),r.set(u,a)};for(const u of e.entities)(r.get(u.modelId)??o)===o&&d(u.modelId);return s}function _f(e,t,o,i,a){var r,l,s,c,d;if(!ft(t.physicalName))return t.physicalName;if(e.attrType==="EMBED_PREDEF")return((s=(l=(r=a==null?void 0:a.embeddableCatalog)==null?void 0:r.find(u=>u.type===e.type))==null?void 0:l.fields[o])==null?void 0:s.physicalName)??"";if(e.attrType==="EMBED_OWN"){const u=(c=e.embedded)==null?void 0:c.embeddableRef;if(u==null)return"";const m=(d=i.entities.find(p=>p.modelId===u))==null?void 0:d.attributes.flatMap(p=>p.dbAttrs)[o];return(m==null?void 0:m.physicalName)??""}return t.physicalName??""}function Fa(e,t){const o=new Map;for(const i of e){const a=t(i);a==null||a===""||o.set(a,(o.get(a)??0)+1)}return e.filter(i=>{const a=t(i);return a!=null&&a!==""&&(o.get(a)??0)>1})}function Ol(e,t){var r,l,s,c,d;const o=[];for(const u of Fa(e.entities,m=>m.name))o.push({ruleId:"CHK-NAME-3",severity:"warning",targetKind:"entity",targetRef:u.modelId,params:{name:u.name}});for(const u of e.entities){const m=u.attributes.filter(h=>h.attrType!=="DIVIDER");if(ft(u.name)&&o.push({ruleId:"CHK-NAME-4",severity:"info",targetKind:"entity",targetRef:u.modelId}),u.stereotype==="JPA_ENTITY"&&!u.abstractClass&&(m.some(h=>h.identifier)||o.push({ruleId:"CHK-JPA-1",severity:"error",targetKind:"entity",targetRef:u.modelId}),ft((r=u.table)==null?void 0:r.physicalName)&&o.push({ruleId:"CHK-JPA-8",severity:"warning",targetKind:"entity",targetRef:u.modelId})),u.stereotype==="JPA_EMBEDDABLE")for(const h of m.filter(E=>E.identifier))o.push({ruleId:"CHK-JPA-2",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of m.filter(E=>E.identifier&&E.transient))o.push({ruleId:"CHK-JPA-12",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of m)if(!h.identifier)for(const E of h.dbAttrs)!E.autoIncrement&&ft(E.sequenceName)||o.push({ruleId:"CHK-JPA-13",severity:"error",targetKind:"column",targetRef:E.modelId,contextRef:u.modelId,params:E.autoIncrement?{name:h.name}:{name:h.name,seq:E.sequenceName??""}});for(const h of m.filter(E=>E.naturalId&&E.identifier))o.push({ruleId:"CHK-JPA-15",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of m.filter(E=>E.naturalId&&E.transient))o.push({ruleId:"CHK-JPA-16",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of m.filter(E=>E.naturalId&&!E.notNull&&!E.identifier&&!E.transient))o.push({ruleId:"CHK-JPA-17",severity:"warning",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});!u.abstractClass&&m.length===0&&o.push({ruleId:"CHK-DSN-2",severity:"warning",targetKind:"entity",targetRef:u.modelId}),(t==null?void 0:t.largeEntityThreshold)!=null&&m.length>t.largeEntityThreshold&&o.push({ruleId:"CHK-DSN-4",severity:"info",targetKind:"entity",targetRef:u.modelId,params:{count:m.length,threshold:t.largeEntityThreshold}});for(const h of Fa(m,E=>E.name))o.push({ruleId:"CHK-NAME-1",severity:"warning",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of m)ft(h.name)&&o.push({ruleId:"CHK-NAME-4",severity:"info",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId});const p=m.flatMap(h=>h.dbAttrs).filter(h=>h.sharedColumnRef==null),f=m.flatMap(h=>h.dbAttrs.map((E,X)=>({col:E,name:_f(h,E,X,e,t)})).filter(E=>E.col.sharedColumnRef==null));for(const h of Fa(f,E=>E.name))o.push({ruleId:"CHK-NAME-2",severity:"error",targetKind:"column",targetRef:h.col.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of p){const E=ai(h.physicalName);E!=null&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:u.modelId,params:{max:ro,len:E}}),t!=null&&t.reservedWords&&!ft(h.physicalName)&&t.reservedWords.has(h.physicalName.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.physicalName}}),t!=null&&t.selectableDataTypes&&!ft(h.dataType)&&!t.selectableDataTypes.has(h.dataType)&&o.push({ruleId:"CHK-TYPE-1",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:u.modelId,params:{dataType:h.dataType}}),!ft(h.dataType)&&pf.has(h.dataType)&&!h.length&&o.push({ruleId:"CHK-TYPE-2",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:u.modelId,params:{dataType:h.dataType}})}if((l=t==null?void 0:t.embeddableCatalog)!=null&&l.length){const h=tn(en(u,e.entities));for(const E of m){if(E.attrType!=="EMBED_PREDEF")continue;const X=t.embeddableCatalog.find(z=>z.type===E.type);X&&E.dbAttrs.forEach((z,q)=>{if(z.sharedColumnRef==null)return;const D=X.fields[q],$=h.get(z.sharedColumnRef);if(!D||!$)return;($.dataType!==D.dataType||($.length??null)!==(D.length??null)||($.scale??null)!==(D.scale??null))&&o.push({ruleId:"CHK-TYPE-3",severity:"warning",targetKind:"column",targetRef:z.modelId,contextRef:u.modelId,params:{targetType:Dl($),metaName:D.name,metaType:Dl(D)}})})}}for(const h of m){const E=h.dbAttrs[0];if(!(E!=null&&E.multiValue))continue;h.type===In&&E.dataType==="VARCHAR"||o.push({ruleId:"CHK-TYPE-4",severity:"warning",targetKind:"column",targetRef:E.modelId,contextRef:u.modelId,params:{type:h.type||"",dataType:E.dataType||""}})}const y=(s=u.table)==null?void 0:s.physicalName,b=ai(y);b!=null&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"entity",targetRef:u.modelId,params:{max:ro,len:b}}),t!=null&&t.reservedWords&&!ft(y)&&t.reservedWords.has(y.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"entity",targetRef:u.modelId,params:{name:y}});const k=new Set;for(const h of u.attributes){k.add(h.modelId);for(const E of h.dbAttrs)k.add(E.modelId)}const g=new Set(oo(u,(t==null?void 0:t.superClassCatalog)??[]).map(h=>h.modelId)),w=(((c=t==null?void 0:t.superClassCatalog)==null?void 0:c.length)??0)>0;for(const h of u.indexes??[]){const E=ai(h.name);E!=null&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"index",targetRef:h.modelId,contextRef:u.modelId,params:{max:ro,len:E}}),t!=null&&t.reservedWords&&!ft(h.name)&&t.reservedWords.has(h.name.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"index",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const X of h.columns){const z=X.columnRef;if(k.has(z)||g.has(z))continue;const q=no(z);q&&!w||o.push({ruleId:"CHK-DSN-5",severity:"warning",targetKind:"index",targetRef:h.modelId,contextRef:u.modelId,params:q?{name:h.name,field:((d=Ba(z))==null?void 0:d.field)??z}:{name:h.name}})}}}const i=new Map;for(const u of e.entities)for(const m of u.attributes)m.attrType==="EMBED_OWN"&&m.embedded&&i.set(m.embedded.associationRef,m);for(const u of e.associations){lo(u.end1.multiplicity)&&lo(u.end2.multiplicity)&&o.push({ruleId:"CHK-DSN-1",severity:"info",targetKind:"association",targetRef:u.modelId}),i.has(u.modelId)&&u.identifying&&o.push({ruleId:"CHK-JPA-11",severity:"error",targetKind:"association",targetRef:u.modelId});for(const m of["end1","end2"]){const p=u[m].jpa;if(!p)continue;const f=p.cascadeTypes??[],y=f.includes("ALL"),b=f.includes("REMOVE");y&&f.length>1&&o.push({ruleId:"CHK-JPA-5",severity:"warning",targetKind:"association",targetRef:u.modelId,params:{which:m}}),p.orphanRemoval&&(b||y)&&o.push({ruleId:"CHK-JPA-6",severity:"info",targetKind:"association",targetRef:u.modelId,params:{which:m,cascade:y?"ALL":"REMOVE"}}),lo(u[m].multiplicity)&&p.fetchType==="EAGER"&&o.push({ruleId:"CHK-JPA-7",severity:"warning",targetKind:"association",targetRef:u.modelId,params:{which:m}}),p.orphanRemoval&&lo(u[m==="end1"?"end2":"end1"].multiplicity)&&o.push({ruleId:"CHK-JPA-14",severity:"error",targetKind:"association",targetRef:u.modelId,params:{which:m}}),!lo(u[m].multiplicity)&&(p.collectionType||p.collectionTable||p.orderColumn)&&o.push({ruleId:"CHK-JPA-9",severity:"warning",targetKind:"association",targetRef:u.modelId,params:{which:m}}),p.collectionType==="SET"&&p.orderColumn&&o.push({ruleId:"CHK-JPA-10",severity:"warning",targetKind:"association",targetRef:u.modelId,params:{which:m}})}}const a=new Map(e.entities.map(u=>[u.modelId,u.name||u.modelId]));for(const u of bf(e)){const m=[...u,u[0]].map(p=>a.get(p)??p).join(" → ");for(const p of u)o.push({ruleId:"CHK-JPA-4",severity:"warning",targetKind:"entity",targetRef:p,params:{path:m}})}if(t!=null&&t.flagEntitiesWithoutRelations){const u=new Set;for(const p of e.associations)u.add(p.end1.entityRef),u.add(p.end2.entityRef);const m=new Map(e.entities.map(p=>[p.name,p.modelId]));for(const p of e.entities){for(const f of p.attributes)f.embedded&&(u.add(p.modelId),u.add(f.embedded.embeddableRef));if(!ft(p.superClass)){u.add(p.modelId);const f=m.get(p.superClass);f&&u.add(f)}}for(const p of e.entities)u.has(p.modelId)||o.push({ruleId:"CHK-DSN-3",severity:"info",targetKind:"entity",targetRef:p.modelId})}return o}const Rn="javax.persistence",ze={jsonIdentityInfo:"com.fasterxml.jackson.annotation.JsonIdentityInfo",jsogGenerator:"com.voodoodyne.jackson.jsog.JSOGGenerator",dynamicInsert:"org.hibernate.annotations.DynamicInsert",dynamicUpdate:"org.hibernate.annotations.DynamicUpdate",naturalId:"org.hibernate.annotations.NaturalId",jpaRepository:"org.springframework.data.jpa.repository.JpaRepository",querydslExecutor:"org.springframework.data.querydsl.QuerydslPredicateExecutor",jsonBackReference:"com.fasterxml.jackson.annotation.JsonBackReference",serializable:"java.io.Serializable",objects:"java.util.Objects",hibernateBeanUtil:"net.g1project.bluewave.core.util.HibernateBeanUtil",jsonUtils:"net.g1project.bluewave.core.util.JSONUtils",compositeType:"org.hibernate.annotations.CompositeType",money:"net.g1project.bluecomm.money.Money",moneyUserType:"net.g1project.bluecomm.money.MoneyUserType",jdbcTypeCode:"org.hibernate.annotations.JdbcTypeCode",sqlTypes:"org.hibernate.type.SqlTypes",lombokGetter:"lombok.Getter",lombokNoArgs:"lombok.NoArgsConstructor",lombokAccessLevel:"lombok.AccessLevel"},ri={StoredFile:"net.g1project.bluecomm.model.StoredFile",MultiLangString:"net.g1project.bluecomm.dto.MultiLangString"};function kf(e){if(!e)return;if(ri[e])return{simpleName:e,fqn:ri[e]};const t=Object.entries(ri).find(([,o])=>o===e);return t?{simpleName:t[0],fqn:t[1]}:void 0}function Ef(e,t,o={}){const i=new Map(e.entities.map(r=>[r.modelId,r])),a=[];for(const r of t){const l=i.get(r);l&&a.push(xf(l,e,o))}return a}class Pl{constructor(){He(this,"imports",new Set);He(this,"body",[]);He(this,"fillIns",[])}import(t){t.includes(".")&&!t.startsWith("java.lang.")&&this.imports.add(t)}jpa(t){this.import(`${Rn}.${t}`)}line(t=""){this.body.push(t)}fillIn(t){this.fillIns.push(t)}render(t){const o=[`package ${t};`,""],i=[...this.imports].sort();if(i.length>0){for(const a of i)o.push(`import ${a};`);o.push("")}return o.push(...this.body),o.join(`
|
|
1
|
+
(function(be,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("vue"),require("@g1cloud/open-bluesea-core")):typeof define=="function"&&define.amd?define(["exports","vue","@g1cloud/open-bluesea-core"],n):(be=typeof globalThis<"u"?globalThis:be||self,n(be.EntityModeler={},be.Vue,be.OpenBlueseaCore))})(this,(function(be,n,ie){"use strict";var lA=Object.defineProperty;var sA=(be,n,ie)=>n in be?lA(be,n,{enumerable:!0,configurable:!0,writable:!0,value:ie}):be[n]=ie;var He=(be,n,ie)=>sA(be,typeof n!="symbol"?n+"":n,ie);const Gm={startX:40,startY:40,columnGap:280,rowGap:220,perRow:4,defaultSize:{width:220,height:140}};function jm(e,t){const o=e%t.perRow,i=Math.floor(e/t.perRow);return{location:{x:t.startX+o*t.columnGap,y:t.startY+i*t.rowGap},size:{...t.defaultSize}}}function bl(e,t,o={}){const i={...Gm,...o},a=new Map(e.entities.map(h=>[h.modelId,h])),r=new Map(e.associations.map(h=>[h.modelId,h])),l=new Map(t.entityLayouts.map(h=>[h.entityRef,h])),s=new Map(t.associationLayouts.map(h=>[h.associationRef,h])),c=t.entityLayouts.map(h=>h.entityRef).filter(h=>!a.has(h)),d=t.associationLayouts.map(h=>h.associationRef).filter(h=>!r.has(h)),u=new Map;for(const h of e.groups)for(const w of h.memberEntityRefs)u.set(w,h.modelId);const m=new Map;for(const h of t.groupLayouts)for(const w of h.memberNoteRefs??[])m.set(w,h.groupRef);let p=0;const f=e.entities.map(h=>{const w=u.get(h.modelId),q=l.get(h.modelId);if(q){const W={location:{x:q.geo.location.x,y:q.geo.location.y},size:{width:q.geo.size.width,height:q.geo.size.height}};return{entity:h,geo:W,collapsed:q.collapsed??!1,locked:q.locked??!1,groupRef:w,style:q.style,attributeStyles:q.attributeStyles,operationStyles:q.operationStyles}}const P=jm(p++,i);return{entity:h,geo:P,collapsed:!1,locked:!1,groupRef:w}}),y=new Map(t.groupLayouts.map(h=>[h.groupRef,h])),b=e.groups.map(h=>{const w=y.get(h.modelId),q=w?{location:{x:w.geo.location.x,y:w.geo.location.y},size:{width:w.geo.size.width,height:w.geo.size.height}}:{location:{x:0,y:0},size:{width:400,height:300}};return{group:h,geo:q,style:w==null?void 0:w.style,locked:(w==null?void 0:w.locked)??!1}}),k=e.associations.map(h=>{const w=s.get(h.modelId);return{association:h,waypoints:(w==null?void 0:w.waypoints)??[],sourceColumnRef:w==null?void 0:w.sourceColumnRef,targetColumnRef:w==null?void 0:w.targetColumnRef}}),g=t.notes.map(h=>({note:{...h,geo:{location:{x:h.geo.location.x,y:h.geo.location.y},size:{width:h.geo.size.width,height:h.geo.size.height}}},groupRef:m.get(h.modelId)})),N=[];for(const h of t.notes)for(const w of h.connections??[])a.has(w.targetRef)&&N.push({noteRef:h.modelId,targetRef:w.targetRef,waypoints:w.waypoints.map(q=>({x:q.x,y:q.y}))});return{entities:f,associations:k,groups:b,notes:g,noteConnections:N,prunedEntityRefs:c,prunedAssociationRefs:d}}function no(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 In=.5;function _l(e,t,o,i,a,r){const l=no(t),s=no(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=(k,g)=>{(Math.abs(k.x-p.x)>=In||Math.abs(k.y-p.y)>=In)&&(m.push({a:p,b:k,seg:g}),p=k)};f(c,0);let y=l.x!==0,b=c;for(let k=1;k<u.length;k++){const g=u[k],N=k<=o.length?k-1:o.length,h=Math.abs(g.x-b.x)<In,w=Math.abs(g.y-b.y)<In;h&&w||(h?(f(g,N),y=!1):w?(f(g,N),y=!0):y?(f({x:b.x,y:g.y},N),f(g,N),y=!0):(f({x:g.x,y:b.y},N),f(g,N),y=!1),b=g)}return f(i,o.length),m}function $a(e,t,o,i,a,r=20){const l=_l(e,t,o,i,a,r);let s=`M ${it(e.x)},${it(e.y)}`;for(const c of l)s+=` L ${it(c.b.x)},${it(c.b.y)}`;return s}const Km=14;function Ra(e,t,o,i,a,r=20){return _l(e,t,o,i,a,r).filter(l=>Math.hypot(l.b.x-l.a.x,l.b.y-l.a.y)>=Km).map(l=>({point:{x:(l.a.x+l.b.x)/2,y:(l.a.y+l.b.y)/2},segIndex:l.seg}))}function it(e){return Math.round(e*100)/100}const Ym=36;function kl(e,t,o=Ym){const i=Math.max(e.x,t.x)+o;return`M ${it(e.x)},${it(e.y)} L ${it(i)},${it(e.y)} L ${it(i)},${it(t.y)} L ${it(t.x)},${it(t.y)}`}function Aa(e,t,o){const i=[e,...t,o];let a=`M ${it(i[0].x)},${it(i[0].y)}`;for(let r=1;r<i.length;r++)a+=` L ${it(i[r].x)},${it(i[r].y)}`;return a}function Wm(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Ta(e,t){const o=Wm(e),i=e.width/2,a=e.height/2,r=t.x-o.x,l=t.y-o.y;if(Math.abs(r)<In&&Math.abs(l)<In)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 Va(e,t,o){const i=o>=e.x+e.width/2;return{point:{x:i?e.x+e.width:e.x,y:t},side:i?"right":"left"}}function Ma(e,t,o){const i=[e,...t,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 qm={cellWidth:260,cellHeight:200,pad:24,headerHeight:28,ungroupedCols:4};function El(e,t,o={}){const i={...qm,...o},a=new Map(t.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 y=Math.max(1,Math.floor((f-i.pad*2)/i.cellWidth));u.memberEntityRefs.forEach((b,k)=>{const g=k%y,N=Math.floor(k/y);r.push({id:b,location:{x:p.x+i.pad+g*i.cellWidth,y:p.y+i.pad+i.headerHeight+N*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 wl={cols:5,boxWidth:200,gap:60,baseX:0,baseY:0,headerHeight:48,rowHeight:24,footerHeight:16,minHeight:120};function Nl(e,t={}){const o={...wl,...t},i=o.headerHeight+Math.max(0,e)*o.rowHeight+o.footerHeight;return Math.max(o.minHeight,i)}function Xm(e,t={}){const o={...wl,...t},i=Math.max(1,o.cols),a=new Array(i).fill(o.baseY);return e.map((r,l)=>{const s=l%i,c=Nl(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}}})}const ti="inherited:";function vl(e,t){return`${ti}${e}:${t}`}function oo(e){return e.startsWith(ti)}function Ba(e){if(!oo(e))return null;const t=e.slice(ti.length),o=t.indexOf(":");if(o<0)return null;const i=t.slice(0,o),a=t.slice(o+1);return!i||!a?null:{baseClass:i,field:a}}function io(e,t){var a;if(e.stereotype==="JPA_EMBEDDABLE")return[];if(t.some(r=>r.name===e.name))return[];const o=e.superClass||((a=t.find(r=>r.default))==null?void 0:a.name);if(!o)return[];const i=t.find(r=>r.name===o);return i?i.columns.map(r=>({modelId:vl(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 ni(e,t,o,i,a="(논리명)"){switch(e){case"CLASS":return t;case"PHYSICAL":return i||t;case"LOGICAL":return o||a;default:return i?`${o||a} · ${i}`:o||a}}function xl(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 Cl(e){var r,l,s;const t=new Map(e.entities.map(c=>[c.modelId,c.name])),o=new Map;for(const c of e.entities)for(const d of c.attributes)o.set(d.modelId,d.name);const 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(`## ${c.name}${d} «${c.stereotype}»${u?` [${u}]`:""}`);const m=[...c.attributes].sort((f,y)=>f.order-y.order);for(const f of m){if(f.attrType==="DIVIDER"){a.push(` ${"─".repeat(8)}${f.name?` ${f.name} ${"─".repeat(8)}`:""}`);continue}const y=f.dbAttrs[0],b=y!=null&&y.length?`(${y.length}${y.scale!=null?`,${y.scale}`:""})`:"",k=y?` → ${y.physicalName} ${y.dataType}${b}`:"",g=[f.identifier?"PK":"",f.notNull?"NOT NULL":"",y!=null&&y.unique?"UNIQUE":"",y!=null&&y.autoIncrement?"AUTO_INCREMENT":""].filter(Boolean);a.push(` - ${f.name}: ${f.type}${k}${g.length?` {${g.join(", ")}}`:""}`)}for(const f of c.indexes??[]){const y=f.columns.map(b=>{var k;return`${o.get(b.columnRef)??((k=Ba(b.columnRef))==null?void 0:k.field)??b.columnRef}${b.descending?" DESC":""}`}).join(", ");a.push(` index ${f.name}${f.unique?" UNIQUE":""}: ${y}`)}const p=[...c.operations??[]].sort((f,y)=>f.order-y.order);for(const f of p){const y=f.visibility?` {${f.visibility}}`:"",b=(s=f.description)!=null&&s.ko?` — ${f.description.ko}`:"";a.push(` method ${f.name}()${y}${b}`)}a.push("")}if(e.associations.length){a.push("# 관계");for(const c of e.associations){const d=t.get(c.end1.entityRef)??c.end1.entityRef,u=t.get(c.end2.entityRef)??c.end2.entityRef,m=c.end2.composition||c.end1.composition?" (composition)":"";a.push(` ${d} ${xl(c.end1.multiplicity)} —— ${xl(c.end2.multiplicity)} ${u}${m}`)}}return a.join(`
|
|
2
|
+
`).trim()}function Jm(e){return e==="CLASS"?"class":"er"}function Da(e,t){return t==="class"?nf(e):Qm(e)}function ao(e,t){return(e??"").trim().replace(/[^0-9A-Za-z_]/g,"_").replace(/^(\d)/,"_$1")||t}function Oa(e){return(e??"").replace(/"/g,"'").replace(/\s+/g," ").trim()}function Il(e,t){const o=new Set,i=new Map;return e.entities.forEach((a,r)=>{const l=ao(t(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 Zm(e){return e.attrType==="RELATION_OWN"||e.attrType==="RELATION_REF"||e.derivedFrom!=null}function Sl(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 $l(e,t){return(t==="left"?{NO_INSTANCE_OR_ONE_INSTANCE:"|o",EXACTLY_ONE_INSTANCE:"||",ZERO_OR_MORE_INSTANCES:"}o",ONE_OR_MORE_INSTANCES:"}|"}:{NO_INSTANCE_OR_ONE_INSTANCE:"o|",EXACTLY_ONE_INSTANCE:"||",ZERO_OR_MORE_INSTANCES:"o{",ONE_OR_MORE_INSTANCES:"|{"})[e]}function Qm(e){var i,a;const t=Il(e,r=>{var l;return((l=r.table)==null?void 0:l.physicalName)||r.name}),o=["erDiagram"];for(const r of e.entities){const l=t.get(r.modelId),s=[...r.attributes].filter(c=>c.attrType!=="DIVIDER").sort((c,d)=>c.order-d.order);if(s.length===0){o.push(` ${l}`);continue}o.push(` ${l} {`);for(const c of s){const d=c.dbAttrs[0],u=ao((d==null?void 0:d.dataType)||c.type,"unknown"),m=ao((d==null?void 0:d.physicalName)||c.name,"col"),p=[c.identifier?"PK":"",Zm(c)?"FK":"",d!=null&&d.unique?"UK":""].filter(Boolean).join(", "),f=d!=null&&d.length?`(${d.length}${d.scale!=null?`,${d.scale}`:""})`:"",y=(a=(i=c.dbAttrs[0])==null?void 0:i.logicalName)==null?void 0:a.ko,b=Oa([y,f].filter(Boolean).join(" ")),k=[` ${u} ${m}`];p&&k.push(p);let g=k.join(" ");b&&(g+=` "${b}"`),o.push(g)}o.push(" }")}for(const r of e.associations){const l=t.get(r.end1.entityRef),s=t.get(r.end2.entityRef);if(!l||!s)continue;const c=`${$l(r.end1.multiplicity,"left")}--${$l(r.end2.multiplicity,"right")}`,d=Oa(r.description);o.push(` ${l} ${c} ${s} : "${d}"`)}return o.join(`
|
|
3
|
+
`)}function ef(e){return e&&e!=="UNDEFINED"?e:null}function tf(e){return(e??"").trim().replace(/</g,"~").replace(/>/g,"~").replace(/[^0-9A-Za-z_~]/g,"")||"any"}function nf(e){const t=Il(e,i=>i.name),o=["classDiagram"];for(const i of e.entities){const a=t.get(i.modelId),r=[],l=ef(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(` +${tf(c.type)} ${ao(c.name,"field")}`);for(const c of[...i.operations??[]].sort((d,u)=>d.order-u.order))r.push(` +${ao(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=t.get(i.end1.entityRef),r=t.get(i.end2.entityRef);if(!a||!r)continue;const l=of(i),s=Oa(i.description),c=` ${a} "${Sl(i.end1.multiplicity)}" ${l} "${Sl(i.end2.multiplicity)}" ${r}`;o.push(s?`${c} : ${s}`:c)}return o.join(`
|
|
4
|
+
`)}function of(e){return e.end1.composition||e.end2.composition?"*--":e.end2.navigable||e.end1.navigable?"-->":"--"}const af=/[\u0000-\u0008\u000B\u000C\u000E-\u001F]/g;function mt(e){return e.replace(af,"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ae(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function Rl(e){return`<text ${[`x="${Ae(e.x)}"`,`y="${Ae(e.y)}"`,`fill="${mt(e.fill)}"`,`font-size="${Ae(e.fontSize)}"`,e.fontFamily?`font-family="${mt(e.fontFamily)}"`:"",e.fontWeight!=null?`font-weight="${mt(String(e.fontWeight))}"`:"",e.fontStyle&&e.fontStyle!=="normal"?`font-style="${mt(e.fontStyle)}"`:"",e.anchor&&e.anchor!=="start"?`text-anchor="${e.anchor}"`:"",'dominant-baseline="central"'].filter(Boolean).join(" ")}>${mt(e.text)}</text>`}function rf(e){return`<line x1="${Ae(e.x1)}" y1="${Ae(e.y)}" x2="${Ae(e.x2)}" y2="${Ae(e.y)}" stroke="${mt(e.stroke)}" stroke-width="${Ae(e.strokeWidth??1)}" />`}function lf(e){return e==null?{tl:0,tr:0,br:0,bl:0}:typeof e=="number"?{tl:e,tr:e,br:e,bl:e}:e}function sf(e,t,o,i,a){return[`M${Ae(e+a.tl)},${Ae(t)}`,`L${Ae(e+o-a.tr)},${Ae(t)}`,a.tr?`Q${Ae(e+o)},${Ae(t)} ${Ae(e+o)},${Ae(t+a.tr)}`:"",`L${Ae(e+o)},${Ae(t+i-a.br)}`,a.br?`Q${Ae(e+o)},${Ae(t+i)} ${Ae(e+o-a.br)},${Ae(t+i)}`:"",`L${Ae(e+a.bl)},${Ae(t+i)}`,a.bl?`Q${Ae(e)},${Ae(t+i)} ${Ae(e)},${Ae(t+i-a.bl)}`:"",`L${Ae(e)},${Ae(t+a.tl)}`,a.tl?`Q${Ae(e)},${Ae(t)} ${Ae(e+a.tl)},${Ae(t)}`:"","Z"].filter(Boolean).join(" ")}function Pa(e){const t=lf(e.radius),o=t.tl||t.tr||t.br||t.bl,i=[`fill="${mt(e.fill)}"`,`stroke="${mt(e.stroke)}"`,`stroke-width="${Ae(e.strokeWidth??1)}"`,e.strokeDasharray?`stroke-dasharray="${mt(e.strokeDasharray)}"`:"",e.opacity!=null?`opacity="${Ae(e.opacity)}"`:""].filter(Boolean),r=[o?`<path d="${sf(e.x,e.y,e.w,e.h,t)}" ${i.join(" ")} />`:`<rect x="${Ae(e.x)}" y="${Ae(e.y)}" width="${Ae(e.w)}" height="${Ae(e.h)}" ${i.join(" ")} />`];for(const l of e.lines??[])r.push(rf(l));for(const l of e.texts)r.push(Rl(l));for(const l of e.icons??[])r.push(l);return`<g>${r.join("")}</g>`}function cf(e){const o=[`<path ${[`d="${mt(e.d)}"`,'fill="none"',`stroke="${mt(e.stroke)}"`,`stroke-width="${Ae(e.strokeWidth)}"`,e.strokeDasharray?`stroke-dasharray="${mt(e.strokeDasharray)}"`:""].filter(Boolean).join(" ")} />`];for(const i of e.markers??[])o.push(i);for(const i of e.labels)o.push(Rl(i));return`<g>${o.join("")}</g>`}function Al(e){const{x:t,y:o,w:i,h:a}=e.viewBox,r=[];e.background&&r.push(`<rect x="${Ae(t)}" y="${Ae(o)}" width="${Ae(i)}" height="${Ae(a)}" fill="${mt(e.background)}" />`);for(const l of e.groups)r.push(Pa(l));for(const l of e.edges)r.push(cf(l));for(const l of e.entities)r.push(Pa(l));for(const l of e.notes)r.push(Pa(l));return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${Ae(t)} ${Ae(o)} ${Ae(i)} ${Ae(a)}" width="${Ae(i)}" height="${Ae(a)}">`+r.join("")+"</svg>"}const df=["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"],uf=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"]),mf=df.filter(e=>!uf.has(e)),ff={TIMESTAMP_WITH_TIMEZONE:"TIMESTAMP WITH TIME ZONE",BIG_SERIAL:"BIGSERIAL",DOUBLE:"DOUBLE PRECISION"};function La(e){return ff[e]??e}const pf=new Set(["CHAR","VARCHAR","NCHAR","NVARCHAR","BINARY","VARBINARY","NUMERIC","DECIMAL"]),ro=new Set(["NUMERIC","DECIMAL"]);function Tl(e,t=mf){const o=[...t];return e&&!o.includes(e)?[e,...o]:o}const wt="CustomType",Sn="GroupCodeEnum",za="String",oi=[{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:Sn,label:"GroupCodeEnum"},{value:"CustomMoneyType",label:"Money"},{value:wt,label:"CustomType"}],hf=new Map(oi.map(e=>[e.value,e.label]));function $n(e){return hf.get(e)??e}const yf=new Set([Sn,"CustomMoneyType"]),Vl=oi.filter(e=>!yf.has(e.value)).map(e=>e.value===wt?{...e,label:"CustomType (사용자정의)"}:e);function Ml(e,t=[]){const o=t.map(a=>{var l,s;const r=((l=a.label)==null?void 0:l.ko)??((s=a.label)==null?void 0:s.en);return{value:a.type,label:r?`${a.type} (${r})`:a.type}}),i=[...Vl,...o];return e&&!i.some(a=>a.value===e)?[{value:e,label:$n(e)},...i]:i}function gf(e){return e.attrType.startsWith("EMBED")&&e.dbAttrs.length>0}function Ua(e,t){var r;if(!e.embedded||!e.attrType.startsWith("EMBED"))return;const o=t.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 Ha(e,t,o){var i;return t.attrType==="DIVIDER"||e==="LOGICAL"?"":o&&t.attrType.startsWith("EMBED")?`${o==="SET"?"Set":"List"}<${$n(t.type)}>`:gf(t)?$n(t.type):e==="CLASS"?t.type===wt&&t.customType||$n(t.type):La(((i=t.dbAttrs[0])==null?void 0:i.dataType)??"")}function ii(e,t){if(e.stereotype!=="JPA_EMBEDDABLE")return[e];const o=t.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 en(e,t){return ii(e,t).flatMap(o=>o.attributes.flatMap(i=>i.dbAttrs))}function tn(e){const t=new Map;for(const o of e)t.set(o.modelId,o);return t}function Rn(e,t){if(e.sharedColumnRef==null)return null;const o=t.get(e.sharedColumnRef);return o?{physicalName:o.physicalName,insertable:!1,updatable:!1}:null}const lo=63;function ai(e){if(!e)return null;const t=e.length;return t>lo?t:null}function Bl(e){return e.dataType?e.length==null?e.dataType:e.scale==null?`${e.dataType}(${e.length})`:`${e.dataType}(${e.length},${e.scale})`:"(미지정)"}function ht(e){return!e||e.trim()===""}function so(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function bf(e){const t=new Map;for(const u of e.associations){if(u.identifying!==!0||u.end1.entityRef===u.end2.entityRef)continue;const m=t.get(u.end1.entityRef)??[];m.push(u.end2.entityRef),t.set(u.end1.entityRef,m)}const o=0,i=1,a=2,r=new Map,l=[],s=[],c=new Set,d=u=>{r.set(u,i),l.push(u);for(const m of t.get(u)??[]){const p=r.get(m)??o;if(p===o)d(m);else if(p===i){const f=l.slice(l.indexOf(m)),y=[...f].sort().join(" ");c.has(y)||(c.add(y),s.push(f))}}l.pop(),r.set(u,a)};for(const u of e.entities)(r.get(u.modelId)??o)===o&&d(u.modelId);return s}function _f(e,t,o,i,a){var r,l,s,c,d;if(!ht(t.physicalName))return t.physicalName;if(e.attrType==="EMBED_PREDEF")return((s=(l=(r=a==null?void 0:a.embeddableCatalog)==null?void 0:r.find(u=>u.type===e.type))==null?void 0:l.fields[o])==null?void 0:s.physicalName)??"";if(e.attrType==="EMBED_OWN"){const u=(c=e.embedded)==null?void 0:c.embeddableRef;if(u==null)return"";const m=(d=i.entities.find(p=>p.modelId===u))==null?void 0:d.attributes.flatMap(p=>p.dbAttrs)[o];return(m==null?void 0:m.physicalName)??""}return t.physicalName??""}function Fa(e,t){const o=new Map;for(const i of e){const a=t(i);a==null||a===""||o.set(a,(o.get(a)??0)+1)}return e.filter(i=>{const a=t(i);return a!=null&&a!==""&&(o.get(a)??0)>1})}function Dl(e,t){var r,l,s,c,d;const o=[];for(const u of Fa(e.entities,m=>m.name))o.push({ruleId:"CHK-NAME-3",severity:"warning",targetKind:"entity",targetRef:u.modelId,params:{name:u.name}});for(const u of e.entities){const m=u.attributes.filter(h=>h.attrType!=="DIVIDER");if(ht(u.name)&&o.push({ruleId:"CHK-NAME-4",severity:"info",targetKind:"entity",targetRef:u.modelId}),u.stereotype==="JPA_ENTITY"&&!u.abstractClass&&(m.some(h=>h.identifier)||o.push({ruleId:"CHK-JPA-1",severity:"error",targetKind:"entity",targetRef:u.modelId}),ht((r=u.table)==null?void 0:r.physicalName)&&o.push({ruleId:"CHK-JPA-8",severity:"warning",targetKind:"entity",targetRef:u.modelId})),u.stereotype==="JPA_EMBEDDABLE")for(const h of m.filter(w=>w.identifier))o.push({ruleId:"CHK-JPA-2",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of m.filter(w=>w.identifier&&w.transient))o.push({ruleId:"CHK-JPA-12",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of m)if(!h.identifier)for(const w of h.dbAttrs)!w.autoIncrement&&ht(w.sequenceName)||o.push({ruleId:"CHK-JPA-13",severity:"error",targetKind:"column",targetRef:w.modelId,contextRef:u.modelId,params:w.autoIncrement?{name:h.name}:{name:h.name,seq:w.sequenceName??""}});for(const h of m.filter(w=>w.naturalId&&w.identifier))o.push({ruleId:"CHK-JPA-15",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of m.filter(w=>w.naturalId&&w.transient))o.push({ruleId:"CHK-JPA-16",severity:"error",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of m.filter(w=>w.naturalId&&!w.notNull&&!w.identifier&&!w.transient))o.push({ruleId:"CHK-JPA-17",severity:"warning",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});!u.abstractClass&&m.length===0&&o.push({ruleId:"CHK-DSN-2",severity:"warning",targetKind:"entity",targetRef:u.modelId}),(t==null?void 0:t.largeEntityThreshold)!=null&&m.length>t.largeEntityThreshold&&o.push({ruleId:"CHK-DSN-4",severity:"info",targetKind:"entity",targetRef:u.modelId,params:{count:m.length,threshold:t.largeEntityThreshold}});for(const h of Fa(m,w=>w.name))o.push({ruleId:"CHK-NAME-1",severity:"warning",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of m)ht(h.name)&&o.push({ruleId:"CHK-NAME-4",severity:"info",targetKind:"attribute",targetRef:h.modelId,contextRef:u.modelId});const p=m.flatMap(h=>h.dbAttrs).filter(h=>h.sharedColumnRef==null),f=m.flatMap(h=>h.dbAttrs.map((w,q)=>({col:w,name:_f(h,w,q,e,t)})).filter(w=>w.col.sharedColumnRef==null));for(const h of Fa(f,w=>w.name))o.push({ruleId:"CHK-NAME-2",severity:"error",targetKind:"column",targetRef:h.col.modelId,contextRef:u.modelId,params:{name:h.name}});for(const h of p){const w=ai(h.physicalName);w!=null&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:u.modelId,params:{max:lo,len:w}}),t!=null&&t.reservedWords&&!ht(h.physicalName)&&t.reservedWords.has(h.physicalName.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.physicalName}}),t!=null&&t.selectableDataTypes&&!ht(h.dataType)&&!t.selectableDataTypes.has(h.dataType)&&o.push({ruleId:"CHK-TYPE-1",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:u.modelId,params:{dataType:h.dataType}}),!ht(h.dataType)&&pf.has(h.dataType)&&!h.length&&o.push({ruleId:"CHK-TYPE-2",severity:"warning",targetKind:"column",targetRef:h.modelId,contextRef:u.modelId,params:{dataType:h.dataType}})}if((l=t==null?void 0:t.embeddableCatalog)!=null&&l.length){const h=tn(en(u,e.entities));for(const w of m){if(w.attrType!=="EMBED_PREDEF")continue;const q=t.embeddableCatalog.find(P=>P.type===w.type);q&&w.dbAttrs.forEach((P,W)=>{if(P.sharedColumnRef==null)return;const M=q.fields[W],$=h.get(P.sharedColumnRef);if(!M||!$)return;($.dataType!==M.dataType||($.length??null)!==(M.length??null)||($.scale??null)!==(M.scale??null))&&o.push({ruleId:"CHK-TYPE-3",severity:"warning",targetKind:"column",targetRef:P.modelId,contextRef:u.modelId,params:{targetType:Bl($),metaName:M.name,metaType:Bl(M)}})})}}for(const h of m){const w=h.dbAttrs[0];if(!(w!=null&&w.multiValue))continue;h.type===Sn&&w.dataType==="VARCHAR"||o.push({ruleId:"CHK-TYPE-4",severity:"warning",targetKind:"column",targetRef:w.modelId,contextRef:u.modelId,params:{type:h.type||"",dataType:w.dataType||""}})}const y=(s=u.table)==null?void 0:s.physicalName,b=ai(y);b!=null&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"entity",targetRef:u.modelId,params:{max:lo,len:b}}),t!=null&&t.reservedWords&&!ht(y)&&t.reservedWords.has(y.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"entity",targetRef:u.modelId,params:{name:y}});const k=new Set;for(const h of u.attributes){k.add(h.modelId);for(const w of h.dbAttrs)k.add(w.modelId)}const g=new Set(io(u,(t==null?void 0:t.superClassCatalog)??[]).map(h=>h.modelId)),N=(((c=t==null?void 0:t.superClassCatalog)==null?void 0:c.length)??0)>0;for(const h of u.indexes??[]){const w=ai(h.name);w!=null&&o.push({ruleId:"CHK-NAME-5",severity:"warning",targetKind:"index",targetRef:h.modelId,contextRef:u.modelId,params:{max:lo,len:w}}),t!=null&&t.reservedWords&&!ht(h.name)&&t.reservedWords.has(h.name.toUpperCase())&&o.push({ruleId:"CHK-NAME-6",severity:"warning",targetKind:"index",targetRef:h.modelId,contextRef:u.modelId,params:{name:h.name}});for(const q of h.columns){const P=q.columnRef;if(k.has(P)||g.has(P))continue;const W=oo(P);W&&!N||o.push({ruleId:"CHK-DSN-5",severity:"warning",targetKind:"index",targetRef:h.modelId,contextRef:u.modelId,params:W?{name:h.name,field:((d=Ba(P))==null?void 0:d.field)??P}:{name:h.name}})}}}const i=new Map;for(const u of e.entities)for(const m of u.attributes)m.attrType==="EMBED_OWN"&&m.embedded&&i.set(m.embedded.associationRef,m);for(const u of e.associations){so(u.end1.multiplicity)&&so(u.end2.multiplicity)&&o.push({ruleId:"CHK-DSN-1",severity:"info",targetKind:"association",targetRef:u.modelId}),i.has(u.modelId)&&u.identifying&&o.push({ruleId:"CHK-JPA-11",severity:"error",targetKind:"association",targetRef:u.modelId});for(const m of["end1","end2"]){const p=u[m].jpa;if(!p)continue;const f=p.cascadeTypes??[],y=f.includes("ALL"),b=f.includes("REMOVE");y&&f.length>1&&o.push({ruleId:"CHK-JPA-5",severity:"warning",targetKind:"association",targetRef:u.modelId,params:{which:m}}),p.orphanRemoval&&(b||y)&&o.push({ruleId:"CHK-JPA-6",severity:"info",targetKind:"association",targetRef:u.modelId,params:{which:m,cascade:y?"ALL":"REMOVE"}}),so(u[m].multiplicity)&&p.fetchType==="EAGER"&&o.push({ruleId:"CHK-JPA-7",severity:"warning",targetKind:"association",targetRef:u.modelId,params:{which:m}}),p.orphanRemoval&&so(u[m==="end1"?"end2":"end1"].multiplicity)&&o.push({ruleId:"CHK-JPA-14",severity:"error",targetKind:"association",targetRef:u.modelId,params:{which:m}}),!so(u[m].multiplicity)&&(p.collectionType||p.collectionTable||p.orderColumn)&&o.push({ruleId:"CHK-JPA-9",severity:"warning",targetKind:"association",targetRef:u.modelId,params:{which:m}}),p.collectionType==="SET"&&p.orderColumn&&o.push({ruleId:"CHK-JPA-10",severity:"warning",targetKind:"association",targetRef:u.modelId,params:{which:m}})}}const a=new Map(e.entities.map(u=>[u.modelId,u.name||u.modelId]));for(const u of bf(e)){const m=[...u,u[0]].map(p=>a.get(p)??p).join(" → ");for(const p of u)o.push({ruleId:"CHK-JPA-4",severity:"warning",targetKind:"entity",targetRef:p,params:{path:m}})}if(t!=null&&t.flagEntitiesWithoutRelations){const u=new Set;for(const p of e.associations)u.add(p.end1.entityRef),u.add(p.end2.entityRef);const m=new Map(e.entities.map(p=>[p.name,p.modelId]));for(const p of e.entities){for(const f of p.attributes)f.embedded&&(u.add(p.modelId),u.add(f.embedded.embeddableRef));if(!ht(p.superClass)){u.add(p.modelId);const f=m.get(p.superClass);f&&u.add(f)}}for(const p of e.entities)u.has(p.modelId)||o.push({ruleId:"CHK-DSN-3",severity:"info",targetKind:"entity",targetRef:p.modelId})}return o}const An="javax.persistence",ze={jsonIdentityInfo:"com.fasterxml.jackson.annotation.JsonIdentityInfo",jsogGenerator:"com.voodoodyne.jackson.jsog.JSOGGenerator",dynamicInsert:"org.hibernate.annotations.DynamicInsert",dynamicUpdate:"org.hibernate.annotations.DynamicUpdate",naturalId:"org.hibernate.annotations.NaturalId",jpaRepository:"org.springframework.data.jpa.repository.JpaRepository",querydslExecutor:"org.springframework.data.querydsl.QuerydslPredicateExecutor",jsonBackReference:"com.fasterxml.jackson.annotation.JsonBackReference",serializable:"java.io.Serializable",objects:"java.util.Objects",hibernateBeanUtil:"net.g1project.bluewave.core.util.HibernateBeanUtil",jsonUtils:"net.g1project.bluewave.core.util.JSONUtils",compositeType:"org.hibernate.annotations.CompositeType",money:"net.g1project.bluecomm.money.Money",moneyUserType:"net.g1project.bluecomm.money.MoneyUserType",jdbcTypeCode:"org.hibernate.annotations.JdbcTypeCode",sqlTypes:"org.hibernate.type.SqlTypes",lombokGetter:"lombok.Getter",lombokNoArgs:"lombok.NoArgsConstructor",lombokAccessLevel:"lombok.AccessLevel"},ri={StoredFile:"net.g1project.bluecomm.model.StoredFile",MultiLangString:"net.g1project.bluecomm.dto.MultiLangString"};function kf(e){if(!e)return;if(ri[e])return{simpleName:e,fqn:ri[e]};const t=Object.entries(ri).find(([,o])=>o===e);return t?{simpleName:t[0],fqn:t[1]}:void 0}function Ef(e,t,o={}){const i=new Map(e.entities.map(r=>[r.modelId,r])),a=[];for(const r of t){const l=i.get(r);l&&a.push(xf(l,e,o))}return a}class Ol{constructor(){He(this,"imports",new Set);He(this,"body",[]);He(this,"fillIns",[])}import(t){t.includes(".")&&!t.startsWith("java.lang.")&&this.imports.add(t)}jpa(t){this.import(`${An}.${t}`)}line(t=""){this.body.push(t)}fillIn(t){this.fillIns.push(t)}render(t){const o=[`package ${t};`,""],i=[...this.imports].sort();if(i.length>0){for(const a of i)o.push(`import ${a};`);o.push("")}return o.push(...this.body),o.join(`
|
|
5
5
|
`)+`
|
|
6
|
-
`}}function Ll(e){return e?e.length===0?e:e[0].toUpperCase()+e.slice(1):""}function wf(e){return e?e.toLowerCase().replace(/_([a-z0-9])/g,(t,o)=>o.toUpperCase()):""}function An(e,t){t&&(e.import(ze.lombokGetter),e.line(" @Getter"))}const Nf=["ko","en","ja","zh"];function Ga(e,t){if(!e)return[];const o=Nf.filter(i=>e[i]!=null&&e[i]!=="").map(i=>`${t} * <li>${i}: ${e[i]}</li>`);return o.length===0?[]:[`${t}/**`,`${t} * <ul>`,...o,`${t} * </ul>`,`${t} */`]}function li(e,t,o,i){const a={type:e,primitive:!1,imports:[],fieldAnnotations:[],fillIns:[]};if(!e)return{...a,type:"Object",fillIns:["속성 타입 미지정 — Object로 폴백 방출, 모델 정정 필요"]};const l=[...oi,...o.javaTypeCatalog??[]].find(c=>c.value===e);if(e===In){if(i){const c=[`${Rn}.Enumerated`,`${Rn}.EnumType`],d=[];return o.groupCodeEnumPackage?c.push(`${o.groupCodeEnumPackage}.${i}`):d.push(`enum ${i} import 패키지 확인 (groupCodeEnumPackage 미주입 — 같은 패키지 가정)`),{type:i,primitive:!1,imports:c,fieldAnnotations:["@Enumerated(EnumType.STRING)"],fillIns:d}}return{type:"Enum",primitive:!1,imports:[`${Rn}.Enumerated`,`${Rn}.EnumType`],fieldAnnotations:["@Enumerated(EnumType.STRING)"],fillIns:["enum 타입 확인 필요 (groupCode 미지정 — 실제 자바 enum 클래스 지정)"]}}if(e===kt){const c=kf(t),d=c?`CustomType '${t}' 은 predef 타입 '${c.simpleName}' 로 승격됨 — 모델에서 '${c.simpleName}' 타입으로 변경 권장(그러면 @JdbcTypeCode + import 자동 방출)`:`CustomType 확인 필요: ${t??"(미지정)"}`;return{...a,type:t||"Object",fillIns:[d]}}if(e==="CustomMoneyType")return{type:"Money",primitive:!1,imports:["net.g1project.bluecomm.money.Money",`${Rn}.Convert`],fieldAnnotations:["@Convert(converter = net.g1project.bluecomm.money.MoneyAttributeConverter.class)"],fillIns:[]};const s=ri[e];if(s)return{type:e,primitive:!1,imports:[s,ze.jdbcTypeCode,ze.sqlTypes],fieldAnnotations:["@JdbcTypeCode(SqlTypes.JSON)"],fillIns:[]};if(l){const c=l.label,d=[],u=[];return["LocalDate","LocalDateTime","Instant","ZonedDateTime","OffsetDateTime"].includes(c)?d.push(`java.time.${c}`):c==="Date"?(d.push("java.util.Date"),u.push("Date 타입 다의 — 레거시 java.util.Date로 방출, 필요 시 JSR-310로 보정")):c==="BigDecimal"||c==="BigInteger"?d.push(`java.math.${c}`):c==="Currency"&&d.push("java.util.Currency"),{type:c,primitive:l.boxed!=null,imports:d,fieldAnnotations:[],fillIns:u}}return{...a,fillIns:[`타입 해소 확인 필요: ${e}`]}}function zl(e){return e.attributes.filter(t=>t.identifier&&(t.attrType==="NORMAL"||t.attrType==="RELATION_OWN")).sort((t,o)=>t.order-o.order)}function ja(e,t,o,i=new Set){if(e.attrType!=="RELATION_OWN")return li(e.type,e.customType,o,e.groupCode).type;const a=t.entities.find(l=>l.name===e.type);if(!a||i.has(a.modelId))return li(e.type,e.customType,o).type;const r=zl(a);return r.length>=2?`${a.name}PK`:r.length===1?ja(r[0],t,o,new Set([...i,a.modelId])):li(e.type,e.customType,o).type}function vf(e,t,o){if(!e.identifier||e.attrType!=="RELATION_OWN"||!t)return!1;const i=!Ya(t.end2.multiplicity),a=e.dbAttrs.length===1?e.dbAttrs[0].physicalName:void 0;return i&&!!a&&o.has(a)}function xf(e,t,o){var D,$,B,Q,V,re;if(e.stereotype==="JPA_EMBEDDABLE")return Cf(e,t,o);const i=new Pl,a=e.name;let r=so(e,t,o);r||(i.fillIn(`${a}: package 미지정 — 로컬 소스트리 관례로 결정 필요(임시 '${si}')`),r=si);const l=new Map(t.entities.map(_=>[_.modelId,_])),s=r,c=Mf(e,o,i),d=new Map;for(const _ of t.associations)_.end2.attributeRef&&d.set(_.end2.attributeRef,{assoc:_,role:"owner"}),_.end1.attributeRef&&_.end1.navigable&&d.set(_.end1.attributeRef,{assoc:_,role:"inverse"});const u=zl(e),m=new Set(u.filter(_=>_.attrType==="NORMAL").flatMap(_=>_.dbAttrs.map(W=>W.physicalName)).filter(Boolean)),p=new Set;for(const _ of u)vf(_,(D=d.get(_.modelId))==null?void 0:D.assoc,m)&&p.add(_.modelId);const f=u.filter(_=>!p.has(_.modelId)),y=f.length>=2,b=f.length===1,k=`${a}PK`,g=_=>p.has(_.modelId)?"mapsId":_.identifier?"id":"none",w=o.lombok!==!1;i.jpa("Entity"),i.import(ze.jsonIdentityInfo),i.import(ze.jsogGenerator);const h=["@Entity"];h.push($f(e,o,i)),h.push('@SuppressWarnings("serial")'),h.push("@JsonIdentityInfo(generator = JSOGGenerator.class)"),y&&(i.jpa("IdClass"),i.import(`${r}.${a}.${k}`),h.push(`@IdClass(${a}.${k}.class)`)),($=e.jpaAttrs)!=null&&$.useDynamicInsert&&(h.push("@DynamicInsert"),i.import(ze.dynamicInsert)),(B=e.jpaAttrs)!=null&&B.useDynamicUpdate&&(h.push("@DynamicUpdate"),i.import(ze.dynamicUpdate)),(Q=e.jpaAttrs)!=null&&Q.useCacheable&&(h.push("@Cacheable"),i.jpa("Cacheable")),w&&(i.import(ze.lombokNoArgs),i.import(ze.lombokAccessLevel),h.push("@NoArgsConstructor(access = AccessLevel.PROTECTED)"));for(const _ of Ga((V=e.table)==null?void 0:V.logicalName,""))i.line(_);for(const _ of h)i.line(_);i.line(`public class ${a}${c} {`);const E=e.attributes.filter(_=>_.attrType!=="DIVIDER").sort((_,W)=>_.order-W.order),X=(re=e.jpaAttrs)!=null&&re.useVersion?u.length?u[u.length-1].modelId:null:void 0,z=[];for(const _ of E){if(_.attrType.startsWith("EMBED"))z.push(...jl(_,e,t,o,i));else if(_.attrType==="RELATION_OWN"){const W=d.get(_.modelId);W&&z.push(Af(_,W.assoc,s,l,g(_),w,t,o,i))}else if(_.attrType==="RELATION_REF"){const W=d.get(_.modelId);W&&z.push(Tf(_,W.assoc,s,l,w,t,o,i))}else z.push(Fl(_,a,o,i));_.modelId===X&&Ul(i,z,w)}X===null&&Ul(i,z,w),w||(i.line(""),i.line(` protected ${a}() {`),i.line(" }")),Hl(z,i,w),y&&(i.import(ze.jsonBackReference),i.import(ze.hibernateBeanUtil),i.line(""),i.line(" @JsonBackReference"),i.line(" public String getStringId() {"),i.line(" return HibernateBeanUtil.getIdString(this);"),i.line(" }"),i.line(""),i.line(" @JsonBackReference"),i.line(` public ${k} getPK() {`),i.line(` return (${k}) HibernateBeanUtil.getPK(this);`),i.line(" }"),Bf(k,f.map(_=>({type:ja(_,t,o),name:_.name})),w,i)),i.line("}");let q;return y?q=Df(a,k,r):b&&(q=Of(a,r,ja(f[0],t,o))),{modelId:e.modelId,fileName:`${a}.java`,packageName:r,source:i.render(r),fillIns:i.fillIns,repository:q}}function Ul(e,t,o){e.jpa("Column"),e.jpa("Version"),e.line(""),e.line(' @Column(name = "data_ver")'),e.line(" @Version"),e.line(" private int dataVersion;"),o||t.push({type:"int",name:"dataVersion",category:0})}function Hl(e,t,o){const i=e.map((a,r)=>({g:a,i:r})).sort((a,r)=>a.g.category-r.g.category||a.i-r.i);for(const{g:a}of i){if(o&&!a.collection)continue;t.line(""),t.line(` public ${a.type} get${Ll(a.name)}() {`);const r=a.collection?a.type.startsWith("Set<")?"unmodifiableSet":"unmodifiableList":void 0;r?(t.import("java.util.Collections"),t.line(` return Collections.${r}(this.${a.name});`)):t.line(` return ${a.name};`),t.line(" }")}}function Cf(e,t,o){var c;const i=new Pl,a=e.name;let r=so(e,t,o);r||(i.fillIn(`${a}: package 미지정 — 로컬 소스트리 관례로 결정 필요(임시 '${si}')`),r=si),i.jpa("Embeddable"),i.import(ze.jsonIdentityInfo),i.import(ze.jsogGenerator),i.import(ze.serializable);for(const d of Ga((c=e.table)==null?void 0:c.logicalName,""))i.line(d);i.line("@Embeddable"),i.line('@SuppressWarnings("serial")'),i.line("@JsonIdentityInfo(generator = JSOGGenerator.class)"),i.line(`public class ${a} implements Serializable {`);const l=e.attributes.filter(d=>d.attrType!=="DIVIDER").sort((d,u)=>d.order-u.order),s=[];for(const d of l){if(d.attrType.startsWith("EMBED")){s.push(...jl(d,e,t,o,i));continue}s.push(Fl(d,a,o,i))}return Hl(s,i,o.lombok!==!1),i.line("}"),{modelId:e.modelId,fileName:`${a}.java`,packageName:r,source:i.render(r),fillIns:i.fillIns}}function Fl(e,t,o,i){const a=e.dbAttrs[0],r=e.name||wf(a==null?void 0:a.physicalName)||"unnamedField";e.name||i.fillIn(`${t}.${r}: 속성 이름 미지정 — 물리명 '${(a==null?void 0:a.physicalName)??""}'에서 파생, 모델 정정 필요`);const l=li(e.type,e.customType,o,e.groupCode);for(const d of l.imports)i.import(d);for(const d of l.fillIns)i.fillIn(`${t}.${r}: ${d}`);const s=(a==null?void 0:a.multiValue)===!0,c=s?`Set<${l.type}>`:l.type;s&&(i.import("java.util.Set"),i.import("java.util.LinkedHashSet"),i.fillIn(`${t}.${r}: 다중값(단일 컬럼 Set) 컨버터 @Convert(converter = <…AttributeConverter>.class) 지정`)),i.line("");for(const d of Ga(a==null?void 0:a.logicalName," "))i.line(d);e.identifier&&(i.jpa("Id"),i.line(" @Id"),a!=null&&a.autoIncrement&&(i.jpa("GeneratedValue"),i.jpa("GenerationType"),i.line(" @GeneratedValue(strategy = GenerationType.IDENTITY)"))),e.naturalId&&(i.import(ze.naturalId),i.line(e.naturalIdMutable?" @NaturalId(mutable = true)":" @NaturalId")),i.line(` ${Vf(e,a,i)}`);for(const d of l.fieldAnnotations)i.line(` ${d}`);return s?(i.line(` // TODO [손채움]: ${r} 다중값 Set 컨버터 — @Convert(converter = <…AttributeConverter>.class)`),An(i,o.lombok!==!1),i.line(` private ${c} ${r} = new LinkedHashSet<>();`)):(An(i,o.lombok!==!1),i.line(` private ${c} ${r};`)),{type:c,name:r,category:0}}function Gl(e,t,o){var r,l;if(e.attrType==="EMBED_PREDEF"){const s=(r=o.embeddableCatalog)==null?void 0:r.find(c=>c.type===e.type);return e.dbAttrs.map((c,d)=>{var u,m;return{fieldName:((u=s==null?void 0:s.fields[d])==null?void 0:u.name)??"",defaultPhysical:((m=s==null?void 0:s.fields[d])==null?void 0:m.physicalName)??""}})}const i=(l=e.embedded)!=null&&l.embeddableRef?t.entities.find(s=>s.modelId===e.embedded.embeddableRef):void 0,a=[];if(i)for(const s of i.attributes.filter(c=>c.attrType!=="DIVIDER"))for(const c of s.dbAttrs)c.physicalName&&a.push({fieldName:s.name,defaultPhysical:c.physicalName});return a}function If(e,t,o,i,a){const r=tn(en(t,o.entities)),l=[];return e.dbAttrs.forEach((s,c)=>{const d=i[c],u=$n(s,r);if(!d||!d.fieldName){(u||s.physicalName&&s.physicalName!==(d==null?void 0:d.defaultPhysical))&&a.fillIn(`${t.name}.${e.name}: EMBED 서브컬럼[${c}] @AttributeOverride 필드명 미해소(카탈로그/임베더블 확인)`);return}if(u){l.push(`@AttributeOverride(name = "${d.fieldName}", column = @Column(name = "${u.physicalName}", insertable = false, updatable = false))`);return}const m=s.physicalName||d.defaultPhysical;m&&m!==d.defaultPhysical&&l.push(`@AttributeOverride(name = "${d.fieldName}", column = @Column(name = "${m}"))`)}),l}function jl(e,t,o,i,a){var m,p,f,y;const r=t.name,l=so(t,o,i);let s=e.type;if(e.attrType==="EMBED_OWN"){const b=(m=e.embedded)!=null&&m.embeddableRef?o.entities.find(k=>k.modelId===e.embedded.embeddableRef):void 0;if(b){s=b.name;const k=so(b,o,i);k&&k!==l&&a.import(`${k}.${b.name}`)}}if(e.type==="Money")return[Sf(e,t,o,i,a)];const c=Gl(e,o,i),d=If(e,t,o,c,a),u=Ua(e,o.associations);if(a.line(""),u){const b=o.associations.find(X=>{var z;return X.modelId===((z=e.embedded)==null?void 0:z.associationRef)}),k=b?b.end2.entityRef===((p=e.embedded)==null?void 0:p.embeddableRef)?b.end2:b.end1:void 0;a.jpa("ElementCollection"),a.line(" @ElementCollection");const g=(f=k==null?void 0:k.jpa)==null?void 0:f.collectionTable;g?(a.jpa("CollectionTable"),a.line(` @CollectionTable(name = "${g}")`)):a.fillIn(`${r}.${e.name}: @CollectionTable 이름 미지정(코드젠 규약 폴백 또는 지정 필요)`),Ka(d,a);const w=u==="SET";!w&&((y=k==null?void 0:k.jpa)!=null&&y.orderColumn)&&(a.jpa("OrderColumn"),a.line(` @OrderColumn(name = "${k.jpa.orderColumn}")`)),a.import(w?"java.util.Set":"java.util.List"),a.import(w?"java.util.LinkedHashSet":"java.util.ArrayList");const h=w?`Set<${s}>`:`List<${s}>`,E=w?"new LinkedHashSet<>()":"new ArrayList<>()";return a.line(` private ${h} ${e.name} = ${E};`),[{type:h,name:e.name,category:0,collection:!0}]}return a.jpa("Embedded"),a.line(" @Embedded"),Ka(d,a),An(a,i.lombok!==!1),a.line(` private ${s} ${e.name};`),[{type:s,name:e.name,category:0}]}function Sf(e,t,o,i,a){a.jpa("Embedded"),a.import(ze.compositeType),a.import(ze.money),a.import(ze.moneyUserType);const r=Gl(e,o,i),l=tn(en(t,o.entities)),s=e.dbAttrs.flatMap((c,d)=>{var k,g;const u=((k=r[d])==null?void 0:k.fieldName)||(d===0?"amount":d===1?"currency":`field${d}`),m=$n(c,l),p=((g=r[d])==null?void 0:g.defaultPhysical)||"",f=c.physicalName||"",y=c.insertable===!1||c.updatable===!1;if(!m&&!y&&(!f||f===p))return[];const b=[`name = "${m?m.physicalName:f||p}"`];return e.notNull&&b.push("nullable = false"),m?b.push("insertable = false","updatable = false"):(c.insertable===!1&&b.push("insertable = false"),c.updatable===!1&&b.push("updatable = false")),[`@AttributeOverride(name = "${u}", column = @Column(${b.join(", ")}))`]});return a.line(""),a.line(" @Embedded"),a.line(" @CompositeType(MoneyUserType.class)"),Ka(s,a),An(a,i.lombok!==!1),a.line(` private Money ${e.name};`),{type:"Money",name:e.name,category:0}}function Ka(e,t){e.length!==0&&(t.jpa("AttributeOverride"),t.jpa("AttributeOverrides"),t.jpa("Column"),t.line(" @AttributeOverrides({"),e.forEach((o,i)=>t.line(` ${o}${i<e.length-1?",":""}`)),t.line(" })"))}function $f(e,t,o){var c;o.jpa("Table");const i=((c=e.table)==null?void 0:c.physicalName)??"",a=e.indexes??[];if(a.length===0)return`@Table(name = "${i}")`;o.jpa("Index");const r=new Map;for(const d of e.attributes)for(const u of d.dbAttrs)r.set(u.modelId,u.physicalName);for(const d of oo(e,t.superClassCatalog??[]))r.set(d.modelId,d.physicalName);const l=a.map(d=>{const u=[];for(const p of d.columns){const f=r.get(p.columnRef);f?u.push(f):o.fillIn(`${e.name}.@Index(${d.name}): 컬럼 참조 미해소(${p.columnRef}) — 카탈로그 확인`)}const m=d.unique?", unique = true":"";return`@Index(name = "${d.name}", columnList = "${u.join(", ")}"${m})`});if(l.length===1)return`@Table(name = "${i}", indexes = { ${l[0]} })`;const s=l.map(d=>` ${d}`).join(`,
|
|
6
|
+
`}}function Pl(e){return e?e.length===0?e:e[0].toUpperCase()+e.slice(1):""}function wf(e){return e?e.toLowerCase().replace(/_([a-z0-9])/g,(t,o)=>o.toUpperCase()):""}function Tn(e,t){t&&(e.import(ze.lombokGetter),e.line(" @Getter"))}const Nf=["ko","en","ja","zh"];function Ga(e,t){if(!e)return[];const o=Nf.filter(i=>e[i]!=null&&e[i]!=="").map(i=>`${t} * <li>${i}: ${e[i]}</li>`);return o.length===0?[]:[`${t}/**`,`${t} * <ul>`,...o,`${t} * </ul>`,`${t} */`]}function li(e,t,o,i){const a={type:e,primitive:!1,imports:[],fieldAnnotations:[],fillIns:[]};if(!e)return{...a,type:"Object",fillIns:["속성 타입 미지정 — Object로 폴백 방출, 모델 정정 필요"]};const l=[...oi,...o.javaTypeCatalog??[]].find(c=>c.value===e);if(e===Sn){if(i){const c=[`${An}.Enumerated`,`${An}.EnumType`],d=[];return o.groupCodeEnumPackage?c.push(`${o.groupCodeEnumPackage}.${i}`):d.push(`enum ${i} import 패키지 확인 (groupCodeEnumPackage 미주입 — 같은 패키지 가정)`),{type:i,primitive:!1,imports:c,fieldAnnotations:["@Enumerated(EnumType.STRING)"],fillIns:d}}return{type:"Enum",primitive:!1,imports:[`${An}.Enumerated`,`${An}.EnumType`],fieldAnnotations:["@Enumerated(EnumType.STRING)"],fillIns:["enum 타입 확인 필요 (groupCode 미지정 — 실제 자바 enum 클래스 지정)"]}}if(e===wt){const c=kf(t),d=c?`CustomType '${t}' 은 predef 타입 '${c.simpleName}' 로 승격됨 — 모델에서 '${c.simpleName}' 타입으로 변경 권장(그러면 @JdbcTypeCode + import 자동 방출)`:`CustomType 확인 필요: ${t??"(미지정)"}`;return{...a,type:t||"Object",fillIns:[d]}}if(e==="CustomMoneyType")return{type:"Money",primitive:!1,imports:["net.g1project.bluecomm.money.Money",`${An}.Convert`],fieldAnnotations:["@Convert(converter = net.g1project.bluecomm.money.MoneyAttributeConverter.class)"],fillIns:[]};const s=ri[e];if(s)return{type:e,primitive:!1,imports:[s,ze.jdbcTypeCode,ze.sqlTypes],fieldAnnotations:["@JdbcTypeCode(SqlTypes.JSON)"],fillIns:[]};if(l){const c=l.label,d=[],u=[];return["LocalDate","LocalDateTime","Instant","ZonedDateTime","OffsetDateTime"].includes(c)?d.push(`java.time.${c}`):c==="Date"?(d.push("java.util.Date"),u.push("Date 타입 다의 — 레거시 java.util.Date로 방출, 필요 시 JSR-310로 보정")):c==="BigDecimal"||c==="BigInteger"?d.push(`java.math.${c}`):c==="Currency"&&d.push("java.util.Currency"),{type:c,primitive:l.boxed!=null,imports:d,fieldAnnotations:[],fillIns:u}}return{...a,fillIns:[`타입 해소 확인 필요: ${e}`]}}function Ll(e){return e.attributes.filter(t=>t.identifier&&(t.attrType==="NORMAL"||t.attrType==="RELATION_OWN")).sort((t,o)=>t.order-o.order)}function ja(e,t,o,i=new Set){if(e.attrType!=="RELATION_OWN")return li(e.type,e.customType,o,e.groupCode).type;const a=t.entities.find(l=>l.name===e.type);if(!a||i.has(a.modelId))return li(e.type,e.customType,o).type;const r=Ll(a);return r.length>=2?`${a.name}PK`:r.length===1?ja(r[0],t,o,new Set([...i,a.modelId])):li(e.type,e.customType,o).type}function vf(e,t,o){if(!e.identifier||e.attrType!=="RELATION_OWN"||!t)return!1;const i=!Ya(t.end2.multiplicity),a=e.dbAttrs.length===1?e.dbAttrs[0].physicalName:void 0;return i&&!!a&&o.has(a)}function xf(e,t,o){var M,$,D,J,B,re;if(e.stereotype==="JPA_EMBEDDABLE")return Cf(e,t,o);const i=new Ol,a=e.name;let r=co(e,t,o);r||(i.fillIn(`${a}: package 미지정 — 로컬 소스트리 관례로 결정 필요(임시 '${si}')`),r=si);const l=new Map(t.entities.map(_=>[_.modelId,_])),s=r,c=Mf(e,o,i),d=new Map;for(const _ of t.associations)_.end2.attributeRef&&d.set(_.end2.attributeRef,{assoc:_,role:"owner"}),_.end1.attributeRef&&_.end1.navigable&&d.set(_.end1.attributeRef,{assoc:_,role:"inverse"});const u=Ll(e),m=new Set(u.filter(_=>_.attrType==="NORMAL").flatMap(_=>_.dbAttrs.map(K=>K.physicalName)).filter(Boolean)),p=new Set;for(const _ of u)vf(_,(M=d.get(_.modelId))==null?void 0:M.assoc,m)&&p.add(_.modelId);const f=u.filter(_=>!p.has(_.modelId)),y=f.length>=2,b=f.length===1,k=`${a}PK`,g=_=>p.has(_.modelId)?"mapsId":_.identifier?"id":"none",N=o.lombok!==!1;i.jpa("Entity"),i.import(ze.jsonIdentityInfo),i.import(ze.jsogGenerator);const h=["@Entity"];h.push($f(e,o,i)),h.push('@SuppressWarnings("serial")'),h.push("@JsonIdentityInfo(generator = JSOGGenerator.class)"),y&&(i.jpa("IdClass"),i.import(`${r}.${a}.${k}`),h.push(`@IdClass(${a}.${k}.class)`)),($=e.jpaAttrs)!=null&&$.useDynamicInsert&&(h.push("@DynamicInsert"),i.import(ze.dynamicInsert)),(D=e.jpaAttrs)!=null&&D.useDynamicUpdate&&(h.push("@DynamicUpdate"),i.import(ze.dynamicUpdate)),(J=e.jpaAttrs)!=null&&J.useCacheable&&(h.push("@Cacheable"),i.jpa("Cacheable")),N&&(i.import(ze.lombokNoArgs),i.import(ze.lombokAccessLevel),h.push("@NoArgsConstructor(access = AccessLevel.PROTECTED)"));for(const _ of Ga((B=e.table)==null?void 0:B.logicalName,""))i.line(_);for(const _ of h)i.line(_);i.line(`public class ${a}${c} {`);const w=e.attributes.filter(_=>_.attrType!=="DIVIDER").sort((_,K)=>_.order-K.order),q=(re=e.jpaAttrs)!=null&&re.useVersion?u.length?u[u.length-1].modelId:null:void 0,P=[];for(const _ of w){if(_.attrType.startsWith("EMBED"))P.push(...Gl(_,e,t,o,i));else if(_.attrType==="RELATION_OWN"){const K=d.get(_.modelId);K&&P.push(Af(_,K.assoc,s,l,g(_),N,t,o,i))}else if(_.attrType==="RELATION_REF"){const K=d.get(_.modelId);K&&P.push(Tf(_,K.assoc,s,l,N,t,o,i))}else P.push(Hl(_,a,o,i));_.modelId===q&&zl(i,P,N)}q===null&&zl(i,P,N),N||(i.line(""),i.line(` protected ${a}() {`),i.line(" }")),Ul(P,i,N),y&&(i.import(ze.jsonBackReference),i.import(ze.hibernateBeanUtil),i.line(""),i.line(" @JsonBackReference"),i.line(" public String getStringId() {"),i.line(" return HibernateBeanUtil.getIdString(this);"),i.line(" }"),i.line(""),i.line(" @JsonBackReference"),i.line(` public ${k} getPK() {`),i.line(` return (${k}) HibernateBeanUtil.getPK(this);`),i.line(" }"),Bf(k,f.map(_=>({type:ja(_,t,o),name:_.name})),N,i)),i.line("}");let W;return y?W=Df(a,k,r):b&&(W=Of(a,r,ja(f[0],t,o))),{modelId:e.modelId,fileName:`${a}.java`,packageName:r,source:i.render(r),fillIns:i.fillIns,repository:W}}function zl(e,t,o){e.jpa("Column"),e.jpa("Version"),e.line(""),e.line(' @Column(name = "data_ver")'),e.line(" @Version"),e.line(" private int dataVersion;"),o||t.push({type:"int",name:"dataVersion",category:0})}function Ul(e,t,o){const i=e.map((a,r)=>({g:a,i:r})).sort((a,r)=>a.g.category-r.g.category||a.i-r.i);for(const{g:a}of i){if(o&&!a.collection)continue;t.line(""),t.line(` public ${a.type} get${Pl(a.name)}() {`);const r=a.collection?a.type.startsWith("Set<")?"unmodifiableSet":"unmodifiableList":void 0;r?(t.import("java.util.Collections"),t.line(` return Collections.${r}(this.${a.name});`)):t.line(` return ${a.name};`),t.line(" }")}}function Cf(e,t,o){var c;const i=new Ol,a=e.name;let r=co(e,t,o);r||(i.fillIn(`${a}: package 미지정 — 로컬 소스트리 관례로 결정 필요(임시 '${si}')`),r=si),i.jpa("Embeddable"),i.import(ze.jsonIdentityInfo),i.import(ze.jsogGenerator),i.import(ze.serializable);for(const d of Ga((c=e.table)==null?void 0:c.logicalName,""))i.line(d);i.line("@Embeddable"),i.line('@SuppressWarnings("serial")'),i.line("@JsonIdentityInfo(generator = JSOGGenerator.class)"),i.line(`public class ${a} implements Serializable {`);const l=e.attributes.filter(d=>d.attrType!=="DIVIDER").sort((d,u)=>d.order-u.order),s=[];for(const d of l){if(d.attrType.startsWith("EMBED")){s.push(...Gl(d,e,t,o,i));continue}s.push(Hl(d,a,o,i))}return Ul(s,i,o.lombok!==!1),i.line("}"),{modelId:e.modelId,fileName:`${a}.java`,packageName:r,source:i.render(r),fillIns:i.fillIns}}function Hl(e,t,o,i){const a=e.dbAttrs[0],r=e.name||wf(a==null?void 0:a.physicalName)||"unnamedField";e.name||i.fillIn(`${t}.${r}: 속성 이름 미지정 — 물리명 '${(a==null?void 0:a.physicalName)??""}'에서 파생, 모델 정정 필요`);const l=li(e.type,e.customType,o,e.groupCode);for(const d of l.imports)i.import(d);for(const d of l.fillIns)i.fillIn(`${t}.${r}: ${d}`);const s=(a==null?void 0:a.multiValue)===!0,c=s?`Set<${l.type}>`:l.type;s&&(i.import("java.util.Set"),i.import("java.util.LinkedHashSet"),i.fillIn(`${t}.${r}: 다중값(단일 컬럼 Set) 컨버터 @Convert(converter = <…AttributeConverter>.class) 지정`)),i.line("");for(const d of Ga(a==null?void 0:a.logicalName," "))i.line(d);e.identifier&&(i.jpa("Id"),i.line(" @Id"),a!=null&&a.autoIncrement&&(i.jpa("GeneratedValue"),i.jpa("GenerationType"),i.line(" @GeneratedValue(strategy = GenerationType.IDENTITY)"))),e.naturalId&&(i.import(ze.naturalId),i.line(e.naturalIdMutable?" @NaturalId(mutable = true)":" @NaturalId")),i.line(` ${Vf(e,a,i)}`);for(const d of l.fieldAnnotations)i.line(` ${d}`);return s?(i.line(` // TODO [손채움]: ${r} 다중값 Set 컨버터 — @Convert(converter = <…AttributeConverter>.class)`),Tn(i,o.lombok!==!1),i.line(` private ${c} ${r} = new LinkedHashSet<>();`)):(Tn(i,o.lombok!==!1),i.line(` private ${c} ${r};`)),{type:c,name:r,category:0}}function Fl(e,t,o){var r,l;if(e.attrType==="EMBED_PREDEF"){const s=(r=o.embeddableCatalog)==null?void 0:r.find(c=>c.type===e.type);return e.dbAttrs.map((c,d)=>{var u,m;return{fieldName:((u=s==null?void 0:s.fields[d])==null?void 0:u.name)??"",defaultPhysical:((m=s==null?void 0:s.fields[d])==null?void 0:m.physicalName)??""}})}const i=(l=e.embedded)!=null&&l.embeddableRef?t.entities.find(s=>s.modelId===e.embedded.embeddableRef):void 0,a=[];if(i)for(const s of i.attributes.filter(c=>c.attrType!=="DIVIDER"))for(const c of s.dbAttrs)c.physicalName&&a.push({fieldName:s.name,defaultPhysical:c.physicalName});return a}function If(e,t,o,i,a){const r=tn(en(t,o.entities)),l=[];return e.dbAttrs.forEach((s,c)=>{const d=i[c],u=Rn(s,r);if(!d||!d.fieldName){(u||s.physicalName&&s.physicalName!==(d==null?void 0:d.defaultPhysical))&&a.fillIn(`${t.name}.${e.name}: EMBED 서브컬럼[${c}] @AttributeOverride 필드명 미해소(카탈로그/임베더블 확인)`);return}if(u){l.push(`@AttributeOverride(name = "${d.fieldName}", column = @Column(name = "${u.physicalName}", insertable = false, updatable = false))`);return}const m=s.physicalName||d.defaultPhysical;m&&m!==d.defaultPhysical&&l.push(`@AttributeOverride(name = "${d.fieldName}", column = @Column(name = "${m}"))`)}),l}function Gl(e,t,o,i,a){var m,p,f,y;const r=t.name,l=co(t,o,i);let s=e.type;if(e.attrType==="EMBED_OWN"){const b=(m=e.embedded)!=null&&m.embeddableRef?o.entities.find(k=>k.modelId===e.embedded.embeddableRef):void 0;if(b){s=b.name;const k=co(b,o,i);k&&k!==l&&a.import(`${k}.${b.name}`)}}if(e.type==="Money")return[Sf(e,t,o,i,a)];const c=Fl(e,o,i),d=If(e,t,o,c,a),u=Ua(e,o.associations);if(a.line(""),u){const b=o.associations.find(q=>{var P;return q.modelId===((P=e.embedded)==null?void 0:P.associationRef)}),k=b?b.end2.entityRef===((p=e.embedded)==null?void 0:p.embeddableRef)?b.end2:b.end1:void 0;a.jpa("ElementCollection"),a.line(" @ElementCollection");const g=(f=k==null?void 0:k.jpa)==null?void 0:f.collectionTable;g?(a.jpa("CollectionTable"),a.line(` @CollectionTable(name = "${g}")`)):a.fillIn(`${r}.${e.name}: @CollectionTable 이름 미지정(코드젠 규약 폴백 또는 지정 필요)`),Ka(d,a);const N=u==="SET";!N&&((y=k==null?void 0:k.jpa)!=null&&y.orderColumn)&&(a.jpa("OrderColumn"),a.line(` @OrderColumn(name = "${k.jpa.orderColumn}")`)),a.import(N?"java.util.Set":"java.util.List"),a.import(N?"java.util.LinkedHashSet":"java.util.ArrayList");const h=N?`Set<${s}>`:`List<${s}>`,w=N?"new LinkedHashSet<>()":"new ArrayList<>()";return a.line(` private ${h} ${e.name} = ${w};`),[{type:h,name:e.name,category:0,collection:!0}]}return a.jpa("Embedded"),a.line(" @Embedded"),Ka(d,a),Tn(a,i.lombok!==!1),a.line(` private ${s} ${e.name};`),[{type:s,name:e.name,category:0}]}function Sf(e,t,o,i,a){a.jpa("Embedded"),a.import(ze.compositeType),a.import(ze.money),a.import(ze.moneyUserType);const r=Fl(e,o,i),l=tn(en(t,o.entities)),s=e.dbAttrs.flatMap((c,d)=>{var k,g;const u=((k=r[d])==null?void 0:k.fieldName)||(d===0?"amount":d===1?"currency":`field${d}`),m=Rn(c,l),p=((g=r[d])==null?void 0:g.defaultPhysical)||"",f=c.physicalName||"",y=c.insertable===!1||c.updatable===!1;if(!m&&!y&&(!f||f===p))return[];const b=[`name = "${m?m.physicalName:f||p}"`];return e.notNull&&b.push("nullable = false"),m?b.push("insertable = false","updatable = false"):(c.insertable===!1&&b.push("insertable = false"),c.updatable===!1&&b.push("updatable = false")),[`@AttributeOverride(name = "${u}", column = @Column(${b.join(", ")}))`]});return a.line(""),a.line(" @Embedded"),a.line(" @CompositeType(MoneyUserType.class)"),Ka(s,a),Tn(a,i.lombok!==!1),a.line(` private Money ${e.name};`),{type:"Money",name:e.name,category:0}}function Ka(e,t){e.length!==0&&(t.jpa("AttributeOverride"),t.jpa("AttributeOverrides"),t.jpa("Column"),t.line(" @AttributeOverrides({"),e.forEach((o,i)=>t.line(` ${o}${i<e.length-1?",":""}`)),t.line(" })"))}function $f(e,t,o){var c;o.jpa("Table");const i=((c=e.table)==null?void 0:c.physicalName)??"",a=e.indexes??[];if(a.length===0)return`@Table(name = "${i}")`;o.jpa("Index");const r=new Map;for(const d of e.attributes)for(const u of d.dbAttrs)r.set(u.modelId,u.physicalName);for(const d of io(e,t.superClassCatalog??[]))r.set(d.modelId,d.physicalName);const l=a.map(d=>{const u=[];for(const p of d.columns){const f=r.get(p.columnRef);f?u.push(f):o.fillIn(`${e.name}.@Index(${d.name}): 컬럼 참조 미해소(${p.columnRef}) — 카탈로그 확인`)}const m=d.unique?", unique = true":"";return`@Index(name = "${d.name}", columnList = "${u.join(", ")}"${m})`});if(l.length===1)return`@Table(name = "${i}", indexes = { ${l[0]} })`;const s=l.map(d=>` ${d}`).join(`,
|
|
7
7
|
`);return`@Table(name = "${i}", indexes = {
|
|
8
8
|
${s}
|
|
9
|
-
})`}function Ya(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function Rf(e,t,o){var r;const i=o.get(t.end1.entityRef);if(e.derivedFrom){const l=i==null?void 0:i.attributes.find(s=>s.modelId===e.derivedFrom.sourceAttributeRef);if(l!=null&&l.dbAttrs[0])return l.dbAttrs[0].physicalName}const a=i==null?void 0:i.attributes.find(l=>l.identifier&&l.dbAttrs.length>0);return(r=a==null?void 0:a.dbAttrs[0])==null?void 0:r.physicalName}function
|
|
9
|
+
})`}function Ya(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function Rf(e,t,o){var r;const i=o.get(t.end1.entityRef);if(e.derivedFrom){const l=i==null?void 0:i.attributes.find(s=>s.modelId===e.derivedFrom.sourceAttributeRef);if(l!=null&&l.dbAttrs[0])return l.dbAttrs[0].physicalName}const a=i==null?void 0:i.attributes.find(l=>l.identifier&&l.dbAttrs.length>0);return(r=a==null?void 0:a.dbAttrs[0])==null?void 0:r.physicalName}function jl(e,t,o,i,a){if(!e)return;const r=co(e,o,i);r&&r!==t&&a.import(`${r}.${e.name}`)}function Af(e,t,o,i,a,r,l,s,c){var N,h;const d=i.get(t.end1.entityRef),u=(d==null?void 0:d.name)??t.end1.entityRef,m=Ya(t.end2.multiplicity)?"ManyToOne":"OneToOne";c.jpa(m),jl(d,o,l,s,c);const p=t.end2.jpa,f=[];e.notNull&&f.push("optional = false"),p!=null&&p.fetchType&&(c.jpa("FetchType"),f.push(`fetch = FetchType.${p.fetchType}`)),(N=p==null?void 0:p.cascadeTypes)!=null&&N.length&&(c.jpa("CascadeType"),f.push(`cascade = { ${p.cascadeTypes.map(w=>`CascadeType.${w}`).join(", ")} }`));const y=e.dbAttrs[0];c.jpa("JoinColumn");const b=Rf(e,t,i),k=(y==null?void 0:y.physicalName)||b||"",g=[];return k?g.push(`name = "${k}"`):c.fillIn(`${((h=i.get(t.end2.entityRef))==null?void 0:h.name)??""}.${e.name}: @JoinColumn 컬럼명 미해소(FK·참조 컬럼 물리명 부재) — 확인 필요`),b&&g.push(`referencedColumnName = "${b}"`),e.notNull&&g.push("nullable = false"),(y==null?void 0:y.insertable)===!1&&g.push("insertable = false"),(y==null?void 0:y.updatable)===!1&&g.push("updatable = false"),c.line(""),a==="id"&&(c.jpa("Id"),c.line(" @Id")),c.line(` @${m}${f.length?`(${f.join(", ")})`:""}`),c.line(` @JoinColumn(${g.join(", ")})`),a==="mapsId"&&(c.jpa("MapsId"),c.line(" @MapsId")),Tn(c,r),c.line(` private ${u} ${e.name};`),{type:u,name:e.name,category:2}}function Tf(e,t,o,i,a,r,l,s){const c=i.get(t.end2.entityRef),d=(c==null?void 0:c.name)??t.end2.entityRef;jl(c,o,r,l,s);const u=c==null?void 0:c.attributes.find(q=>q.modelId===t.end2.attributeRef),m=(u==null?void 0:u.name)??"",p=Ya(t.end2.multiplicity);if(s.line(""),!p)return s.jpa("OneToOne"),s.line(` @OneToOne(mappedBy = "${m}")`),Tn(s,a),s.line(` private ${d} ${e.name};`),{type:d,name:e.name,category:1};s.jpa("OneToMany");const f=t.end1.jpa,y=t.end1.composition||t.end2.composition;let b=(f==null?void 0:f.cascadeTypes)??[],k=f==null?void 0:f.orphanRemoval;y&&b.length===0&&(b=["ALL"],k==null&&(k=!0),s.fillIn(`${d}.${e.name}: composition → cascade=ALL·orphanRemoval=true 제안(사람 확인)`));const g=[`mappedBy = "${m}"`];b.length&&(s.jpa("CascadeType"),g.push(`cascade = { ${b.map(q=>`CascadeType.${q}`).join(", ")} }`)),k&&g.push("orphanRemoval = true"),f!=null&&f.fetchType&&(s.jpa("FetchType"),g.push(`fetch = FetchType.${f.fetchType}`)),s.line(` @OneToMany(${g.join(", ")})`),f!=null&&f.orderBy&&(s.jpa("OrderBy"),s.line(` @OrderBy("${f.orderBy}")`));const N=(f==null?void 0:f.collectionType)==="SET";s.import(N?"java.util.Set":"java.util.List"),s.import(N?"java.util.LinkedHashSet":"java.util.ArrayList");const h=N?`Set<${d}>`:`List<${d}>`,w=N?"new LinkedHashSet<>()":"new ArrayList<>()";return s.line(` private ${h} ${e.name} = ${w};`),{type:h,name:e.name,category:1,collection:!0}}function Vf(e,t,o){o.jpa("Column");const i=[`name = "${(t==null?void 0:t.physicalName)??""}"`];if(e.notNull&&i.push("nullable = false"),t){const a=ro.has(t.dataType);t.length!=null&&i.push(a?`precision = ${t.length}`:`length = ${t.length}`),t.scale!=null&&i.push(`scale = ${t.scale}`),t.insertable===!1&&i.push("insertable = false"),t.updatable===!1&&i.push("updatable = false"),t.unique&&i.push("unique = true")}return`@Column(${i.join(", ")})`}function Mf(e,t,o){var l;const i=t.superClassCatalog??[],a=e.superClass||((l=i.find(s=>s.default))==null?void 0:l.name);if(!a||a==="Object")return"";const r=i.find(s=>s.name===a);return r!=null&&r.packageName?o.import(`${r.packageName}.${r.name}`):o.fillIn(`${e.name}: superClass '${a}' import 확인 필요 (카탈로그 미등록 또는 packageName 부재)`),` extends ${a}`}function Bf(e,t,o,i){i.import(ze.serializable),i.import(ze.objects),i.import(ze.jsonUtils),o&&i.import(ze.lombokGetter),i.line(""),i.line(` public static class ${e} implements Serializable {`);for(const a of t)i.line(""),o&&i.line(" @Getter"),i.line(` private ${a.type} ${a.name};`);i.line(""),i.line(` protected ${e}() {`),i.line(" }"),i.line(""),i.line(` public ${e}(${t.map(a=>`${a.type} ${a.name}`).join(", ")}) {`);for(const a of t)i.line(` this.${a.name} = ${a.name};`);if(i.line(" }"),!o)for(const a of t)i.line(""),i.line(` public ${a.type} get${Pl(a.name)}() {`),i.line(` return ${a.name};`),i.line(" }");i.line(""),i.line(" @Override"),i.line(" public int hashCode() {"),i.line(` return Objects.hash(${t.map(a=>a.name).join(", ")});`),i.line(" }"),i.line(""),i.line(" @Override"),i.line(" public boolean equals(Object obj) {"),i.line(" if (this == obj) {"),i.line(" return true;"),i.line(" }"),i.line(" if (obj == null) {"),i.line(" return false;"),i.line(" }"),i.line(" if (getClass() != obj.getClass()) {"),i.line(" return false;"),i.line(" }"),i.line(` ${e} other = (${e}) obj;`),i.line(` return ${t.map(a=>`Objects.equals(this.${a.name}, other.${a.name})`).join(" && ")};`),i.line(" }"),i.line(""),i.line(` public static ${e} getPK(String stringId) {`),i.line(` return JSONUtils.readValue(stringId, ${e}.class);`),i.line(" }"),i.line(" }")}function Df(e,t,o){const i=[`${o}.${e}`,`${o}.${e}.${t}`,ze.jpaRepository,ze.querydslExecutor].sort(),a=[`package ${o};`,""];for(const r of i)a.push(`import ${r};`);return a.push(""),a.push(`public interface ${e}Repository extends JpaRepository<${e}, ${t}>, QuerydslPredicateExecutor<${e}> {`),a.push("}"),{fileName:`${e}Repository.java`,source:a.join(`
|
|
10
10
|
`)+`
|
|
11
11
|
`}}function Of(e,t,o){const i=[`${t}.${e}`,ze.jpaRepository,ze.querydslExecutor].sort(),a=[`package ${t};`,""];for(const r of i)a.push(`import ${r};`);return a.push(""),a.push(`public interface ${e}Repository extends JpaRepository<${e}, ${o}>, QuerydslPredicateExecutor<${e}> {`),a.push("}"),{fileName:`${e}Repository.java`,source:a.join(`
|
|
12
12
|
`)+`
|
|
13
|
-
`}}const si="com.example",Pf="command.domain";function so(e,t,o={}){if(e.packageName)return e.packageName;const i=o.packageConfig;if(i!=null&&i.basePackage){const a=t.groups.find(c=>{var d;return(d=c.memberEntityRefs)==null?void 0:d.includes(e.modelId)}),r=a!=null&&a.packageName?`.${a.packageName}`:"",l=i.layerSuffix??Pf,s=l?`.${l}`:"";return`${i.basePackage}${r}${s}`}return t.packageName||""}function Be(){return crypto.randomUUID()}const Lf="CustomMoneyType",zf="Money";function Uf(e){return!(e.type!==Lf||e.attrType!=="NORMAL"||e.identifier||e.dbAttrs.length>1)}function Hf(e){const t=e.dbAttrs[0]??{modelId:Be(),physicalName:"",dataType:""},o={modelId:Be(),physicalName:"",dataType:""},{customType:i,...a}=e;return{...a,type:zf,attrType:"EMBED_PREDEF",dbAttrs:[t,o]}}function Ff(e){let t=!1;const o=e.entities.map(i=>{let a=!1;const r=i.attributes.map(l=>Uf(l)?(a=!0,t=!0,Hf(l)):l);return a?{...i,attributes:r}:i});return t?{...e,entities:o}:e}function Yl(e){return!!e.derivedFrom&&e.dbAttrs.length>0}function Wl(e){for(const t of e){const o=[...t.attributes].sort((s,c)=>s.order-c.order),i=o.filter(Yl);if(!i.length)continue;const a=o.filter(s=>!Yl(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),t.attributes=l}}function Tn(e){return JSON.parse(JSON.stringify(e))}function ql(e,t,o){var q;const i=o.idFactory??Be,a=o.offset??{x:0,y:0},{logical:r,layout:l}=e,s=new Set(t);if(o.includeRelated){const D=new Set(t);for(const $ of r.associations){const B=D.has($.end1.entityRef),Q=D.has($.end2.entityRef);B!==Q&&s.add(B?$.end2.entityRef:$.end1.entityRef)}}const c=r.entities.filter(D=>s.has(D.modelId)),d=new Set(c.map(D=>D.modelId)),u=r.associations.filter(D=>d.has(D.end1.entityRef)&&d.has(D.end2.entityRef)),m=new Set(u.map(D=>D.modelId)),p=new Map,f=D=>{let $=p.get(D);return $||($=i(),p.set(D,$)),$};for(const D of c){f(D.modelId);for(const $ of D.attributes){f($.modelId);for(const B of $.dbAttrs)f(B.modelId)}for(const $ of D.indexes??[])f($.modelId);for(const $ of D.operations??[])f($.modelId)}for(const D of u)f(D.modelId);const y=D=>p.get(D),b=c.map(D=>{const $=Tn(D);$.modelId=y(D.modelId),$.attributes=$.attributes.map(B=>Gf(B,y,m,d));for(const B of $.indexes??[])B.modelId=y(B.modelId),B.columns=B.columns.map(Q=>no(Q.columnRef)?Q:{...Q,columnRef:y(Q.columnRef)}).filter(Q=>Q.columnRef!==void 0);for(const B of $.operations??[])B.modelId=y(B.modelId);return $});Wl(b);const k=u.map(D=>{const $=Tn(D);return $.modelId=y(D.modelId),$.end1=Xl($.end1,y),$.end2=Xl($.end2,y),$}),g=[];for(const D of r.groups){const $=D.memberEntityRefs.filter(Q=>d.has(Q));if($.length===0)continue;const B=Tn(D);B.modelId=f(D.modelId),B.memberEntityRefs=$.map(Q=>y(Q)),g.push(B)}const w=new Set(o.existing.entities.map(D=>D.name)),h=new Set(o.existing.entities.map(D=>{var $;return($=D.table)==null?void 0:$.physicalName}).filter(D=>!!D));for(const D of b)w.has(D.name)&&(D.name=`${D.name}_imported`),(q=D.table)!=null&&q.physicalName&&h.has(D.table.physicalName)&&(D.table.physicalName=`${D.table.physicalName}_imported`);const E=[];for(const D of l.entityLayouts){const $=y(D.entityRef);if(!$)continue;const B=Tn(D);B.entityRef=$,B.geo={...B.geo,location:Wa(B.geo.location,a)},B.attributeStyles&&(B.attributeStyles=Jl(B.attributeStyles,y)),B.operationStyles&&(B.operationStyles=Jl(B.operationStyles,y)),E.push(B)}const X=[];for(const D of l.associationLayouts){const $=y(D.associationRef);if(!$)continue;const B=Tn(D);B.associationRef=$,B.sourceColumnRef=D.sourceColumnRef?y(D.sourceColumnRef):void 0,B.targetColumnRef=D.targetColumnRef?y(D.targetColumnRef):void 0,B.waypoints=B.waypoints.map(Q=>Wa(Q,a)),X.push(B)}const z=[];for(const D of l.groupLayouts){const $=y(D.groupRef);if(!$)continue;const B=Tn(D);B.groupRef=$,B.geo={...B.geo,location:Wa(B.geo.location,a)},delete B.memberNoteRefs,z.push(B)}return{logical:{entities:b,associations:k,groups:g},layout:{entityLayouts:E,associationLayouts:X,groupLayouts:z},idMap:p}}function Wa(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Gf(e,t,o,i){e.modelId=t(e.modelId);for(const a of e.dbAttrs)if(a.modelId=t(a.modelId),a.sharedColumnRef!==void 0){const r=t(a.sharedColumnRef);r?a.sharedColumnRef=r:delete a.sharedColumnRef}return e.derivedFrom&&(o.has(e.derivedFrom.associationRef)?e.derivedFrom={associationRef:t(e.derivedFrom.associationRef),sourceAttributeRef:t(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:t(e.embedded.associationRef)??e.embedded.associationRef,embeddableRef:t(e.embedded.embeddableRef)}:(delete e.embedded,e.attrType.startsWith("EMBED")&&(e.attrType="NORMAL"))),e}function Xl(e,t){return{...e,entityRef:t(e.entityRef),attributeRef:e.attributeRef?t(e.attributeRef):void 0}}function Jl(e,t){const o={};for(const[i,a]of Object.entries(e)){const r=t(i);r&&(o[r]=a)}return o}function qa(e){if(!("rev"in e))return e;const{rev:t,...o}=e;return o}function Vn(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((o,i)=>Vn(o,t[i]));if(typeof e=="object"&&typeof t=="object"){const o=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of o)if(!Vn(e[i],t[i]))return!1;return!0}return!1}function nn(e,t,o){const i={},a=new Set([...Object.keys(e),...Object.keys(t)]);for(const r of a)o.has(r)||Vn(e[r],t[r])||(i[r]=t[r]===void 0?null:t[r]);return Object.keys(i).length?i:null}function on(e,t,o){const i=new Map(e.map(d=>[o(d),d])),a=new Map(t.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 jf(e,t){const o=new Set(e),i=new Set(t),a=t.filter(l=>!o.has(l)).sort(),r=e.filter(l=>!i.has(l)).sort();return{added:a,removed:r}}const Kf=new Set(["attributes","operations","indexes","rev"]),Yf=new Set(["end1","end2","rev"]),Wf=new Set(["memberEntityRefs","rev"]),Zl=new Set(["modelId"]),qf=new Set(["modelId","columns"]),Xf=new Set([]);function Jf(e,t,o,i){const a=on(t.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=nn(s,c,Zl);d&&i.push({kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:s.modelId,patch:d})}const r=on(t.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=nn(s,c,Zl);d&&i.push({kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId,patch:d})}const l=on(t.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(!Vn(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=nn(s,c,qf);d&&i.push({kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId,patch:d})}}function Zf(e,t,o){const i=on(e.entities??[],t.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:qa(l)});for(const{cur:l,tgt:s}of i.common){const c=nn(l,s,Kf);c&&o.push({kind:"entity.update",casUnit:"logical",containerRef:l.modelId,entityRef:l.modelId,patch:c}),Jf(l.modelId,l,s,o)}const a=on(e.associations??[],t.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:qa(l)});for(const{cur:l,tgt:s}of a.common){const c=nn(l,s,Yf);c&&o.push({kind:"association.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,patch:c});for(const d of["end1","end2"]){const u=nn(l[d]??{},s[d]??{},Xf);u&&o.push({kind:"associationEnd.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,end:d,patch:u})}}const r=on(e.groups??[],t.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:qa(l)});for(const{cur:l,tgt:s}of r.common){const c=nn(l,s,Wf);c&&o.push({kind:"group.update",casUnit:"logical",containerRef:l.modelId,groupRef:l.modelId,patch:c});const d=jf(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 ci(e,t,o,i,a,r,l){const s=on(e,t,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)Vn(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 Qf(e,t,o){ci(e.entityLayouts??[],t.entityLayouts??[],i=>i.entityRef,"entityLayout.add","entityLayout.remove","entityRef",o),ci(e.associationLayouts??[],t.associationLayouts??[],i=>i.associationRef,"associationLayout.add","associationLayout.remove","associationRef",o),ci(e.groupLayouts??[],t.groupLayouts??[],i=>i.groupRef,"groupLayout.add","groupLayout.remove","groupRef",o),ci(e.notes??[],t.notes??[],i=>i.modelId,"note.add","note.remove","noteRef",o)}function ep(e,t){const o=[];return Zf(e.logical,t.logical,o),Qf(e.layout,t.layout,o),o}function tp(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 np={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 op{constructor(t){He(this,"out",[]);He(this,"last",new Map);this.fieldFilter=t}set(t,o,i){if(this.fieldFilter!=null&&o!==this.fieldFilter)return;const a=this.last.get(o);this.out.push({...co(t),field:o,value:i,...this.last.has(o)?{oldValue:a}:{}}),this.last.set(o,i)}remove(t,o){if(o!=null){if(this.fieldFilter!=null&&o!==this.fieldFilter)return;this.out.push({...co(t),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({...co(t),field:a,value:void 0,removed:!0});continue}this.out.push({...co(t),field:a,value:void 0,removed:!0,oldValue:this.last.get(a)}),this.last.delete(a)}}member(t,o,i){const a="memberEntityRefs";this.fieldFilter!=null&&a!==this.fieldFilter||this.out.push({...co(t),field:a,value:o,...i?{removed:!0}:{}})}result(){return this.out}}function co(e){const t={seq:e.seq};return e.ts!==void 0&&(t.ts=e.ts),e.origin!==void 0&&(t.origin=e.origin),e.author!==void 0&&(t.author=e.author),e.kind!==void 0&&(t.kind=e.kind),e.restoredFromSeq!==void 0&&(t.restoredFromSeq=e.restoredFromSeq),t}function Et(e,t,o,i){if(o==null||typeof o!="object")return;const a=np[i];for(const[r,l]of Object.entries(o))a.has(r)||e.set(t,r,l)}function an(e,t,o){if(!(o==null||typeof o!="object"))for(const[i,a]of Object.entries(o))e.set(t,i,a)}function Xa(e,t){if(Array.isArray(e))return e.find(o=>o.modelId===t)}function Ft(e,t){var r,l,s,c,d,u,m,p;const o=tp(t),i=new op(t.field),a=[...e].sort((f,y)=>f.seq-y.seq);for(const f of a)for(const y of f.ops)switch(o){case"entity":if(y.entityRef!==t.entityRef)break;y.kind==="entity.add"?Et(i,f,y.value,"entity"):y.kind==="entity.update"?an(i,f,y.patch):y.kind==="entity.remove"&&i.remove(f);break;case"attribute":if(y.entityRef!==t.entityRef)break;if(y.kind==="entity.add"){const b=Xa((r=y.value)==null?void 0:r.attributes,t.attributeRef);b&&Et(i,f,b,"attribute")}else y.kind==="attribute.add"&&((l=y.value)==null?void 0:l.modelId)===t.attributeRef?Et(i,f,y.value,"attribute"):y.kind==="attribute.update"&&y.attributeRef===t.attributeRef?an(i,f,y.patch):(y.kind==="attribute.remove"&&y.attributeRef===t.attributeRef||y.kind==="entity.remove")&&i.remove(f);break;case"operation":if(y.entityRef!==t.entityRef)break;if(y.kind==="entity.add"){const b=Xa((s=y.value)==null?void 0:s.operations,t.operationRef);b&&Et(i,f,b,"operation")}else y.kind==="operation.add"&&((c=y.value)==null?void 0:c.modelId)===t.operationRef?Et(i,f,y.value,"operation"):y.kind==="operation.update"&&y.operationRef===t.operationRef?an(i,f,y.patch):(y.kind==="operation.remove"&&y.operationRef===t.operationRef||y.kind==="entity.remove")&&i.remove(f);break;case"index":if(y.entityRef!==t.entityRef)break;if(y.kind==="entity.add"){const b=Xa((d=y.value)==null?void 0:d.indexes,t.indexRef);b&&Et(i,f,b,"index")}else y.kind==="index.add"&&((u=y.value)==null?void 0:u.modelId)===t.indexRef?Et(i,f,y.value,"index"):y.kind==="index.update"&&y.indexRef===t.indexRef?an(i,f,y.patch):(y.kind==="index.remove"&&y.indexRef===t.indexRef||y.kind==="entity.remove")&&i.remove(f);break;case"association":if(y.associationRef!==t.associationRef)break;y.kind==="association.add"?Et(i,f,y.value,"association"):y.kind==="association.update"?an(i,f,y.patch):y.kind==="association.remove"&&i.remove(f);break;case"associationEnd":if(y.associationRef!==t.associationRef)break;if(y.kind==="association.add"){const b=(m=y.value)==null?void 0:m[t.end];Et(i,f,b,"associationEnd")}else y.kind==="associationEnd.update"&&y.end===t.end?an(i,f,y.patch):y.kind==="association.remove"&&i.remove(f);break;case"group":if(y.groupRef!==t.groupRef)break;if(y.kind==="group.add"){Et(i,f,y.value,"group");const b=(p=y.value)==null?void 0:p.memberEntityRefs;if(Array.isArray(b))for(const k of b)i.member(f,k,!1)}else y.kind==="group.update"?an(i,f,y.patch):y.kind==="group.remove"?i.remove(f):y.kind==="group.addMember"&&y.entityRef!=null?i.member(f,y.entityRef,!1):y.kind==="group.removeMember"&&y.entityRef!=null&&i.member(f,y.entityRef,!0);break}return i.result()}function ip(e,t){const o=e;return o.entityRef===t||o.containerRef===t}function Mn(e,t){if(Array.isArray(e))for(const o of e)typeof o.modelId=="string"&&t.add(o.modelId)}function ap(e,t){const o=new Set,i=new Set,a=new Set;for(const r of e)for(const l of r.ops){const s=l;if(l.kind==="entity.add"&&s.entityRef===t){const c=s.value;Mn(c==null?void 0:c.attributes,o),Mn(c==null?void 0:c.operations,i),Mn(c==null?void 0:c.indexes,a);continue}s.containerRef!==t&&s.entityRef!==t||(l.kind==="attribute.add"?Mn([s.value],o):l.kind==="attribute.update"||l.kind==="attribute.remove"?typeof s.attributeRef=="string"&&o.add(s.attributeRef):l.kind==="operation.add"?Mn([s.value],i):l.kind==="operation.update"||l.kind==="operation.remove"?typeof s.operationRef=="string"&&i.add(s.operationRef):l.kind==="index.add"?Mn([s.value],a):(l.kind==="index.update"||l.kind==="index.remove")&&typeof s.indexRef=="string"&&a.add(s.indexRef))}return{attributes:o,operations:i,indexes:a}}function di(e,t){return e.map(o=>({...o,subject:t}))}function Ql(e,t){const o=e.filter(s=>s.ops.some(c=>ip(c,t))),{attributes:i,operations:a,indexes:r}=ap(o,t),l=[...di(Ft(o,{entityRef:t}),{kind:"entity",ref:t})];for(const s of i)l.push(...di(Ft(o,{entityRef:t,attributeRef:s}),{kind:"attribute",ref:s}));for(const s of a)l.push(...di(Ft(o,{entityRef:t,operationRef:s}),{kind:"operation",ref:s}));for(const s of r)l.push(...di(Ft(o,{entityRef:t,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 es(e){return`${e.kind}:${e.ref}:${e.end??""}`}function rp(e){var i,a,r;const t=new Set,o=(l,s)=>{typeof s=="string"&&t.add(`${l}:${s}:`)};for(const l of e)for(const s of l.ops){const c=s;switch(s.kind){case"entity.add":{o("entity",c.entityRef);const d=c.value;for(const u of Array.isArray(d==null?void 0:d.attributes)?d.attributes:[])o("attribute",u.modelId);for(const u of Array.isArray(d==null?void 0:d.operations)?d.operations:[])o("operation",u.modelId);for(const u of Array.isArray(d==null?void 0:d.indexes)?d.indexes:[])o("index",u.modelId);break}case"attribute.add":o("attribute",(i=c.value)==null?void 0:i.modelId);break;case"operation.add":o("operation",(a=c.value)==null?void 0:a.modelId);break;case"index.add":o("index",(r=c.value)==null?void 0:r.modelId);break;case"association.add":o("association",c.associationRef);break;case"group.add":o("group",c.groupRef);break}}return t}function lp(e){const t=new Set,o=new Set,i=new Set;for(const a of e)for(const r of a.ops){const l=r,s=r.kind;if(s.startsWith("entity."))typeof l.entityRef=="string"&&t.add(l.entityRef);else if(s.startsWith("attribute.")||s.startsWith("operation.")||s.startsWith("index.")){const c=l.containerRef??l.entityRef;typeof c=="string"&&t.add(c)}else s.startsWith("associationEnd.")||s.startsWith("association.")?typeof l.associationRef=="string"&&o.add(l.associationRef):s.startsWith("group.")&&typeof l.groupRef=="string"&&i.add(l.groupRef)}return{entities:t,associations:o,groups:i}}function sp(e){const{entities:t,associations:o,groups:i}=lp(e),a=[];for(const r of t)for(const l of Ql(e,r))a.push({...l,subject:{...l.subject,entityRef:r}});for(const r of o){for(const l of Ft(e,{associationRef:r}))a.push({...l,subject:{kind:"association",ref:r}});for(const l of["end1","end2"])for(const s of Ft(e,{associationRef:r,end:l}))a.push({...s,subject:{kind:"associationEnd",ref:r,end:l}})}for(const r of i)for(const l of Ft(e,{groupRef:r}))a.push({...l,subject:{kind:"group",ref:r}});return a}function ts(e){const t=sp(e),o=rp(e),i=new Map;for(const l of t){const s=es(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 t){let s=a.get(l.seq);s||(s={meta:l,subjects:new Map},a.set(l.seq,s));const c=es(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)}class Ja{constructor(t){He(this,"undoStack",[]);He(this,"redoStack",[]);He(this,"savePoint",null);He(this,"listeners",new Set);He(this,"commandListeners",new Set);He(this,"coalesceSealed",!1);this.state=t}execute(t){t.apply(this.state);const o=this.undoStack.at(-1),i=!this.coalesceSealed&&t.coalesceKey!=null&&!!o&&o.coalesceKey===t.coalesceKey;this.coalesceSealed=!1,i?(t.invert=o.invert,this.undoStack[this.undoStack.length-1]=t):this.undoStack.push(t),this.redoStack=[],this.emitCommand(t,"do",i),this.emit()}undo(){const t=this.undoStack.pop();t&&(t.invert(this.state),this.redoStack.push(t),this.emitCommand(t,"undo",!1),this.emit())}redo(){const t=this.redoStack.pop();t&&(t.apply(this.state),this.undoStack.push(t),this.emitCommand(t,"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.emit()}get isDirty(){return(this.undoStack.at(-1)??null)!==this.savePoint}onChange(t){return this.listeners.add(t),()=>this.listeners.delete(t)}onCommand(t){return this.commandListeners.add(t),()=>this.commandListeners.delete(t)}emit(){for(const t of this.listeners)t()}emitCommand(t,o,i){for(const a of this.commandListeners)a(t,o,i)}}function ns(e,t){return e.logical.entities.findIndex(o=>o.modelId===t)}function Je(e,t){return e.layout.entityLayouts.findIndex(o=>o.entityRef===t)}function pt(e,t){return e.layout.associationLayouts.find(o=>o.associationRef===t)}function Fe(e,t){const o=e.logical.entities.find(i=>i.modelId===t);if(!o)throw new Error(`엔티티 없음: ${t}`);return o}function Tt(e,t,o){var i,a;return(a=(i=e.layout.notes.find(r=>r.modelId===t))==null?void 0:i.connections)==null?void 0:a.find(r=>r.targetRef===o)}function ui(e,t,o){return{label:`엔티티 추가: ${e.name}`,apply(i){i.logical.entities.push(e),i.layout.entityLayouts.push({entityRef:e.modelId,geo:t,...o})},invert(i){const a=ns(i,e.modelId);a>=0&&i.logical.entities.splice(a,1);const r=Je(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:t,...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 os(e){let t=null;const o=i=>i.end1.entityRef===e||i.end2.entityRef===e;return{label:"엔티티 삭제",apply(i){const a=ns(i,e);if(a<0)throw new Error(`엔티티 없음: ${e}`);const r=Je(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})}),t={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(t){i.logical.entities.splice(t.entity.index,0,t.entity.item),t.entityLayout&&i.layout.entityLayouts.splice(t.entityLayout.index,0,t.entityLayout.item),[...t.assocs].sort((a,r)=>a.index-r.index).forEach(a=>i.logical.associations.splice(a.index,0,a.item)),[...t.assocLayouts].sort((a,r)=>a.index-r.index).forEach(a=>i.layout.associationLayouts.splice(a.index,0,a.item));for(const a of t.groupMemberships){const r=i.logical.groups.find(l=>l.modelId===a.groupId);r==null||r.memberEntityRefs.splice(a.index,0,e)}}},emitOps(){if(!t)return{forward:[],invert:[]};const i=[],a=[];for(const r of t.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 t.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 t.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 t.entityLayout&&(i.push({kind:"entityLayout.remove",casUnit:"layout",entityRef:e,incidental:!0}),a.push({kind:"entityLayout.add",casUnit:"layout",entityRef:e,value:t.entityLayout.item,incidental:!0})),i.push({kind:"entity.remove",casUnit:"logical",entityRef:e}),a.push({kind:"entity.add",casUnit:"logical",entityRef:e,value:t.entity.item}),{forward:i,invert:a.reverse()}}}}function is(e,t){const o={};return{label:"엔티티 수정",apply(i){const a=Fe(i,e);for(const r of Object.keys(t))o[r]=a[r];Object.assign(a,t)},invert(i){Object.assign(Fe(i,e),o)},emitOps(){return{forward:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:t}],invert:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:{...o}}]}}}}function as(e,t){let o="";return{label:`엔티티 이름 변경: ${t}`,apply(i){const a=Fe(i,e);o=a.name,a.name=t},invert(i){Fe(i,e).name=o},emitOps(){return{forward:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:{name:t}}],invert:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:{name:o}}]}}}}function Bn(e,t){let o=null;return{label:"엔티티 이동",apply(i){const a=Je(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a].geo;o={...r.location},r.location={...t}},invert(i){const a=Je(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(t)],invert:[i(o)]}}}}function rs(e,t){let o=null;return{label:"엔티티 크기 변경",apply(i){const a=Je(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a].geo;o={...r.size},r.size={...t}},invert(i){const a=Je(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(t)],invert:[i(o)]}}}}function uo(e,t){const o={...(e==null?void 0:e.properties)??{}};return t?o.swatch=t:delete o.swatch,Object.keys(o).length?{properties:o}:void 0}function ls(e,t){let o;return{label:"엔티티 색상 변경",apply(i){const a=Je(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.style,r.style=uo(r.style,t)},invert(i){const a=Je(i,e);a>=0&&(i.layout.entityLayouts[a].style=o)},emitOps(i){const a=Je(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 ss(e,t){let o;return{label:t?"엔티티 접기":"엔티티 펼치기",apply(i){const a=Je(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.collapsed,r.collapsed=t},invert(i){const a=Je(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(t)],invert:[i(o)]}}}}function cs(e,t){let o;return{label:t?"엔티티 잠금":"엔티티 잠금 해제",apply(i){const a=Je(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.locked,r.locked=t},invert(i){const a=Je(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(t)],invert:[i(o)]}}}}function Za(e){let t=[];return{label:e?"모두 접기":"모두 펼치기",apply(o){t=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=t[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:t[l]}})}),{forward:i,invert:a}}}}function mi(e,t,o){let i;return{label:"속성 색상 변경",apply(a){const r=Je(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.attributeStyles;const s={...l.attributeStyles},c=uo(s[t],o);c?s[t]=c:delete s[t],l.attributeStyles=Object.keys(s).length?s:void 0},invert(a){const r=Je(a,e);r>=0&&(a.layout.entityLayouts[r].attributeStyles=i)},emitOps(a){const r=Je(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 fi(e,t,o){return{label:"그룹 추가",apply(i){i.logical.groups.push(e),i.layout.groupLayouts.push({groupRef:e.modelId,geo:t,...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:t,...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 ds(e,t){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(t))o[l]=r[l];Object.assign(r,t)},invert(a){Object.assign(i(a),o)},emitOps(){return{forward:[{kind:"group.update",casUnit:"logical",containerRef:e,groupRef:e,patch:t}],invert:[{kind:"group.update",casUnit:"logical",containerRef:e,groupRef:e,patch:{...o}}]}}}}function us(e){let t=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);t={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){t&&(o.logical.groups.splice(t.group.index,0,t.group.item),t.layout&&o.layout.groupLayouts.splice(t.layout.index,0,t.layout.item))},emitOps(){if(!t)return{forward:[],invert:[]};const o=[],i=[];return t.layout&&(o.push({kind:"groupLayout.remove",casUnit:"layout",groupRef:e,incidental:!0}),i.push({kind:"groupLayout.add",casUnit:"layout",groupRef:e,value:t.layout.item,incidental:!0})),o.push({kind:"group.remove",casUnit:"logical",groupRef:e}),i.push({kind:"group.add",casUnit:"logical",groupRef:e,value:t.group.item}),{forward:o,invert:i.reverse()}}}}function ms(e,t){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(t)&&(r.memberEntityRefs.push(t),o=!0)},invert(a){if(!o)return;const r=i(a),l=(r==null?void 0:r.memberEntityRefs.indexOf(t))??-1;l>=0&&r.memberEntityRefs.splice(l,1)},emitOps(){return o?{forward:[{kind:"group.addMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:t}],invert:[{kind:"group.removeMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:t}]}:{forward:[],invert:[]}}}}function pi(e,t){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(t))??-1,o>=0&&r.memberEntityRefs.splice(o,1)},invert(a){var r;o<0||(r=i(a))==null||r.memberEntityRefs.splice(o,0,t)},emitOps(){return o<0?{forward:[],invert:[]}:{forward:[{kind:"group.removeMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:t}],invert:[{kind:"group.addMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:t}]}}}}function fs(e,t){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={...t}},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(t)],invert:[i(o)]}}}}function ps(e,t){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={...t}},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(t)],invert:[i(o)]}}}}function hs(e,t){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=uo(a.style,t)},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 ys(e,t){let o;return{label:t?"그룹 잠금":"그룹 잠금 해제",apply(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o=a.locked,a.locked=t},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(t)],invert:[i(o)]}}}}function Vt(e,t){return{label:`속성 추가: ${t.name}`,apply(o){Fe(o,e).attributes.push(t)},invert(o){const i=Fe(o,e),a=i.attributes.findIndex(r=>r.modelId===t.modelId);a>=0&&i.attributes.splice(a,1)},emitOps(){return{forward:[{kind:"attribute.add",casUnit:"logical",containerRef:e,entityRef:e,value:t}],invert:[{kind:"attribute.remove",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:t.modelId}]}}}}function rn(e,t,o){const i={},a=r=>{const l=Fe(r,e).attributes.find(s=>s.modelId===t);if(!l)throw new Error(`속성 없음: ${t}`);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:t,patch:o}],invert:[{kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:t,patch:{...i}}]}}}}function Dn(e,t){let o=null;return{label:"속성 삭제",apply(i){const a=Fe(i,e),r=a.attributes.findIndex(l=>l.modelId===t);if(r<0)throw new Error(`속성 없음: ${t}`);o={item:a.attributes[r],index:r},a.attributes.splice(r,1)},invert(i){o&&Fe(i,e).attributes.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"attribute.remove",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:t}],invert:[{kind:"attribute.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}function Qa(e,t,o){let i=null;return{label:"속성 재정렬",apply(a){const r=Fe(a,e);i=r.attributes.map(m=>({...m}));const l=new Set(t),s=r.attributes.filter(m=>l.has(m.modelId)),c=r.attributes.filter(m=>!l.has(m.modelId)),d=Math.max(0,Math.min(o,c.length)),u=[...c.slice(0,d),...s,...c.slice(d)];r.attributes.splice(0,r.attributes.length,...u),r.attributes.forEach((m,p)=>m.order=p)},invert(a){i&&Fe(a,e).attributes.splice(0,1/0,...i)},emitOps(a){const r=Fe(a,e).attributes.map(l=>({...l}));return{forward:[{kind:"attribute.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:r}],invert:[{kind:"attribute.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:i??[]}]}}}}function gs(e,t){let o=!1;return{label:`메서드 추가: ${t.name}`,apply(i){const a=Fe(i,e);a.operations||(a.operations=[],o=!0),a.operations.push(t)},invert(i){var l;const a=Fe(i,e),r=((l=a.operations)==null?void 0:l.findIndex(s=>s.modelId===t.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:t}],invert:[{kind:"operation.remove",casUnit:"logical",containerRef:e,entityRef:e,operationRef:t.modelId}]}}}}function bs(e,t,o){const i={},a=r=>{var s;const l=(s=Fe(r,e).operations)==null?void 0:s.find(c=>c.modelId===t);if(!l)throw new Error(`메서드 없음: ${t}`);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:t,patch:o}],invert:[{kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:t,patch:{...i}}]}}}}function _s(e,t){let o=null;return{label:"메서드 삭제",apply(i){var s;const a=Fe(i,e),r=((s=a.operations)==null?void 0:s.findIndex(c=>c.modelId===t))??-1;if(r<0)throw new Error(`메서드 없음: ${t}`);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=Fe(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:t}],invert:[{kind:"operation.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}function ks(e,t,o){let i=null;return{label:"메서드 재정렬",apply(a){const r=Fe(a,e),l=r.operations??[];i=l.map(p=>({...p}));const s=new Set(t),c=l.filter(p=>s.has(p.modelId)),d=l.filter(p=>!s.has(p.modelId)),u=Math.max(0,Math.min(o,d.length)),m=[...d.slice(0,u),...c,...d.slice(u)];l.splice(0,l.length,...m),l.forEach((p,f)=>p.order=f),r.operations=l},invert(a){if(!i)return;const r=Fe(a,e);r.operations&&r.operations.splice(0,1/0,...i)},emitOps(a){const r=(Fe(a,e).operations??[]).map(l=>({...l}));return{forward:[{kind:"operation.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:r}],invert:[{kind:"operation.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:i??[]}]}}}}function Es(e,t,o){let i;return{label:"메서드 색상 변경",apply(a){const r=Je(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.operationStyles;const s={...l.operationStyles},c=uo(s[t],o);c?s[t]=c:delete s[t],l.operationStyles=Object.keys(s).length?s:void 0},invert(a){const r=Je(a,e);r>=0&&(a.layout.entityLayouts[r].operationStyles=i)},emitOps(a){const r=Je(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 hi(e,t){return{label:"관계 추가",apply(o){o.logical.associations.push(e),o.layout.associationLayouts.push(t)},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:t,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 ws(e){let t=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);t={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){t&&(o.logical.associations.splice(t.assoc.index,0,t.assoc.item),t.layout&&o.layout.associationLayouts.splice(t.layout.index,0,t.layout.item))},emitOps(){if(!t)return{forward:[],invert:[]};const o=[],i=[];return t.layout&&(o.push({kind:"associationLayout.remove",casUnit:"layout",associationRef:e,incidental:!0}),i.push({kind:"associationLayout.add",casUnit:"layout",associationRef:e,value:t.layout.item,incidental:!0})),o.push({kind:"association.remove",casUnit:"logical",associationRef:e}),i.push({kind:"association.add",casUnit:"logical",associationRef:e,value:t.assoc.item}),{forward:o,invert:i.reverse()}}}}function yi(e,t){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(t))o[l]=r[l];Object.assign(r,t)},invert(a){Object.assign(i(a),o)},emitOps(){return{forward:[{kind:"association.update",casUnit:"logical",containerRef:e,associationRef:e,patch:t}],invert:[{kind:"association.update",casUnit:"logical",containerRef:e,associationRef:e,patch:{...o}}]}}}}function ln(e,t,o){const i={},a=r=>{const l=r.logical.associations.find(s=>s.modelId===e);if(!l)throw new Error(`관계 없음: ${e}`);return l[t]};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:t,patch:o}],invert:[{kind:"associationEnd.update",casUnit:"logical",containerRef:e,associationRef:e,end:t,patch:{...i}}]}}}}function Ns(e,t){return{label:"인덱스 추가",apply(o){const i=Fe(o,e);(i.indexes??(i.indexes=[])).push(t)},invert(o){var r;const i=Fe(o,e),a=((r=i.indexes)==null?void 0:r.findIndex(l=>l.modelId===t.modelId))??-1;a>=0&&i.indexes.splice(a,1)},emitOps(){return{forward:[{kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:t}],invert:[{kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:t.modelId}]}}}}function vs(e,t,o){const i={},a=r=>{var s;const l=(s=Fe(r,e).indexes)==null?void 0:s.find(c=>c.modelId===t);if(!l)throw new Error(`인덱스 없음: ${t}`);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:t,patch:o}],invert:[{kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:t,patch:{...i}}]}}}}function xs(e,t){let o=null;return{label:"인덱스 삭제",apply(i){var l;const a=Fe(i,e),r=((l=a.indexes)==null?void 0:l.findIndex(s=>s.modelId===t))??-1;if(r<0)throw new Error(`인덱스 없음: ${t}`);o={item:a.indexes[r],index:r},a.indexes.splice(r,1)},invert(i){o&&Fe(i,e).indexes.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:t}],invert:[{kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}const wt=(e,t)=>({kind:"associationLayout.setWaypoints",casUnit:"layout",associationRef:e,value:{waypoints:t}}),mo=(e,t)=>{var o;return((o=pt(e,t))==null?void 0:o.waypoints.map(i=>({...i})))??[]};function Cs(e,t,o){let i=null;return{label:"waypoint 이동",coalesceKey:`waypoint:${e}`,apply(a){const r=pt(a,e);if(!r||!r.waypoints[t])throw new Error(`waypoint 없음: ${e}[${t}]`);i={...r.waypoints[t]},r.waypoints.splice(t,1,{...o})},invert(a){const r=pt(a,e);r&&i&&r.waypoints.splice(t,1,i)},emitOps(a){const r=mo(a,e),l=r.map((s,c)=>c===t&&i?{...i}:s);return{forward:[wt(e,r)],invert:[wt(e,l)]}}}}function Is(e,t){let o=null;return{label:"waypoint 제거",apply(i){const a=pt(i,e);if(!a||!a.waypoints[t])throw new Error(`waypoint 없음: ${e}[${t}]`);o={...a.waypoints[t]},a.waypoints.splice(t,1)},invert(i){const a=pt(i,e);a&&o&&a.waypoints.splice(t,0,o)},emitOps(i){const a=mo(i,e),r=a.slice();return o&&r.splice(t,0,{...o}),{forward:[wt(e,a)],invert:[wt(e,r)]}}}}function Ss(e,t,o){let i=null;return{label:"waypoint 평행이동",apply(a){const r=pt(a,e);if(!r)throw new Error(`관계 레이아웃 없음: ${e}`);i=r.waypoints.map(l=>({...l})),r.waypoints=i.map(l=>({x:l.x+t,y:l.y+o}))},invert(a){const r=pt(a,e);r&&i&&(r.waypoints=i)},emitOps(a){return{forward:[wt(e,mo(a,e))],invert:[wt(e,i??[])]}}}}function $s(e){let t=null;return{label:"꺾은선 풀기",apply(o){const i=pt(o,e);if(!i)throw new Error(`관계 레이아웃 없음: ${e}`);t=i.waypoints.map(a=>({...a})),i.waypoints=[]},invert(o){const i=pt(o,e);i&&t&&(i.waypoints=t)},emitOps(o){return{forward:[wt(e,mo(o,e))],invert:[wt(e,t??[])]}}}}function Rs(e,t,o){return{label:"waypoint 추가",apply(i){const a=pt(i,e);if(!a)throw new Error(`관계 레이아웃 없음: ${e}`);a.waypoints.splice(t,0,{...o})},invert(i){const a=pt(i,e);a==null||a.waypoints.splice(t,1)},emitOps(i){const a=mo(i,e),r=a.slice();return r.splice(t,1),{forward:[wt(e,a)],invert:[wt(e,r)]}}}}function As(e){return{label:"노트 추가",apply(t){t.layout.notes.push(e)},invert(t){const o=t.layout.notes.findIndex(i=>i.modelId===e.modelId);o>=0&&t.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 Ts(e){let t=null;return{label:"노트 삭제",apply(o){const i=o.layout.notes.findIndex(a=>a.modelId===e);if(i<0)throw new Error(`노트 없음: ${e}`);t={item:o.layout.notes[i],index:i},o.layout.notes.splice(i,1)},invert(o){t&&o.layout.notes.splice(t.index,0,t.item)},emitOps(){return t?{forward:[{kind:"note.remove",casUnit:"layout",noteRef:e}],invert:[{kind:"note.add",casUnit:"layout",noteRef:e,value:t.item}]}:{forward:[],invert:[]}}}}function fo(e,t){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={...t}},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(t)],invert:[i(o)]}}}}function Vs(e,t){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={...t}},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(t)],invert:[i(o)]}}}}function Ms(e,t){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=t},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(t)],invert:[i(o)]}}}}function Bs(e,t){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=uo(a.style,t)},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 Ds(e,t){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(t)&&(l.memberNoteRefs.push(t),o=!0))},invert(r){if(!o)return;const l=a(r);if(!(l!=null&&l.memberNoteRefs))return;const s=l.memberNoteRefs.indexOf(t);s>=0&&l.memberNoteRefs.splice(s,1),i&&delete l.memberNoteRefs},emitOps(){return o?{forward:[{kind:"groupLayout.addNoteMember",casUnit:"layout",groupRef:e,noteRef:t}],invert:[{kind:"groupLayout.removeNoteMember",casUnit:"layout",groupRef:e,noteRef:t}]}:{forward:[],invert:[]}}}}function Os(e,t){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(t))??-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,t))},emitOps(){return o<0?{forward:[],invert:[]}:{forward:[{kind:"groupLayout.removeNoteMember",casUnit:"layout",groupRef:e,noteRef:t}],invert:[{kind:"groupLayout.addNoteMember",casUnit:"layout",groupRef:e,noteRef:t}]}}}}const Gt=(e,t,o)=>({kind:"noteConnection.setWaypoints",casUnit:"layout",noteRef:e,targetRef:t,value:{waypoints:o}}),gi=(e,t,o)=>{var i;return((i=Tt(e,t,o))==null?void 0:i.waypoints.map(a=>({...a})))??[]};function Ps(e,t){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===t)){o=!1;return}r.connections.push({targetRef:t,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===t);l>=0&&r.connections.splice(l,1),i&&delete r.connections},emitOps(){return o?{forward:[{kind:"noteConnection.add",casUnit:"layout",noteRef:e,targetRef:t,value:{targetRef:t,waypoints:[]}}],invert:[{kind:"noteConnection.remove",casUnit:"layout",noteRef:e,targetRef:t}]}:{forward:[],invert:[]}}}}function Ls(e,t){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===t))??-1;if(!(a!=null&&a.connections)||r<0)throw new Error(`노트 연결 없음: ${e}→${t}`);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:t}],invert:[{kind:"noteConnection.add",casUnit:"layout",noteRef:e,targetRef:t,value:o.item}]}:{forward:[],invert:[]}}}}function zs(e,t,o,i){let a=null;return{label:"waypoint 이동",coalesceKey:`noteConnWaypoint:${e}:${t}`,apply(r){const l=Tt(r,e,t);if(!l||!l.waypoints[o])throw new Error(`waypoint 없음: ${e}→${t}[${o}]`);a={...l.waypoints[o]},l.waypoints.splice(o,1,{...i})},invert(r){const l=Tt(r,e,t);l&&a&&l.waypoints.splice(o,1,a)},emitOps(r){const l=gi(r,e,t),s=l.map((c,d)=>d===o&&a?{...a}:c);return{forward:[Gt(e,t,l)],invert:[Gt(e,t,s)]}}}}function Us(e,t,o,i){return{label:"waypoint 추가",apply(a){const r=Tt(a,e,t);if(!r)throw new Error(`노트 연결 없음: ${e}→${t}`);r.waypoints.splice(o,0,{...i})},invert(a){const r=Tt(a,e,t);r==null||r.waypoints.splice(o,1)},emitOps(a){const r=gi(a,e,t),l=r.slice();return l.splice(o,1),{forward:[Gt(e,t,r)],invert:[Gt(e,t,l)]}}}}function Hs(e,t,o){let i=null;return{label:"waypoint 제거",apply(a){const r=Tt(a,e,t);if(!r||!r.waypoints[o])throw new Error(`waypoint 없음: ${e}→${t}[${o}]`);i={...r.waypoints[o]},r.waypoints.splice(o,1)},invert(a){const r=Tt(a,e,t);r&&i&&r.waypoints.splice(o,0,i)},emitOps(a){const r=gi(a,e,t),l=r.slice();return i&&l.splice(o,0,{...i}),{forward:[Gt(e,t,r)],invert:[Gt(e,t,l)]}}}}function Fs(e,t){let o=null;return{label:"꺾은선 풀기",apply(i){const a=Tt(i,e,t);if(!a)throw new Error(`노트 연결 없음: ${e}→${t}`);o=a.waypoints.map(r=>({...r})),a.waypoints=[]},invert(i){const a=Tt(i,e,t);a&&o&&(a.waypoints=o)},emitOps(i){return{forward:[Gt(e,t,gi(i,e,t))],invert:[Gt(e,t,o??[])]}}}}function Ge(e,t,o){return{label:e,coalesceKey:o,apply(i){for(const a of t)a.apply(i)},invert(i){for(let a=t.length-1;a>=0;a--)t[a].invert(i)},emitOps(i){const a=t.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 cp=Object.freeze(Object.defineProperty({__proto__:null,addAssociation:hi,addAttribute:Vt,addEntity:ui,addEntityToGroup:ms,addGroup:fi,addIndex:Ns,addNote:As,addNoteConnection:Ps,addNoteConnectionWaypoint:Us,addNoteToGroup:Ds,addOperation:gs,addWaypoint:Rs,clearNoteConnectionWaypoints:Fs,clearWaypoints:$s,composite:Ge,moveEntity:Bn,moveGroup:fs,moveNote:fo,moveNoteConnectionWaypoint:zs,moveWaypoint:Cs,removeAssociation:ws,removeAttribute:Dn,removeEntity:os,removeEntityFromGroup:pi,removeGroup:us,removeIndex:xs,removeNote:Ts,removeNoteConnection:Ls,removeNoteConnectionWaypoint:Hs,removeNoteFromGroup:Os,removeOperation:_s,removeWaypoint:Is,renameEntity:as,reorderAttributes:Qa,reorderOperations:ks,resizeEntity:rs,resizeGroup:ps,resizeNote:Vs,setAllEntitiesCollapsed:Za,setAttributeSwatch:mi,setEntityCollapsed:ss,setEntityLocked:cs,setEntitySwatch:ls,setGroupLocked:ys,setGroupSwatch:hs,setNoteMemo:Ms,setNoteSwatch:Bs,setOperationSwatch:Es,translateWaypoints:Ss,updateAssociation:yi,updateAssociationEnd:ln,updateAttribute:rn,updateEntity:is,updateGroup:ds,updateIndex:vs,updateOperation:bs},Symbol.toStringTag,{value:"Module"}));class Gs{constructor(){He(this,"revs",new Map);He(this,"layoutVersion",0);He(this,"logicalVersion",0)}seed(t){this.revs.clear();for(const[o,i]of Object.entries(t.revs??{}))this.revs.set(o,i);this.layoutVersion=t.layoutVersion??0,this.logicalVersion=t.logicalVersion??0}rev(t){return this.revs.get(t)??0}setRev(t,o){this.revs.set(t,o)}deleteRev(t){this.revs.delete(t)}snapshot(){return{revs:Object.fromEntries(this.revs),layoutVersion:this.layoutVersion,logicalVersion:this.logicalVersion}}}class js{constructor(t){He(this,"cache",new Gs);He(this,"newClientOpId");He(this,"debounceMs");He(this,"emissions",new WeakMap);He(this,"open",null);He(this,"debounceHandle",null);He(this,"queue",[]);He(this,"sending",!1);He(this,"_frozen",!1);He(this,"stack",null);He(this,"settledWaiters",[]);this.opts=t,this.newClientOpId=t.newClientOpId??Be,this.debounceMs=t.debounceMs??300}seed(t){this.cache.seed(t)}attach(t){this.stack=t;const o=t.onCommand((i,a,r)=>this.handle(i,a,r));return()=>{o(),this.stack===t&&(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(t=>this.settledWaiters.push(t)):Promise.resolve()}handle(t,o,i){var l;if(this._frozen)return;let a;if(o==="do"){const s=(l=t.emitOps)==null?void 0:l.call(t,this.opts.state);if(!s)throw new Error(`op-mode에서 emitOps 미구현 command 실행: ${t.label}`);a=s}else{const s=this.emissions.get(t);if(!s)throw new Error(`op-mode ${o} 대상 command의 emission 미기록: ${t.label}`);a=s}const r=o==="undo"?a.invert:a.forward;if(o==="do"&&i&&this.open&&this.open.coalesceKey===t.coalesceKey){this.open.fwd=r,this.emissions.set(t,{forward:r,invert:this.open.inv}),this.resetDebounce();return}if(this.flushOpen(!1),o==="do"&&(this.emissions.set(t,a),t.coalesceKey!=null)){this.open={coalesceKey:t.coalesceKey,fwd:r,inv:a.invert},this.startDebounce();return}r.length&&this.enqueue(this.buildBatch(r))}flushOpen(t){var i;this.cancelDebounce();const o=this.open;this.open=null,o&&o.fwd.length&&this.enqueue(this.buildBatch(o.fwd)),t&&((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(t){const o={},i=new Set;let a=!1,r=!1;for(const l of t)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:t,cas:o,origin:this.opts.origin??"gui",clientOpId:this.newClientOpId()}}enqueue(t){this.queue.push(t),this.pump()}async pump(){var i,a;if(this.sending||this._frozen)return;const t=this.queue.shift();if(!t){this.notifySettled();return}this.sending=!0;let o=null;try{o=await this.opts.transport(t)}catch(r){this.sending=!1,console.error("[op-sync] op 전송 실패 → 하드 프리즈(kind:missing):",r),(a=(i=this.opts).onError)==null||a.call(i,r),this.freeze({kind:"missing"});return}this.sending=!1,o.ok?(this.reconcile(o),this.pump()):this.freeze(o.conflict)}reconcile(t){if(!(this.queue.length>0)){for(const[o,i]of Object.entries(t.revs))this.cache.setRev(o,i);this.cache.layoutVersion=t.layoutVersion,this.cache.logicalVersion=t.logicalVersion}}freeze(t){var o,i;this._frozen=!0,this.queue.length=0,this.open=null,this.cancelDebounce(),(i=(o=this.opts).onFreeze)==null||i.call(o,t),this.notifySettled()}notifySettled(){if(this.hasPending)return;const t=this.settledWaiters;this.settledWaiters=[];for(const o of t)o()}}const Ks=["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","group.add"],Ys=()=>crypto.randomUUID(),dp=e=>e.add.length===0&&e.update.length===0&&e.remove.length===0,up=e=>e&&e[0].toLowerCase()+e.slice(1),mp=e=>e&&e[0].toUpperCase()+e.slice(1),fp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase();function pp(e,t){return up(e)+mp(t)}function hp(e,t){const o=e.entities.find(l=>l.modelId===t.end1.entityRef);if(!o)return[];if(o.stereotype==="JPA_EMBEDDABLE")return[];const a=t.end1.entityRef===t.end2.entityRef?!1:t.identifying===!0;return o.attributes.filter(l=>l.identifier&&(l.attrType==="NORMAL"||l.attrType==="RELATION_OWN")).sort((l,s)=>l.order-s.order).map(l=>{const s=pp(o.name,l.name);return{associationRef:t.modelId,sourceAttributeRef:l.modelId,name:s,type:l.type,identifier:a,notNull:a,dbAttrs:l.dbAttrs.map(c=>({physicalName:fp(s),logicalName:c.logicalName,dataType:c.dataType,length:c.length,scale:c.scale}))}})}const bi=(e,t)=>`${e}::${t}`,_i=e=>e??void 0;function yp(e,t,o){const i={};return e.type!==t.type&&(i.type=t.type),e.identifier!==t.identifier&&(i.identifier=t.identifier),e.notNull!==t.notNull&&(i.notNull=t.notNull),(e.dbAttrs.length!==t.dbAttrs.length||t.dbAttrs.some((r,l)=>{const s=e.dbAttrs[l];return!s||s.dataType!==r.dataType||_i(s.length)!==_i(r.length)||_i(s.scale)!==_i(r.scale)}))&&(i.dbAttrs=t.dbAttrs.map((r,l)=>{const s=e.dbAttrs[l];return{modelId:(s==null?void 0:s.modelId)??o(),physicalName:(s==null?void 0:s.physicalName)??r.physicalName,logicalName:(s==null?void 0:s.logicalName)??r.logicalName,dataType:r.dataType,length:r.length,scale:r.scale}})),Object.keys(i).length?i:null}function gp(e,t,o){return{modelId:o(),name:e.name,type:e.type,attrType:"RELATION_OWN",identifier:e.identifier,notNull:e.notNull,order:t,dbAttrs:e.dbAttrs.map(i=>({...i,modelId:o()})),derivedFrom:{associationRef:e.associationRef,sourceAttributeRef:e.sourceAttributeRef}}}function po(e,t,o=Ys){const i={add:[],update:[],remove:[]},a=e.entities.find(m=>m.modelId===t);if(!a)return i;const r=e.associations.filter(m=>m.end2.entityRef===t),l=a.stereotype==="JPA_EMBEDDABLE"?[]:r.flatMap(m=>hp(e,m)),s=new Map(l.map(m=>[bi(m.associationRef,m.sourceAttributeRef),m])),c=a.attributes.filter(m=>m.derivedFrom),d=new Map(c.map(m=>[bi(m.derivedFrom.associationRef,m.derivedFrom.sourceAttributeRef),m]));for(const m of c){const p=bi(m.derivedFrom.associationRef,m.derivedFrom.sourceAttributeRef);s.has(p)||i.remove.push(m.modelId)}let u=a.attributes.reduce((m,p)=>Math.max(m,p.order),-1)+1;for(const m of l){const p=bi(m.associationRef,m.sourceAttributeRef),f=d.get(p);if(!f)i.add.push(gp(m,u++,o));else{const y=yp(f,m,o);y&&i.update.push({attributeId:f.modelId,patch:y})}}return i}function bp(e,t){if(t.remove.length){const o=new Set(t.remove);e.attributes=e.attributes.filter(i=>!o.has(i.modelId))}for(const o of t.update){const i=e.attributes.find(a=>a.modelId===o.attributeId);i&&Object.assign(i,o.patch)}t.add.length&&e.attributes.push(...t.add)}function _p(e){return{...e,entities:e.entities.map(t=>({...t,attributes:t.attributes.map(o=>({...o}))}))}}function kp(e,t,o=Ys){const i=new Map,a=_p(e),r=new Set,l=[t];for(;l.length;){const s=l.shift();if(r.has(s))continue;r.add(s);const c=new Set(a.associations.filter(d=>d.end1.entityRef===s).map(d=>d.end2.entityRef));for(const d of c){const u=po(a,d,o);if(dp(u))continue;i.has(d)||i.set(d,u);const m=a.entities.find(p=>p.modelId===d);m&&bp(m,u),r.has(d)||l.push(d)}}return i}function ki(e,t,o){var l;const i=e.entities.find(s=>s.modelId===t),a=i==null?void 0:i.attributes.find(s=>s.modelId===o);if(!a||!a.attrType.startsWith("RELATION")||a.dbAttrs.length===0)return;const r=(l=a.derivedFrom)==null?void 0:l.associationRef;if(r){const s=e.associations.find(c=>c.modelId===r);if(s)return s}return e.associations.find(s=>s.end1.entityRef===t&&s.end1.attributeRef===o||s.end2.entityRef===t&&s.end2.attributeRef===o)}function Ep(e,t){const o=()=>e.entities.filter(r=>{var l;return((l=r.table)==null?void 0:l.physicalName)===t.ref}),i=()=>e.entities.filter(r=>r.name===t.ref);if(t.by==="physicalName")return o();if(t.by==="name")return i();const a=o();return a.length?a:i()}function wp(e,t){const o=()=>e.attributes.filter(r=>r.name===t.ref),i=()=>e.attributes.filter(r=>r.dbAttrs.some(l=>l.physicalName===t.ref));if(t.by==="name")return o();if(t.by==="physicalName")return i();const a=o();return a.length?a:i()}function Ws(e,t,o){return e.associations.filter(i=>{const a=[i.end1.entityRef,i.end2.entityRef];return a.includes(t)&&a.includes(o)})}function at(e,t){const o=Ep(e,t);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 Np(e,t){const o=wp(e,t);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 vp(e,t){const o=()=>e.attributes.flatMap(r=>r.dbAttrs).filter(r=>r.physicalName===t.ref),i=()=>e.attributes.filter(r=>r.name===t.ref).flatMap(r=>r.dbAttrs);if(t.by==="physicalName")return o();if(t.by==="name")return i();const a=o();return a.length?a:i()}function xp(e,t){const o=vp(e,t);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 qs(e,t){const o=e.filter(i=>i.physicalName===t.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 Cp(e,t){return(e.indexes??[]).filter(o=>o.name===t.ref)}function Ip(e,t){return(e.operations??[]).filter(o=>o.name===t.ref)}function Sp(e,t){const o=Cp(e,t);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 $p(e,t){const o=Ip(e,t);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 Xs(e,t,o){const i=e.physicalName!=null||e.dataType!=null||e.length!=null||e.scale!=null||e.columnLogicalName!=null||e.unique!=null||e.updatable!=null;return{modelId:o(),name:e.name,type:e.type,attrType:"NORMAL",identifier:e.identifier??!1,notNull:e.notNull??!1,order:t,...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 Js(e,t,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 t.fields){const y=u.get(f.name);if(y!=null&&y.sharedColumnPhysicalName){const b={ref:y.sharedColumnPhysicalName,by:"physicalName"},k=qs(en(i,a),b);if(!k.ok){s.push(k.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:r,entity:l,handle:b}:{code:"shared-column-target-ambiguous",opIndex:r,entity:l,handle:b,matches:k.matches}),p=!0;continue}m.push({modelId:c(),physicalName:"",dataType:"",sharedColumnRef:k.value.modelId});continue}m.push({modelId:c(),physicalName:(y==null?void 0:y.physicalName)??"",dataType:"",...y!=null&&y.length?{length:y.length}:{},...y!=null&&y.scale?{scale:y.scale}:{},...(y==null?void 0:y.insertable)!=null?{insertable:y.insertable}:{},...(y==null?void 0:y.updatable)!=null?{updatable:y.updatable}:{}})}return p?null:{modelId:d,name:e.name,type:t.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}}function Rp(e,t,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=t.fields[p],y=f?c.get(f.name):void 0;if(!y){d.push(m);return}if(y.sharedColumnPhysicalName){const k={ref:y.sharedColumnPhysicalName,by:"physicalName"},g=qs(en(i,a),k);if(!g.ok){s.push(g.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:r,entity:l,handle:k}:{code:"shared-column-target-ambiguous",opIndex:r,entity:l,handle:k,matches:g.matches}),u=!0;return}d.push({modelId:m.modelId,physicalName:"",dataType:"",sharedColumnRef:g.value.modelId});return}const b={...m};delete b.sharedColumnRef,d.push({...b,...y.physicalName!=null?{physicalName:y.physicalName}:{},...y.length!=null?{length:y.length}:{},...y.scale!=null?{scale:y.scale}:{},...y.insertable!=null?{insertable:y.insertable}:{},...y.updatable!=null?{updatable:y.updatable}:{}})}),u?null:d}function Zs(e,t,o){return{modelId:o(),name:e.name,order:t,...e.visibility?{visibility:e.visibility}:{},...e.sourceCode?{sourceCode:e.sourceCode}:{},...e.description?{description:e.description}:{},...e.personalInfoAttributeType?{personalInfoAttributeType:e.personalInfoAttributeType}:{}}}function Qs(e,t,o,i,a,r){const l=[];let s=!1;for(const c of t.columns){const d=xp(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:t.name,unique:t.unique??!1,columns:l,...t.description?{description:t.description}:{},...t.parameters?{parameters:t.parameters}:{}}}function Ap(e,t,o={}){const i=o.mkId??Be,a=o.embeddableCatalog??[],r=m=>a.find(p=>p.type===m),l=[],s=[],c=new Map,d=new Map,u=new Set;for(const m of t)m.kind==="entity.add"&&(u.add(m.spec.name),m.spec.physicalName&&u.add(m.spec.physicalName));return t.forEach((m,p)=>{var f,y,b,k;switch(m.kind){case"entity.add":{const g=i(),w={modelId:g,name:m.spec.name,stereotype:m.spec.stereotype??"JPA_ENTITY",attributes:[],...m.spec.useVersion?{jpaAttrs:{useVersion:!0}}:{},...m.spec.physicalName?{table:{physicalName:m.spec.physicalName}}:{}},h={ref:m.spec.name};let E=!1;for(const[q,D]of(m.spec.attributes??[]).entries()){if(D.type==="GroupCodeEnum"&&!D.groupCode){s.push({code:"groupcode-required",opIndex:p,entity:h,handle:{ref:D.name}}),E=!0;continue}const $=r(D.type);if($){const B=Js(D,$,q,w,e.entities,p,h,s,i);B?w.attributes.push(B):E=!0}else(f=D.embeddableOverrides)!=null&&f.length?(s.push({code:"embeddable-type-unresolved",opIndex:p,entity:h,handle:{ref:D.name}}),E=!0):w.attributes.push(Xs(D,q,i))}const X=(m.spec.operations??[]).map((q,D)=>Zs(q,D,i));X.length&&(w.operations=X);const z=[];for(const q of m.spec.indexes??[]){const D=Qs(w,q,p,h,s,i);D?z.push(D):E=!0}if(z.length&&(w.indexes=z),E)break;l.push({kind:"entity.add",casUnit:"logical",entityRef:g,value:w});break}case"entity.update":{const g=at(e,m.entity);if(!g.ok){s.push(rt(g.reason,p,m.entity,g.matches,u));break}l.push({kind:"entity.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,patch:m.patch});break}case"entity.remove":{const g=at(e,m.entity);if(!g.ok){s.push(rt(g.reason,p,m.entity,g.matches,u));break}l.push({kind:"entity.remove",casUnit:"logical",entityRef:g.value.modelId});break}case"attribute.add":{const g=at(e,m.entity);if(!g.ok){s.push(rt(g.reason,p,m.entity,g.matches,u));break}if(m.spec.type==="GroupCodeEnum"&&!m.spec.groupCode){s.push({code:"groupcode-required",opIndex:p,entity:m.entity,handle:{ref:m.spec.name}});break}const w=c.get(g.value.modelId)??g.value.attributes.length;c.set(g.value.modelId,w+1);const h=r(m.spec.type);let E;if(h)E=Js(m.spec,h,w,g.value,e.entities,p,m.entity,s,i);else if((y=m.spec.embeddableOverrides)!=null&&y.length){s.push({code:"embeddable-type-unresolved",opIndex:p,entity:m.entity,handle:{ref:m.spec.name}});break}else E=Xs(m.spec,w,i);if(!E)break;l.push({kind:"attribute.add",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,value:E});break}case"attribute.update":case"attribute.remove":{const g=at(e,m.entity);if(!g.ok){s.push(rt(g.reason,p,m.entity,g.matches,u));break}const w=Np(g.value,m.attribute);if(!w.ok){s.push(w.reason==="not-found"?{code:"attribute-not-found",opIndex:p,entity:m.entity,handle:m.attribute}:{code:"attribute-ambiguous",opIndex:p,entity:m.entity,handle:m.attribute,matches:w.matches});break}if(m.kind==="attribute.update"){let h=m.patch;if((b=m.embeddableOverrides)!=null&&b.length){const E=r(w.value.type);if(!E||w.value.attrType!=="EMBED_PREDEF"){s.push({code:"embeddable-type-unresolved",opIndex:p,entity:m.entity,handle:m.attribute});break}const X=Rp(w.value,E,m.embeddableOverrides,g.value,e.entities,p,m.entity,s);if(!X)break;h={...m.patch,dbAttrs:X}}l.push({kind:"attribute.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,attributeRef:w.value.modelId,patch:h})}else l.push({kind:"attribute.remove",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,attributeRef:w.value.modelId});break}case"association.add":{const g=at(e,m.spec.from),w=at(e,m.spec.to);if(g.ok||s.push(rt(g.reason,p,m.spec.from,g.matches,u)),w.ok||s.push(rt(w.reason,p,m.spec.to,w.matches,u)),!g.ok||!w.ok)break;if(m.spec.identifying&&g.value.modelId===w.value.modelId){s.push({code:"self-identifying",opIndex:p,handle:{from:m.spec.from,to:m.spec.to}});break}const h=i(),E={modelId:h,...m.spec.identifying!=null?{identifying:m.spec.identifying}:{},end1:{entityRef:g.value.modelId,multiplicity:m.spec.fromMultiplicity??"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1},end2:{entityRef:w.value.modelId,multiplicity:m.spec.toMultiplicity??"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:m.spec.composition??!1}},X={...e,associations:[...e.associations,E]},z=po(X,w.value.modelId,i);z.add[0]&&(E.end2.attributeRef=z.add[0].modelId),l.push({kind:"association.add",casUnit:"logical",associationRef:h,value:E});for(const q of z.add)l.push({kind:"attribute.add",casUnit:"logical",containerRef:w.value.modelId,entityRef:w.value.modelId,value:q});break}case"association.remove":{const g=at(e,m.association.from),w=at(e,m.association.to);if(g.ok||s.push(rt(g.reason,p,m.association.from,g.matches,u)),w.ok||s.push(rt(w.reason,p,m.association.to,w.matches,u)),!g.ok||!w.ok)break;const h=Ws(e,g.value.modelId,w.value.modelId);if(h.length!==1){s.push(h.length===0?{code:"association-not-found",opIndex:p,handle:m.association}:{code:"association-ambiguous",opIndex:p,handle:m.association,matches:h.map(E=>E.modelId)});break}l.push({kind:"association.remove",casUnit:"logical",associationRef:h[0].modelId});break}case"association.update":{const g=ec(e,m.association,p,s,u);if(!g)break;l.push({kind:"association.update",casUnit:"logical",containerRef:g.modelId,associationRef:g.modelId,patch:m.patch});break}case"associationEnd.update":{const g=ec(e,m.association,p,s,u);if(!g)break;const w=m.end==="from"?"end1":"end2";l.push({kind:"associationEnd.update",casUnit:"logical",containerRef:g.modelId,associationRef:g.modelId,end:w,patch:m.patch});break}case"index.add":{const g=at(e,m.entity);if(!g.ok){s.push(rt(g.reason,p,m.entity,g.matches,u));break}const w=Qs(g.value,m.spec,p,m.entity,s,i);if(!w)break;l.push({kind:"index.add",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,indexRef:w.modelId,value:w});break}case"index.update":case"index.remove":{const g=at(e,m.entity);if(!g.ok){s.push(rt(g.reason,p,m.entity,g.matches,u));break}const w=Sp(g.value,m.index);if(!w.ok){s.push(w.reason==="not-found"?{code:"index-not-found",opIndex:p,entity:m.entity,handle:m.index}:{code:"index-ambiguous",opIndex:p,entity:m.entity,handle:m.index,matches:w.matches});break}if(m.kind==="index.update"){if("columns"in m.patch){s.push({code:"index-columns-patch-unsupported",opIndex:p,entity:m.entity,handle:m.index});break}l.push({kind:"index.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,indexRef:w.value.modelId,patch:m.patch})}else l.push({kind:"index.remove",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,indexRef:w.value.modelId});break}case"operation.add":{const g=at(e,m.entity);if(!g.ok){s.push(rt(g.reason,p,m.entity,g.matches,u));break}const w=d.get(g.value.modelId)??((k=g.value.operations)==null?void 0:k.length)??0;d.set(g.value.modelId,w+1);const h=Zs(m.spec,w,i);l.push({kind:"operation.add",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,operationRef:h.modelId,value:h});break}case"operation.update":case"operation.remove":{const g=at(e,m.entity);if(!g.ok){s.push(rt(g.reason,p,m.entity,g.matches,u));break}const w=$p(g.value,m.operation);if(!w.ok){s.push(w.reason==="not-found"?{code:"operation-not-found",opIndex:p,entity:m.entity,handle:m.operation}:{code:"operation-ambiguous",opIndex:p,entity:m.entity,handle:m.operation,matches:w.matches});break}m.kind==="operation.update"?l.push({kind:"operation.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,operationRef:w.value.modelId,patch:m.patch}):l.push({kind:"operation.remove",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,operationRef:w.value.modelId});break}case"group.add":{const g=[];let w=!1;for(const X of m.spec.members){const z=at(e,X);if(!z.ok){s.push(rt(z.reason,p,X,z.matches,u)),w=!0;continue}g.push(z.value.modelId)}if(w)break;const h=i(),E={modelId:h,excludeDDLGeneration:m.spec.excludeDDLGeneration??!1,memberEntityRefs:g,...m.spec.name?{name:m.spec.name}:{},...m.spec.packageName?{packageName:m.spec.packageName}:{},...m.spec.description?{description:m.spec.description}:{}};l.push({kind:"group.add",casUnit:"logical",groupRef:h,value:E});break}}}),s.length?{ok:!1,errors:s}:{ok:!0,ops:l}}function rt(e,t,o,i,a){return e==="not-found"&&(a!=null&&a.has(o.ref))?{code:"pending-entity-ref",opIndex:t,handle:o}:e==="not-found"?{code:"entity-not-found",opIndex:t,handle:o}:{code:"entity-ambiguous",opIndex:t,handle:o,matches:i}}function ec(e,t,o,i,a){const r=at(e,t.from),l=at(e,t.to);if(r.ok||i.push(rt(r.reason,o,t.from,r.matches,a)),l.ok||i.push(rt(l.reason,o,t.to,l.matches,a)),!r.ok||!l.ok)return null;const s=Ws(e,r.value.modelId,l.value.modelId);return s.length!==1?(i.push(s.length===0?{code:"association-not-found",opIndex:o,handle:t}:{code:"association-ambiguous",opIndex:o,handle:t,matches:s.map(c=>c.modelId)}),null):s[0]}const tc={type:"object",description:"요소 지정 핸들. 엔티티: 물리명(table.physicalName) 우선, 논리명(name) 보조. 속성: 소속 엔티티 내 속성명 또는 컬럼 물리명.",properties:{ref:{type:"string",description:"매칭할 이름/물리명."},by:{type:"string",enum:["physicalName","name"],description:"매칭 키 고정(미지정 시 대상별 기본 순서)."}},required:["ref"],additionalProperties:!1},Tp={type:"object",description:"관계는 무명이라 양 끝 엔티티로 주소. from=부모(end1), to=자식(end2). 같은 쌍 복수 관계는 모호 보고.",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"}},required:["from","to"],additionalProperties:!1},Vp={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"],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"}}},required:["name"],additionalProperties:!1},Ei={type:"object",properties:{ko:{type:"string"},en:{type:"string"},ja:{type:"string"},zh:{type:"string"}},additionalProperties:!1},Mp={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:{...Ei,description:"속성 설명(다국어)."},columnLogicalName:{...Ei,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},Bp={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}},nc={type:"string",enum:["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"]},Dp={type:"object",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"},fromMultiplicity:{...nc,description:"end1 다중성(기본 EXACTLY_ONE_INSTANCE)."},toMultiplicity:{...nc,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},Op={type:"object",properties:{name:{type:"string"},unique:{type:"boolean",description:"UNIQUE 인덱스 여부(기본 false)."},columns:{type:"array",description:"인덱스 컬럼(순서 의미 있음).",items:{type:"object",properties:{column:{...tc,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},Pp={type:"object",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"],description:"가시성(기본 미설정)."},sourceCode:{type:"string",description:"Java 메서드 본문(멀티라인, 파라미터·반환 시그니처 포함)."},description:{...Ei,description:"메서드 설명(다국어)."},personalInfoAttributeType:{type:"string",description:"개인정보 속성 유형(패스스루)."}},required:["name"],additionalProperties:!1},Lp={type:"object",properties:{name:{...Ei,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},zp={type:"object",description:"부분 patch(임의 키). 값 품질 검증은 별도 엔진."};function tt(e,t){return{type:"object",properties:{kind:{const:e},...t.properties},required:["kind",...t.required],additionalProperties:!1}}const Up={"entity.add":tt("entity.add",{properties:{spec:{$ref:"#/$defs/entitySpec"}},required:["spec"]}),"entity.update":tt("entity.update",{properties:{entity:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","patch"]}),"entity.remove":tt("entity.remove",{properties:{entity:{$ref:"#/$defs/handle"}},required:["entity"]}),"attribute.add":tt("attribute.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/attrSpec"}},required:["entity","spec"]}),"attribute.update":tt("attribute.update",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"},embeddableOverrides:{$ref:"#/$defs/embeddableOverrides"}},required:["entity","attribute","patch"]}),"attribute.remove":tt("attribute.remove",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"}},required:["entity","attribute"]}),"association.add":tt("association.add",{properties:{spec:{$ref:"#/$defs/assocSpec"}},required:["spec"]}),"association.remove":tt("association.remove",{properties:{association:{$ref:"#/$defs/assocHandle"}},required:["association"]}),"association.update":tt("association.update",{properties:{association:{$ref:"#/$defs/assocHandle"},patch:{$ref:"#/$defs/patch"}},required:["association","patch"]}),"associationEnd.update":tt("associationEnd.update",{properties:{association:{$ref:"#/$defs/assocHandle"},end:{type:"string",enum:["from","to"],description:"from=부모(end1), to=자식(end2)."},patch:{$ref:"#/$defs/patch"}},required:["association","end","patch"]}),"index.add":tt("index.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/indexSpec"}},required:["entity","spec"]}),"index.update":tt("index.update",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","index","patch"]}),"index.remove":tt("index.remove",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/handle"}},required:["entity","index"]}),"operation.add":tt("operation.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/operationSpec"}},required:["entity","spec"]}),"operation.update":tt("operation.update",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","operation","patch"]}),"operation.remove":tt("operation.remove",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/handle"}},required:["entity","operation"]}),"group.add":tt("group.add",{properties:{spec:{$ref:"#/$defs/groupSpec"}},required:["spec"]})},oc={anyOf:Ks.map(e=>Up[e])},Hp={type:"object",description:"엔티티 모델을 생성·수정·삭제할 때 호출한다. ops는 사람 핸들(엔티티 물리명/논리명, 속성명)로 지정하며 서버가 modelId로 해소한다. 모호하면 에러로 후보를 돌려주니 리소스로 현재 모델을 먼저 읽어 핸들을 확정하라.",properties:{ops:{type:"array",items:{$ref:"#/$defs/symbolicOp"}}},required:["ops"],additionalProperties:!1,$defs:{handle:tc,assocHandle:Tp,entitySpec:Vp,attrSpec:Mp,embeddableOverrides:Bp,assocSpec:Dp,indexSpec:Op,operationSpec:Pp,groupSpec:Lp,patch:zp,symbolicOp:oc}};function Fp(e,t,o,i={}){const a=i.mkClientOpId??Be,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]=t[s]??0}return{diagramId:e,ops:o,cas:l,origin:i.origin??"agent",clientOpId:a()}}const ic={location:{x:0,y:0},size:{width:220,height:140}};function ac(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 Gp=/^[-=_*~\s]{3,}$/;function jp(e){return e.attrType&&e.attrType!=="NORMAL"||!Gp.test(e.name??"")?!1:!(e.dbAttrs??[]).some(t=>t.physicalName||t.dataType)}function Kp(e){return e.type===kt&&e.customType==="java.util.Currency"?{type:"Currency",customType:void 0}:{type:e.type,customType:e.customType}}function Yp(e,t){if(e.attrType==="DIVIDER"||jp(e))return{modelId:e.modelId,name:e.attrType==="DIVIDER"?e.name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:e.order??t,dbAttrs:[]};const o=Kp(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??t,dbAttrs:e.dbAttrs.map(ac)}}function Wp(e){const{modelId:t,name:o,visibility:i,sourceCode:a,description:r,order:l,personalInfoAttributeType:s,style:c,...d}=e;return{modelId:t,name:o,visibility:i,sourceCode:a,description:r?{ko:r}:void 0,order:l??0,personalInfoAttributeType:s,legacyRaw:Object.keys(d).length?d:void 0}}function qp(e){return{modelId:e.modelId,name:e.name,unique:e.unique,description:e.description,parameters:e.parameters,columns:e.indexColumns.map(t=>({columnRef:t.targetColumn.refId,descending:t.descending}))}}function Xp(e){var t,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(Yp),operations:(t=e.operations)==null?void 0:t.map(Wp),indexes:(o=e.indexes)==null?void 0:o.map(qp),jpaAttrs:e.jpaAttrs,table:e.dbAttrs?{physicalName:e.dbAttrs.physicalName,logicalName:e.dbAttrs.logicalName}:void 0}}function Jp(e){const t={};for(const i of e.attributes)i.style&&(t[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??{...ic},style:e.style,attributeStyles:Object.keys(t).length?t:void 0,operationStyles:Object.keys(o).length?o:void 0,collapsed:e.collapsed,locked:e.locked}}function rc(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 er(e){var t;return{entityRef:e.endModel.refId,multiplicity:e.multiplicity,navigable:e.navigable,composition:e.composition,attributeRef:(t=e.attribute)==null?void 0:t.modelId,jpa:rc(e)}}function Zp(e){var i,a;const t={modelId:e.modelId,description:e.description,end1:er(e.end1),end2:er(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:t,layout:o}}function lc(e){var t;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("RELATION")&&(((t=e.dbAttrs)==null?void 0:t.length)??0)>0}function sc(e){var t;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("EMBED")&&(((t=e.dbAttrs)==null?void 0:t.length)??0)>0}function cc(e){var o;const t=e.attribute;return(t==null?void 0:t.attrType)==="EMBED_OWN"&&(((o=t.dbAttrs)==null?void 0:o.length)??0)===0&&(e.multiplicity==="ZERO_OR_MORE_INSTANCES"||e.multiplicity==="ONE_OR_MORE_INSTANCES")}function dc(e,t){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:t,dbAttrs:(e.dbAttrs??[]).map(ac)}}function Qp(e,t,o){var k,g;const i=lc(e.end1.attribute),a=lc(e.end2.attribute);if(i===a)return Zp(e);const r=i?e.end1:e.end2,l=i?e.end2:e.end1,s=r.attribute,c=(g=(k=s.dbAttrs)==null?void 0:k[0])==null?void 0:g.targetModelId,d=c?o.get(c):void 0,u=t.get(l.endModel.refId),m=u?u.attributes.reduce((w,h)=>Math.max(w,h.order),-1)+1:s.order??0,p={...dc(s,m),attrType:"RELATION_OWN",derivedFrom:d?{associationRef:e.modelId,sourceAttributeRef:d}:void 0};u&&u.attributes.push(p);const f=(w,h)=>({entityRef:w.endModel.refId,multiplicity:w.multiplicity,navigable:w.navigable,composition:w.composition,attributeRef:h?d:p.modelId,legacyNavRaw:h?void 0:w.attribute,jpa:rc(w)}),y={modelId:e.modelId,description:e.description,end1:f(e.end1,i),end2:f(e.end2,a)},b={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:y.end1.attributeRef,targetColumnRef:y.end2.attributeRef,style:e.style};return{assoc:y,layout:b}}function eh(e,t){const o=e.targetModelId?t.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 th(e,t,o){var y;const i=((y=e.end1.attribute)==null?void 0:y.attrType)==="EMBED_OWN",a=i?e.end1:e.end2,r=i?e.end2:e.end1,l=a.attribute,s=t.get(r.endModel.refId),c=s?s.attributes.reduce((b,k)=>Math.max(b,k.order),-1)+1:l.order??0,d={...dc(l,c),attrType:l.attrType??"EMBED_OWN",dbAttrs:(l.dbAttrs??[]).map(b=>eh(b,o)),embedded:{associationRef:e.modelId,embeddableRef:a.endModel.refId}};s&&s.attributes.push(d);const u=b=>({...er(b),legacyEmbedRaw:b.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 nh(e,t){var i,a,r,l;const o=[];for(const s of t){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 uc(e,t={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=nh(o,s);u.length&&(d=u)}return{modelId:o,memo:i,geo:{location:{x:a.location.x+t.x,y:a.location.y+t.y},size:a.size},style:r,connections:d,legacyRaw:Object.keys(c).length?c:void 0}}function mc(e,t,o){if(!(o!=null&&o.length))return;const i=new Map(e.map(l=>[l.modelId,l])),a=new Map(t.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 oh(e){return(e.schemaVersion??1)>=2&&"logical"in e?ih(e):ah(e)}function ih(e){const t=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),{version:s,...c}=e.layout;mc(a,r,c.associationLayouts);const d={logical:{modelId:e.logical.modelId??t,packageName:e.logical.packageName,entities:a,associations:r,groups:l},layout:{...c,diagramId:c.diagramId??t,logicalModelRef:c.logicalModelRef??t}},u={id:e.id,version:e.version,diagramVersion:e.diagramVersion,size:e.size,packageName:e.packageName,schemaVersion:e.schemaVersion,opWriteEnabled:e.opWriteEnabled,revSeed:{revs:o,layoutVersion:s??0,logicalVersion:e.logical.version??0}};return{state:d,meta:u}}function ah(e){var g,w;const t=e.id??"",o=[],i=[],a=[],r=[],l=[],s=[],c=[],d=(h,E)=>{o.push(Xp(h));const X=Jp(h);X.geo={location:{x:X.geo.location.x+E.x,y:X.geo.location.y+E.y},size:X.geo.size},i.push(X);for(const z of h.ownedAssociations??[])c.push(z)},u={x:0,y:0};for(const h of e.entities??[])d(h,u);const m=[];for(const h of e.groups??[]){const E=h.entities??[];l.push({modelId:h.modelId,name:h.name,description:h.description,packageName:h.packageName,excludeDDLGeneration:h.excludeDDLGeneration??!1,memberEntityRefs:E.map(z=>z.modelId)});const X=((g=h.geo)==null?void 0:g.location)??u;if(h.geo){const z=(h.notes??[]).map(q=>q.modelId);s.push({groupRef:h.modelId,geo:h.geo,style:h.style,locked:h.locked,memberNoteRefs:z.length?z:void 0})}for(const z of E)d(z,X);for(const z of h.notes??[])m.push(uc(z,X))}const p=new Map(o.map(h=>[h.modelId,h])),f=new Map,y=new Map;for(const h of o)for(const E of h.attributes)for(const X of E.dbAttrs)f.set(X.modelId,E.modelId),y.set(X.modelId,X);for(const h of c)for(const E of[h.end1,h.end2]){const X=E.attribute;if(X&&(((w=X.dbAttrs)==null?void 0:w.length)??0)>0)for(const z of X.dbAttrs)z.modelId&&f.set(z.modelId,X.modelId)}for(const h of c){const E=sc(h.end1.attribute),X=sc(h.end2.attribute),z=cc(h.end1)||cc(h.end2),{assoc:q,layout:D}=E!==X||z?th(h,p,y):Qp(h,p,f);a.push(q),r.push(D)}mc(o,a,r),Wl(o);const b={logical:{modelId:t,packageName:e.packageName,entities:o,associations:a,groups:l},layout:{diagramId:t,logicalModelRef:t,canvasSize:e.size,entityLayouts:i,associationLayouts:r,groupLayouts:s,notes:[...(e.notes??[]).map(h=>uc(h)),...m]}},k={id:e.id,version:e.version,diagramVersion:e.diagramVersion,size:e.size,packageName:e.packageName,schemaVersion:e.schemaVersion??1};return{state:b,meta:k}}function fc(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 rh(e,t){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(fc),style:t}}function lh(e,t){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:t}}function sh(e){return{modelId:e.modelId,name:e.name,unique:e.unique,description:e.description,parameters:e.parameters,indexColumns:e.columns.map(t=>({targetColumn:{refId:t.columnRef},descending:t.descending}))}}function jt(e,t){return{endModel:{refId:e.entityRef},multiplicity:e.multiplicity,navigable:e.navigable,composition:e.composition,jpaAttribute:e.jpa,attribute:t??(e.attributeRef?{modelId:e.attributeRef}:void 0)}}function ch(e,t){const o=t==null?void 0:t.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{...fc(i),targetModelId:(r=o==null?void 0:o.dbAttrs[a])==null?void 0:r.modelId}})}}function dh(e){const t=new Set;for(const o of e.logical.associations){const i=o.end1.legacyNavRaw?o.end1:o.end2.legacyNavRaw?o.end2:void 0;i!=null&&i.attributeRef&&t.add(i.attributeRef)}return t}function uh(e){const t=new Set;for(const o of e.logical.entities)for(const i of o.attributes)i.embedded&&t.add(i.modelId);return t}function mh(e,t){return e===t||JSON.stringify(e??null)===JSON.stringify(t??null)}function fh(e,t){const o=(i,a)=>i===a?void 0:i;return{modelId:e.modelId,targetModelId:t==null?void 0:t.modelId,physicalName:e.physicalName===((t==null?void 0:t.physicalName)??"")?"":e.physicalName,logicalName:mh(e.logicalName,t==null?void 0:t.logicalName)?void 0:e.logicalName,dataType:e.dataType===((t==null?void 0:t.dataType)??"")?"":e.dataType,length:o(e.length,t==null?void 0:t.length),scale:o(e.scale,t==null?void 0:t.scale),unique:o(e.unique,t==null?void 0:t.unique),autoIncrement:o(e.autoIncrement,t==null?void 0:t.autoIncrement),updatable:o(e.updatable,t==null?void 0:t.updatable),insertable:o(e.insertable,t==null?void 0:t.insertable)}}function ph(e,t,o){let i;for(const m of t.logical.entities){const p=m.attributes.find(f=>{var y;return((y=f.embedded)==null?void 0:y.associationRef)===e.modelId});if(p){i=p;break}}if(!i)return;const a=i.embedded.embeddableRef,r=t.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)=>fh(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:jt(e.end1,c?s:u),end2:jt(e.end2,c?u:s)}}function hh(e,t,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:jt(e.end1,e.end1.legacyEmbedRaw),end2:jt(e.end2,e.end2.legacyEmbedRaw)};const a=ph(e,t,i);if(a)return a;const r=!!e.end1.legacyNavRaw,l=!!e.end2.legacyNavRaw;if(r!==l){const s=r?e.end1:e.end2,c=r?e.end2:e.end1,d=t.logical.entities.find(y=>y.modelId===s.entityRef),u=d==null?void 0:d.attributes.find(y=>y.modelId===s.attributeRef),m=t.logical.entities.find(y=>y.modelId===c.entityRef),p=u?ch(u,m):void 0,f=s.legacyNavRaw;return{...i,end1:jt(e.end1,r?f:p),end2:jt(e.end2,l?f:p)}}return{...i,end1:jt(e.end1),end2:jt(e.end2)}}function pc(e,t,o,i,a={x:0,y:0}){var u,m;const r=t.layout.entityLayouts.find(p=>p.entityRef===e.modelId),l=t.logical.associations.filter(p=>p.end1.entityRef===e.modelId),s=p=>t.layout.associationLayouts.find(f=>f.associationRef===p),c=(r==null?void 0:r.geo)??{...ic},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 rh(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 lh(p,(f=r==null?void 0:r.operationStyles)==null?void 0:f[p.modelId])}),ownedAssociations:l.map(p=>hh(p,t,s(p.modelId))),indexes:(m=e.indexes)==null?void 0:m.map(sh),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 yh(e,t,o,i){const a=t.layout.groupLayouts.find(c=>c.groupRef===e.modelId),r=e.memberEntityRefs.map(c=>t.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=>t.layout.notes.find(d=>d.modelId===c)).filter(c=>!!c).map(c=>hc(c,l));return{modelId:e.modelId,name:e.name,description:e.description,packageName:e.packageName,excludeDDLGeneration:e.excludeDDLGeneration,entities:r.map(c=>pc(c,t,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 hc(e,t={x:0,y:0}){return{...e.legacyRaw,modelId:e.modelId,memo:e.memo,geo:{location:{x:e.geo.location.x-t.x,y:e.geo.location.y-t.y},size:e.geo.size},style:e.style,connections:e.connections}}function gh(e,t={}){const o=new Set(e.logical.groups.flatMap(s=>s.memberEntityRefs)),i=e.logical.entities.filter(s=>!o.has(s.modelId)),a=dh(e),r=uh(e),l=new Set(e.layout.groupLayouts.flatMap(s=>s.memberNoteRefs??[]));return{id:t.id,diagramVersion:t.diagramVersion,version:t.version,size:t.size??e.layout.canvasSize,packageName:t.packageName??e.logical.packageName,entities:i.map(s=>pc(s,e,a,r)),groups:e.logical.groups.map(s=>yh(s,e,a,r)),notes:e.layout.notes.filter(s=>!l.has(s.modelId)).map(s=>hc(s))}}function bh(e,t={}){var a,r,l;const o=((a=t.revSeed)==null?void 0:a.revs)??{},i=s=>({...s,rev:o[s.modelId]??0});return{id:t.id,schemaVersion:2,opWriteEnabled:t.opWriteEnabled,version:t.version,diagramVersion:t.diagramVersion,packageName:t.packageName,size:t.size,logical:{version:((r=t.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=t.revSeed)==null?void 0:l.layoutVersion)??0}}}function ho(e){return n.getCurrentScope()?(n.onScopeDispose(e),!0):!1}function Mt(e){return typeof e=="function"?e():n.unref(e)}const _h=typeof window<"u"&&typeof document<"u",kh=e=>typeof e<"u",Eh=Object.prototype.toString,wh=e=>Eh.call(e)==="[object Object]",Nh=()=>{};function vh(e,t){function o(...i){return new Promise((a,r)=>{Promise.resolve(e(()=>t.apply(this,i),{fn:t,thisArg:this,args:i})).then(a).catch(r)})}return o}const yc=e=>e();function xh(e=yc){const t=n.ref(!0);function o(){t.value=!1}function i(){t.value=!0}const a=(...r)=>{t.value&&e(...r)};return{isActive:n.readonly(t),pause:o,resume:i,eventFilter:a}}function gc(e,t=!1,o="Timeout"){return new Promise((i,a)=>{setTimeout(t?()=>a(o):i,e)})}function Ch(e,t,o={}){const{eventFilter:i=yc,...a}=o;return n.watch(e,vh(i,t),a)}function On(e,t,o={}){const{eventFilter:i,...a}=o,{eventFilter:r,pause:l,resume:s,isActive:c}=xh(i);return{stop:Ch(e,t,{...a,eventFilter:r}),pause:l,resume:s,isActive:c}}function Ih(e,t={}){if(!n.isRef(e))return n.toRefs(e);const o=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)o[i]=n.customRef(()=>({get(){return e.value[i]},set(a){var r;if((r=Mt(t.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 tr(e,t=!1){function o(m,{flush:p="sync",deep:f=!1,timeout:y,throwOnTimeout:b}={}){let k=null;const w=[new Promise(h=>{k=n.watch(e,E=>{m(E)!==t&&(k==null||k(),h(E))},{flush:p,deep:f,immediate:!0})})];return y!=null&&w.push(gc(y,b).then(()=>Mt(e)).finally(()=>k==null?void 0:k())),Promise.race(w)}function i(m,p){if(!n.isRef(m))return o(E=>E===m,p);const{flush:f="sync",deep:y=!1,timeout:b,throwOnTimeout:k}=p??{};let g=null;const h=[new Promise(E=>{g=n.watch([e,m],([X,z])=>{t!==(X===z)&&(g==null||g(),E(X))},{flush:f,deep:y,immediate:!0})})];return b!=null&&h.push(gc(b,k).then(()=>Mt(e)).finally(()=>(g==null||g(),Mt(e)))),Promise.race(h)}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 y=Array.from(f);return y.includes(m)||y.includes(Mt(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(Mt(e))?{toMatch:o,toContains:c,changed:d,changedTimes:u,get not(){return tr(e,!t)}}:{toMatch:o,toBe:i,toBeTruthy:a,toBeNull:r,toBeNaN:s,toBeUndefined:l,changed:d,changedTimes:u,get not(){return tr(e,!t)}}}function nr(e){return tr(e)}function Sh(e){var t;const o=Mt(e);return(t=o==null?void 0:o.$el)!=null?t:o}const bc=_h?window:void 0;function _c(...e){let t,o,i,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([o,i,a]=e,t=bc):[t,o,i,a]=e,!t)return Nh;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=n.watch(()=>[Sh(t),Mt(a)],([u,m])=>{if(l(),!u)return;const p=wh(m)?{...m}:m;r.push(...o.flatMap(f=>i.map(y=>s(u,f,y,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return ho(d),d}function $h(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function kc(...e){let t,o,i={};e.length===3?(t=e[0],o=e[1],i=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,o=e[0],i=e[1]):(t=e[0],o=e[1]):(t=!0,o=e[0]);const{target:a=bc,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=i,c=$h(t);return _c(a,r,u=>{u.repeat&&Mt(s)||c(u)&&o(u)},l)}function Rh(e){return JSON.parse(JSON.stringify(e))}function or(e,t,o,i={}){var a,r,l;const{clone:s=!1,passive:c=!1,eventName:d,deep:u=!1,defaultValue:m,shouldEmit:p}=i,f=n.getCurrentInstance(),y=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 b=d;t||(t="modelValue"),b=b||`update:${t.toString()}`;const k=h=>s?typeof s=="function"?s(h):Rh(h):h,g=()=>kh(e[t])?k(e[t]):m,w=h=>{p?p(h)&&y(b,h):y(b,h)};if(c){const h=g(),E=n.ref(h);let X=!1;return n.watch(()=>e[t],z=>{X||(X=!0,E.value=k(z),n.nextTick(()=>X=!1))}),n.watch(E,z=>{!X&&(z!==e[t]||u)&&w(z)},{deep:u}),E}else return n.computed({get(){return g()},set(h){w(h)}})}var Ah={value:()=>{}};function wi(){for(var e=0,t=arguments.length,o={},i;e<t;++e){if(!(i=arguments[e]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new Ni(o)}function Ni(e){this._=e}function Th(e,t){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&&!t.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}Ni.prototype=wi.prototype={constructor:Ni,on:function(e,t){var o=this._,i=Th(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=Vh(o[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<l;)if(a=(e=i[r]).type)o[a]=Ec(o[a],e.name,t);else if(t==null)for(a in o)o[a]=Ec(o[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var o in t)e[o]=t[o].slice();return new Ni(e)},call:function(e,t){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(t,o)},apply:function(e,t,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(t,o)}};function Vh(e,t){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===t)return a.value}function Ec(e,t,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=Ah,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:t,value:o}),e}var ir="http://www.w3.org/1999/xhtml";const wc={svg:"http://www.w3.org/2000/svg",xhtml:ir,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vi(e){var t=e+="",o=t.indexOf(":");return o>=0&&(t=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),wc.hasOwnProperty(t)?{space:wc[t],local:e}:e}function Mh(e){return function(){var t=this.ownerDocument,o=this.namespaceURI;return o===ir&&t.documentElement.namespaceURI===ir?t.createElement(e):t.createElementNS(o,e)}}function Bh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Nc(e){var t=vi(e);return(t.local?Bh:Mh)(t)}function Dh(){}function ar(e){return e==null?Dh:function(){return this.querySelector(e)}}function Oh(e){typeof e!="function"&&(e=ar(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 Ph(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Lh(){return[]}function vc(e){return e==null?Lh:function(){return this.querySelectorAll(e)}}function zh(e){return function(){return Ph(e.apply(this,arguments))}}function Uh(e){typeof e=="function"?e=zh(e):e=vc(e);for(var t=this._groups,o=t.length,i=[],a=[],r=0;r<o;++r)for(var l=t[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 xc(e){return function(){return this.matches(e)}}function Cc(e){return function(t){return t.matches(e)}}var Hh=Array.prototype.find;function Fh(e){return function(){return Hh.call(this.children,e)}}function Gh(){return this.firstElementChild}function jh(e){return this.select(e==null?Gh:Fh(typeof e=="function"?e:Cc(e)))}var Kh=Array.prototype.filter;function Yh(){return Array.from(this.children)}function Wh(e){return function(){return Kh.call(this.children,e)}}function qh(e){return this.selectAll(e==null?Yh:Wh(typeof e=="function"?e:Cc(e)))}function Xh(e){typeof e!="function"&&(e=xc(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 Ic(e){return new Array(e.length)}function Jh(){return new ut(this._enter||this._groups.map(Ic),this._parents)}function xi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}xi.prototype={constructor:xi,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Zh(e){return function(){return e}}function Qh(e,t,o,i,a,r){for(var l=0,s,c=t.length,d=r.length;l<d;++l)(s=t[l])?(s.__data__=r[l],i[l]=s):o[l]=new xi(e,r[l]);for(;l<c;++l)(s=t[l])&&(a[l]=s)}function ey(e,t,o,i,a,r,l){var s,c,d=new Map,u=t.length,m=r.length,p=new Array(u),f;for(s=0;s<u;++s)(c=t[s])&&(p[s]=f=l.call(c,c.__data__,s,t)+"",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 xi(e,r[s]);for(s=0;s<u;++s)(c=t[s])&&d.get(p[s])===c&&(a[s]=c)}function ty(e){return e.__data__}function ny(e,t){if(!arguments.length)return Array.from(this,ty);var o=t?ey:Qh,i=this._parents,a=this._groups;typeof e!="function"&&(e=Zh(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=oy(e.call(u,u&&u.__data__,d,i)),y=f.length,b=s[d]=new Array(y),k=l[d]=new Array(y),g=c[d]=new Array(p);o(u,m,b,k,g,f,t);for(var w=0,h=0,E,X;w<y;++w)if(E=b[w]){for(w>=h&&(h=w+1);!(X=k[h])&&++h<y;);E._next=X||null}}return l=new ut(l,i),l._enter=s,l._exit=c,l}function oy(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function iy(){return new ut(this._exit||this._groups.map(Ic),this._parents)}function ay(e,t,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+""),t!=null&&(a=t(a),a&&(a=a.selection())),o==null?r.remove():o(r),i&&a?i.merge(a).order():a}function ry(e){for(var t=e.selection?e.selection():e,o=this._groups,i=t._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,y=0;y<m;++y)(f=d[y]||u[y])&&(p[y]=f);for(;c<a;++c)s[c]=o[c];return new ut(s,this._parents)}function ly(){for(var e=this._groups,t=-1,o=e.length;++t<o;)for(var i=e[t],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 sy(e){e||(e=cy);function t(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(t)}return new ut(a,this._parents).order()}function cy(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dy(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function uy(){return Array.from(this)}function my(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,r=i.length;a<r;++a){var l=i[a];if(l)return l}return null}function fy(){let e=0;for(const t of this)++e;return e}function py(){return!this.node()}function hy(e){for(var t=this._groups,o=0,i=t.length;o<i;++o)for(var a=t[o],r=0,l=a.length,s;r<l;++r)(s=a[r])&&e.call(s,s.__data__,r,a);return this}function yy(e){return function(){this.removeAttribute(e)}}function gy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function by(e,t){return function(){this.setAttribute(e,t)}}function _y(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ky(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function Ey(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,o)}}function wy(e,t){var o=vi(e);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((t==null?o.local?gy:yy:typeof t=="function"?o.local?Ey:ky:o.local?_y:by)(o,t))}function Sc(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ny(e){return function(){this.style.removeProperty(e)}}function vy(e,t,o){return function(){this.style.setProperty(e,t,o)}}function xy(e,t,o){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function Cy(e,t,o){return arguments.length>1?this.each((t==null?Ny:typeof t=="function"?xy:vy)(e,t,o??"")):Pn(this.node(),e)}function Pn(e,t){return e.style.getPropertyValue(t)||Sc(e).getComputedStyle(e,null).getPropertyValue(t)}function Iy(e){return function(){delete this[e]}}function Sy(e,t){return function(){this[e]=t}}function $y(e,t){return function(){var o=t.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function Ry(e,t){return arguments.length>1?this.each((t==null?Iy:typeof t=="function"?$y:Sy)(e,t)):this.node()[e]}function $c(e){return e.trim().split(/^|\s+/)}function rr(e){return e.classList||new Rc(e)}function Rc(e){this._node=e,this._names=$c(e.getAttribute("class")||"")}Rc.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ac(e,t){for(var o=rr(e),i=-1,a=t.length;++i<a;)o.add(t[i])}function Tc(e,t){for(var o=rr(e),i=-1,a=t.length;++i<a;)o.remove(t[i])}function Ay(e){return function(){Ac(this,e)}}function Ty(e){return function(){Tc(this,e)}}function Vy(e,t){return function(){(t.apply(this,arguments)?Ac:Tc)(this,e)}}function My(e,t){var o=$c(e+"");if(arguments.length<2){for(var i=rr(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof t=="function"?Vy:t?Ay:Ty)(o,t))}function By(){this.textContent=""}function Dy(e){return function(){this.textContent=e}}function Oy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Py(e){return arguments.length?this.each(e==null?By:(typeof e=="function"?Oy:Dy)(e)):this.node().textContent}function Ly(){this.innerHTML=""}function zy(e){return function(){this.innerHTML=e}}function Uy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Hy(e){return arguments.length?this.each(e==null?Ly:(typeof e=="function"?Uy:zy)(e)):this.node().innerHTML}function Fy(){this.nextSibling&&this.parentNode.appendChild(this)}function Gy(){return this.each(Fy)}function jy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ky(){return this.each(jy)}function Yy(e){var t=typeof e=="function"?e:Nc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Wy(){return null}function qy(e,t){var o=typeof e=="function"?e:Nc(e),i=t==null?Wy:typeof t=="function"?t:ar(t);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function Xy(){var e=this.parentNode;e&&e.removeChild(this)}function Jy(){return this.each(Xy)}function Zy(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eg(e){return this.select(e?Qy:Zy)}function tg(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ng(e){return function(t){e.call(this,t,this.__data__)}}function og(e){return e.trim().split(/^|\s+/).map(function(t){var o="",i=t.indexOf(".");return i>=0&&(o=t.slice(i+1),t=t.slice(0,i)),{type:t,name:o}})}function ig(e){return function(){var t=this.__on;if(t){for(var o=0,i=-1,a=t.length,r;o<a;++o)r=t[o],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++i]=r;++i?t.length=i:delete this.__on}}}function ag(e,t,o){return function(){var i=this.__on,a,r=ng(t);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=t;return}}this.addEventListener(e.type,r,o),a={type:e.type,name:e.name,value:t,listener:r,options:o},i?i.push(a):this.__on=[a]}}function rg(e,t,o){var i=og(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=t?ag:ig,a=0;a<r;++a)this.each(s(i[a],t,o));return this}function Vc(e,t,o){var i=Sc(e),a=i.CustomEvent;typeof a=="function"?a=new a(t,o):(a=i.document.createEvent("Event"),o?(a.initEvent(t,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function lg(e,t){return function(){return Vc(this,e,t)}}function sg(e,t){return function(){return Vc(this,e,t.apply(this,arguments))}}function cg(e,t){return this.each((typeof t=="function"?sg:lg)(e,t))}function*dg(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,r=i.length,l;a<r;++a)(l=i[a])&&(yield l)}var Mc=[null];function ut(e,t){this._groups=e,this._parents=t}function yo(){return new ut([[document.documentElement]],Mc)}function ug(){return this}ut.prototype=yo.prototype={constructor:ut,select:Oh,selectAll:Uh,selectChild:jh,selectChildren:qh,filter:Xh,data:ny,enter:Jh,exit:iy,join:ay,merge:ry,selection:ug,order:ly,sort:sy,call:dy,nodes:uy,node:my,size:fy,empty:py,each:hy,attr:wy,style:Cy,property:Ry,classed:My,text:Py,html:Hy,raise:Gy,lower:Ky,append:Yy,insert:qy,remove:Jy,clone:eg,datum:tg,on:rg,dispatch:cg,[Symbol.iterator]:dg};function ht(e){return typeof e=="string"?new ut([[document.querySelector(e)]],[document.documentElement]):new ut([[e]],Mc)}function mg(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Nt(e,t){if(e=mg(e),t===void 0&&(t=e.currentTarget),t){var o=t.ownerSVGElement||t;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const fg={passive:!1},go={capture:!0,passive:!1};function lr(e){e.stopImmediatePropagation()}function Ln(e){e.preventDefault(),e.stopImmediatePropagation()}function Bc(e){var t=e.document.documentElement,o=ht(e).on("dragstart.drag",Ln,go);"onselectstart"in t?o.on("selectstart.drag",Ln,go):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Dc(e,t){var o=e.document.documentElement,i=ht(e).on("dragstart.drag",null);t&&(i.on("click.drag",Ln,go),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 Ci=e=>()=>e;function sr(e,{sourceEvent:t,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:t,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}})}sr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function pg(e){return!e.ctrlKey&&!e.button}function hg(){return this.parentNode}function yg(e,t){return t??{x:e.x,y:e.y}}function gg(){return navigator.maxTouchPoints||"ontouchstart"in this}function bg(){var e=pg,t=hg,o=yg,i=gg,a={},r=wi("start","drag","end"),l=0,s,c,d,u,m=0;function p(E){E.on("mousedown.drag",f).filter(i).on("touchstart.drag",k).on("touchmove.drag",g,fg).on("touchend.drag touchcancel.drag",w).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(E,X){if(!(u||!e.call(this,E,X))){var z=h(this,t.call(this,E,X),E,X,"mouse");z&&(ht(E.view).on("mousemove.drag",y,go).on("mouseup.drag",b,go),Bc(E.view),lr(E),d=!1,s=E.clientX,c=E.clientY,z("start",E))}}function y(E){if(Ln(E),!d){var X=E.clientX-s,z=E.clientY-c;d=X*X+z*z>m}a.mouse("drag",E)}function b(E){ht(E.view).on("mousemove.drag mouseup.drag",null),Dc(E.view,d),Ln(E),a.mouse("end",E)}function k(E,X){if(e.call(this,E,X)){var z=E.changedTouches,q=t.call(this,E,X),D=z.length,$,B;for($=0;$<D;++$)(B=h(this,q,E,X,z[$].identifier,z[$]))&&(lr(E),B("start",E,z[$]))}}function g(E){var X=E.changedTouches,z=X.length,q,D;for(q=0;q<z;++q)(D=a[X[q].identifier])&&(Ln(E),D("drag",E,X[q]))}function w(E){var X=E.changedTouches,z=X.length,q,D;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),q=0;q<z;++q)(D=a[X[q].identifier])&&(lr(E),D("end",E,X[q]))}function h(E,X,z,q,D,$){var B=r.copy(),Q=Nt($||z,X),V,re,_;if((_=o.call(E,new sr("beforestart",{sourceEvent:z,target:p,identifier:D,active:l,x:Q[0],y:Q[1],dx:0,dy:0,dispatch:B}),q))!=null)return V=_.x-Q[0]||0,re=_.y-Q[1]||0,function W(R,J,ee){var ae=Q,I;switch(R){case"start":a[D]=W,I=l++;break;case"end":delete a[D],--l;case"drag":Q=Nt(ee||J,X),I=l;break}B.call(R,E,new sr(R,{sourceEvent:J,subject:_,target:p,identifier:D,active:I,x:Q[0]+V,y:Q[1]+re,dx:Q[0]-ae[0],dy:Q[1]-ae[1],dispatch:B}),q)}}return p.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Ci(!!E),p):e},p.container=function(E){return arguments.length?(t=typeof E=="function"?E:Ci(E),p):t},p.subject=function(E){return arguments.length?(o=typeof E=="function"?E:Ci(E),p):o},p.touchable=function(E){return arguments.length?(i=typeof E=="function"?E:Ci(!!E),p):i},p.on=function(){var E=r.on.apply(r,arguments);return E===r?p:E},p.clickDistance=function(E){return arguments.length?(m=(E=+E)*E,p):Math.sqrt(m)},p}function cr(e,t,o){e.prototype=t.prototype=o,o.constructor=e}function Oc(e,t){var o=Object.create(e.prototype);for(var i in t)o[i]=t[i];return o}function bo(){}var _o=.7,Ii=1/_o,zn="\\s*([+-]?\\d+)\\s*",ko="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",vt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_g=/^#([0-9a-f]{3,8})$/,kg=new RegExp(`^rgb\\(${zn},${zn},${zn}\\)$`),Eg=new RegExp(`^rgb\\(${vt},${vt},${vt}\\)$`),wg=new RegExp(`^rgba\\(${zn},${zn},${zn},${ko}\\)$`),Ng=new RegExp(`^rgba\\(${vt},${vt},${vt},${ko}\\)$`),vg=new RegExp(`^hsl\\(${ko},${vt},${vt}\\)$`),xg=new RegExp(`^hsla\\(${ko},${vt},${vt},${ko}\\)$`),Pc={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};cr(bo,sn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Lc,formatHex:Lc,formatHex8:Cg,formatHsl:Ig,formatRgb:zc,toString:zc});function Lc(){return this.rgb().formatHex()}function Cg(){return this.rgb().formatHex8()}function Ig(){return jc(this).formatHsl()}function zc(){return this.rgb().formatRgb()}function sn(e){var t,o;return e=(e+"").trim().toLowerCase(),(t=_g.exec(e))?(o=t[1].length,t=parseInt(t[1],16),o===6?Uc(t):o===3?new st(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):o===8?Si(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):o===4?Si(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=kg.exec(e))?new st(t[1],t[2],t[3],1):(t=Eg.exec(e))?new st(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wg.exec(e))?Si(t[1],t[2],t[3],t[4]):(t=Ng.exec(e))?Si(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vg.exec(e))?Gc(t[1],t[2]/100,t[3]/100,1):(t=xg.exec(e))?Gc(t[1],t[2]/100,t[3]/100,t[4]):Pc.hasOwnProperty(e)?Uc(Pc[e]):e==="transparent"?new st(NaN,NaN,NaN,0):null}function Uc(e){return new st(e>>16&255,e>>8&255,e&255,1)}function Si(e,t,o,i){return i<=0&&(e=t=o=NaN),new st(e,t,o,i)}function Sg(e){return e instanceof bo||(e=sn(e)),e?(e=e.rgb(),new st(e.r,e.g,e.b,e.opacity)):new st}function dr(e,t,o,i){return arguments.length===1?Sg(e):new st(e,t,o,i??1)}function st(e,t,o,i){this.r=+e,this.g=+t,this.b=+o,this.opacity=+i}cr(st,dr,Oc(bo,{brighter(e){return e=e==null?Ii:Math.pow(Ii,e),new st(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?_o:Math.pow(_o,e),new st(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new st(cn(this.r),cn(this.g),cn(this.b),$i(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:Hc,formatHex:Hc,formatHex8:$g,formatRgb:Fc,toString:Fc}));function Hc(){return`#${dn(this.r)}${dn(this.g)}${dn(this.b)}`}function $g(){return`#${dn(this.r)}${dn(this.g)}${dn(this.b)}${dn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Fc(){const e=$i(this.opacity);return`${e===1?"rgb(":"rgba("}${cn(this.r)}, ${cn(this.g)}, ${cn(this.b)}${e===1?")":`, ${e})`}`}function $i(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dn(e){return e=cn(e),(e<16?"0":"")+e.toString(16)}function Gc(e,t,o,i){return i<=0?e=t=o=NaN:o<=0||o>=1?e=t=NaN:t<=0&&(e=NaN),new yt(e,t,o,i)}function jc(e){if(e instanceof yt)return new yt(e.h,e.s,e.l,e.opacity);if(e instanceof bo||(e=sn(e)),!e)return new yt;if(e instanceof yt)return e;e=e.rgb();var t=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(t,o,i),r=Math.max(t,o,i),l=NaN,s=r-a,c=(r+a)/2;return s?(t===r?l=(o-i)/s+(o<i)*6:o===r?l=(i-t)/s+2:l=(t-o)/s+4,s/=c<.5?r+a:2-r-a,l*=60):s=c>0&&c<1?0:l,new yt(l,s,c,e.opacity)}function Rg(e,t,o,i){return arguments.length===1?jc(e):new yt(e,t,o,i??1)}function yt(e,t,o,i){this.h=+e,this.s=+t,this.l=+o,this.opacity=+i}cr(yt,Rg,Oc(bo,{brighter(e){return e=e==null?Ii:Math.pow(Ii,e),new yt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?_o:Math.pow(_o,e),new yt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,i=o+(o<.5?o:1-o)*t,a=2*o-i;return new st(ur(e>=240?e-240:e+120,a,i),ur(e,a,i),ur(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new yt(Kc(this.h),Ri(this.s),Ri(this.l),$i(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=$i(this.opacity);return`${e===1?"hsl(":"hsla("}${Kc(this.h)}, ${Ri(this.s)*100}%, ${Ri(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Kc(e){return e=(e||0)%360,e<0?e+360:e}function Ri(e){return Math.max(0,Math.min(1,e||0))}function ur(e,t,o){return(e<60?t+(o-t)*e/60:e<180?o:e<240?t+(o-t)*(240-e)/60:t)*255}const mr=e=>()=>e;function Ag(e,t){return function(o){return e+o*t}}function Tg(e,t,o){return e=Math.pow(e,o),t=Math.pow(t,o)-e,o=1/o,function(i){return Math.pow(e+i*t,o)}}function Vg(e){return(e=+e)==1?Yc:function(t,o){return o-t?Tg(t,o,e):mr(isNaN(t)?o:t)}}function Yc(e,t){var o=t-e;return o?Ag(e,o):mr(isNaN(e)?t:e)}const Ai=(function e(t){var o=Vg(t);function i(a,r){var l=o((a=dr(a)).r,(r=dr(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=Yc(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 Mg(e,t){t||(t=[]);var o=e?Math.min(t.length,e.length):0,i=t.slice(),a;return function(r){for(a=0;a<o;++a)i[a]=e[a]*(1-r)+t[a]*r;return i}}function Bg(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Dg(e,t){var o=t?t.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]=Eo(e[l],t[l]);for(;l<o;++l)r[l]=t[l];return function(s){for(l=0;l<i;++l)r[l]=a[l](s);return r}}function Og(e,t){var o=new Date;return e=+e,t=+t,function(i){return o.setTime(e*(1-i)+t*i),o}}function xt(e,t){return e=+e,t=+t,function(o){return e*(1-o)+t*o}}function Pg(e,t){var o={},i={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?o[a]=Eo(e[a],t[a]):i[a]=t[a];return function(r){for(a in o)i[a]=o[a](r);return i}}var fr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pr=new RegExp(fr.source,"g");function Lg(e){return function(){return e}}function zg(e){return function(t){return e(t)+""}}function Wc(e,t){var o=fr.lastIndex=pr.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",t=t+"";(i=fr.exec(e))&&(a=pr.exec(t));)(r=a.index)>o&&(r=t.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:xt(i,a)})),o=pr.lastIndex;return o<t.length&&(r=t.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?zg(c[0].x):Lg(t):(t=c.length,function(d){for(var u=0,m;u<t;++u)s[(m=c[u]).i]=m.x(d);return s.join("")})}function Eo(e,t){var o=typeof t,i;return t==null||o==="boolean"?mr(t):(o==="number"?xt:o==="string"?(i=sn(t))?(t=i,Ai):Wc:t instanceof sn?Ai:t instanceof Date?Og:Bg(t)?Mg:Array.isArray(t)?Dg:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Pg:xt)(e,t)}var qc=180/Math.PI,hr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Xc(e,t,o,i,a,r){var l,s,c;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(c=e*o+t*i)&&(o-=e*c,i-=t*c),(s=Math.sqrt(o*o+i*i))&&(o/=s,i/=s,c/=s),e*i<t*o&&(e=-e,t=-t,c=-c,l=-l),{translateX:a,translateY:r,rotate:Math.atan2(t,e)*qc,skewX:Math.atan(c)*qc,scaleX:l,scaleY:s}}var Ti;function Ug(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?hr:Xc(t.a,t.b,t.c,t.d,t.e,t.f)}function Hg(e){return e==null||(Ti||(Ti=document.createElementNS("http://www.w3.org/2000/svg","g")),Ti.setAttribute("transform",e),!(e=Ti.transform.baseVal.consolidate()))?hr:(e=e.matrix,Xc(e.a,e.b,e.c,e.d,e.e,e.f))}function Jc(e,t,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,p,f,y){if(d!==m||u!==p){var b=f.push("translate(",null,t,null,o);y.push({i:b-4,x:xt(d,m)},{i:b-2,x:xt(u,p)})}else(m||p)&&f.push("translate("+m+t+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:xt(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:xt(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,p,f,y){if(d!==m||u!==p){var b=f.push(a(f)+"scale(",null,",",null,")");y.push({i:b-4,x:xt(d,m)},{i:b-2,x:xt(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 y=-1,b=p.length,k;++y<b;)m[(k=p[y]).i]=k.x(f);return m.join("")}}}var Fg=Jc(Ug,"px, ","px)","deg)"),Gg=Jc(Hg,", ",")",")"),jg=1e-12;function Zc(e){return((e=Math.exp(e))+1/e)/2}function Kg(e){return((e=Math.exp(e))-1/e)/2}function Yg(e){return((e=Math.exp(2*e))-1)/(e+1)}const Vi=(function e(t,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,y=m-c,b=f*f+y*y,k,g;if(b<jg)g=Math.log(p/d)/t,k=function(q){return[s+q*f,c+q*y,d*Math.exp(t*q*g)]};else{var w=Math.sqrt(b),h=(p*p-d*d+i*b)/(2*d*o*w),E=(p*p-d*d-i*b)/(2*p*o*w),X=Math.log(Math.sqrt(h*h+1)-h),z=Math.log(Math.sqrt(E*E+1)-E);g=(z-X)/t,k=function(q){var D=q*g,$=Zc(X),B=d/(o*w)*($*Yg(t*D+X)-Kg(X));return[s+B*f,c+B*y,d*$/Zc(t*D+X)]}}return k.duration=g*1e3*t/Math.SQRT2,k}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 Un=0,wo=0,No=0,Qc=1e3,Mi,vo,Bi=0,un=0,Di=0,xo=typeof performance=="object"&&performance.now?performance:Date,ed=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function yr(){return un||(ed(Wg),un=xo.now()+Di)}function Wg(){un=0}function Oi(){this._call=this._time=this._next=null}Oi.prototype=td.prototype={constructor:Oi,restart:function(e,t,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?yr():+o)+(t==null?0:+t),!this._next&&vo!==this&&(vo?vo._next=this:Mi=this,vo=this),this._call=e,this._time=o,gr()},stop:function(){this._call&&(this._call=null,this._time=1/0,gr())}};function td(e,t,o){var i=new Oi;return i.restart(e,t,o),i}function qg(){yr(),++Un;for(var e=Mi,t;e;)(t=un-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Un}function nd(){un=(Bi=xo.now())+Di,Un=wo=0;try{qg()}finally{Un=0,Jg(),un=0}}function Xg(){var e=xo.now(),t=e-Bi;t>Qc&&(Di-=t,Bi=e)}function Jg(){for(var e,t=Mi,o,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(o=t._next,t._next=null,t=e?e._next=o:Mi=o);vo=e,gr(i)}function gr(e){if(!Un){wo&&(wo=clearTimeout(wo));var t=e-un;t>24?(e<1/0&&(wo=setTimeout(nd,e-xo.now()-Di)),No&&(No=clearInterval(No))):(No||(Bi=xo.now(),No=setInterval(Xg,Qc)),Un=1,ed(nd))}}function od(e,t,o){var i=new Oi;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,o),i}var Zg=wi("start","end","cancel","interrupt"),Qg=[],id=0,ad=1,br=2,Pi=3,rd=4,_r=5,Li=6;function zi(e,t,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;eb(e,o,{name:t,index:i,group:a,on:Zg,tween:Qg,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:id})}function kr(e,t){var o=gt(e,t);if(o.state>id)throw new Error("too late; already scheduled");return o}function Ct(e,t){var o=gt(e,t);if(o.state>Pi)throw new Error("too late; already running");return o}function gt(e,t){var o=e.__transition;if(!o||!(o=o[t]))throw new Error("transition not found");return o}function eb(e,t,o){var i=e.__transition,a;i[t]=o,o.timer=td(r,0,o.time);function r(d){o.state=ad,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!==ad)return c();for(u in i)if(f=i[u],f.name===o.name){if(f.state===Pi)return od(l);f.state===rd?(f.state=Li,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=Li,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(od(function(){o.state===Pi&&(o.state=rd,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=br,o.on.call("start",e,e.__data__,o.index,o.group),o.state===br){for(o.state=Pi,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=_r,1),m=-1,p=a.length;++m<p;)a[m].call(e,u);o.state===_r&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=Li,o.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function Ui(e,t){var o=e.__transition,i,a,r=!0,l;if(o){t=t==null?null:t+"";for(l in o){if((i=o[l]).name!==t){r=!1;continue}a=i.state>br&&i.state<_r,i.state=Li,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function tb(e){return this.each(function(){Ui(this,e)})}function nb(e,t){var o,i;return function(){var a=Ct(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===t){i=i.slice(),i.splice(l,1);break}}a.tween=i}}function ob(e,t,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=Ct(this,e),l=r.tween;if(l!==i){a=(i=l).slice();for(var s={name:t,value:o},c=0,d=a.length;c<d;++c)if(a[c].name===t){a[c]=s;break}c===d&&a.push(s)}r.tween=a}}function ib(e,t){var o=this._id;if(e+="",arguments.length<2){for(var i=gt(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((t==null?nb:ob)(o,e,t))}function Er(e,t,o){var i=e._id;return e.each(function(){var a=Ct(this,i);(a.value||(a.value={}))[t]=o.apply(this,arguments)}),function(a){return gt(a,i).value[t]}}function ld(e,t){var o;return(typeof t=="number"?xt:t instanceof sn?Ai:(o=sn(t))?(t=o,Ai):Wc)(e,t)}function ab(e){return function(){this.removeAttribute(e)}}function rb(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lb(e,t,o){var i,a=o+"",r;return function(){var l=this.getAttribute(e);return l===a?null:l===i?r:r=t(i=l,o)}}function sb(e,t,o){var i,a=o+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===i?r:r=t(i=l,o)}}function cb(e,t,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=t(i=l,s)))}}function db(e,t,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=t(i=l,s)))}}function ub(e,t){var o=vi(e),i=o==="transform"?Gg:ld;return this.attrTween(e,typeof t=="function"?(o.local?db:cb)(o,i,Er(this,"attr."+e,t)):t==null?(o.local?rb:ab)(o):(o.local?sb:lb)(o,i,t))}function mb(e,t){return function(o){this.setAttribute(e,t.call(this,o))}}function fb(e,t){return function(o){this.setAttributeNS(e.space,e.local,t.call(this,o))}}function pb(e,t){var o,i;function a(){var r=t.apply(this,arguments);return r!==i&&(o=(i=r)&&fb(e,r)),o}return a._value=t,a}function hb(e,t){var o,i;function a(){var r=t.apply(this,arguments);return r!==i&&(o=(i=r)&&mb(e,r)),o}return a._value=t,a}function yb(e,t){var o="attr."+e;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;var i=vi(e);return this.tween(o,(i.local?pb:hb)(i,t))}function gb(e,t){return function(){kr(this,e).delay=+t.apply(this,arguments)}}function bb(e,t){return t=+t,function(){kr(this,e).delay=t}}function _b(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?gb:bb)(t,e)):gt(this.node(),t).delay}function kb(e,t){return function(){Ct(this,e).duration=+t.apply(this,arguments)}}function Eb(e,t){return t=+t,function(){Ct(this,e).duration=t}}function wb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kb:Eb)(t,e)):gt(this.node(),t).duration}function Nb(e,t){if(typeof t!="function")throw new Error;return function(){Ct(this,e).ease=t}}function vb(e){var t=this._id;return arguments.length?this.each(Nb(t,e)):gt(this.node(),t).ease}function xb(e,t){return function(){var o=t.apply(this,arguments);if(typeof o!="function")throw new Error;Ct(this,e).ease=o}}function Cb(e){if(typeof e!="function")throw new Error;return this.each(xb(this._id,e))}function Ib(e){typeof e!="function"&&(e=xc(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 Bt(i,this._parents,this._name,this._id)}function Sb(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,o=e._groups,i=t.length,a=o.length,r=Math.min(i,a),l=new Array(i),s=0;s<r;++s)for(var c=t[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]=t[s];return new Bt(l,this._parents,this._name,this._id)}function $b(e){return(e+"").trim().split(/^|\s+/).every(function(t){var o=t.indexOf(".");return o>=0&&(t=t.slice(0,o)),!t||t==="start"})}function Rb(e,t,o){var i,a,r=$b(t)?kr:Ct;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(t,o),l.on=a}}function Ab(e,t){var o=this._id;return arguments.length<2?gt(this.node(),o).on.on(e):this.each(Rb(o,e,t))}function Tb(e){return function(){var t=this.parentNode;for(var o in this.__transition)if(+o!==e)return;t&&t.removeChild(this)}}function Vb(){return this.on("end.remove",Tb(this._id))}function Mb(e){var t=this._name,o=this._id;typeof e!="function"&&(e=ar(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,zi(d[p],t,o,p,d,gt(u,o)));return new Bt(r,this._parents,t,o)}function Bb(e){var t=this._name,o=this._id;typeof e!="function"&&(e=vc(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,y=gt(u,o),b=0,k=p.length;b<k;++b)(f=p[b])&&zi(f,t,o,b,p,y);r.push(p),l.push(u)}return new Bt(r,l,t,o)}var Db=yo.prototype.constructor;function Ob(){return new Db(this._groups,this._parents)}function Pb(e,t){var o,i,a;return function(){var r=Pn(this,e),l=(this.style.removeProperty(e),Pn(this,e));return r===l?null:r===o&&l===i?a:a=t(o=r,i=l)}}function sd(e){return function(){this.style.removeProperty(e)}}function Lb(e,t,o){var i,a=o+"",r;return function(){var l=Pn(this,e);return l===a?null:l===i?r:r=t(i=l,o)}}function zb(e,t,o){var i,a,r;return function(){var l=Pn(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Pn(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=t(i=l,s))}}function Ub(e,t){var o,i,a,r="style."+t,l="end."+r,s;return function(){var c=Ct(this,e),d=c.on,u=c.value[r]==null?s||(s=sd(t)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function Hb(e,t,o){var i=(e+="")=="transform"?Fg:ld;return t==null?this.styleTween(e,Pb(e,i)).on("end.style."+e,sd(e)):typeof t=="function"?this.styleTween(e,zb(e,i,Er(this,"style."+e,t))).each(Ub(this._id,e)):this.styleTween(e,Lb(e,i,t),o).on("end.style."+e,null)}function Fb(e,t,o){return function(i){this.style.setProperty(e,t.call(this,i),o)}}function Gb(e,t,o){var i,a;function r(){var l=t.apply(this,arguments);return l!==a&&(i=(a=l)&&Fb(e,l,o)),i}return r._value=t,r}function jb(e,t,o){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,Gb(e,t,o??""))}function Kb(e){return function(){this.textContent=e}}function Yb(e){return function(){var t=e(this);this.textContent=t??""}}function Wb(e){return this.tween("text",typeof e=="function"?Yb(Er(this,"text",e)):Kb(e==null?"":e+""))}function qb(e){return function(t){this.textContent=e.call(this,t)}}function Xb(e){var t,o;function i(){var a=e.apply(this,arguments);return a!==o&&(t=(o=a)&&qb(a)),t}return i._value=e,i}function Jb(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Xb(e))}function Zb(){for(var e=this._name,t=this._id,o=cd(),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=gt(c,t);zi(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Bt(i,this._parents,e,o)}function Qb(){var e,t,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=Ct(this,i),u=d.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),d.on=t}),a===0&&r()})}var e_=0;function Bt(e,t,o,i){this._groups=e,this._parents=t,this._name=o,this._id=i}function cd(){return++e_}var Dt=yo.prototype;Bt.prototype={constructor:Bt,select:Mb,selectAll:Bb,selectChild:Dt.selectChild,selectChildren:Dt.selectChildren,filter:Ib,merge:Sb,selection:Ob,transition:Zb,call:Dt.call,nodes:Dt.nodes,node:Dt.node,size:Dt.size,empty:Dt.empty,each:Dt.each,on:Ab,attr:ub,attrTween:yb,style:Hb,styleTween:jb,text:Wb,textTween:Jb,remove:Vb,tween:ib,delay:_b,duration:wb,ease:vb,easeVarying:Cb,end:Qb,[Symbol.iterator]:Dt[Symbol.iterator]};function t_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var n_={time:null,delay:0,duration:250,ease:t_};function o_(e,t){for(var o;!(o=e.__transition)||!(o=o[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return o}function i_(e){var t,o;e instanceof Bt?(t=e._id,e=e._name):(t=cd(),(o=n_).time=yr(),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])&&zi(c,e,t,d,l,o||o_(c,t));return new Bt(i,this._parents,e,t)}yo.prototype.interrupt=tb,yo.prototype.transition=i_;const Hi=e=>()=>e;function a_(e,{sourceEvent:t,target:o,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function Ot(e,t,o){this.k=e,this.x=t,this.y=o}Ot.prototype={constructor:Ot,scale:function(e){return e===1?this:new Ot(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ot(this.k,this.x+this.k*e,this.y+this.k*t)},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 Hn=new Ot(1,0,0);Ot.prototype;function wr(e){e.stopImmediatePropagation()}function Co(e){e.preventDefault(),e.stopImmediatePropagation()}function r_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function l_(){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 dd(){return this.__zoom||Hn}function s_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function c_(){return navigator.maxTouchPoints||"ontouchstart"in this}function d_(e,t,o){var i=e.invertX(t[0][0])-o[0][0],a=e.invertX(t[1][0])-o[1][0],r=e.invertY(t[0][1])-o[0][1],l=e.invertY(t[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 u_(){var e=r_,t=l_,o=d_,i=s_,a=c_,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Vi,d=wi("start","zoom","end"),u,m,p,f=500,y=150,b=0,k=10;function g(_){_.property("__zoom",dd).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",B).filter(a).on("touchstart.zoom",Q).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(_,W,R,J){var ee=_.selection?_.selection():_;ee.property("__zoom",dd),_!==ee?X(_,W,R,J):ee.interrupt().each(function(){z(this,arguments).event(J).start().zoom(null,typeof W=="function"?W.apply(this,arguments):W).end()})},g.scaleBy=function(_,W,R,J){g.scaleTo(_,function(){var ee=this.__zoom.k,ae=typeof W=="function"?W.apply(this,arguments):W;return ee*ae},R,J)},g.scaleTo=function(_,W,R,J){g.transform(_,function(){var ee=t.apply(this,arguments),ae=this.__zoom,I=R==null?E(ee):typeof R=="function"?R.apply(this,arguments):R,K=ae.invert(I),oe=typeof W=="function"?W.apply(this,arguments):W;return o(h(w(ae,oe),I,K),ee,l)},R,J)},g.translateBy=function(_,W,R,J){g.transform(_,function(){return o(this.__zoom.translate(typeof W=="function"?W.apply(this,arguments):W,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),l)},null,J)},g.translateTo=function(_,W,R,J,ee){g.transform(_,function(){var ae=t.apply(this,arguments),I=this.__zoom,K=J==null?E(ae):typeof J=="function"?J.apply(this,arguments):J;return o(Hn.translate(K[0],K[1]).scale(I.k).translate(typeof W=="function"?-W.apply(this,arguments):-W,typeof R=="function"?-R.apply(this,arguments):-R),ae,l)},J,ee)};function w(_,W){return W=Math.max(r[0],Math.min(r[1],W)),W===_.k?_:new Ot(W,_.x,_.y)}function h(_,W,R){var J=W[0]-R[0]*_.k,ee=W[1]-R[1]*_.k;return J===_.x&&ee===_.y?_:new Ot(_.k,J,ee)}function E(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function X(_,W,R,J){_.on("start.zoom",function(){z(this,arguments).event(J).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(J).end()}).tween("zoom",function(){var ee=this,ae=arguments,I=z(ee,ae).event(J),K=t.apply(ee,ae),oe=R==null?E(K):typeof R=="function"?R.apply(ee,ae):R,pe=Math.max(K[1][0]-K[0][0],K[1][1]-K[0][1]),fe=ee.__zoom,ce=typeof W=="function"?W.apply(ee,ae):W,ue=c(fe.invert(oe).concat(pe/fe.k),ce.invert(oe).concat(pe/ce.k));return function(he){if(he===1)he=ce;else{var we=ue(he),Se=pe/we[2];he=new Ot(Se,oe[0]-we[0]*Se,oe[1]-we[1]*Se)}I.zoom(null,he)}})}function z(_,W,R){return!R&&_.__zooming||new q(_,W)}function q(_,W){this.that=_,this.args=W,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,W),this.taps=0}q.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,W){return this.mouse&&_!=="mouse"&&(this.mouse[1]=W.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=W.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=W.invert(this.touch1[0])),this.that.__zoom=W,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var W=ht(this.that).datum();d.call(_,this.that,new a_(_,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:d}),W)}};function D(_,...W){if(!e.apply(this,arguments))return;var R=z(this,W).event(_),J=this.__zoom,ee=Math.max(r[0],Math.min(r[1],J.k*Math.pow(2,i.apply(this,arguments)))),ae=Nt(_);if(R.wheel)(R.mouse[0][0]!==ae[0]||R.mouse[0][1]!==ae[1])&&(R.mouse[1]=J.invert(R.mouse[0]=ae)),clearTimeout(R.wheel);else{if(J.k===ee)return;R.mouse=[ae,J.invert(ae)],Ui(this),R.start()}Co(_),R.wheel=setTimeout(I,y),R.zoom("mouse",o(h(w(J,ee),R.mouse[0],R.mouse[1]),R.extent,l));function I(){R.wheel=null,R.end()}}function $(_,...W){if(p||!e.apply(this,arguments))return;var R=_.currentTarget,J=z(this,W,!0).event(_),ee=ht(_.view).on("mousemove.zoom",oe,!0).on("mouseup.zoom",pe,!0),ae=Nt(_,R),I=_.clientX,K=_.clientY;Bc(_.view),wr(_),J.mouse=[ae,this.__zoom.invert(ae)],Ui(this),J.start();function oe(fe){if(Co(fe),!J.moved){var ce=fe.clientX-I,ue=fe.clientY-K;J.moved=ce*ce+ue*ue>b}J.event(fe).zoom("mouse",o(h(J.that.__zoom,J.mouse[0]=Nt(fe,R),J.mouse[1]),J.extent,l))}function pe(fe){ee.on("mousemove.zoom mouseup.zoom",null),Dc(fe.view,J.moved),Co(fe),J.event(fe).end()}}function B(_,...W){if(e.apply(this,arguments)){var R=this.__zoom,J=Nt(_.changedTouches?_.changedTouches[0]:_,this),ee=R.invert(J),ae=R.k*(_.shiftKey?.5:2),I=o(h(w(R,ae),J,ee),t.apply(this,W),l);Co(_),s>0?ht(this).transition().duration(s).call(X,I,J,_):ht(this).call(g.transform,I,J,_)}}function Q(_,...W){if(e.apply(this,arguments)){var R=_.touches,J=R.length,ee=z(this,W,_.changedTouches.length===J).event(_),ae,I,K,oe;for(wr(_),I=0;I<J;++I)K=R[I],oe=Nt(K,this),oe=[oe,this.__zoom.invert(oe),K.identifier],ee.touch0?!ee.touch1&&ee.touch0[2]!==oe[2]&&(ee.touch1=oe,ee.taps=0):(ee.touch0=oe,ae=!0,ee.taps=1+!!u);u&&(u=clearTimeout(u)),ae&&(ee.taps<2&&(m=oe[0],u=setTimeout(function(){u=null},f)),Ui(this),ee.start())}}function V(_,...W){if(this.__zooming){var R=z(this,W).event(_),J=_.changedTouches,ee=J.length,ae,I,K,oe;for(Co(_),ae=0;ae<ee;++ae)I=J[ae],K=Nt(I,this),R.touch0&&R.touch0[2]===I.identifier?R.touch0[0]=K:R.touch1&&R.touch1[2]===I.identifier&&(R.touch1[0]=K);if(I=R.that.__zoom,R.touch1){var pe=R.touch0[0],fe=R.touch0[1],ce=R.touch1[0],ue=R.touch1[1],he=(he=ce[0]-pe[0])*he+(he=ce[1]-pe[1])*he,we=(we=ue[0]-fe[0])*we+(we=ue[1]-fe[1])*we;I=w(I,Math.sqrt(he/we)),K=[(pe[0]+ce[0])/2,(pe[1]+ce[1])/2],oe=[(fe[0]+ue[0])/2,(fe[1]+ue[1])/2]}else if(R.touch0)K=R.touch0[0],oe=R.touch0[1];else return;R.zoom("touch",o(h(I,K,oe),R.extent,l))}}function re(_,...W){if(this.__zooming){var R=z(this,W).event(_),J=_.changedTouches,ee=J.length,ae,I;for(wr(_),p&&clearTimeout(p),p=setTimeout(function(){p=null},f),ae=0;ae<ee;++ae)I=J[ae],R.touch0&&R.touch0[2]===I.identifier?delete R.touch0:R.touch1&&R.touch1[2]===I.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(I=Nt(I,this),Math.hypot(m[0]-I[0],m[1]-I[1])<k)){var K=ht(this).on("dblclick.zoom");K&&K.apply(this,arguments)}}}return g.wheelDelta=function(_){return arguments.length?(i=typeof _=="function"?_:Hi(+_),g):i},g.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Hi(!!_),g):e},g.touchable=function(_){return arguments.length?(a=typeof _=="function"?_:Hi(!!_),g):a},g.extent=function(_){return arguments.length?(t=typeof _=="function"?_:Hi([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),g):t},g.scaleExtent=function(_){return arguments.length?(r[0]=+_[0],r[1]=+_[1],g):[r[0],r[1]]},g.translateExtent=function(_){return arguments.length?(l[0][0]=+_[0][0],l[1][0]=+_[1][0],l[0][1]=+_[0][1],l[1][1]=+_[1][1],g):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},g.constrain=function(_){return arguments.length?(o=_,g):o},g.duration=function(_){return arguments.length?(s=+_,g):s},g.interpolate=function(_){return arguments.length?(c=_,g):c},g.on=function(){var _=d.on.apply(d,arguments);return _===d?g:_},g.clickDistance=function(_){return arguments.length?(b=(_=+_)*_,g):Math.sqrt(b)},g.tapDistance=function(_){return arguments.length?(k=+_,g):k},g}var Ce=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(Ce||{}),Nr=(e=>(e.Partial="partial",e.Full="full",e))(Nr||{}),mn=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(mn||{}),Pt=(e=>(e.Strict="strict",e.Loose="loose",e))(Pt||{}),vr=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(vr||{}),Io=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(Io||{}),ud=(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))(ud||{});const m_=["INPUT","SELECT","TEXTAREA"],f_=typeof document<"u"?document:null;function xr(e){var t,o;const i=((o=(t=e.composedPath)==null?void 0:t.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 m_.includes(i==null?void 0:i.nodeName)||a||!!r}function p_(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function md(e,t,o,i){const a=t.replace("+",`
|
|
13
|
+
`}}const si="com.example",Pf="command.domain";function co(e,t,o={}){if(e.packageName)return e.packageName;const i=o.packageConfig;if(i!=null&&i.basePackage){const a=t.groups.find(c=>{var d;return(d=c.memberEntityRefs)==null?void 0:d.includes(e.modelId)}),r=a!=null&&a.packageName?`.${a.packageName}`:"",l=i.layerSuffix??Pf,s=l?`.${l}`:"";return`${i.basePackage}${r}${s}`}return t.packageName||""}function Me(){return crypto.randomUUID()}const Lf="CustomMoneyType",zf="Money";function Uf(e){return!(e.type!==Lf||e.attrType!=="NORMAL"||e.identifier||e.dbAttrs.length>1)}function Hf(e){const t=e.dbAttrs[0]??{modelId:Me(),physicalName:"",dataType:""},o={modelId:Me(),physicalName:"",dataType:""},{customType:i,...a}=e;return{...a,type:zf,attrType:"EMBED_PREDEF",dbAttrs:[t,o]}}function Ff(e){let t=!1;const o=e.entities.map(i=>{let a=!1;const r=i.attributes.map(l=>Uf(l)?(a=!0,t=!0,Hf(l)):l);return a?{...i,attributes:r}:i});return t?{...e,entities:o}:e}function Kl(e){return!!e.derivedFrom&&e.dbAttrs.length>0}function Yl(e){for(const t of e){const o=[...t.attributes].sort((s,c)=>s.order-c.order),i=o.filter(Kl);if(!i.length)continue;const a=o.filter(s=>!Kl(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),t.attributes=l}}function Vn(e){return JSON.parse(JSON.stringify(e))}function Wl(e,t,o){var W;const i=o.idFactory??Me,a=o.offset??{x:0,y:0},{logical:r,layout:l}=e,s=new Set(t);if(o.includeRelated){const M=new Set(t);for(const $ of r.associations){const D=M.has($.end1.entityRef),J=M.has($.end2.entityRef);D!==J&&s.add(D?$.end2.entityRef:$.end1.entityRef)}}const c=r.entities.filter(M=>s.has(M.modelId)),d=new Set(c.map(M=>M.modelId)),u=r.associations.filter(M=>d.has(M.end1.entityRef)&&d.has(M.end2.entityRef)),m=new Set(u.map(M=>M.modelId)),p=new Map,f=M=>{let $=p.get(M);return $||($=i(),p.set(M,$)),$};for(const M of c){f(M.modelId);for(const $ of M.attributes){f($.modelId);for(const D of $.dbAttrs)f(D.modelId)}for(const $ of M.indexes??[])f($.modelId);for(const $ of M.operations??[])f($.modelId)}for(const M of u)f(M.modelId);const y=M=>p.get(M),b=c.map(M=>{const $=Vn(M);$.modelId=y(M.modelId),$.attributes=$.attributes.map(D=>Gf(D,y,m,d));for(const D of $.indexes??[])D.modelId=y(D.modelId),D.columns=D.columns.map(J=>oo(J.columnRef)?J:{...J,columnRef:y(J.columnRef)}).filter(J=>J.columnRef!==void 0);for(const D of $.operations??[])D.modelId=y(D.modelId);return $});Yl(b);const k=u.map(M=>{const $=Vn(M);return $.modelId=y(M.modelId),$.end1=ql($.end1,y),$.end2=ql($.end2,y),$}),g=[];for(const M of r.groups){const $=M.memberEntityRefs.filter(J=>d.has(J));if($.length===0)continue;const D=Vn(M);D.modelId=f(M.modelId),D.memberEntityRefs=$.map(J=>y(J)),g.push(D)}const N=new Set(o.existing.entities.map(M=>M.name)),h=new Set(o.existing.entities.map(M=>{var $;return($=M.table)==null?void 0:$.physicalName}).filter(M=>!!M));for(const M of b)N.has(M.name)&&(M.name=`${M.name}_imported`),(W=M.table)!=null&&W.physicalName&&h.has(M.table.physicalName)&&(M.table.physicalName=`${M.table.physicalName}_imported`);const w=[];for(const M of l.entityLayouts){const $=y(M.entityRef);if(!$)continue;const D=Vn(M);D.entityRef=$,D.geo={...D.geo,location:Wa(D.geo.location,a)},D.attributeStyles&&(D.attributeStyles=Xl(D.attributeStyles,y)),D.operationStyles&&(D.operationStyles=Xl(D.operationStyles,y)),w.push(D)}const q=[];for(const M of l.associationLayouts){const $=y(M.associationRef);if(!$)continue;const D=Vn(M);D.associationRef=$,D.sourceColumnRef=M.sourceColumnRef?y(M.sourceColumnRef):void 0,D.targetColumnRef=M.targetColumnRef?y(M.targetColumnRef):void 0,D.waypoints=D.waypoints.map(J=>Wa(J,a)),q.push(D)}const P=[];for(const M of l.groupLayouts){const $=y(M.groupRef);if(!$)continue;const D=Vn(M);D.groupRef=$,D.geo={...D.geo,location:Wa(D.geo.location,a)},delete D.memberNoteRefs,P.push(D)}return{logical:{entities:b,associations:k,groups:g},layout:{entityLayouts:w,associationLayouts:q,groupLayouts:P},idMap:p}}function Wa(e,t){return{x:e.x+t.x,y:e.y+t.y}}function Gf(e,t,o,i){e.modelId=t(e.modelId);for(const a of e.dbAttrs)if(a.modelId=t(a.modelId),a.sharedColumnRef!==void 0){const r=t(a.sharedColumnRef);r?a.sharedColumnRef=r:delete a.sharedColumnRef}return e.derivedFrom&&(o.has(e.derivedFrom.associationRef)?e.derivedFrom={associationRef:t(e.derivedFrom.associationRef),sourceAttributeRef:t(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:t(e.embedded.associationRef)??e.embedded.associationRef,embeddableRef:t(e.embedded.embeddableRef)}:(delete e.embedded,e.attrType.startsWith("EMBED")&&(e.attrType="NORMAL"))),e}function ql(e,t){return{...e,entityRef:t(e.entityRef),attributeRef:e.attributeRef?t(e.attributeRef):void 0}}function Xl(e,t){const o={};for(const[i,a]of Object.entries(e)){const r=t(i);r&&(o[r]=a)}return o}function qa(e){if(!("rev"in e))return e;const{rev:t,...o}=e;return o}function Mn(e,t){if(e===t||e==null&&t==null)return!0;if(e==null||t==null)return!1;if(Array.isArray(e)||Array.isArray(t))return!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length?!1:e.every((o,i)=>Mn(o,t[i]));if(typeof e=="object"&&typeof t=="object"){const o=new Set([...Object.keys(e),...Object.keys(t)]);for(const i of o)if(!Mn(e[i],t[i]))return!1;return!0}return!1}function nn(e,t,o){const i={},a=new Set([...Object.keys(e),...Object.keys(t)]);for(const r of a)o.has(r)||Mn(e[r],t[r])||(i[r]=t[r]===void 0?null:t[r]);return Object.keys(i).length?i:null}function on(e,t,o){const i=new Map(e.map(d=>[o(d),d])),a=new Map(t.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 jf(e,t){const o=new Set(e),i=new Set(t),a=t.filter(l=>!o.has(l)).sort(),r=e.filter(l=>!i.has(l)).sort();return{added:a,removed:r}}const Kf=new Set(["attributes","operations","indexes","rev"]),Yf=new Set(["end1","end2","rev"]),Wf=new Set(["memberEntityRefs","rev"]),Jl=new Set(["modelId"]),qf=new Set(["modelId","columns"]),Xf=new Set([]);function Jf(e,t,o,i){const a=on(t.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=nn(s,c,Jl);d&&i.push({kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:s.modelId,patch:d})}const r=on(t.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=nn(s,c,Jl);d&&i.push({kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:s.modelId,patch:d})}const l=on(t.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(!Mn(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=nn(s,c,qf);d&&i.push({kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:s.modelId,patch:d})}}function Zf(e,t,o){const i=on(e.entities??[],t.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:qa(l)});for(const{cur:l,tgt:s}of i.common){const c=nn(l,s,Kf);c&&o.push({kind:"entity.update",casUnit:"logical",containerRef:l.modelId,entityRef:l.modelId,patch:c}),Jf(l.modelId,l,s,o)}const a=on(e.associations??[],t.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:qa(l)});for(const{cur:l,tgt:s}of a.common){const c=nn(l,s,Yf);c&&o.push({kind:"association.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,patch:c});for(const d of["end1","end2"]){const u=nn(l[d]??{},s[d]??{},Xf);u&&o.push({kind:"associationEnd.update",casUnit:"logical",containerRef:l.modelId,associationRef:l.modelId,end:d,patch:u})}}const r=on(e.groups??[],t.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:qa(l)});for(const{cur:l,tgt:s}of r.common){const c=nn(l,s,Wf);c&&o.push({kind:"group.update",casUnit:"logical",containerRef:l.modelId,groupRef:l.modelId,patch:c});const d=jf(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 ci(e,t,o,i,a,r,l){const s=on(e,t,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)Mn(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 Qf(e,t,o){ci(e.entityLayouts??[],t.entityLayouts??[],i=>i.entityRef,"entityLayout.add","entityLayout.remove","entityRef",o),ci(e.associationLayouts??[],t.associationLayouts??[],i=>i.associationRef,"associationLayout.add","associationLayout.remove","associationRef",o),ci(e.groupLayouts??[],t.groupLayouts??[],i=>i.groupRef,"groupLayout.add","groupLayout.remove","groupRef",o),ci(e.notes??[],t.notes??[],i=>i.modelId,"note.add","note.remove","noteRef",o)}function ep(e,t){const o=[];return Zf(e.logical,t.logical,o),Qf(e.layout,t.layout,o),o}function tp(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 np={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 op{constructor(t){He(this,"out",[]);He(this,"last",new Map);this.fieldFilter=t}set(t,o,i){if(this.fieldFilter!=null&&o!==this.fieldFilter)return;const a=this.last.get(o);this.out.push({...uo(t),field:o,value:i,...this.last.has(o)?{oldValue:a}:{}}),this.last.set(o,i)}remove(t,o){if(o!=null){if(this.fieldFilter!=null&&o!==this.fieldFilter)return;this.out.push({...uo(t),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({...uo(t),field:a,value:void 0,removed:!0});continue}this.out.push({...uo(t),field:a,value:void 0,removed:!0,oldValue:this.last.get(a)}),this.last.delete(a)}}member(t,o,i){const a="memberEntityRefs";this.fieldFilter!=null&&a!==this.fieldFilter||this.out.push({...uo(t),field:a,value:o,...i?{removed:!0}:{}})}result(){return this.out}}function uo(e){const t={seq:e.seq};return e.ts!==void 0&&(t.ts=e.ts),e.origin!==void 0&&(t.origin=e.origin),e.author!==void 0&&(t.author=e.author),e.kind!==void 0&&(t.kind=e.kind),e.restoredFromSeq!==void 0&&(t.restoredFromSeq=e.restoredFromSeq),t}function Nt(e,t,o,i){if(o==null||typeof o!="object")return;const a=np[i];for(const[r,l]of Object.entries(o))a.has(r)||e.set(t,r,l)}function an(e,t,o){if(!(o==null||typeof o!="object"))for(const[i,a]of Object.entries(o))e.set(t,i,a)}function Xa(e,t){if(Array.isArray(e))return e.find(o=>o.modelId===t)}function Gt(e,t){var r,l,s,c,d,u,m,p;const o=tp(t),i=new op(t.field),a=[...e].sort((f,y)=>f.seq-y.seq);for(const f of a)for(const y of f.ops)switch(o){case"entity":if(y.entityRef!==t.entityRef)break;y.kind==="entity.add"?Nt(i,f,y.value,"entity"):y.kind==="entity.update"?an(i,f,y.patch):y.kind==="entity.remove"&&i.remove(f);break;case"attribute":if(y.entityRef!==t.entityRef)break;if(y.kind==="entity.add"){const b=Xa((r=y.value)==null?void 0:r.attributes,t.attributeRef);b&&Nt(i,f,b,"attribute")}else y.kind==="attribute.add"&&((l=y.value)==null?void 0:l.modelId)===t.attributeRef?Nt(i,f,y.value,"attribute"):y.kind==="attribute.update"&&y.attributeRef===t.attributeRef?an(i,f,y.patch):(y.kind==="attribute.remove"&&y.attributeRef===t.attributeRef||y.kind==="entity.remove")&&i.remove(f);break;case"operation":if(y.entityRef!==t.entityRef)break;if(y.kind==="entity.add"){const b=Xa((s=y.value)==null?void 0:s.operations,t.operationRef);b&&Nt(i,f,b,"operation")}else y.kind==="operation.add"&&((c=y.value)==null?void 0:c.modelId)===t.operationRef?Nt(i,f,y.value,"operation"):y.kind==="operation.update"&&y.operationRef===t.operationRef?an(i,f,y.patch):(y.kind==="operation.remove"&&y.operationRef===t.operationRef||y.kind==="entity.remove")&&i.remove(f);break;case"index":if(y.entityRef!==t.entityRef)break;if(y.kind==="entity.add"){const b=Xa((d=y.value)==null?void 0:d.indexes,t.indexRef);b&&Nt(i,f,b,"index")}else y.kind==="index.add"&&((u=y.value)==null?void 0:u.modelId)===t.indexRef?Nt(i,f,y.value,"index"):y.kind==="index.update"&&y.indexRef===t.indexRef?an(i,f,y.patch):(y.kind==="index.remove"&&y.indexRef===t.indexRef||y.kind==="entity.remove")&&i.remove(f);break;case"association":if(y.associationRef!==t.associationRef)break;y.kind==="association.add"?Nt(i,f,y.value,"association"):y.kind==="association.update"?an(i,f,y.patch):y.kind==="association.remove"&&i.remove(f);break;case"associationEnd":if(y.associationRef!==t.associationRef)break;if(y.kind==="association.add"){const b=(m=y.value)==null?void 0:m[t.end];Nt(i,f,b,"associationEnd")}else y.kind==="associationEnd.update"&&y.end===t.end?an(i,f,y.patch):y.kind==="association.remove"&&i.remove(f);break;case"group":if(y.groupRef!==t.groupRef)break;if(y.kind==="group.add"){Nt(i,f,y.value,"group");const b=(p=y.value)==null?void 0:p.memberEntityRefs;if(Array.isArray(b))for(const k of b)i.member(f,k,!1)}else y.kind==="group.update"?an(i,f,y.patch):y.kind==="group.remove"?i.remove(f):y.kind==="group.addMember"&&y.entityRef!=null?i.member(f,y.entityRef,!1):y.kind==="group.removeMember"&&y.entityRef!=null&&i.member(f,y.entityRef,!0);break}return i.result()}function ip(e,t){const o=e;return o.entityRef===t||o.containerRef===t}function Bn(e,t){if(Array.isArray(e))for(const o of e)typeof o.modelId=="string"&&t.add(o.modelId)}function ap(e,t){const o=new Set,i=new Set,a=new Set;for(const r of e)for(const l of r.ops){const s=l;if(l.kind==="entity.add"&&s.entityRef===t){const c=s.value;Bn(c==null?void 0:c.attributes,o),Bn(c==null?void 0:c.operations,i),Bn(c==null?void 0:c.indexes,a);continue}s.containerRef!==t&&s.entityRef!==t||(l.kind==="attribute.add"?Bn([s.value],o):l.kind==="attribute.update"||l.kind==="attribute.remove"?typeof s.attributeRef=="string"&&o.add(s.attributeRef):l.kind==="operation.add"?Bn([s.value],i):l.kind==="operation.update"||l.kind==="operation.remove"?typeof s.operationRef=="string"&&i.add(s.operationRef):l.kind==="index.add"?Bn([s.value],a):(l.kind==="index.update"||l.kind==="index.remove")&&typeof s.indexRef=="string"&&a.add(s.indexRef))}return{attributes:o,operations:i,indexes:a}}function di(e,t){return e.map(o=>({...o,subject:t}))}function Zl(e,t){const o=e.filter(s=>s.ops.some(c=>ip(c,t))),{attributes:i,operations:a,indexes:r}=ap(o,t),l=[...di(Gt(o,{entityRef:t}),{kind:"entity",ref:t})];for(const s of i)l.push(...di(Gt(o,{entityRef:t,attributeRef:s}),{kind:"attribute",ref:s}));for(const s of a)l.push(...di(Gt(o,{entityRef:t,operationRef:s}),{kind:"operation",ref:s}));for(const s of r)l.push(...di(Gt(o,{entityRef:t,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 Ql(e){return`${e.kind}:${e.ref}:${e.end??""}`}function rp(e){var i,a,r;const t=new Set,o=(l,s)=>{typeof s=="string"&&t.add(`${l}:${s}:`)};for(const l of e)for(const s of l.ops){const c=s;switch(s.kind){case"entity.add":{o("entity",c.entityRef);const d=c.value;for(const u of Array.isArray(d==null?void 0:d.attributes)?d.attributes:[])o("attribute",u.modelId);for(const u of Array.isArray(d==null?void 0:d.operations)?d.operations:[])o("operation",u.modelId);for(const u of Array.isArray(d==null?void 0:d.indexes)?d.indexes:[])o("index",u.modelId);break}case"attribute.add":o("attribute",(i=c.value)==null?void 0:i.modelId);break;case"operation.add":o("operation",(a=c.value)==null?void 0:a.modelId);break;case"index.add":o("index",(r=c.value)==null?void 0:r.modelId);break;case"association.add":o("association",c.associationRef);break;case"group.add":o("group",c.groupRef);break}}return t}function lp(e){const t=new Set,o=new Set,i=new Set;for(const a of e)for(const r of a.ops){const l=r,s=r.kind;if(s.startsWith("entity."))typeof l.entityRef=="string"&&t.add(l.entityRef);else if(s.startsWith("attribute.")||s.startsWith("operation.")||s.startsWith("index.")){const c=l.containerRef??l.entityRef;typeof c=="string"&&t.add(c)}else s.startsWith("associationEnd.")||s.startsWith("association.")?typeof l.associationRef=="string"&&o.add(l.associationRef):s.startsWith("group.")&&typeof l.groupRef=="string"&&i.add(l.groupRef)}return{entities:t,associations:o,groups:i}}function sp(e){const{entities:t,associations:o,groups:i}=lp(e),a=[];for(const r of t)for(const l of Zl(e,r))a.push({...l,subject:{...l.subject,entityRef:r}});for(const r of o){for(const l of Gt(e,{associationRef:r}))a.push({...l,subject:{kind:"association",ref:r}});for(const l of["end1","end2"])for(const s of Gt(e,{associationRef:r,end:l}))a.push({...s,subject:{kind:"associationEnd",ref:r,end:l}})}for(const r of i)for(const l of Gt(e,{groupRef:r}))a.push({...l,subject:{kind:"group",ref:r}});return a}function es(e){const t=sp(e),o=rp(e),i=new Map;for(const l of t){const s=Ql(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 t){let s=a.get(l.seq);s||(s={meta:l,subjects:new Map},a.set(l.seq,s));const c=Ql(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)}class Ja{constructor(t){He(this,"undoStack",[]);He(this,"redoStack",[]);He(this,"savePoint",null);He(this,"listeners",new Set);He(this,"commandListeners",new Set);He(this,"coalesceSealed",!1);this.state=t}execute(t){t.apply(this.state);const o=this.undoStack.at(-1),i=!this.coalesceSealed&&t.coalesceKey!=null&&!!o&&o.coalesceKey===t.coalesceKey;this.coalesceSealed=!1,i?(t.invert=o.invert,this.undoStack[this.undoStack.length-1]=t):this.undoStack.push(t),this.redoStack=[],this.emitCommand(t,"do",i),this.emit()}undo(){const t=this.undoStack.pop();t&&(t.invert(this.state),this.redoStack.push(t),this.emitCommand(t,"undo",!1),this.emit())}redo(){const t=this.redoStack.pop();t&&(t.apply(this.state),this.undoStack.push(t),this.emitCommand(t,"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.emit()}get isDirty(){return(this.undoStack.at(-1)??null)!==this.savePoint}onChange(t){return this.listeners.add(t),()=>this.listeners.delete(t)}onCommand(t){return this.commandListeners.add(t),()=>this.commandListeners.delete(t)}emit(){for(const t of this.listeners)t()}emitCommand(t,o,i){for(const a of this.commandListeners)a(t,o,i)}}function ts(e,t){return e.logical.entities.findIndex(o=>o.modelId===t)}function Ze(e,t){return e.layout.entityLayouts.findIndex(o=>o.entityRef===t)}function yt(e,t){return e.layout.associationLayouts.find(o=>o.associationRef===t)}function Fe(e,t){const o=e.logical.entities.find(i=>i.modelId===t);if(!o)throw new Error(`엔티티 없음: ${t}`);return o}function Vt(e,t,o){var i,a;return(a=(i=e.layout.notes.find(r=>r.modelId===t))==null?void 0:i.connections)==null?void 0:a.find(r=>r.targetRef===o)}function ui(e,t,o){return{label:`엔티티 추가: ${e.name}`,apply(i){i.logical.entities.push(e),i.layout.entityLayouts.push({entityRef:e.modelId,geo:t,...o})},invert(i){const a=ts(i,e.modelId);a>=0&&i.logical.entities.splice(a,1);const r=Ze(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:t,...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 ns(e){let t=null;const o=i=>i.end1.entityRef===e||i.end2.entityRef===e;return{label:"엔티티 삭제",apply(i){const a=ts(i,e);if(a<0)throw new Error(`엔티티 없음: ${e}`);const r=Ze(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})}),t={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(t){i.logical.entities.splice(t.entity.index,0,t.entity.item),t.entityLayout&&i.layout.entityLayouts.splice(t.entityLayout.index,0,t.entityLayout.item),[...t.assocs].sort((a,r)=>a.index-r.index).forEach(a=>i.logical.associations.splice(a.index,0,a.item)),[...t.assocLayouts].sort((a,r)=>a.index-r.index).forEach(a=>i.layout.associationLayouts.splice(a.index,0,a.item));for(const a of t.groupMemberships){const r=i.logical.groups.find(l=>l.modelId===a.groupId);r==null||r.memberEntityRefs.splice(a.index,0,e)}}},emitOps(){if(!t)return{forward:[],invert:[]};const i=[],a=[];for(const r of t.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 t.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 t.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 t.entityLayout&&(i.push({kind:"entityLayout.remove",casUnit:"layout",entityRef:e,incidental:!0}),a.push({kind:"entityLayout.add",casUnit:"layout",entityRef:e,value:t.entityLayout.item,incidental:!0})),i.push({kind:"entity.remove",casUnit:"logical",entityRef:e}),a.push({kind:"entity.add",casUnit:"logical",entityRef:e,value:t.entity.item}),{forward:i,invert:a.reverse()}}}}function os(e,t){const o={};return{label:"엔티티 수정",apply(i){const a=Fe(i,e);for(const r of Object.keys(t))o[r]=a[r];Object.assign(a,t)},invert(i){Object.assign(Fe(i,e),o)},emitOps(){return{forward:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:t}],invert:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:{...o}}]}}}}function is(e,t){let o="";return{label:`엔티티 이름 변경: ${t}`,apply(i){const a=Fe(i,e);o=a.name,a.name=t},invert(i){Fe(i,e).name=o},emitOps(){return{forward:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:{name:t}}],invert:[{kind:"entity.update",casUnit:"logical",containerRef:e,entityRef:e,patch:{name:o}}]}}}}function Dn(e,t){let o=null;return{label:"엔티티 이동",apply(i){const a=Ze(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a].geo;o={...r.location},r.location={...t}},invert(i){const a=Ze(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(t)],invert:[i(o)]}}}}function as(e,t){let o=null;return{label:"엔티티 크기 변경",apply(i){const a=Ze(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a].geo;o={...r.size},r.size={...t}},invert(i){const a=Ze(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(t)],invert:[i(o)]}}}}function mo(e,t){const o={...(e==null?void 0:e.properties)??{}};return t?o.swatch=t:delete o.swatch,Object.keys(o).length?{properties:o}:void 0}function rs(e,t){let o;return{label:"엔티티 색상 변경",apply(i){const a=Ze(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.style,r.style=mo(r.style,t)},invert(i){const a=Ze(i,e);a>=0&&(i.layout.entityLayouts[a].style=o)},emitOps(i){const a=Ze(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 ls(e,t){let o;return{label:t?"엔티티 접기":"엔티티 펼치기",apply(i){const a=Ze(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.collapsed,r.collapsed=t},invert(i){const a=Ze(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(t)],invert:[i(o)]}}}}function ss(e,t){let o;return{label:t?"엔티티 잠금":"엔티티 잠금 해제",apply(i){const a=Ze(i,e);if(a<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const r=i.layout.entityLayouts[a];o=r.locked,r.locked=t},invert(i){const a=Ze(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(t)],invert:[i(o)]}}}}function Za(e){let t=[];return{label:e?"모두 접기":"모두 펼치기",apply(o){t=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=t[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:t[l]}})}),{forward:i,invert:a}}}}function mi(e,t,o){let i;return{label:"속성 색상 변경",apply(a){const r=Ze(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.attributeStyles;const s={...l.attributeStyles},c=mo(s[t],o);c?s[t]=c:delete s[t],l.attributeStyles=Object.keys(s).length?s:void 0},invert(a){const r=Ze(a,e);r>=0&&(a.layout.entityLayouts[r].attributeStyles=i)},emitOps(a){const r=Ze(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 fi(e,t,o){return{label:"그룹 추가",apply(i){i.logical.groups.push(e),i.layout.groupLayouts.push({groupRef:e.modelId,geo:t,...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:t,...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 cs(e,t){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(t))o[l]=r[l];Object.assign(r,t)},invert(a){Object.assign(i(a),o)},emitOps(){return{forward:[{kind:"group.update",casUnit:"logical",containerRef:e,groupRef:e,patch:t}],invert:[{kind:"group.update",casUnit:"logical",containerRef:e,groupRef:e,patch:{...o}}]}}}}function ds(e){let t=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);t={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){t&&(o.logical.groups.splice(t.group.index,0,t.group.item),t.layout&&o.layout.groupLayouts.splice(t.layout.index,0,t.layout.item))},emitOps(){if(!t)return{forward:[],invert:[]};const o=[],i=[];return t.layout&&(o.push({kind:"groupLayout.remove",casUnit:"layout",groupRef:e,incidental:!0}),i.push({kind:"groupLayout.add",casUnit:"layout",groupRef:e,value:t.layout.item,incidental:!0})),o.push({kind:"group.remove",casUnit:"logical",groupRef:e}),i.push({kind:"group.add",casUnit:"logical",groupRef:e,value:t.group.item}),{forward:o,invert:i.reverse()}}}}function us(e,t){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(t)&&(r.memberEntityRefs.push(t),o=!0)},invert(a){if(!o)return;const r=i(a),l=(r==null?void 0:r.memberEntityRefs.indexOf(t))??-1;l>=0&&r.memberEntityRefs.splice(l,1)},emitOps(){return o?{forward:[{kind:"group.addMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:t}],invert:[{kind:"group.removeMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:t}]}:{forward:[],invert:[]}}}}function pi(e,t){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(t))??-1,o>=0&&r.memberEntityRefs.splice(o,1)},invert(a){var r;o<0||(r=i(a))==null||r.memberEntityRefs.splice(o,0,t)},emitOps(){return o<0?{forward:[],invert:[]}:{forward:[{kind:"group.removeMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:t}],invert:[{kind:"group.addMember",casUnit:"logical",containerRef:e,groupRef:e,entityRef:t}]}}}}function ms(e,t){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={...t}},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(t)],invert:[i(o)]}}}}function fs(e,t){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={...t}},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(t)],invert:[i(o)]}}}}function ps(e,t){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=mo(a.style,t)},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 hs(e,t){let o;return{label:t?"그룹 잠금":"그룹 잠금 해제",apply(i){const a=i.layout.groupLayouts.find(r=>r.groupRef===e);if(!a)throw new Error(`그룹 레이아웃 없음: ${e}`);o=a.locked,a.locked=t},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(t)],invert:[i(o)]}}}}function Mt(e,t){return{label:`속성 추가: ${t.name}`,apply(o){Fe(o,e).attributes.push(t)},invert(o){const i=Fe(o,e),a=i.attributes.findIndex(r=>r.modelId===t.modelId);a>=0&&i.attributes.splice(a,1)},emitOps(){return{forward:[{kind:"attribute.add",casUnit:"logical",containerRef:e,entityRef:e,value:t}],invert:[{kind:"attribute.remove",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:t.modelId}]}}}}function rn(e,t,o){const i={},a=r=>{const l=Fe(r,e).attributes.find(s=>s.modelId===t);if(!l)throw new Error(`속성 없음: ${t}`);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:t,patch:o}],invert:[{kind:"attribute.update",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:t,patch:{...i}}]}}}}function On(e,t){let o=null;return{label:"속성 삭제",apply(i){const a=Fe(i,e),r=a.attributes.findIndex(l=>l.modelId===t);if(r<0)throw new Error(`속성 없음: ${t}`);o={item:a.attributes[r],index:r},a.attributes.splice(r,1)},invert(i){o&&Fe(i,e).attributes.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"attribute.remove",casUnit:"logical",containerRef:e,entityRef:e,attributeRef:t}],invert:[{kind:"attribute.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}function Qa(e,t,o){let i=null;return{label:"속성 재정렬",apply(a){const r=Fe(a,e);i=r.attributes.map(m=>({...m}));const l=new Set(t),s=r.attributes.filter(m=>l.has(m.modelId)),c=r.attributes.filter(m=>!l.has(m.modelId)),d=Math.max(0,Math.min(o,c.length)),u=[...c.slice(0,d),...s,...c.slice(d)];r.attributes.splice(0,r.attributes.length,...u),r.attributes.forEach((m,p)=>m.order=p)},invert(a){i&&Fe(a,e).attributes.splice(0,1/0,...i)},emitOps(a){const r=Fe(a,e).attributes.map(l=>({...l}));return{forward:[{kind:"attribute.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:r}],invert:[{kind:"attribute.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:i??[]}]}}}}function ys(e,t){let o=!1;return{label:`메서드 추가: ${t.name}`,apply(i){const a=Fe(i,e);a.operations||(a.operations=[],o=!0),a.operations.push(t)},invert(i){var l;const a=Fe(i,e),r=((l=a.operations)==null?void 0:l.findIndex(s=>s.modelId===t.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:t}],invert:[{kind:"operation.remove",casUnit:"logical",containerRef:e,entityRef:e,operationRef:t.modelId}]}}}}function gs(e,t,o){const i={},a=r=>{var s;const l=(s=Fe(r,e).operations)==null?void 0:s.find(c=>c.modelId===t);if(!l)throw new Error(`메서드 없음: ${t}`);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:t,patch:o}],invert:[{kind:"operation.update",casUnit:"logical",containerRef:e,entityRef:e,operationRef:t,patch:{...i}}]}}}}function bs(e,t){let o=null;return{label:"메서드 삭제",apply(i){var s;const a=Fe(i,e),r=((s=a.operations)==null?void 0:s.findIndex(c=>c.modelId===t))??-1;if(r<0)throw new Error(`메서드 없음: ${t}`);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=Fe(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:t}],invert:[{kind:"operation.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}function _s(e,t,o){let i=null;return{label:"메서드 재정렬",apply(a){const r=Fe(a,e),l=r.operations??[];i=l.map(p=>({...p}));const s=new Set(t),c=l.filter(p=>s.has(p.modelId)),d=l.filter(p=>!s.has(p.modelId)),u=Math.max(0,Math.min(o,d.length)),m=[...d.slice(0,u),...c,...d.slice(u)];l.splice(0,l.length,...m),l.forEach((p,f)=>p.order=f),r.operations=l},invert(a){if(!i)return;const r=Fe(a,e);r.operations&&r.operations.splice(0,1/0,...i)},emitOps(a){const r=(Fe(a,e).operations??[]).map(l=>({...l}));return{forward:[{kind:"operation.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:r}],invert:[{kind:"operation.reorder",casUnit:"logical",containerRef:e,entityRef:e,value:i??[]}]}}}}function ks(e,t,o){let i;return{label:"메서드 색상 변경",apply(a){const r=Ze(a,e);if(r<0)throw new Error(`엔티티 레이아웃 없음: ${e}`);const l=a.layout.entityLayouts[r];i=l.operationStyles;const s={...l.operationStyles},c=mo(s[t],o);c?s[t]=c:delete s[t],l.operationStyles=Object.keys(s).length?s:void 0},invert(a){const r=Ze(a,e);r>=0&&(a.layout.entityLayouts[r].operationStyles=i)},emitOps(a){const r=Ze(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 hi(e,t){return{label:"관계 추가",apply(o){o.logical.associations.push(e),o.layout.associationLayouts.push(t)},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:t,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 Es(e){let t=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);t={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){t&&(o.logical.associations.splice(t.assoc.index,0,t.assoc.item),t.layout&&o.layout.associationLayouts.splice(t.layout.index,0,t.layout.item))},emitOps(){if(!t)return{forward:[],invert:[]};const o=[],i=[];return t.layout&&(o.push({kind:"associationLayout.remove",casUnit:"layout",associationRef:e,incidental:!0}),i.push({kind:"associationLayout.add",casUnit:"layout",associationRef:e,value:t.layout.item,incidental:!0})),o.push({kind:"association.remove",casUnit:"logical",associationRef:e}),i.push({kind:"association.add",casUnit:"logical",associationRef:e,value:t.assoc.item}),{forward:o,invert:i.reverse()}}}}function yi(e,t){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(t))o[l]=r[l];Object.assign(r,t)},invert(a){Object.assign(i(a),o)},emitOps(){return{forward:[{kind:"association.update",casUnit:"logical",containerRef:e,associationRef:e,patch:t}],invert:[{kind:"association.update",casUnit:"logical",containerRef:e,associationRef:e,patch:{...o}}]}}}}function ln(e,t,o){const i={},a=r=>{const l=r.logical.associations.find(s=>s.modelId===e);if(!l)throw new Error(`관계 없음: ${e}`);return l[t]};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:t,patch:o}],invert:[{kind:"associationEnd.update",casUnit:"logical",containerRef:e,associationRef:e,end:t,patch:{...i}}]}}}}function ws(e,t){return{label:"인덱스 추가",apply(o){const i=Fe(o,e);(i.indexes??(i.indexes=[])).push(t)},invert(o){var r;const i=Fe(o,e),a=((r=i.indexes)==null?void 0:r.findIndex(l=>l.modelId===t.modelId))??-1;a>=0&&i.indexes.splice(a,1)},emitOps(){return{forward:[{kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:t}],invert:[{kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:t.modelId}]}}}}function Ns(e,t,o){const i={},a=r=>{var s;const l=(s=Fe(r,e).indexes)==null?void 0:s.find(c=>c.modelId===t);if(!l)throw new Error(`인덱스 없음: ${t}`);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:t,patch:o}],invert:[{kind:"index.update",casUnit:"logical",containerRef:e,entityRef:e,indexRef:t,patch:{...i}}]}}}}function vs(e,t){let o=null;return{label:"인덱스 삭제",apply(i){var l;const a=Fe(i,e),r=((l=a.indexes)==null?void 0:l.findIndex(s=>s.modelId===t))??-1;if(r<0)throw new Error(`인덱스 없음: ${t}`);o={item:a.indexes[r],index:r},a.indexes.splice(r,1)},invert(i){o&&Fe(i,e).indexes.splice(o.index,0,o.item)},emitOps(){return o?{forward:[{kind:"index.remove",casUnit:"logical",containerRef:e,entityRef:e,indexRef:t}],invert:[{kind:"index.add",casUnit:"logical",containerRef:e,entityRef:e,value:o.item}]}:{forward:[],invert:[]}}}}const vt=(e,t)=>({kind:"associationLayout.setWaypoints",casUnit:"layout",associationRef:e,value:{waypoints:t}}),fo=(e,t)=>{var o;return((o=yt(e,t))==null?void 0:o.waypoints.map(i=>({...i})))??[]};function xs(e,t,o){let i=null;return{label:"waypoint 이동",coalesceKey:`waypoint:${e}`,apply(a){const r=yt(a,e);if(!r||!r.waypoints[t])throw new Error(`waypoint 없음: ${e}[${t}]`);i={...r.waypoints[t]},r.waypoints.splice(t,1,{...o})},invert(a){const r=yt(a,e);r&&i&&r.waypoints.splice(t,1,i)},emitOps(a){const r=fo(a,e),l=r.map((s,c)=>c===t&&i?{...i}:s);return{forward:[vt(e,r)],invert:[vt(e,l)]}}}}function Cs(e,t){let o=null;return{label:"waypoint 제거",apply(i){const a=yt(i,e);if(!a||!a.waypoints[t])throw new Error(`waypoint 없음: ${e}[${t}]`);o={...a.waypoints[t]},a.waypoints.splice(t,1)},invert(i){const a=yt(i,e);a&&o&&a.waypoints.splice(t,0,o)},emitOps(i){const a=fo(i,e),r=a.slice();return o&&r.splice(t,0,{...o}),{forward:[vt(e,a)],invert:[vt(e,r)]}}}}function Is(e,t,o){let i=null;return{label:"waypoint 평행이동",apply(a){const r=yt(a,e);if(!r)throw new Error(`관계 레이아웃 없음: ${e}`);i=r.waypoints.map(l=>({...l})),r.waypoints=i.map(l=>({x:l.x+t,y:l.y+o}))},invert(a){const r=yt(a,e);r&&i&&(r.waypoints=i)},emitOps(a){return{forward:[vt(e,fo(a,e))],invert:[vt(e,i??[])]}}}}function Ss(e){let t=null;return{label:"꺾은선 풀기",apply(o){const i=yt(o,e);if(!i)throw new Error(`관계 레이아웃 없음: ${e}`);t=i.waypoints.map(a=>({...a})),i.waypoints=[]},invert(o){const i=yt(o,e);i&&t&&(i.waypoints=t)},emitOps(o){return{forward:[vt(e,fo(o,e))],invert:[vt(e,t??[])]}}}}function $s(e,t,o){return{label:"waypoint 추가",apply(i){const a=yt(i,e);if(!a)throw new Error(`관계 레이아웃 없음: ${e}`);a.waypoints.splice(t,0,{...o})},invert(i){const a=yt(i,e);a==null||a.waypoints.splice(t,1)},emitOps(i){const a=fo(i,e),r=a.slice();return r.splice(t,1),{forward:[vt(e,a)],invert:[vt(e,r)]}}}}function Rs(e){return{label:"노트 추가",apply(t){t.layout.notes.push(e)},invert(t){const o=t.layout.notes.findIndex(i=>i.modelId===e.modelId);o>=0&&t.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 As(e){let t=null;return{label:"노트 삭제",apply(o){const i=o.layout.notes.findIndex(a=>a.modelId===e);if(i<0)throw new Error(`노트 없음: ${e}`);t={item:o.layout.notes[i],index:i},o.layout.notes.splice(i,1)},invert(o){t&&o.layout.notes.splice(t.index,0,t.item)},emitOps(){return t?{forward:[{kind:"note.remove",casUnit:"layout",noteRef:e}],invert:[{kind:"note.add",casUnit:"layout",noteRef:e,value:t.item}]}:{forward:[],invert:[]}}}}function po(e,t){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={...t}},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(t)],invert:[i(o)]}}}}function Ts(e,t){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={...t}},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(t)],invert:[i(o)]}}}}function Vs(e,t){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=t},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(t)],invert:[i(o)]}}}}function Ms(e,t){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=mo(a.style,t)},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 Bs(e,t){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(t)&&(l.memberNoteRefs.push(t),o=!0))},invert(r){if(!o)return;const l=a(r);if(!(l!=null&&l.memberNoteRefs))return;const s=l.memberNoteRefs.indexOf(t);s>=0&&l.memberNoteRefs.splice(s,1),i&&delete l.memberNoteRefs},emitOps(){return o?{forward:[{kind:"groupLayout.addNoteMember",casUnit:"layout",groupRef:e,noteRef:t}],invert:[{kind:"groupLayout.removeNoteMember",casUnit:"layout",groupRef:e,noteRef:t}]}:{forward:[],invert:[]}}}}function Ds(e,t){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(t))??-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,t))},emitOps(){return o<0?{forward:[],invert:[]}:{forward:[{kind:"groupLayout.removeNoteMember",casUnit:"layout",groupRef:e,noteRef:t}],invert:[{kind:"groupLayout.addNoteMember",casUnit:"layout",groupRef:e,noteRef:t}]}}}}const jt=(e,t,o)=>({kind:"noteConnection.setWaypoints",casUnit:"layout",noteRef:e,targetRef:t,value:{waypoints:o}}),gi=(e,t,o)=>{var i;return((i=Vt(e,t,o))==null?void 0:i.waypoints.map(a=>({...a})))??[]};function Os(e,t){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===t)){o=!1;return}r.connections.push({targetRef:t,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===t);l>=0&&r.connections.splice(l,1),i&&delete r.connections},emitOps(){return o?{forward:[{kind:"noteConnection.add",casUnit:"layout",noteRef:e,targetRef:t,value:{targetRef:t,waypoints:[]}}],invert:[{kind:"noteConnection.remove",casUnit:"layout",noteRef:e,targetRef:t}]}:{forward:[],invert:[]}}}}function Ps(e,t){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===t))??-1;if(!(a!=null&&a.connections)||r<0)throw new Error(`노트 연결 없음: ${e}→${t}`);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:t}],invert:[{kind:"noteConnection.add",casUnit:"layout",noteRef:e,targetRef:t,value:o.item}]}:{forward:[],invert:[]}}}}function Ls(e,t,o,i){let a=null;return{label:"waypoint 이동",coalesceKey:`noteConnWaypoint:${e}:${t}`,apply(r){const l=Vt(r,e,t);if(!l||!l.waypoints[o])throw new Error(`waypoint 없음: ${e}→${t}[${o}]`);a={...l.waypoints[o]},l.waypoints.splice(o,1,{...i})},invert(r){const l=Vt(r,e,t);l&&a&&l.waypoints.splice(o,1,a)},emitOps(r){const l=gi(r,e,t),s=l.map((c,d)=>d===o&&a?{...a}:c);return{forward:[jt(e,t,l)],invert:[jt(e,t,s)]}}}}function zs(e,t,o,i){return{label:"waypoint 추가",apply(a){const r=Vt(a,e,t);if(!r)throw new Error(`노트 연결 없음: ${e}→${t}`);r.waypoints.splice(o,0,{...i})},invert(a){const r=Vt(a,e,t);r==null||r.waypoints.splice(o,1)},emitOps(a){const r=gi(a,e,t),l=r.slice();return l.splice(o,1),{forward:[jt(e,t,r)],invert:[jt(e,t,l)]}}}}function Us(e,t,o){let i=null;return{label:"waypoint 제거",apply(a){const r=Vt(a,e,t);if(!r||!r.waypoints[o])throw new Error(`waypoint 없음: ${e}→${t}[${o}]`);i={...r.waypoints[o]},r.waypoints.splice(o,1)},invert(a){const r=Vt(a,e,t);r&&i&&r.waypoints.splice(o,0,i)},emitOps(a){const r=gi(a,e,t),l=r.slice();return i&&l.splice(o,0,{...i}),{forward:[jt(e,t,r)],invert:[jt(e,t,l)]}}}}function Hs(e,t){let o=null;return{label:"꺾은선 풀기",apply(i){const a=Vt(i,e,t);if(!a)throw new Error(`노트 연결 없음: ${e}→${t}`);o=a.waypoints.map(r=>({...r})),a.waypoints=[]},invert(i){const a=Vt(i,e,t);a&&o&&(a.waypoints=o)},emitOps(i){return{forward:[jt(e,t,gi(i,e,t))],invert:[jt(e,t,o??[])]}}}}function Ge(e,t,o){return{label:e,coalesceKey:o,apply(i){for(const a of t)a.apply(i)},invert(i){for(let a=t.length-1;a>=0;a--)t[a].invert(i)},emitOps(i){const a=t.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 cp=Object.freeze(Object.defineProperty({__proto__:null,addAssociation:hi,addAttribute:Mt,addEntity:ui,addEntityToGroup:us,addGroup:fi,addIndex:ws,addNote:Rs,addNoteConnection:Os,addNoteConnectionWaypoint:zs,addNoteToGroup:Bs,addOperation:ys,addWaypoint:$s,clearNoteConnectionWaypoints:Hs,clearWaypoints:Ss,composite:Ge,moveEntity:Dn,moveGroup:ms,moveNote:po,moveNoteConnectionWaypoint:Ls,moveWaypoint:xs,removeAssociation:Es,removeAttribute:On,removeEntity:ns,removeEntityFromGroup:pi,removeGroup:ds,removeIndex:vs,removeNote:As,removeNoteConnection:Ps,removeNoteConnectionWaypoint:Us,removeNoteFromGroup:Ds,removeOperation:bs,removeWaypoint:Cs,renameEntity:is,reorderAttributes:Qa,reorderOperations:_s,resizeEntity:as,resizeGroup:fs,resizeNote:Ts,setAllEntitiesCollapsed:Za,setAttributeSwatch:mi,setEntityCollapsed:ls,setEntityLocked:ss,setEntitySwatch:rs,setGroupLocked:hs,setGroupSwatch:ps,setNoteMemo:Vs,setNoteSwatch:Ms,setOperationSwatch:ks,translateWaypoints:Is,updateAssociation:yi,updateAssociationEnd:ln,updateAttribute:rn,updateEntity:os,updateGroup:cs,updateIndex:Ns,updateOperation:gs},Symbol.toStringTag,{value:"Module"}));class Fs{constructor(){He(this,"revs",new Map);He(this,"layoutVersion",0);He(this,"logicalVersion",0)}seed(t){this.revs.clear();for(const[o,i]of Object.entries(t.revs??{}))this.revs.set(o,i);this.layoutVersion=t.layoutVersion??0,this.logicalVersion=t.logicalVersion??0}rev(t){return this.revs.get(t)??0}setRev(t,o){this.revs.set(t,o)}deleteRev(t){this.revs.delete(t)}snapshot(){return{revs:Object.fromEntries(this.revs),layoutVersion:this.layoutVersion,logicalVersion:this.logicalVersion}}}class Gs{constructor(t){He(this,"cache",new Fs);He(this,"newClientOpId");He(this,"debounceMs");He(this,"emissions",new WeakMap);He(this,"open",null);He(this,"debounceHandle",null);He(this,"queue",[]);He(this,"sending",!1);He(this,"_frozen",!1);He(this,"stack",null);He(this,"settledWaiters",[]);this.opts=t,this.newClientOpId=t.newClientOpId??Me,this.debounceMs=t.debounceMs??300}seed(t){this.cache.seed(t)}attach(t){this.stack=t;const o=t.onCommand((i,a,r)=>this.handle(i,a,r));return()=>{o(),this.stack===t&&(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(t=>this.settledWaiters.push(t)):Promise.resolve()}handle(t,o,i){var l;if(this._frozen)return;let a;if(o==="do"){const s=(l=t.emitOps)==null?void 0:l.call(t,this.opts.state);if(!s)throw new Error(`op-mode에서 emitOps 미구현 command 실행: ${t.label}`);a=s}else{const s=this.emissions.get(t);if(!s)throw new Error(`op-mode ${o} 대상 command의 emission 미기록: ${t.label}`);a=s}const r=o==="undo"?a.invert:a.forward;if(o==="do"&&i&&this.open&&this.open.coalesceKey===t.coalesceKey){this.open.fwd=r,this.emissions.set(t,{forward:r,invert:this.open.inv}),this.resetDebounce();return}if(this.flushOpen(!1),o==="do"&&(this.emissions.set(t,a),t.coalesceKey!=null)){this.open={coalesceKey:t.coalesceKey,fwd:r,inv:a.invert},this.startDebounce();return}r.length&&this.enqueue(this.buildBatch(r))}flushOpen(t){var i;this.cancelDebounce();const o=this.open;this.open=null,o&&o.fwd.length&&this.enqueue(this.buildBatch(o.fwd)),t&&((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(t){const o={},i=new Set;let a=!1,r=!1;for(const l of t)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:t,cas:o,origin:this.opts.origin??"gui",clientOpId:this.newClientOpId()}}enqueue(t){this.queue.push(t),this.pump()}async pump(){var i,a;if(this.sending||this._frozen)return;const t=this.queue.shift();if(!t){this.notifySettled();return}this.sending=!0;let o=null;try{o=await this.opts.transport(t)}catch(r){this.sending=!1,console.error("[op-sync] op 전송 실패 → 하드 프리즈(kind:missing):",r),(a=(i=this.opts).onError)==null||a.call(i,r),this.freeze({kind:"missing"});return}this.sending=!1,o.ok?(this.reconcile(o),this.pump()):this.freeze(o.conflict)}reconcile(t){if(!(this.queue.length>0)){for(const[o,i]of Object.entries(t.revs))this.cache.setRev(o,i);this.cache.layoutVersion=t.layoutVersion,this.cache.logicalVersion=t.logicalVersion}}freeze(t){var o,i;this._frozen=!0,this.queue.length=0,this.open=null,this.cancelDebounce(),(i=(o=this.opts).onFreeze)==null||i.call(o,t),this.notifySettled()}notifySettled(){if(this.hasPending)return;const t=this.settledWaiters;this.settledWaiters=[];for(const o of t)o()}}const js=["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","group.add"],Ks=()=>crypto.randomUUID(),dp=e=>e.add.length===0&&e.update.length===0&&e.remove.length===0,up=e=>e&&e[0].toLowerCase()+e.slice(1),mp=e=>e&&e[0].toUpperCase()+e.slice(1),fp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1_$2").replace(/[-\s]+/g,"_").toLowerCase();function pp(e,t){return up(e)+mp(t)}function hp(e,t){const o=e.entities.find(l=>l.modelId===t.end1.entityRef);if(!o)return[];if(o.stereotype==="JPA_EMBEDDABLE")return[];const a=t.end1.entityRef===t.end2.entityRef?!1:t.identifying===!0;return o.attributes.filter(l=>l.identifier&&(l.attrType==="NORMAL"||l.attrType==="RELATION_OWN")).sort((l,s)=>l.order-s.order).map(l=>{const s=pp(o.name,l.name);return{associationRef:t.modelId,sourceAttributeRef:l.modelId,name:s,type:l.type,identifier:a,notNull:a,dbAttrs:l.dbAttrs.map(c=>({physicalName:fp(s),logicalName:c.logicalName,dataType:c.dataType,length:c.length,scale:c.scale}))}})}const bi=(e,t)=>`${e}::${t}`,_i=e=>e??void 0;function yp(e,t,o){const i={};return e.type!==t.type&&(i.type=t.type),e.identifier!==t.identifier&&(i.identifier=t.identifier),e.notNull!==t.notNull&&(i.notNull=t.notNull),(e.dbAttrs.length!==t.dbAttrs.length||t.dbAttrs.some((r,l)=>{const s=e.dbAttrs[l];return!s||s.dataType!==r.dataType||_i(s.length)!==_i(r.length)||_i(s.scale)!==_i(r.scale)}))&&(i.dbAttrs=t.dbAttrs.map((r,l)=>{const s=e.dbAttrs[l];return{modelId:(s==null?void 0:s.modelId)??o(),physicalName:(s==null?void 0:s.physicalName)??r.physicalName,logicalName:(s==null?void 0:s.logicalName)??r.logicalName,dataType:r.dataType,length:r.length,scale:r.scale}})),Object.keys(i).length?i:null}function gp(e,t,o){return{modelId:o(),name:e.name,type:e.type,attrType:"RELATION_OWN",identifier:e.identifier,notNull:e.notNull,order:t,dbAttrs:e.dbAttrs.map(i=>({...i,modelId:o()})),derivedFrom:{associationRef:e.associationRef,sourceAttributeRef:e.sourceAttributeRef}}}function ho(e,t,o=Ks){const i={add:[],update:[],remove:[]},a=e.entities.find(m=>m.modelId===t);if(!a)return i;const r=e.associations.filter(m=>m.end2.entityRef===t),l=a.stereotype==="JPA_EMBEDDABLE"?[]:r.flatMap(m=>hp(e,m)),s=new Map(l.map(m=>[bi(m.associationRef,m.sourceAttributeRef),m])),c=a.attributes.filter(m=>m.derivedFrom),d=new Map(c.map(m=>[bi(m.derivedFrom.associationRef,m.derivedFrom.sourceAttributeRef),m]));for(const m of c){const p=bi(m.derivedFrom.associationRef,m.derivedFrom.sourceAttributeRef);s.has(p)||i.remove.push(m.modelId)}let u=a.attributes.reduce((m,p)=>Math.max(m,p.order),-1)+1;for(const m of l){const p=bi(m.associationRef,m.sourceAttributeRef),f=d.get(p);if(!f)i.add.push(gp(m,u++,o));else{const y=yp(f,m,o);y&&i.update.push({attributeId:f.modelId,patch:y})}}return i}function bp(e,t){if(t.remove.length){const o=new Set(t.remove);e.attributes=e.attributes.filter(i=>!o.has(i.modelId))}for(const o of t.update){const i=e.attributes.find(a=>a.modelId===o.attributeId);i&&Object.assign(i,o.patch)}t.add.length&&e.attributes.push(...t.add)}function _p(e){return{...e,entities:e.entities.map(t=>({...t,attributes:t.attributes.map(o=>({...o}))}))}}function kp(e,t,o=Ks){const i=new Map,a=_p(e),r=new Set,l=[t];for(;l.length;){const s=l.shift();if(r.has(s))continue;r.add(s);const c=new Set(a.associations.filter(d=>d.end1.entityRef===s).map(d=>d.end2.entityRef));for(const d of c){const u=ho(a,d,o);if(dp(u))continue;i.has(d)||i.set(d,u);const m=a.entities.find(p=>p.modelId===d);m&&bp(m,u),r.has(d)||l.push(d)}}return i}function ki(e,t,o){var l;const i=e.entities.find(s=>s.modelId===t),a=i==null?void 0:i.attributes.find(s=>s.modelId===o);if(!a||!a.attrType.startsWith("RELATION")||a.dbAttrs.length===0)return;const r=(l=a.derivedFrom)==null?void 0:l.associationRef;if(r){const s=e.associations.find(c=>c.modelId===r);if(s)return s}return e.associations.find(s=>s.end1.entityRef===t&&s.end1.attributeRef===o||s.end2.entityRef===t&&s.end2.attributeRef===o)}function Ep(e,t){const o=()=>e.entities.filter(r=>{var l;return((l=r.table)==null?void 0:l.physicalName)===t.ref}),i=()=>e.entities.filter(r=>r.name===t.ref);if(t.by==="physicalName")return o();if(t.by==="name")return i();const a=o();return a.length?a:i()}function wp(e,t){const o=()=>e.attributes.filter(r=>r.name===t.ref),i=()=>e.attributes.filter(r=>r.dbAttrs.some(l=>l.physicalName===t.ref));if(t.by==="name")return o();if(t.by==="physicalName")return i();const a=o();return a.length?a:i()}function Ys(e,t,o){return e.associations.filter(i=>{const a=[i.end1.entityRef,i.end2.entityRef];return a.includes(t)&&a.includes(o)})}function rt(e,t){const o=Ep(e,t);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 Np(e,t){const o=wp(e,t);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 vp(e,t){const o=()=>e.attributes.flatMap(r=>r.dbAttrs).filter(r=>r.physicalName===t.ref),i=()=>e.attributes.filter(r=>r.name===t.ref).flatMap(r=>r.dbAttrs);if(t.by==="physicalName")return o();if(t.by==="name")return i();const a=o();return a.length?a:i()}function xp(e,t){const o=vp(e,t);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 Ws(e,t){const o=e.filter(i=>i.physicalName===t.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 Cp(e,t){return(e.indexes??[]).filter(o=>o.name===t.ref)}function Ip(e,t){return(e.operations??[]).filter(o=>o.name===t.ref)}function Sp(e,t){const o=Cp(e,t);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 $p(e,t){const o=Ip(e,t);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 qs(e,t,o){const i=e.physicalName!=null||e.dataType!=null||e.length!=null||e.scale!=null||e.columnLogicalName!=null||e.unique!=null||e.updatable!=null;return{modelId:o(),name:e.name,type:e.type,attrType:"NORMAL",identifier:e.identifier??!1,notNull:e.notNull??!1,order:t,...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 Xs(e,t,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 t.fields){const y=u.get(f.name);if(y!=null&&y.sharedColumnPhysicalName){const b={ref:y.sharedColumnPhysicalName,by:"physicalName"},k=Ws(en(i,a),b);if(!k.ok){s.push(k.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:r,entity:l,handle:b}:{code:"shared-column-target-ambiguous",opIndex:r,entity:l,handle:b,matches:k.matches}),p=!0;continue}m.push({modelId:c(),physicalName:"",dataType:"",sharedColumnRef:k.value.modelId});continue}m.push({modelId:c(),physicalName:(y==null?void 0:y.physicalName)??"",dataType:"",...y!=null&&y.length?{length:y.length}:{},...y!=null&&y.scale?{scale:y.scale}:{},...(y==null?void 0:y.insertable)!=null?{insertable:y.insertable}:{},...(y==null?void 0:y.updatable)!=null?{updatable:y.updatable}:{}})}return p?null:{modelId:d,name:e.name,type:t.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}}function Rp(e,t,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=t.fields[p],y=f?c.get(f.name):void 0;if(!y){d.push(m);return}if(y.sharedColumnPhysicalName){const k={ref:y.sharedColumnPhysicalName,by:"physicalName"},g=Ws(en(i,a),k);if(!g.ok){s.push(g.reason==="not-found"?{code:"shared-column-target-not-found",opIndex:r,entity:l,handle:k}:{code:"shared-column-target-ambiguous",opIndex:r,entity:l,handle:k,matches:g.matches}),u=!0;return}d.push({modelId:m.modelId,physicalName:"",dataType:"",sharedColumnRef:g.value.modelId});return}const b={...m};delete b.sharedColumnRef,d.push({...b,...y.physicalName!=null?{physicalName:y.physicalName}:{},...y.length!=null?{length:y.length}:{},...y.scale!=null?{scale:y.scale}:{},...y.insertable!=null?{insertable:y.insertable}:{},...y.updatable!=null?{updatable:y.updatable}:{}})}),u?null:d}function Js(e,t,o){return{modelId:o(),name:e.name,order:t,...e.visibility?{visibility:e.visibility}:{},...e.sourceCode?{sourceCode:e.sourceCode}:{},...e.description?{description:e.description}:{},...e.personalInfoAttributeType?{personalInfoAttributeType:e.personalInfoAttributeType}:{}}}function Zs(e,t,o,i,a,r){const l=[];let s=!1;for(const c of t.columns){const d=xp(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:t.name,unique:t.unique??!1,columns:l,...t.description?{description:t.description}:{},...t.parameters?{parameters:t.parameters}:{}}}function Ap(e,t,o={}){const i=o.mkId??Me,a=o.embeddableCatalog??[],r=m=>a.find(p=>p.type===m),l=[],s=[],c=new Map,d=new Map,u=new Set;for(const m of t)m.kind==="entity.add"&&(u.add(m.spec.name),m.spec.physicalName&&u.add(m.spec.physicalName));return t.forEach((m,p)=>{var f,y,b,k;switch(m.kind){case"entity.add":{const g=i(),N={modelId:g,name:m.spec.name,stereotype:m.spec.stereotype??"JPA_ENTITY",attributes:[],...m.spec.useVersion?{jpaAttrs:{useVersion:!0}}:{},...m.spec.physicalName?{table:{physicalName:m.spec.physicalName}}:{}},h={ref:m.spec.name};let w=!1;for(const[W,M]of(m.spec.attributes??[]).entries()){if(M.type==="GroupCodeEnum"&&!M.groupCode){s.push({code:"groupcode-required",opIndex:p,entity:h,handle:{ref:M.name}}),w=!0;continue}const $=r(M.type);if($){const D=Xs(M,$,W,N,e.entities,p,h,s,i);D?N.attributes.push(D):w=!0}else(f=M.embeddableOverrides)!=null&&f.length?(s.push({code:"embeddable-type-unresolved",opIndex:p,entity:h,handle:{ref:M.name}}),w=!0):N.attributes.push(qs(M,W,i))}const q=(m.spec.operations??[]).map((W,M)=>Js(W,M,i));q.length&&(N.operations=q);const P=[];for(const W of m.spec.indexes??[]){const M=Zs(N,W,p,h,s,i);M?P.push(M):w=!0}if(P.length&&(N.indexes=P),w)break;l.push({kind:"entity.add",casUnit:"logical",entityRef:g,value:N});break}case"entity.update":{const g=rt(e,m.entity);if(!g.ok){s.push(lt(g.reason,p,m.entity,g.matches,u));break}l.push({kind:"entity.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,patch:m.patch});break}case"entity.remove":{const g=rt(e,m.entity);if(!g.ok){s.push(lt(g.reason,p,m.entity,g.matches,u));break}l.push({kind:"entity.remove",casUnit:"logical",entityRef:g.value.modelId});break}case"attribute.add":{const g=rt(e,m.entity);if(!g.ok){s.push(lt(g.reason,p,m.entity,g.matches,u));break}if(m.spec.type==="GroupCodeEnum"&&!m.spec.groupCode){s.push({code:"groupcode-required",opIndex:p,entity:m.entity,handle:{ref:m.spec.name}});break}const N=c.get(g.value.modelId)??g.value.attributes.length;c.set(g.value.modelId,N+1);const h=r(m.spec.type);let w;if(h)w=Xs(m.spec,h,N,g.value,e.entities,p,m.entity,s,i);else if((y=m.spec.embeddableOverrides)!=null&&y.length){s.push({code:"embeddable-type-unresolved",opIndex:p,entity:m.entity,handle:{ref:m.spec.name}});break}else w=qs(m.spec,N,i);if(!w)break;l.push({kind:"attribute.add",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,value:w});break}case"attribute.update":case"attribute.remove":{const g=rt(e,m.entity);if(!g.ok){s.push(lt(g.reason,p,m.entity,g.matches,u));break}const N=Np(g.value,m.attribute);if(!N.ok){s.push(N.reason==="not-found"?{code:"attribute-not-found",opIndex:p,entity:m.entity,handle:m.attribute}:{code:"attribute-ambiguous",opIndex:p,entity:m.entity,handle:m.attribute,matches:N.matches});break}if(m.kind==="attribute.update"){let h=m.patch;if((b=m.embeddableOverrides)!=null&&b.length){const w=r(N.value.type);if(!w||N.value.attrType!=="EMBED_PREDEF"){s.push({code:"embeddable-type-unresolved",opIndex:p,entity:m.entity,handle:m.attribute});break}const q=Rp(N.value,w,m.embeddableOverrides,g.value,e.entities,p,m.entity,s);if(!q)break;h={...m.patch,dbAttrs:q}}l.push({kind:"attribute.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,attributeRef:N.value.modelId,patch:h})}else l.push({kind:"attribute.remove",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,attributeRef:N.value.modelId});break}case"association.add":{const g=rt(e,m.spec.from),N=rt(e,m.spec.to);if(g.ok||s.push(lt(g.reason,p,m.spec.from,g.matches,u)),N.ok||s.push(lt(N.reason,p,m.spec.to,N.matches,u)),!g.ok||!N.ok)break;if(m.spec.identifying&&g.value.modelId===N.value.modelId){s.push({code:"self-identifying",opIndex:p,handle:{from:m.spec.from,to:m.spec.to}});break}const h=i(),w={modelId:h,...m.spec.identifying!=null?{identifying:m.spec.identifying}:{},end1:{entityRef:g.value.modelId,multiplicity:m.spec.fromMultiplicity??"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1},end2:{entityRef:N.value.modelId,multiplicity:m.spec.toMultiplicity??"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:m.spec.composition??!1}},q={...e,associations:[...e.associations,w]},P=ho(q,N.value.modelId,i);P.add[0]&&(w.end2.attributeRef=P.add[0].modelId),l.push({kind:"association.add",casUnit:"logical",associationRef:h,value:w});for(const W of P.add)l.push({kind:"attribute.add",casUnit:"logical",containerRef:N.value.modelId,entityRef:N.value.modelId,value:W});break}case"association.remove":{const g=rt(e,m.association.from),N=rt(e,m.association.to);if(g.ok||s.push(lt(g.reason,p,m.association.from,g.matches,u)),N.ok||s.push(lt(N.reason,p,m.association.to,N.matches,u)),!g.ok||!N.ok)break;const h=Ys(e,g.value.modelId,N.value.modelId);if(h.length!==1){s.push(h.length===0?{code:"association-not-found",opIndex:p,handle:m.association}:{code:"association-ambiguous",opIndex:p,handle:m.association,matches:h.map(w=>w.modelId)});break}l.push({kind:"association.remove",casUnit:"logical",associationRef:h[0].modelId});break}case"association.update":{const g=Qs(e,m.association,p,s,u);if(!g)break;l.push({kind:"association.update",casUnit:"logical",containerRef:g.modelId,associationRef:g.modelId,patch:m.patch});break}case"associationEnd.update":{const g=Qs(e,m.association,p,s,u);if(!g)break;const N=m.end==="from"?"end1":"end2";l.push({kind:"associationEnd.update",casUnit:"logical",containerRef:g.modelId,associationRef:g.modelId,end:N,patch:m.patch});break}case"index.add":{const g=rt(e,m.entity);if(!g.ok){s.push(lt(g.reason,p,m.entity,g.matches,u));break}const N=Zs(g.value,m.spec,p,m.entity,s,i);if(!N)break;l.push({kind:"index.add",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,indexRef:N.modelId,value:N});break}case"index.update":case"index.remove":{const g=rt(e,m.entity);if(!g.ok){s.push(lt(g.reason,p,m.entity,g.matches,u));break}const N=Sp(g.value,m.index);if(!N.ok){s.push(N.reason==="not-found"?{code:"index-not-found",opIndex:p,entity:m.entity,handle:m.index}:{code:"index-ambiguous",opIndex:p,entity:m.entity,handle:m.index,matches:N.matches});break}if(m.kind==="index.update"){if("columns"in m.patch){s.push({code:"index-columns-patch-unsupported",opIndex:p,entity:m.entity,handle:m.index});break}l.push({kind:"index.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,indexRef:N.value.modelId,patch:m.patch})}else l.push({kind:"index.remove",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,indexRef:N.value.modelId});break}case"operation.add":{const g=rt(e,m.entity);if(!g.ok){s.push(lt(g.reason,p,m.entity,g.matches,u));break}const N=d.get(g.value.modelId)??((k=g.value.operations)==null?void 0:k.length)??0;d.set(g.value.modelId,N+1);const h=Js(m.spec,N,i);l.push({kind:"operation.add",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,operationRef:h.modelId,value:h});break}case"operation.update":case"operation.remove":{const g=rt(e,m.entity);if(!g.ok){s.push(lt(g.reason,p,m.entity,g.matches,u));break}const N=$p(g.value,m.operation);if(!N.ok){s.push(N.reason==="not-found"?{code:"operation-not-found",opIndex:p,entity:m.entity,handle:m.operation}:{code:"operation-ambiguous",opIndex:p,entity:m.entity,handle:m.operation,matches:N.matches});break}m.kind==="operation.update"?l.push({kind:"operation.update",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,operationRef:N.value.modelId,patch:m.patch}):l.push({kind:"operation.remove",casUnit:"logical",containerRef:g.value.modelId,entityRef:g.value.modelId,operationRef:N.value.modelId});break}case"group.add":{const g=[];let N=!1;for(const q of m.spec.members){const P=rt(e,q);if(!P.ok){s.push(lt(P.reason,p,q,P.matches,u)),N=!0;continue}g.push(P.value.modelId)}if(N)break;const h=i(),w={modelId:h,excludeDDLGeneration:m.spec.excludeDDLGeneration??!1,memberEntityRefs:g,...m.spec.name?{name:m.spec.name}:{},...m.spec.packageName?{packageName:m.spec.packageName}:{},...m.spec.description?{description:m.spec.description}:{}};l.push({kind:"group.add",casUnit:"logical",groupRef:h,value:w});break}}}),s.length?{ok:!1,errors:s}:{ok:!0,ops:l}}function lt(e,t,o,i,a){return e==="not-found"&&(a!=null&&a.has(o.ref))?{code:"pending-entity-ref",opIndex:t,handle:o}:e==="not-found"?{code:"entity-not-found",opIndex:t,handle:o}:{code:"entity-ambiguous",opIndex:t,handle:o,matches:i}}function Qs(e,t,o,i,a){const r=rt(e,t.from),l=rt(e,t.to);if(r.ok||i.push(lt(r.reason,o,t.from,r.matches,a)),l.ok||i.push(lt(l.reason,o,t.to,l.matches,a)),!r.ok||!l.ok)return null;const s=Ys(e,r.value.modelId,l.value.modelId);return s.length!==1?(i.push(s.length===0?{code:"association-not-found",opIndex:o,handle:t}:{code:"association-ambiguous",opIndex:o,handle:t,matches:s.map(c=>c.modelId)}),null):s[0]}const ec={type:"object",description:"요소 지정 핸들. 엔티티: 물리명(table.physicalName) 우선, 논리명(name) 보조. 속성: 소속 엔티티 내 속성명 또는 컬럼 물리명.",properties:{ref:{type:"string",description:"매칭할 이름/물리명."},by:{type:"string",enum:["physicalName","name"],description:"매칭 키 고정(미지정 시 대상별 기본 순서)."}},required:["ref"],additionalProperties:!1},Tp={type:"object",description:"관계는 무명이라 양 끝 엔티티로 주소. from=부모(end1), to=자식(end2). 같은 쌍 복수 관계는 모호 보고.",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"}},required:["from","to"],additionalProperties:!1},Vp={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"],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"}}},required:["name"],additionalProperties:!1},Ei={type:"object",properties:{ko:{type:"string"},en:{type:"string"},ja:{type:"string"},zh:{type:"string"}},additionalProperties:!1},Mp={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:{...Ei,description:"속성 설명(다국어)."},columnLogicalName:{...Ei,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},Bp={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}},tc={type:"string",enum:["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"]},Dp={type:"object",properties:{from:{$ref:"#/$defs/handle"},to:{$ref:"#/$defs/handle"},fromMultiplicity:{...tc,description:"end1 다중성(기본 EXACTLY_ONE_INSTANCE)."},toMultiplicity:{...tc,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},Op={type:"object",properties:{name:{type:"string"},unique:{type:"boolean",description:"UNIQUE 인덱스 여부(기본 false)."},columns:{type:"array",description:"인덱스 컬럼(순서 의미 있음).",items:{type:"object",properties:{column:{...ec,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},Pp={type:"object",properties:{name:{type:"string"},visibility:{type:"string",enum:["PUBLIC","PRIVATE","PROTECTED","PACKAGE"],description:"가시성(기본 미설정)."},sourceCode:{type:"string",description:"Java 메서드 본문(멀티라인, 파라미터·반환 시그니처 포함)."},description:{...Ei,description:"메서드 설명(다국어)."},personalInfoAttributeType:{type:"string",description:"개인정보 속성 유형(패스스루)."}},required:["name"],additionalProperties:!1},Lp={type:"object",properties:{name:{...Ei,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},zp={type:"object",description:"부분 patch(임의 키). 값 품질 검증은 별도 엔진."};function nt(e,t){return{type:"object",properties:{kind:{const:e},...t.properties},required:["kind",...t.required],additionalProperties:!1}}const Up={"entity.add":nt("entity.add",{properties:{spec:{$ref:"#/$defs/entitySpec"}},required:["spec"]}),"entity.update":nt("entity.update",{properties:{entity:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","patch"]}),"entity.remove":nt("entity.remove",{properties:{entity:{$ref:"#/$defs/handle"}},required:["entity"]}),"attribute.add":nt("attribute.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/attrSpec"}},required:["entity","spec"]}),"attribute.update":nt("attribute.update",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"},embeddableOverrides:{$ref:"#/$defs/embeddableOverrides"}},required:["entity","attribute","patch"]}),"attribute.remove":nt("attribute.remove",{properties:{entity:{$ref:"#/$defs/handle"},attribute:{$ref:"#/$defs/handle"}},required:["entity","attribute"]}),"association.add":nt("association.add",{properties:{spec:{$ref:"#/$defs/assocSpec"}},required:["spec"]}),"association.remove":nt("association.remove",{properties:{association:{$ref:"#/$defs/assocHandle"}},required:["association"]}),"association.update":nt("association.update",{properties:{association:{$ref:"#/$defs/assocHandle"},patch:{$ref:"#/$defs/patch"}},required:["association","patch"]}),"associationEnd.update":nt("associationEnd.update",{properties:{association:{$ref:"#/$defs/assocHandle"},end:{type:"string",enum:["from","to"],description:"from=부모(end1), to=자식(end2)."},patch:{$ref:"#/$defs/patch"}},required:["association","end","patch"]}),"index.add":nt("index.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/indexSpec"}},required:["entity","spec"]}),"index.update":nt("index.update",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","index","patch"]}),"index.remove":nt("index.remove",{properties:{entity:{$ref:"#/$defs/handle"},index:{$ref:"#/$defs/handle"}},required:["entity","index"]}),"operation.add":nt("operation.add",{properties:{entity:{$ref:"#/$defs/handle"},spec:{$ref:"#/$defs/operationSpec"}},required:["entity","spec"]}),"operation.update":nt("operation.update",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/handle"},patch:{$ref:"#/$defs/patch"}},required:["entity","operation","patch"]}),"operation.remove":nt("operation.remove",{properties:{entity:{$ref:"#/$defs/handle"},operation:{$ref:"#/$defs/handle"}},required:["entity","operation"]}),"group.add":nt("group.add",{properties:{spec:{$ref:"#/$defs/groupSpec"}},required:["spec"]})},nc={anyOf:js.map(e=>Up[e])},Hp={type:"object",description:"엔티티 모델을 생성·수정·삭제할 때 호출한다. ops는 사람 핸들(엔티티 물리명/논리명, 속성명)로 지정하며 서버가 modelId로 해소한다. 모호하면 에러로 후보를 돌려주니 리소스로 현재 모델을 먼저 읽어 핸들을 확정하라.",properties:{ops:{type:"array",items:{$ref:"#/$defs/symbolicOp"}}},required:["ops"],additionalProperties:!1,$defs:{handle:ec,assocHandle:Tp,entitySpec:Vp,attrSpec:Mp,embeddableOverrides:Bp,assocSpec:Dp,indexSpec:Op,operationSpec:Pp,groupSpec:Lp,patch:zp,symbolicOp:nc}};function Fp(e,t,o,i={}){const a=i.mkClientOpId??Me,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]=t[s]??0}return{diagramId:e,ops:o,cas:l,origin:i.origin??"agent",clientOpId:a()}}const oc={location:{x:0,y:0},size:{width:220,height:140}};function ic(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 Gp=/^[-=_*~\s]{3,}$/;function jp(e){return e.attrType&&e.attrType!=="NORMAL"||!Gp.test(e.name??"")?!1:!(e.dbAttrs??[]).some(t=>t.physicalName||t.dataType)}function Kp(e){return e.type===wt&&e.customType==="java.util.Currency"?{type:"Currency",customType:void 0}:{type:e.type,customType:e.customType}}function Yp(e,t){if(e.attrType==="DIVIDER"||jp(e))return{modelId:e.modelId,name:e.attrType==="DIVIDER"?e.name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:e.order??t,dbAttrs:[]};const o=Kp(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??t,dbAttrs:e.dbAttrs.map(ic)}}function Wp(e){const{modelId:t,name:o,visibility:i,sourceCode:a,description:r,order:l,personalInfoAttributeType:s,style:c,...d}=e;return{modelId:t,name:o,visibility:i,sourceCode:a,description:r?{ko:r}:void 0,order:l??0,personalInfoAttributeType:s,legacyRaw:Object.keys(d).length?d:void 0}}function qp(e){return{modelId:e.modelId,name:e.name,unique:e.unique,description:e.description,parameters:e.parameters,columns:e.indexColumns.map(t=>({columnRef:t.targetColumn.refId,descending:t.descending}))}}function Xp(e){var t,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(Yp),operations:(t=e.operations)==null?void 0:t.map(Wp),indexes:(o=e.indexes)==null?void 0:o.map(qp),jpaAttrs:e.jpaAttrs,table:e.dbAttrs?{physicalName:e.dbAttrs.physicalName,logicalName:e.dbAttrs.logicalName}:void 0}}function Jp(e){const t={};for(const i of e.attributes)i.style&&(t[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??{...oc},style:e.style,attributeStyles:Object.keys(t).length?t:void 0,operationStyles:Object.keys(o).length?o:void 0,collapsed:e.collapsed,locked:e.locked}}function ac(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 er(e){var t;return{entityRef:e.endModel.refId,multiplicity:e.multiplicity,navigable:e.navigable,composition:e.composition,attributeRef:(t=e.attribute)==null?void 0:t.modelId,jpa:ac(e)}}function Zp(e){var i,a;const t={modelId:e.modelId,description:e.description,end1:er(e.end1),end2:er(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:t,layout:o}}function rc(e){var t;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("RELATION")&&(((t=e.dbAttrs)==null?void 0:t.length)??0)>0}function lc(e){var t;return!!e&&typeof e.attrType=="string"&&e.attrType.startsWith("EMBED")&&(((t=e.dbAttrs)==null?void 0:t.length)??0)>0}function sc(e){var o;const t=e.attribute;return(t==null?void 0:t.attrType)==="EMBED_OWN"&&(((o=t.dbAttrs)==null?void 0:o.length)??0)===0&&(e.multiplicity==="ZERO_OR_MORE_INSTANCES"||e.multiplicity==="ONE_OR_MORE_INSTANCES")}function cc(e,t){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:t,dbAttrs:(e.dbAttrs??[]).map(ic)}}function Qp(e,t,o){var k,g;const i=rc(e.end1.attribute),a=rc(e.end2.attribute);if(i===a)return Zp(e);const r=i?e.end1:e.end2,l=i?e.end2:e.end1,s=r.attribute,c=(g=(k=s.dbAttrs)==null?void 0:k[0])==null?void 0:g.targetModelId,d=c?o.get(c):void 0,u=t.get(l.endModel.refId),m=u?u.attributes.reduce((N,h)=>Math.max(N,h.order),-1)+1:s.order??0,p={...cc(s,m),attrType:"RELATION_OWN",derivedFrom:d?{associationRef:e.modelId,sourceAttributeRef:d}:void 0};u&&u.attributes.push(p);const f=(N,h)=>({entityRef:N.endModel.refId,multiplicity:N.multiplicity,navigable:N.navigable,composition:N.composition,attributeRef:h?d:p.modelId,legacyNavRaw:h?void 0:N.attribute,jpa:ac(N)}),y={modelId:e.modelId,description:e.description,end1:f(e.end1,i),end2:f(e.end2,a)},b={associationRef:e.modelId,waypoints:e.locations??[],sourceColumnRef:y.end1.attributeRef,targetColumnRef:y.end2.attributeRef,style:e.style};return{assoc:y,layout:b}}function eh(e,t){const o=e.targetModelId?t.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 th(e,t,o){var y;const i=((y=e.end1.attribute)==null?void 0:y.attrType)==="EMBED_OWN",a=i?e.end1:e.end2,r=i?e.end2:e.end1,l=a.attribute,s=t.get(r.endModel.refId),c=s?s.attributes.reduce((b,k)=>Math.max(b,k.order),-1)+1:l.order??0,d={...cc(l,c),attrType:l.attrType??"EMBED_OWN",dbAttrs:(l.dbAttrs??[]).map(b=>eh(b,o)),embedded:{associationRef:e.modelId,embeddableRef:a.endModel.refId}};s&&s.attributes.push(d);const u=b=>({...er(b),legacyEmbedRaw:b.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 nh(e,t){var i,a,r,l;const o=[];for(const s of t){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 dc(e,t={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=nh(o,s);u.length&&(d=u)}return{modelId:o,memo:i,geo:{location:{x:a.location.x+t.x,y:a.location.y+t.y},size:a.size},style:r,connections:d,legacyRaw:Object.keys(c).length?c:void 0}}function uc(e,t,o){if(!(o!=null&&o.length))return;const i=new Map(e.map(l=>[l.modelId,l])),a=new Map(t.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 oh(e){return(e.schemaVersion??1)>=2&&"logical"in e?ih(e):ah(e)}function ih(e){const t=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),{version:s,...c}=e.layout;uc(a,r,c.associationLayouts);const d={logical:{modelId:e.logical.modelId??t,packageName:e.logical.packageName,entities:a,associations:r,groups:l},layout:{...c,diagramId:c.diagramId??t,logicalModelRef:c.logicalModelRef??t}},u={id:e.id,version:e.version,diagramVersion:e.diagramVersion,size:e.size,packageName:e.packageName,schemaVersion:e.schemaVersion,opWriteEnabled:e.opWriteEnabled,revSeed:{revs:o,layoutVersion:s??0,logicalVersion:e.logical.version??0}};return{state:d,meta:u}}function ah(e){var g,N;const t=e.id??"",o=[],i=[],a=[],r=[],l=[],s=[],c=[],d=(h,w)=>{o.push(Xp(h));const q=Jp(h);q.geo={location:{x:q.geo.location.x+w.x,y:q.geo.location.y+w.y},size:q.geo.size},i.push(q);for(const P of h.ownedAssociations??[])c.push(P)},u={x:0,y:0};for(const h of e.entities??[])d(h,u);const m=[];for(const h of e.groups??[]){const w=h.entities??[];l.push({modelId:h.modelId,name:h.name,description:h.description,packageName:h.packageName,excludeDDLGeneration:h.excludeDDLGeneration??!1,memberEntityRefs:w.map(P=>P.modelId)});const q=((g=h.geo)==null?void 0:g.location)??u;if(h.geo){const P=(h.notes??[]).map(W=>W.modelId);s.push({groupRef:h.modelId,geo:h.geo,style:h.style,locked:h.locked,memberNoteRefs:P.length?P:void 0})}for(const P of w)d(P,q);for(const P of h.notes??[])m.push(dc(P,q))}const p=new Map(o.map(h=>[h.modelId,h])),f=new Map,y=new Map;for(const h of o)for(const w of h.attributes)for(const q of w.dbAttrs)f.set(q.modelId,w.modelId),y.set(q.modelId,q);for(const h of c)for(const w of[h.end1,h.end2]){const q=w.attribute;if(q&&(((N=q.dbAttrs)==null?void 0:N.length)??0)>0)for(const P of q.dbAttrs)P.modelId&&f.set(P.modelId,q.modelId)}for(const h of c){const w=lc(h.end1.attribute),q=lc(h.end2.attribute),P=sc(h.end1)||sc(h.end2),{assoc:W,layout:M}=w!==q||P?th(h,p,y):Qp(h,p,f);a.push(W),r.push(M)}uc(o,a,r),Yl(o);const b={logical:{modelId:t,packageName:e.packageName,entities:o,associations:a,groups:l},layout:{diagramId:t,logicalModelRef:t,canvasSize:e.size,entityLayouts:i,associationLayouts:r,groupLayouts:s,notes:[...(e.notes??[]).map(h=>dc(h)),...m]}},k={id:e.id,version:e.version,diagramVersion:e.diagramVersion,size:e.size,packageName:e.packageName,schemaVersion:e.schemaVersion??1};return{state:b,meta:k}}function mc(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 rh(e,t){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(mc),style:t}}function lh(e,t){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:t}}function sh(e){return{modelId:e.modelId,name:e.name,unique:e.unique,description:e.description,parameters:e.parameters,indexColumns:e.columns.map(t=>({targetColumn:{refId:t.columnRef},descending:t.descending}))}}function Kt(e,t){return{endModel:{refId:e.entityRef},multiplicity:e.multiplicity,navigable:e.navigable,composition:e.composition,jpaAttribute:e.jpa,attribute:t??(e.attributeRef?{modelId:e.attributeRef}:void 0)}}function ch(e,t){const o=t==null?void 0:t.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{...mc(i),targetModelId:(r=o==null?void 0:o.dbAttrs[a])==null?void 0:r.modelId}})}}function dh(e){const t=new Set;for(const o of e.logical.associations){const i=o.end1.legacyNavRaw?o.end1:o.end2.legacyNavRaw?o.end2:void 0;i!=null&&i.attributeRef&&t.add(i.attributeRef)}return t}function uh(e){const t=new Set;for(const o of e.logical.entities)for(const i of o.attributes)i.embedded&&t.add(i.modelId);return t}function mh(e,t){return e===t||JSON.stringify(e??null)===JSON.stringify(t??null)}function fh(e,t){const o=(i,a)=>i===a?void 0:i;return{modelId:e.modelId,targetModelId:t==null?void 0:t.modelId,physicalName:e.physicalName===((t==null?void 0:t.physicalName)??"")?"":e.physicalName,logicalName:mh(e.logicalName,t==null?void 0:t.logicalName)?void 0:e.logicalName,dataType:e.dataType===((t==null?void 0:t.dataType)??"")?"":e.dataType,length:o(e.length,t==null?void 0:t.length),scale:o(e.scale,t==null?void 0:t.scale),unique:o(e.unique,t==null?void 0:t.unique),autoIncrement:o(e.autoIncrement,t==null?void 0:t.autoIncrement),updatable:o(e.updatable,t==null?void 0:t.updatable),insertable:o(e.insertable,t==null?void 0:t.insertable)}}function ph(e,t,o){let i;for(const m of t.logical.entities){const p=m.attributes.find(f=>{var y;return((y=f.embedded)==null?void 0:y.associationRef)===e.modelId});if(p){i=p;break}}if(!i)return;const a=i.embedded.embeddableRef,r=t.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)=>fh(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:Kt(e.end1,c?s:u),end2:Kt(e.end2,c?u:s)}}function hh(e,t,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:Kt(e.end1,e.end1.legacyEmbedRaw),end2:Kt(e.end2,e.end2.legacyEmbedRaw)};const a=ph(e,t,i);if(a)return a;const r=!!e.end1.legacyNavRaw,l=!!e.end2.legacyNavRaw;if(r!==l){const s=r?e.end1:e.end2,c=r?e.end2:e.end1,d=t.logical.entities.find(y=>y.modelId===s.entityRef),u=d==null?void 0:d.attributes.find(y=>y.modelId===s.attributeRef),m=t.logical.entities.find(y=>y.modelId===c.entityRef),p=u?ch(u,m):void 0,f=s.legacyNavRaw;return{...i,end1:Kt(e.end1,r?f:p),end2:Kt(e.end2,l?f:p)}}return{...i,end1:Kt(e.end1),end2:Kt(e.end2)}}function fc(e,t,o,i,a={x:0,y:0}){var u,m;const r=t.layout.entityLayouts.find(p=>p.entityRef===e.modelId),l=t.logical.associations.filter(p=>p.end1.entityRef===e.modelId),s=p=>t.layout.associationLayouts.find(f=>f.associationRef===p),c=(r==null?void 0:r.geo)??{...oc},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 rh(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 lh(p,(f=r==null?void 0:r.operationStyles)==null?void 0:f[p.modelId])}),ownedAssociations:l.map(p=>hh(p,t,s(p.modelId))),indexes:(m=e.indexes)==null?void 0:m.map(sh),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 yh(e,t,o,i){const a=t.layout.groupLayouts.find(c=>c.groupRef===e.modelId),r=e.memberEntityRefs.map(c=>t.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=>t.layout.notes.find(d=>d.modelId===c)).filter(c=>!!c).map(c=>pc(c,l));return{modelId:e.modelId,name:e.name,description:e.description,packageName:e.packageName,excludeDDLGeneration:e.excludeDDLGeneration,entities:r.map(c=>fc(c,t,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 pc(e,t={x:0,y:0}){return{...e.legacyRaw,modelId:e.modelId,memo:e.memo,geo:{location:{x:e.geo.location.x-t.x,y:e.geo.location.y-t.y},size:e.geo.size},style:e.style,connections:e.connections}}function gh(e,t={}){const o=new Set(e.logical.groups.flatMap(s=>s.memberEntityRefs)),i=e.logical.entities.filter(s=>!o.has(s.modelId)),a=dh(e),r=uh(e),l=new Set(e.layout.groupLayouts.flatMap(s=>s.memberNoteRefs??[]));return{id:t.id,diagramVersion:t.diagramVersion,version:t.version,size:t.size??e.layout.canvasSize,packageName:t.packageName??e.logical.packageName,entities:i.map(s=>fc(s,e,a,r)),groups:e.logical.groups.map(s=>yh(s,e,a,r)),notes:e.layout.notes.filter(s=>!l.has(s.modelId)).map(s=>pc(s))}}function bh(e,t={}){var a,r,l;const o=((a=t.revSeed)==null?void 0:a.revs)??{},i=s=>({...s,rev:o[s.modelId]??0});return{id:t.id,schemaVersion:2,opWriteEnabled:t.opWriteEnabled,version:t.version,diagramVersion:t.diagramVersion,packageName:t.packageName,size:t.size,logical:{version:((r=t.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=t.revSeed)==null?void 0:l.layoutVersion)??0}}}function yo(e){return n.getCurrentScope()?(n.onScopeDispose(e),!0):!1}function Bt(e){return typeof e=="function"?e():n.unref(e)}const _h=typeof window<"u"&&typeof document<"u",kh=e=>typeof e<"u",Eh=Object.prototype.toString,wh=e=>Eh.call(e)==="[object Object]",Nh=()=>{};function vh(e,t){function o(...i){return new Promise((a,r)=>{Promise.resolve(e(()=>t.apply(this,i),{fn:t,thisArg:this,args:i})).then(a).catch(r)})}return o}const hc=e=>e();function xh(e=hc){const t=n.ref(!0);function o(){t.value=!1}function i(){t.value=!0}const a=(...r)=>{t.value&&e(...r)};return{isActive:n.readonly(t),pause:o,resume:i,eventFilter:a}}function yc(e,t=!1,o="Timeout"){return new Promise((i,a)=>{setTimeout(t?()=>a(o):i,e)})}function Ch(e,t,o={}){const{eventFilter:i=hc,...a}=o;return n.watch(e,vh(i,t),a)}function Pn(e,t,o={}){const{eventFilter:i,...a}=o,{eventFilter:r,pause:l,resume:s,isActive:c}=xh(i);return{stop:Ch(e,t,{...a,eventFilter:r}),pause:l,resume:s,isActive:c}}function Ih(e,t={}){if(!n.isRef(e))return n.toRefs(e);const o=Array.isArray(e.value)?Array.from({length:e.value.length}):{};for(const i in e.value)o[i]=n.customRef(()=>({get(){return e.value[i]},set(a){var r;if((r=Bt(t.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 tr(e,t=!1){function o(m,{flush:p="sync",deep:f=!1,timeout:y,throwOnTimeout:b}={}){let k=null;const N=[new Promise(h=>{k=n.watch(e,w=>{m(w)!==t&&(k==null||k(),h(w))},{flush:p,deep:f,immediate:!0})})];return y!=null&&N.push(yc(y,b).then(()=>Bt(e)).finally(()=>k==null?void 0:k())),Promise.race(N)}function i(m,p){if(!n.isRef(m))return o(w=>w===m,p);const{flush:f="sync",deep:y=!1,timeout:b,throwOnTimeout:k}=p??{};let g=null;const h=[new Promise(w=>{g=n.watch([e,m],([q,P])=>{t!==(q===P)&&(g==null||g(),w(q))},{flush:f,deep:y,immediate:!0})})];return b!=null&&h.push(yc(b,k).then(()=>Bt(e)).finally(()=>(g==null||g(),Bt(e)))),Promise.race(h)}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 y=Array.from(f);return y.includes(m)||y.includes(Bt(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(Bt(e))?{toMatch:o,toContains:c,changed:d,changedTimes:u,get not(){return tr(e,!t)}}:{toMatch:o,toBe:i,toBeTruthy:a,toBeNull:r,toBeNaN:s,toBeUndefined:l,changed:d,changedTimes:u,get not(){return tr(e,!t)}}}function nr(e){return tr(e)}function Sh(e){var t;const o=Bt(e);return(t=o==null?void 0:o.$el)!=null?t:o}const gc=_h?window:void 0;function bc(...e){let t,o,i,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([o,i,a]=e,t=gc):[t,o,i,a]=e,!t)return Nh;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=n.watch(()=>[Sh(t),Bt(a)],([u,m])=>{if(l(),!u)return;const p=wh(m)?{...m}:m;r.push(...o.flatMap(f=>i.map(y=>s(u,f,y,p))))},{immediate:!0,flush:"post"}),d=()=>{c(),l()};return yo(d),d}function $h(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function _c(...e){let t,o,i={};e.length===3?(t=e[0],o=e[1],i=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,o=e[0],i=e[1]):(t=e[0],o=e[1]):(t=!0,o=e[0]);const{target:a=gc,eventName:r="keydown",passive:l=!1,dedupe:s=!1}=i,c=$h(t);return bc(a,r,u=>{u.repeat&&Bt(s)||c(u)&&o(u)},l)}function Rh(e){return JSON.parse(JSON.stringify(e))}function or(e,t,o,i={}){var a,r,l;const{clone:s=!1,passive:c=!1,eventName:d,deep:u=!1,defaultValue:m,shouldEmit:p}=i,f=n.getCurrentInstance(),y=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 b=d;t||(t="modelValue"),b=b||`update:${t.toString()}`;const k=h=>s?typeof s=="function"?s(h):Rh(h):h,g=()=>kh(e[t])?k(e[t]):m,N=h=>{p?p(h)&&y(b,h):y(b,h)};if(c){const h=g(),w=n.ref(h);let q=!1;return n.watch(()=>e[t],P=>{q||(q=!0,w.value=k(P),n.nextTick(()=>q=!1))}),n.watch(w,P=>{!q&&(P!==e[t]||u)&&N(P)},{deep:u}),w}else return n.computed({get(){return g()},set(h){N(h)}})}var Ah={value:()=>{}};function wi(){for(var e=0,t=arguments.length,o={},i;e<t;++e){if(!(i=arguments[e]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new Ni(o)}function Ni(e){this._=e}function Th(e,t){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&&!t.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}Ni.prototype=wi.prototype={constructor:Ni,on:function(e,t){var o=this._,i=Th(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=Vh(o[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<l;)if(a=(e=i[r]).type)o[a]=kc(o[a],e.name,t);else if(t==null)for(a in o)o[a]=kc(o[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var o in t)e[o]=t[o].slice();return new Ni(e)},call:function(e,t){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(t,o)},apply:function(e,t,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(t,o)}};function Vh(e,t){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===t)return a.value}function kc(e,t,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=Ah,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:t,value:o}),e}var ir="http://www.w3.org/1999/xhtml";const Ec={svg:"http://www.w3.org/2000/svg",xhtml:ir,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function vi(e){var t=e+="",o=t.indexOf(":");return o>=0&&(t=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),Ec.hasOwnProperty(t)?{space:Ec[t],local:e}:e}function Mh(e){return function(){var t=this.ownerDocument,o=this.namespaceURI;return o===ir&&t.documentElement.namespaceURI===ir?t.createElement(e):t.createElementNS(o,e)}}function Bh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function wc(e){var t=vi(e);return(t.local?Bh:Mh)(t)}function Dh(){}function ar(e){return e==null?Dh:function(){return this.querySelector(e)}}function Oh(e){typeof e!="function"&&(e=ar(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 ft(i,this._parents)}function Ph(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Lh(){return[]}function Nc(e){return e==null?Lh:function(){return this.querySelectorAll(e)}}function zh(e){return function(){return Ph(e.apply(this,arguments))}}function Uh(e){typeof e=="function"?e=zh(e):e=Nc(e);for(var t=this._groups,o=t.length,i=[],a=[],r=0;r<o;++r)for(var l=t[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 ft(i,a)}function vc(e){return function(){return this.matches(e)}}function xc(e){return function(t){return t.matches(e)}}var Hh=Array.prototype.find;function Fh(e){return function(){return Hh.call(this.children,e)}}function Gh(){return this.firstElementChild}function jh(e){return this.select(e==null?Gh:Fh(typeof e=="function"?e:xc(e)))}var Kh=Array.prototype.filter;function Yh(){return Array.from(this.children)}function Wh(e){return function(){return Kh.call(this.children,e)}}function qh(e){return this.selectAll(e==null?Yh:Wh(typeof e=="function"?e:xc(e)))}function Xh(e){typeof e!="function"&&(e=vc(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 ft(i,this._parents)}function Cc(e){return new Array(e.length)}function Jh(){return new ft(this._enter||this._groups.map(Cc),this._parents)}function xi(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}xi.prototype={constructor:xi,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Zh(e){return function(){return e}}function Qh(e,t,o,i,a,r){for(var l=0,s,c=t.length,d=r.length;l<d;++l)(s=t[l])?(s.__data__=r[l],i[l]=s):o[l]=new xi(e,r[l]);for(;l<c;++l)(s=t[l])&&(a[l]=s)}function ey(e,t,o,i,a,r,l){var s,c,d=new Map,u=t.length,m=r.length,p=new Array(u),f;for(s=0;s<u;++s)(c=t[s])&&(p[s]=f=l.call(c,c.__data__,s,t)+"",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 xi(e,r[s]);for(s=0;s<u;++s)(c=t[s])&&d.get(p[s])===c&&(a[s]=c)}function ty(e){return e.__data__}function ny(e,t){if(!arguments.length)return Array.from(this,ty);var o=t?ey:Qh,i=this._parents,a=this._groups;typeof e!="function"&&(e=Zh(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=oy(e.call(u,u&&u.__data__,d,i)),y=f.length,b=s[d]=new Array(y),k=l[d]=new Array(y),g=c[d]=new Array(p);o(u,m,b,k,g,f,t);for(var N=0,h=0,w,q;N<y;++N)if(w=b[N]){for(N>=h&&(h=N+1);!(q=k[h])&&++h<y;);w._next=q||null}}return l=new ft(l,i),l._enter=s,l._exit=c,l}function oy(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function iy(){return new ft(this._exit||this._groups.map(Cc),this._parents)}function ay(e,t,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+""),t!=null&&(a=t(a),a&&(a=a.selection())),o==null?r.remove():o(r),i&&a?i.merge(a).order():a}function ry(e){for(var t=e.selection?e.selection():e,o=this._groups,i=t._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,y=0;y<m;++y)(f=d[y]||u[y])&&(p[y]=f);for(;c<a;++c)s[c]=o[c];return new ft(s,this._parents)}function ly(){for(var e=this._groups,t=-1,o=e.length;++t<o;)for(var i=e[t],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 sy(e){e||(e=cy);function t(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(t)}return new ft(a,this._parents).order()}function cy(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function dy(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function uy(){return Array.from(this)}function my(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,r=i.length;a<r;++a){var l=i[a];if(l)return l}return null}function fy(){let e=0;for(const t of this)++e;return e}function py(){return!this.node()}function hy(e){for(var t=this._groups,o=0,i=t.length;o<i;++o)for(var a=t[o],r=0,l=a.length,s;r<l;++r)(s=a[r])&&e.call(s,s.__data__,r,a);return this}function yy(e){return function(){this.removeAttribute(e)}}function gy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function by(e,t){return function(){this.setAttribute(e,t)}}function _y(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function ky(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function Ey(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,o)}}function wy(e,t){var o=vi(e);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((t==null?o.local?gy:yy:typeof t=="function"?o.local?Ey:ky:o.local?_y:by)(o,t))}function Ic(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ny(e){return function(){this.style.removeProperty(e)}}function vy(e,t,o){return function(){this.style.setProperty(e,t,o)}}function xy(e,t,o){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function Cy(e,t,o){return arguments.length>1?this.each((t==null?Ny:typeof t=="function"?xy:vy)(e,t,o??"")):Ln(this.node(),e)}function Ln(e,t){return e.style.getPropertyValue(t)||Ic(e).getComputedStyle(e,null).getPropertyValue(t)}function Iy(e){return function(){delete this[e]}}function Sy(e,t){return function(){this[e]=t}}function $y(e,t){return function(){var o=t.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function Ry(e,t){return arguments.length>1?this.each((t==null?Iy:typeof t=="function"?$y:Sy)(e,t)):this.node()[e]}function Sc(e){return e.trim().split(/^|\s+/)}function rr(e){return e.classList||new $c(e)}function $c(e){this._node=e,this._names=Sc(e.getAttribute("class")||"")}$c.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Rc(e,t){for(var o=rr(e),i=-1,a=t.length;++i<a;)o.add(t[i])}function Ac(e,t){for(var o=rr(e),i=-1,a=t.length;++i<a;)o.remove(t[i])}function Ay(e){return function(){Rc(this,e)}}function Ty(e){return function(){Ac(this,e)}}function Vy(e,t){return function(){(t.apply(this,arguments)?Rc:Ac)(this,e)}}function My(e,t){var o=Sc(e+"");if(arguments.length<2){for(var i=rr(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof t=="function"?Vy:t?Ay:Ty)(o,t))}function By(){this.textContent=""}function Dy(e){return function(){this.textContent=e}}function Oy(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Py(e){return arguments.length?this.each(e==null?By:(typeof e=="function"?Oy:Dy)(e)):this.node().textContent}function Ly(){this.innerHTML=""}function zy(e){return function(){this.innerHTML=e}}function Uy(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Hy(e){return arguments.length?this.each(e==null?Ly:(typeof e=="function"?Uy:zy)(e)):this.node().innerHTML}function Fy(){this.nextSibling&&this.parentNode.appendChild(this)}function Gy(){return this.each(Fy)}function jy(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ky(){return this.each(jy)}function Yy(e){var t=typeof e=="function"?e:wc(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Wy(){return null}function qy(e,t){var o=typeof e=="function"?e:wc(e),i=t==null?Wy:typeof t=="function"?t:ar(t);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function Xy(){var e=this.parentNode;e&&e.removeChild(this)}function Jy(){return this.each(Xy)}function Zy(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qy(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function eg(e){return this.select(e?Qy:Zy)}function tg(e){return arguments.length?this.property("__data__",e):this.node().__data__}function ng(e){return function(t){e.call(this,t,this.__data__)}}function og(e){return e.trim().split(/^|\s+/).map(function(t){var o="",i=t.indexOf(".");return i>=0&&(o=t.slice(i+1),t=t.slice(0,i)),{type:t,name:o}})}function ig(e){return function(){var t=this.__on;if(t){for(var o=0,i=-1,a=t.length,r;o<a;++o)r=t[o],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++i]=r;++i?t.length=i:delete this.__on}}}function ag(e,t,o){return function(){var i=this.__on,a,r=ng(t);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=t;return}}this.addEventListener(e.type,r,o),a={type:e.type,name:e.name,value:t,listener:r,options:o},i?i.push(a):this.__on=[a]}}function rg(e,t,o){var i=og(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=t?ag:ig,a=0;a<r;++a)this.each(s(i[a],t,o));return this}function Tc(e,t,o){var i=Ic(e),a=i.CustomEvent;typeof a=="function"?a=new a(t,o):(a=i.document.createEvent("Event"),o?(a.initEvent(t,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function lg(e,t){return function(){return Tc(this,e,t)}}function sg(e,t){return function(){return Tc(this,e,t.apply(this,arguments))}}function cg(e,t){return this.each((typeof t=="function"?sg:lg)(e,t))}function*dg(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,r=i.length,l;a<r;++a)(l=i[a])&&(yield l)}var Vc=[null];function ft(e,t){this._groups=e,this._parents=t}function go(){return new ft([[document.documentElement]],Vc)}function ug(){return this}ft.prototype=go.prototype={constructor:ft,select:Oh,selectAll:Uh,selectChild:jh,selectChildren:qh,filter:Xh,data:ny,enter:Jh,exit:iy,join:ay,merge:ry,selection:ug,order:ly,sort:sy,call:dy,nodes:uy,node:my,size:fy,empty:py,each:hy,attr:wy,style:Cy,property:Ry,classed:My,text:Py,html:Hy,raise:Gy,lower:Ky,append:Yy,insert:qy,remove:Jy,clone:eg,datum:tg,on:rg,dispatch:cg,[Symbol.iterator]:dg};function gt(e){return typeof e=="string"?new ft([[document.querySelector(e)]],[document.documentElement]):new ft([[e]],Vc)}function mg(e){let t;for(;t=e.sourceEvent;)e=t;return e}function xt(e,t){if(e=mg(e),t===void 0&&(t=e.currentTarget),t){var o=t.ownerSVGElement||t;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const fg={passive:!1},bo={capture:!0,passive:!1};function lr(e){e.stopImmediatePropagation()}function zn(e){e.preventDefault(),e.stopImmediatePropagation()}function Mc(e){var t=e.document.documentElement,o=gt(e).on("dragstart.drag",zn,bo);"onselectstart"in t?o.on("selectstart.drag",zn,bo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Bc(e,t){var o=e.document.documentElement,i=gt(e).on("dragstart.drag",null);t&&(i.on("click.drag",zn,bo),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 Ci=e=>()=>e;function sr(e,{sourceEvent:t,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:t,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}})}sr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function pg(e){return!e.ctrlKey&&!e.button}function hg(){return this.parentNode}function yg(e,t){return t??{x:e.x,y:e.y}}function gg(){return navigator.maxTouchPoints||"ontouchstart"in this}function bg(){var e=pg,t=hg,o=yg,i=gg,a={},r=wi("start","drag","end"),l=0,s,c,d,u,m=0;function p(w){w.on("mousedown.drag",f).filter(i).on("touchstart.drag",k).on("touchmove.drag",g,fg).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(w,q){if(!(u||!e.call(this,w,q))){var P=h(this,t.call(this,w,q),w,q,"mouse");P&&(gt(w.view).on("mousemove.drag",y,bo).on("mouseup.drag",b,bo),Mc(w.view),lr(w),d=!1,s=w.clientX,c=w.clientY,P("start",w))}}function y(w){if(zn(w),!d){var q=w.clientX-s,P=w.clientY-c;d=q*q+P*P>m}a.mouse("drag",w)}function b(w){gt(w.view).on("mousemove.drag mouseup.drag",null),Bc(w.view,d),zn(w),a.mouse("end",w)}function k(w,q){if(e.call(this,w,q)){var P=w.changedTouches,W=t.call(this,w,q),M=P.length,$,D;for($=0;$<M;++$)(D=h(this,W,w,q,P[$].identifier,P[$]))&&(lr(w),D("start",w,P[$]))}}function g(w){var q=w.changedTouches,P=q.length,W,M;for(W=0;W<P;++W)(M=a[q[W].identifier])&&(zn(w),M("drag",w,q[W]))}function N(w){var q=w.changedTouches,P=q.length,W,M;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),W=0;W<P;++W)(M=a[q[W].identifier])&&(lr(w),M("end",w,q[W]))}function h(w,q,P,W,M,$){var D=r.copy(),J=xt($||P,q),B,re,_;if((_=o.call(w,new sr("beforestart",{sourceEvent:P,target:p,identifier:M,active:l,x:J[0],y:J[1],dx:0,dy:0,dispatch:D}),W))!=null)return B=_.x-J[0]||0,re=_.y-J[1]||0,function K(R,X,ee){var oe=J,U;switch(R){case"start":a[M]=K,U=l++;break;case"end":delete a[M],--l;case"drag":J=xt(ee||X,q),U=l;break}D.call(R,w,new sr(R,{sourceEvent:X,subject:_,target:p,identifier:M,active:U,x:J[0]+B,y:J[1]+re,dx:J[0]-oe[0],dy:J[1]-oe[1],dispatch:D}),W)}}return p.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Ci(!!w),p):e},p.container=function(w){return arguments.length?(t=typeof w=="function"?w:Ci(w),p):t},p.subject=function(w){return arguments.length?(o=typeof w=="function"?w:Ci(w),p):o},p.touchable=function(w){return arguments.length?(i=typeof w=="function"?w:Ci(!!w),p):i},p.on=function(){var w=r.on.apply(r,arguments);return w===r?p:w},p.clickDistance=function(w){return arguments.length?(m=(w=+w)*w,p):Math.sqrt(m)},p}function cr(e,t,o){e.prototype=t.prototype=o,o.constructor=e}function Dc(e,t){var o=Object.create(e.prototype);for(var i in t)o[i]=t[i];return o}function _o(){}var ko=.7,Ii=1/ko,Un="\\s*([+-]?\\d+)\\s*",Eo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ct="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",_g=/^#([0-9a-f]{3,8})$/,kg=new RegExp(`^rgb\\(${Un},${Un},${Un}\\)$`),Eg=new RegExp(`^rgb\\(${Ct},${Ct},${Ct}\\)$`),wg=new RegExp(`^rgba\\(${Un},${Un},${Un},${Eo}\\)$`),Ng=new RegExp(`^rgba\\(${Ct},${Ct},${Ct},${Eo}\\)$`),vg=new RegExp(`^hsl\\(${Eo},${Ct},${Ct}\\)$`),xg=new RegExp(`^hsla\\(${Eo},${Ct},${Ct},${Eo}\\)$`),Oc={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};cr(_o,sn,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Pc,formatHex:Pc,formatHex8:Cg,formatHsl:Ig,formatRgb:Lc,toString:Lc});function Pc(){return this.rgb().formatHex()}function Cg(){return this.rgb().formatHex8()}function Ig(){return Gc(this).formatHsl()}function Lc(){return this.rgb().formatRgb()}function sn(e){var t,o;return e=(e+"").trim().toLowerCase(),(t=_g.exec(e))?(o=t[1].length,t=parseInt(t[1],16),o===6?zc(t):o===3?new ct(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):o===8?Si(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):o===4?Si(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=kg.exec(e))?new ct(t[1],t[2],t[3],1):(t=Eg.exec(e))?new ct(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=wg.exec(e))?Si(t[1],t[2],t[3],t[4]):(t=Ng.exec(e))?Si(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vg.exec(e))?Fc(t[1],t[2]/100,t[3]/100,1):(t=xg.exec(e))?Fc(t[1],t[2]/100,t[3]/100,t[4]):Oc.hasOwnProperty(e)?zc(Oc[e]):e==="transparent"?new ct(NaN,NaN,NaN,0):null}function zc(e){return new ct(e>>16&255,e>>8&255,e&255,1)}function Si(e,t,o,i){return i<=0&&(e=t=o=NaN),new ct(e,t,o,i)}function Sg(e){return e instanceof _o||(e=sn(e)),e?(e=e.rgb(),new ct(e.r,e.g,e.b,e.opacity)):new ct}function dr(e,t,o,i){return arguments.length===1?Sg(e):new ct(e,t,o,i??1)}function ct(e,t,o,i){this.r=+e,this.g=+t,this.b=+o,this.opacity=+i}cr(ct,dr,Dc(_o,{brighter(e){return e=e==null?Ii:Math.pow(Ii,e),new ct(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new ct(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ct(cn(this.r),cn(this.g),cn(this.b),$i(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:Uc,formatHex:Uc,formatHex8:$g,formatRgb:Hc,toString:Hc}));function Uc(){return`#${dn(this.r)}${dn(this.g)}${dn(this.b)}`}function $g(){return`#${dn(this.r)}${dn(this.g)}${dn(this.b)}${dn((isNaN(this.opacity)?1:this.opacity)*255)}`}function Hc(){const e=$i(this.opacity);return`${e===1?"rgb(":"rgba("}${cn(this.r)}, ${cn(this.g)}, ${cn(this.b)}${e===1?")":`, ${e})`}`}function $i(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function cn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dn(e){return e=cn(e),(e<16?"0":"")+e.toString(16)}function Fc(e,t,o,i){return i<=0?e=t=o=NaN:o<=0||o>=1?e=t=NaN:t<=0&&(e=NaN),new bt(e,t,o,i)}function Gc(e){if(e instanceof bt)return new bt(e.h,e.s,e.l,e.opacity);if(e instanceof _o||(e=sn(e)),!e)return new bt;if(e instanceof bt)return e;e=e.rgb();var t=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(t,o,i),r=Math.max(t,o,i),l=NaN,s=r-a,c=(r+a)/2;return s?(t===r?l=(o-i)/s+(o<i)*6:o===r?l=(i-t)/s+2:l=(t-o)/s+4,s/=c<.5?r+a:2-r-a,l*=60):s=c>0&&c<1?0:l,new bt(l,s,c,e.opacity)}function Rg(e,t,o,i){return arguments.length===1?Gc(e):new bt(e,t,o,i??1)}function bt(e,t,o,i){this.h=+e,this.s=+t,this.l=+o,this.opacity=+i}cr(bt,Rg,Dc(_o,{brighter(e){return e=e==null?Ii:Math.pow(Ii,e),new bt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new bt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,i=o+(o<.5?o:1-o)*t,a=2*o-i;return new ct(ur(e>=240?e-240:e+120,a,i),ur(e,a,i),ur(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new bt(jc(this.h),Ri(this.s),Ri(this.l),$i(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=$i(this.opacity);return`${e===1?"hsl(":"hsla("}${jc(this.h)}, ${Ri(this.s)*100}%, ${Ri(this.l)*100}%${e===1?")":`, ${e})`}`}}));function jc(e){return e=(e||0)%360,e<0?e+360:e}function Ri(e){return Math.max(0,Math.min(1,e||0))}function ur(e,t,o){return(e<60?t+(o-t)*e/60:e<180?o:e<240?t+(o-t)*(240-e)/60:t)*255}const mr=e=>()=>e;function Ag(e,t){return function(o){return e+o*t}}function Tg(e,t,o){return e=Math.pow(e,o),t=Math.pow(t,o)-e,o=1/o,function(i){return Math.pow(e+i*t,o)}}function Vg(e){return(e=+e)==1?Kc:function(t,o){return o-t?Tg(t,o,e):mr(isNaN(t)?o:t)}}function Kc(e,t){var o=t-e;return o?Ag(e,o):mr(isNaN(e)?t:e)}const Ai=(function e(t){var o=Vg(t);function i(a,r){var l=o((a=dr(a)).r,(r=dr(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=Kc(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 Mg(e,t){t||(t=[]);var o=e?Math.min(t.length,e.length):0,i=t.slice(),a;return function(r){for(a=0;a<o;++a)i[a]=e[a]*(1-r)+t[a]*r;return i}}function Bg(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Dg(e,t){var o=t?t.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]=wo(e[l],t[l]);for(;l<o;++l)r[l]=t[l];return function(s){for(l=0;l<i;++l)r[l]=a[l](s);return r}}function Og(e,t){var o=new Date;return e=+e,t=+t,function(i){return o.setTime(e*(1-i)+t*i),o}}function It(e,t){return e=+e,t=+t,function(o){return e*(1-o)+t*o}}function Pg(e,t){var o={},i={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?o[a]=wo(e[a],t[a]):i[a]=t[a];return function(r){for(a in o)i[a]=o[a](r);return i}}var fr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pr=new RegExp(fr.source,"g");function Lg(e){return function(){return e}}function zg(e){return function(t){return e(t)+""}}function Yc(e,t){var o=fr.lastIndex=pr.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",t=t+"";(i=fr.exec(e))&&(a=pr.exec(t));)(r=a.index)>o&&(r=t.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:It(i,a)})),o=pr.lastIndex;return o<t.length&&(r=t.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?zg(c[0].x):Lg(t):(t=c.length,function(d){for(var u=0,m;u<t;++u)s[(m=c[u]).i]=m.x(d);return s.join("")})}function wo(e,t){var o=typeof t,i;return t==null||o==="boolean"?mr(t):(o==="number"?It:o==="string"?(i=sn(t))?(t=i,Ai):Yc:t instanceof sn?Ai:t instanceof Date?Og:Bg(t)?Mg:Array.isArray(t)?Dg:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Pg:It)(e,t)}var Wc=180/Math.PI,hr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function qc(e,t,o,i,a,r){var l,s,c;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(c=e*o+t*i)&&(o-=e*c,i-=t*c),(s=Math.sqrt(o*o+i*i))&&(o/=s,i/=s,c/=s),e*i<t*o&&(e=-e,t=-t,c=-c,l=-l),{translateX:a,translateY:r,rotate:Math.atan2(t,e)*Wc,skewX:Math.atan(c)*Wc,scaleX:l,scaleY:s}}var Ti;function Ug(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?hr:qc(t.a,t.b,t.c,t.d,t.e,t.f)}function Hg(e){return e==null||(Ti||(Ti=document.createElementNS("http://www.w3.org/2000/svg","g")),Ti.setAttribute("transform",e),!(e=Ti.transform.baseVal.consolidate()))?hr:(e=e.matrix,qc(e.a,e.b,e.c,e.d,e.e,e.f))}function Xc(e,t,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,p,f,y){if(d!==m||u!==p){var b=f.push("translate(",null,t,null,o);y.push({i:b-4,x:It(d,m)},{i:b-2,x:It(u,p)})}else(m||p)&&f.push("translate("+m+t+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:It(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:It(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,p,f,y){if(d!==m||u!==p){var b=f.push(a(f)+"scale(",null,",",null,")");y.push({i:b-4,x:It(d,m)},{i:b-2,x:It(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 y=-1,b=p.length,k;++y<b;)m[(k=p[y]).i]=k.x(f);return m.join("")}}}var Fg=Xc(Ug,"px, ","px)","deg)"),Gg=Xc(Hg,", ",")",")"),jg=1e-12;function Jc(e){return((e=Math.exp(e))+1/e)/2}function Kg(e){return((e=Math.exp(e))-1/e)/2}function Yg(e){return((e=Math.exp(2*e))-1)/(e+1)}const Vi=(function e(t,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,y=m-c,b=f*f+y*y,k,g;if(b<jg)g=Math.log(p/d)/t,k=function(W){return[s+W*f,c+W*y,d*Math.exp(t*W*g)]};else{var N=Math.sqrt(b),h=(p*p-d*d+i*b)/(2*d*o*N),w=(p*p-d*d-i*b)/(2*p*o*N),q=Math.log(Math.sqrt(h*h+1)-h),P=Math.log(Math.sqrt(w*w+1)-w);g=(P-q)/t,k=function(W){var M=W*g,$=Jc(q),D=d/(o*N)*($*Yg(t*M+q)-Kg(q));return[s+D*f,c+D*y,d*$/Jc(t*M+q)]}}return k.duration=g*1e3*t/Math.SQRT2,k}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 Hn=0,No=0,vo=0,Zc=1e3,Mi,xo,Bi=0,un=0,Di=0,Co=typeof performance=="object"&&performance.now?performance:Date,Qc=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function yr(){return un||(Qc(Wg),un=Co.now()+Di)}function Wg(){un=0}function Oi(){this._call=this._time=this._next=null}Oi.prototype=ed.prototype={constructor:Oi,restart:function(e,t,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?yr():+o)+(t==null?0:+t),!this._next&&xo!==this&&(xo?xo._next=this:Mi=this,xo=this),this._call=e,this._time=o,gr()},stop:function(){this._call&&(this._call=null,this._time=1/0,gr())}};function ed(e,t,o){var i=new Oi;return i.restart(e,t,o),i}function qg(){yr(),++Hn;for(var e=Mi,t;e;)(t=un-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Hn}function td(){un=(Bi=Co.now())+Di,Hn=No=0;try{qg()}finally{Hn=0,Jg(),un=0}}function Xg(){var e=Co.now(),t=e-Bi;t>Zc&&(Di-=t,Bi=e)}function Jg(){for(var e,t=Mi,o,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(o=t._next,t._next=null,t=e?e._next=o:Mi=o);xo=e,gr(i)}function gr(e){if(!Hn){No&&(No=clearTimeout(No));var t=e-un;t>24?(e<1/0&&(No=setTimeout(td,e-Co.now()-Di)),vo&&(vo=clearInterval(vo))):(vo||(Bi=Co.now(),vo=setInterval(Xg,Zc)),Hn=1,Qc(td))}}function nd(e,t,o){var i=new Oi;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,o),i}var Zg=wi("start","end","cancel","interrupt"),Qg=[],od=0,id=1,br=2,Pi=3,ad=4,_r=5,Li=6;function zi(e,t,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;eb(e,o,{name:t,index:i,group:a,on:Zg,tween:Qg,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:od})}function kr(e,t){var o=_t(e,t);if(o.state>od)throw new Error("too late; already scheduled");return o}function St(e,t){var o=_t(e,t);if(o.state>Pi)throw new Error("too late; already running");return o}function _t(e,t){var o=e.__transition;if(!o||!(o=o[t]))throw new Error("transition not found");return o}function eb(e,t,o){var i=e.__transition,a;i[t]=o,o.timer=ed(r,0,o.time);function r(d){o.state=id,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!==id)return c();for(u in i)if(f=i[u],f.name===o.name){if(f.state===Pi)return nd(l);f.state===ad?(f.state=Li,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=Li,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(nd(function(){o.state===Pi&&(o.state=ad,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=br,o.on.call("start",e,e.__data__,o.index,o.group),o.state===br){for(o.state=Pi,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=_r,1),m=-1,p=a.length;++m<p;)a[m].call(e,u);o.state===_r&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=Li,o.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function Ui(e,t){var o=e.__transition,i,a,r=!0,l;if(o){t=t==null?null:t+"";for(l in o){if((i=o[l]).name!==t){r=!1;continue}a=i.state>br&&i.state<_r,i.state=Li,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function tb(e){return this.each(function(){Ui(this,e)})}function nb(e,t){var o,i;return function(){var a=St(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===t){i=i.slice(),i.splice(l,1);break}}a.tween=i}}function ob(e,t,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=St(this,e),l=r.tween;if(l!==i){a=(i=l).slice();for(var s={name:t,value:o},c=0,d=a.length;c<d;++c)if(a[c].name===t){a[c]=s;break}c===d&&a.push(s)}r.tween=a}}function ib(e,t){var o=this._id;if(e+="",arguments.length<2){for(var i=_t(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((t==null?nb:ob)(o,e,t))}function Er(e,t,o){var i=e._id;return e.each(function(){var a=St(this,i);(a.value||(a.value={}))[t]=o.apply(this,arguments)}),function(a){return _t(a,i).value[t]}}function rd(e,t){var o;return(typeof t=="number"?It:t instanceof sn?Ai:(o=sn(t))?(t=o,Ai):Yc)(e,t)}function ab(e){return function(){this.removeAttribute(e)}}function rb(e){return function(){this.removeAttributeNS(e.space,e.local)}}function lb(e,t,o){var i,a=o+"",r;return function(){var l=this.getAttribute(e);return l===a?null:l===i?r:r=t(i=l,o)}}function sb(e,t,o){var i,a=o+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===i?r:r=t(i=l,o)}}function cb(e,t,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=t(i=l,s)))}}function db(e,t,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=t(i=l,s)))}}function ub(e,t){var o=vi(e),i=o==="transform"?Gg:rd;return this.attrTween(e,typeof t=="function"?(o.local?db:cb)(o,i,Er(this,"attr."+e,t)):t==null?(o.local?rb:ab)(o):(o.local?sb:lb)(o,i,t))}function mb(e,t){return function(o){this.setAttribute(e,t.call(this,o))}}function fb(e,t){return function(o){this.setAttributeNS(e.space,e.local,t.call(this,o))}}function pb(e,t){var o,i;function a(){var r=t.apply(this,arguments);return r!==i&&(o=(i=r)&&fb(e,r)),o}return a._value=t,a}function hb(e,t){var o,i;function a(){var r=t.apply(this,arguments);return r!==i&&(o=(i=r)&&mb(e,r)),o}return a._value=t,a}function yb(e,t){var o="attr."+e;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;var i=vi(e);return this.tween(o,(i.local?pb:hb)(i,t))}function gb(e,t){return function(){kr(this,e).delay=+t.apply(this,arguments)}}function bb(e,t){return t=+t,function(){kr(this,e).delay=t}}function _b(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?gb:bb)(t,e)):_t(this.node(),t).delay}function kb(e,t){return function(){St(this,e).duration=+t.apply(this,arguments)}}function Eb(e,t){return t=+t,function(){St(this,e).duration=t}}function wb(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kb:Eb)(t,e)):_t(this.node(),t).duration}function Nb(e,t){if(typeof t!="function")throw new Error;return function(){St(this,e).ease=t}}function vb(e){var t=this._id;return arguments.length?this.each(Nb(t,e)):_t(this.node(),t).ease}function xb(e,t){return function(){var o=t.apply(this,arguments);if(typeof o!="function")throw new Error;St(this,e).ease=o}}function Cb(e){if(typeof e!="function")throw new Error;return this.each(xb(this._id,e))}function Ib(e){typeof e!="function"&&(e=vc(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 Dt(i,this._parents,this._name,this._id)}function Sb(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,o=e._groups,i=t.length,a=o.length,r=Math.min(i,a),l=new Array(i),s=0;s<r;++s)for(var c=t[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]=t[s];return new Dt(l,this._parents,this._name,this._id)}function $b(e){return(e+"").trim().split(/^|\s+/).every(function(t){var o=t.indexOf(".");return o>=0&&(t=t.slice(0,o)),!t||t==="start"})}function Rb(e,t,o){var i,a,r=$b(t)?kr:St;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(t,o),l.on=a}}function Ab(e,t){var o=this._id;return arguments.length<2?_t(this.node(),o).on.on(e):this.each(Rb(o,e,t))}function Tb(e){return function(){var t=this.parentNode;for(var o in this.__transition)if(+o!==e)return;t&&t.removeChild(this)}}function Vb(){return this.on("end.remove",Tb(this._id))}function Mb(e){var t=this._name,o=this._id;typeof e!="function"&&(e=ar(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,zi(d[p],t,o,p,d,_t(u,o)));return new Dt(r,this._parents,t,o)}function Bb(e){var t=this._name,o=this._id;typeof e!="function"&&(e=Nc(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,y=_t(u,o),b=0,k=p.length;b<k;++b)(f=p[b])&&zi(f,t,o,b,p,y);r.push(p),l.push(u)}return new Dt(r,l,t,o)}var Db=go.prototype.constructor;function Ob(){return new Db(this._groups,this._parents)}function Pb(e,t){var o,i,a;return function(){var r=Ln(this,e),l=(this.style.removeProperty(e),Ln(this,e));return r===l?null:r===o&&l===i?a:a=t(o=r,i=l)}}function ld(e){return function(){this.style.removeProperty(e)}}function Lb(e,t,o){var i,a=o+"",r;return function(){var l=Ln(this,e);return l===a?null:l===i?r:r=t(i=l,o)}}function zb(e,t,o){var i,a,r;return function(){var l=Ln(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Ln(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=t(i=l,s))}}function Ub(e,t){var o,i,a,r="style."+t,l="end."+r,s;return function(){var c=St(this,e),d=c.on,u=c.value[r]==null?s||(s=ld(t)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function Hb(e,t,o){var i=(e+="")=="transform"?Fg:rd;return t==null?this.styleTween(e,Pb(e,i)).on("end.style."+e,ld(e)):typeof t=="function"?this.styleTween(e,zb(e,i,Er(this,"style."+e,t))).each(Ub(this._id,e)):this.styleTween(e,Lb(e,i,t),o).on("end.style."+e,null)}function Fb(e,t,o){return function(i){this.style.setProperty(e,t.call(this,i),o)}}function Gb(e,t,o){var i,a;function r(){var l=t.apply(this,arguments);return l!==a&&(i=(a=l)&&Fb(e,l,o)),i}return r._value=t,r}function jb(e,t,o){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,Gb(e,t,o??""))}function Kb(e){return function(){this.textContent=e}}function Yb(e){return function(){var t=e(this);this.textContent=t??""}}function Wb(e){return this.tween("text",typeof e=="function"?Yb(Er(this,"text",e)):Kb(e==null?"":e+""))}function qb(e){return function(t){this.textContent=e.call(this,t)}}function Xb(e){var t,o;function i(){var a=e.apply(this,arguments);return a!==o&&(t=(o=a)&&qb(a)),t}return i._value=e,i}function Jb(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,Xb(e))}function Zb(){for(var e=this._name,t=this._id,o=sd(),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=_t(c,t);zi(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Dt(i,this._parents,e,o)}function Qb(){var e,t,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=St(this,i),u=d.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),d.on=t}),a===0&&r()})}var e_=0;function Dt(e,t,o,i){this._groups=e,this._parents=t,this._name=o,this._id=i}function sd(){return++e_}var Ot=go.prototype;Dt.prototype={constructor:Dt,select:Mb,selectAll:Bb,selectChild:Ot.selectChild,selectChildren:Ot.selectChildren,filter:Ib,merge:Sb,selection:Ob,transition:Zb,call:Ot.call,nodes:Ot.nodes,node:Ot.node,size:Ot.size,empty:Ot.empty,each:Ot.each,on:Ab,attr:ub,attrTween:yb,style:Hb,styleTween:jb,text:Wb,textTween:Jb,remove:Vb,tween:ib,delay:_b,duration:wb,ease:vb,easeVarying:Cb,end:Qb,[Symbol.iterator]:Ot[Symbol.iterator]};function t_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var n_={time:null,delay:0,duration:250,ease:t_};function o_(e,t){for(var o;!(o=e.__transition)||!(o=o[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return o}function i_(e){var t,o;e instanceof Dt?(t=e._id,e=e._name):(t=sd(),(o=n_).time=yr(),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])&&zi(c,e,t,d,l,o||o_(c,t));return new Dt(i,this._parents,e,t)}go.prototype.interrupt=tb,go.prototype.transition=i_;const Hi=e=>()=>e;function a_(e,{sourceEvent:t,target:o,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function Pt(e,t,o){this.k=e,this.x=t,this.y=o}Pt.prototype={constructor:Pt,scale:function(e){return e===1?this:new Pt(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Pt(this.k,this.x+this.k*e,this.y+this.k*t)},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 Fn=new Pt(1,0,0);Pt.prototype;function wr(e){e.stopImmediatePropagation()}function Io(e){e.preventDefault(),e.stopImmediatePropagation()}function r_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function l_(){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 cd(){return this.__zoom||Fn}function s_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function c_(){return navigator.maxTouchPoints||"ontouchstart"in this}function d_(e,t,o){var i=e.invertX(t[0][0])-o[0][0],a=e.invertX(t[1][0])-o[1][0],r=e.invertY(t[0][1])-o[0][1],l=e.invertY(t[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 u_(){var e=r_,t=l_,o=d_,i=s_,a=c_,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Vi,d=wi("start","zoom","end"),u,m,p,f=500,y=150,b=0,k=10;function g(_){_.property("__zoom",cd).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",D).filter(a).on("touchstart.zoom",J).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(_,K,R,X){var ee=_.selection?_.selection():_;ee.property("__zoom",cd),_!==ee?q(_,K,R,X):ee.interrupt().each(function(){P(this,arguments).event(X).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},g.scaleBy=function(_,K,R,X){g.scaleTo(_,function(){var ee=this.__zoom.k,oe=typeof K=="function"?K.apply(this,arguments):K;return ee*oe},R,X)},g.scaleTo=function(_,K,R,X){g.transform(_,function(){var ee=t.apply(this,arguments),oe=this.__zoom,U=R==null?w(ee):typeof R=="function"?R.apply(this,arguments):R,G=oe.invert(U),ne=typeof K=="function"?K.apply(this,arguments):K;return o(h(N(oe,ne),U,G),ee,l)},R,X)},g.translateBy=function(_,K,R,X){g.transform(_,function(){return o(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),l)},null,X)},g.translateTo=function(_,K,R,X,ee){g.transform(_,function(){var oe=t.apply(this,arguments),U=this.__zoom,G=X==null?w(oe):typeof X=="function"?X.apply(this,arguments):X;return o(Fn.translate(G[0],G[1]).scale(U.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof R=="function"?-R.apply(this,arguments):-R),oe,l)},X,ee)};function N(_,K){return K=Math.max(r[0],Math.min(r[1],K)),K===_.k?_:new Pt(K,_.x,_.y)}function h(_,K,R){var X=K[0]-R[0]*_.k,ee=K[1]-R[1]*_.k;return X===_.x&&ee===_.y?_:new Pt(_.k,X,ee)}function w(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function q(_,K,R,X){_.on("start.zoom",function(){P(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(X).end()}).tween("zoom",function(){var ee=this,oe=arguments,U=P(ee,oe).event(X),G=t.apply(ee,oe),ne=R==null?w(G):typeof R=="function"?R.apply(ee,oe):R,ce=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),pe=ee.__zoom,se=typeof K=="function"?K.apply(ee,oe):K,me=c(pe.invert(ne).concat(ce/pe.k),se.invert(ne).concat(ce/se.k));return function(he){if(he===1)he=se;else{var Ee=me(he),Se=ce/Ee[2];he=new Pt(Se,ne[0]-Ee[0]*Se,ne[1]-Ee[1]*Se)}U.zoom(null,he)}})}function P(_,K,R){return!R&&_.__zooming||new W(_,K)}function W(_,K){this.that=_,this.args=K,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,K),this.taps=0}W.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,K){return this.mouse&&_!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var K=gt(this.that).datum();d.call(_,this.that,new a_(_,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:d}),K)}};function M(_,...K){if(!e.apply(this,arguments))return;var R=P(this,K).event(_),X=this.__zoom,ee=Math.max(r[0],Math.min(r[1],X.k*Math.pow(2,i.apply(this,arguments)))),oe=xt(_);if(R.wheel)(R.mouse[0][0]!==oe[0]||R.mouse[0][1]!==oe[1])&&(R.mouse[1]=X.invert(R.mouse[0]=oe)),clearTimeout(R.wheel);else{if(X.k===ee)return;R.mouse=[oe,X.invert(oe)],Ui(this),R.start()}Io(_),R.wheel=setTimeout(U,y),R.zoom("mouse",o(h(N(X,ee),R.mouse[0],R.mouse[1]),R.extent,l));function U(){R.wheel=null,R.end()}}function $(_,...K){if(p||!e.apply(this,arguments))return;var R=_.currentTarget,X=P(this,K,!0).event(_),ee=gt(_.view).on("mousemove.zoom",ne,!0).on("mouseup.zoom",ce,!0),oe=xt(_,R),U=_.clientX,G=_.clientY;Mc(_.view),wr(_),X.mouse=[oe,this.__zoom.invert(oe)],Ui(this),X.start();function ne(pe){if(Io(pe),!X.moved){var se=pe.clientX-U,me=pe.clientY-G;X.moved=se*se+me*me>b}X.event(pe).zoom("mouse",o(h(X.that.__zoom,X.mouse[0]=xt(pe,R),X.mouse[1]),X.extent,l))}function ce(pe){ee.on("mousemove.zoom mouseup.zoom",null),Bc(pe.view,X.moved),Io(pe),X.event(pe).end()}}function D(_,...K){if(e.apply(this,arguments)){var R=this.__zoom,X=xt(_.changedTouches?_.changedTouches[0]:_,this),ee=R.invert(X),oe=R.k*(_.shiftKey?.5:2),U=o(h(N(R,oe),X,ee),t.apply(this,K),l);Io(_),s>0?gt(this).transition().duration(s).call(q,U,X,_):gt(this).call(g.transform,U,X,_)}}function J(_,...K){if(e.apply(this,arguments)){var R=_.touches,X=R.length,ee=P(this,K,_.changedTouches.length===X).event(_),oe,U,G,ne;for(wr(_),U=0;U<X;++U)G=R[U],ne=xt(G,this),ne=[ne,this.__zoom.invert(ne),G.identifier],ee.touch0?!ee.touch1&&ee.touch0[2]!==ne[2]&&(ee.touch1=ne,ee.taps=0):(ee.touch0=ne,oe=!0,ee.taps=1+!!u);u&&(u=clearTimeout(u)),oe&&(ee.taps<2&&(m=ne[0],u=setTimeout(function(){u=null},f)),Ui(this),ee.start())}}function B(_,...K){if(this.__zooming){var R=P(this,K).event(_),X=_.changedTouches,ee=X.length,oe,U,G,ne;for(Io(_),oe=0;oe<ee;++oe)U=X[oe],G=xt(U,this),R.touch0&&R.touch0[2]===U.identifier?R.touch0[0]=G:R.touch1&&R.touch1[2]===U.identifier&&(R.touch1[0]=G);if(U=R.that.__zoom,R.touch1){var ce=R.touch0[0],pe=R.touch0[1],se=R.touch1[0],me=R.touch1[1],he=(he=se[0]-ce[0])*he+(he=se[1]-ce[1])*he,Ee=(Ee=me[0]-pe[0])*Ee+(Ee=me[1]-pe[1])*Ee;U=N(U,Math.sqrt(he/Ee)),G=[(ce[0]+se[0])/2,(ce[1]+se[1])/2],ne=[(pe[0]+me[0])/2,(pe[1]+me[1])/2]}else if(R.touch0)G=R.touch0[0],ne=R.touch0[1];else return;R.zoom("touch",o(h(U,G,ne),R.extent,l))}}function re(_,...K){if(this.__zooming){var R=P(this,K).event(_),X=_.changedTouches,ee=X.length,oe,U;for(wr(_),p&&clearTimeout(p),p=setTimeout(function(){p=null},f),oe=0;oe<ee;++oe)U=X[oe],R.touch0&&R.touch0[2]===U.identifier?delete R.touch0:R.touch1&&R.touch1[2]===U.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(U=xt(U,this),Math.hypot(m[0]-U[0],m[1]-U[1])<k)){var G=gt(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return g.wheelDelta=function(_){return arguments.length?(i=typeof _=="function"?_:Hi(+_),g):i},g.filter=function(_){return arguments.length?(e=typeof _=="function"?_:Hi(!!_),g):e},g.touchable=function(_){return arguments.length?(a=typeof _=="function"?_:Hi(!!_),g):a},g.extent=function(_){return arguments.length?(t=typeof _=="function"?_:Hi([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),g):t},g.scaleExtent=function(_){return arguments.length?(r[0]=+_[0],r[1]=+_[1],g):[r[0],r[1]]},g.translateExtent=function(_){return arguments.length?(l[0][0]=+_[0][0],l[1][0]=+_[1][0],l[0][1]=+_[0][1],l[1][1]=+_[1][1],g):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},g.constrain=function(_){return arguments.length?(o=_,g):o},g.duration=function(_){return arguments.length?(s=+_,g):s},g.interpolate=function(_){return arguments.length?(c=_,g):c},g.on=function(){var _=d.on.apply(d,arguments);return _===d?g:_},g.clickDistance=function(_){return arguments.length?(b=(_=+_)*_,g):Math.sqrt(b)},g.tapDistance=function(_){return arguments.length?(k=+_,g):k},g}var Ce=(e=>(e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom",e))(Ce||{}),Nr=(e=>(e.Partial="partial",e.Full="full",e))(Nr||{}),mn=(e=>(e.Bezier="default",e.SimpleBezier="simple-bezier",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e))(mn||{}),Lt=(e=>(e.Strict="strict",e.Loose="loose",e))(Lt||{}),vr=(e=>(e.Arrow="arrow",e.ArrowClosed="arrowclosed",e))(vr||{}),So=(e=>(e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal",e))(So||{}),dd=(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))(dd||{});const m_=["INPUT","SELECT","TEXTAREA"],f_=typeof document<"u"?document:null;function xr(e){var t,o;const i=((o=(t=e.composedPath)==null?void 0:t.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 m_.includes(i==null?void 0:i.nodeName)||a||!!r}function p_(e){return e.ctrlKey||e.metaKey||e.shiftKey||e.altKey}function ud(e,t,o,i){const a=t.replace("+",`
|
|
14
14
|
`).replace(`
|
|
15
15
|
|
|
16
16
|
`,`
|
|
17
17
|
+`).split(`
|
|
18
|
-
`).map(l=>l.trim().toLowerCase());if(a.length===1)return e.toLowerCase()===t.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 h_(e,t){return o=>{if(!o.code&&!o.key)return!1;const i=y_(o.code,e);return Array.isArray(e)?e.some(a=>md(o[i],a,t,o.type==="keyup")):md(o[i],e,t,o.type==="keyup")}}function y_(e,t){return t.includes(e)?"code":"key"}function So(e,t){const o=n.computed(()=>n.toValue(t==null?void 0:t.target)??f_),i=n.shallowRef(n.toValue(e)===!0);let a=!1;const r=new Set;let l=c(n.toValue(e));n.watch(()=>n.toValue(e),(d,u)=>{typeof u=="boolean"&&typeof d!="boolean"&&s(),l=c(d)},{immediate:!0}),_c(["blur","contextmenu"],s),kc((...d)=>l(...d),d=>{var u,m;const p=n.toValue(t==null?void 0:t.actInsideInputWithModifier)??!0,f=n.toValue(t==null?void 0:t.preventDefault)??!1;if(a=p_(d),(!a||a&&!p)&&xr(d))return;const b=((m=(u=d.composedPath)==null?void 0:u.call(d))==null?void 0:m[0])||d.target,k=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";!f&&(a||!k)&&d.preventDefault(),i.value=!0},{eventName:"keydown",target:o}),kc((...d)=>l(...d),d=>{const u=n.toValue(t==null?void 0:t.actInsideInputWithModifier)??!0;if(i.value){if((!a||a&&!u)&&xr(d))return;a=!1,i.value=!1}},{eventName:"keyup",target:o});function s(){a=!1,r.clear(),i.value=n.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"?h_(d,r):d}return i}const fd="vue-flow__node-desc",pd="vue-flow__edge-desc",g_="vue-flow__aria-live",hd=["Enter"," ","Escape"],Fn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Fi(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function Gi(e,t){const o=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(o*i)}function ji(e){return{width:e.offsetWidth,height:e.offsetHeight}}function fn(e,t=0,o=1){return Math.min(Math.max(e,t),o)}function yd(e,t){return{x:fn(e.x,t[0][0],t[1][0]),y:fn(e.y,t[0][1],t[1][1])}}function gd(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Kt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function pn(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Kt(e)}function $o(e){return pn(e)&&"computedPosition"in e}function Ki(e){return!Number.isNaN(e)&&Number.isFinite(e)}function b_(e){return Ki(e.width)&&Ki(e.height)&&Ki(e.x)&&Ki(e.y)}function __(e,t,o){const i={id:e.id.toString(),type:e.type??"default",dimensions:n.markRaw({width:0,height:0}),computedPosition:n.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:qe(e.data)?e.data:{},events:n.markRaw(qe(e.events)?e.events:{})};return Object.assign(t??i,e,{id:e.id.toString(),parentNode:o})}function bd(e,t,o){var i,a;const r={id:e.id.toString(),type:e.type??(t==null?void 0:t.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:qe(e.data)?e.data:{},events:n.markRaw(qe(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(o==null?void 0:o.interactionWidth),...o??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function _d(e,t,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 t.filter(s=>r.has(s.id))}function k_(...e){if(e.length===3){const[r,l,s]=e;return _d(r,l,s,"target")}const[t,o]=e,i=typeof t=="string"?t:t.id;return o.filter(r=>Kt(r)&&r.source===i).map(r=>o.find(l=>pn(l)&&l.id===r.target))}function E_(...e){if(e.length===3){const[r,l,s]=e;return _d(r,l,s,"source")}const[t,o]=e,i=typeof t=="string"?t:t.id;return o.filter(r=>Kt(r)&&r.target===i).map(r=>o.find(l=>pn(l)&&l.id===r.source))}function kd({source:e,sourceHandle:t,target:o,targetHandle:i}){return`vueflow__edge-${e}${t??""}-${o}${i??""}`}function w_(e,t){return t.some(o=>Kt(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 Ro({x:e,y:t},{x:o,y:i,zoom:a}){return{x:e*a+o,y:t*a+i}}function Ao({x:e,y:t},{x:o,y:i,zoom:a},r=!1,l=[1,1]){const s={x:(e-o)/a,y:(t-i)/a};return r?Wi(s,l):s}function Ed(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function Yi({x:e,y:t,width:o,height:i}){return{x:e,y:t,x2:e+o,y2:t+i}}function wd({x:e,y:t,x2:o,y2:i}){return{x:e,y:t,width:o-e,height:i-t}}function N_(e,t){return wd(Ed(Yi(e),Yi(t)))}function Cr(e){let t={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];t=Ed(t,Yi({...i.computedPosition,...i.dimensions}))}return wd(t)}function Nd(e,t,o={x:0,y:0,zoom:1},i=!1,a=!1){const r={...Ao(t,o),width:t.width/o.zoom,height:t.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=Gi(r,Fi(s)),y=m===null||p===null,b=i&&f>0,k=(m??0)*(p??0);(y||b||f>=k||s.dragging)&&l.push(s)}return l}function hn(e,t){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 t.filter(i=>o.has(i.source)||o.has(i.target))}function Gn(e,t){if(typeof e=="number")return Math.floor((t-t/(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(t*o*.01)}return Mo(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function v_(e,t,o){if(typeof e=="string"||typeof e=="number"){const i=Gn(e,o),a=Gn(e,t);return{top:i,right:a,bottom:i,left:a,x:a*2,y:i*2}}if(typeof e=="object"){const i=Gn(e.top??e.y??0,o),a=Gn(e.bottom??e.y??0,o),r=Gn(e.left??e.x??0,t),l=Gn(e.right??e.x??0,t);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 x_(e,t,o,i,a,r){const{x:l,y:s}=Ro(e,{x:t,y:o,zoom:i}),{x:c,y:d}=Ro({x:e.x+e.width,y:e.y+e.height},{x:t,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 vd(e,t,o,i,a,r=.1){const l=v_(r,t,o),s=(t-l.x)/e.width,c=(o-l.y)/e.height,d=Math.min(s,c),u=fn(d,i,a),m=e.x+e.width/2,p=e.y+e.height/2,f=t/2-m*u,y=o/2-p*u,b=x_(e,f,y,u,t,o),k={left:Math.min(b.left-l.left,0),top:Math.min(b.top-l.top,0),right:Math.min(b.right-l.right,0),bottom:Math.min(b.bottom-l.bottom,0)};return{x:f-k.left+k.right,y:y-k.top+k.bottom,zoom:u}}function C_(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function xd(e,t){if(!e.parentNode)return!1;const o=t.get(e.parentNode);return o?o.selected?!0:xd(o,t):!1}function To(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`}function Ir(e){const t=e.ctrlKey&&Vo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function Cd(e,t,o){return e<t?fn(Math.abs(e-t),1,t)/t:e>o?-fn(Math.abs(e-o),1,t)/t:0}function Id(e,t,o=15,i=40){const a=Cd(e.x,i,t.width-i)*o,r=Cd(e.y,i,t.height-i)*o;return[a,r]}function Sr(e,t){if(t){const o=e.position.x+e.dimensions.width-t.dimensions.width,i=e.position.y+e.dimensions.height-t.dimensions.height;if(o>0||i>0||e.position.x<0||e.position.y<0){let a={};if(typeof t.style=="function"?a={...t.style(t)}:t.style&&(a={...t.style}),a.width=a.width??`${t.dimensions.width}px`,a.height=a.height??`${t.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(t.position.x=t.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(t.position.y=t.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}t.dimensions.width=Number(a.width.toString().replace("px","")),t.dimensions.height=Number(a.height.toString().replace("px","")),typeof t.style=="function"?t.style=r=>{const l=t.style;return{...l(r),...a}}:t.style={...t.style,...a}}}}function Sd(e,t){var o,i;const a=e.filter(l=>l.type==="add"||l.type==="remove");for(const l of a)if(l.type==="add")t.findIndex(c=>c.id===l.item.id)===-1&&t.push(l.item);else if(l.type==="remove"){const s=t.findIndex(c=>c.id===l.id);s!==-1&&t.splice(s,1)}const r=t.map(l=>l.id);for(const l of t)for(const s of e)if(s.id===l.id)switch(s.type){case"select":l.selected=s.selected;break;case"position":if($o(l)&&(typeof s.position<"u"&&(l.position=s.position),typeof s.dragging<"u"&&(l.dragging=s.dragging),l.expandParent&&l.parentNode)){const c=t[r.indexOf(l.parentNode)];c&&$o(c)&&Sr(l,c)}break;case"dimensions":if($o(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=t[r.indexOf(l.parentNode)];c&&$o(c)&&(!!c.dimensions.width&&!!c.dimensions.height?Sr(l,c):n.nextTick(()=>{Sr(l,c)}))}break}return t}function Yt(e,t){return{id:e,type:"select",selected:t}}function $d(e){return{item:e,type:"add"}}function Rd(e){return{id:e,type:"remove"}}function Ad(e,t,o,i,a){return{id:e,source:t,target:o,sourceHandle:i||null,targetHandle:a||null,type:"remove"}}function Wt(e,t=new Set,o=!1){const i=[];for(const[a,r]of e){const l=t.has(a);!(r.selected===void 0&&!l)&&r.selected!==l&&(o&&(r.selected=l),i.push(Yt(r.id,l)))}return i}const Td=()=>{};function xe(e){const t=new Set;let o=Td,i=()=>!1;const a=()=>t.size>0||i(),r=p=>{o=p},l=()=>{o=Td},s=p=>{i=p},c=()=>{i=()=>!1},d=p=>{t.delete(p)};return{on:p=>{t.add(p);const f=()=>d(p);return ho(f),{off:f}},off:d,trigger:p=>{const f=[o];return a()?f.push(...t):e&&f.push(e),Promise.allSettled(f.map(y=>y(p)))},hasListeners:a,listeners:t,setEmitter:r,removeEmitter:l,setHasEmitListeners:s,removeHasEmitListeners:c}}function Vd(e,t,o){let i=e;do{if(i&&i.matches(t))return!0;if(i===o)return!1;i=i.parentElement}while(i);return!1}function I_(e,t,o,i){var a,r;const l=new Map;for(const[s,c]of e)(c.selected||c.id===i)&&(!c.parentNode||!xd(c,e))&&(c.draggable||t&&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 $r({id:e,dragItems:t,findNode:o}){const i=[];for(const a of t){const r=o(a.id);r&&i.push(r)}return[e?i.find(a=>a.id===e):i[0],i]}function Md(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 S_(e,t,o){const[i,a,r,l]=typeof e!="string"?Md(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 $_(e,t,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=S_(a,e,i);r&&(a=r)}else t(new Ze(We.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]=Md(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 R_({width:e,height:t},o){return[o[0],[o[1][0]-(e||0),o[1][1]-(t||0)]]}function Rr(e,t,o,i,a){const r=R_(e.dimensions,$_(e,o,i,a)),l=yd(t,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 jn(e,t,o=Ce.Left,i=!1){const a=((t==null?void 0:t.x)??0)+e.computedPosition.x,r=((t==null?void 0:t.y)??0)+e.computedPosition.y,{width:l,height:s}=t??M_(e);if(i)return{x:a+l/2,y:r+s/2};switch((t==null?void 0:t.position)??o){case Ce.Top:return{x:a+l/2,y:r};case Ce.Right:return{x:a+l,y:r+s/2};case Ce.Bottom:return{x:a+l/2,y:r+s};case Ce.Left:return{x:a,y:r+s/2}}}function Bd(e,t){return e&&(t?e.find(o=>o.id===t):e[0])||null}function A_({sourcePos:e,targetPos:t,sourceWidth:o,sourceHeight:i,targetWidth:a,targetHeight:r,width:l,height:s,viewport:c}){const d={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+o,t.x+a),y2:Math.max(e.y+i,t.y+r)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const u=Yi({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 T_(e,t,o=!1){const i=typeof e.zIndex=="number";let a=i?e.zIndex:0;const r=t(e.source),l=t(e.target);return!r||!l?0:(o&&(a=i?e.zIndex:Math.max(r.computedPosition.z||0,l.computedPosition.z||0)),a)}var We=(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))(We||{});const Dd={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
|
|
18
|
+
`).map(l=>l.trim().toLowerCase());if(a.length===1)return e.toLowerCase()===t.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 h_(e,t){return o=>{if(!o.code&&!o.key)return!1;const i=y_(o.code,e);return Array.isArray(e)?e.some(a=>ud(o[i],a,t,o.type==="keyup")):ud(o[i],e,t,o.type==="keyup")}}function y_(e,t){return t.includes(e)?"code":"key"}function $o(e,t){const o=n.computed(()=>n.toValue(t==null?void 0:t.target)??f_),i=n.shallowRef(n.toValue(e)===!0);let a=!1;const r=new Set;let l=c(n.toValue(e));n.watch(()=>n.toValue(e),(d,u)=>{typeof u=="boolean"&&typeof d!="boolean"&&s(),l=c(d)},{immediate:!0}),bc(["blur","contextmenu"],s),_c((...d)=>l(...d),d=>{var u,m;const p=n.toValue(t==null?void 0:t.actInsideInputWithModifier)??!0,f=n.toValue(t==null?void 0:t.preventDefault)??!1;if(a=p_(d),(!a||a&&!p)&&xr(d))return;const b=((m=(u=d.composedPath)==null?void 0:u.call(d))==null?void 0:m[0])||d.target,k=(b==null?void 0:b.nodeName)==="BUTTON"||(b==null?void 0:b.nodeName)==="A";!f&&(a||!k)&&d.preventDefault(),i.value=!0},{eventName:"keydown",target:o}),_c((...d)=>l(...d),d=>{const u=n.toValue(t==null?void 0:t.actInsideInputWithModifier)??!0;if(i.value){if((!a||a&&!u)&&xr(d))return;a=!1,i.value=!1}},{eventName:"keyup",target:o});function s(){a=!1,r.clear(),i.value=n.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"?h_(d,r):d}return i}const md="vue-flow__node-desc",fd="vue-flow__edge-desc",g_="vue-flow__aria-live",pd=["Enter"," ","Escape"],Gn={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};function Fi(e){return{...e.computedPosition||{x:0,y:0},width:e.dimensions.width||0,height:e.dimensions.height||0}}function Gi(e,t){const o=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),i=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(o*i)}function ji(e){return{width:e.offsetWidth,height:e.offsetHeight}}function fn(e,t=0,o=1){return Math.min(Math.max(e,t),o)}function hd(e,t){return{x:fn(e.x,t[0][0],t[1][0]),y:fn(e.y,t[0][1],t[1][1])}}function yd(e){const t=e.getRootNode();return"elementFromPoint"in t?t:window.document}function Yt(e){return e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e}function pn(e){return e&&typeof e=="object"&&"id"in e&&"position"in e&&!Yt(e)}function Ro(e){return pn(e)&&"computedPosition"in e}function Ki(e){return!Number.isNaN(e)&&Number.isFinite(e)}function b_(e){return Ki(e.width)&&Ki(e.height)&&Ki(e.x)&&Ki(e.y)}function __(e,t,o){const i={id:e.id.toString(),type:e.type??"default",dimensions:n.markRaw({width:0,height:0}),computedPosition:n.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:Xe(e.data)?e.data:{},events:n.markRaw(Xe(e.events)?e.events:{})};return Object.assign(t??i,e,{id:e.id.toString(),parentNode:o})}function gd(e,t,o){var i,a;const r={id:e.id.toString(),type:e.type??(t==null?void 0:t.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:Xe(e.data)?e.data:{},events:n.markRaw(Xe(e.events)?e.events:{}),label:e.label??"",interactionWidth:e.interactionWidth??(o==null?void 0:o.interactionWidth),...o??{}};return Object.assign(t??r,e,{id:e.id.toString()})}function bd(e,t,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 t.filter(s=>r.has(s.id))}function k_(...e){if(e.length===3){const[r,l,s]=e;return bd(r,l,s,"target")}const[t,o]=e,i=typeof t=="string"?t:t.id;return o.filter(r=>Yt(r)&&r.source===i).map(r=>o.find(l=>pn(l)&&l.id===r.target))}function E_(...e){if(e.length===3){const[r,l,s]=e;return bd(r,l,s,"source")}const[t,o]=e,i=typeof t=="string"?t:t.id;return o.filter(r=>Yt(r)&&r.target===i).map(r=>o.find(l=>pn(l)&&l.id===r.source))}function _d({source:e,sourceHandle:t,target:o,targetHandle:i}){return`vueflow__edge-${e}${t??""}-${o}${i??""}`}function w_(e,t){return t.some(o=>Yt(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 Ao({x:e,y:t},{x:o,y:i,zoom:a}){return{x:e*a+o,y:t*a+i}}function To({x:e,y:t},{x:o,y:i,zoom:a},r=!1,l=[1,1]){const s={x:(e-o)/a,y:(t-i)/a};return r?Wi(s,l):s}function kd(e,t){return{x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}}function Yi({x:e,y:t,width:o,height:i}){return{x:e,y:t,x2:e+o,y2:t+i}}function Ed({x:e,y:t,x2:o,y2:i}){return{x:e,y:t,width:o-e,height:i-t}}function N_(e,t){return Ed(kd(Yi(e),Yi(t)))}function Cr(e){let t={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];t=kd(t,Yi({...i.computedPosition,...i.dimensions}))}return Ed(t)}function wd(e,t,o={x:0,y:0,zoom:1},i=!1,a=!1){const r={...To(t,o),width:t.width/o.zoom,height:t.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=Gi(r,Fi(s)),y=m===null||p===null,b=i&&f>0,k=(m??0)*(p??0);(y||b||f>=k||s.dragging)&&l.push(s)}return l}function hn(e,t){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 t.filter(i=>o.has(i.source)||o.has(i.target))}function jn(e,t){if(typeof e=="number")return Math.floor((t-t/(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(t*o*.01)}return Bo(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function v_(e,t,o){if(typeof e=="string"||typeof e=="number"){const i=jn(e,o),a=jn(e,t);return{top:i,right:a,bottom:i,left:a,x:a*2,y:i*2}}if(typeof e=="object"){const i=jn(e.top??e.y??0,o),a=jn(e.bottom??e.y??0,o),r=jn(e.left??e.x??0,t),l=jn(e.right??e.x??0,t);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 x_(e,t,o,i,a,r){const{x:l,y:s}=Ao(e,{x:t,y:o,zoom:i}),{x:c,y:d}=Ao({x:e.x+e.width,y:e.y+e.height},{x:t,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 Nd(e,t,o,i,a,r=.1){const l=v_(r,t,o),s=(t-l.x)/e.width,c=(o-l.y)/e.height,d=Math.min(s,c),u=fn(d,i,a),m=e.x+e.width/2,p=e.y+e.height/2,f=t/2-m*u,y=o/2-p*u,b=x_(e,f,y,u,t,o),k={left:Math.min(b.left-l.left,0),top:Math.min(b.top-l.top,0),right:Math.min(b.right-l.right,0),bottom:Math.min(b.bottom-l.bottom,0)};return{x:f-k.left+k.right,y:y-k.top+k.bottom,zoom:u}}function C_(e,t){return{x:t.x+e.x,y:t.y+e.y,z:(e.z>t.z?e.z:t.z)+1}}function vd(e,t){if(!e.parentNode)return!1;const o=t.get(e.parentNode);return o?o.selected?!0:vd(o,t):!1}function Vo(e,t){return typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(i=>`${i}=${e[i]}`).join("&")}`}function Ir(e){const t=e.ctrlKey&&Mo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t}function xd(e,t,o){return e<t?fn(Math.abs(e-t),1,t)/t:e>o?-fn(Math.abs(e-o),1,t)/t:0}function Cd(e,t,o=15,i=40){const a=xd(e.x,i,t.width-i)*o,r=xd(e.y,i,t.height-i)*o;return[a,r]}function Sr(e,t){if(t){const o=e.position.x+e.dimensions.width-t.dimensions.width,i=e.position.y+e.dimensions.height-t.dimensions.height;if(o>0||i>0||e.position.x<0||e.position.y<0){let a={};if(typeof t.style=="function"?a={...t.style(t)}:t.style&&(a={...t.style}),a.width=a.width??`${t.dimensions.width}px`,a.height=a.height??`${t.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(t.position.x=t.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(t.position.y=t.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}t.dimensions.width=Number(a.width.toString().replace("px","")),t.dimensions.height=Number(a.height.toString().replace("px","")),typeof t.style=="function"?t.style=r=>{const l=t.style;return{...l(r),...a}}:t.style={...t.style,...a}}}}function Id(e,t){var o,i;const a=e.filter(l=>l.type==="add"||l.type==="remove");for(const l of a)if(l.type==="add")t.findIndex(c=>c.id===l.item.id)===-1&&t.push(l.item);else if(l.type==="remove"){const s=t.findIndex(c=>c.id===l.id);s!==-1&&t.splice(s,1)}const r=t.map(l=>l.id);for(const l of t)for(const s of e)if(s.id===l.id)switch(s.type){case"select":l.selected=s.selected;break;case"position":if(Ro(l)&&(typeof s.position<"u"&&(l.position=s.position),typeof s.dragging<"u"&&(l.dragging=s.dragging),l.expandParent&&l.parentNode)){const c=t[r.indexOf(l.parentNode)];c&&Ro(c)&&Sr(l,c)}break;case"dimensions":if(Ro(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=t[r.indexOf(l.parentNode)];c&&Ro(c)&&(!!c.dimensions.width&&!!c.dimensions.height?Sr(l,c):n.nextTick(()=>{Sr(l,c)}))}break}return t}function Wt(e,t){return{id:e,type:"select",selected:t}}function Sd(e){return{item:e,type:"add"}}function $d(e){return{id:e,type:"remove"}}function Rd(e,t,o,i,a){return{id:e,source:t,target:o,sourceHandle:i||null,targetHandle:a||null,type:"remove"}}function qt(e,t=new Set,o=!1){const i=[];for(const[a,r]of e){const l=t.has(a);!(r.selected===void 0&&!l)&&r.selected!==l&&(o&&(r.selected=l),i.push(Wt(r.id,l)))}return i}const Ad=()=>{};function ve(e){const t=new Set;let o=Ad,i=()=>!1;const a=()=>t.size>0||i(),r=p=>{o=p},l=()=>{o=Ad},s=p=>{i=p},c=()=>{i=()=>!1},d=p=>{t.delete(p)};return{on:p=>{t.add(p);const f=()=>d(p);return yo(f),{off:f}},off:d,trigger:p=>{const f=[o];return a()?f.push(...t):e&&f.push(e),Promise.allSettled(f.map(y=>y(p)))},hasListeners:a,listeners:t,setEmitter:r,removeEmitter:l,setHasEmitListeners:s,removeHasEmitListeners:c}}function Td(e,t,o){let i=e;do{if(i&&i.matches(t))return!0;if(i===o)return!1;i=i.parentElement}while(i);return!1}function I_(e,t,o,i){var a,r;const l=new Map;for(const[s,c]of e)(c.selected||c.id===i)&&(!c.parentNode||!vd(c,e))&&(c.draggable||t&&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 $r({id:e,dragItems:t,findNode:o}){const i=[];for(const a of t){const r=o(a.id);r&&i.push(r)}return[e?i.find(a=>a.id===e):i[0],i]}function Vd(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 S_(e,t,o){const[i,a,r,l]=typeof e!="string"?Vd(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 $_(e,t,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=S_(a,e,i);r&&(a=r)}else t(new Qe(qe.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]=Vd(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 R_({width:e,height:t},o){return[o[0],[o[1][0]-(e||0),o[1][1]-(t||0)]]}function Rr(e,t,o,i,a){const r=R_(e.dimensions,$_(e,o,i,a)),l=hd(t,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 Kn(e,t,o=Ce.Left,i=!1){const a=((t==null?void 0:t.x)??0)+e.computedPosition.x,r=((t==null?void 0:t.y)??0)+e.computedPosition.y,{width:l,height:s}=t??M_(e);if(i)return{x:a+l/2,y:r+s/2};switch((t==null?void 0:t.position)??o){case Ce.Top:return{x:a+l/2,y:r};case Ce.Right:return{x:a+l,y:r+s/2};case Ce.Bottom:return{x:a+l/2,y:r+s};case Ce.Left:return{x:a,y:r+s/2}}}function Md(e,t){return e&&(t?e.find(o=>o.id===t):e[0])||null}function A_({sourcePos:e,targetPos:t,sourceWidth:o,sourceHeight:i,targetWidth:a,targetHeight:r,width:l,height:s,viewport:c}){const d={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+o,t.x+a),y2:Math.max(e.y+i,t.y+r)};d.x===d.x2&&(d.x2+=1),d.y===d.y2&&(d.y2+=1);const u=Yi({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 T_(e,t,o=!1){const i=typeof e.zIndex=="number";let a=i?e.zIndex:0;const r=t(e.source),l=t(e.target);return!r||!l?0:(o&&(a=i?e.zIndex:Math.max(r.computedPosition.z||0,l.computedPosition.z||0)),a)}var qe=(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))(qe||{});const Bd={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
|
|
19
19
|
Node: ${e}`,NODE_NOT_FOUND:e=>`Node not found
|
|
20
20
|
Node: ${e}`,NODE_MISSING_PARENT:(e,t)=>`Node is missing a parent
|
|
21
21
|
Node: ${e}
|
|
@@ -35,18 +35,18 @@ Edge: ${e}
|
|
|
35
35
|
Source: ${t}
|
|
36
36
|
Target: ${o}`,EDGE_ORPHANED:e=>`Edge was orphaned (suddenly missing source or target) and has been removed
|
|
37
37
|
Edge: ${e}`,EDGE_NOT_FOUND:e=>`Edge not found
|
|
38
|
-
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 Ze extends Error{constructor(t,...o){var i;super((i=Dd[t])==null?void 0:i.call(Dd,...o)),this.name="VueFlowError",this.code=t,this.args=o}}function Ar(e){return"clientX"in e}function V_(e){return"sourceEvent"in e}function It(e,t){const o=Ar(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-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}}const Vo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function M_(e){var t,o;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((o=e.dimensions)==null?void 0:o.height)??e.height??0}}function Wi(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const B_=()=>!0;function Tr(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function D_(e,t,o){const i=[],a={x:e.x-o,y:e.y-o,width:o*2,height:o*2};for(const r of t.values())Gi(a,Fi(r))>0&&i.push(r);return i}const O_=250;function P_(e,t,o,i){var a,r;let l=[],s=Number.POSITIVE_INFINITY;const c=D_(e,o,t+O_);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}=jn(d,m,m.position,!0),y=Math.sqrt((p-e.x)**2+(f-e.y)**2);y>t||(y<s?(l=[{...m,x:p,y:f}],s=y):y===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 Od(e,{handle:t,connectionMode:o,fromNodeId:i,fromHandleId:a,fromType:r,doc:l,lib:s,flowId:c,isValidConnection:d=B_},u,m,p,f){const y=r==="target",b=t?l.querySelector(`.${s}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:k,y:g}=It(e),w=l.elementFromPoint(k,g),h=w!=null&&w.classList.contains(`${s}-flow__handle`)?w:b,E={handleDomNode:h,isValid:!1,connection:null,toHandle:null};if(h){const X=Pd(void 0,h),z=h.getAttribute("data-nodeid"),q=h.getAttribute("data-handleid"),D=h.classList.contains("connectable"),$=h.classList.contains("connectableend");if(!z||!X)return E;const B={source:y?z:i,sourceHandle:y?q:a,target:y?i:z,targetHandle:y?a:q};E.connection=B;const V=D&&$&&(o===Pt.Strict?y&&X==="source"||!y&&X==="target":z!==i||q!==a);E.isValid=V&&d(B,{nodes:m,edges:u,sourceNode:p(B.source),targetNode:p(B.target)}),E.toHandle=Ld(z,X,q,f,o,!0)}return E}function Pd(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function L_(e,t){let o=null;return t?o="valid":e&&!t&&(o="invalid"),o}function z_(e,t){let o=null;return t?o=!0:e&&!t&&(o=!1),o}function Ld(e,t,o,i,a,r=!1){var l,s,c;const d=i.get(e);if(!d)return null;const u=a===Pt.Strict?(l=d.handleBounds)==null?void 0:l[t]:[...((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,...jn(d,m,m.position,!0)}:m}const Vr={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top},U_=["production","prod"];function Mo(e,...t){zd()&&console.warn(`[Vue Flow]: ${e}`,...t)}function zd(){return!U_.includes(process.env.NODE_ENV||"")}function Ud(e,t,o,i,a){const r=t.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,...ji(l)}}):null}function Mr(e,t,o,i,a,r=!1,l){a.value=!1,e.selected?(r||e.selected&&t)&&(i([e]),n.nextTick(()=>{l.blur()})):o([e])}function qe(e){return typeof n.unref(e)<"u"}function H_(e,t,o,i){if(!e||!e.source||!e.target)return o(new Ze(We.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let a;return Kt(e)?a=e:a={...e,id:kd(e)},a=bd(a,void 0,i),w_(a,t)?!1:a}function F_(e,t,o,i,a){if(!t.source||!t.target)return a(new Ze(We.EDGE_INVALID,e.id)),!1;if(!o)return a(new Ze(We.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...l}=e;return{...l,id:i?kd(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Hd(e,t,o){const i={},a=[];for(let r=0;r<e.length;++r){const l=e[r];if(!pn(l)){o(new Ze(We.NODE_INVALID,l==null?void 0:l.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const s=__(l,t(l.id),l.parentNode);l.parentNode&&(i[l.parentNode]=!0),a[r]=s}for(const r of a){const l=t(r.parentNode)||a.find(s=>s.id===r.parentNode);r.parentNode&&!l&&o(new Ze(We.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 Fd(e,t,o,i,a,r){let l=a;const s=i.get(l)||new Map;i.set(l,s.set(o,t)),l=`${a}-${e}`;const c=i.get(l)||new Map;if(i.set(l,c.set(o,t)),r){l=`${a}-${e}-${r}`;const d=i.get(l)||new Map;i.set(l,d.set(o,t))}}function Br(e,t,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}`;Fd("source",c,u,e,a,l),Fd("target",c,d,e,r,s)}}function Gd(e,t){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}function Dr(e,t,o,i,a,r,l,s){const c=[];for(const d of e){const u=Kt(d)?d:H_(d,s,a,r);if(!u)continue;const m=o(u.source),p=o(u.target);if(!m||!p){a(new Ze(We.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!m){a(new Ze(We.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!p){a(new Ze(We.EDGE_TARGET_MISSING,u.id,u.target));continue}if(t&&!t(u,{edges:s,nodes:l,sourceNode:m,targetNode:p})){a(new Ze(We.EDGE_INVALID,u.id));continue}const f=i(u.id);c.push({...bd(u,f,r),sourceNode:m,targetNode:p})}return c}const jd=Symbol("vueFlow"),Kd=Symbol("nodeId"),Yd=Symbol("nodeRef"),G_=Symbol("edgeId"),j_=Symbol("edgeRef"),qi=Symbol("slots");function Wd(e){const{vueFlowRef:t,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:y,nodesSelectionActive:b,selectNodesOnDrag:k,removeSelectedElements:g,addSelectedNodes:w,updateNodePositions:h,emits:E}=Oe(),{onStart:X,onDrag:z,onStop:q,onClick:D,el:$,disabled:B,id:Q,selectable:V,dragHandle:re}=e,_=n.shallowRef(!1);let W=[],R,J=null,ee={x:void 0,y:void 0},ae={x:0,y:0},I=null,K=!1,oe=!1,pe=0,fe=!1;const ce=W_(),ue=({x:ge,y:ke})=>{ee={x:ge,y:ke};let G=!1;if(W=W.map(H=>{const C={x:ge-H.distance.x,y:ke-H.distance.y},{computedPosition:M}=Rr(H,o.value?Wi(C,i.value):C,E.error,l.value,H.parentNode?f(H.parentNode):void 0);return G=G||H.position.x!==M.x||H.position.y!==M.y,H.position=M,H}),oe=oe||G,!!G&&(h(W,!0,!0),_.value=!0,I)){const[H,C]=$r({id:Q,dragItems:W,findNode:f});z({event:I,node:H,nodes:C})}},he=()=>{if(!J)return;const[ge,ke]=Id(ae,J,u.value);if(ge!==0||ke!==0){const G={x:(ee.x??0)-ge/c.value.zoom,y:(ee.y??0)-ke/c.value.zoom};p({x:ge,y:ke})&&ue(G)}pe=requestAnimationFrame(he)},we=(ge,ke)=>{K=!0;const G=f(Q);!k.value&&!y.value&&G&&(G.selected||g()),G&&n.toValue(V)&&k.value&&Mr(G,y.value,w,g,b,!1,ke);const H=ce(ge.sourceEvent);if(ee=H,W=I_(r.value,m.value,H,Q),W.length){const[C,M]=$r({id:Q,dragItems:W,findNode:f});X({event:ge.sourceEvent,node:C,nodes:M})}},Se=(ge,ke)=>{var G;ge.sourceEvent.type==="touchmove"&&ge.sourceEvent.touches.length>1||(oe=!1,s.value===0&&we(ge,ke),ee=ce(ge.sourceEvent),J=((G=t.value)==null?void 0:G.getBoundingClientRect())||null,ae=It(ge.sourceEvent,J))},Ie=(ge,ke)=>{const G=ce(ge.sourceEvent);if(!fe&&K&&d.value&&(fe=!0,he()),!K){const H=G.xSnapped-(ee.x??0),C=G.ySnapped-(ee.y??0);Math.sqrt(H*H+C*C)>s.value&&we(ge,ke)}(ee.x!==G.xSnapped||ee.y!==G.ySnapped)&&W.length&&K&&(I=ge.sourceEvent,ae=It(ge.sourceEvent,J),ue(G))},me=ge=>{let ke=!1;if(!K&&!_.value&&!y.value){const G=ge.sourceEvent,H=ce(G),C=H.xSnapped-(ee.x??0),M=H.ySnapped-(ee.y??0),T=Math.sqrt(C*C+M*M);T!==0&&T<=s.value&&(D==null||D(G),ke=!0)}if(W.length&&!ke){oe&&(h(W,!1,!1),oe=!1);const[G,H]=$r({id:Q,dragItems:W,findNode:f});q({event:ge.sourceEvent,node:G,nodes:H})}W=[],_.value=!1,fe=!1,K=!1,ee={x:void 0,y:void 0},cancelAnimationFrame(pe)};return n.watch([()=>n.toValue(B),$],([ge,ke],G,H)=>{if(ke){const C=ht(ke);ge||(R=bg().on("start",M=>Se(M,ke)).on("drag",M=>Ie(M,ke)).on("end",M=>me(M)).filter(M=>{const T=M.target,ne=n.toValue(re);return!M.button&&(!a.value||!Vd(T,`.${a.value}`,ke)&&(!ne||Vd(T,ne,ke)))}),C.call(R)),H(()=>{C.on(".drag",null),R&&(R.on("start",null),R.on("drag",null),R.on("end",null))})}}),_}function K_(){return{doubleClick:xe(),click:xe(),mouseEnter:xe(),mouseMove:xe(),mouseLeave:xe(),contextMenu:xe(),updateStart:xe(),update:xe(),updateEnd:xe()}}function Y_(e,t){const o=K_();return o.doubleClick.on(i=>{var a,r;t.edgeDoubleClick(i),(r=(a=e.events)==null?void 0:a.doubleClick)==null||r.call(a,i)}),o.click.on(i=>{var a,r;t.edgeClick(i),(r=(a=e.events)==null?void 0:a.click)==null||r.call(a,i)}),o.mouseEnter.on(i=>{var a,r;t.edgeMouseEnter(i),(r=(a=e.events)==null?void 0:a.mouseEnter)==null||r.call(a,i)}),o.mouseMove.on(i=>{var a,r;t.edgeMouseMove(i),(r=(a=e.events)==null?void 0:a.mouseMove)==null||r.call(a,i)}),o.mouseLeave.on(i=>{var a,r;t.edgeMouseLeave(i),(r=(a=e.events)==null?void 0:a.mouseLeave)==null||r.call(a,i)}),o.contextMenu.on(i=>{var a,r;t.edgeContextMenu(i),(r=(a=e.events)==null?void 0:a.contextMenu)==null||r.call(a,i)}),o.updateStart.on(i=>{var a,r;t.edgeUpdateStart(i),(r=(a=e.events)==null?void 0:a.updateStart)==null||r.call(a,i)}),o.update.on(i=>{var a,r;t.edgeUpdate(i),(r=(a=e.events)==null?void 0:a.update)==null||r.call(a,i)}),o.updateEnd.on(i=>{var a,r;t.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 W_(){const{viewport:e,snapGrid:t,snapToGrid:o,vueFlowRef:i}=Oe();return a=>{var r;const l=((r=i.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},s=V_(a)?a.sourceEvent:a,{x:c,y:d}=It(s,l),u=Ao({x:c,y:d},e.value),{x:m,y:p}=o.value?Wi(u,t.value):u;return{xSnapped:m,ySnapped:p,...u}}}function Xi(){return!0}function qd({handleId:e,nodeId:t,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:y,autoPanSpeed:b,findNode:k,panBy:g,startConnection:w,updateConnection:h,endConnection:E,emits:X,viewport:z,edges:q,nodes:D,isValidConnection:$,nodeLookup:B}=Oe();let Q=null,V=!1,re=null;function _(R){var J;const ee=n.toValue(o)==="target",ae=Ar(R),I=gd(R.target),K=R.currentTarget;if(K&&(ae&&R.button===0||!ae)){let oe=function(ye){G=It(ye,me),ue=P_(Ao(G,z.value,!1,[1,1]),u.value,B.value,M),H||(C(),H=!0);const ve=Od(ye,{handle:ue,connectionMode:d.value,fromNodeId:n.toValue(t),fromHandleId:n.toValue(e),fromType:ee?"target":"source",isValidConnection:ce,doc:I,lib:"vue",flowId:s,nodeLookup:B.value},q.value,D.value,k,B.value);re=ve.handleDomNode,Q=ve.connection,V=z_(!!ue,ve.isValid);const Te={...Ee,isValid:V,to:ve.toHandle&&V?Ro({x:ve.toHandle.x,y:ve.toHandle.y},z.value):G,toHandle:ve.toHandle,toPosition:V&&ve.toHandle?ve.toHandle.position:Vr[M.position],toNode:ve.toHandle?B.value.get(ve.toHandle.nodeId):null};if(V&&ue&&(Ee!=null&&Ee.toHandle)&&Te.toHandle&&Ee.toHandle.type===Te.toHandle.type&&Ee.toHandle.nodeId===Te.toHandle.nodeId&&Ee.toHandle.id===Te.toHandle.id&&Ee.to.x===Te.to.x&&Ee.to.y===Te.to.y)return;const Ve=ue??ve.toHandle;if(h(Ve&&V?Ro({x:Ve.x,y:Ve.y},z.value):G,Ve,L_(!!Ve,V)),Ee=Te,!ue&&!V&&!re)return Tr(ke);Q&&Q.source!==Q.target&&re&&(Tr(ke),ke=re,re.classList.add("connecting","vue-flow__handle-connecting"),re.classList.toggle("valid",!!V),re.classList.toggle("vue-flow__handle-valid",!!V))},pe=function(ye){"touches"in ye&&ye.touches.length>0||((ue||re)&&Q&&V&&(r?r(ye,Q):X.connect(Q)),X.connectEnd(ye),a&&(l==null||l(ye)),Tr(ke),cancelAnimationFrame(he),E(ye),H=!1,V=!1,Q=null,re=null,I.removeEventListener("mousemove",oe),I.removeEventListener("mouseup",pe),I.removeEventListener("touchmove",oe),I.removeEventListener("touchend",pe))};const fe=k(n.toValue(t));let ce=n.toValue(i)||$.value||Xi;!ce&&fe&&(ce=(ee?fe.isValidSourcePos:fe.isValidTargetPos)||Xi);let ue,he=0;const{x:we,y:Se}=It(R),Ie=Pd(n.toValue(a),K),me=(J=c.value)==null?void 0:J.getBoundingClientRect();if(!me||!Ie)return;const ge=Ld(n.toValue(t),Ie,n.toValue(e),B.value,d.value);if(!ge)return;let ke,G=It(R,me),H=!1;const C=()=>{if(!y.value)return;const[ye,ve]=Id(G,me,b.value);g({x:ye,y:ve}),he=requestAnimationFrame(C)},M={...ge,nodeId:n.toValue(t),type:Ie,position:ge.position},T=B.value.get(n.toValue(t)),de={inProgress:!0,isValid:null,from:jn(T,M,Ce.Left,!0),fromHandle:M,fromPosition:M.position,fromNode:T,to:G,toHandle:null,toPosition:Vr[M.position],toNode:null};w({nodeId:n.toValue(t),id:n.toValue(e),type:Ie,position:(K==null?void 0:K.getAttribute("data-handlepos"))||Ce.Top,...G},{x:we-me.left,y:Se-me.top}),X.connectStart({event:R,nodeId:n.toValue(t),handleId:n.toValue(e),handleType:Ie});let Ee=de;I.addEventListener("mousemove",oe),I.addEventListener("mouseup",pe),I.addEventListener("touchmove",oe),I.addEventListener("touchend",pe)}}function W(R){var J,ee;if(!m.value)return;const ae=n.toValue(o)==="target";if(!p.value){X.clickConnectStart({event:R,nodeId:n.toValue(t),handleId:n.toValue(e)}),w({nodeId:n.toValue(t),type:n.toValue(o),id:n.toValue(e),position:Ce.Top,...It(R)},void 0,!0);return}let I=n.toValue(i)||$.value||Xi;const K=k(n.toValue(t));if(!I&&K&&(I=(ae?K.isValidSourcePos:K.isValidTargetPos)||Xi),K&&(typeof K.connectable>"u"?f.value:K.connectable)===!1)return;const oe=gd(R.target),pe=Od(R,{handle:{nodeId:n.toValue(t),id:n.toValue(e),type:n.toValue(o),position:Ce.Top,...It(R)},connectionMode:d.value,fromNodeId:p.value.nodeId,fromHandleId:p.value.id??null,fromType:p.value.type,isValidConnection:I,doc:oe,lib:"vue",flowId:s,nodeLookup:B.value},q.value,D.value,k,B.value),fe=((J=pe.connection)==null?void 0:J.source)===((ee=pe.connection)==null?void 0:ee.target);pe.isValid&&pe.connection&&!fe&&X.connect(pe.connection),X.clickConnectEnd(R),E(R,!0)}return{handlePointerDown:_,handleClick:W}}function q_(){return n.inject(Kd,"")}function Xd(e){const t=e??q_()??"",o=n.inject(Yd,n.ref(null)),{findNode:i,edges:a,emits:r}=Oe(),l=i(t);return l||r.error(new Ze(We.NODE_NOT_FOUND,t)),{id:t,nodeEl:o,node:l,parentNode:n.computed(()=>i(l.parentNode)),connectedEdges:n.computed(()=>hn([l],a.value))}}function X_(){return{doubleClick:xe(),click:xe(),mouseEnter:xe(),mouseMove:xe(),mouseLeave:xe(),contextMenu:xe(),dragStart:xe(),drag:xe(),dragStop:xe()}}function J_(e,t){const o=X_();return o.doubleClick.on(i=>{var a,r;t.nodeDoubleClick(i),(r=(a=e.events)==null?void 0:a.doubleClick)==null||r.call(a,i)}),o.click.on(i=>{var a,r;t.nodeClick(i),(r=(a=e.events)==null?void 0:a.click)==null||r.call(a,i)}),o.mouseEnter.on(i=>{var a,r;t.nodeMouseEnter(i),(r=(a=e.events)==null?void 0:a.mouseEnter)==null||r.call(a,i)}),o.mouseMove.on(i=>{var a,r;t.nodeMouseMove(i),(r=(a=e.events)==null?void 0:a.mouseMove)==null||r.call(a,i)}),o.mouseLeave.on(i=>{var a,r;t.nodeMouseLeave(i),(r=(a=e.events)==null?void 0:a.mouseLeave)==null||r.call(a,i)}),o.contextMenu.on(i=>{var a,r;t.nodeContextMenu(i),(r=(a=e.events)==null?void 0:a.contextMenu)==null||r.call(a,i)}),o.dragStart.on(i=>{var a,r;t.nodeDragStart(i),(r=(a=e.events)==null?void 0:a.dragStart)==null||r.call(a,i)}),o.drag.on(i=>{var a,r;t.nodeDrag(i),(r=(a=e.events)==null?void 0:a.drag)==null||r.call(a,i)}),o.dragStop.on(i=>{var a,r;t.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 Jd(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:o,findNode:i,snapGrid:a,snapToGrid:r,nodesDraggable:l,emits:s}=Oe();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,y=c.y*m*p,b=[];for(const k of e.value)if(k.draggable||l&&typeof k.draggable>"u"){const g={x:k.computedPosition.x+f,y:k.computedPosition.y+y},{position:w}=Rr(k,g,s.error,t.value,k.parentNode?i(k.parentNode):void 0);b.push({id:k.id,position:w,from:k.position,distance:{x:c.x,y:c.y},dimensions:k.dimensions})}o(b,!0,!1)}}const Ji=.1,Z_=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function qt(){return Mo("Viewport not initialized yet."),Promise.resolve(!1)}const Q_={zoomIn:qt,zoomOut:qt,zoomTo:qt,fitView:qt,setCenter:qt,fitBounds:qt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:qt,setTransform:qt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function e1(e){function t(i,a){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((a==null?void 0:a.interpolate)==="linear"?Eo:Vi).scaleBy(Or(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}=yd({x:-i,y:-a},e.translateExtent),m=Hn.translate(-d,-u).scale(r);e.d3Selection&&e.d3Zoom?(c=e.d3Zoom)==null||c.interpolate((l==null?void 0:l.interpolate)==="linear"?Eo:Vi).transform(Or(e.d3Selection,l==null?void 0:l.duration,l==null?void 0:l.ease,()=>{s(!0)}),m):s(!1)})}return n.computed(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:a=>t(1.2,a),zoomOut:a=>t(1/1.2,a),zoomTo:(a,r)=>new Promise(l=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((r==null?void 0:r.interpolate)==="linear"?Eo:Vi).scaleTo(Or(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:Ji,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=Cr(s),{x:d,y:u,zoom:m}=vd(c,e.dimensions.width,e.dimensions.height,a.minZoom??e.minZoom,a.maxZoom??e.maxZoom,a.padding??Ji);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:Ji})=>{const{x:l,y:s,zoom:c}=vd(a,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding??Ji);return o(l,s,c,r)},project:a=>Ao(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 Ao(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 Ro(s,e.viewport)}return{x:0,y:0}}}:Q_)}function Or(e,t=0,o=Z_,i=()=>{}){const a=typeof t=="number"&&t>0;return a||i(),a?e.transition().duration(t).ease(o).on("end",i):e}function t1(e,t,o){const i=n.effectScope(!0);return i.run(()=>{const a=()=>{i.run(()=>{let b,k,g=!!(o.nodes.value.length||o.edges.value.length);b=On([e.modelValue,()=>{var w,h;return(h=(w=e.modelValue)==null?void 0:w.value)==null?void 0:h.length}],([w])=>{w&&Array.isArray(w)&&(k==null||k.pause(),o.setElements(w),!k&&!g&&w.length?g=!0:k==null||k.resume())}),k=On([o.nodes,o.edges,()=>o.edges.value.length,()=>o.nodes.value.length],([w,h])=>{var E;(E=e.modelValue)!=null&&E.value&&Array.isArray(e.modelValue.value)&&(b==null||b.pause(),e.modelValue.value=[...w,...h],n.nextTick(()=>{b==null||b.resume()}))},{immediate:g}),n.onScopeDispose(()=>{b==null||b.stop(),k==null||k.stop()})})},r=()=>{i.run(()=>{let b,k,g=!!o.nodes.value.length;b=On([e.nodes,()=>{var w,h;return(h=(w=e.nodes)==null?void 0:w.value)==null?void 0:h.length}],([w])=>{w&&Array.isArray(w)&&(k==null||k.pause(),o.setNodes(w),!k&&!g&&w.length?g=!0:k==null||k.resume())}),k=On([o.nodes,()=>o.nodes.value.length],([w])=>{var h;(h=e.nodes)!=null&&h.value&&Array.isArray(e.nodes.value)&&(b==null||b.pause(),e.nodes.value=[...w],n.nextTick(()=>{b==null||b.resume()}))},{immediate:g}),n.onScopeDispose(()=>{b==null||b.stop(),k==null||k.stop()})})},l=()=>{i.run(()=>{let b,k,g=!!o.edges.value.length;b=On([e.edges,()=>{var w,h;return(h=(w=e.edges)==null?void 0:w.value)==null?void 0:h.length}],([w])=>{w&&Array.isArray(w)&&(k==null||k.pause(),o.setEdges(w),!k&&!g&&w.length?g=!0:k==null||k.resume())}),k=On([o.edges,()=>o.edges.value.length],([w])=>{var h;(h=e.edges)!=null&&h.value&&Array.isArray(e.edges.value)&&(b==null||b.pause(),e.edges.value=[...w],n.nextTick(()=>{b==null||b.resume()}))},{immediate:g}),n.onScopeDispose(()=>{b==null||b.stop(),k==null||k.stop()})})},s=()=>{i.run(()=>{n.watch(()=>t.maxZoom,()=>{t.maxZoom&&qe(t.maxZoom)&&o.setMaxZoom(t.maxZoom)},{immediate:!0})})},c=()=>{i.run(()=>{n.watch(()=>t.minZoom,()=>{t.minZoom&&qe(t.minZoom)&&o.setMinZoom(t.minZoom)},{immediate:!0})})},d=()=>{i.run(()=>{n.watch(()=>t.translateExtent,()=>{t.translateExtent&&qe(t.translateExtent)&&o.setTranslateExtent(t.translateExtent)},{immediate:!0})})},u=()=>{i.run(()=>{n.watch(()=>t.nodeExtent,()=>{t.nodeExtent&&qe(t.nodeExtent)&&o.setNodeExtent(t.nodeExtent)},{immediate:!0})})},m=()=>{i.run(()=>{n.watch(()=>t.applyDefault,()=>{qe(t.applyDefault)&&(o.applyDefault.value=t.applyDefault)},{immediate:!0})})},p=()=>{i.run(()=>{const b=async k=>{let g=k;typeof t.autoConnect=="function"&&(g=await t.autoConnect(k)),g!==!1&&o.addEdges([g])};n.watch(()=>t.autoConnect,()=>{qe(t.autoConnect)&&(o.autoConnect.value=t.autoConnect)},{immediate:!0}),n.watch(o.autoConnect,(k,g,w)=>{k?o.onConnect(b):o.hooks.value.connect.off(b),w(()=>{o.hooks.value.connect.off(b)})},{immediate:!0})})},f=()=>{const b=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const k of Object.keys(t)){const g=k;if(!b.includes(g)){const w=n.toRef(()=>t[g]),h=o[g];n.isRef(h)&&i.run(()=>{n.watch(w,E=>{qe(E)&&(h.value=E)},{immediate:!0})})}}};(()=>{a(),r(),l(),c(),s(),d(),u(),m(),p(),f()})()}),()=>i.stop()}function n1(){return{edgesChange:xe(),nodesChange:xe(),nodeDoubleClick:xe(),nodeClick:xe(),nodeMouseEnter:xe(),nodeMouseMove:xe(),nodeMouseLeave:xe(),nodeContextMenu:xe(),nodeDragStart:xe(),nodeDrag:xe(),nodeDragStop:xe(),nodesInitialized:xe(),miniMapNodeClick:xe(),miniMapNodeDoubleClick:xe(),miniMapNodeMouseEnter:xe(),miniMapNodeMouseMove:xe(),miniMapNodeMouseLeave:xe(),connect:xe(),connectStart:xe(),connectEnd:xe(),clickConnectStart:xe(),clickConnectEnd:xe(),paneReady:xe(),init:xe(),move:xe(),moveStart:xe(),moveEnd:xe(),selectionDragStart:xe(),selectionDrag:xe(),selectionDragStop:xe(),selectionContextMenu:xe(),selectionStart:xe(),selectionEnd:xe(),viewportChangeStart:xe(),viewportChange:xe(),viewportChangeEnd:xe(),paneScroll:xe(),paneClick:xe(),paneContextMenu:xe(),paneMouseEnter:xe(),paneMouseMove:xe(),paneMouseLeave:xe(),edgeContextMenu:xe(),edgeMouseEnter:xe(),edgeMouseMove:xe(),edgeMouseLeave:xe(),edgeDoubleClick:xe(),edgeClick:xe(),edgeUpdateStart:xe(),edgeUpdate:xe(),edgeUpdateEnd:xe(),updateNodeInternals:xe(),error:xe(e=>Mo(e.message))}}function o1(e,t){const o=n.getCurrentInstance();n.onBeforeMount(()=>{for(const[a,r]of Object.entries(t.value)){const l=s=>{e(a,s)};r.setEmitter(l),ho(r.removeEmitter),r.setHasEmitListeners(()=>i(a)),ho(r.removeHasEmitListeners)}});function i(a){var r;const l=i1(a);return!!((r=o==null?void 0:o.vnode.props)==null?void 0:r[l])}}function i1(e){const[t,...o]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(a,r)=>r.toUpperCase())}${o.length?`:${o.join(":")}`:""}`}function Zd(){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:Nr.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:Io.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:mn.Bezier,style:{}},connectionMode:Pt.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:Vo()?"Meta":"Control",zoomActivationKeyCode:Vo()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:n1(),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 a1=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function r1(e,t,o){const i=e1(e),a=G=>{const H=G??[];e.hooks.updateNodeInternals.trigger(H)},r=G=>E_(G,e.nodes,e.edges),l=G=>k_(G,e.nodes,e.edges),s=G=>hn(G,e.edges),c=({id:G,type:H,nodeId:C})=>{var M;const T=G?`-${H}-${G}`:`-${H}`;return Array.from(((M=e.connectionLookup.get(`${C}${T}`))==null?void 0:M.values())??[])},d=G=>{if(G)return t.value.get(G)},u=G=>{if(G)return o.value.get(G)},m=(G,H,C)=>{var M,T;const ne=[];for(const de of G){const Ee={id:de.id,type:"position",dragging:C,from:de.from};if(H&&(Ee.position=de.position,de.parentNode)){const ye=d(de.parentNode);Ee.position={x:Ee.position.x-(((M=ye==null?void 0:ye.computedPosition)==null?void 0:M.x)??0),y:Ee.position.y-(((T=ye==null?void 0:ye.computedPosition)==null?void 0:T.y)??0)}}ne.push(Ee)}ne!=null&&ne.length&&e.hooks.nodesChange.trigger(ne)},p=G=>{if(!e.vueFlowRef)return;const H=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!H)return;const C=window.getComputedStyle(H),{m22:M}=new window.DOMMatrixReadOnly(C.transform),T=[];for(const ne of G){const de=ne,Ee=d(de.id);if(Ee){const ye=ji(de.nodeElement);if(!!(ye.width&&ye.height&&(Ee.dimensions.width!==ye.width||Ee.dimensions.height!==ye.height||de.forceUpdate))){const Te=de.nodeElement.getBoundingClientRect();Ee.dimensions=ye,Ee.handleBounds.source=Ud("source",de.nodeElement,Te,M,Ee.id),Ee.handleBounds.target=Ud("target",de.nodeElement,Te,M,Ee.id),T.push({id:Ee.id,type:"dimensions",dimensions:ye})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&i.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),T.length&&e.hooks.nodesChange.trigger(T)},f=(G,H)=>{const C=new Set,M=new Set;for(const de of G)pn(de)?C.add(de.id):Kt(de)&&M.add(de.id);const T=Wt(t.value,C,!0),ne=Wt(o.value,M);if(e.multiSelectionActive){for(const de of C)T.push(Yt(de,H));for(const de of M)ne.push(Yt(de,H))}T.length&&e.hooks.nodesChange.trigger(T),ne.length&&e.hooks.edgesChange.trigger(ne)},y=G=>{if(e.multiSelectionActive){const H=G.map(C=>Yt(C.id,!0));e.hooks.nodesChange.trigger(H);return}e.hooks.nodesChange.trigger(Wt(t.value,new Set(G.map(H=>H.id)),!0)),e.hooks.edgesChange.trigger(Wt(o.value))},b=G=>{if(e.multiSelectionActive){const H=G.map(C=>Yt(C.id,!0));e.hooks.edgesChange.trigger(H);return}e.hooks.edgesChange.trigger(Wt(o.value,new Set(G.map(H=>H.id)))),e.hooks.nodesChange.trigger(Wt(t.value,new Set,!0))},k=G=>{f(G,!0)},g=G=>{const C=(G||e.nodes).map(M=>(M.selected=!1,Yt(M.id,!1)));e.hooks.nodesChange.trigger(C)},w=G=>{const C=(G||e.edges).map(M=>(M.selected=!1,Yt(M.id,!1)));e.hooks.edgesChange.trigger(C)},h=G=>{if(!G||!G.length)return f([],!1);const H=G.reduce((C,M)=>{const T=Yt(M.id,!1);return pn(M)?C.nodes.push(T):C.edges.push(T),C},{nodes:[],edges:[]});H.nodes.length&&e.hooks.nodesChange.trigger(H.nodes),H.edges.length&&e.hooks.edgesChange.trigger(H.edges)},E=G=>{var H;(H=e.d3Zoom)==null||H.scaleExtent([G,e.maxZoom]),e.minZoom=G},X=G=>{var H;(H=e.d3Zoom)==null||H.scaleExtent([e.minZoom,G]),e.maxZoom=G},z=G=>{var H;(H=e.d3Zoom)==null||H.translateExtent(G),e.translateExtent=G},q=G=>{e.nodeExtent=G,a()},D=G=>{var H;(H=e.d3Zoom)==null||H.clickDistance(G)},$=G=>{e.nodesDraggable=G,e.nodesConnectable=G,e.elementsSelectable=G},B=G=>{const H=G instanceof Function?G(e.nodes):G;!e.initialized&&!H.length||(e.nodes=Hd(H,d,e.hooks.error.trigger))},Q=G=>{const H=G instanceof Function?G(e.edges):G;if(!e.initialized&&!H.length)return;const C=Dr(H,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Br(e.connectionLookup,o.value,C),e.edges=C},V=G=>{const H=G instanceof Function?G([...e.nodes,...e.edges]):G;!e.initialized&&!H.length||(B(H.filter(pn)),Q(H.filter(Kt)))},re=G=>{let H=G instanceof Function?G(e.nodes):G;H=Array.isArray(H)?H:[H];const C=Hd(H,d,e.hooks.error.trigger),M=[];for(const T of C)M.push($d(T));M.length&&e.hooks.nodesChange.trigger(M)},_=G=>{let H=G instanceof Function?G(e.edges):G;H=Array.isArray(H)?H:[H];const C=Dr(H,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),M=[];for(const T of C)M.push($d(T));M.length&&e.hooks.edgesChange.trigger(M)},W=(G,H=!0,C=!1)=>{const M=G instanceof Function?G(e.nodes):G,T=Array.isArray(M)?M:[M],ne=[],de=[];function Ee(ve){const Te=s(ve);for(const Ve of Te)(!qe(Ve.deletable)||Ve.deletable)&&de.push(Ad(Ve.id,Ve.source,Ve.target,Ve.sourceHandle,Ve.targetHandle))}function ye(ve){const Te=[];for(const Ve of e.nodes)Ve.parentNode===ve&&Te.push(Ve);if(Te.length){for(const Ve of Te)ne.push(Rd(Ve.id));H&&Ee(Te);for(const Ve of Te)ye(Ve.id)}}for(const ve of T){const Te=typeof ve=="string"?d(ve):ve;Te&&(qe(Te.deletable)&&!Te.deletable||(ne.push(Rd(Te.id)),H&&Ee([Te]),C&&ye(Te.id)))}de.length&&e.hooks.edgesChange.trigger(de),ne.length&&e.hooks.nodesChange.trigger(ne)},R=G=>{const H=G instanceof Function?G(e.edges):G,C=Array.isArray(H)?H:[H],M=[];for(const T of C){const ne=typeof T=="string"?u(T):T;ne&&(qe(ne.deletable)&&!ne.deletable||M.push(Ad(typeof T=="string"?T:T.id,ne.source,ne.target,ne.sourceHandle,ne.targetHandle)))}e.hooks.edgesChange.trigger(M)},J=(G,H,C=!0)=>{const M=u(G.id);if(!M)return!1;const T=e.edges.indexOf(M),ne=F_(G,H,M,C,e.hooks.error.trigger);if(ne){const[de]=Dr([ne],e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((Ee,ye)=>ye===T?de:Ee),Br(e.connectionLookup,o.value,[de]),de}return!1},ee=(G,H,C={replace:!1})=>{const M=u(G);if(!M)return;const T=typeof H=="function"?H(M):H;M.data=C.replace?T:{...M.data,...T}},ae=G=>Sd(G,e.nodes),I=G=>{const H=Sd(G,e.edges);return Br(e.connectionLookup,o.value,H),H},K=(G,H,C={replace:!1})=>{const M=d(G);if(!M)return;const T=typeof H=="function"?H(M):H;C.replace?e.nodes.splice(e.nodes.indexOf(M),1,T):Object.assign(M,T)},oe=(G,H,C={replace:!1})=>{const M=d(G);if(!M)return;const T=typeof H=="function"?H(M):H;M.data=C.replace?T:{...M.data,...T}},pe=(G,H,C=!1)=>{C?e.connectionClickStartHandle=G:e.connectionStartHandle=G,e.connectionEndHandle=null,e.connectionStatus=null,H&&(e.connectionPosition=H)},fe=(G,H=null,C=null)=>{e.connectionStartHandle&&(e.connectionPosition=G,e.connectionEndHandle=H,e.connectionStatus=C)},ce=(G,H)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,H?e.connectionClickStartHandle=null:e.connectionStartHandle=null},ue=G=>{const H=b_(G),C=H?null:$o(G)?G:d(G.id);return!H&&!C?[null,null,H]:[H?G:Fi(C),C,H]},he=(G,H=!0,C=e.nodes)=>{const[M,T,ne]=ue(G);if(!M)return[];const de=[];for(const Ee of C||e.nodes){if(!ne&&(Ee.id===T.id||!Ee.computedPosition))continue;const ye=Fi(Ee),ve=Gi(ye,M);(H&&ve>0||ve>=ye.width*ye.height||ve>=Number(M.width)*Number(M.height))&&de.push(Ee)}return de},we=(G,H,C=!0)=>{const[M]=ue(G);if(!M)return!1;const T=Gi(M,H);return C&&T>0||T>=Number(M.width)*Number(M.height)},Se=G=>{const{viewport:H,dimensions:C,d3Zoom:M,d3Selection:T,translateExtent:ne}=e;if(!M||!T||!G.x&&!G.y)return!1;const de=Hn.translate(H.x+G.x,H.y+G.y).scale(H.zoom),Ee=[[0,0],[C.width,C.height]],ye=M.constrain()(de,Ee,ne),ve=e.viewport.x!==ye.x||e.viewport.y!==ye.y||e.viewport.zoom!==ye.k;return M.transform(T,ye),ve},Ie=G=>{const H=G instanceof Function?G(e):G,C=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];qe(H.defaultEdgeOptions)&&(e.defaultEdgeOptions=H.defaultEdgeOptions);const M=H.modelValue||H.nodes||H.edges?[]:void 0;M&&(H.modelValue&&M.push(...H.modelValue),H.nodes&&M.push(...H.nodes),H.edges&&M.push(...H.edges),V(M));const T=()=>{qe(H.maxZoom)&&X(H.maxZoom),qe(H.minZoom)&&E(H.minZoom),qe(H.translateExtent)&&z(H.translateExtent)};for(const ne of Object.keys(H)){const de=ne,Ee=H[de];![...a1,...C].includes(de)&&qe(Ee)&&(e[de]=Ee)}nr(()=>e.d3Zoom).not.toBeNull().then(T),e.initialized||(e.initialized=!0)};return{updateNodePositions:m,updateNodeDimensions:p,setElements:V,setNodes:B,setEdges:Q,addNodes:re,addEdges:_,removeNodes:W,removeEdges:R,findNode:d,findEdge:u,updateEdge:J,updateEdgeData:ee,updateNode:K,updateNodeData:oe,applyEdgeChanges:I,applyNodeChanges:ae,addSelectedElements:k,addSelectedNodes:y,addSelectedEdges:b,setMinZoom:E,setMaxZoom:X,setTranslateExtent:z,setNodeExtent:q,setPaneClickDistance:D,removeSelectedElements:h,removeSelectedNodes:g,removeSelectedEdges:w,startConnection:pe,updateConnection:fe,endConnection:ce,setInteractive:$,setState:Ie,getIntersectingNodes:he,getIncomers:r,getOutgoers:l,getConnectedEdges:s,getHandleConnections:c,isNodeIntersecting:we,panBy:Se,fitView:G=>i.value.fitView(G),zoomIn:G=>i.value.zoomIn(G),zoomOut:G=>i.value.zoomOut(G),zoomTo:(G,H)=>i.value.zoomTo(G,H),setViewport:(G,H)=>i.value.setViewport(G,H),setTransform:(G,H)=>i.value.setTransform(G,H),getViewport:()=>i.value.getViewport(),getTransform:()=>i.value.getTransform(),setCenter:(G,H,C)=>i.value.setCenter(G,H,C),fitBounds:(G,H)=>i.value.fitBounds(G,H),project:G=>i.value.project(G),screenToFlowCoordinate:G=>i.value.screenToFlowCoordinate(G),flowToScreenCoordinate:G=>i.value.flowToScreenCoordinate(G),toObject:()=>{const G=[],H=[];for(const C of e.nodes){const{computedPosition:M,handleBounds:T,selected:ne,dimensions:de,isParent:Ee,resizing:ye,dragging:ve,events:Te,...Ve}=C;G.push(Ve)}for(const C of e.edges){const{selected:M,sourceNode:T,targetNode:ne,events:de,...Ee}=C;H.push(Ee)}return JSON.parse(JSON.stringify({nodes:G,edges:H,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:G=>new Promise(H=>{const{nodes:C,edges:M,position:T,zoom:ne,viewport:de}=G;C&&B(C),M&&Q(M);const[Ee,ye]=de!=null&&de.x&&(de!=null&&de.y)?[de.x,de.y]:T??[null,null];if(Ee&&ye){const ve=(de==null?void 0:de.zoom)||ne||e.viewport.zoom;return nr(()=>i.value.viewportInitialized).toBe(!0).then(()=>{i.value.setViewport({x:Ee,y:ye,zoom:ve}).then(()=>{H(!0)})})}else H(!0)}),updateNodeInternals:a,viewportHelper:i,$reset:()=>{const G=Zd();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const H=Hn.translate(G.defaultViewport.x??0,G.defaultViewport.y??0).scale(fn(G.defaultViewport.zoom??1,G.minZoom,G.maxZoom)),C=e.viewportRef.getBoundingClientRect(),M=[[0,0],[C.width,C.height]],T=e.d3Zoom.constrain()(H,M,G.translateExtent);e.d3Zoom.transform(e.d3Selection,T)}Ie(G)},$destroy:()=>{}}}const l1=["data-id","data-handleid","data-nodeid","data-handlepos"],s1={name:"Handle",compatConfig:{MODE:3}},yn=n.defineComponent({...s1,props:{id:{default:null},type:{},position:{default:()=>Ce.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:t}){const o=n.createPropsRestProxy(e,["position","connectable","connectableStart","connectableEnd","id"]),i=n.toRef(()=>o.type??"source"),a=n.toRef(()=>o.isValidConnection??null),{id:r,connectionStartHandle:l,connectionClickStartHandle:s,connectionEndHandle:c,vueFlowRef:d,nodesConnectable:u,noDragClassName:m,noPanClassName:p}=Oe(),{id:f,node:y,nodeEl:b,connectedEdges:k}=Xd(),g=n.ref(),w=n.toRef(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),h=n.toRef(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),E=n.toRef(()=>{var Q,V,re,_,W,R;return((Q=l.value)==null?void 0:Q.nodeId)===f&&((V=l.value)==null?void 0:V.id)===e.id&&((re=l.value)==null?void 0:re.type)===i.value||((_=c.value)==null?void 0:_.nodeId)===f&&((W=c.value)==null?void 0:W.id)===e.id&&((R=c.value)==null?void 0:R.type)===i.value}),X=n.toRef(()=>{var Q,V,re;return((Q=s.value)==null?void 0:Q.nodeId)===f&&((V=s.value)==null?void 0:V.id)===e.id&&((re=s.value)==null?void 0:re.type)===i.value}),{handlePointerDown:z,handleClick:q}=qd({nodeId:f,handleId:e.id,isValidConnection:a,type:i}),D=n.computed(()=>typeof e.connectable=="string"&&e.connectable==="single"?!k.value.some(Q=>{const V=Q[`${i.value}Handle`];return Q[i.value]!==f?!1:V?V===e.id:!0}):typeof e.connectable=="number"?k.value.filter(Q=>{const V=Q[`${i.value}Handle`];return Q[i.value]!==f?!1:V?V===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(y,k.value):qe(e.connectable)?e.connectable:u.value);n.onMounted(()=>{var Q;if(!y.dimensions.width||!y.dimensions.height)return;const V=(Q=y.handleBounds[i.value])==null?void 0:Q.find(ae=>ae.id===e.id);if(!d.value||V)return;const re=d.value.querySelector(".vue-flow__transformationpane");if(!b.value||!g.value||!re||!e.id)return;const _=b.value.getBoundingClientRect(),W=g.value.getBoundingClientRect(),R=window.getComputedStyle(re),{m22:J}=new window.DOMMatrixReadOnly(R.transform),ee={id:e.id,position:e.position,x:(W.left-_.left)/J,y:(W.top-_.top)/J,type:i.value,nodeId:f,...ji(g.value)};y.handleBounds[i.value]=[...y.handleBounds[i.value]??[],ee]});function $(Q){const V=Ar(Q);D.value&&w.value&&(V&&Q.button===0||!V)&&z(Q)}function B(Q){!f||!s.value&&!w.value||D.value&&q(Q)}return t({handleClick:q,handlePointerDown:z,onClick:B,onPointerDown:$}),(Q,V)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"handle",ref:g,"data-id":`${n.unref(r)}-${n.unref(f)}-${e.id}-${i.value}`,"data-handleid":e.id,"data-nodeid":n.unref(f),"data-handlepos":Q.position,class:n.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${Q.position}`,`vue-flow__handle-${e.id}`,n.unref(m),n.unref(p),i.value,{connectable:D.value,connecting:X.value,connectablestart:w.value,connectableend:h.value,connectionindicator:D.value&&(w.value&&!E.value||h.value&&E.value)}]]),onMousedown:$,onTouchstartPassive:$,onClick:B},[n.renderSlot(Q.$slots,"default",{id:Q.id})],42,l1))}}),Zi=function({sourcePosition:e=Ce.Bottom,targetPosition:t=Ce.Top,label:o,connectable:i=!0,isValidTargetPos:a,isValidSourcePos:r,data:l}){const s=l.label??o;return[n.h(yn,{type:"target",position:t,connectable:i,isValidConnection:a}),typeof s!="string"&&s?n.h(s):n.h(n.Fragment,[s]),n.h(yn,{type:"source",position:e,connectable:i,isValidConnection:r})]};Zi.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Zi.inheritAttrs=!1,Zi.compatConfig={MODE:3};const c1=Zi,Qi=function({targetPosition:e=Ce.Top,label:t,connectable:o=!0,isValidTargetPos:i,data:a}){const r=a.label??t;return[n.h(yn,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof r!="string"&&r?n.h(r):n.h(n.Fragment,[r])]};Qi.props=["targetPosition","label","isValidTargetPos","connectable","data"],Qi.inheritAttrs=!1,Qi.compatConfig={MODE:3};const d1=Qi,ea=function({sourcePosition:e=Ce.Bottom,label:t,connectable:o=!0,isValidSourcePos:i,data:a}){const r=a.label??t;return[typeof r!="string"&&r?n.h(r):n.h(n.Fragment,[r]),n.h(yn,{type:"source",position:e,connectable:o,isValidConnection:i})]};ea.props=["sourcePosition","label","isValidSourcePos","connectable","data"],ea.inheritAttrs=!1,ea.compatConfig={MODE:3};const u1=ea,m1=["transform"],f1=["width","height","x","y","rx","ry"],p1=["y"],h1={name:"EdgeText",compatConfig:{MODE:3}},y1=n.defineComponent({...h1,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=n.ref({x:0,y:0,width:0,height:0}),o=n.ref(null),i=n.computed(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);n.onMounted(a),n.watch([()=>e.x,()=>e.y,o,()=>e.label],a);function a(){if(!o.value)return;const r=o.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,l)=>(n.openBlock(),n.createElementBlock("g",{transform:i.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(n.openBlock(),n.createElementBlock("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:n.normalizeStyle(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,f1)):n.createCommentVNode("",!0),n.createElementVNode("text",n.mergeProps(r.$attrs,{ref_key:"el",ref:o,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[n.renderSlot(r.$slots,"default",{},()=>[typeof r.label!="string"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.label),{key:0})):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(r.label),1)],64))])],16,p1)],8,m1))}}),g1=["id","d","marker-end","marker-start"],b1=["d","stroke-width"],_1={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},ta=n.defineComponent({..._1,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const o=n.ref(null),i=n.ref(null),a=n.ref(null),r=n.useAttrs();return t({pathEl:o,interactionEl:i,labelEl:a}),(l,s)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",n.mergeProps(n.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,g1),l.interactionWidth?(n.openBlock(),n.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,b1)):n.createCommentVNode("",!0),l.label&&l.labelX&&l.labelY?(n.openBlock(),n.createBlock(y1,{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"])):n.createCommentVNode("",!0)],64))}});function Qd({sourceX:e,sourceY:t,targetX:o,targetY:i}){const a=Math.abs(o-e)/2,r=o<e?o+a:o-a,l=Math.abs(i-t)/2,s=i<t?i+l:i-l;return[r,s,a,l]}function eu({sourceX:e,sourceY:t,targetX:o,targetY:i,sourceControlX:a,sourceControlY:r,targetControlX:l,targetControlY:s}){const c=e*.125+a*.375+l*.375+o*.125,d=t*.125+r*.375+s*.375+i*.125,u=Math.abs(c-e),m=Math.abs(d-t);return[c,d,u,m]}function na(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function tu({pos:e,x1:t,y1:o,x2:i,y2:a,c:r}){let l,s;switch(e){case Ce.Left:l=t-na(t-i,r),s=o;break;case Ce.Right:l=t+na(i-t,r),s=o;break;case Ce.Top:l=t,s=o-na(o-a,r);break;case Ce.Bottom:l=t,s=o+na(a-o,r);break}return[l,s]}function nu(e){const{sourceX:t,sourceY:o,sourcePosition:i=Ce.Bottom,targetX:a,targetY:r,targetPosition:l=Ce.Top,curvature:s=.25}=e,[c,d]=tu({pos:i,x1:t,y1:o,x2:a,y2:r,c:s}),[u,m]=tu({pos:l,x1:a,y1:r,x2:t,y2:o,c:s}),[p,f,y,b]=eu({sourceX:t,sourceY:o,targetX:a,targetY:r,sourceControlX:c,sourceControlY:d,targetControlX:u,targetControlY:m});return[`M${t},${o} C${c},${d} ${u},${m} ${a},${r}`,p,f,y,b]}function ou({pos:e,x1:t,y1:o,x2:i,y2:a}){let r,l;switch(e){case Ce.Left:case Ce.Right:r=.5*(t+i),l=o;break;case Ce.Top:case Ce.Bottom:r=t,l=.5*(o+a);break}return[r,l]}function iu(e){const{sourceX:t,sourceY:o,sourcePosition:i=Ce.Bottom,targetX:a,targetY:r,targetPosition:l=Ce.Top}=e,[s,c]=ou({pos:i,x1:t,y1:o,x2:a,y2:r}),[d,u]=ou({pos:l,x1:a,y1:r,x2:t,y2:o}),[m,p,f,y]=eu({sourceX:t,sourceY:o,targetX:a,targetY:r,sourceControlX:s,sourceControlY:c,targetControlX:d,targetControlY:u});return[`M${t},${o} C${s},${c} ${d},${u} ${a},${r}`,m,p,f,y]}const au={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}};function k1({source:e,sourcePosition:t=Ce.Bottom,target:o}){return t===Ce.Left||t===Ce.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 ru(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function E1({source:e,sourcePosition:t=Ce.Bottom,target:o,targetPosition:i=Ce.Top,center:a,offset:r}){const l=au[t],s=au[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=k1({source:c,sourcePosition:t,target:d}),m=u.x!==0?"x":"y",p=u[m];let f,y,b;const k={x:0,y:0},g={x:0,y:0},[w,h,E,X]=Qd({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(l[m]*s[m]===-1){y=a.x??w,b=a.y??h;const q=[{x:y,y:c.y},{x:y,y:d.y}],D=[{x:c.x,y:b},{x:d.x,y:b}];l[m]===p?f=m==="x"?q:D:f=m==="x"?D:q}else{const q=[{x:c.x,y:d.y}],D=[{x:d.x,y:c.y}];if(m==="x"?f=l.x===p?D:q:f=l.y===p?q:D,t===i){const re=Math.abs(e[m]-o[m]);if(re<=r){const _=Math.min(r-1,r-re);l[m]===p?k[m]=(c[m]>e[m]?-1:1)*_:g[m]=(d[m]>o[m]?-1:1)*_}}if(t!==i){const re=m==="x"?"y":"x",_=l[m]===s[re],W=c[re]>d[re],R=c[re]<d[re];(l[m]===1&&(!_&&W||_&&R)||l[m]!==1&&(!_&&R||_&&W))&&(f=m==="x"?q:D)}const $={x:c.x+k.x,y:c.y+k.y},B={x:d.x+g.x,y:d.y+g.y},Q=Math.max(Math.abs($.x-f[0].x),Math.abs(B.x-f[0].x)),V=Math.max(Math.abs($.y-f[0].y),Math.abs(B.y-f[0].y));Q>=V?(y=($.x+B.x)/2,b=f[0].y):(y=f[0].x,b=($.y+B.y)/2)}return[[e,{x:c.x+k.x,y:c.y+k.y},...f,{x:d.x+g.x,y:d.y+g.y},o],y,b,E,X]}function w1(e,t,o,i){const a=Math.min(ru(e,t)/2,ru(t,o)/2,i),{x:r,y:l}=t;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 Pr(e){const{sourceX:t,sourceY:o,sourcePosition:i=Ce.Bottom,targetX:a,targetY:r,targetPosition:l=Ce.Top,borderRadius:s=5,centerX:c,centerY:d,offset:u=20}=e,[m,p,f,y,b]=E1({source:{x:t,y:o},sourcePosition:i,target:{x:a,y:r},targetPosition:l,center:{x:c,y:d},offset:u});return[m.reduce((g,w,h)=>{let E;return h>0&&h<m.length-1?E=w1(m[h-1],w,m[h+1],s):E=`${h===0?"M":"L"}${w.x} ${w.y}`,g+=E,g},""),p,f,y,b]}function N1(e){const{sourceX:t,sourceY:o,targetX:i,targetY:a}=e,[r,l,s,c]=Qd({sourceX:t,sourceY:o,targetX:i,targetY:a});return[`M ${t},${o}L ${i},${a}`,r,l,s,c]}const v1=n.defineComponent({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[o,i,a]=N1(e);return n.h(ta,{path:o,labelX:i,labelY:a,...t,...e})}}}),lu=n.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:t}){return()=>{const[o,i,a]=Pr({...e,sourcePosition:e.sourcePosition??Ce.Bottom,targetPosition:e.targetPosition??Ce.Top});return n.h(ta,{path:o,labelX:i,labelY:a,...t,...e})}}}),x1=n.defineComponent({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>n.h(lu,{...e,...t,borderRadius:0})}}),C1=n.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:t}){return()=>{const[o,i,a]=nu({...e,sourcePosition:e.sourcePosition??Ce.Bottom,targetPosition:e.targetPosition??Ce.Top});return n.h(ta,{path:o,labelX:i,labelY:a,...t,...e})}}}),I1=n.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:t}){return()=>{const[o,i,a]=iu({...e,sourcePosition:e.sourcePosition??Ce.Bottom,targetPosition:e.targetPosition??Ce.Top});return n.h(ta,{path:o,labelX:i,labelY:a,...t,...e})}}}),S1={input:u1,default:c1,output:d1},$1={default:C1,straight:v1,step:x1,smoothstep:lu,simplebezier:I1};function R1(e,t,o){const i=n.computed(()=>b=>t.value.get(b)),a=n.computed(()=>b=>o.value.get(b)),r=n.computed(()=>{const b={...$1,...e.edgeTypes},k=Object.keys(b);for(const g of e.edges)g.type&&!k.includes(g.type)&&(b[g.type]=g.type);return b}),l=n.computed(()=>{const b={...S1,...e.nodeTypes},k=Object.keys(b);for(const g of e.nodes)g.type&&!k.includes(g.type)&&(b[g.type]=g.type);return b}),s=n.computed(()=>e.onlyRenderVisibleElements?Nd(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),c=n.computed(()=>{if(e.onlyRenderVisibleElements){const b=[];for(const k of e.edges){const g=t.value.get(k.source),w=t.value.get(k.target);A_({sourcePos:g.computedPosition||{x:0,y:0},targetPos:w.computedPosition||{x:0,y:0},sourceWidth:g.dimensions.width,sourceHeight:g.dimensions.height,targetWidth:w.dimensions.width,targetHeight:w.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&b.push(k)}return b}return e.edges}),d=n.computed(()=>[...s.value,...c.value]),u=n.computed(()=>{const b=[];for(const k of e.nodes)k.selected&&b.push(k);return b}),m=n.computed(()=>{const b=[];for(const k of e.edges)k.selected&&b.push(k);return b}),p=n.computed(()=>[...u.value,...m.value]),f=n.computed(()=>{const b=[];for(const k of e.nodes)k.dimensions.width&&k.dimensions.height&&k.handleBounds!==void 0&&b.push(k);return b}),y=n.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:y}}class gn{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const o=(t=n.getCurrentInstance())==null?void 0:t.appContext.app,i=(o==null?void 0:o.config.globalProperties.$vueFlowStorage)??gn.instance;return gn.instance=i??new gn,o&&(o.config.globalProperties.$vueFlowStorage=gn.instance),gn.instance}set(t,o){return this.flows.set(t,o)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,o){const i=Zd(),a=n.reactive(i),r={};for(const[p,f]of Object.entries(a.hooks)){const y=`on${p.charAt(0).toUpperCase()+p.slice(1)}`;r[y]=f.on}const l={};for(const[p,f]of Object.entries(a.hooks))l[p]=f.trigger;const s=n.computed(()=>{const p=new Map;for(const f of a.nodes)p.set(f.id,f);return p}),c=n.computed(()=>{const p=new Map;for(const f of a.edges)p.set(f.id,f);return p}),d=R1(a,s,c),u=r1(a,s,c);u.setState({...a,...o});const m={...r,...d,...u,...Ih(a),nodeLookup:s,edgeLookup:c,emits:l,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,m),m}getId(){return`vue-flow-${this.currentId++}`}}function Oe(e){const t=gn.getInstance(),o=n.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=n.inject(jd,null);typeof c<"u"&&c!==null&&(!l||c.id===l)&&(s=c)}if(s||l&&(s=t.get(l)),!s||l&&s.id!==l){const c=r??t.getId(),d=t.create(c,a);s=d,(o??n.effectScope(!0)).run(()=>{n.watch(d.applyDefault,(m,p,f)=>{const y=k=>{d.applyNodeChanges(k)},b=k=>{d.applyEdgeChanges(k)};m?(d.onNodesChange(y),d.onEdgesChange(b)):(d.hooks.value.nodesChange.off(y),d.hooks.value.edgesChange.off(b)),f(()=>{d.hooks.value.nodesChange.off(y),d.hooks.value.edgesChange.off(b)})},{immediate:!0}),ho(()=>{if(s){const m=t.get(s.id);m?m.$destroy():Mo(`No store instance found for id ${s.id} in storage.`)}})})}else i&&s.setState(a);if(o&&(n.provide(jd,s),o.vueFlowId=s.id),i){const c=n.getCurrentInstance();(c==null?void 0:c.type.name)!=="VueFlow"&&s.emits.error(new Ze(We.USEVUEFLOW_OPTIONS))}return s}function A1(e){const{emits:t,dimensions:o}=Oe();let i;n.onMounted(()=>{const a=()=>{var r,l;if(!e.value||!(((l=(r=e.value).checkVisibility)==null?void 0:l.call(r))??!0))return;const s=ji(e.value);(s.width===0||s.height===0)&&t.error(new Ze(We.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)),n.onBeforeUnmount(()=>{window.removeEventListener("resize",a),i&&e.value&&i.unobserve(e.value)})})}const T1={name:"UserSelection",compatConfig:{MODE:3}},V1=n.defineComponent({...T1,props:{userSelectionRect:{}},setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("div",{class:"vue-flow__selection vue-flow__container",style:n.normalizeStyle({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),M1=["tabIndex"],B1={name:"NodesSelection",compatConfig:{MODE:3}},D1=n.defineComponent({...B1,setup(e){const{emits:t,viewport:o,getSelectedNodes:i,noPanClassName:a,disableKeyboardA11y:r,userSelectionActive:l}=Oe(),s=Jd(),c=n.ref(null),d=Wd({el:c,onStart(y){t.selectionDragStart(y),t.nodeDragStart(y)},onDrag(y){t.selectionDrag(y),t.nodeDrag(y)},onStop(y){t.selectionDragStop(y),t.nodeDragStop(y)}});n.onMounted(()=>{var y;r.value||(y=c.value)==null||y.focus({preventScroll:!0})});const u=n.computed(()=>Cr(i.value)),m=n.computed(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function p(y){t.selectionContextMenu({event:y,nodes:i.value})}function f(y){r.value||Fn[y.key]&&(y.preventDefault(),s({x:Fn[y.key].x,y:Fn[y.key].y},y.shiftKey))}return(y,b)=>!n.unref(l)&&u.value.width&&u.value.height?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["vue-flow__nodesselection vue-flow__container",n.unref(a)]),style:n.normalizeStyle({transform:`translate(${n.unref(o).x}px,${n.unref(o).y}px) scale(${n.unref(o).zoom})`})},[n.createElementVNode("div",{ref_key:"el",ref:c,class:n.normalizeClass([{dragging:n.unref(d)},"vue-flow__nodesselection-rect"]),style:n.normalizeStyle(m.value),tabIndex:n.unref(r)?void 0:-1,onContextmenu:p,onKeydown:f},null,46,M1)],6)):n.createCommentVNode("",!0)}});function O1(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const P1={name:"Pane",compatConfig:{MODE:3}},L1=n.defineComponent({...P1,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,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:y,deleteKeyCode:b,multiSelectionKeyCode:k,multiSelectionActive:g,edgeLookup:w,nodeLookup:h,connectionLookup:E,defaultEdgeOptions:X,connectionStartHandle:z,panOnDrag:q}=Oe(),D=n.shallowRef(null),$=n.shallowRef(new Set),B=n.shallowRef(new Set),Q=n.shallowRef(null),V=n.toRef(()=>c.value&&(e.isSelecting||r.value)),re=n.toRef(()=>z.value!==null);let _=!1,W=!1;const R=So(b,{actInsideInputWithModifier:!1}),J=So(k);n.watch(R,ce=>{ce&&(p(m.value),f(u.value),d.value=!1)}),n.watch(J,ce=>{g.value=ce});function ee(ce,ue){return he=>{he.target===ue&&(ce==null||ce(he))}}function ae(ce){if(_||re.value){_=!1;return}a.paneClick(ce),l(),d.value=!1}function I(ce){var ue;if(Array.isArray(q.value)&&((ue=q.value)!=null&&ue.includes(2))){ce.preventDefault();return}a.paneContextMenu(ce)}function K(ce){a.paneScroll(ce)}function oe(ce){var ue,he,we;if(Q.value=((ue=t.value)==null?void 0:ue.getBoundingClientRect())??null,!c.value||!e.isSelecting||ce.button!==0||ce.target!==D.value||!Q.value)return;(we=(he=ce.target)==null?void 0:he.setPointerCapture)==null||we.call(he,ce.pointerId);const{x:Se,y:Ie}=O1(ce,Q.value);W=!0,_=!1,l(),s.value={width:0,height:0,startX:Se,startY:Ie,x:Se,y:Ie},a.selectionStart(ce)}function pe(ce){var ue;if(!Q.value||!s.value)return;_=!0;const{x:he,y:we}=It(ce,Q.value),{startX:Se=0,startY:Ie=0}=s.value,me={startX:Se,startY:Ie,x:he<Se?he:Se,y:we<Ie?we:Ie,width:Math.abs(he-Se),height:Math.abs(we-Ie)},ge=$.value,ke=B.value;$.value=new Set(Nd(o.value,me,i.value,y.value===Nr.Partial,!0).map(H=>H.id)),B.value=new Set;const G=((ue=X.value)==null?void 0:ue.selectable)??!0;for(const H of $.value){const C=E.value.get(H);if(C)for(const{edgeId:M}of C.values()){const T=w.value.get(M);T&&(T.selectable??G)&&B.value.add(M)}}if(!Gd(ge,$.value)){const H=Wt(h.value,$.value,!0);a.nodesChange(H)}if(!Gd(ke,B.value)){const H=Wt(w.value,B.value);a.edgesChange(H)}s.value=me,r.value=!0,d.value=!1}function fe(ce){var ue;ce.button!==0||!W||((ue=ce.target)==null||ue.releasePointerCapture(ce.pointerId),!r.value&&s.value&&ce.target===D.value&&ae(ce),r.value=!1,s.value=null,d.value=$.value.size>0,a.selectionEnd(ce),e.selectionKeyPressed&&(_=!1),W=!1)}return(ce,ue)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"container",ref:D,class:n.normalizeClass(["vue-flow__pane vue-flow__container",{selection:ce.isSelecting}]),onClick:ue[0]||(ue[0]=he=>V.value?void 0:ee(ae,D.value)(he)),onContextmenu:ue[1]||(ue[1]=he=>ee(I,D.value)(he)),onWheelPassive:ue[2]||(ue[2]=he=>ee(K,D.value)(he)),onPointerenter:ue[3]||(ue[3]=he=>V.value?void 0:n.unref(a).paneMouseEnter(he)),onPointerdown:ue[4]||(ue[4]=he=>V.value?oe(he):n.unref(a).paneMouseMove(he)),onPointermove:ue[5]||(ue[5]=he=>V.value?pe(he):n.unref(a).paneMouseMove(he)),onPointerup:ue[6]||(ue[6]=he=>V.value?fe(he):void 0),onPointerleave:ue[7]||(ue[7]=he=>n.unref(a).paneMouseLeave(he))},[n.renderSlot(ce.$slots,"default"),n.unref(r)&&n.unref(s)?(n.openBlock(),n.createBlock(V1,{key:0,"user-selection-rect":n.unref(s)},null,8,["user-selection-rect"])):n.createCommentVNode("",!0),n.unref(d)&&n.unref(m).length?(n.openBlock(),n.createBlock(D1,{key:1})):n.createCommentVNode("",!0)],34))}}),z1={name:"Transform",compatConfig:{MODE:3}},U1=n.defineComponent({...z1,setup(e){const{viewport:t,fitViewOnInit:o,fitViewOnInitDone:i}=Oe(),a=n.computed(()=>o.value?!i.value:!1),r=n.computed(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(l,s)=>(n.openBlock(),n.createElementBlock("div",{class:"vue-flow__transformationpane vue-flow__container",style:n.normalizeStyle({transform:r.value,opacity:a.value?0:void 0})},[n.renderSlot(l.$slots,"default")],4))}}),H1={name:"Viewport",compatConfig:{MODE:3}},F1=n.defineComponent({...H1,setup(e){const{minZoom:t,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:y,preventScrolling:b,noWheelClassName:k,noPanClassName:g,emits:w,connectionStartHandle:h,userSelectionActive:E,paneDragging:X,d3Zoom:z,d3Selection:q,d3ZoomHandler:D,viewport:$,viewportRef:B,paneClickDistance:Q}=Oe();A1(B);const V=n.shallowRef(!1),re=n.shallowRef(!1);let _=null,W=!1,R=0,J={x:0,y:0,zoom:0};const ee=So(s),ae=So(l),I=So(r),K=n.toRef(()=>(!ae.value||ae.value&&l.value===!0)&&(ee.value||m.value)),oe=n.toRef(()=>ee.value||c.value),pe=n.toRef(()=>l.value===!0&&K.value!==!0),fe=n.toRef(()=>ae.value&&l.value!==!0||E.value||pe.value),ce=n.toRef(()=>h.value!==null);n.onMounted(()=>{if(!B.value){Mo("Viewport element is missing");return}const Ie=B.value,me=Ie.getBoundingClientRect(),ge=u_().clickDistance(Q.value).scaleExtent([t.value,o.value]).translateExtent(a.value),ke=ht(Ie).call(ge),G=ke.on("wheel.zoom"),H=Hn.translate(i.value.x??0,i.value.y??0).scale(fn(i.value.zoom??1,t.value,o.value)),C=[[0,0],[me.width,me.height]],M=ge.constrain()(H,C,a.value);ge.transform(ke,M),ge.wheelDelta(Ir),z.value=ge,q.value=ke,D.value=G,$.value={x:M.x,y:M.y,zoom:M.k},ge.on("start",T=>{var ne;if(!T.sourceEvent)return null;R=T.sourceEvent.button,V.value=!0;const de=we(T.transform);((ne=T.sourceEvent)==null?void 0:ne.type)==="mousedown"&&(X.value=!0),J=de,w.viewportChangeStart(de),w.moveStart({event:T,flowTransform:de})}),ge.on("end",T=>{if(!T.sourceEvent)return null;if(V.value=!1,X.value=!1,ue(K.value,R??0)&&!W&&w.paneContextMenu(T.sourceEvent),W=!1,he(J,T.transform)){const ne=we(T.transform);J=ne,w.viewportChangeEnd(ne),w.moveEnd({event:T,flowTransform:ne})}}),ge.filter(T=>{var ne;const de=I.value||y.value,Ee=f.value&&T.ctrlKey,ye=T.button,ve=T.type==="wheel";if(ye===1&&T.type==="mousedown"&&(Se(T,"vue-flow__node")||Se(T,"vue-flow__edge")))return!0;if(!K.value&&!de&&!oe.value&&!p.value&&!f.value||E.value||ce.value&&!ve||!p.value&&T.type==="dblclick"||Se(T,k.value)&&ve||Se(T,g.value)&&(!ve||oe.value&&ve&&!I.value)||!f.value&&T.ctrlKey&&ve||!de&&!oe.value&&!Ee&&ve)return!1;if(!f&&T.type==="touchstart"&&((ne=T.touches)==null?void 0:ne.length)>1)return T.preventDefault(),!1;if(!K.value&&(T.type==="mousedown"||T.type==="touchstart")||pe.value&&Array.isArray(m.value)&&m.value.includes(0)&&ye===0||Array.isArray(m.value)&&!m.value.includes(ye)&&(T.type==="mousedown"||T.type==="touchstart"))return!1;const Te=Array.isArray(m.value)&&m.value.includes(ye)||l.value===!0&&Array.isArray(m.value)&&!m.value.includes(0)||!ye||ye<=1;return(!T.ctrlKey||ee.value||ve)&&Te}),n.watch([E,K],()=>{E.value&&!V.value?ge.on("zoom",null):E.value||ge.on("zoom",T=>{$.value={x:T.transform.x,y:T.transform.y,zoom:T.transform.k};const ne=we(T.transform);W=ue(K.value,R??0),w.viewportChange(ne),w.move({event:T,flowTransform:ne})})},{immediate:!0}),n.watch([E,oe,d,I,f,b,k],()=>{oe.value&&!I.value&&!E.value?ke.on("wheel.zoom",T=>{if(Se(T,k.value))return!1;const ne=I.value||y.value,de=f.value&&T.ctrlKey;if(!(!b.value||oe.value||ne||de))return!1;T.preventDefault(),T.stopImmediatePropagation();const ye=ke.property("__zoom").k||1,ve=Vo();if(!ee.value&&T.ctrlKey&&f.value&&ve){const lt=Nt(T),x=Ir(T),F=ye*2**x;ge.scaleTo(ke,F,lt,T);return}const Te=T.deltaMode===1?20:1;let Ve=d.value===Io.Vertical?0:T.deltaX*Te,Le=d.value===Io.Horizontal?0:T.deltaY*Te;!ve&&T.shiftKey&&d.value!==Io.Vertical&&!Ve&&Le&&(Ve=Le,Le=0),ge.translateBy(ke,-(Ve/ye)*u.value,-(Le/ye)*u.value);const je=we(ke.property("__zoom"));_&&clearTimeout(_),re.value?(w.move({event:T,flowTransform:je}),w.viewportChange(je),_=setTimeout(()=>{w.moveEnd({event:T,flowTransform:je}),w.viewportChangeEnd(je),re.value=!1},150)):(re.value=!0,w.moveStart({event:T,flowTransform:je}),w.viewportChangeStart(je))},{passive:!1}):typeof G<"u"&&ke.on("wheel.zoom",function(T,ne){const de=!b.value&&T.type==="wheel"&&!T.ctrlKey,Ee=I.value||y.value,ye=f.value&&T.ctrlKey;if(!Ee&&!c.value&&!ye&&T.type==="wheel"||de||Se(T,k.value))return null;T.preventDefault(),G.call(this,T,ne)},{passive:!1})},{immediate:!0})});function ue(Ie,me){return me===2&&Array.isArray(Ie)&&Ie.includes(2)}function he(Ie,me){return Ie.x!==me.x&&!Number.isNaN(me.x)||Ie.y!==me.y&&!Number.isNaN(me.y)||Ie.zoom!==me.k&&!Number.isNaN(me.k)}function we(Ie){return{x:Ie.x,y:Ie.y,zoom:Ie.k}}function Se(Ie,me){return Ie.target.closest(`.${me}`)}return(Ie,me)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"viewportRef",ref:B,class:"vue-flow__viewport vue-flow__container"},[n.createVNode(L1,{"is-selecting":fe.value,"selection-key-pressed":n.unref(ae),class:n.normalizeClass({connecting:ce.value,dragging:n.unref(X),draggable:n.unref(m)===!0||Array.isArray(n.unref(m))&&n.unref(m).includes(0)})},{default:n.withCtx(()=>[n.createVNode(U1,null,{default:n.withCtx(()=>[n.renderSlot(Ie.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),G1=["id"],j1=["id"],K1=["id"],Y1={name:"A11yDescriptions",compatConfig:{MODE:3}},W1=n.defineComponent({...Y1,setup(e){const{id:t,disableKeyboardA11y:o,ariaLiveMessage:i}=Oe();return(a,r)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",{id:`${n.unref(fd)}-${n.unref(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+n.toDisplayString(n.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,G1),n.createElementVNode("div",{id:`${n.unref(pd)}-${n.unref(t)}`,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,j1),n.unref(o)?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,id:`${n.unref(g_)}-${n.unref(t)}`,"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%)"}},n.toDisplayString(n.unref(i)),9,K1))],64))}});function q1(){const e=Oe();n.watch(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function X1(e,t,o){return o===Ce.Left?e-t:o===Ce.Right?e+t:e}function J1(e,t,o){return o===Ce.Top?e-t:o===Ce.Bottom?e+t:e}const Lr=function({radius:e=10,centerX:t=0,centerY:o=0,position:i=Ce.Top,type:a}){return n.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${a}`,cx:X1(t,e,i),cy:J1(o,e,i),r:e,stroke:"transparent",fill:"transparent"})};Lr.props=["radius","centerX","centerY","position","type"],Lr.compatConfig={MODE:3};const su=Lr,Z1=n.defineComponent({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,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:y,elementsSelectable:b,edgesUpdatable:k,edgesFocusable:g,hooks:w}=Oe(),h=n.computed(()=>u(e.id)),{emit:E,on:X}=Y_(h.value,r),z=n.inject(qi),q=n.getCurrentInstance(),D=n.ref(!1),$=n.ref(!1),B=n.ref(""),Q=n.ref(null),V=n.ref("source"),re=n.ref(null),_=n.toRef(()=>typeof h.value.selectable>"u"?b.value:h.value.selectable),W=n.toRef(()=>typeof h.value.updatable>"u"?k.value:h.value.updatable),R=n.toRef(()=>typeof h.value.focusable>"u"?g.value:h.value.focusable);n.provide(G_,e.id),n.provide(j_,re);const J=n.computed(()=>h.value.class instanceof Function?h.value.class(h.value):h.value.class),ee=n.computed(()=>h.value.style instanceof Function?h.value.style(h.value):h.value.style),ae=n.computed(()=>{const H=h.value.type||"default",C=z==null?void 0:z[`edge-${H}`];if(C)return C;let M=h.value.template??c.value[H];if(typeof M=="string"&&q){const T=Object.keys(q.appContext.components);T&&T.includes(H)&&(M=n.resolveComponent(H,!1))}return M&&typeof M!="string"?M:(r.error(new Ze(We.EDGE_TYPE_MISSING,M)),!1)}),{handlePointerDown:I}=qd({nodeId:B,handleId:Q,type:V,isValidConnection:p,edgeUpdaterType:V,onEdgeUpdate:pe,onEdgeUpdateEnd:fe});return()=>{const H=m(h.value.source),C=m(h.value.target),M="pathOptions"in h.value?h.value.pathOptions:{};if(!H&&!C)return r.error(new Ze(We.EDGE_SOURCE_TARGET_MISSING,h.value.id,h.value.source,h.value.target)),null;if(!H)return r.error(new Ze(We.EDGE_SOURCE_MISSING,h.value.id,h.value.source)),null;if(!C)return r.error(new Ze(We.EDGE_TARGET_MISSING,h.value.id,h.value.target)),null;if(!h.value||h.value.hidden||H.hidden||C.hidden)return null;let T;i.value===Pt.Strict?T=H.handleBounds.source:T=[...H.handleBounds.source||[],...H.handleBounds.target||[]];const ne=Bd(T,h.value.sourceHandle);let de;i.value===Pt.Strict?de=C.handleBounds.target:de=[...C.handleBounds.target||[],...C.handleBounds.source||[]];const Ee=Bd(de,h.value.targetHandle),ye=(ne==null?void 0:ne.position)||Ce.Bottom,ve=(Ee==null?void 0:Ee.position)||Ce.Top,{x:Te,y:Ve}=jn(H,ne,ye),{x:Le,y:je}=jn(C,Ee,ve);return h.value.sourceX=Te,h.value.sourceY=Ve,h.value.targetX=Le,h.value.targetY=je,n.h("g",{ref:re,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${ae.value===!1?"default":h.value.type||"default"}`,s.value,J.value,{updating:D.value,selected:h.value.selected,animated:h.value.animated,inactive:!_.value&&!w.value.edgeClick.hasListeners()}],tabIndex:R.value?0:void 0,"aria-label":h.value.ariaLabel===null?void 0:h.value.ariaLabel??`Edge from ${h.value.source} to ${h.value.target}`,"aria-describedby":R.value?`${pd}-${t}`:void 0,"aria-roledescription":"edge",role:R.value?"group":"img",...h.value.domAttributes,onClick:ue,onContextmenu:he,onDblclick:we,onMouseenter:Se,onMousemove:Ie,onMouseleave:me,onKeyDown:R.value?G:void 0},[$.value?null:n.h(ae.value===!1?c.value.default:ae.value,{id:e.id,sourceNode:H,targetNode:C,source:h.value.source,target:h.value.target,type:h.value.type,updatable:W.value,selected:h.value.selected,animated:h.value.animated,label:h.value.label,labelStyle:h.value.labelStyle,labelShowBg:h.value.labelShowBg,labelBgStyle:h.value.labelBgStyle,labelBgPadding:h.value.labelBgPadding,labelBgBorderRadius:h.value.labelBgBorderRadius,data:h.value.data,events:{...h.value.events,...X},style:ee.value,markerStart:`url('#${To(h.value.markerStart,t)}')`,markerEnd:`url('#${To(h.value.markerEnd,t)}')`,sourcePosition:ye,targetPosition:ve,sourceX:Te,sourceY:Ve,targetX:Le,targetY:je,sourceHandleId:h.value.sourceHandle,targetHandleId:h.value.targetHandle,interactionWidth:h.value.interactionWidth,...M}),[W.value==="source"||W.value===!0?[n.h("g",{onMousedown:ge,onMouseenter:K,onMouseout:oe},n.h(su,{position:ye,centerX:Te,centerY:Ve,radius:a.value,type:"source","data-type":"source"}))]:null,W.value==="target"||W.value===!0?[n.h("g",{onMousedown:ke,onMouseenter:K,onMouseout:oe},n.h(su,{position:ve,centerX:Le,centerY:je,radius:a.value,type:"target","data-type":"target"}))]:null]])};function K(){D.value=!0}function oe(){D.value=!1}function pe(H,C){E.update({event:H,edge:h.value,connection:C})}function fe(H){E.updateEnd({event:H,edge:h.value}),$.value=!1}function ce(H,C){H.button===0&&($.value=!0,B.value=C?h.value.target:h.value.source,Q.value=(C?h.value.targetHandle:h.value.sourceHandle)??null,V.value=C?"target":"source",E.updateStart({event:H,edge:h.value}),I(H))}function ue(H){var C;const M={event:H,edge:h.value};_.value&&(l.value=!1,h.value.selected&&f.value?(d([h.value]),(C=re.value)==null||C.blur()):o([h.value])),E.click(M)}function he(H){E.contextMenu({event:H,edge:h.value})}function we(H){E.doubleClick({event:H,edge:h.value})}function Se(H){E.mouseEnter({event:H,edge:h.value})}function Ie(H){E.mouseMove({event:H,edge:h.value})}function me(H){E.mouseLeave({event:H,edge:h.value})}function ge(H){ce(H,!0)}function ke(H){ce(H,!1)}function G(H){var C;!y.value&&hd.includes(H.key)&&_.value&&(H.key==="Escape"?((C=re.value)==null||C.blur(),d([u(e.id)])):o([u(e.id)]))}}}),Q1=n.defineComponent({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:o,connectionStartHandle:i,connectionEndHandle:a,connectionPosition:r,connectionLineType:l,connectionLineStyle:s,connectionLineOptions:c,connectionStatus:d,viewport:u,findNode:m}=Oe(),p=(e=n.inject(qi))==null?void 0:e["connection-line"],f=n.computed(()=>{var w;return m((w=i.value)==null?void 0:w.nodeId)}),y=n.computed(()=>{var w;return m((w=a.value)==null?void 0:w.nodeId)??null}),b=n.computed(()=>({x:(r.value.x-u.value.x)/u.value.zoom,y:(r.value.y-u.value.y)/u.value.zoom})),k=n.computed(()=>c.value.markerStart?`url(#${To(c.value.markerStart,t)})`:""),g=n.computed(()=>c.value.markerEnd?`url(#${To(c.value.markerEnd,t)})`:"");return()=>{var w,h,E;if(!f.value||!i.value)return null;const X=i.value.id,z=i.value.type,q=f.value.handleBounds;let D=(q==null?void 0:q[z])??[];if(o.value===Pt.Loose){const ee=(q==null?void 0:q[z==="source"?"target":"source"])??[];D=[...D,...ee]}if(!D)return null;const $=(X?D.find(ee=>ee.id===X):D[0])??null,B=($==null?void 0:$.position)??Ce.Top,{x:Q,y:V}=jn(f.value,$,B);let re=null;y.value&&(o.value===Pt.Strict?re=((w=y.value.handleBounds[z==="source"?"target":"source"])==null?void 0:w.find(ee=>{var ae;return ee.id===((ae=a.value)==null?void 0:ae.id)}))||null:re=((h=[...y.value.handleBounds.source??[],...y.value.handleBounds.target??[]])==null?void 0:h.find(ee=>{var ae;return ee.id===((ae=a.value)==null?void 0:ae.id)}))||null);const _=((E=a.value)==null?void 0:E.position)??(B?Vr[B]:null);if(!B||!_)return null;const W=l.value??c.value.type??mn.Bezier;let R="";const J={sourceX:Q,sourceY:V,sourcePosition:B,targetX:b.value.x,targetY:b.value.y,targetPosition:_};return W===mn.Bezier?[R]=nu(J):W===mn.Step?[R]=Pr({...J,borderRadius:0}):W===mn.SmoothStep?[R]=Pr(J):W===mn.SimpleBezier?[R]=iu(J):R=`M${Q},${V} ${b.value.x},${b.value.y}`,n.h("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},n.h("g",{class:"vue-flow__connection"},p?n.h(p,{sourceX:Q,sourceY:V,sourcePosition:B,targetX:b.value.x,targetY:b.value.y,targetPosition:_,sourceNode:f.value,sourceHandle:$,targetNode:y.value,targetHandle:re,markerEnd:g.value,markerStart:k.value,connectionStatus:d.value}):n.h("path",{d:R,class:[c.value.class,d.value,"vue-flow__connection-path"],style:{...s.value,...c.value.style},"marker-end":g.value,"marker-start":k.value})))}}}),e0=["id","markerWidth","markerHeight","markerUnits","orient"],t0={name:"MarkerType",compatConfig:{MODE:3}},n0=n.defineComponent({...t0,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(t,o)=>(n.openBlock(),n.createElementBlock("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===n.unref(vr).ArrowClosed?(n.openBlock(),n.createElementBlock("polyline",{key:0,style:n.normalizeStyle({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):n.createCommentVNode("",!0),t.type===n.unref(vr).Arrow?(n.openBlock(),n.createElementBlock("polyline",{key:1,style:n.normalizeStyle({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):n.createCommentVNode("",!0)],8,e0))}}),o0={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},i0={name:"MarkerDefinitions",compatConfig:{MODE:3}},a0=n.defineComponent({...i0,setup(e){const{id:t,edges:o,connectionLineOptions:i,defaultMarkerColor:a}=Oe(),r=n.computed(()=>{const l=new Set,s=[],c=d=>{if(d){const u=To(d,t);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)=>(n.openBlock(),n.createElementBlock("svg",o0,[n.createElementVNode("defs",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,c=>(n.openBlock(),n.createBlock(n0,{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))])]))}}),r0={name:"Edges",compatConfig:{MODE:3}},l0=n.defineComponent({...r0,setup(e){const{findNode:t,getEdges:o,elevateEdgesOnSelect:i}=Oe();return(a,r)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(a0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o),l=>(n.openBlock(),n.createElementBlock("svg",{key:l.id,class:"vue-flow__edges vue-flow__container",style:n.normalizeStyle({zIndex:n.unref(T_)(l,n.unref(t),n.unref(i))})},[n.createVNode(n.unref(Z1),{id:l.id},null,8,["id"])],4))),128)),n.createVNode(n.unref(Q1))],64))}}),s0=n.defineComponent({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,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:y,ariaLiveMessage:b,snapToGrid:k,snapGrid:g,nodeDragThreshold:w,nodesDraggable:h,elementsSelectable:E,nodesConnectable:X,nodesFocusable:z,hooks:q}=Oe(),D=n.ref(null);n.provide(Yd,D),n.provide(Kd,e.id);const $=n.inject(qi),B=n.getCurrentInstance(),Q=Jd(),{node:V,parentNode:re}=Xd(e.id),{emit:_,on:W}=J_(V,l),R=n.toRef(()=>typeof V.draggable>"u"?h.value:V.draggable),J=n.toRef(()=>typeof V.selectable>"u"?E.value:V.selectable),ee=n.toRef(()=>typeof V.connectable>"u"?X.value:V.connectable),ae=n.toRef(()=>typeof V.focusable>"u"?z.value:V.focusable),I=n.computed(()=>J.value||R.value||q.value.nodeClick.hasListeners()||q.value.nodeDoubleClick.hasListeners()||q.value.nodeMouseEnter.hasListeners()||q.value.nodeMouseMove.hasListeners()||q.value.nodeMouseLeave.hasListeners()),K=n.toRef(()=>!!V.dimensions.width&&!!V.dimensions.height),oe=n.computed(()=>{const C=V.type||"default",M=$==null?void 0:$[`node-${C}`];if(M)return M;let T=V.template||m.value[C];if(typeof T=="string"&&B){const ne=Object.keys(B.appContext.components);ne&&ne.includes(C)&&(T=n.resolveComponent(C,!1))}return T&&typeof T!="string"?T:(l.error(new Ze(We.NODE_TYPE_MISSING,T)),!1)}),pe=Wd({id:e.id,el:D,disabled:()=>!R.value,selectable:J,dragHandle:()=>V.dragHandle,onStart(C){_.dragStart(C)},onDrag(C){_.drag(C)},onStop(C){_.dragStop(C)},onClick(C){G(C)}}),fe=n.computed(()=>V.class instanceof Function?V.class(V):V.class),ce=n.computed(()=>{const C=(V.style instanceof Function?V.style(V):V.style)||{},M=V.width instanceof Function?V.width(V):V.width,T=V.height instanceof Function?V.height(V):V.height;return!C.width&&M&&(C.width=typeof M=="string"?M:`${M}px`),!C.height&&T&&(C.height=typeof T=="string"?T:`${T}px`),C}),ue=n.toRef(()=>Number(V.zIndex??ce.value.zIndex??0));return u(C=>{(C.includes(e.id)||!C.length)&&we()}),n.onMounted(()=>{n.watch(()=>V.hidden,(C=!1,M,T)=>{!C&&D.value&&(e.resizeObserver.observe(D.value),T(()=>{D.value&&e.resizeObserver.unobserve(D.value)}))},{immediate:!0,flush:"post"})}),n.watch([()=>V.type,()=>V.sourcePosition,()=>V.targetPosition],()=>{n.nextTick(()=>{d([{id:e.id,nodeElement:D.value,forceUpdate:!0}])})}),n.watch([()=>V.position.x,()=>V.position.y,()=>{var C;return(C=re.value)==null?void 0:C.computedPosition.x},()=>{var C;return(C=re.value)==null?void 0:C.computedPosition.y},()=>{var C;return(C=re.value)==null?void 0:C.computedPosition.z},ue,()=>V.selected,()=>V.dimensions.height,()=>V.dimensions.width,()=>{var C;return(C=re.value)==null?void 0:C.dimensions.height},()=>{var C;return(C=re.value)==null?void 0:C.dimensions.width}],([C,M,T,ne,de,Ee])=>{const ye={x:C,y:M,z:Ee+(f.value&&V.selected?1e3:0)};typeof T<"u"&&typeof ne<"u"?V.computedPosition=C_({x:T,y:ne,z:de},ye):V.computedPosition=ye},{flush:"post",immediate:!0}),n.watch([()=>V.extent,p],([C,M],[T,ne])=>{(C!==T||M!==ne)&&he()}),V.extent==="parent"||typeof V.extent=="object"&&"range"in V.extent&&V.extent.range==="parent"?nr(()=>K).toBe(!0).then(he):he(),()=>V.hidden?null:n.h("div",{ref:D,"data-id":V.id,class:["vue-flow__node",`vue-flow__node-${oe.value===!1?"default":V.type||"default"}`,{[o.value]:R.value,dragging:pe==null?void 0:pe.value,draggable:R.value,selected:V.selected,selectable:J.value,parent:V.isParent},fe.value],style:{visibility:K.value?"visible":"hidden",zIndex:V.computedPosition.z??ue.value,transform:`translate(${V.computedPosition.x}px,${V.computedPosition.y}px)`,pointerEvents:I.value?"all":"none",...ce.value},tabIndex:ae.value?0:void 0,role:ae.value?"group":void 0,"aria-describedby":y.value?void 0:`${fd}-${t}`,"aria-label":V.ariaLabel,"aria-roledescription":"node",...V.domAttributes,onMouseenter:Se,onMousemove:Ie,onMouseleave:me,onContextmenu:ge,onClick:G,onDblclick:ke,onKeydown:H},[n.h(oe.value===!1?m.value.default:oe.value,{id:V.id,type:V.type,data:V.data,events:{...V.events,...W},selected:V.selected,resizing:V.resizing,dragging:pe.value,connectable:ee.value,position:V.computedPosition,dimensions:V.dimensions,isValidTargetPos:V.isValidTargetPos,isValidSourcePos:V.isValidSourcePos,parent:V.parentNode,parentNodeId:V.parentNode,zIndex:V.computedPosition.z??ue.value,targetPosition:V.targetPosition,sourcePosition:V.sourcePosition,label:V.label,dragHandle:V.dragHandle,onUpdateNodeInternals:we})]);function he(){const C=V.computedPosition,{computedPosition:M,position:T}=Rr(V,k.value?Wi(C,g.value):C,l.error,p.value,re.value);(V.computedPosition.x!==M.x||V.computedPosition.y!==M.y)&&(V.computedPosition={...V.computedPosition,...M}),(V.position.x!==T.x||V.position.y!==T.y)&&(V.position=T)}function we(){D.value&&d([{id:e.id,nodeElement:D.value,forceUpdate:!0}])}function Se(C){pe!=null&&pe.value||_.mouseEnter({event:C,node:V})}function Ie(C){pe!=null&&pe.value||_.mouseMove({event:C,node:V})}function me(C){pe!=null&&pe.value||_.mouseLeave({event:C,node:V})}function ge(C){return _.contextMenu({event:C,node:V})}function ke(C){return _.doubleClick({event:C,node:V})}function G(C){J.value&&(!i.value||!R.value||w.value>0)&&Mr(V,r.value,c,s,a,!1,D.value),_.click({event:C,node:V})}function H(C){if(!(xr(C)||y.value))if(hd.includes(C.key)&&J.value){const M=C.key==="Escape";Mr(V,r.value,c,s,a,M,D.value)}else R.value&&V.selected&&Fn[C.key]&&(C.preventDefault(),b.value=`Moved selected node ${C.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~V.position.x}, y: ${~~V.position.y}`,Q({x:Fn[C.key].x,y:Fn[C.key].y},C.shiftKey))}}});function c0(e={includeHiddenNodes:!1}){const{nodes:t}=Oe();return n.computed(()=>{if(t.value.length===0)return!1;for(const o of t.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 d0={class:"vue-flow__nodes vue-flow__container"},u0={name:"Nodes",compatConfig:{MODE:3}},m0=n.defineComponent({...u0,setup(e){const{getNodes:t,updateNodeDimensions:o,emits:i}=Oe(),a=c0(),r=n.ref();return n.watch(a,l=>{l&&n.nextTick(()=>{i.nodesInitialized(t.value)})},{immediate:!0}),n.onMounted(()=>{r.value=new ResizeObserver(l=>{const s=l.map(c=>({id:c.target.getAttribute("data-id"),nodeElement:c.target,forceUpdate:!0}));n.nextTick(()=>o(s))})}),n.onBeforeUnmount(()=>{var l;return(l=r.value)==null?void 0:l.disconnect()}),(l,s)=>(n.openBlock(),n.createElementBlock("div",d0,[r.value?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(n.unref(t),(c,d,u,m)=>{const p=[c.id];if(m&&m.key===c.id&&n.isMemoSame(m,p))return m;const f=(n.openBlock(),n.createBlock(n.unref(s0),{id:c.id,key:c.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return f.memo=p,f},s,0),128)):n.createCommentVNode("",!0)]))}});function f0(){const{emits:e}=Oe();n.onMounted(()=>{if(zd()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Ze(We.MISSING_STYLES))}})}const p0=n.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),h0={name:"VueFlow",compatConfig:{MODE:3}},y0=n.defineComponent({...h0,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:t,emit:o}){const i=e,a=n.useSlots(),r=or(i,"modelValue",o),l=or(i,"nodes",o),s=or(i,"edges",o),c=Oe(i),d=t1({modelValue:r,nodes:l,edges:s},i,c);return o1(o,c.hooks),q1(),f0(),n.provide(qi,a),n.onUnmounted(d),t(c),(u,m)=>(n.openBlock(),n.createElementBlock("div",{ref:n.unref(c).vueFlowRef,class:"vue-flow"},[n.createVNode(F1,null,{default:n.withCtx(()=>[n.createVNode(l0),p0,n.createVNode(m0),n.renderSlot(u.$slots,"zoom-pane")]),_:3}),n.renderSlot(u.$slots,"default"),n.createVNode(W1)],512))}}),g0={name:"Panel",compatConfig:{MODE:3}},cu=n.defineComponent({...g0,props:{position:{}},setup(e){const t=e,{userSelectionActive:o}=Oe(),i=n.computed(()=>`${t.position}`.split("-"));return(a,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["vue-flow__panel",i.value]),style:n.normalizeStyle({pointerEvents:n.unref(o)?"none":"all"})},[n.renderSlot(a.$slots,"default")],6))}}),bn=["red","amber","green","teal","blue","indigo","violet","pink"],du={red:"빨강",amber:"주황",green:"초록",teal:"청록",blue:"파랑",indigo:"남색",violet:"보라",pink:"분홍"};function b0(e){return typeof e=="string"&&e in du}const _0={red:0,amber:32,green:145,teal:173,blue:221,indigo:244,violet:262,pink:330},k0=.15;function E0(e){const t=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let o=t[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 w0(e){if(typeof e!="string")return null;const t=E0(e);if(!t||t.s<k0)return null;let o=null,i=1/0;for(const a of bn){const r=Math.abs(t.h-_0[a]),l=Math.min(r,360-r);l<i&&(i=l,o=a)}return o}function it(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.swatch;if(b0(t))return t;const o=e==null?void 0:e.properties;return w0((o==null?void 0:o["background-color"])??(o==null?void 0:o["font-color"])??(o==null?void 0:o.color))}function zr(e){return e?{bar:`var(--em-swatch-${e}-bar)`,barOn:`var(--em-swatch-${e}-on)`,text:`var(--em-swatch-${e}-text)`}:null}const N0={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)"},v0={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 uu(e,t=!1){return e?t?v0[e]:N0[e]:null}function Kn(e){return du[e]}function Yn(e){return`var(--em-swatch-${e}-bar)`}const x0=["width","height","innerHTML"],C0=n.defineComponent({__name:"EmIcon",props:{name:{},size:{}},setup(e){const t={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"/>',"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)=>(n.openBlock(),n.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:t[e.name]??""},null,8,x0))}}),Pe=(e,t)=>{const o=e.__vccOpts||e;for(const[i,a]of t)o[i]=a;return o},$e=Pe(C0,[["__scopeId","data-v-92c1dba8"]]);function I0(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 S0(e,t){const o=I0(t);return o?e(o):t.split("-")[1]??t}function $0(e){const t=o=>e.params!=null&&o 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"em.check.name3";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-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-6":return"em.check.jpa6";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 t("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-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-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 t("field")?"em.check.dsn5Inherited":"em.check.dsn5Missing";default:return e.ruleId}}function mu(e,t){const o=$0(t);if(t.ruleId==="CHK-TYPE-4"){const i=e("em.check.unspecified"),a=t.params??{};return e(o,{type:a.type||i,dataType:a.dataType||i})}return e(o,t.params)}function R0(e){return e.targetKind==="entity"?e.targetRef:e.contextRef}const A0={class:"em-inline-issue__msgs"},_n=Pe(n.defineComponent({__name:"InlineIssueBadge",props:{controller:{},refId:{}},setup(e){const t=e,o=t.controller,i={error:{order:0,icon:"alert-circle"},warning:{order:1,icon:"alert-triangle"},info:{order:2,icon:"info"}},a=n.computed(()=>t.refId?t.controller.issuesByRef.value.get(t.refId)??[]:[]),r=n.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?(n.openBlock(),n.createElementBlock("p",{key:0,class:n.normalizeClass(["em-inline-issue",`is-${r.value}`])},[n.createVNode($e,{name:i[r.value].icon,size:13,class:"em-inline-issue__icon"},null,8,["name"]),n.createElementVNode("span",A0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,(c,d)=>(n.openBlock(),n.createElementBlock("span",{key:d},n.toDisplayString(n.unref(mu)(n.unref(o).t,c)),1))),128))])],2)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-9f959cc0"]]),T0={class:"em-mlang"},V0={class:"em-mlang__tabs",role:"tablist"},M0=["aria-selected","onClick"],B0={key:0,class:"em-mlang__dot"},Ur=Pe(n.defineComponent({__name:"MultiLangTextField",props:{modelValue:{},name:{},languages:{default:()=>["ko","en","ja","zh"]},defaultLang:{},multiline:{type:Boolean,default:!1},placeholder:{},height:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,i=t;function a(){const d=o.defaultLang;return d&&o.languages.includes(d)?d:o.languages[0]??"ko"}const r=n.ref(a());n.watch(()=>[o.languages,o.defaultLang],()=>{o.languages.includes(r.value)||(r.value=a())});function l(d){var u,m;return!!((m=(u=o.modelValue)==null?void 0:u[d])!=null&&m.trim())}const s=n.computed(()=>{var d;return((d=o.modelValue)==null?void 0:d[r.value])??""});function c(d){const u={...o.modelValue};d.trim()===""?delete u[r.value]:u[r.value]=d,i("update:modelValue",u)}return(d,u)=>(n.openBlock(),n.createElementBlock("div",T0,[n.createElementVNode("div",V0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.languages,m=>(n.openBlock(),n.createElementBlock("button",{key:m,type:"button",class:n.normalizeClass(["em-mlang__tab",{"is-active":r.value===m}]),role:"tab","aria-selected":r.value===m,onClick:p=>r.value=m},[n.createTextVNode(n.toDisplayString(m),1),l(m)?(n.openBlock(),n.createElementBlock("span",B0,"•")):n.createCommentVNode("",!0)],10,M0))),128))]),e.multiline?(n.openBlock(),n.createBlock(n.unref(ie.BSTextArea),{key:0,name:`${e.name}-${r.value}`,width:"100%",height:e.height??"64px",placeholder:e.placeholder,"model-value":s.value,"onUpdate:modelValue":c},null,8,["name","height","placeholder","model-value"])):(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:1,name:`${e.name}-${r.value}`,width:"100%",placeholder:e.placeholder,"model-value":s.value,"onUpdate:modelValue":c},null,8,["name","placeholder","model-value"]))]))}}),[["__scopeId","data-v-274a0fe9"]]),D0=["disabled"],O0={class:"em-panel__sub-label"},P0={class:"em-field"},L0={class:"em-field"},z0={class:"em-field"},U0={class:"em-class"},H0={class:"em-field"},F0={class:"em-field"},G0={class:"em-field"},j0={class:"em-field"},K0={class:"em-multilang"},Y0={class:"em-multilang"},W0={class:"em-jpa"},q0={class:"em-field"},X0={class:"em-field"},J0={class:"em-field"},Z0={class:"em-swatch"},Q0={class:"em-swatch__row"},ek=["title"],tk=["title","onClick"],fu=Pe(n.defineComponent({__name:"EntityBasicsSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean},title:{}},emits:["toggle"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,r=n.computed(()=>a.state.logical.entities.find(V=>V.modelId===o.entityId)??null),l=n.computed(()=>r.value?a.state.layout.entityLayouts.find(V=>V.entityRef===r.value.modelId)??null:null),s=n.computed(()=>{var V;return it(((V=l.value)==null?void 0:V.style)??void 0)}),c=["JPA_ENTITY","JPA_EMBEDDABLE","JPA_MULTI_LANGUAGE_ENTITY","UNDEFINED"],d=[{key:"useVersion",label:"@Version"},{key:"useCacheable",label:"@Cacheable"},{key:"useDynamicInsert",label:"@DynamicInsert"},{key:"useDynamicUpdate",label:"@DynamicUpdate"},{key:"useDiscriminator",label:"@Discriminator"}],u=["inherit","STRING","CHAR","INTEGER"],m=V=>V;function p(V){return V==="inherit"?a.t("em.common.inherit"):V}function f(V){r.value&&a.updateEntity(r.value.modelId,V)}function y(V,re,_){var R;const W=((R=r.value)==null?void 0:R.table)??{physicalName:""};f(V==="physicalName"?{table:{...W,physicalName:_}}:{table:{...W,logicalName:{...W.logicalName,[re]:_}}})}function b(V){f({description:Object.keys(V).length?V:void 0})}function k(V,re){var _;f({jpaAttrs:{...(_=r.value)==null?void 0:_.jpaAttrs,[V]:re}})}function g(V,re){k(V,re)}const w=n.computed(()=>{var V,re;return((re=(V=r.value)==null?void 0:V.jpaAttrs)==null?void 0:re.discriminatorType)??"inherit"}),h=n.computed(()=>{var V,re;return!((re=(V=r.value)==null?void 0:V.jpaAttrs)!=null&&re.useDiscriminator)});function E(V){k("discriminatorType",V==="inherit"?void 0:V)}function X(V){f({hasPersonalInfo:V})}function z(V){f({superClass:V.trim()||void 0})}function q(V){f({schema:V.trim()||void 0})}function D(V){f({abstractClass:V})}const $=n.computed(()=>{var V,re;return((re=(V=r.value)==null?void 0:V.declarationOfInterfaces)==null?void 0:re.join(", "))??""});function B(V){const re=V.split(",").map(_=>_.trim()).filter(Boolean);f({declarationOfInterfaces:re.length?re:void 0})}function Q(V){r.value&&a.setEntitySwatch(r.value.modelId,V)}return(V,re)=>{var _,W,R;return r.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!n.unref(a).editable.value},[e.collapsible?(n.openBlock(),n.createElementBlock("h4",{key:0,class:"em-panel__sub em-panel__sub--toggle",onClick:re[0]||(re[0]=J=>i("toggle"))},[n.createElementVNode("span",O0,[n.createVNode($e,{name:"chevron",size:13,class:n.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"]),n.createTextVNode(" "+n.toDisplayString(e.title||r.value.name||n.unref(a).t("em.entity.fallback")),1)])])):n.createCommentVNode("",!0),!e.collapsible||!e.collapsed?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createVNode(_n,{controller:n.unref(a),"ref-id":e.entityId,class:"em-section__issues"},null,8,["controller","ref-id"]),n.createElementVNode("label",P0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.name")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-name",width:"100%","model-value":r.value.name,"onUpdate:modelValue":re[1]||(re[1]=J=>f({name:J}))},null,8,["model-value"])]),n.createElementVNode("label",L0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.stereotype")),1),n.createVNode(n.unref(ie.BSSelect),{"model-value":r.value.stereotype,items:c,"value-provider":m,"label-provider":m,"onUpdate:modelValue":re[2]||(re[2]=J=>f({stereotype:J}))},null,8,["model-value"])]),n.createElementVNode("label",z0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.package")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-package",width:"100%","model-value":r.value.packageName??"","onUpdate:modelValue":re[3]||(re[3]=J=>f({packageName:J}))},null,8,["model-value"])]),n.createElementVNode("fieldset",U0,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.entity.classLegend")),1),n.createElementVNode("label",H0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.superClass")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-superclass",width:"100%",placeholder:n.unref(a).t("em.entity.superClassPlaceholder"),"model-value":r.value.superClass??"","onUpdate:modelValue":re[4]||(re[4]=J=>z(J))},null,8,["placeholder","model-value"])]),n.createElementVNode("label",F0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.interfaces")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-interfaces",width:"100%",placeholder:n.unref(a).t("em.entity.interfacesPlaceholder"),"model-value":$.value,"onUpdate:modelValue":re[5]||(re[5]=J=>B(J))},null,8,["placeholder","model-value"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"ent-abstract",class:"em-check",label:n.unref(a).t("em.entity.abstractClass"),"model-value":!!r.value.abstractClass,"onUpdate:modelValue":re[6]||(re[6]=J=>D(J))},null,8,["label","model-value"])]),n.createElementVNode("label",G0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.tablePhysical")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-table",width:"100%","model-value":((_=r.value.table)==null?void 0:_.physicalName)??"","onUpdate:modelValue":re[7]||(re[7]=J=>y("physicalName",null,J))},null,8,["model-value"])]),n.createElementVNode("label",j0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.schema")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-schema",width:"100%",placeholder:n.unref(a).t("em.entity.schemaPlaceholder"),"model-value":r.value.schema??"","onUpdate:modelValue":re[8]||(re[8]=J=>q(J))},null,8,["placeholder","model-value"])]),n.createElementVNode("fieldset",K0,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.entity.tableLogicalLegend")),1),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a).languages.value,J=>{var ee,ae;return n.openBlock(),n.createElementBlock("label",{key:J,class:"em-lang"},[n.createElementVNode("span",null,n.toDisplayString(J),1),n.createVNode(n.unref(ie.BSTextInput),{name:`ent-logical-${J}`,width:"100%","model-value":((ae=(ee=r.value.table)==null?void 0:ee.logicalName)==null?void 0:ae[J])??"","onUpdate:modelValue":I=>y("logicalName",J,I)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),n.createElementVNode("fieldset",Y0,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.common.description")),1),n.createVNode(Ur,{multiline:"",name:"ent-desc",languages:n.unref(a).languages.value,"default-lang":n.unref(a).userLanguage.value,"model-value":r.value.description,"onUpdate:modelValue":b},null,8,["languages","default-lang","model-value"])]),n.createElementVNode("fieldset",W0,[re[13]||(re[13]=n.createElementVNode("legend",null,"JPA",-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(d,J=>{var ee;return n.createVNode(n.unref(ie.BSCheckbox),{key:J.key,name:`jpa-${J.key}`,class:"em-check",label:J.label,"model-value":!!((ee=r.value.jpaAttrs)!=null&&ee[J.key]),"onUpdate:modelValue":ae=>g(J.key,ae)},null,8,["name","label","model-value","onUpdate:modelValue"])}),64)),n.createElementVNode("label",q0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.discColumn")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"disc-col",width:"100%",placeholder:n.unref(a).t("em.entity.discColumnPlaceholder"),disabled:h.value,"model-value":((W=r.value.jpaAttrs)==null?void 0:W.discriminatorColumnName)??"","onUpdate:modelValue":re[9]||(re[9]=J=>k("discriminatorColumnName",J.trim()||void 0))},null,8,["placeholder","disabled","model-value"])]),n.createElementVNode("label",X0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.discType")),1),n.createVNode(n.unref(ie.BSSelect),{disabled:h.value,"model-value":w.value,items:u,"value-provider":m,"label-provider":p,"onUpdate:modelValue":re[10]||(re[10]=J=>J&&E(J))},null,8,["disabled","model-value"])]),n.createElementVNode("label",J0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.discLength")),1),n.createVNode(n.unref(ie.BSNumberInput),{name:"disc-len",width:"64px",placeholder:"len",disabled:h.value,"model-value":(R=r.value.jpaAttrs)==null?void 0:R.discriminatorLength,"onUpdate:modelValue":re[11]||(re[11]=J=>k("discriminatorLength",J||void 0))},null,8,["disabled","model-value"])])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"ent-personalinfo",class:"em-check em-check--block",label:n.unref(a).t("em.entity.hasPersonalInfo"),"model-value":!!r.value.hasPersonalInfo,"onUpdate:modelValue":X},null,8,["label","model-value"]),n.createElementVNode("fieldset",Z0,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.entity.headerColor")),1),n.createElementVNode("div",Q0,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":s.value===null}]),title:n.unref(a).t("em.swatch.none"),onClick:re[12]||(re[12]=J=>Q(null))},"∅",10,ek),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),J=>(n.openBlock(),n.createElementBlock("button",{key:J,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":s.value===J}]),style:n.normalizeStyle({background:n.unref(Yn)(J)}),title:n.unref(Kn)(J),onClick:ee=>Q(J)},null,14,tk))),128))])])],64)):n.createCommentVNode("",!0)],8,D0)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-92e146f7"]]),pu={"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.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.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.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.copy":"Copy","em.export.download":"Download","em.export.copied":"Copied to clipboard.","em.export.copyFailed":"Failed to copy.","em.shortcuts.title":"Keyboard shortcuts","em.shortcuts.groupEdit":"Edit","em.shortcuts.groupMove":"Move · Arrange","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.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.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.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.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.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.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.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.descPlaceholderKo":"Description (ko)","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.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.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.emptyShortcutHint":"Press <kbd>?</kbd> for keyboard shortcuts","em.canvas.emptyReadonly":"No entities to show","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.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.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.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.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.name3":'Duplicate entity name: "{name}"',"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.jpa1":"JPA entity has no identifier (PK) attribute","em.check.jpa2":'An embeddable type 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.jpa6":"{which}: orphanRemoval overlaps with cascade {cascade}","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.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.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.unspecified":"unspecified"},hu={"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.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.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.common.close":"閉じる","em.common.save":"保存","em.export.title":"エクスポート","em.export.formatText":"論理モデルテキスト","em.export.formatMermaidEr":"Mermaid (ER)","em.export.formatMermaidClass":"Mermaid (クラス)","em.export.copy":"コピー","em.export.download":"ダウンロード","em.export.copied":"クリップボードにコピーしました。","em.export.copyFailed":"コピーに失敗しました。","em.shortcuts.title":"キーボードショートカット","em.shortcuts.groupEdit":"編集","em.shortcuts.groupMove":"移動・整列","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.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.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.cascadeAllNote":"ALL は個別の cascade をすべて含みます(CHK-JPA-5)。","em.assoc.orphanRemovalNote":"相手側がコレクション(@ManyToOne/@ManyToMany)のため orphanRemoval は無効です(CHK-JPA-14)。","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.headerColor":"ヘッダー色","em.attr.section":"属性 ({n})","em.attr.addEmbeddable":"埋め込み追加","em.attr.nameless":"(名前なし)","em.attr.selectHint":"上のリストから属性を選択すると編集フォームが表示されます。","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.overrideCollapse":"オーバーライドを折りたたむ","em.attr.overrideExpand":"オーバーライドを展開","em.attr.overrideLegend":"カラムオーバーライド","em.attr.empty":"属性なし — 「追加」で作成","em.op.body":"本文","em.op.bodyDirty":"本文 ●","em.op.descPlaceholderKo":"説明(ko)","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.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.canvas.emptyTitle":"空のダイアグラムです","em.canvas.emptyHint":"キャンバスを<strong>右クリック</strong>するか、左下の<strong>+</strong>ボタンで最初のエンティティを追加してください。","em.canvas.emptyShortcutHint":"ショートカットのヘルプは<kbd>?</kbd>キー","em.canvas.emptyReadonly":"表示するエンティティがありません","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.opsSummaryTitle":"オペレーション {n}件 — クラス表示モードで展開されます","em.node.opsSummary":"オペレーション {n}件","em.node.addAttr":"+ 属性","em.node.addDivider":"+ 区切り線","em.group.ddlExcludeBadge":"DDL 除外","em.explorer.groupFallback":"(グループ)","em.explorer.associations":"関連 ({n})","em.explorer.notes":"ノート ({n})","em.explorer.emptyNote":"(空のノート)","em.explorer.diagram":"ダイアグラム","em.explorer.searchPlaceholder":"エンティティ・属性検索 ( / )","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.check.catName":"名前","em.check.catJpa":"JPA","em.check.catType":"型","em.check.catDsn":"設計","em.check.name1":'属性名が重複しています: "{name}"',"em.check.name2":'カラム物理名が重複しています: "{name}"',"em.check.name3":'エンティティ名が重複しています: "{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.jpa1":"JPAエンティティに識別子(PK)属性がありません","em.check.jpa2":'組込み可能(embeddable)型は識別子属性を持てません: "{name}"',"em.check.jpa4":"識別関係の循環です(PKが自身に無限依存): {path}","em.check.jpa5":"{which}: cascade ALLが個別のcascadeと重複しています(ALLがすべて含む)","em.check.jpa6":"{which}: orphanRemovalがcascade {cascade}と意味が重なります","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.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.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.unspecified":"未指定"},yu={"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.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.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.common.close":"닫기","em.common.save":"저장","em.export.title":"내보내기","em.export.formatText":"논리 모델 텍스트","em.export.formatMermaidEr":"Mermaid (ER)","em.export.formatMermaidClass":"Mermaid (클래스)","em.export.copy":"복사","em.export.download":"다운로드","em.export.copied":"클립보드에 복사되었습니다.","em.export.copyFailed":"복사에 실패했습니다.","em.shortcuts.title":"키보드 단축키","em.shortcuts.groupEdit":"편집","em.shortcuts.groupMove":"이동 · 정렬","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.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.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.cascadeAllNote":"ALL이 개별 cascade를 모두 포함합니다 (CHK-JPA-5).","em.assoc.orphanRemovalNote":"반대편이 컬렉션(@ManyToOne/@ManyToMany)이라 orphanRemoval이 무효입니다 (CHK-JPA-14).","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.headerColor":"헤더 색상","em.attr.section":"속성 ({n})","em.attr.addEmbeddable":"임베더블 추가","em.attr.nameless":"(이름 없음)","em.attr.selectHint":"위 목록에서 속성을 선택하면 편집 폼이 표시됩니다.","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.overrideCollapse":"오버라이드 접기","em.attr.overrideExpand":"오버라이드 펼치기","em.attr.overrideLegend":"컬럼 오버라이드","em.attr.empty":"속성 없음 — '추가'로 생성","em.op.body":"본문","em.op.bodyDirty":"본문 ●","em.op.descPlaceholderKo":"설명(ko)","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.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.canvas.emptyTitle":"빈 다이어그램입니다","em.canvas.emptyHint":"캔버스를 <strong>우클릭</strong>하거나 좌하단 <strong>+</strong> 버튼으로 첫 엔티티를 추가하세요.","em.canvas.emptyShortcutHint":"단축키 도움말은 <kbd>?</kbd> 키","em.canvas.emptyReadonly":"표시할 엔티티가 없습니다","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.opsSummaryTitle":"오퍼레이션 {n}개 — 클래스 표시 모드에서 펼쳐 보입니다","em.node.opsSummary":"오퍼레이션 {n}개","em.node.addAttr":"+ 속성","em.node.addDivider":"+ 구분선","em.group.ddlExcludeBadge":"DDL 제외","em.explorer.groupFallback":"(그룹)","em.explorer.associations":"관계 ({n})","em.explorer.notes":"노트 ({n})","em.explorer.emptyNote":"(빈 노트)","em.explorer.diagram":"다이어그램","em.explorer.searchPlaceholder":"엔티티·속성 검색 ( / )","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.check.catName":"이름","em.check.catJpa":"JPA","em.check.catType":"타입","em.check.catDsn":"설계","em.check.name1":'속성 이름이 중복됩니다: "{name}"',"em.check.name2":'컬럼 물리명이 중복됩니다: "{name}"',"em.check.name3":'엔티티 이름이 중복됩니다: "{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.jpa1":"JPA 엔티티에 식별자(PK) 속성이 없습니다","em.check.jpa2":'임베더블 타입은 식별자 속성을 가질 수 없습니다: "{name}"',"em.check.jpa4":"식별 관계 사이클입니다 (PK 무한 의존): {path}","em.check.jpa5":"{which}: cascade ALL이 개별 cascade와 중복됩니다 (ALL이 모두 포함)","em.check.jpa6":"{which}: orphanRemoval이 cascade {cascade}와 의미가 겹칩니다","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.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.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.unspecified":"미지정"},nk=["ko","en","ja"],Hr={ko:yu,en:pu,ja:hu};function St(e,t,o){let a=(Hr[e]??Hr.ko)[t]??Hr.ko[t]??t;return o&&(a=a.replace(/\{(\w+)\}/g,(r,l)=>l in o?String(o[l]):r)),a}const gu=["ko","en","ja","zh"];function ok(e){if(e)for(const t of gu){const o=e[t];if(o)return o}}function Fr(e){const t=ok(e.label);return t?`${e.groupCode} (${t})`:e.groupCode}function ik(e,t){const o=t.trim().toLowerCase();return o?e.filter(i=>i.groupCode.toLowerCase().includes(o)?!0:gu.some(a=>{var r,l;return(l=(r=i.label)==null?void 0:r[a])==null?void 0:l.toLowerCase().includes(o)})):e}const ak=["aria-expanded","placeholder"],rk=["aria-selected","onClick","onMouseenter"],lk={key:0,class:"gcc__opt gcc__opt--empty"},bu=Pe(n.defineComponent({__name:"GroupCodeCombobox",props:{modelValue:{},items:{},locale:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,i=t,a=($,B)=>St(o.locale??"ko",$,B),r=n.ref(),l=n.ref(),s=n.ref(),c=n.ref(""),d=n.ref(!1),u=n.ref(-1),m=n.ref({}),p=n.computed(()=>o.items.find($=>$.groupCode===o.modelValue)),f=n.computed(()=>p.value?Fr(p.value):"");n.watch(f,$=>{d.value||(c.value=$)},{immediate:!0});const y=n.computed(()=>c.value===f.value?o.items:ik(o.items,c.value));function b(){var B;const $=(B=r.value)==null?void 0:B.getBoundingClientRect();$&&(m.value={left:`${$.left}px`,top:`${$.bottom}px`,width:`${$.width}px`})}function k(){d.value=!0,b(),u.value=Math.max(0,y.value.findIndex($=>$.groupCode===o.modelValue)),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),document.addEventListener("mousedown",D)}function g(){d.value=!1,window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b),document.removeEventListener("mousedown",D)}n.onBeforeUnmount(g);function w(){k(),n.nextTick(()=>{var $;return($=l.value)==null?void 0:$.select()})}function h(){d.value||k(),u.value=0}function E($){i("update:modelValue",$.groupCode),c.value=Fr($),g()}function X(){i("update:modelValue",void 0),c.value="",g()}function z(){c.value.trim()===""?X():(c.value=f.value,g())}function q($){var B;if($.key==="ArrowDown")d.value||k(),u.value=Math.min(u.value+1,y.value.length-1),$.preventDefault();else if($.key==="ArrowUp")u.value=Math.max(u.value-1,0),$.preventDefault();else if($.key==="Enter"){const Q=y.value[u.value];Q&&E(Q),$.preventDefault()}else $.key==="Escape"&&(c.value=f.value,g(),(B=l.value)==null||B.blur())}function D($){var Q,V;const B=$.target;!((Q=r.value)!=null&&Q.contains(B))&&!((V=s.value)!=null&&V.contains(B))&&z()}return($,B)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:r,class:"gcc"},[n.withDirectives(n.createElementVNode("input",{ref_key:"inputEl",ref:l,"onUpdate:modelValue":B[0]||(B[0]=Q=>c.value=Q),class:"gcc__input",type:"text",role:"combobox",autocomplete:"off","aria-expanded":d.value,placeholder:a("em.groupCode.searchPlaceholder"),onFocus:w,onInput:h,onKeydown:q},null,40,ak),[[n.vModelText,c.value]]),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[d.value?(n.openBlock(),n.createElementBlock("ul",{key:0,ref_key:"popup",ref:s,class:"gcc__popup",style:n.normalizeStyle(m.value),role:"listbox"},[n.createElementVNode("li",{class:"gcc__opt gcc__opt--none",onMousedown:B[1]||(B[1]=n.withModifiers(()=>{},["prevent"])),onClick:X},n.toDisplayString(a("em.common.noneParen")),33),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.value,(Q,V)=>(n.openBlock(),n.createElementBlock("li",{key:Q.groupCode,class:n.normalizeClass(["gcc__opt",{"is-active":V===u.value,"is-selected":Q.groupCode===e.modelValue}]),role:"option","aria-selected":Q.groupCode===e.modelValue,onMousedown:B[2]||(B[2]=n.withModifiers(()=>{},["prevent"])),onClick:re=>E(Q),onMouseenter:re=>u.value=V},n.toDisplayString(n.unref(Fr)(Q)),43,rk))),128)),y.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",lk,n.toDisplayString(a("em.groupCode.noMatch")),1))],4)):n.createCommentVNode("",!0)]))],512))}}),[["__scopeId","data-v-431f9333"]]),sk=["disabled"],ck={class:"em-aw__toolbar"},dk={class:"em-aw__count"},uk={class:"em-aw__scroll"},mk={class:"em-aw__table"},fk={class:"c-name"},pk={class:"c-type"},hk={class:"c-logical"},yk={class:"c-col"},gk={class:"c-constraints"},bk={class:"c-del"},_k={class:"c-expand"},kk=["title","onClick","onKeydown"],Ek={class:"c-constraints"},wk={class:"em-aw__cflags"},Nk=["title"],vk={colspan:"8"},xk={class:"em-aw__detail"},Ck={class:"em-aw__dgroup"},Ik={class:"em-aw__df"},Sk={class:"em-aw__df"},$k={class:"em-aw__df"},Rk={class:"em-aw__dgroup"},Ak={class:"em-aw__dgroup"},Tk={class:"em-aw__df"},Vk={key:0,class:"em-aw__df"},Mk={class:"em-aw__df"},Bk={class:"c-expand"},Dk={class:"em-aw__caret is-static","aria-hidden":"true"},Ok={class:"c-del"},Pk={class:"c-expand"},Lk=["title","onClick","onKeydown"],zk={class:"em-aw__embed-label"},Uk={class:"em-aw__ro"},Hk={class:"em-aw__ro"},Fk={class:"c-constraints"},Gk={class:"em-aw__ro"},jk={key:0,class:"em-aw__detail-row em-aw__embed-detail"},Kk={colspan:"8"},Yk={class:"em-aw__detail"},Wk={class:"em-aw__dgroup"},qk={key:0,class:"em-aw__df"},Xk={class:"em-aw__df"},Jk={class:"em-aw__df"},Zk={key:0},Qk={colspan:"99",class:"em-aw__empty"},eE=6,tE=5,oa="__OWN__",nE=Pe(n.defineComponent({__name:"EntityAttributesWide",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=n.computed(()=>o.state.logical.entities.find(S=>S.modelId===t.entityId)??null),a=n.computed(()=>{var S;return((S=i.value)==null?void 0:S.stereotype)==="JPA_EMBEDDABLE"}),r=n.computed(()=>new Set(o.selectedAttrIds.value)),l=n.computed(()=>{var S;return(((S=i.value)==null?void 0:S.attributes)??[]).filter(L=>L.attrType!=="DIVIDER").length}),s=n.ref(new Set);function c(S){return s.value.has(S)}function d(S){const L=new Set(s.value);L.has(S)?L.delete(S):L.add(S),s.value=L}const u=["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 m(S){return S==="none"?o.t("em.common.noneParen"):S}const p=S=>S;function f(S,L){i.value&&o.updateAttribute(i.value.modelId,S.modelId,L)}function y(S){return!!i.value&&!!ki(o.state.logical,i.value.modelId,S.modelId)}function b(S,L){f(S,{naturalId:L||void 0,naturalIdMutable:L?S.naturalIdMutable:void 0})}function k(){return{naturalId:void 0,naturalIdMutable:void 0}}function g(S,L){f(S,{identifier:L,...L?k():{}})}function w(S,L){f(S,{transient:L||void 0,...L?k():{}})}function h(S){return!!S.transient}const E=S=>S.value,X=S=>S.label;function z(S,L){if(!L)return;const P=re.value.find(j=>j.type===L);if(P){const j=S.dbAttrs[0]??{modelId:S.modelId+".c",physicalName:S.name,dataType:"VARCHAR"};f(S,{type:L,customType:void 0,dbAttrs:[{...j,dataType:P.dataType,length:P.length,scale:P.scale}]});return}f(S,L===kt?{type:L}:{type:L,customType:void 0})}function q(S,L){f(S,{customType:L.trim()===""?void 0:L})}function D(S,L){const j={...S.dbAttrs[0]??{modelId:S.modelId+".c",physicalName:S.name,dataType:"VARCHAR"},...L};L.dataType!==void 0&&!ao.has(j.dataType)&&(j.scale=void 0),f(S,{dbAttrs:[j]})}function $(S){var L;return ao.has(((L=S.dbAttrs[0])==null?void 0:L.dataType)??"")}function B(S,L,P){var j;D(S,{logicalName:{...(j=S.dbAttrs[0])==null?void 0:j.logicalName,[L]:P}})}function Q(S){return S.personalInfoAttributeType??"none"}function V(S,L){f(S,{personalInfoAttributeType:L==="none"?void 0:L})}const re=n.computed(()=>o.predefinedCustomTypeCatalog.value),_=n.computed(()=>o.embeddableCatalog.value);function W(S){var L,P;return((L=S.label)==null?void 0:L.ko)??((P=S.label)==null?void 0:P.en)??S.type}function R(S){!S||!i.value||o.addPredefinedEmbed(i.value.modelId,S)}const J=n.computed(()=>o.groupCodeCatalog.value);function ee(S){var L;return((L=J.value.find(P=>P.groupCode===S.groupCode))==null?void 0:L.codes)??[]}function ae(S){return["none",...ee(S)]}function I(S){return S==="none"?"none":S.code}function K(S){var P,j;if(S==="none")return o.t("em.common.noneParen");const L=((P=S.label)==null?void 0:P.ko)??((j=S.label)==null?void 0:j.en);return L?`${S.code} (${L})`:S.code}function oe(S,L){i.value&&o.setAttributeGroupCode(i.value.modelId,S.modelId,L)}function pe(S,L){f(S,{defaultValue:L==="none"?void 0:L})}function fe(S,L){f(S,{defaultValue:L.trim()===""?void 0:L})}function ce(S){return S.attrType.startsWith("EMBED")&&S.dbAttrs.length>0}function ue(S,L,P){const j=S.dbAttrs.map((Z,te)=>{if(te!==L)return Z;const v={...Z,...P};for(const A of Object.keys(P))P[A]===void 0&&delete v[A];return v});i.value&&o.setEmbedColumns(i.value.modelId,S.modelId,j)}function he(S,L,P,j){var Z;ue(S,L,{logicalName:{...(Z=S.dbAttrs[L])==null?void 0:Z.logicalName,[P]:j}})}function we(S,L){var Z,te,v;if(S.attrType==="EMBED_PREDEF"){const A=(Z=o.embeddableCatalog.value.find(Y=>Y.type===S.type))==null?void 0:Z.fields[L];return A?{name:A.name,physicalName:A.physicalName,dataType:A.dataType,length:A.length,shareable:A.shareable,logicalName:A.logicalName}:void 0}const P=(te=S.embedded)==null?void 0:te.embeddableRef;if(!P)return;const j=(v=o.state.logical.entities.find(A=>A.modelId===P))==null?void 0:v.attributes.flatMap(A=>A.dbAttrs)[L];return j?{physicalName:j.physicalName,dataType:j.dataType,length:j.length,scale:j.scale,logicalName:j.logicalName}:void 0}function Se(S,L){var P,j;return((P=we(S,L))==null?void 0:P.dataType)||((j=S.dbAttrs[L])==null?void 0:j.dataType)||""}function Ie(S,L){var P,j;return((P=we(S,L))==null?void 0:P.length)??((j=S.dbAttrs[L])==null?void 0:j.length)}function me(S,L){var P,j;return((P=we(S,L))==null?void 0:P.scale)??((j=S.dbAttrs[L])==null?void 0:j.scale)}const ge=["inherit","true","false"];function ke(S){return S==="inherit"?o.t("em.common.inherit"):S}function G(S){return(S==null?void 0:S.updatable)===void 0?"inherit":S.updatable?"true":"false"}function H(S,L,P){ue(S,L,{updatable:P==="inherit"?void 0:P==="true"})}function C(S,L){D(S,{updatable:L==="inherit"?void 0:L==="true"})}const M=["inherit","true","false"];function T(S){return S==="inherit"?o.t("em.common.inherit"):S}function ne(S){return(S==null?void 0:S.insertable)===void 0?"inherit":S.insertable?"true":"false"}function de(S,L,P){ue(S,L,{insertable:P==="inherit"?void 0:P==="true"})}function Ee(S,L){D(S,{insertable:L==="inherit"?void 0:L==="true"})}const ye=n.computed(()=>i.value?ii(i.value,o.state.logical.entities):[]),ve=n.computed(()=>tn(ye.value.flatMap(S=>S.attributes.flatMap(L=>L.dbAttrs)))),Te=n.computed(()=>ye.value.flatMap(S=>S.attributes.filter(L=>L.attrType==="NORMAL"&&L.dbAttrs.length===1&&L.dbAttrs[0]).map(L=>{var P;return{modelId:L.dbAttrs[0].modelId,physical:L.dbAttrs[0].physicalName||L.name,isCurrency:L.type==="Currency",ownerName:S.modelId===((P=i.value)==null?void 0:P.modelId)?void 0:S.name}})));function Ve(){const S=[...Te.value].sort((L,P)=>Number(P.isCurrency)-Number(L.isCurrency));return[oa,...S.map(L=>L.modelId)]}function Le(S){if(S===oa)return o.t("em.attr.sharedOwn");const L=Te.value.find(j=>j.modelId===S);if(!L)return S;const P=L.ownerName?`${L.ownerName}.`:"";return o.t("em.attr.sharedRef",{owner:P,physical:L.physical,mode:L.isCurrency?o.t("em.attr.currencyMode"):o.t("em.attr.sharedMode")})}function je(S){return(S==null?void 0:S.sharedColumnRef)??oa}function lt(S,L,P){ue(S,L,{sharedColumnRef:P===oa?void 0:P})}function x(S){return(S==null?void 0:S.sharedColumnRef)!=null}function F(S){var L;return((L=$n(S,ve.value))==null?void 0:L.physicalName)??""}return(S,L)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-aw",disabled:!n.unref(o).editable.value},[n.createElementVNode("div",ck,[n.createElementVNode("span",dk,n.toDisplayString(n.unref(o).t("em.attr.section",{n:l.value})),1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t("em.common.add"),onClick:L[0]||(L[0]=P=>n.unref(o).addAttribute(i.value.modelId))},null,8,["caption"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t("em.attr.addDivider"),onClick:L[1]||(L[1]=P=>n.unref(o).addDivider(i.value.modelId))},null,8,["caption"]),_.value.length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"140px",placeholder:n.unref(o).t("em.attr.addEmbeddable"),"model-value":void 0,items:_.value,"value-provider":P=>P.type,"label-provider":W,"onUpdate:modelValue":R},null,8,["placeholder","items","value-provider"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",uk,[n.createElementVNode("table",mk,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[L[2]||(L[2]=n.createElementVNode("th",{class:"c-expand"},null,-1)),n.createElementVNode("th",fk,n.toDisplayString(n.unref(o).t("em.attr.namePlaceholder")),1),n.createElementVNode("th",pk,n.toDisplayString(n.unref(o).t("em.attr.typePlaceholder")),1),n.createElementVNode("th",hk,n.toDisplayString(n.unref(o).t("em.attr.logicalPlaceholder")),1),n.createElementVNode("th",yk,n.toDisplayString(n.unref(o).t("em.attr.columnPhysical")),1),L[3]||(L[3]=n.createElementVNode("th",{class:"c-dtype"},"dataType",-1)),L[4]||(L[4]=n.createElementVNode("th",{class:"c-len"},"len",-1)),n.createElementVNode("th",gk,n.toDisplayString(n.unref(o).t("em.attr.constraints")),1),L[5]||(L[5]=n.createElementVNode("th",{class:"c-del"},null,-1))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value.attributes,P=>{var j,Z,te,v,A,Y,N,U,O,le,Ne;return n.openBlock(),n.createElementBlock(n.Fragment,{key:P.modelId},[P.attrType==="DIVIDER"?(n.openBlock(),n.createElementBlock("tr",{key:0,class:n.normalizeClass(["em-aw__divider-row",{"is-focused":r.value.has(P.modelId)}])},[L[6]||(L[6]=n.createElementVNode("td",{class:"c-expand"},null,-1)),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-divlabel-${P.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.dividerLabelPlaceholder"),"model-value":P.name,"onUpdate:modelValue":se=>f(P,{name:se})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",{colspan:eE,class:"em-aw__divider-note"},n.toDisplayString(n.unref(o).t("em.attr.dividerNote")),1),n.createElementVNode("td",bk,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:se=>n.unref(o).removeAttribute(i.value.modelId,P.modelId)},null,8,["onClick"])])],2)):ce(P)?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("tr",{class:n.normalizeClass(["em-aw__embed-parent",{"is-focused":r.value.has(P.modelId)}])},[n.createElementVNode("td",Bk,[n.createElementVNode("span",Dk,[n.createVNode($e,{name:"chevron",size:14,class:"em-aw__caret-ic"})])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-name-${P.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.namePlaceholder"),"model-value":P.name,"onUpdate:modelValue":se=>f(P,{name:se})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-type-${P.modelId}`,width:"100%",disabled:"","model-value":P.type},null,8,["name","model-value"])]),n.createElementVNode("td",{colspan:tE,class:"em-aw__embed-note"},n.toDisplayString(n.unref(o).t("em.attr.embedChildCols",{n:P.dbAttrs.length})),1),n.createElementVNode("td",Ok,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:se=>n.unref(o).removeAttribute(i.value.modelId,P.modelId)},null,8,["onClick"])])],2),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(P.dbAttrs,(se,Re)=>{var De,Ue,Qe,Ke,Ye,At,Qt;return n.openBlock(),n.createElementBlock(n.Fragment,{key:se.modelId},[n.createElementVNode("tr",{class:n.normalizeClass(["em-aw__embed-col",{"em-aw__open":c(se.modelId)}])},[n.createElementVNode("td",Pk,[n.createElementVNode("span",{class:n.normalizeClass(["em-aw__caret",{"is-open":c(se.modelId)}]),role:"button",tabindex:"0",title:n.unref(o).t(c(se.modelId)?"em.attr.overrideCollapse":"em.attr.overrideExpand"),onClick:be=>d(se.modelId),onKeydown:[n.withKeys(n.withModifiers(be=>d(se.modelId),["prevent"]),["enter"]),n.withKeys(n.withModifiers(be=>d(se.modelId),["prevent"]),["space"])]},[n.createVNode($e,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,Lk)]),n.createElementVNode("td",zk,"↳ "+n.toDisplayString(((De=we(P,Re))==null?void 0:De.name)??((Ue=we(P,Re))==null?void 0:Ue.physicalName)??n.unref(o).t("em.attr.colFallback",{n:Re+1})),1),L[13]||(L[13]=n.createElementVNode("td",null,null,-1)),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-embed-logical-${se.modelId}`,width:"100%",placeholder:((Ke=(Qe=we(P,Re))==null?void 0:Qe.logicalName)==null?void 0:Ke.ko)??n.unref(o).t("em.attr.logicalPlaceholder"),"model-value":((Ye=se.logicalName)==null?void 0:Ye.ko)??"","onUpdate:modelValue":be=>he(P,Re,"ko",be)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-embed-col-${se.modelId}`,width:"100%",disabled:x(se),placeholder:((At=we(P,Re))==null?void 0:At.physicalName)??n.unref(o).t("em.attr.columnPlaceholder"),"model-value":x(se)?F(se):se.physicalName,"onUpdate:modelValue":be=>ue(P,Re,{physicalName:be})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(_n,{controller:n.unref(o),"ref-id":se.modelId},null,8,["controller","ref-id"])]),n.createElementVNode("td",null,[n.createElementVNode("span",Uk,n.toDisplayString(Se(P,Re)),1)]),n.createElementVNode("td",null,[n.createElementVNode("span",Hk,n.toDisplayString(Ie(P,Re)??""),1)]),n.createElementVNode("td",Fk,[n.createElementVNode("span",Gk,n.toDisplayString(me(P,Re)!=null?`scale ${me(P,Re)}`:""),1)]),L[14]||(L[14]=n.createElementVNode("td",null,null,-1))],2),c(se.modelId)?(n.openBlock(),n.createElementBlock("tr",jk,[L[17]||(L[17]=n.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),n.createElementVNode("td",Kk,[n.createElementVNode("div",Yk,[n.createElementVNode("fieldset",Wk,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(o).t("em.attr.overrideLegend")),1),(Qt=we(P,Re))!=null&&Qt.shareable?(n.openBlock(),n.createElementBlock("label",qk,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.currencyColumn")),1),n.createVNode(n.unref(ie.BSSelect),{width:"150px","model-value":je(se),items:Ve(),"value-provider":p,"label-provider":Le,"onUpdate:modelValue":be=>be&<(P,Re,be)},null,8,["model-value","items","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",Xk,[L[15]||(L[15]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px",disabled:x(se),"model-value":x(se)?"false":ne(se),items:M,"value-provider":p,"label-provider":T,"onUpdate:modelValue":be=>be&&de(P,Re,be)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",Jk,[L[16]||(L[16]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px",disabled:x(se),"model-value":x(se)?"false":G(se),items:ge,"value-provider":p,"label-provider":ke,"onUpdate:modelValue":be=>be&&H(P,Re,be)},null,8,["disabled","model-value","onUpdate:modelValue"])])])])])])):n.createCommentVNode("",!0)],64)}),128))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("tr",{class:n.normalizeClass({"is-focused":r.value.has(P.modelId),"em-aw__open":c(P.modelId)})},[n.createElementVNode("td",_k,[n.createElementVNode("span",{class:n.normalizeClass(["em-aw__caret",{"is-open":c(P.modelId)}]),role:"button",tabindex:"0",title:n.unref(o).t(c(P.modelId)?"em.attr.detailCollapse":"em.attr.detailExpand"),onClick:se=>d(P.modelId),onKeydown:[n.withKeys(n.withModifiers(se=>d(P.modelId),["prevent"]),["enter"]),n.withKeys(n.withModifiers(se=>d(P.modelId),["prevent"]),["space"])]},[n.createVNode($e,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,kk)]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-name-${P.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.namePlaceholder"),"model-value":P.name,"onUpdate:modelValue":se=>f(P,{name:se})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{name:`aw-type-${P.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.typePlaceholder"),disabled:!!P.groupCode,items:n.unref(Bl)(P.type,re.value),"value-provider":E,"label-provider":X,"model-value":P.type,"onUpdate:modelValue":se=>z(P,se)},null,8,["name","placeholder","disabled","items","model-value","onUpdate:modelValue"]),P.type===n.unref(kt)?(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:0,name:`aw-customtype-${P.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.customTypePlaceholder"),"model-value":P.customType??"","onUpdate:modelValue":se=>q(P,se)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])):n.createCommentVNode("",!0)]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-logical-${P.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.logicalPlaceholder"),"model-value":((Z=(j=P.dbAttrs[0])==null?void 0:j.logicalName)==null?void 0:Z.ko)??"","onUpdate:modelValue":se=>B(P,"ko",se)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-col-${P.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.columnPlaceholder"),disabled:h(P),"model-value":((te=P.dbAttrs[0])==null?void 0:te.physicalName)??"","onUpdate:modelValue":se=>D(P,{physicalName:se})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),n.createVNode(_n,{controller:n.unref(o),"ref-id":(v=P.dbAttrs[0])==null?void 0:v.modelId},null,8,["controller","ref-id"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{name:`aw-dtype-${P.modelId}`,width:"100%",placeholder:"dataType",disabled:h(P),items:n.unref(Vl)(((A=P.dbAttrs[0])==null?void 0:A.dataType)??"",n.unref(o).selectableDataTypes.value),"value-provider":p,"label-provider":n.unref(La),"model-value":((Y=P.dbAttrs[0])==null?void 0:Y.dataType)??"","onUpdate:modelValue":se=>se&&D(P,{dataType:se})},null,8,["name","disabled","items","label-provider","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSNumberInput),{name:`aw-len-${P.modelId}`,width:"100%",placeholder:"len",disabled:h(P),"model-value":(N=P.dbAttrs[0])==null?void 0:N.length,"onUpdate:modelValue":se=>D(P,{length:se||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",Ek,[n.createElementVNode("div",wk,[n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-pk-${P.modelId}`,label:"PK","model-value":P.identifier,disabled:a.value||h(P),"onUpdate:modelValue":se=>g(P,se)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-nn-${P.modelId}`,label:"NN","model-value":P.notNull,disabled:h(P),"onUpdate:modelValue":se=>f(P,{notNull:se})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-uq-${P.modelId}`,label:"UQ","model-value":!!((U=P.dbAttrs[0])!=null&&U.unique),disabled:h(P),"onUpdate:modelValue":se=>D(P,{unique:se})},null,8,["name","model-value","disabled","onUpdate:modelValue"])])]),n.createElementVNode("td",{class:"c-del",title:y(P)?n.unref(o).t("em.attr.fkDeleteHint"):void 0},[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:se=>n.unref(o).removeAttribute(i.value.modelId,P.modelId)},null,8,["onClick"])],8,Nk)],2),c(P.modelId)?(n.openBlock(),n.createElementBlock("tr",{key:0,class:n.normalizeClass(["em-aw__detail-row",{"is-focused":r.value.has(P.modelId)}])},[L[12]||(L[12]=n.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),n.createElementVNode("td",vk,[n.createElementVNode("div",xk,[n.createElementVNode("fieldset",Ck,[L[10]||(L[10]=n.createElementVNode("legend",null,"DB",-1)),n.createElementVNode("label",Ik,[L[7]||(L[7]=n.createElementVNode("span",null,"scale",-1)),n.createVNode(n.unref(ie.BSNumberInput),{name:`aw-scale-${P.modelId}`,width:"72px",placeholder:"scale",disabled:h(P)||!$(P),"model-value":(O=P.dbAttrs[0])==null?void 0:O.scale,"onUpdate:modelValue":se=>D(P,{scale:se||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-ai-${P.modelId}`,label:"Auto Increment","model-value":!!((le=P.dbAttrs[0])!=null&&le.autoIncrement),disabled:h(P)||!P.identifier,"onUpdate:modelValue":se=>D(P,{autoIncrement:se})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createElementVNode("label",Sk,[L[8]||(L[8]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ie.BSSelect),{name:`aw-ins-${P.modelId}`,width:"110px",disabled:h(P),"model-value":ne(P.dbAttrs[0]),items:M,"value-provider":p,"label-provider":T,"onUpdate:modelValue":se=>se&&Ee(P,se)},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",$k,[L[9]||(L[9]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ie.BSSelect),{name:`aw-upd-${P.modelId}`,width:"110px",disabled:h(P),"model-value":G(P.dbAttrs[0]),items:ge,"value-provider":p,"label-provider":ke,"onUpdate:modelValue":se=>se&&C(P,se)},null,8,["name","disabled","model-value","onUpdate:modelValue"])])]),n.createElementVNode("fieldset",Rk,[L[11]||(L[11]=n.createElementVNode("legend",null,"JPA",-1)),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-tr-${P.modelId}`,label:"@Transient","model-value":!!P.transient,disabled:P.identifier,"onUpdate:modelValue":se=>w(P,se)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-nid-${P.modelId}`,label:"@NaturalId","model-value":!!P.naturalId,disabled:P.identifier||h(P),"onUpdate:modelValue":se=>b(P,se)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{class:"em-aw__dsub",name:`aw-nidm-${P.modelId}`,label:"mutable","model-value":!!P.naturalIdMutable,disabled:h(P)||!P.naturalId,"onUpdate:modelValue":se=>f(P,{naturalIdMutable:se||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-mv-${P.modelId}`,label:"Multi-Value (Set)","model-value":!!((Ne=P.dbAttrs[0])!=null&&Ne.multiValue),disabled:h(P),"onUpdate:modelValue":se=>D(P,{multiValue:se||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("fieldset",Ak,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(o).t("em.attr.semanticLegend")),1),n.createElementVNode("label",Tk,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.pii")),1),n.createVNode(n.unref(ie.BSSelect),{width:"150px","model-value":Q(P),items:u,"value-provider":p,"label-provider":m,"onUpdate:modelValue":se=>se&&V(P,se)},null,8,["model-value","onUpdate:modelValue"])]),J.value.length?(n.openBlock(),n.createElementBlock("label",Vk,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.codeGroup")),1),n.createVNode(bu,{"model-value":P.groupCode,items:J.value,locale:n.unref(o).uiLocale.value,"onUpdate:modelValue":se=>oe(P,se)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",Mk,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.defaultValue")),1),ee(P).length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"150px","model-value":P.defaultValue??"none",items:ae(P),"value-provider":I,"label-provider":K,"onUpdate:modelValue":se=>se&&pe(P,se)},null,8,["model-value","items","onUpdate:modelValue"])):(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:1,name:`aw-default-${P.modelId}`,width:"150px",placeholder:n.unref(o).t("em.attr.defaultValue"),"model-value":P.defaultValue??"","onUpdate:modelValue":se=>fe(P,se)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))])])])])],2)):n.createCommentVNode("",!0)],64))],64)}),128)),i.value.attributes.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("tr",Zk,[n.createElementVNode("td",Qk,n.toDisplayString(n.unref(o).t("em.attr.empty")),1)]))])])])],8,sk)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-891b5a4b"]]),oE=["disabled"],iE={class:"em-idxw__list"},aE={class:"em-idxw__list-head"},rE=["onClick"],lE={class:"em-idxw__item-name"},sE={key:0,class:"em-idxw__badge"},cE={class:"em-idxw__item-cnt"},dE={key:0,class:"em-idxw__empty"},uE={key:0,class:"em-idxw__edit"},mE={class:"em-idxw__form"},fE={class:"em-field em-idxw__name"},pE={class:"em-field"},hE=["value","placeholder"],yE={class:"em-idxw__transfer"},gE={class:"em-idxw__pane"},bE={class:"em-idxw__pane-head"},_E={class:"em-idxw__cols"},kE=["onClick"],EE=["title"],wE={key:0,class:"em-idxw__empty"},NE={class:"em-idxw__arrows"},vE={class:"em-idxw__pane"},xE={class:"em-idxw__pane-head"},CE={class:"em-idxw__cols"},IE={class:"em-idxw__col-name"},SE=["title"],$E={class:"em-idxw__col-ops"},RE=["title","disabled","onClick"],AE=["title","disabled","onClick"],TE=["title","onClick"],VE={key:0,class:"em-idxw__empty"},ME={key:1,class:"em-idxw__edit em-idxw__edit--empty"},BE=Pe(n.defineComponent({__name:"EntityIndexesWide",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=n.computed(()=>o.state.logical.entities.find($=>$.modelId===t.entityId)??null),a=n.computed(()=>{var $;return(($=i.value)==null?void 0:$.indexes)??[]}),r=n.computed(()=>{var $;return(($=i.value)==null?void 0:$.attributes)??[]}),l=n.ref(null);n.watch(a,$=>{var B;$.some(Q=>Q.modelId===l.value)||(l.value=((B=$[0])==null?void 0:B.modelId)??null)},{immediate:!0});const s=n.computed(()=>a.value.find($=>$.modelId===l.value)??null),c=n.computed(()=>i.value?oo(i.value,o.superClassCatalog.value):[]),d=n.computed(()=>{var $;return new Set((($=s.value)==null?void 0:$.columns.map(B=>B.columnRef))??[])}),u=n.computed(()=>[...r.value.filter($=>!d.value.has($.modelId)).map($=>({ref:$.modelId,label:p($),inherited:!1})),...c.value.filter($=>!d.value.has($.modelId)).map($=>({ref:$.modelId,label:f($),inherited:!0}))]),m=n.ref(new Set);n.watch(l,()=>m.value=new Set);function p($){var Q;const B=(Q=$.dbAttrs[0])==null?void 0:Q.physicalName;return B&&B!==$.name?`${$.name} (${B})`:$.name}function f($){return $.physicalName&&$.physicalName!==$.field?`${$.field} (${$.physicalName})`:$.field}function y($){const B=r.value.find(V=>V.modelId===$);if(B)return p(B);const Q=c.value.find(V=>V.modelId===$);return Q?f(Q):$}function b($){return no($)}function k($,B){i.value&&o.updateIndex(i.value.modelId,$,B)}function g(){var B;if(!i.value)return;const $=Be();o.addIndex(i.value.modelId,{modelId:$,name:`idx_${(((B=i.value.indexes)==null?void 0:B.length)??0)+1}`,unique:!1,columns:[]}),l.value=$}function w($){i.value&&o.removeIndex(i.value.modelId,$)}function h($){s.value&&k(s.value.modelId,{parameters:$.trim()===""?void 0:$})}function E($){const B=new Set(m.value);B.has($)?B.delete($):B.add($),m.value=B}function X(){const $=s.value;if(!$||!m.value.size)return;const B=[...m.value].map(Q=>({columnRef:Q,descending:!1}));k($.modelId,{columns:[...$.columns,...B]}),m.value=new Set}function z($){const B=s.value;B&&k(B.modelId,{columns:B.columns.filter((Q,V)=>V!==$)})}function q($,B){const Q=s.value;Q&&k(Q.modelId,{columns:Q.columns.map((V,re)=>re===$?{...V,descending:B}:V)})}function D($,B){const Q=s.value;if(!Q)return;const V=$+B;if(V<0||V>=Q.columns.length)return;const re=[...Q.columns];[re[$],re[V]]=[re[V],re[$]],k(Q.modelId,{columns:re})}return($,B)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-idxw",disabled:!n.unref(o).editable.value},[n.createElementVNode("aside",iE,[n.createElementVNode("div",aE,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.index.section",{n:a.value.length})),1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t("em.common.add"),onClick:g},null,8,["caption"])]),n.createElementVNode("ul",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,Q=>(n.openBlock(),n.createElementBlock("li",{key:Q.modelId,class:n.normalizeClass(["em-idxw__item",{"is-active":Q.modelId===l.value}]),onClick:V=>l.value=Q.modelId},[n.createElementVNode("span",lE,n.toDisplayString(Q.name||n.unref(o).t("em.attr.nameless")),1),Q.unique?(n.openBlock(),n.createElementBlock("span",sE,"UQ")):n.createCommentVNode("",!0),n.createElementVNode("span",cE,n.toDisplayString(Q.columns.length),1)],10,rE))),128)),a.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",dE,n.toDisplayString(n.unref(o).t("em.index.empty")),1))])]),s.value?(n.openBlock(),n.createElementBlock("section",uE,[n.createElementVNode("div",mE,[n.createElementVNode("label",fE,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.index.namePlaceholder")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"idxw-name",width:"100%","model-value":s.value.name,"onUpdate:modelValue":B[0]||(B[0]=Q=>k(s.value.modelId,{name:Q}))},null,8,["model-value"]),n.createVNode(_n,{controller:n.unref(o),"ref-id":s.value.modelId},null,8,["controller","ref-id"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"idxw-uq",class:"em-check em-idxw__uq",label:"unique","model-value":s.value.unique,"onUpdate:modelValue":B[1]||(B[1]=Q=>k(s.value.modelId,{unique:Q}))},null,8,["model-value"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn em-idxw__del",caption:n.unref(o).t("em.index.delete"),onClick:B[2]||(B[2]=Q=>w(s.value.modelId))},null,8,["caption"])]),n.createElementVNode("label",pE,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.index.condition")),1),n.createElementVNode("textarea",{class:"em-textarea",value:s.value.parameters??"",rows:"2",placeholder:n.unref(o).t("em.index.conditionPlaceholderWide"),onChange:B[3]||(B[3]=Q=>h(Q.target.value))},null,40,hE)]),n.createElementVNode("div",yE,[n.createElementVNode("div",gE,[n.createElementVNode("div",bE,n.toDisplayString(n.unref(o).t("em.index.availColumns",{n:u.value.length})),1),n.createElementVNode("ul",_E,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.value,Q=>(n.openBlock(),n.createElementBlock("li",{key:Q.ref,class:n.normalizeClass(["em-idxw__col",{"is-sel":m.value.has(Q.ref)}]),onClick:V=>E(Q.ref)},[n.createTextVNode(n.toDisplayString(Q.label),1),Q.inherited?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-idxw__inh",title:n.unref(o).t("em.index.inheritedColTitle")},n.toDisplayString(n.unref(o).t("em.index.inheritedBadge")),9,EE)):n.createCommentVNode("",!0)],10,kE))),128)),u.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",wE,n.toDisplayString(n.unref(o).t("em.index.allColumnsUsed")),1))])]),n.createElementVNode("div",NE,[n.createVNode(n.unref(ie.BSButton),{caption:n.unref(o).t("em.index.addArrow"),disabled:!m.value.size,onClick:X},null,8,["caption","disabled"])]),n.createElementVNode("div",vE,[n.createElementVNode("div",xE,n.toDisplayString(n.unref(o).t("em.index.indexColumns",{n:s.value.columns.length})),1),n.createElementVNode("ul",CE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value.columns,(Q,V)=>(n.openBlock(),n.createElementBlock("li",{key:V,class:"em-idxw__col em-idxw__col--idx"},[n.createElementVNode("span",IE,[n.createTextVNode(n.toDisplayString(y(Q.columnRef)),1),b(Q.columnRef)?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-idxw__inh",title:n.unref(o).t("em.index.inheritedColTitle")},n.toDisplayString(n.unref(o).t("em.index.inheritedBadge")),9,SE)):n.createCommentVNode("",!0)]),n.createVNode(n.unref(ie.BSCheckbox),{name:`idxw-desc-${V}`,class:"em-check",label:"DESC","model-value":Q.descending,"onUpdate:modelValue":re=>q(V,re)},null,8,["name","model-value","onUpdate:modelValue"]),n.createElementVNode("span",$E,[n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn",title:n.unref(o).t("em.index.moveUp"),disabled:V===0,onClick:re=>D(V,-1)},"↑",8,RE),n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn",title:n.unref(o).t("em.index.moveDown"),disabled:V===s.value.columns.length-1,onClick:re=>D(V,1)},"↓",8,AE),n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn em-idxw__opbtn--del",title:n.unref(o).t("em.index.removeColumn"),onClick:re=>z(V)},"✕",8,TE)])]))),128)),s.value.columns.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",VE,n.toDisplayString(n.unref(o).t("em.index.noColumns")),1))])])])])):(n.openBlock(),n.createElementBlock("section",ME,n.toDisplayString(n.unref(o).t("em.index.selectPrompt")),1))],8,oE)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-76de4c26"]]),DE={class:"em-op-src"},OE=["placeholder"],PE={class:"em-op-src__actions"},_u=Pe(n.defineComponent({__name:"OperationSourceEditor",props:{operationName:{},sourceCode:{},onSave:{type:Function},locale:{}},setup(e){const t=e,o=ie.useModalHandle(),i=(l,s)=>St(t.locale??"ko",l,s),a=n.ref(t.sourceCode);function r(){t.onSave(a.value),o.close()}return(l,s)=>(n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:i("em.opSource.title",{name:t.operationName})},{default:n.withCtx(()=>[n.createElementVNode("div",DE,[n.withDirectives(n.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,OE),[[n.vModelText,a.value]]),n.createElementVNode("div",PE,[n.createVNode(n.unref(ie.BSButton),{caption:i("em.common.save"),onClick:r},null,8,["caption"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:i("em.common.close"),onClick:s[1]||(s[1]=c=>n.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-34c9b822"]]),LE=["disabled"],zE={class:"em-ow__toolbar"},UE={class:"em-ow__count"},HE={class:"em-ow__scroll"},FE={class:"em-ow__table"},GE={class:"c-name"},jE={class:"c-desc"},KE={class:"c-pii"},YE={class:"c-src"},WE={class:"c-del"},qE={key:0},XE={colspan:"6",class:"em-ow__empty"},JE=Pe(n.defineComponent({__name:"EntityOperationsWide",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=ie.useModal(),a=n.computed(()=>o.state.logical.entities.find(y=>y.modelId===t.entityId)??null),r=["PUBLIC","PROTECTED","PACKAGE","PRIVATE"],l=["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 s(y){return y==="none"?o.t("em.common.noneParen"):y}const c=y=>y;function d(y,b){a.value&&o.updateOperation(a.value.modelId,y.modelId,b)}function u(y,b,k){d(y,{description:{...y.description,[b]:k}})}function m(y){return y.personalInfoAttributeType??"none"}function p(y,b){d(y,{personalInfoAttributeType:b==="none"?void 0:b})}function f(y){i.openModal({component:_u,bind:{operationName:y.name,sourceCode:y.sourceCode??"",locale:o.uiLocale.value,onSave:b=>d(y,{sourceCode:b})}})}return(y,b)=>{var k,g;return a.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-ow",disabled:!n.unref(o).editable.value},[n.createElementVNode("div",zE,[n.createElementVNode("span",UE,n.toDisplayString(n.unref(o).t("em.op.section",{n:((k=a.value.operations)==null?void 0:k.length)??0})),1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t("em.common.add"),onClick:b[0]||(b[0]=w=>n.unref(o).addOperation(a.value.modelId))},null,8,["caption"])]),n.createElementVNode("div",HE,[n.createElementVNode("table",FE,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[n.createElementVNode("th",GE,n.toDisplayString(n.unref(o).t("em.attr.namePlaceholder")),1),b[1]||(b[1]=n.createElementVNode("th",{class:"c-vis"},"visibility",-1)),n.createElementVNode("th",jE,n.toDisplayString(n.unref(o).t("em.common.description")),1),n.createElementVNode("th",KE,n.toDisplayString(n.unref(o).t("em.attr.pii")),1),n.createElementVNode("th",YE,n.toDisplayString(n.unref(o).t("em.op.body")),1),b[2]||(b[2]=n.createElementVNode("th",{class:"c-del"},null,-1))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value.operations??[],w=>{var h;return n.openBlock(),n.createElementBlock("tr",{key:w.modelId},[n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`ow-name-${w.modelId}`,width:"100%",placeholder:n.unref(o).t("em.op.namePlaceholder"),"model-value":w.name,"onUpdate:modelValue":E=>d(w,{name:E})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":w.visibility??"PACKAGE",items:r,"value-provider":c,"label-provider":c,"onUpdate:modelValue":E=>E&&d(w,{visibility:E})},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`ow-desc-${w.modelId}`,width:"100%",placeholder:n.unref(o).t("em.op.descPlaceholderKo"),"model-value":((h=w.description)==null?void 0:h.ko)??"","onUpdate:modelValue":E=>u(w,"ko",E)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":m(w),items:l,"value-provider":c,"label-provider":s,"onUpdate:modelValue":E=>E&&p(w,E)},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t(w.sourceCode?"em.op.bodyDirty":"em.op.body"),onClick:E=>f(w)},null,8,["caption","onClick"])]),n.createElementVNode("td",WE,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:E=>n.unref(o).removeOperation(a.value.modelId,w.modelId)},null,8,["onClick"])])])}),128)),(g=a.value.operations)!=null&&g.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("tr",qE,[n.createElementVNode("td",XE,n.toDisplayString(n.unref(o).t("em.op.empty")),1)]))])])])],8,LE)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-1c255914"]]),ZE={class:"em-detail__tabs"},QE=["onClick"],ew={key:0,class:"em-detail__narrow"},tw=Pe(n.defineComponent({__name:"EntityDetailModal",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=ie.useModalHandle(),a=n.computed(()=>o.state.logical.entities.find(s=>s.modelId===t.entityId)??null);n.watch(a,s=>{s||i.close()});const r=[{key:"basics",labelKey:"em.detail.tabBasics"},{key:"columns",labelKey:"em.detail.tabColumns"},{key:"indexes",labelKey:"em.detail.tabIndexes"},{key:"operations",labelKey:"em.detail.tabOperations"}],l=n.ref("basics");return(s,c)=>{var d;return n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:n.unref(o).t("em.detail.title",{name:((d=a.value)==null?void 0:d.name)??""})},{default:n.withCtx(()=>[a.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["em-detail",{"is-maximized":n.unref(i).maximized}])},[n.createElementVNode("nav",ZE,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(r,u=>n.createElementVNode("button",{key:u.key,type:"button",class:n.normalizeClass(["em-detail__tab",{"is-active":l.value===u.key}]),onClick:m=>l.value=u.key},n.toDisplayString(n.unref(o).t(u.labelKey)),11,QE)),64))]),n.createElementVNode("div",{class:n.normalizeClass(["em-detail__body",{"is-readonly":!n.unref(o).editable.value}])},[l.value==="basics"?(n.openBlock(),n.createElementBlock("div",ew,[n.createVNode(fu,{controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])])):l.value==="columns"?(n.openBlock(),n.createBlock(nE,{key:1,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])):l.value==="indexes"?(n.openBlock(),n.createBlock(BE,{key:2,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])):(n.openBlock(),n.createBlock(JE,{key:3,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"]))],2)],2)):n.createCommentVNode("",!0)]),_:1},8,["title"])}}}),[["__scopeId","data-v-785c4770"]]);function ia(e,t,o){e.openModal({component:tw,bind:{controller:n.markRaw(t),entityId:o}})}const ku="외래키는 연관관계에서 파생됩니다. 삭제하려면 연관관계선을 선택해 삭제하세요.";function nw(e){var i;const t=JSON.parse(JSON.stringify(e));t.modelId=Be(),t.name=`${e.name}_copy`,(i=t.table)!=null&&i.physicalName&&(t.table.physicalName=`${t.table.physicalName}_copy`);const o=new Map;for(const a of t.attributes){const r=Be();o.set(a.modelId,r),a.modelId=r;for(const l of a.dbAttrs)l.modelId=Be()}for(const a of t.indexes??[]){a.modelId=Be();for(const r of a.columns)r.columnRef=o.get(r.columnRef)??r.columnRef}return t}const ow=220;function iw(e,t){let i=-1/0;for(const r of e.entityLayouts)i=Math.max(i,r.geo.location.x+(r.geo.size.width||ow));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 t.entityLayouts)a=Math.min(a,r.geo.location.x);for(const r of t.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 Gr=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),kn=Symbol("editorController");function Eu(e="m1",t="d1"){return{logical:{modelId:e,entities:[],associations:[],groups:[]},layout:{diagramId:t,logicalModelRef:e,entityLayouts:[],associationLayouts:[],groupLayouts:[],notes:[]}}}function aa(e,t){const o=[];for(const i of t.remove)o.push(Dn(e,i));for(const i of t.update)o.push(rn(e,i.attributeId,i.patch));for(const i of t.add)o.push(Vt(e,i));return o}function Wn(e,t,o){return{...e,entities:e.entities.map(i=>i.modelId===t?{...i,attributes:o(i.attributes)}:i)}}function qn(e,t){const o=[];for(const[i,a]of kp(e,t,Be))o.push(...aa(i,a));return o}function wu(e,t,o){const i=new Set(o.remove);return Wn(e,t,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 jr(e,t){const o=po(e,t,Be),i=aa(t,o),a=wu(e,t,o);return i.push(...qn(a,t)),i}function Nu(e){return e.attributes.flatMap(t=>t.dbAttrs).map(t=>({...t,modelId:Be()}))}function aw(e,t){var d;const o=e.entities.find(u=>u.modelId===t);if(!o)return[];const i=[];let a;if(!o.attributes.some(u=>u.identifier)){const u=o.attributes.reduce((f,y)=>Math.max(f,y.order),-1)+1,m=new Set(o.attributes.map(f=>f.name));let p="id";for(let f=2;m.has(p);f++)p=`id${f}`;a={modelId:Be(),name:p,type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:u,dbAttrs:[{modelId:Be(),physicalName:p.toLowerCase(),dataType:"BIGINT"}]},i.push(Vt(t,a))}const r=[];for(const u of e.entities)for(const m of u.attributes){if(((d=m.embedded)==null?void 0:d.embeddableRef)!==t)continue;const p=e.associations.find(k=>k.modelId===m.embedded.associationRef);if(!p)continue;const f=p.end1.entityRef===u.modelId,y=f?p.end1:p.end2,b=f?p.end2:p.end1;r.push({ownerId:u.modelId,dispId:m.modelId,assocId:p.modelId,end1:{entityRef:u.modelId,multiplicity:y.multiplicity,navigable:y.navigable,composition:!1},end2:{entityRef:t,multiplicity:b.multiplicity,navigable:b.navigable,composition:!1}})}const l={...e,entities:e.entities.map(u=>{if(u.modelId===t)return a?{...u,stereotype:"JPA_ENTITY",attributes:[...u.attributes,a]}:{...u,stereotype:"JPA_ENTITY"};const m=new Set(r.filter(p=>p.ownerId===u.modelId).map(p=>p.dispId));return m.size?{...u,attributes:u.attributes.filter(p=>!m.has(p.modelId))}:u}),associations:e.associations.map(u=>{const m=r.find(p=>p.assocId===u.modelId);return m?{...u,end1:m.end1,end2:m.end2}:u})},s=po(l,t,Be);for(const u of r){const m=s.add.find(p=>{var f;return((f=p.derivedFrom)==null?void 0:f.associationRef)===u.assocId});m&&(u.end2.attributeRef=m.modelId)}for(const u of r)i.push(Dn(u.ownerId,u.dispId)),i.push(yi(u.assocId,{end1:u.end1,end2:u.end2}));i.push(...aa(t,s));const c=wu(l,t,s);return i.push(...qn(c,t)),i}function rw(e,t){const o=e.entities.find(r=>r.modelId===t);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===t,s=r.end2.entityRef===t;if(!l&&!s)continue;const c=l?r.end2.entityRef:r.end1.entityRef,d=e.entities.find(h=>h.modelId===c);if(!d||d.attributes.some(h=>{var E;return((E=h.embedded)==null?void 0:E.associationRef)===r.modelId}))continue;const u=Be(),m=d.attributes.reduce((h,E)=>Math.max(h,E.order),-1)+1,p=new Set(d.attributes.map(h=>h.name)),f=a(o.name);let y=f;for(let h=2;p.has(y);h++)y=`${f}${h}`;const b=o.attributes.filter(h=>!h.identifier&&!h.derivedFrom).flatMap(h=>h.dbAttrs).map(h=>({...h,modelId:Be()})),k={modelId:u,name:y,type:o.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:m,dbAttrs:b,embedded:{associationRef:r.modelId,embeddableRef:t}};i.push(Vt(c,k));const g=l?"end2":"end1",w=l?"end1":"end2";i.push(yi(r.modelId,{identifying:!1,[g]:{entityRef:c,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:Be()},[w]:{entityRef:t,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:u}}))}return i}function lw(e=Eu(),t={}){var je,lt;const o=n.reactive(e);let i=new Ja(o);const a=n.ref(t.embeddableCatalog??[]),r=n.ref(t.groupCodeCatalog??[]),l=n.ref(t.predefinedCustomTypeCatalog??[]),s=n.ref(t.superClassCatalog??[]),c=n.ref(t.languages??["ko","en","ja","zh"]),d=n.ref(t.userLanguage??"ko"),u=n.ref(t.uiLocale??"ko"),m=(x,F)=>St(u.value,x,F),p=n.ref(t.reservedWords),f=n.ref(t.selectableDataTypes),y=n.ref(t.largeEntityThreshold),b=n.ref(t.flagEntitiesWithoutRelations??!1),k=n.ref(!1),g=n.ref(!1),w=n.ref(!1),h=n.ref(0),E=n.ref(null);let X=0;const z=x=>{if(t.onNotice){t.onNotice(x);return}E.value={text:x,id:++X}},q=n.ref(((je=t.meta)==null?void 0:je.schemaVersion)??1),D=n.ref(((lt=t.meta)==null?void 0:lt.opWriteEnabled)??!1),$=n.computed(()=>q.value>=2&&D.value),B=t.historyTransport,Q=n.computed(()=>$.value&&B!==void 0),V=t.restoreTransport,re=n.ref(0),_=n.computed(()=>$.value&&R.value&&V!==void 0);async function W(x){if(!V||!R.value)return{ok:!1,reason:"unavailable"};const F=await V(x);return F.ok&&re.value++,F}const R=n.ref(!(q.value>=2&&D.value===!1)),J=n.ref("LOGICAL_PHYSICAL"),ee=n.ref("straight"),ae=n.ref(!0),I=n.ref(!0),K=n.ref(null),oe=n.computed(()=>{var x;return((x=K.value)==null?void 0:x.kind)==="attribute"?{entityId:K.value.entityId,attrId:K.value.anchor}:null}),pe=n.computed(()=>{var x;return((x=K.value)==null?void 0:x.kind)==="attribute"?K.value.ids:[]}),fe=n.computed(()=>{var x,F;return((x=K.value)==null?void 0:x.kind)==="entity"?K.value.id:((F=K.value)==null?void 0:F.kind)==="attribute"?K.value.entityId:null}),ce=n.ref(null);let ue=0;const he=n.ref(null),we=n.ref(null);let Se=t.meta;function Ie(){i.onChange(()=>{k.value=i.canUndo,g.value=i.canRedo,w.value=i.isDirty,h.value++})}Ie();let me=null,ge=null;function ke(){ge==null||ge(),ge=null,me=null}function G(){if(ke(),!$.value||!t.opTransport)return;const x=new js({diagramId:o.layout.diagramId,state:o,transport:t.opTransport,origin:"gui",onFreeze:F=>{R.value=!1,we.value=F},onError:t.onOpError});x.seed((Se==null?void 0:Se.revSeed)??{}),ge=x.attach(i),me=x}G();const H=n.computed(()=>_l(o.logical,o.layout)),C=n.computed(()=>({reservedWords:p.value,selectableDataTypes:f.value,largeEntityThreshold:y.value,flagEntitiesWithoutRelations:b.value,embeddableCatalog:a.value,superClassCatalog:s.value})),M=n.computed(()=>Ol(o.logical,C.value)),T=n.computed(()=>{const x=new Map;for(const F of M.value){if(!F.targetRef)continue;const S=x.get(F.targetRef);S?S.push(F):x.set(F.targetRef,[F])}return x}),ne=x=>{R.value&&i.execute(x)},de=x=>o.layout.entityLayouts.some(F=>F.entityRef===x&&!!F.locked),Ee=x=>o.layout.groupLayouts.some(F=>F.groupRef===x&&!!F.locked),ye=x=>{const F=o.logical.associations.find(S=>S.modelId===x);return!!F&&(de(F.end1.entityRef)||de(F.end2.entityRef))},ve=(x,F,S)=>{if(de(x))return;const L=rn(x,F,S),P=Wn(o.logical,x,Z=>Z.map(te=>te.modelId===F?{...te,...S}:te)),j=qn(P,x);ne(j.length?Ge("속성 수정",[L,...j]):L)};function Te(x){const F=x.map(v=>o.layout.entityLayouts.find(A=>A.entityRef===v)).filter(v=>!!v);if(!F.length)return{location:{x:40,y:40},size:{width:400,height:300}};let S=1/0,L=1/0,P=-1/0,j=-1/0;for(const v of F){const A=v.geo.size.width||220,Y=v.geo.size.height||140;S=Math.min(S,v.geo.location.x),L=Math.min(L,v.geo.location.y),P=Math.max(P,v.geo.location.x+A),j=Math.max(j,v.geo.location.y+Y)}const Z=40,te=28;return{location:{x:S-Z,y:L-Z-te},size:{width:P-S+Z*2,height:j-L+Z*2+te}}}function Ve(x,F,S){var v;const L=o.layout.groupLayouts.find(A=>A.groupRef===x),P=(L==null?void 0:L.geo.location)??F,j=F.x-P.x,Z=F.y-P.y,te=[fs(x,F),...S.map(A=>Bn(A.id,A.location))];if(j||Z){const A=new Set(((v=o.logical.groups.find(Y=>Y.modelId===x))==null?void 0:v.memberEntityRefs)??[]);for(const Y of o.logical.associations){if(!A.has(Y.end1.entityRef)||!A.has(Y.end2.entityRef))continue;const N=o.layout.associationLayouts.find(U=>U.associationRef===Y.modelId);N&&N.waypoints.length&&te.push(Ss(Y.modelId,j,Z))}for(const Y of(L==null?void 0:L.memberNoteRefs)??[]){const N=o.layout.notes.find(U=>U.modelId===Y);N&&te.push(fo(Y,{x:N.geo.location.x+j,y:N.geo.location.y+Z}))}}return te}const Le={state:o,resolved:H,issues:M,issuesByRef:T,flagEntitiesWithoutRelations:b,canUndo:k,canRedo:g,dirty:w,revision:h,notice:E,editable:R,schemaVersion:q,opWriteEnabled:D,opMode:$,opConflict:we,historyTransport:B,historyAvailable:Q,restoreTransport:V,restoreAvailable:_,restoreToSeq:W,reloadRequest:re,displayMode:J,routingMode:ee,showGrid:ae,showMinimap:I,selection:K,selectedAttr:oe,selectedAttrIds:pe,inspectedEntityId:fe,focusRequest:ce,clipboard:he,embeddableCatalog:a,groupCodeCatalog:r,predefinedCustomTypeCatalog:l,superClassCatalog:s,languages:c,userLanguage:d,uiLocale:u,t:m,selectableDataTypes:f,setEditable(x){R.value=x&&$.value},setEmbeddableCatalog(x){a.value=x},setGroupCodeCatalog(x){r.value=x},setPredefinedCustomTypeCatalog(x){l.value=x},setSuperClassCatalog(x){s.value=x},selectAttribute(x,F,S="replace"){const L=K.value,P=(L==null?void 0:L.kind)==="attribute"&&L.entityId===x;if(S==="replace"||!P){K.value={kind:"attribute",entityId:x,ids:[F],anchor:F};return}if(S==="toggle"){const N=L.ids.includes(F),U=N?L.ids.filter(le=>le!==F):[...L.ids,F];if(!U.length){K.value=null;return}const O=N&&L.anchor===F?U[U.length-1]:N?L.anchor:F;K.value={kind:"attribute",entityId:x,ids:U,anchor:O};return}const j=o.logical.entities.find(N=>N.modelId===x),Z=[...(j==null?void 0:j.attributes)??[]].sort((N,U)=>N.order-U.order).map(N=>N.modelId),te=Z.indexOf(L.anchor),v=Z.indexOf(F);if(te<0||v<0){K.value={kind:"attribute",entityId:x,ids:[F],anchor:F};return}const[A,Y]=te<=v?[te,v]:[v,te];K.value={kind:"attribute",entityId:x,ids:Z.slice(A,Y+1),anchor:L.anchor}},moveAttributeFocus(x){const F=K.value;if((F==null?void 0:F.kind)!=="attribute")return!1;const S=o.logical.entities.find(Z=>Z.modelId===F.entityId);if(!S||!S.attributes.length)return!1;const L=S.attributes.findIndex(Z=>Z.modelId===F.anchor);if(L<0)return!1;const P=Math.min(Math.max(L+x,0),S.attributes.length-1);if(P===L)return!0;const j=S.attributes[P].modelId;return K.value={kind:"attribute",entityId:F.entityId,ids:[j],anchor:j},!0},nudgeSelectedAttributes(x){const F=K.value;if((F==null?void 0:F.kind)!=="attribute")return!1;const S=o.logical.entities.find(N=>N.modelId===F.entityId);if(!S)return!1;const L=S.attributes,P=new Set(F.ids),j=L.map((N,U)=>P.has(N.modelId)?U:-1).filter(N=>N>=0);if(!j.length)return!1;const Z=Math.min(...j),te=L.filter(N=>!P.has(N.modelId)),v=L.slice(0,Z).filter(N=>!P.has(N.modelId)).length;let A;if(x<0){if(v<=0)return!0;A=v-1}else{if(te.length-v<=0)return!0;A=v+1}if(de(F.entityId))return!0;const Y=L.filter(N=>P.has(N.modelId)).map(N=>N.modelId);return ne(Qa(F.entityId,Y,A)),!0},deleteSelection(){if(!R.value)return!1;const x=K.value;if(!x)return!1;if(x.kind==="attribute"){if(de(x.entityId))return!1;const F=x.ids;if(!F.length)return!1;F.length===1?Le.removeAttribute(x.entityId,F[0]):Le.removeAttributes(x.entityId,F)}else if(x.kind==="entity"){if(de(x.id))return!1;Le.removeEntity(x.id)}else if(x.kind==="note")Le.removeNote(x.id);else if(x.kind==="group"){if(Ee(x.id))return!1;Le.removeGroup(x.id)}else Le.removeAssociation(x.id);return K.value=null,!0},nudgeNodes(x,F,S){if(!x.length||F===0&&S===0)return!1;const L=new Set(o.logical.entities.map(A=>A.modelId)),P=new Set(o.logical.groups.map(A=>A.modelId)),j=new Set(o.layout.notes.map(A=>A.modelId)),Z=new Set;for(const A of x){if(!P.has(A))continue;const Y=o.logical.groups.find(N=>N.modelId===A);for(const N of(Y==null?void 0:Y.memberEntityRefs)??[])Z.add(N)}const te=[],v=[];for(const A of x)if(P.has(A)){if(Ee(A))continue;const Y=o.layout.groupLayouts.find(le=>le.groupRef===A);if(!Y)continue;const N=o.logical.groups.find(le=>le.modelId===A),U=((N==null?void 0:N.memberEntityRefs)??[]).map(le=>{var se;const Ne=((se=o.layout.entityLayouts.find(Re=>Re.entityRef===le))==null?void 0:se.geo.location)??{x:0,y:0};return{id:le,location:{x:Ne.x+F,y:Ne.y+S}}}),O={x:Y.geo.location.x+F,y:Y.geo.location.y+S};te.push(Ge("그룹 이동",Ve(A,O,U))),v.push("g:"+A)}else if(L.has(A)){if(Z.has(A)||de(A))continue;const Y=o.layout.entityLayouts.find(N=>N.entityRef===A);if(!Y)continue;te.push(Bn(A,{x:Y.geo.location.x+F,y:Y.geo.location.y+S})),v.push("e:"+A)}else if(j.has(A)){const Y=o.layout.notes.find(N=>N.modelId===A);if(!Y)continue;te.push(fo(A,{x:Y.geo.location.x+F,y:Y.geo.location.y+S})),v.push("n:"+A)}return te.length?(ne(Ge("이동",te,"nudge:"+v.sort().join(","))),!0):!1},requestFocus(x){ce.value={id:x,nonce:++ue}},undo:()=>{R.value&&i.undo()},redo:()=>{R.value&&i.redo()},markSaved:()=>{R.value&&(me==null||me.flush(),i.markSavePoint())},loadDiagram(x,F){ke(),o.logical=x.logical,o.layout=x.layout,i=new Ja(o),Ie(),q.value=(F==null?void 0:F.schemaVersion)??1,D.value=(F==null?void 0:F.opWriteEnabled)??!1,R.value=!(q.value>=2&&D.value===!1),Se=F,we.value=null,K.value=null,k.value=i.canUndo,g.value=i.canRedo,w.value=i.isDirty,G()},flush(){me==null||me.flush()},whenOpsSettled(){return(me==null?void 0:me.whenSettled())??Promise.resolve()},addEntity(x="NewEntity",F={x:80,y:80}){const S=Be(),L={modelId:S,name:x,stereotype:"JPA_ENTITY",table:{physicalName:x.toLowerCase()},attributes:[{modelId:Be(),name:"id",type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:0,dbAttrs:[{modelId:Be(),physicalName:"id",dataType:"BIGINT"}]}]};return ne(ui(L,{location:{...F},size:{width:220,height:140}})),S},renameEntity(x,F){de(x)||ne(as(x,F))},updateEntity(x,F){if(de(x))return;const S=is(x,F),L=o.logical.entities.find(Z=>Z.modelId===x),P=F.stereotype==="JPA_EMBEDDABLE"&&!!L&&L.stereotype!=="JPA_EMBEDDABLE",j=!!F.stereotype&&F.stereotype!=="JPA_EMBEDDABLE"&&!!L&&L.stereotype==="JPA_EMBEDDABLE";if(P&&L){const Z=L.attributes.filter(N=>N.identifier&&!N.derivedFrom).map(N=>rn(x,N.modelId,{identifier:!1})),te=Wn({...o.logical,entities:o.logical.entities.map(N=>N.modelId===x?{...N,stereotype:"JPA_EMBEDDABLE"}:N)},x,N=>N.map(U=>U.identifier&&!U.derivedFrom?{...U,identifier:!1}:U)),v=jr(te,x),A=rw(o.logical,x),Y=[S,...Z,...v,...A];ne(Y.length>1?Ge("임베더블 변환",Y):S);return}if(j){const Z=aw(o.logical,x),te=[S,...Z];ne(te.length>1?Ge("엔터티 전환",te):S);return}ne(S)},moveEntity(x,F){de(x)||ne(Bn(x,F))},resizeEntity(x,F){de(x)||ne(rs(x,F))},removeEntity(x){de(x)||ne(os(x))},setEntitySwatch(x,F){ne(ls(x,F))},setEntityCollapsed(x,F){ne(ss(x,F))},setEntityLocked(x,F){ne(cs(x,F))},isEntityLocked(x){return de(x)},collapseAll(){ne(Za(!0))},expandAll(){ne(Za(!1))},setAttributeSwatch(x,F,S){ne(mi(x,F,S))},dragGroup(x,F,S){Ee(x)||ne(Ge("그룹 이동",Ve(x,F,S)))},resizeGroup(x,F){Ee(x)||ne(ps(x,F))},setGroupSwatch(x,F){ne(hs(x,F))},setGroupLocked(x,F){ne(ys(x,F))},isGroupLocked(x){return Ee(x)},updateGroup(x,F){Ee(x)||ne(ds(x,F))},createGroup(x,F){if(!x.length)return null;const S=[];for(const j of o.logical.groups)for(const Z of x)j.memberEntityRefs.includes(Z)&&S.push(pi(j.modelId,Z));const L=Be(),P={modelId:L,name:F?{ko:F}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[...x]};return S.push(fi(P,Te(x))),ne(Ge("그룹 생성",S)),K.value=null,L},addEmptyGroup(x,F){const S=Be();return ne(fi({modelId:S,name:F?{ko:F}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[]},{location:{...x},size:{width:360,height:260}})),S},removeGroup(x){Ee(x)||ne(us(x))},dropEntity(x,F,S){var j;if(de(x))return;const L=((j=o.logical.groups.find(Z=>Z.memberEntityRefs.includes(x)))==null?void 0:j.modelId)??null,P=[Bn(x,F)];L!==S&&(L&&P.push(pi(L,x)),S&&P.push(ms(S,x))),ne(Ge("이동",P))},ungroupEntity(x){const F=o.logical.groups.find(S=>S.memberEntityRefs.includes(x));F&&ne(pi(F.modelId,x))},dropNote(x,F,S){var j;const L=((j=o.layout.groupLayouts.find(Z=>{var te;return(te=Z.memberNoteRefs)==null?void 0:te.includes(x)}))==null?void 0:j.groupRef)??null,P=[fo(x,F)];L!==S&&(L&&P.push(Os(L,x)),S&&P.push(Ds(S,x))),ne(Ge("이동",P))},addPredefinedEmbed(x,F){if(de(x))return;const S=a.value.find(v=>v.type===F),L=o.logical.entities.find(v=>v.modelId===x);if(!S||!L)return;const P=L.attributes.reduce((v,A)=>Math.max(v,A.order),-1)+1,j=Be(),Z=S.fields.map(()=>({modelId:Be(),physicalName:"",dataType:""})),te={modelId:j,name:S.defaultName,type:S.type,attrType:"EMBED_PREDEF",identifier:!1,notNull:!1,order:P,dbAttrs:Z};return ne(Vt(x,te)),j},addAttribute(x,F={}){if(de(x))return F.modelId??"";const S=o.logical.entities.find(Y=>Y.modelId===x),L=S?S.attributes.length:0,P=F.modelId??Be(),j=F.name??`field${L}`,Z={modelId:P,name:j,type:F.type??za,attrType:F.attrType??"NORMAL",identifier:F.identifier??!1,notNull:F.notNull??!1,order:L,dbAttrs:F.dbAttrs??[{modelId:Be(),physicalName:j,dataType:"VARCHAR",length:255}],...F},te=Vt(x,Z),v=Wn(o.logical,x,Y=>[...Y,Z]),A=qn(v,x);return ne(A.length?Ge("속성 추가",[te,...A]):te),P},addDivider(x){if(de(x))return"";const F=o.logical.entities.find(j=>j.modelId===x),S=F?F.attributes.length:0,L=Be();return ne(Vt(x,{modelId:L,name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:S,dbAttrs:[]})),L},updateAttribute(x,F,S){ve(x,F,S)},setAttributeGroupCode(x,F,S){ve(x,F,{groupCode:S,type:S?In:za})},setEmbedColumns(x,F,S){var v,A;if(de(x))return;const L=rn(x,F,{dbAttrs:S}),P=(v=o.logical.entities.find(Y=>Y.modelId===x))==null?void 0:v.attributes.find(Y=>Y.modelId===F),j=(A=P==null?void 0:P.embedded)==null?void 0:A.associationRef,Z=j?o.logical.associations.find(Y=>Y.modelId===j):void 0,te=[];Z&&j&&(Z.end1.legacyEmbedRaw&&te.push(ln(j,"end1",{legacyEmbedRaw:void 0})),Z.end2.legacyEmbedRaw&&te.push(ln(j,"end2",{legacyEmbedRaw:void 0}))),ne(te.length?Ge("임베드 컬럼 수정",[L,...te]):L)},removeAttribute(x,F){if(de(x))return;if(ki(o.logical,x,F)){z(ku);return}const S=Dn(x,F),L=Wn(o.logical,x,j=>j.filter(Z=>Z.modelId!==F)),P=qn(L,x);ne(P.length?Ge("속성 삭제",[S,...P]):S)},removeAttributes(x,F){var te;if(!F.length||de(x))return;const S=F.filter(v=>!ki(o.logical,x,v));if(S.length<F.length&&z(ku),!S.length)return;const L=S.map(v=>Dn(x,v)),P=new Set(S),j=Wn(o.logical,x,v=>v.filter(A=>!P.has(A.modelId))),Z=[...L,...qn(j,x)];ne(Z.length===1?Z[0]:Ge("속성 삭제",Z)),((te=K.value)==null?void 0:te.kind)==="attribute"&&K.value.entityId===x&&(K.value=null)},setAttributeSwatches(x,F,S){F.length&&(F.length===1?ne(mi(x,F[0],S)):ne(Ge("속성 색상",F.map(L=>mi(x,L,S)))))},reorderAttributes(x,F,S){!F.length||de(x)||ne(Qa(x,F,S))},addIndex(x,F){de(x)||ne(Ns(x,F))},updateIndex(x,F,S){de(x)||ne(vs(x,F,S))},removeIndex(x,F){de(x)||ne(xs(x,F))},addOperation(x,F={}){var Z;if(de(x))return F.modelId??"";const S=o.logical.entities.find(te=>te.modelId===x),L=((Z=S==null?void 0:S.operations)==null?void 0:Z.length)??0,P=F.modelId??Be(),j={modelId:P,name:F.name??`method${L}`,visibility:F.visibility??"PACKAGE",order:L,...F};return ne(gs(x,j)),P},updateOperation(x,F,S){de(x)||ne(bs(x,F,S))},removeOperation(x,F){de(x)||ne(_s(x,F))},reorderOperations(x,F,S){!F.length||de(x)||ne(ks(x,F,S))},setOperationSwatch(x,F,S){ne(Es(x,F,S))},addAssociation(x,F,S,L){if(de(x)||de(F))return"";const P=Be(),j={modelId:P,end1:{entityRef:x,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:S},end2:{entityRef:F,multiplicity:"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:!1}},Z={...o.logical,associations:[...o.logical.associations,j]},te=po(Z,F,Be),v=te.add[0];v&&(j.end2.attributeRef=v.modelId);const A={associationRef:P,waypoints:[],sourceColumnRef:S,targetColumnRef:(v==null?void 0:v.modelId)??L},Y=hi(j,A),N=aa(F,te);return ne(N.length?Ge("관계 추가",[Y,...N]):Y),P},addEmbedAssociation(x,F){if(de(x))return;const S=o.logical.entities.find(se=>se.modelId===x),L=o.logical.entities.find(se=>se.modelId===F);if(!S||!L||L.stereotype!=="JPA_EMBEDDABLE")return;const P=Be(),j=Be(),Z=Be(),te=S.attributes.reduce((se,Re)=>Math.max(se,Re.order),-1)+1,v=Nu(L),A=se=>se&&se.charAt(0).toLowerCase()+se.slice(1),Y=new Set(S.attributes.map(se=>se.name)),N=A(L.name);let U=N;for(let se=2;Y.has(U);se++)U=`${N}${se}`;const O={modelId:j,name:U,type:L.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:te,dbAttrs:v,embedded:{associationRef:P,embeddableRef:F}},le={modelId:P,end1:{entityRef:x,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:Z},end2:{entityRef:F,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:j}},Ne={associationRef:P,waypoints:[],sourceColumnRef:j,targetColumnRef:void 0};return ne(Ge("임베드 추가",[Vt(x,O),hi(le,Ne)])),P},setEmbedCardinality(x,F){var N;if(ye(x))return;const S=o.logical.associations.find(U=>U.modelId===x);if(!S)return;let L,P;for(const U of o.logical.entities){const O=U.attributes.find(le=>{var Ne;return((Ne=le.embedded)==null?void 0:Ne.associationRef)===x&&le.attrType==="EMBED_OWN"});if(O){L=U.modelId,P=O;break}}if(!L||!P)return;const j=P.embedded.embeddableRef,Z=S.end2.entityRef===j?"end2":"end1",te=S[Z];if(te.multiplicity===F)return;const v=U=>U==="ZERO_OR_MORE_INSTANCES"||U==="ONE_OR_MORE_INSTANCES",A=v(te.multiplicity),Y=v(F);if(A===Y){ne(ln(x,Z,{multiplicity:F}));return}if(Y)ne(Ge("임베드 컬렉션 전환",[rn(L,P.modelId,{dbAttrs:[]}),ln(x,Z,{multiplicity:F,jpa:{...te.jpa,collectionType:((N=te.jpa)==null?void 0:N.collectionType)??"LIST"}})]));else{const U=o.logical.entities.find(O=>O.modelId===j);if(!U)return;ne(Ge("임베드 단일 전환",[rn(L,P.modelId,{dbAttrs:Nu(U)}),ln(x,Z,{multiplicity:F,jpa:{...te.jpa,collectionType:void 0,collectionTable:void 0,orderColumn:void 0}})]))}},removeAssociation(x){if(ye(x))return;const F=o.logical.associations.find(Z=>Z.modelId===x),S=ws(x);if(!F){ne(S);return}for(const Z of o.logical.entities){const te=Z.attributes.find(v=>{var A;return((A=v.embedded)==null?void 0:A.associationRef)===x});if(te){ne(Ge("임베드 삭제",[S,Dn(Z.modelId,te.modelId)]));return}}const L=F.end2.entityRef,P={...o.logical,associations:o.logical.associations.filter(Z=>Z.modelId!==x)},j=jr(P,L);ne(j.length?Ge("관계 삭제",[S,...j]):S)},setAssociationIdentifying(x,F){if(ye(x))return;const S=o.logical.associations.find(te=>te.modelId===x),L=yi(x,{identifying:F});if(!S||S.identifying===F){ne(L);return}const P=S.end2.entityRef,j={...o.logical,associations:o.logical.associations.map(te=>te.modelId===x?{...te,identifying:F}:te)},Z=jr(j,P);ne(Z.length?Ge("식별 관계 변경",[L,...Z]):L)},updateAssociationEnd(x,F,S){ye(x)||ne(ln(x,F,S))},moveWaypoint(x,F,S){ne(Cs(x,F,S))},addWaypoint(x,F,S){ne(Rs(x,F,S))},removeWaypoint(x,F){ne(Is(x,F))},clearWaypoints(x){ne($s(x))},addNote(x="메모",F={x:80,y:80}){const S=Be();return ne(As({modelId:S,memo:x,geo:{location:{...F},size:{width:200,height:120}}})),S},removeNote(x){ne(Ts(x))},moveNote(x,F){ne(fo(x,F))},resizeNote(x,F){ne(Vs(x,F))},setNoteMemo(x,F){ne(Ms(x,F))},setNoteSwatch(x,F){ne(Bs(x,F))},addNoteConnection(x,F){ne(Ps(x,F))},removeNoteConnection(x,F){ne(Ls(x,F))},moveNoteConnectionWaypoint(x,F,S,L){ne(zs(x,F,S,L))},addNoteConnectionWaypoint(x,F,S,L){ne(Us(x,F,S,L))},removeNoteConnectionWaypoint(x,F,S){ne(Hs(x,F,S))},clearNoteConnectionWaypoints(x,F){ne(Fs(x,F))},autoLayout(){const x=wl(o.logical,o.layout);x.length&&ne(Ge("자동 배치",x.map(F=>Bn(F.id,F.location))))},copy(){const x=K.value;if((x==null?void 0:x.kind)==="attribute"){const j=o.logical.entities.find(te=>te.modelId===x.entityId);if(!j)return;const Z=[...j.attributes].sort((te,v)=>te.order-v.order).filter(te=>x.ids.includes(te.modelId));if(!Z.length)return;he.value=JSON.parse(JSON.stringify({kind:"attribute",attributes:Z}));return}const F=fe.value;if(!F)return;const S=o.logical.entities.find(j=>j.modelId===F),L=o.layout.entityLayouts.find(j=>j.entityRef===F);if(!S)return;const P=(L==null?void 0:L.geo)??{location:{x:80,y:80},size:{width:220,height:140}};he.value=JSON.parse(JSON.stringify({kind:"entity",entity:S,geo:P}))},paste(){if(!R.value)return;const x=he.value;if(!x)return;if(x.kind==="attribute"){const L=fe.value;if(!L)return;const P=o.logical.entities.find(Y=>Y.modelId===L);if(!P)return;const j=new Set(P.attributes.map(Y=>Y.name)),Z=new Set(P.attributes.flatMap(Y=>Y.dbAttrs.map(N=>N.physicalName))),te=P.attributes.length,v=[],A=x.attributes.map((Y,N)=>{const U=JSON.parse(JSON.stringify(Y));U.modelId=Be();for(const O of U.dbAttrs)O.modelId=Be();j.has(U.name)&&(U.name=`${U.name}_copy`);for(const O of U.dbAttrs)O.physicalName&&Z.has(O.physicalName)&&(O.physicalName=`${O.physicalName}_copy`);return U.order=te+N,v.push(U.modelId),Vt(L,U)});ne(A.length===1?A[0]:Ge("속성 붙여넣기",A)),K.value={kind:"attribute",entityId:L,ids:v,anchor:v[v.length-1]};return}const F=nw(x.entity),S={location:{x:x.geo.location.x+40,y:x.geo.location.y+40},size:{...x.geo.size}};ne(ui(F,S)),K.value={kind:"entity",id:F.modelId}},importEntities(x,F,S){if(!R.value)return;const L=ql(x,F,{existing:o.logical,includeRelated:S==null?void 0:S.includeRelated});if(L.logical.entities.length===0)return;const P=iw(o.layout,L.layout),j=new Map(L.layout.entityLayouts.map(Y=>[Y.entityRef,Y])),Z=new Map(L.layout.associationLayouts.map(Y=>[Y.associationRef,Y])),te=new Map(L.layout.groupLayouts.map(Y=>[Y.groupRef,Y])),v=[];let A=80;for(const Y of L.logical.entities){const N=j.get(Y.modelId),U=N?{location:Gr(N.geo.location,P),size:{...N.geo.size}}:{location:{x:A+=40,y:80},size:{width:220,height:140}};let O;if(N){const{entityRef:le,geo:Ne,locked:se,...Re}=N;O=Re}v.push(ui(Y,U,O))}for(const Y of L.logical.associations){const N=Z.get(Y.modelId),U=N?{...N,waypoints:N.waypoints.map(O=>Gr(O,P))}:{associationRef:Y.modelId,waypoints:[]};v.push(hi(Y,U))}for(const Y of L.logical.groups){const N=te.get(Y.modelId),U=N?{location:Gr(N.geo.location,P),size:{...N.geo.size}}:{location:{x:80,y:80},size:{width:320,height:200}};let O;if(N){const{groupRef:le,geo:Ne,locked:se,memberNoteRefs:Re,...De}=N;O=De}v.push(fi(Y,U,O))}ne(Ge("다이어그램 가져오기",v)),K.value={kind:"entity",id:L.logical.entities[0].modelId}}};return Le}const ra=Symbol("groupHover"),vu=Symbol("groupDrag"),Xn=Symbol("relationHighlight"),sw={key:0,class:"em-sel","aria-hidden":"true"},cw=["title","aria-expanded","disabled"],dw={class:"em-entity__stereotype"},uw={key:1,class:"em-entity__name"},mw=["data-attr","onClick","onPointerdown","onPointermove","onPointerup","onPointercancel"],fw=["onPointerdown"],pw={key:1,class:"em-entity__divider-label"},hw=["title"],yw={class:"em-key-slot"},gw={class:"em-key-slot"},bw={key:0,class:"em-entity__type"},_w=["onClick"],kw={class:"em-entity__attrname"},Ew={class:"em-entity__type"},ww=["data-op"],Nw=["onPointerdown"],vw={class:"em-entity__op-vis","aria-hidden":"true"},xw=["title"],Cw={key:4,class:"em-entity__footer"},xu=Pe(n.defineComponent({__name:"EntityNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const t=e,o=n.inject(kn,null),i=(j,Z)=>o?o.t(j,Z):St("ko",j,Z),a=ie.useModal();function r(){o&&ia(a,o,t.id)}const l=n.inject(ra,null),s=n.inject(Xn,null),c=n.computed(()=>!!o&&o.editable.value);function d(){l&&(l.value=t.data.groupRef??null)}function u(){s==null||s.setEntityHover(t.id)}function m(){s==null||s.setEntityHover(null)}const p=n.computed(()=>!!s&&s.primaryEntityIds.value.has(t.id)),f=n.computed(()=>!!s&&s.relatedEntityIds.value.has(t.id)&&!p.value),y=n.computed(()=>{var j;return((j=o==null?void 0:o.selection.value)==null?void 0:j.kind)==="entity"&&o.selection.value.id===t.id}),b=n.computed(()=>!!t.selected&&!y.value),k=n.computed(()=>{var j;return o&&((j=o.selectedAttr.value)==null?void 0:j.entityId)===t.id?new Set(o.selectedAttrIds.value):new Set}),g=n.computed(()=>k.value.size>0);function w(j,Z){const te=Z.shiftKey?"range":Z.metaKey||Z.ctrlKey?"toggle":"replace";o==null||o.selectAttribute(t.id,j.modelId,te)}const h=n.computed(()=>!!s&&s.active.value&&!s.relatedEntityIds.value.has(t.id)&&!y.value),E=n.computed(()=>t.data.entity),X=n.computed(()=>t.data.displayMode??"LOGICAL_PHYSICAL"),z=n.computed(()=>t.data.collapsed??!1),q=n.computed(()=>t.data.locked??!1);function D(){c.value&&(o==null||o.setEntityCollapsed(t.id,!z.value))}const $=n.computed(()=>X.value==="PHYSICAL"||X.value==="LOGICAL_PHYSICAL"),B=n.computed(()=>{const j=X.value==="PHYSICAL"||X.value==="LOGICAL_PHYSICAL",Z={};for(const te of E.value.attributes){const v=te.attrType.startsWith("RELATION")&&te.dbAttrs.length>0;Z[te.modelId]={pk:te.identifier,fk:v&&j,required:te.notNull&&!te.identifier}}return Z});function Q(j){if(!j)return"";const Z=[];return j.pk&&j.fk?Z.push(i("em.node.keyPfk")):j.pk?Z.push(i("em.node.keyPk")):j.fk&&Z.push(i("em.node.keyFk")),j.required&&Z.push(i("em.node.required")),Z.join(" · ")}const V=n.computed(()=>{const j=zr(it(t.data.style)),Z={};return j&&(Z["--em-header-bg"]=j.bar,Z["--em-header-fg"]=j.barOn),Z});function re(j){var Z,te;return(te=zr(it((Z=t.data.attributeStyles)==null?void 0:Z[j.modelId])))==null?void 0:te.text}const _=n.computed(()=>[...E.value.operations??[]].sort((j,Z)=>j.order-Z.order)),W=n.computed(()=>X.value==="CLASS"&&_.value.length>0),R={PUBLIC:"+",PRIVATE:"-",PROTECTED:"#",PACKAGE:"~"};function J(j){return j?R[j]:"~"}function ee(j){var Z,te;return(te=zr(it((Z=t.data.operationStyles)==null?void 0:Z[j.modelId])))==null?void 0:te.text}function ae(j,Z,te){switch(X.value){case"CLASS":return[{text:j}];case"PHYSICAL":return[{text:te||j}];case"LOGICAL":return[Z?{text:Z}:{text:i("em.node.logicalMissing"),missing:!0}];default:{const v=Z?{text:Z}:{text:i("em.node.logicalMissing"),missing:!0};return te?[v,{text:` · ${te}`}]:[v]}}}function I(j){var Z,te,v;return K(j)?[{text:j.name}]:ae(j.name,(te=(Z=j.dbAttrs[0])==null?void 0:Z.logicalName)==null?void 0:te.ko,((v=j.dbAttrs[0])==null?void 0:v.physicalName)??"")}function K(j){return j.attrType.startsWith("EMBED")&&j.dbAttrs.length>0}function oe(j){return j.attrType==="DIVIDER"}function pe(j){if(j.attrType!=="EMBED_PREDEF")return j.dbAttrs;const Z=o==null?void 0:o.embeddableCatalog.value.find(v=>v.type===j.type);if(!Z)return j.dbAttrs;const te=tn(en(E.value,(o==null?void 0:o.state.logical.entities)??[]));return j.dbAttrs.map((v,A)=>{const Y=Z.fields[A],N=$n(v,te);return N?{...v,physicalName:N.physicalName,logicalName:v.logicalName??(Y==null?void 0:Y.logicalName),dataType:v.dataType||(Y==null?void 0:Y.dataType)||""}:Y?{...v,physicalName:v.physicalName||Y.physicalName,logicalName:v.logicalName??Y.logicalName,dataType:v.dataType||Y.dataType,length:v.length??Y.length}:v})}function fe(j){var Z;return ae(j.physicalName,(Z=j.logicalName)==null?void 0:Z.ko,j.physicalName)}function ce(j){const Z=Ua(j,(o==null?void 0:o.state.logical.associations)??[]);return Ha(X.value,j,Z)}const ue=n.computed(()=>{var j,Z,te;return ae(E.value.name,(Z=(j=E.value.table)==null?void 0:j.logicalName)==null?void 0:Z.ko,((te=E.value.table)==null?void 0:te.physicalName)??"")}),he=n.ref(!1),we=n.ref(""),Se=n.ref(null);async function Ie(){var j,Z;c.value&&(we.value=E.value.name,he.value=!0,await n.nextTick(),(j=Se.value)==null||j.focus(),(Z=Se.value)==null||Z.select())}function me(){if(!he.value)return;he.value=!1;const j=we.value.trim();j&&j!==E.value.name&&(o==null||o.renameEntity(t.id,j))}function ge(){o==null||o.addAttribute(t.id)}function ke(){o==null||o.addDivider(t.id)}const{screenToFlowCoordinate:G,findNode:H}=Oe(),C=n.ref(null),M=n.computed(()=>{const j=C.value??t.data.size;return j?{width:`${j.width}px`,minHeight:`${j.height}px`}:void 0});let T=null;function ne(j){var v,A,Y;if(!c.value)return;j.stopPropagation();const Z=(v=H(t.id))==null?void 0:v.dimensions,te=G({x:j.clientX,y:j.clientY});T={fx:te.x,fy:te.y,w:(Z==null?void 0:Z.width)??((A=t.data.size)==null?void 0:A.width)??200,h:(Z==null?void 0:Z.height)??((Y=t.data.size)==null?void 0:Y.height)??120},j.target.setPointerCapture(j.pointerId)}function de(j){if(!T)return;const Z=G({x:j.clientX,y:j.clientY});C.value={width:Math.max(40,T.w+(Z.x-T.fx)),height:Math.max(40,T.h+(Z.y-T.fy))}}function Ee(j){var Z,te,v;if(T&&C.value&&o){const A=(Z=H(t.id))==null?void 0:Z.dimensions;o.resizeEntity(t.id,{width:Math.round((A==null?void 0:A.width)??C.value.width),height:Math.round((A==null?void 0:A.height)??C.value.height)})}T=null,C.value=null,(v=(te=j.target).releasePointerCapture)==null||v.call(te,j.pointerId)}const ye=n.ref(null),ve=n.ref(null);function Te(j,Z){if(!c.value)return;Z.stopPropagation(),Z.preventDefault();const te=k.value,v=te.has(j.modelId)?new Set(te):new Set([j.modelId]);ve.value={ids:v,dropIndex:-1,lineY:0},Z.target.setPointerCapture(Z.pointerId)}function Ve(j){if(!ve.value||!ye.value)return;const Z=Array.from(ye.value.querySelectorAll(".em-entity__row"));if(!Z.length)return;let te=Z.length;for(let Y=0;Y<Z.length;Y++){const N=Z[Y].getBoundingClientRect();if(j.clientY<N.top+N.height/2){te=Y;break}}const v=Z[Z.length-1],A=te<Z.length?Z[te].offsetTop:v.offsetTop+v.offsetHeight;ve.value={...ve.value,dropIndex:te,lineY:A}}function Le(){const j=ve.value;if(ve.value=null,!j||j.dropIndex<0)return;const Z=E.value.attributes,te=Z.filter(U=>j.ids.has(U.modelId)).map(U=>U.modelId),v=Z.filter((U,O)=>j.ids.has(U.modelId)&&O<j.dropIndex).length,A=j.dropIndex-v,Y=Z.filter(U=>!j.ids.has(U.modelId)).map(U=>U.modelId);[...Y.slice(0,A),...te,...Y.slice(A)].join(",")!==Z.map(U=>U.modelId).join(",")&&(o==null||o.reorderAttributes(t.id,te,A))}function je(){ve.value=null}const lt=n.ref(null),x=n.ref(null);function F(j,Z){c.value&&(Z.stopPropagation(),Z.preventDefault(),x.value={id:j.modelId,dropIndex:-1,lineY:0},Z.target.setPointerCapture(Z.pointerId))}function S(j){if(!x.value||!lt.value)return;const Z=Array.from(lt.value.querySelectorAll(".em-entity__op-row"));if(!Z.length)return;let te=Z.length;for(let Y=0;Y<Z.length;Y++){const N=Z[Y].getBoundingClientRect();if(j.clientY<N.top+N.height/2){te=Y;break}}const v=Z[Z.length-1],A=te<Z.length?Z[te].offsetTop:v.offsetTop+v.offsetHeight;x.value={...x.value,dropIndex:te,lineY:A}}function L(){const j=x.value;if(x.value=null,!j||j.dropIndex<0)return;const te=_.value.findIndex(A=>A.modelId===j.id);if(te<0)return;const v=j.dropIndex-(te<j.dropIndex?1:0);v!==te&&(o==null||o.reorderOperations(t.id,[j.id],v))}function P(){x.value=null}return(j,Z)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-entity",{"is-hover-origin":p.value,"is-related":f.value,"is-dimmed":h.value,"is-selected":y.value,"is-multi-selected":b.value,"has-focused-attr":g.value,"is-locked":q.value}]),style:n.normalizeStyle(M.value),onPointerdown:d,onMouseenter:u,onMouseleave:m,onDblclick:r},[y.value?(n.openBlock(),n.createElementBlock("div",sw,[...Z[7]||(Z[7]=[n.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):n.createCommentVNode("",!0),n.createElementVNode("header",{class:"em-entity__header",style:n.normalizeStyle(V.value),onDblclick:n.withModifiers(Ie,["stop"])},[n.createElementVNode("button",{type:"button",class:"em-entity__caret nodrag",title:i(z.value?"em.panel.expand":"em.panel.collapse"),"aria-expanded":!z.value,disabled:!c.value,onClick:n.withModifiers(D,["stop"]),onPointerdown:Z[0]||(Z[0]=n.withModifiers(()=>{},["stop"])),onDblclick:Z[1]||(Z[1]=n.withModifiers(()=>{},["stop"]))},n.toDisplayString(z.value?"▸":"▾"),41,cw),n.createElementVNode("span",dw,"«"+n.toDisplayString(E.value.stereotype)+"»",1),he.value?n.withDirectives((n.openBlock(),n.createElementBlock("input",{key:0,ref_key:"inputEl",ref:Se,"onUpdate:modelValue":Z[2]||(Z[2]=te=>we.value=te),class:"em-entity__name-input nodrag",onKeyup:[n.withKeys(me,["enter"]),Z[3]||(Z[3]=n.withKeys(te=>he.value=!1,["esc"]))],onBlur:me,onPointerdown:Z[4]||(Z[4]=n.withModifiers(()=>{},["stop"]))},null,544)),[[n.vModelText,we.value]]):(n.openBlock(),n.createElementBlock("span",uw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ue.value,(te,v)=>(n.openBlock(),n.createElementBlock("span",{key:v,class:n.normalizeClass({"em-entity__missing":te.missing})},n.toDisplayString(te.text),3))),128))])),q.value?(n.openBlock(),n.createBlock($e,{key:2,name:"lock",size:12,class:"em-entity__lock",title:i("em.node.editLock")},null,8,["title"])):n.createCommentVNode("",!0)],36),z.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("ul",{key:1,ref_key:"attrsUl",ref:ye,class:"em-entity__attrs"},[ve.value&&ve.value.dropIndex>=0?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:n.normalizeStyle({top:`${ve.value.lineY}px`}),"aria-hidden":"true"},null,4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(E.value.attributes,te=>{var v,A,Y,N;return n.openBlock(),n.createElementBlock(n.Fragment,{key:te.modelId},[n.createElementVNode("li",{class:n.normalizeClass(["em-entity__row",{"is-attr-selected":k.value.has(te.modelId),"is-dragging":(v=ve.value)==null?void 0:v.ids.has(te.modelId),"is-embed":K(te),"is-divider":oe(te),nodrag:oe(te)&&c.value}]),"data-attr":te.modelId,onClick:n.withModifiers(U=>w(te,U),["stop"]),onPointerdown:U=>oe(te)?Te(te,U):void 0,onPointermove:U=>oe(te)?Ve(U):void 0,onPointerup:U=>oe(te)?Le():void 0,onPointercancel:U=>oe(te)?je():void 0},[c.value&&!oe(te)?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:U=>Te(te,U),onPointermove:Ve,onPointerup:Le,onPointercancel:je,onClick:Z[5]||(Z[5]=n.withModifiers(()=>{},["stop"]))},"⠿",40,fw)):n.createCommentVNode("",!0),oe(te)?(n.openBlock(),n.createElementBlock("span",pw,n.toDisplayString(te.name),1)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createVNode(n.unref(yn),{id:`l:${te.modelId}`,type:"target",position:n.unref(Ce).Left,class:"em-handle"},null,8,["id","position"]),n.createElementVNode("span",{class:"em-entity__keys",title:Q(B.value[te.modelId]),"aria-hidden":"true"},[n.createElementVNode("span",yw,[(A=B.value[te.modelId])!=null&&A.pk?(n.openBlock(),n.createBlock($e,{key:0,name:"key",size:12,class:"em-key is-pk"})):(Y=B.value[te.modelId])!=null&&Y.required?(n.openBlock(),n.createBlock($e,{key:1,name:"asterisk",size:14,class:"em-key is-required"})):n.createCommentVNode("",!0)]),n.createElementVNode("span",gw,[K(te)?(n.openBlock(),n.createBlock($e,{key:0,name:"table",size:11,class:"em-embed-glyph"})):(N=B.value[te.modelId])!=null&&N.fk?(n.openBlock(),n.createBlock($e,{key:1,name:"key",size:12,class:"em-key is-fk"})):n.createCommentVNode("",!0)])],8,hw),n.createElementVNode("span",{class:"em-entity__attrname",style:n.normalizeStyle({color:re(te)})},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(I(te),(U,O)=>(n.openBlock(),n.createElementBlock("span",{key:O,class:n.normalizeClass({"em-entity__missing":U.missing})},n.toDisplayString(U.text),3))),128))],4),ce(te)?(n.openBlock(),n.createElementBlock("span",bw,n.toDisplayString(ce(te)),1)):n.createCommentVNode("",!0),n.createVNode(n.unref(yn),{id:`r:${te.modelId}`,type:"source",position:n.unref(Ce).Right,class:"em-handle"},null,8,["id","position"])],64))],42,mw),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(K(te)&&$.value?pe(te):[],U=>(n.openBlock(),n.createElementBlock("li",{key:`${te.modelId}:${U.modelId}`,class:n.normalizeClass(["em-entity__embed-col",{"is-group-selected":k.value.has(te.modelId)}]),onClick:n.withModifiers(O=>w(te,O),["stop"])},[Z[8]||(Z[8]=n.createElementVNode("span",{class:"em-entity__embed-rail","aria-hidden":"true"},null,-1)),n.createElementVNode("span",kw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(fe(U),(O,le)=>(n.openBlock(),n.createElementBlock("span",{key:le,class:n.normalizeClass({"em-entity__missing":O.missing})},n.toDisplayString(O.text),3))),128))]),n.createElementVNode("span",Ew,n.toDisplayString(U.dataType),1)],10,_w))),128))],64)}),128))],512)),!z.value&&W.value?(n.openBlock(),n.createElementBlock("ul",{key:2,ref_key:"opsUl",ref:lt,class:"em-entity__ops"},[x.value&&x.value.dropIndex>=0?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:n.normalizeStyle({top:`${x.value.lineY}px`}),"aria-hidden":"true"},null,4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(_.value,te=>{var v;return n.openBlock(),n.createElementBlock("li",{key:te.modelId,class:n.normalizeClass(["em-entity__op-row",{"is-dragging":((v=x.value)==null?void 0:v.id)===te.modelId}]),"data-op":te.modelId},[c.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:A=>F(te,A),onPointermove:S,onPointerup:L,onPointercancel:P,onClick:Z[6]||(Z[6]=n.withModifiers(()=>{},["stop"]))},"⠿",40,Nw)):n.createCommentVNode("",!0),n.createElementVNode("span",vw,n.toDisplayString(J(te.visibility)),1),n.createElementVNode("span",{class:"em-entity__op-name",style:n.normalizeStyle({color:ee(te)})},n.toDisplayString(te.name)+"()",5)],10,ww)}),128))],512)):_.value.length?(n.openBlock(),n.createElementBlock("div",{key:3,class:"em-entity__ops-summary",title:i("em.node.opsSummaryTitle",{n:_.value.length})},[n.createVNode($e,{name:"method",size:12}),n.createElementVNode("span",null,n.toDisplayString(i("em.node.opsSummary",{n:_.value.length})),1)],8,xw)):n.createCommentVNode("",!0),c.value?(n.openBlock(),n.createElementBlock("footer",Cw,[n.createElementVNode("button",{type:"button",class:"em-entity__add nodrag",onClick:ge},n.toDisplayString(i("em.node.addAttr")),1),Z[9]||(Z[9]=n.createElementVNode("span",{class:"em-entity__footer-sep","aria-hidden":"true"},null,-1)),n.createElementVNode("button",{type:"button",class:"em-entity__add nodrag",onClick:ke},n.toDisplayString(i("em.node.addDivider")),1)])):n.createCommentVNode("",!0),c.value&&!he.value?(n.openBlock(),n.createElementBlock("div",{key:5,class:"em-entity__resize nodrag nopan",onPointerdown:ne,onPointermove:de,onPointerup:Ee},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-9d96e2df"]]),Iw={key:0,class:"em-sel","aria-hidden":"true"},Sw={class:"em-group__label"},$w={class:"em-group__name"},Rw={key:0,class:"em-group__pkg"},Aw={key:1,class:"em-group__flag"},Cu=Pe(n.defineComponent({__name:"GroupNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const t=e,o=n.computed(()=>t.data.group),i=n.computed(()=>t.data.locked??!1),a=n.computed(()=>it(t.data.style)),r=n.computed(()=>a.value?{"--em-group-fill":`color-mix(in srgb, var(--em-swatch-${a.value}-bar) 14%, transparent)`}:{}),l=n.inject(kn,null),s=(B,Q)=>l?l.t(B,Q):St("ko",B,Q),c=n.computed(()=>!!l&&l.editable.value),d=n.computed(()=>{var B;return!!t.id&&((B=l==null?void 0:l.selection.value)==null?void 0:B.kind)==="group"&&l.selection.value.id===t.id}),u=n.computed(()=>!!t.selected&&!d.value),m=n.inject(ra,null),p=n.computed(()=>!!t.id&&(m==null?void 0:m.value)===t.id),f=n.inject(Xn,null);function y(){t.id&&(f==null||f.setGroupHover(t.id))}function b(){f==null||f.setGroupHover(null)}const k=n.computed(()=>!!f&&f.hoverGroupId.value===t.id),g=n.computed(()=>!!f&&f.hoverGroupId.value!==null&&f.hoverGroupId.value!==t.id),{screenToFlowCoordinate:w,findNode:h}=Oe();let E=null,X=null;function z(B){var re;if(!t.id||!c.value)return;B.stopPropagation();const Q=((re=h(t.id))==null?void 0:re.dimensions)??{width:400,height:300},V=w({x:B.clientX,y:B.clientY});E={fx:V.x,fy:V.y,w:Q.width,h:Q.height},B.target.setPointerCapture(B.pointerId)}function q(B){if(!E||!t.id)return;const Q=w({x:B.clientX,y:B.clientY});X={width:Math.max(160,E.w+(Q.x-E.fx)),height:Math.max(120,E.h+(Q.y-E.fy))};const V=h(t.id);V&&(V.style={width:`${X.width}px`,height:`${X.height}px`})}function D(B){var Q,V;E&&X&&t.id&&l&&l.resizeGroup(t.id,X),E=null,X=null,(V=(Q=B.target).releasePointerCapture)==null||V.call(Q,B.pointerId)}const $=n.computed(()=>{const B=o.value.name;return(B==null?void 0:B.ko)||(B==null?void 0:B.en)||(B==null?void 0:B.ja)||(B==null?void 0:B.zh)||o.value.packageName||s("em.group.fallback")});return(B,Q)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-group",{"is-drop-target":p.value,"is-hover-origin":k.value,"is-dimmed":g.value,"is-selected":d.value,"is-multi-selected":u.value,"is-locked":i.value}]),style:n.normalizeStyle(r.value),onMouseenter:y,onMouseleave:b},[d.value?(n.openBlock(),n.createElementBlock("div",Iw,[...Q[0]||(Q[0]=[n.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):n.createCommentVNode("",!0),n.createElementVNode("div",Sw,[n.createElementVNode("span",$w,n.toDisplayString($.value),1),o.value.packageName?(n.openBlock(),n.createElementBlock("span",Rw,n.toDisplayString(o.value.packageName),1)):n.createCommentVNode("",!0),o.value.excludeDDLGeneration?(n.openBlock(),n.createElementBlock("span",Aw,n.toDisplayString(s("em.group.ddlExcludeBadge")),1)):n.createCommentVNode("",!0),i.value?(n.openBlock(),n.createBlock($e,{key:2,name:"lock",size:12,class:"em-group__lock",title:s("em.node.editLock")},null,8,["title"])):n.createCommentVNode("",!0)]),c.value&&!i.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"em-group__resize nodrag nopan",onPointerdown:z,onPointermove:q,onPointerup:D},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-9b95a9b6"]]),Tw={key:0,class:"em-sel","aria-hidden":"true"},Vw={key:2,class:"em-note__text"},Iu=Pe(n.defineComponent({__name:"NoteNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const t=e,o=n.inject(kn,null),i=n.inject(ra,null),a=n.inject(Xn,null),r=n.computed(()=>t.data.note),l=n.computed(()=>!!o&&o.editable.value),s=n.computed(()=>it(r.value.style)),c=n.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=t.data.groupRef??null)}function u(){a==null||a.setNoteHover(t.id)}function m(){a==null||a.setNoteHover(null)}const p=n.computed(()=>{var _;return((_=a==null?void 0:a.source.value)==null?void 0:_.kind)==="note"&&a.source.value.id===t.id}),f=n.computed(()=>!!a&&a.relatedNoteIds.value.has(t.id)&&!p.value),y=n.computed(()=>{var _;return((_=o==null?void 0:o.selection.value)==null?void 0:_.kind)==="note"&&o.selection.value.id===t.id}),b=n.computed(()=>!!t.selected&&!y.value),k=n.computed(()=>!!a&&a.active.value&&!a.relatedNoteIds.value.has(t.id)&&!y.value),g=[{id:"n-top",pos:Ce.Top},{id:"n-right",pos:Ce.Right},{id:"n-bottom",pos:Ce.Bottom},{id:"n-left",pos:Ce.Left}],w=n.ref(!1),h=n.ref(""),E=n.ref(null);async function X(){var _;l.value&&(h.value=r.value.memo,w.value=!0,await n.nextTick(),(_=E.value)==null||_.focus())}function z(){w.value&&(w.value=!1,h.value!==r.value.memo&&(o==null||o.setNoteMemo(t.id,h.value)))}const{screenToFlowCoordinate:q,findNode:D}=Oe();let $=null,B=null;function Q(_){var J;if(!l.value)return;_.stopPropagation();const W=((J=D(t.id))==null?void 0:J.dimensions)??r.value.geo.size,R=q({x:_.clientX,y:_.clientY});$={fx:R.x,fy:R.y,w:W.width,h:W.height},_.target.setPointerCapture(_.pointerId)}function V(_){if(!$)return;const W=q({x:_.clientX,y:_.clientY});B={width:Math.max(140,$.w+(W.x-$.fx)),height:Math.max(60,$.h+(W.y-$.fy))};const R=D(t.id);R&&(R.style={width:`${B.width}px`,height:`${B.height}px`})}function re(_){var W,R;$&&B&&o&&o.resizeNote(t.id,B),$=null,B=null,(R=(W=_.target).releasePointerCapture)==null||R.call(W,_.pointerId)}return(_,W)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-note",{"is-hover-origin":p.value,"is-related":f.value,"is-dimmed":k.value,"is-selected":y.value,"is-multi-selected":b.value}]),style:n.normalizeStyle(c.value),onDblclick:X,onPointerdown:d,onMouseenter:u,onMouseleave:m},[y.value?(n.openBlock(),n.createElementBlock("div",Tw,[...W[4]||(W[4]=[n.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):n.createCommentVNode("",!0),w.value?n.withDirectives((n.openBlock(),n.createElementBlock("textarea",{key:1,ref_key:"area",ref:E,"onUpdate:modelValue":W[0]||(W[0]=R=>h.value=R),class:"em-note__edit nodrag",onBlur:z,onKeydown:W[1]||(W[1]=n.withKeys(R=>w.value=!1,["esc"])),onPointerdown:W[2]||(W[2]=n.withModifiers(()=>{},["stop"]))},null,544)),[[n.vModelText,h.value]]):(n.openBlock(),n.createElementBlock("div",Vw,n.toDisplayString(r.value.memo),1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(g,R=>n.createVNode(n.unref(yn),{id:R.id,key:R.id,type:"source",position:R.pos,class:"em-note-handle",onPointerdown:W[3]||(W[3]=n.withModifiers(()=>{},["stop"]))},null,8,["id","position"])),64)),l.value&&!w.value?(n.openBlock(),n.createElementBlock("div",{key:3,class:"em-note__resize nodrag nopan",onPointerdown:Q,onPointermove:V,onPointerup:re},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-77c75add"]]),Mw=20,Bw=22,Dw=7,Ow=22,Su=31,$u=7,Pw=20,Ru=11,Au=11,Lw=Su+$u;function zw(e){return e==="NO_INSTANCE_OR_ONE_INSTANCE"||e==="ZERO_OR_MORE_INSTANCES"}function Uw(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function la(e,t,o){const i=t.x-e.x,a=t.y-e.y,r=Math.hypot(i,a)||1;return{x:e.x+i*o/r,y:e.y+a*o/r}}function Tu(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function sa(e,t,o){return{x:Math.cos(o)*t+e.x,y:Math.sin(o)*t+e.y}}function Vu(e,t,o,i){const a=i/2,r=e.x===t.x&&e.y===t.y?Math.PI/2:Tu(e,t);return[sa(o,a,r-Math.PI/2),sa(o,a,r+Math.PI/2)]}function Mu(e,t,o,i){const a=t*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 Bu(e,t,o,i){const a=[],r=[],l=[];if(e.x===t.x&&e.y===t.y)return{lines:a,circles:r,polygons:l};if(i==="db"){const c=la(e,t,Mw),[d,u]=Vu(e,t,c,Bw);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}),zw(o.multiplicity)){const m=la(e,t,Su);r.push({cx:m.x,cy:m.y,r:$u})}if(Uw(o.multiplicity)){const m=la(e,t,Dw),[p,f]=Vu(e,t,m,Ow);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=la(e,t,Pw),d={x:(e.x+c.x)/2,y:(e.y+c.y)/2},u=Tu(e,t),m=sa(d,Ru/2,u-Math.PI/2),p=sa(d,Ru/2,u+Math.PI/2);l.push({points:[e,m,c,p]}),s=c}if(o.navigable&&!o.otherNavigable){const c=Math.atan2(t.x-e.x,t.y-e.y),d=Mu(s,c,Au,!0),u=Mu(s,c,Au,!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 Du=200,Ou=120,Kr=24;function Pu(e){var a,r;if(!e)return{x:0,y:0,width:Du,height:Ou};const t=e.computedPosition??e.position??{x:0,y:0},o=((a=e.dimensions)==null?void 0:a.width)||Du,i=((r=e.dimensions)==null?void 0:r.height)||Ou;return{x:t.x,y:t.y,width:o,height:i}}function Lu(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function zu(e){const t=n.computed(()=>Pu(e.sourceNode())),o=n.computed(()=>Pu(e.targetNode())),i=n.computed(()=>{const d=e.sourceNode(),u=e.targetNode();return!!d&&!!u&&d.id===u.id}),a=n.computed(()=>{var f,y;const d=t.value,u=d.x+d.width;let m=((f=e.sourceRowY)==null?void 0:f.call(e))??d.y+d.height/3,p=((y=e.targetRowY)==null?void 0:y.call(e))??d.y+d.height*2/3;if(Math.abs(p-m)<Kr){const b=(m+p)/2;m=b-Kr/2,p=b+Kr/2}return{source:{x:u,y:m},target:{x:u,y:p}}}),r=n.computed(()=>e.waypoints()[0]??Lu(o.value)),l=n.computed(()=>{const d=e.waypoints();return d[d.length-1]??Lu(t.value)}),s=n.computed(()=>{var u;const d=(u=e.sourceRowY)==null?void 0:u.call(e);return d!=null?Va(t.value,d,r.value.x):Ta(t.value,r.value)}),c=n.computed(()=>{var u;const d=(u=e.targetRowY)==null?void 0:u.call(e);return d!=null?Va(o.value,d,l.value.x):Ta(o.value,l.value)});return{source:n.computed(()=>i.value?a.value.source:s.value.point),target:n.computed(()=>i.value?a.value.target:c.value.point),sourceSide:n.computed(()=>i.value?"right":s.value.side),targetSide:n.computed(()=>i.value?"right":c.value.side),isSelf:i}}const Yr=Symbol("waypointController"),Hw=["d"],Fw=["d"],Gw=["d"],jw=["x1","y1","x2","y2"],Kw=["cx","cy","r"],Yw=["x","y"],Ww=["x","y"],qw=["cx","cy","onDblclick"],Xw=["x","y","onPointerdown","onDblclick"],Uu=Pe(n.defineComponent({inheritAttrs:!1,__name:"AssociationEdge",props:{id:{},sourceY:{},targetY:{},sourceNode:{},targetNode:{},data:{}},setup(e){const t=e,{screenToFlowCoordinate:o}=Oe(),i=n.inject(Yr),a=n.inject(kn,null),r=n.computed(()=>!!a&&a.editable.value),l=n.inject(vu,null),s=n.inject(Xn,null),c=n.computed(()=>!!s&&s.relatedEdgeIds.value.has(t.id)),d=n.computed(()=>{var me;return((me=a==null?void 0:a.selection.value)==null?void 0:me.kind)==="association"&&a.selection.value.id===t.id}),u=n.computed(()=>!!s&&s.active.value&&!s.relatedEdgeIds.value.has(t.id)&&!d.value),m=n.computed(()=>{const me=l==null?void 0:l.value;if(!me||!a)return null;const ge=a.resolved.value.entities,ke=H=>{var C;return(C=ge.find(M=>M.entity.modelId===H))==null?void 0:C.groupRef},G=t.data.association;return ke(G.end1.entityRef)===me.groupId&&ke(G.end2.entityRef)===me.groupId?{dx:me.dx,dy:me.dy}:null}),p=n.computed(()=>(i==null?void 0:i.points(t.id))??[]),f=n.ref(-1),y=n.ref({x:0,y:0}),b=n.computed(()=>{const me=m.value;return p.value.map((ge,ke)=>ke===f.value?y.value:me?{x:ge.x+me.dx,y:ge.y+me.dy}:ge)}),k=n.computed(()=>{var me;return!!((me=t.sourceNode.data)!=null&&me.collapsed)}),g=n.computed(()=>{var me;return!!((me=t.targetNode.data)!=null&&me.collapsed)}),{source:w,target:h,sourceSide:E,targetSide:X,isSelf:z}=zu({sourceNode:()=>t.sourceNode,targetNode:()=>t.targetNode,waypoints:()=>b.value,sourceRowY:()=>t.data.sourceColumnRef&&!k.value?t.sourceY:void 0,targetRowY:()=>t.data.targetColumnRef&&!g.value?t.targetY:void 0}),q=Lw+4,D=n.computed(()=>z.value?El(w.value,h.value):(a==null?void 0:a.routingMode.value)==="orthogonal"?$a(w.value,E.value,b.value,h.value,X.value,q):Aa(w.value,b.value,h.value)),$=n.computed(()=>z.value||!r.value?[]:(a==null?void 0:a.routingMode.value)==="orthogonal"?Ra(w.value,E.value,b.value,h.value,X.value,q):Ma(w.value,b.value,h.value).map((me,ge)=>({point:me,segIndex:ge}))),B=n.computed(()=>z.value||!r.value?[]:b.value);function Q(me){switch(me){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 V(me,ge){f.value=me,y.value={...p.value[me]},ge.target.setPointerCapture(ge.pointerId),ge.stopPropagation()}function re(me){if(f.value<0)return;const ge=o({x:me.clientX,y:me.clientY});y.value={x:ge.x,y:ge.y}}function _(me){var ge,ke;f.value>=0&&i&&i.movePoint(t.id,f.value,{...y.value}),f.value=-1,(ke=(ge=me.target).releasePointerCapture)==null||ke.call(ge,me.pointerId)}function W(me,ge){ge.stopPropagation(),i==null||i.removePoint(t.id,me)}function R(me,ge){if(!i)return;const ke=o({x:ge.clientX,y:ge.clientY});i.insertPoint(t.id,me,{x:ke.x,y:ke.y})}const J=n.computed(()=>Q(t.data.association.end1.multiplicity)),ee=n.computed(()=>Q(t.data.association.end2.multiplicity)),ae=n.computed(()=>(a==null?void 0:a.displayMode.value)==="CLASS"?"class":"db"),I=n.computed(()=>ae.value==="class"),K=n.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const me=to(E.value);return{x:w.value.x+me.x*10,y:w.value.y+me.y*10}}return b.value[0]??h.value}),oe=n.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const ge=to(X.value);return{x:h.value.x+ge.x*10,y:h.value.y+ge.y*10}}const me=b.value;return me[me.length-1]??w.value}),pe=n.computed(()=>{const me=t.data.association;return{multiplicity:me.end1.multiplicity,navigable:me.end1.navigable,composition:me.end1.composition,otherNavigable:me.end2.navigable}}),fe=n.computed(()=>{const me=t.data.association;return{multiplicity:me.end2.multiplicity,navigable:me.end2.navigable,composition:me.end2.composition,otherNavigable:me.end1.navigable}}),ce=n.computed(()=>Bu(w.value,K.value,pe.value,ae.value)),ue=n.computed(()=>Bu(h.value,oe.value,fe.value,ae.value)),he=n.computed(()=>[...ce.value.lines,...ue.value.lines]),we=n.computed(()=>[...ce.value.circles,...ue.value.circles]),Se=n.computed(()=>[...ce.value.polygons,...ue.value.polygons].map(me=>`M${me.points.map(ge=>`${ge.x},${ge.y}`).join(" L")} Z`)),Ie=n.computed(()=>({"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}));return(me,ge)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",{d:D.value,fill:"none",class:"em-edge__hit"},null,8,Hw),n.createElementVNode("path",{d:D.value,fill:"none","stroke-width":"1.5",class:n.normalizeClass(["em-edge__path",{"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}])},null,10,Fw),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Se.value,(ke,G)=>(n.openBlock(),n.createElementBlock("path",{key:`mpoly-${G}`,d:ke,class:n.normalizeClass(["em-edge__marker em-edge__marker--fill",Ie.value])},null,10,Gw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(he.value,(ke,G)=>(n.openBlock(),n.createElementBlock("line",{key:`mline-${G}`,x1:ke.x1,y1:ke.y1,x2:ke.x2,y2:ke.y2,class:n.normalizeClass(["em-edge__marker",Ie.value])},null,10,jw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(we.value,(ke,G)=>(n.openBlock(),n.createElementBlock("circle",{key:`mcirc-${G}`,cx:ke.cx,cy:ke.cy,r:ke.r,class:n.normalizeClass(["em-edge__marker",Ie.value])},null,10,Kw))),128)),I.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("text",{x:n.unref(w).x+8,y:n.unref(w).y-6,class:n.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},n.toDisplayString(J.value),11,Yw),n.createElementVNode("text",{x:n.unref(h).x-8,y:n.unref(h).y-6,"text-anchor":"end",class:n.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},n.toDisplayString(ee.value),11,Ww)],64)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList($.value,(ke,G)=>(n.openBlock(),n.createElementBlock("circle",{key:`mid-${G}`,cx:ke.point.x,cy:ke.point.y,r:"4",class:n.normalizeClass(["em-edge__mid",{"is-dimmed":u.value}]),onDblclick:n.withModifiers(H=>R(ke.segIndex,H),["stop"])},null,42,qw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(B.value,(ke,G)=>(n.openBlock(),n.createElementBlock("rect",{key:`wp-${G}`,x:ke.x-5,y:ke.y-5,width:"10",height:"10",rx:"2",class:n.normalizeClass(["em-edge__waypoint",{"is-dimmed":u.value}]),onPointerdown:H=>V(G,H),onPointermove:re,onPointerup:_,onDblclick:H=>W(G,H)},null,42,Xw))),128))],64))}}),[["__scopeId","data-v-208ecd02"]]);var Lt=(e=>(e.Lines="lines",e.Dots="dots",e))(Lt||{});const Hu=function({dimensions:e,size:t,color:o}){return n.h("path",{stroke:o,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},Fu=function({radius:e,color:t}){return n.h("circle",{cx:e,cy:e,r:e,fill:t})};Lt.Lines+"",Lt.Dots+"";const Jw={[Lt.Dots]:"#81818a",[Lt.Lines]:"#eee"},Zw=["id","x","y","width","height","patternTransform"],Qw={key:2,height:"100",width:"100"},eN=["fill"],tN=["x","y","fill"],nN={name:"Background",compatConfig:{MODE:3}},oN=n.defineComponent({...nN,props:{id:{},variant:{default:()=>Lt.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:t,viewport:o}=Oe(),i=n.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=n.toRef(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),r=n.toRef(()=>e.color||e.patternColor||Jw[e.variant||Lt.Dots]);return(l,s)=>(n.openBlock(),n.createElementBlock("svg",{class:"vue-flow__background vue-flow__container",style:n.normalizeStyle({height:`${l.height>100?100:l.height}%`,width:`${l.width>100?100:l.width}%`})},[n.renderSlot(l.$slots,"pattern-container",{id:a.value},()=>[n.createElementVNode("pattern",{id:a.value,x:n.unref(o).x%i.value.scaledGap[0],y:n.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"},[n.renderSlot(l.$slots,"pattern",{},()=>[l.variant===n.unref(Lt).Lines?(n.openBlock(),n.createBlock(n.unref(Hu),{key:0,size:l.lineWidth,color:r.value,dimensions:i.value.scaledGap},null,8,["size","color","dimensions"])):l.variant===n.unref(Lt).Dots?(n.openBlock(),n.createBlock(n.unref(Fu),{key:1,color:r.value,radius:i.value.size/2},null,8,["color","radius"])):n.createCommentVNode("",!0),l.bgColor?(n.openBlock(),n.createElementBlock("svg",Qw,[n.createElementVNode("rect",{width:"100%",height:"100%",fill:l.bgColor},null,8,eN)])):n.createCommentVNode("",!0)])],8,Zw)]),n.createElementVNode("rect",{x:l.x,y:l.y,width:"100%",height:"100%",fill:`url(#${a.value})`},null,8,tN),n.renderSlot(l.$slots,"default",{id:a.value})],4))}}),iN={name:"ControlButton",compatConfig:{MODE:3}},aN=(e,t)=>{const o=e.__vccOpts||e;for(const[i,a]of t)o[i]=a;return o},rN={type:"button",class:"vue-flow__controls-button"};function lN(e,t,o,i,a,r){return n.openBlock(),n.createElementBlock("button",rN,[n.renderSlot(e.$slots,"default")])}const En=aN(iN,[["render",lN]]),sN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},cN=[n.createElementVNode("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function dN(e,t){return n.openBlock(),n.createElementBlock("svg",sN,cN)}const uN={render:dN},mN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},fN=[n.createElementVNode("path",{d:"M0 0h32v4.2H0z"},null,-1)];function pN(e,t){return n.openBlock(),n.createElementBlock("svg",mN,fN)}const hN={render:pN},yN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},gN=[n.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 bN(e,t){return n.openBlock(),n.createElementBlock("svg",yN,gN)}const _N={render:bN},kN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},EN=[n.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 wN(e,t){return n.openBlock(),n.createElementBlock("svg",kN,EN)}const NN={render:wN},vN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},xN=[n.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 CN(e,t){return n.openBlock(),n.createElementBlock("svg",vN,xN)}const IN={render:CN},SN={name:"Controls",compatConfig:{MODE:3}},$N=n.defineComponent({...SN,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>ud.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:o,nodesConnectable:i,elementsSelectable:a,setInteractive:r,zoomIn:l,zoomOut:s,fitView:c,viewport:d,minZoom:u,maxZoom:m}=Oe(),p=n.toRef(()=>o.value||i.value||a.value),f=n.toRef(()=>d.value.zoom<=u.value),y=n.toRef(()=>d.value.zoom>=m.value);function b(){l(),t("zoomIn")}function k(){s(),t("zoomOut")}function g(){c(e.fitViewParams),t("fitView")}function w(){r(!p.value),t("interactionChange",!p.value)}return(h,E)=>(n.openBlock(),n.createBlock(n.unref(cu),{class:"vue-flow__controls",position:h.position},{default:n.withCtx(()=>[n.renderSlot(h.$slots,"top"),h.showZoom?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.renderSlot(h.$slots,"control-zoom-in",{},()=>[n.createVNode(En,{class:"vue-flow__controls-zoomin",disabled:y.value,onClick:b},{default:n.withCtx(()=>[n.renderSlot(h.$slots,"icon-zoom-in",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(uN))))])]),_:3},8,["disabled"])]),n.renderSlot(h.$slots,"control-zoom-out",{},()=>[n.createVNode(En,{class:"vue-flow__controls-zoomout",disabled:f.value,onClick:k},{default:n.withCtx(()=>[n.renderSlot(h.$slots,"icon-zoom-out",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(hN))))])]),_:3},8,["disabled"])])],64)):n.createCommentVNode("",!0),h.showFitView?n.renderSlot(h.$slots,"control-fit-view",{key:1},()=>[n.createVNode(En,{class:"vue-flow__controls-fitview",onClick:g},{default:n.withCtx(()=>[n.renderSlot(h.$slots,"icon-fit-view",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(_N))))])]),_:3})]):n.createCommentVNode("",!0),h.showInteractive?n.renderSlot(h.$slots,"control-interactive",{key:2},()=>[h.showInteractive?(n.openBlock(),n.createBlock(En,{key:0,class:"vue-flow__controls-interactive",onClick:w},{default:n.withCtx(()=>[p.value?n.renderSlot(h.$slots,"icon-unlock",{key:0},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(IN))))]):n.createCommentVNode("",!0),p.value?n.createCommentVNode("",!0):n.renderSlot(h.$slots,"icon-lock",{key:1},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(NN))))])]),_:3})):n.createCommentVNode("",!0)]):n.createCommentVNode("",!0),n.renderSlot(h.$slots,"default")]),_:3},8,["position"]))}});var RN={value:()=>{}};function Wr(){for(var e=0,t=arguments.length,o={},i;e<t;++e){if(!(i=arguments[e]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new ca(o)}function ca(e){this._=e}function AN(e,t){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&&!t.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}ca.prototype=Wr.prototype={constructor:ca,on:function(e,t){var o=this._,i=AN(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=TN(o[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<l;)if(a=(e=i[r]).type)o[a]=Gu(o[a],e.name,t);else if(t==null)for(a in o)o[a]=Gu(o[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var o in t)e[o]=t[o].slice();return new ca(e)},call:function(e,t){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(t,o)},apply:function(e,t,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(t,o)}};function TN(e,t){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===t)return a.value}function Gu(e,t,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=RN,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:t,value:o}),e}var qr="http://www.w3.org/1999/xhtml";const ju={svg:"http://www.w3.org/2000/svg",xhtml:qr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function da(e){var t=e+="",o=t.indexOf(":");return o>=0&&(t=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),ju.hasOwnProperty(t)?{space:ju[t],local:e}:e}function VN(e){return function(){var t=this.ownerDocument,o=this.namespaceURI;return o===qr&&t.documentElement.namespaceURI===qr?t.createElement(e):t.createElementNS(o,e)}}function MN(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ku(e){var t=da(e);return(t.local?MN:VN)(t)}function BN(){}function Xr(e){return e==null?BN:function(){return this.querySelector(e)}}function DN(e){typeof e!="function"&&(e=Xr(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 mt(i,this._parents)}function ON(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function PN(){return[]}function Yu(e){return e==null?PN:function(){return this.querySelectorAll(e)}}function LN(e){return function(){return ON(e.apply(this,arguments))}}function zN(e){typeof e=="function"?e=LN(e):e=Yu(e);for(var t=this._groups,o=t.length,i=[],a=[],r=0;r<o;++r)for(var l=t[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 mt(i,a)}function Wu(e){return function(){return this.matches(e)}}function qu(e){return function(t){return t.matches(e)}}var UN=Array.prototype.find;function HN(e){return function(){return UN.call(this.children,e)}}function FN(){return this.firstElementChild}function GN(e){return this.select(e==null?FN:HN(typeof e=="function"?e:qu(e)))}var jN=Array.prototype.filter;function KN(){return Array.from(this.children)}function YN(e){return function(){return jN.call(this.children,e)}}function WN(e){return this.selectAll(e==null?KN:YN(typeof e=="function"?e:qu(e)))}function qN(e){typeof e!="function"&&(e=Wu(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 mt(i,this._parents)}function Xu(e){return new Array(e.length)}function XN(){return new mt(this._enter||this._groups.map(Xu),this._parents)}function ua(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ua.prototype={constructor:ua,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function JN(e){return function(){return e}}function ZN(e,t,o,i,a,r){for(var l=0,s,c=t.length,d=r.length;l<d;++l)(s=t[l])?(s.__data__=r[l],i[l]=s):o[l]=new ua(e,r[l]);for(;l<c;++l)(s=t[l])&&(a[l]=s)}function QN(e,t,o,i,a,r,l){var s,c,d=new Map,u=t.length,m=r.length,p=new Array(u),f;for(s=0;s<u;++s)(c=t[s])&&(p[s]=f=l.call(c,c.__data__,s,t)+"",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 ua(e,r[s]);for(s=0;s<u;++s)(c=t[s])&&d.get(p[s])===c&&(a[s]=c)}function ev(e){return e.__data__}function tv(e,t){if(!arguments.length)return Array.from(this,ev);var o=t?QN:ZN,i=this._parents,a=this._groups;typeof e!="function"&&(e=JN(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=nv(e.call(u,u&&u.__data__,d,i)),y=f.length,b=s[d]=new Array(y),k=l[d]=new Array(y),g=c[d]=new Array(p);o(u,m,b,k,g,f,t);for(var w=0,h=0,E,X;w<y;++w)if(E=b[w]){for(w>=h&&(h=w+1);!(X=k[h])&&++h<y;);E._next=X||null}}return l=new mt(l,i),l._enter=s,l._exit=c,l}function nv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ov(){return new mt(this._exit||this._groups.map(Xu),this._parents)}function iv(e,t,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+""),t!=null&&(a=t(a),a&&(a=a.selection())),o==null?r.remove():o(r),i&&a?i.merge(a).order():a}function av(e){for(var t=e.selection?e.selection():e,o=this._groups,i=t._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,y=0;y<m;++y)(f=d[y]||u[y])&&(p[y]=f);for(;c<a;++c)s[c]=o[c];return new mt(s,this._parents)}function rv(){for(var e=this._groups,t=-1,o=e.length;++t<o;)for(var i=e[t],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 lv(e){e||(e=sv);function t(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(t)}return new mt(a,this._parents).order()}function sv(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function cv(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function dv(){return Array.from(this)}function uv(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,r=i.length;a<r;++a){var l=i[a];if(l)return l}return null}function mv(){let e=0;for(const t of this)++e;return e}function fv(){return!this.node()}function pv(e){for(var t=this._groups,o=0,i=t.length;o<i;++o)for(var a=t[o],r=0,l=a.length,s;r<l;++r)(s=a[r])&&e.call(s,s.__data__,r,a);return this}function hv(e){return function(){this.removeAttribute(e)}}function yv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gv(e,t){return function(){this.setAttribute(e,t)}}function bv(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function _v(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function kv(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,o)}}function Ev(e,t){var o=da(e);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((t==null?o.local?yv:hv:typeof t=="function"?o.local?kv:_v:o.local?bv:gv)(o,t))}function Ju(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function wv(e){return function(){this.style.removeProperty(e)}}function Nv(e,t,o){return function(){this.style.setProperty(e,t,o)}}function vv(e,t,o){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function xv(e,t,o){return arguments.length>1?this.each((t==null?wv:typeof t=="function"?vv:Nv)(e,t,o??"")):Jn(this.node(),e)}function Jn(e,t){return e.style.getPropertyValue(t)||Ju(e).getComputedStyle(e,null).getPropertyValue(t)}function Cv(e){return function(){delete this[e]}}function Iv(e,t){return function(){this[e]=t}}function Sv(e,t){return function(){var o=t.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function $v(e,t){return arguments.length>1?this.each((t==null?Cv:typeof t=="function"?Sv:Iv)(e,t)):this.node()[e]}function Zu(e){return e.trim().split(/^|\s+/)}function Jr(e){return e.classList||new Qu(e)}function Qu(e){this._node=e,this._names=Zu(e.getAttribute("class")||"")}Qu.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function em(e,t){for(var o=Jr(e),i=-1,a=t.length;++i<a;)o.add(t[i])}function tm(e,t){for(var o=Jr(e),i=-1,a=t.length;++i<a;)o.remove(t[i])}function Rv(e){return function(){em(this,e)}}function Av(e){return function(){tm(this,e)}}function Tv(e,t){return function(){(t.apply(this,arguments)?em:tm)(this,e)}}function Vv(e,t){var o=Zu(e+"");if(arguments.length<2){for(var i=Jr(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof t=="function"?Tv:t?Rv:Av)(o,t))}function Mv(){this.textContent=""}function Bv(e){return function(){this.textContent=e}}function Dv(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ov(e){return arguments.length?this.each(e==null?Mv:(typeof e=="function"?Dv:Bv)(e)):this.node().textContent}function Pv(){this.innerHTML=""}function Lv(e){return function(){this.innerHTML=e}}function zv(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Uv(e){return arguments.length?this.each(e==null?Pv:(typeof e=="function"?zv:Lv)(e)):this.node().innerHTML}function Hv(){this.nextSibling&&this.parentNode.appendChild(this)}function Fv(){return this.each(Hv)}function Gv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jv(){return this.each(Gv)}function Kv(e){var t=typeof e=="function"?e:Ku(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Yv(){return null}function Wv(e,t){var o=typeof e=="function"?e:Ku(e),i=t==null?Yv:typeof t=="function"?t:Xr(t);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function qv(){var e=this.parentNode;e&&e.removeChild(this)}function Xv(){return this.each(qv)}function Jv(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Zv(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qv(e){return this.select(e?Zv:Jv)}function ex(e){return arguments.length?this.property("__data__",e):this.node().__data__}function tx(e){return function(t){e.call(this,t,this.__data__)}}function nx(e){return e.trim().split(/^|\s+/).map(function(t){var o="",i=t.indexOf(".");return i>=0&&(o=t.slice(i+1),t=t.slice(0,i)),{type:t,name:o}})}function ox(e){return function(){var t=this.__on;if(t){for(var o=0,i=-1,a=t.length,r;o<a;++o)r=t[o],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++i]=r;++i?t.length=i:delete this.__on}}}function ix(e,t,o){return function(){var i=this.__on,a,r=tx(t);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=t;return}}this.addEventListener(e.type,r,o),a={type:e.type,name:e.name,value:t,listener:r,options:o},i?i.push(a):this.__on=[a]}}function ax(e,t,o){var i=nx(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=t?ix:ox,a=0;a<r;++a)this.each(s(i[a],t,o));return this}function nm(e,t,o){var i=Ju(e),a=i.CustomEvent;typeof a=="function"?a=new a(t,o):(a=i.document.createEvent("Event"),o?(a.initEvent(t,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function rx(e,t){return function(){return nm(this,e,t)}}function lx(e,t){return function(){return nm(this,e,t.apply(this,arguments))}}function sx(e,t){return this.each((typeof t=="function"?lx:rx)(e,t))}function*cx(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,r=i.length,l;a<r;++a)(l=i[a])&&(yield l)}var om=[null];function mt(e,t){this._groups=e,this._parents=t}function Bo(){return new mt([[document.documentElement]],om)}function dx(){return this}mt.prototype=Bo.prototype={constructor:mt,select:DN,selectAll:zN,selectChild:GN,selectChildren:WN,filter:qN,data:tv,enter:XN,exit:ov,join:iv,merge:av,selection:dx,order:rv,sort:lv,call:cv,nodes:dv,node:uv,size:mv,empty:fv,each:pv,attr:Ev,style:xv,property:$v,classed:Vv,text:Ov,html:Uv,raise:Fv,lower:jv,append:Kv,insert:Wv,remove:Xv,clone:Qv,datum:ex,on:ax,dispatch:sx,[Symbol.iterator]:cx};function Xt(e){return typeof e=="string"?new mt([[document.querySelector(e)]],[document.documentElement]):new mt([[e]],om)}function ux(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Jt(e,t){if(e=ux(e),t===void 0&&(t=e.currentTarget),t){var o=t.ownerSVGElement||t;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const Zr={capture:!0,passive:!1};function Qr(e){e.preventDefault(),e.stopImmediatePropagation()}function mx(e){var t=e.document.documentElement,o=Xt(e).on("dragstart.drag",Qr,Zr);"onselectstart"in t?o.on("selectstart.drag",Qr,Zr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function fx(e,t){var o=e.document.documentElement,i=Xt(e).on("dragstart.drag",null);t&&(i.on("click.drag",Qr,Zr),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 el(e,t,o){e.prototype=t.prototype=o,o.constructor=e}function im(e,t){var o=Object.create(e.prototype);for(var i in t)o[i]=t[i];return o}function Do(){}var Oo=.7,ma=1/Oo,Zn="\\s*([+-]?\\d+)\\s*",Po="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",$t="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",px=/^#([0-9a-f]{3,8})$/,hx=new RegExp(`^rgb\\(${Zn},${Zn},${Zn}\\)$`),yx=new RegExp(`^rgb\\(${$t},${$t},${$t}\\)$`),gx=new RegExp(`^rgba\\(${Zn},${Zn},${Zn},${Po}\\)$`),bx=new RegExp(`^rgba\\(${$t},${$t},${$t},${Po}\\)$`),_x=new RegExp(`^hsl\\(${Po},${$t},${$t}\\)$`),kx=new RegExp(`^hsla\\(${Po},${$t},${$t},${Po}\\)$`),am={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};el(Do,Lo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:rm,formatHex:rm,formatHex8:Ex,formatHsl:wx,formatRgb:lm,toString:lm});function rm(){return this.rgb().formatHex()}function Ex(){return this.rgb().formatHex8()}function wx(){return mm(this).formatHsl()}function lm(){return this.rgb().formatRgb()}function Lo(e){var t,o;return e=(e+"").trim().toLowerCase(),(t=px.exec(e))?(o=t[1].length,t=parseInt(t[1],16),o===6?sm(t):o===3?new ct(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):o===8?fa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):o===4?fa(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=hx.exec(e))?new ct(t[1],t[2],t[3],1):(t=yx.exec(e))?new ct(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gx.exec(e))?fa(t[1],t[2],t[3],t[4]):(t=bx.exec(e))?fa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_x.exec(e))?um(t[1],t[2]/100,t[3]/100,1):(t=kx.exec(e))?um(t[1],t[2]/100,t[3]/100,t[4]):am.hasOwnProperty(e)?sm(am[e]):e==="transparent"?new ct(NaN,NaN,NaN,0):null}function sm(e){return new ct(e>>16&255,e>>8&255,e&255,1)}function fa(e,t,o,i){return i<=0&&(e=t=o=NaN),new ct(e,t,o,i)}function Nx(e){return e instanceof Do||(e=Lo(e)),e?(e=e.rgb(),new ct(e.r,e.g,e.b,e.opacity)):new ct}function tl(e,t,o,i){return arguments.length===1?Nx(e):new ct(e,t,o,i??1)}function ct(e,t,o,i){this.r=+e,this.g=+t,this.b=+o,this.opacity=+i}el(ct,tl,im(Do,{brighter(e){return e=e==null?ma:Math.pow(ma,e),new ct(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Oo:Math.pow(Oo,e),new ct(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ct(wn(this.r),wn(this.g),wn(this.b),pa(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:cm,formatHex:cm,formatHex8:vx,formatRgb:dm,toString:dm}));function cm(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}`}function vx(){return`#${Nn(this.r)}${Nn(this.g)}${Nn(this.b)}${Nn((isNaN(this.opacity)?1:this.opacity)*255)}`}function dm(){const e=pa(this.opacity);return`${e===1?"rgb(":"rgba("}${wn(this.r)}, ${wn(this.g)}, ${wn(this.b)}${e===1?")":`, ${e})`}`}function pa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function wn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Nn(e){return e=wn(e),(e<16?"0":"")+e.toString(16)}function um(e,t,o,i){return i<=0?e=t=o=NaN:o<=0||o>=1?e=t=NaN:t<=0&&(e=NaN),new bt(e,t,o,i)}function mm(e){if(e instanceof bt)return new bt(e.h,e.s,e.l,e.opacity);if(e instanceof Do||(e=Lo(e)),!e)return new bt;if(e instanceof bt)return e;e=e.rgb();var t=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(t,o,i),r=Math.max(t,o,i),l=NaN,s=r-a,c=(r+a)/2;return s?(t===r?l=(o-i)/s+(o<i)*6:o===r?l=(i-t)/s+2:l=(t-o)/s+4,s/=c<.5?r+a:2-r-a,l*=60):s=c>0&&c<1?0:l,new bt(l,s,c,e.opacity)}function xx(e,t,o,i){return arguments.length===1?mm(e):new bt(e,t,o,i??1)}function bt(e,t,o,i){this.h=+e,this.s=+t,this.l=+o,this.opacity=+i}el(bt,xx,im(Do,{brighter(e){return e=e==null?ma:Math.pow(ma,e),new bt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Oo:Math.pow(Oo,e),new bt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,i=o+(o<.5?o:1-o)*t,a=2*o-i;return new ct(nl(e>=240?e-240:e+120,a,i),nl(e,a,i),nl(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new bt(fm(this.h),ha(this.s),ha(this.l),pa(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=pa(this.opacity);return`${e===1?"hsl(":"hsla("}${fm(this.h)}, ${ha(this.s)*100}%, ${ha(this.l)*100}%${e===1?")":`, ${e})`}`}}));function fm(e){return e=(e||0)%360,e<0?e+360:e}function ha(e){return Math.max(0,Math.min(1,e||0))}function nl(e,t,o){return(e<60?t+(o-t)*e/60:e<180?o:e<240?t+(o-t)*(240-e)/60:t)*255}const pm=e=>()=>e;function Cx(e,t){return function(o){return e+o*t}}function Ix(e,t,o){return e=Math.pow(e,o),t=Math.pow(t,o)-e,o=1/o,function(i){return Math.pow(e+i*t,o)}}function Sx(e){return(e=+e)==1?hm:function(t,o){return o-t?Ix(t,o,e):pm(isNaN(t)?o:t)}}function hm(e,t){var o=t-e;return o?Cx(e,o):pm(isNaN(e)?t:e)}const ym=(function e(t){var o=Sx(t);function i(a,r){var l=o((a=tl(a)).r,(r=tl(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=hm(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 Zt(e,t){return e=+e,t=+t,function(o){return e*(1-o)+t*o}}var ol=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,il=new RegExp(ol.source,"g");function $x(e){return function(){return e}}function Rx(e){return function(t){return e(t)+""}}function Ax(e,t){var o=ol.lastIndex=il.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",t=t+"";(i=ol.exec(e))&&(a=il.exec(t));)(r=a.index)>o&&(r=t.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:Zt(i,a)})),o=il.lastIndex;return o<t.length&&(r=t.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?Rx(c[0].x):$x(t):(t=c.length,function(d){for(var u=0,m;u<t;++u)s[(m=c[u]).i]=m.x(d);return s.join("")})}var gm=180/Math.PI,al={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function bm(e,t,o,i,a,r){var l,s,c;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(c=e*o+t*i)&&(o-=e*c,i-=t*c),(s=Math.sqrt(o*o+i*i))&&(o/=s,i/=s,c/=s),e*i<t*o&&(e=-e,t=-t,c=-c,l=-l),{translateX:a,translateY:r,rotate:Math.atan2(t,e)*gm,skewX:Math.atan(c)*gm,scaleX:l,scaleY:s}}var ya;function Tx(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?al:bm(t.a,t.b,t.c,t.d,t.e,t.f)}function Vx(e){return e==null||(ya||(ya=document.createElementNS("http://www.w3.org/2000/svg","g")),ya.setAttribute("transform",e),!(e=ya.transform.baseVal.consolidate()))?al:(e=e.matrix,bm(e.a,e.b,e.c,e.d,e.e,e.f))}function _m(e,t,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,p,f,y){if(d!==m||u!==p){var b=f.push("translate(",null,t,null,o);y.push({i:b-4,x:Zt(d,m)},{i:b-2,x:Zt(u,p)})}else(m||p)&&f.push("translate("+m+t+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:Zt(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:Zt(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,p,f,y){if(d!==m||u!==p){var b=f.push(a(f)+"scale(",null,",",null,")");y.push({i:b-4,x:Zt(d,m)},{i:b-2,x:Zt(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 y=-1,b=p.length,k;++y<b;)m[(k=p[y]).i]=k.x(f);return m.join("")}}}var Mx=_m(Tx,"px, ","px)","deg)"),Bx=_m(Vx,", ",")",")"),Dx=1e-12;function km(e){return((e=Math.exp(e))+1/e)/2}function Ox(e){return((e=Math.exp(e))-1/e)/2}function Px(e){return((e=Math.exp(2*e))-1)/(e+1)}const Lx=(function e(t,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,y=m-c,b=f*f+y*y,k,g;if(b<Dx)g=Math.log(p/d)/t,k=function(q){return[s+q*f,c+q*y,d*Math.exp(t*q*g)]};else{var w=Math.sqrt(b),h=(p*p-d*d+i*b)/(2*d*o*w),E=(p*p-d*d-i*b)/(2*p*o*w),X=Math.log(Math.sqrt(h*h+1)-h),z=Math.log(Math.sqrt(E*E+1)-E);g=(z-X)/t,k=function(q){var D=q*g,$=km(X),B=d/(o*w)*($*Px(t*D+X)-Ox(X));return[s+B*f,c+B*y,d*$/km(t*D+X)]}}return k.duration=g*1e3*t/Math.SQRT2,k}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 Qn=0,zo=0,Uo=0,Em=1e3,ga,Ho,ba=0,vn=0,_a=0,Fo=typeof performance=="object"&&performance.now?performance:Date,wm=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function rl(){return vn||(wm(zx),vn=Fo.now()+_a)}function zx(){vn=0}function ka(){this._call=this._time=this._next=null}ka.prototype=Nm.prototype={constructor:ka,restart:function(e,t,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?rl():+o)+(t==null?0:+t),!this._next&&Ho!==this&&(Ho?Ho._next=this:ga=this,Ho=this),this._call=e,this._time=o,ll()},stop:function(){this._call&&(this._call=null,this._time=1/0,ll())}};function Nm(e,t,o){var i=new ka;return i.restart(e,t,o),i}function Ux(){rl(),++Qn;for(var e=ga,t;e;)(t=vn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Qn}function vm(){vn=(ba=Fo.now())+_a,Qn=zo=0;try{Ux()}finally{Qn=0,Fx(),vn=0}}function Hx(){var e=Fo.now(),t=e-ba;t>Em&&(_a-=t,ba=e)}function Fx(){for(var e,t=ga,o,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(o=t._next,t._next=null,t=e?e._next=o:ga=o);Ho=e,ll(i)}function ll(e){if(!Qn){zo&&(zo=clearTimeout(zo));var t=e-vn;t>24?(e<1/0&&(zo=setTimeout(vm,e-Fo.now()-_a)),Uo&&(Uo=clearInterval(Uo))):(Uo||(ba=Fo.now(),Uo=setInterval(Hx,Em)),Qn=1,wm(vm))}}function xm(e,t,o){var i=new ka;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,o),i}var Gx=Wr("start","end","cancel","interrupt"),jx=[],Cm=0,Im=1,sl=2,Ea=3,Sm=4,cl=5,wa=6;function Na(e,t,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;Kx(e,o,{name:t,index:i,group:a,on:Gx,tween:jx,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:Cm})}function dl(e,t){var o=_t(e,t);if(o.state>Cm)throw new Error("too late; already scheduled");return o}function Rt(e,t){var o=_t(e,t);if(o.state>Ea)throw new Error("too late; already running");return o}function _t(e,t){var o=e.__transition;if(!o||!(o=o[t]))throw new Error("transition not found");return o}function Kx(e,t,o){var i=e.__transition,a;i[t]=o,o.timer=Nm(r,0,o.time);function r(d){o.state=Im,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!==Im)return c();for(u in i)if(f=i[u],f.name===o.name){if(f.state===Ea)return xm(l);f.state===Sm?(f.state=wa,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=wa,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(xm(function(){o.state===Ea&&(o.state=Sm,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=sl,o.on.call("start",e,e.__data__,o.index,o.group),o.state===sl){for(o.state=Ea,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=cl,1),m=-1,p=a.length;++m<p;)a[m].call(e,u);o.state===cl&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=wa,o.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function va(e,t){var o=e.__transition,i,a,r=!0,l;if(o){t=t==null?null:t+"";for(l in o){if((i=o[l]).name!==t){r=!1;continue}a=i.state>sl&&i.state<cl,i.state=wa,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function Yx(e){return this.each(function(){va(this,e)})}function Wx(e,t){var o,i;return function(){var a=Rt(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===t){i=i.slice(),i.splice(l,1);break}}a.tween=i}}function qx(e,t,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=Rt(this,e),l=r.tween;if(l!==i){a=(i=l).slice();for(var s={name:t,value:o},c=0,d=a.length;c<d;++c)if(a[c].name===t){a[c]=s;break}c===d&&a.push(s)}r.tween=a}}function Xx(e,t){var o=this._id;if(e+="",arguments.length<2){for(var i=_t(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((t==null?Wx:qx)(o,e,t))}function ul(e,t,o){var i=e._id;return e.each(function(){var a=Rt(this,i);(a.value||(a.value={}))[t]=o.apply(this,arguments)}),function(a){return _t(a,i).value[t]}}function $m(e,t){var o;return(typeof t=="number"?Zt:t instanceof Lo?ym:(o=Lo(t))?(t=o,ym):Ax)(e,t)}function Jx(e){return function(){this.removeAttribute(e)}}function Zx(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qx(e,t,o){var i,a=o+"",r;return function(){var l=this.getAttribute(e);return l===a?null:l===i?r:r=t(i=l,o)}}function eC(e,t,o){var i,a=o+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===i?r:r=t(i=l,o)}}function tC(e,t,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=t(i=l,s)))}}function nC(e,t,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=t(i=l,s)))}}function oC(e,t){var o=da(e),i=o==="transform"?Bx:$m;return this.attrTween(e,typeof t=="function"?(o.local?nC:tC)(o,i,ul(this,"attr."+e,t)):t==null?(o.local?Zx:Jx)(o):(o.local?eC:Qx)(o,i,t))}function iC(e,t){return function(o){this.setAttribute(e,t.call(this,o))}}function aC(e,t){return function(o){this.setAttributeNS(e.space,e.local,t.call(this,o))}}function rC(e,t){var o,i;function a(){var r=t.apply(this,arguments);return r!==i&&(o=(i=r)&&aC(e,r)),o}return a._value=t,a}function lC(e,t){var o,i;function a(){var r=t.apply(this,arguments);return r!==i&&(o=(i=r)&&iC(e,r)),o}return a._value=t,a}function sC(e,t){var o="attr."+e;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;var i=da(e);return this.tween(o,(i.local?rC:lC)(i,t))}function cC(e,t){return function(){dl(this,e).delay=+t.apply(this,arguments)}}function dC(e,t){return t=+t,function(){dl(this,e).delay=t}}function uC(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cC:dC)(t,e)):_t(this.node(),t).delay}function mC(e,t){return function(){Rt(this,e).duration=+t.apply(this,arguments)}}function fC(e,t){return t=+t,function(){Rt(this,e).duration=t}}function pC(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?mC:fC)(t,e)):_t(this.node(),t).duration}function hC(e,t){if(typeof t!="function")throw new Error;return function(){Rt(this,e).ease=t}}function yC(e){var t=this._id;return arguments.length?this.each(hC(t,e)):_t(this.node(),t).ease}function gC(e,t){return function(){var o=t.apply(this,arguments);if(typeof o!="function")throw new Error;Rt(this,e).ease=o}}function bC(e){if(typeof e!="function")throw new Error;return this.each(gC(this._id,e))}function _C(e){typeof e!="function"&&(e=Wu(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 zt(i,this._parents,this._name,this._id)}function kC(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,o=e._groups,i=t.length,a=o.length,r=Math.min(i,a),l=new Array(i),s=0;s<r;++s)for(var c=t[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]=t[s];return new zt(l,this._parents,this._name,this._id)}function EC(e){return(e+"").trim().split(/^|\s+/).every(function(t){var o=t.indexOf(".");return o>=0&&(t=t.slice(0,o)),!t||t==="start"})}function wC(e,t,o){var i,a,r=EC(t)?dl:Rt;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(t,o),l.on=a}}function NC(e,t){var o=this._id;return arguments.length<2?_t(this.node(),o).on.on(e):this.each(wC(o,e,t))}function vC(e){return function(){var t=this.parentNode;for(var o in this.__transition)if(+o!==e)return;t&&t.removeChild(this)}}function xC(){return this.on("end.remove",vC(this._id))}function CC(e){var t=this._name,o=this._id;typeof e!="function"&&(e=Xr(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,Na(d[p],t,o,p,d,_t(u,o)));return new zt(r,this._parents,t,o)}function IC(e){var t=this._name,o=this._id;typeof e!="function"&&(e=Yu(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,y=_t(u,o),b=0,k=p.length;b<k;++b)(f=p[b])&&Na(f,t,o,b,p,y);r.push(p),l.push(u)}return new zt(r,l,t,o)}var SC=Bo.prototype.constructor;function $C(){return new SC(this._groups,this._parents)}function RC(e,t){var o,i,a;return function(){var r=Jn(this,e),l=(this.style.removeProperty(e),Jn(this,e));return r===l?null:r===o&&l===i?a:a=t(o=r,i=l)}}function Rm(e){return function(){this.style.removeProperty(e)}}function AC(e,t,o){var i,a=o+"",r;return function(){var l=Jn(this,e);return l===a?null:l===i?r:r=t(i=l,o)}}function TC(e,t,o){var i,a,r;return function(){var l=Jn(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Jn(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=t(i=l,s))}}function VC(e,t){var o,i,a,r="style."+t,l="end."+r,s;return function(){var c=Rt(this,e),d=c.on,u=c.value[r]==null?s||(s=Rm(t)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function MC(e,t,o){var i=(e+="")=="transform"?Mx:$m;return t==null?this.styleTween(e,RC(e,i)).on("end.style."+e,Rm(e)):typeof t=="function"?this.styleTween(e,TC(e,i,ul(this,"style."+e,t))).each(VC(this._id,e)):this.styleTween(e,AC(e,i,t),o).on("end.style."+e,null)}function BC(e,t,o){return function(i){this.style.setProperty(e,t.call(this,i),o)}}function DC(e,t,o){var i,a;function r(){var l=t.apply(this,arguments);return l!==a&&(i=(a=l)&&BC(e,l,o)),i}return r._value=t,r}function OC(e,t,o){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,DC(e,t,o??""))}function PC(e){return function(){this.textContent=e}}function LC(e){return function(){var t=e(this);this.textContent=t??""}}function zC(e){return this.tween("text",typeof e=="function"?LC(ul(this,"text",e)):PC(e==null?"":e+""))}function UC(e){return function(t){this.textContent=e.call(this,t)}}function HC(e){var t,o;function i(){var a=e.apply(this,arguments);return a!==o&&(t=(o=a)&&UC(a)),t}return i._value=e,i}function FC(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,HC(e))}function GC(){for(var e=this._name,t=this._id,o=Am(),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=_t(c,t);Na(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new zt(i,this._parents,e,o)}function jC(){var e,t,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=Rt(this,i),u=d.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),d.on=t}),a===0&&r()})}var KC=0;function zt(e,t,o,i){this._groups=e,this._parents=t,this._name=o,this._id=i}function Am(){return++KC}var Ut=Bo.prototype;zt.prototype={constructor:zt,select:CC,selectAll:IC,selectChild:Ut.selectChild,selectChildren:Ut.selectChildren,filter:_C,merge:kC,selection:$C,transition:GC,call:Ut.call,nodes:Ut.nodes,node:Ut.node,size:Ut.size,empty:Ut.empty,each:Ut.each,on:NC,attr:oC,attrTween:sC,style:MC,styleTween:OC,text:zC,textTween:FC,remove:xC,tween:Xx,delay:uC,duration:pC,ease:yC,easeVarying:bC,end:jC,[Symbol.iterator]:Ut[Symbol.iterator]};function YC(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var WC={time:null,delay:0,duration:250,ease:YC};function qC(e,t){for(var o;!(o=e.__transition)||!(o=o[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return o}function XC(e){var t,o;e instanceof zt?(t=e._id,e=e._name):(t=Am(),(o=WC).time=rl(),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])&&Na(c,e,t,d,l,o||qC(c,t));return new zt(i,this._parents,e,t)}Bo.prototype.interrupt=Yx,Bo.prototype.transition=XC;const xa=e=>()=>e;function JC(e,{sourceEvent:t,target:o,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function Ht(e,t,o){this.k=e,this.x=t,this.y=o}Ht.prototype={constructor:Ht,scale:function(e){return e===1?this:new Ht(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ht(this.k,this.x+this.k*e,this.y+this.k*t)},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 ml=new Ht(1,0,0);Ht.prototype;function fl(e){e.stopImmediatePropagation()}function Go(e){e.preventDefault(),e.stopImmediatePropagation()}function ZC(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function QC(){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 Tm(){return this.__zoom||ml}function eI(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function tI(){return navigator.maxTouchPoints||"ontouchstart"in this}function nI(e,t,o){var i=e.invertX(t[0][0])-o[0][0],a=e.invertX(t[1][0])-o[1][0],r=e.invertY(t[0][1])-o[0][1],l=e.invertY(t[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 oI(){var e=ZC,t=QC,o=nI,i=eI,a=tI,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Lx,d=Wr("start","zoom","end"),u,m,p,f=500,y=150,b=0,k=10;function g(_){_.property("__zoom",Tm).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",B).filter(a).on("touchstart.zoom",Q).on("touchmove.zoom",V).on("touchend.zoom touchcancel.zoom",re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(_,W,R,J){var ee=_.selection?_.selection():_;ee.property("__zoom",Tm),_!==ee?X(_,W,R,J):ee.interrupt().each(function(){z(this,arguments).event(J).start().zoom(null,typeof W=="function"?W.apply(this,arguments):W).end()})},g.scaleBy=function(_,W,R,J){g.scaleTo(_,function(){var ee=this.__zoom.k,ae=typeof W=="function"?W.apply(this,arguments):W;return ee*ae},R,J)},g.scaleTo=function(_,W,R,J){g.transform(_,function(){var ee=t.apply(this,arguments),ae=this.__zoom,I=R==null?E(ee):typeof R=="function"?R.apply(this,arguments):R,K=ae.invert(I),oe=typeof W=="function"?W.apply(this,arguments):W;return o(h(w(ae,oe),I,K),ee,l)},R,J)},g.translateBy=function(_,W,R,J){g.transform(_,function(){return o(this.__zoom.translate(typeof W=="function"?W.apply(this,arguments):W,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),l)},null,J)},g.translateTo=function(_,W,R,J,ee){g.transform(_,function(){var ae=t.apply(this,arguments),I=this.__zoom,K=J==null?E(ae):typeof J=="function"?J.apply(this,arguments):J;return o(ml.translate(K[0],K[1]).scale(I.k).translate(typeof W=="function"?-W.apply(this,arguments):-W,typeof R=="function"?-R.apply(this,arguments):-R),ae,l)},J,ee)};function w(_,W){return W=Math.max(r[0],Math.min(r[1],W)),W===_.k?_:new Ht(W,_.x,_.y)}function h(_,W,R){var J=W[0]-R[0]*_.k,ee=W[1]-R[1]*_.k;return J===_.x&&ee===_.y?_:new Ht(_.k,J,ee)}function E(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function X(_,W,R,J){_.on("start.zoom",function(){z(this,arguments).event(J).start()}).on("interrupt.zoom end.zoom",function(){z(this,arguments).event(J).end()}).tween("zoom",function(){var ee=this,ae=arguments,I=z(ee,ae).event(J),K=t.apply(ee,ae),oe=R==null?E(K):typeof R=="function"?R.apply(ee,ae):R,pe=Math.max(K[1][0]-K[0][0],K[1][1]-K[0][1]),fe=ee.__zoom,ce=typeof W=="function"?W.apply(ee,ae):W,ue=c(fe.invert(oe).concat(pe/fe.k),ce.invert(oe).concat(pe/ce.k));return function(he){if(he===1)he=ce;else{var we=ue(he),Se=pe/we[2];he=new Ht(Se,oe[0]-we[0]*Se,oe[1]-we[1]*Se)}I.zoom(null,he)}})}function z(_,W,R){return!R&&_.__zooming||new q(_,W)}function q(_,W){this.that=_,this.args=W,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,W),this.taps=0}q.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,W){return this.mouse&&_!=="mouse"&&(this.mouse[1]=W.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=W.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=W.invert(this.touch1[0])),this.that.__zoom=W,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var W=Xt(this.that).datum();d.call(_,this.that,new JC(_,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:d}),W)}};function D(_,...W){if(!e.apply(this,arguments))return;var R=z(this,W).event(_),J=this.__zoom,ee=Math.max(r[0],Math.min(r[1],J.k*Math.pow(2,i.apply(this,arguments)))),ae=Jt(_);if(R.wheel)(R.mouse[0][0]!==ae[0]||R.mouse[0][1]!==ae[1])&&(R.mouse[1]=J.invert(R.mouse[0]=ae)),clearTimeout(R.wheel);else{if(J.k===ee)return;R.mouse=[ae,J.invert(ae)],va(this),R.start()}Go(_),R.wheel=setTimeout(I,y),R.zoom("mouse",o(h(w(J,ee),R.mouse[0],R.mouse[1]),R.extent,l));function I(){R.wheel=null,R.end()}}function $(_,...W){if(p||!e.apply(this,arguments))return;var R=_.currentTarget,J=z(this,W,!0).event(_),ee=Xt(_.view).on("mousemove.zoom",oe,!0).on("mouseup.zoom",pe,!0),ae=Jt(_,R),I=_.clientX,K=_.clientY;mx(_.view),fl(_),J.mouse=[ae,this.__zoom.invert(ae)],va(this),J.start();function oe(fe){if(Go(fe),!J.moved){var ce=fe.clientX-I,ue=fe.clientY-K;J.moved=ce*ce+ue*ue>b}J.event(fe).zoom("mouse",o(h(J.that.__zoom,J.mouse[0]=Jt(fe,R),J.mouse[1]),J.extent,l))}function pe(fe){ee.on("mousemove.zoom mouseup.zoom",null),fx(fe.view,J.moved),Go(fe),J.event(fe).end()}}function B(_,...W){if(e.apply(this,arguments)){var R=this.__zoom,J=Jt(_.changedTouches?_.changedTouches[0]:_,this),ee=R.invert(J),ae=R.k*(_.shiftKey?.5:2),I=o(h(w(R,ae),J,ee),t.apply(this,W),l);Go(_),s>0?Xt(this).transition().duration(s).call(X,I,J,_):Xt(this).call(g.transform,I,J,_)}}function Q(_,...W){if(e.apply(this,arguments)){var R=_.touches,J=R.length,ee=z(this,W,_.changedTouches.length===J).event(_),ae,I,K,oe;for(fl(_),I=0;I<J;++I)K=R[I],oe=Jt(K,this),oe=[oe,this.__zoom.invert(oe),K.identifier],ee.touch0?!ee.touch1&&ee.touch0[2]!==oe[2]&&(ee.touch1=oe,ee.taps=0):(ee.touch0=oe,ae=!0,ee.taps=1+!!u);u&&(u=clearTimeout(u)),ae&&(ee.taps<2&&(m=oe[0],u=setTimeout(function(){u=null},f)),va(this),ee.start())}}function V(_,...W){if(this.__zooming){var R=z(this,W).event(_),J=_.changedTouches,ee=J.length,ae,I,K,oe;for(Go(_),ae=0;ae<ee;++ae)I=J[ae],K=Jt(I,this),R.touch0&&R.touch0[2]===I.identifier?R.touch0[0]=K:R.touch1&&R.touch1[2]===I.identifier&&(R.touch1[0]=K);if(I=R.that.__zoom,R.touch1){var pe=R.touch0[0],fe=R.touch0[1],ce=R.touch1[0],ue=R.touch1[1],he=(he=ce[0]-pe[0])*he+(he=ce[1]-pe[1])*he,we=(we=ue[0]-fe[0])*we+(we=ue[1]-fe[1])*we;I=w(I,Math.sqrt(he/we)),K=[(pe[0]+ce[0])/2,(pe[1]+ce[1])/2],oe=[(fe[0]+ue[0])/2,(fe[1]+ue[1])/2]}else if(R.touch0)K=R.touch0[0],oe=R.touch0[1];else return;R.zoom("touch",o(h(I,K,oe),R.extent,l))}}function re(_,...W){if(this.__zooming){var R=z(this,W).event(_),J=_.changedTouches,ee=J.length,ae,I;for(fl(_),p&&clearTimeout(p),p=setTimeout(function(){p=null},f),ae=0;ae<ee;++ae)I=J[ae],R.touch0&&R.touch0[2]===I.identifier?delete R.touch0:R.touch1&&R.touch1[2]===I.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(I=Jt(I,this),Math.hypot(m[0]-I[0],m[1]-I[1])<k)){var K=Xt(this).on("dblclick.zoom");K&&K.apply(this,arguments)}}}return g.wheelDelta=function(_){return arguments.length?(i=typeof _=="function"?_:xa(+_),g):i},g.filter=function(_){return arguments.length?(e=typeof _=="function"?_:xa(!!_),g):e},g.touchable=function(_){return arguments.length?(a=typeof _=="function"?_:xa(!!_),g):a},g.extent=function(_){return arguments.length?(t=typeof _=="function"?_:xa([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),g):t},g.scaleExtent=function(_){return arguments.length?(r[0]=+_[0],r[1]=+_[1],g):[r[0],r[1]]},g.translateExtent=function(_){return arguments.length?(l[0][0]=+_[0][0],l[1][0]=+_[1][0],l[0][1]=+_[0][1],l[1][1]=+_[1][1],g):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},g.constrain=function(_){return arguments.length?(o=_,g):o},g.duration=function(_){return arguments.length?(s=+_,g):s},g.interpolate=function(_){return arguments.length?(c=_,g):c},g.on=function(){var _=d.on.apply(d,arguments);return _===d?g:_},g.clickDistance=function(_){return arguments.length?(b=(_=+_)*_,g):Math.sqrt(b)},g.tapDistance=function(_){return arguments.length?(k=+_,g):k},g}const Vm=Symbol("MiniMapSlots"),iI=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],aI={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},rI=n.defineComponent({...aI,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:t}){const o=e,i=n.inject(Vm),a=n.useAttrs(),r=n.toRef(()=>a.style??{});function l(m){t("click",m)}function s(m){t("dblclick",m)}function c(m){t("mouseenter",m)}function d(m){t("mousemove",m)}function u(m){t("mouseleave",m)}return(m,p)=>!m.hidden&&m.dimensions.width!==0&&m.dimensions.height!==0?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.unref(i)[`node-${o.type}`]?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(i)[`node-${o.type}`]),n.normalizeProps(n.mergeProps({key:0},{...o,...m.$attrs})),null,16)):(n.openBlock(),n.createElementBlock("rect",n.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,iI))],64)):n.createCommentVNode("",!0)}}),lI=["width","height","viewBox","aria-labelledby"],sI=["id"],cI=["d","fill","stroke","stroke-width"],dI={name:"MiniMap",compatConfig:{MODE:3}},uI=n.defineComponent({...dI,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:t}){const o=n.useSlots(),i=n.useAttrs(),a=200,r=150,{id:l,edges:s,viewport:c,translateExtent:d,dimensions:u,emits:m,d3Selection:p,d3Zoom:f,getNodesInitialized:y}=Oe(),b=n.ref();n.provide(Vm,o);const k=n.toRef(()=>{var ee;return e.width??((ee=i.style)==null?void 0:ee.width)??a}),g=n.toRef(()=>{var ee;return e.height??((ee=i.style)==null?void 0:ee.height)??r}),w=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",h=n.computed(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),E=n.computed(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),X=n.computed(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),z=n.computed(()=>Cr(y.value.filter(ee=>!ee.hidden))),q=n.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})),D=n.computed(()=>y.value&&y.value.length?N_(z.value,q.value):q.value),$=n.computed(()=>{const ee=D.value.width/k.value,ae=D.value.height/g.value;return Math.max(ee,ae)}),B=n.computed(()=>{const ee=$.value*k.value,ae=$.value*g.value,I=e.offsetScale*$.value;return{offset:I,x:D.value.x-(ee-D.value.width)/2-I,y:D.value.y-(ae-D.value.height)/2-I,width:ee+I*2,height:ae+I*2}}),Q=n.computed(()=>!B.value.x||!B.value.y?"":`
|
|
39
|
-
M${
|
|
40
|
-
h${
|
|
41
|
-
v${
|
|
42
|
-
h${-
|
|
43
|
-
M${
|
|
44
|
-
h${
|
|
38
|
+
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 Qe extends Error{constructor(t,...o){var i;super((i=Bd[t])==null?void 0:i.call(Bd,...o)),this.name="VueFlowError",this.code=t,this.args=o}}function Ar(e){return"clientX"in e}function V_(e){return"sourceEvent"in e}function $t(e,t){const o=Ar(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-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}}const Mo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function M_(e){var t,o;return{width:((t=e.dimensions)==null?void 0:t.width)??e.width??0,height:((o=e.dimensions)==null?void 0:o.height)??e.height??0}}function Wi(e,t=[1,1]){return{x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}}const B_=()=>!0;function Tr(e){e==null||e.classList.remove("valid","connecting","vue-flow__handle-valid","vue-flow__handle-connecting")}function D_(e,t,o){const i=[],a={x:e.x-o,y:e.y-o,width:o*2,height:o*2};for(const r of t.values())Gi(a,Fi(r))>0&&i.push(r);return i}const O_=250;function P_(e,t,o,i){var a,r;let l=[],s=Number.POSITIVE_INFINITY;const c=D_(e,o,t+O_);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}=Kn(d,m,m.position,!0),y=Math.sqrt((p-e.x)**2+(f-e.y)**2);y>t||(y<s?(l=[{...m,x:p,y:f}],s=y):y===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 Dd(e,{handle:t,connectionMode:o,fromNodeId:i,fromHandleId:a,fromType:r,doc:l,lib:s,flowId:c,isValidConnection:d=B_},u,m,p,f){const y=r==="target",b=t?l.querySelector(`.${s}-flow__handle[data-id="${c}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:k,y:g}=$t(e),N=l.elementFromPoint(k,g),h=N!=null&&N.classList.contains(`${s}-flow__handle`)?N:b,w={handleDomNode:h,isValid:!1,connection:null,toHandle:null};if(h){const q=Od(void 0,h),P=h.getAttribute("data-nodeid"),W=h.getAttribute("data-handleid"),M=h.classList.contains("connectable"),$=h.classList.contains("connectableend");if(!P||!q)return w;const D={source:y?P:i,sourceHandle:y?W:a,target:y?i:P,targetHandle:y?a:W};w.connection=D;const B=M&&$&&(o===Lt.Strict?y&&q==="source"||!y&&q==="target":P!==i||W!==a);w.isValid=B&&d(D,{nodes:m,edges:u,sourceNode:p(D.source),targetNode:p(D.target)}),w.toHandle=Pd(P,q,W,f,o,!0)}return w}function Od(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function L_(e,t){let o=null;return t?o="valid":e&&!t&&(o="invalid"),o}function z_(e,t){let o=null;return t?o=!0:e&&!t&&(o=!1),o}function Pd(e,t,o,i,a,r=!1){var l,s,c;const d=i.get(e);if(!d)return null;const u=a===Lt.Strict?(l=d.handleBounds)==null?void 0:l[t]:[...((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,...Kn(d,m,m.position,!0)}:m}const Vr={[Ce.Left]:Ce.Right,[Ce.Right]:Ce.Left,[Ce.Top]:Ce.Bottom,[Ce.Bottom]:Ce.Top},U_=["production","prod"];function Bo(e,...t){Ld()&&console.warn(`[Vue Flow]: ${e}`,...t)}function Ld(){return!U_.includes(process.env.NODE_ENV||"")}function zd(e,t,o,i,a){const r=t.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,...ji(l)}}):null}function Mr(e,t,o,i,a,r=!1,l){a.value=!1,e.selected?(r||e.selected&&t)&&(i([e]),n.nextTick(()=>{l.blur()})):o([e])}function Xe(e){return typeof n.unref(e)<"u"}function H_(e,t,o,i){if(!e||!e.source||!e.target)return o(new Qe(qe.EDGE_INVALID,(e==null?void 0:e.id)??"[ID UNKNOWN]")),!1;let a;return Yt(e)?a=e:a={...e,id:_d(e)},a=gd(a,void 0,i),w_(a,t)?!1:a}function F_(e,t,o,i,a){if(!t.source||!t.target)return a(new Qe(qe.EDGE_INVALID,e.id)),!1;if(!o)return a(new Qe(qe.EDGE_NOT_FOUND,e.id)),!1;const{id:r,...l}=e;return{...l,id:i?_d(t):r,source:t.source,target:t.target,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle}}function Ud(e,t,o){const i={},a=[];for(let r=0;r<e.length;++r){const l=e[r];if(!pn(l)){o(new Qe(qe.NODE_INVALID,l==null?void 0:l.id)||`[ID UNKNOWN|INDEX ${r}]`);continue}const s=__(l,t(l.id),l.parentNode);l.parentNode&&(i[l.parentNode]=!0),a[r]=s}for(const r of a){const l=t(r.parentNode)||a.find(s=>s.id===r.parentNode);r.parentNode&&!l&&o(new Qe(qe.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 Hd(e,t,o,i,a,r){let l=a;const s=i.get(l)||new Map;i.set(l,s.set(o,t)),l=`${a}-${e}`;const c=i.get(l)||new Map;if(i.set(l,c.set(o,t)),r){l=`${a}-${e}-${r}`;const d=i.get(l)||new Map;i.set(l,d.set(o,t))}}function Br(e,t,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}`;Hd("source",c,u,e,a,l),Hd("target",c,d,e,r,s)}}function Fd(e,t){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}function Dr(e,t,o,i,a,r,l,s){const c=[];for(const d of e){const u=Yt(d)?d:H_(d,s,a,r);if(!u)continue;const m=o(u.source),p=o(u.target);if(!m||!p){a(new Qe(qe.EDGE_SOURCE_TARGET_MISSING,u.id,u.source,u.target));continue}if(!m){a(new Qe(qe.EDGE_SOURCE_MISSING,u.id,u.source));continue}if(!p){a(new Qe(qe.EDGE_TARGET_MISSING,u.id,u.target));continue}if(t&&!t(u,{edges:s,nodes:l,sourceNode:m,targetNode:p})){a(new Qe(qe.EDGE_INVALID,u.id));continue}const f=i(u.id);c.push({...gd(u,f,r),sourceNode:m,targetNode:p})}return c}const Gd=Symbol("vueFlow"),jd=Symbol("nodeId"),Kd=Symbol("nodeRef"),G_=Symbol("edgeId"),j_=Symbol("edgeRef"),qi=Symbol("slots");function Yd(e){const{vueFlowRef:t,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:y,nodesSelectionActive:b,selectNodesOnDrag:k,removeSelectedElements:g,addSelectedNodes:N,updateNodePositions:h,emits:w}=De(),{onStart:q,onDrag:P,onStop:W,onClick:M,el:$,disabled:D,id:J,selectable:B,dragHandle:re}=e,_=n.shallowRef(!1);let K=[],R,X=null,ee={x:void 0,y:void 0},oe={x:0,y:0},U=null,G=!1,ne=!1,ce=0,pe=!1;const se=W_(),me=({x:ge,y:_e})=>{ee={x:ge,y:_e};let j=!1;if(K=K.map(H=>{const x={x:ge-H.distance.x,y:_e-H.distance.y},{computedPosition:T}=Rr(H,o.value?Wi(x,i.value):x,w.error,l.value,H.parentNode?f(H.parentNode):void 0);return j=j||H.position.x!==T.x||H.position.y!==T.y,H.position=T,H}),ne=ne||j,!!j&&(h(K,!0,!0),_.value=!0,U)){const[H,x]=$r({id:J,dragItems:K,findNode:f});P({event:U,node:H,nodes:x})}},he=()=>{if(!X)return;const[ge,_e]=Cd(oe,X,u.value);if(ge!==0||_e!==0){const j={x:(ee.x??0)-ge/c.value.zoom,y:(ee.y??0)-_e/c.value.zoom};p({x:ge,y:_e})&&me(j)}ce=requestAnimationFrame(he)},Ee=(ge,_e)=>{G=!0;const j=f(J);!k.value&&!y.value&&j&&(j.selected||g()),j&&n.toValue(B)&&k.value&&Mr(j,y.value,N,g,b,!1,_e);const H=se(ge.sourceEvent);if(ee=H,K=I_(r.value,m.value,H,J),K.length){const[x,T]=$r({id:J,dragItems:K,findNode:f});q({event:ge.sourceEvent,node:x,nodes:T})}},Se=(ge,_e)=>{var j;ge.sourceEvent.type==="touchmove"&&ge.sourceEvent.touches.length>1||(ne=!1,s.value===0&&Ee(ge,_e),ee=se(ge.sourceEvent),X=((j=t.value)==null?void 0:j.getBoundingClientRect())||null,oe=$t(ge.sourceEvent,X))},Ie=(ge,_e)=>{const j=se(ge.sourceEvent);if(!pe&&G&&d.value&&(pe=!0,he()),!G){const H=j.xSnapped-(ee.x??0),x=j.ySnapped-(ee.y??0);Math.sqrt(H*H+x*x)>s.value&&Ee(ge,_e)}(ee.x!==j.xSnapped||ee.y!==j.ySnapped)&&K.length&&G&&(U=ge.sourceEvent,oe=$t(ge.sourceEvent,X),me(j))},fe=ge=>{let _e=!1;if(!G&&!_.value&&!y.value){const j=ge.sourceEvent,H=se(j),x=H.xSnapped-(ee.x??0),T=H.ySnapped-(ee.y??0),V=Math.sqrt(x*x+T*T);V!==0&&V<=s.value&&(M==null||M(j),_e=!0)}if(K.length&&!_e){ne&&(h(K,!1,!1),ne=!1);const[j,H]=$r({id:J,dragItems:K,findNode:f});W({event:ge.sourceEvent,node:j,nodes:H})}K=[],_.value=!1,pe=!1,G=!1,ee={x:void 0,y:void 0},cancelAnimationFrame(ce)};return n.watch([()=>n.toValue(D),$],([ge,_e],j,H)=>{if(_e){const x=gt(_e);ge||(R=bg().on("start",T=>Se(T,_e)).on("drag",T=>Ie(T,_e)).on("end",T=>fe(T)).filter(T=>{const V=T.target,te=n.toValue(re);return!T.button&&(!a.value||!Td(V,`.${a.value}`,_e)&&(!te||Td(V,te,_e)))}),x.call(R)),H(()=>{x.on(".drag",null),R&&(R.on("start",null),R.on("drag",null),R.on("end",null))})}}),_}function K_(){return{doubleClick:ve(),click:ve(),mouseEnter:ve(),mouseMove:ve(),mouseLeave:ve(),contextMenu:ve(),updateStart:ve(),update:ve(),updateEnd:ve()}}function Y_(e,t){const o=K_();return o.doubleClick.on(i=>{var a,r;t.edgeDoubleClick(i),(r=(a=e.events)==null?void 0:a.doubleClick)==null||r.call(a,i)}),o.click.on(i=>{var a,r;t.edgeClick(i),(r=(a=e.events)==null?void 0:a.click)==null||r.call(a,i)}),o.mouseEnter.on(i=>{var a,r;t.edgeMouseEnter(i),(r=(a=e.events)==null?void 0:a.mouseEnter)==null||r.call(a,i)}),o.mouseMove.on(i=>{var a,r;t.edgeMouseMove(i),(r=(a=e.events)==null?void 0:a.mouseMove)==null||r.call(a,i)}),o.mouseLeave.on(i=>{var a,r;t.edgeMouseLeave(i),(r=(a=e.events)==null?void 0:a.mouseLeave)==null||r.call(a,i)}),o.contextMenu.on(i=>{var a,r;t.edgeContextMenu(i),(r=(a=e.events)==null?void 0:a.contextMenu)==null||r.call(a,i)}),o.updateStart.on(i=>{var a,r;t.edgeUpdateStart(i),(r=(a=e.events)==null?void 0:a.updateStart)==null||r.call(a,i)}),o.update.on(i=>{var a,r;t.edgeUpdate(i),(r=(a=e.events)==null?void 0:a.update)==null||r.call(a,i)}),o.updateEnd.on(i=>{var a,r;t.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 W_(){const{viewport:e,snapGrid:t,snapToGrid:o,vueFlowRef:i}=De();return a=>{var r;const l=((r=i.value)==null?void 0:r.getBoundingClientRect())??{left:0,top:0},s=V_(a)?a.sourceEvent:a,{x:c,y:d}=$t(s,l),u=To({x:c,y:d},e.value),{x:m,y:p}=o.value?Wi(u,t.value):u;return{xSnapped:m,ySnapped:p,...u}}}function Xi(){return!0}function Wd({handleId:e,nodeId:t,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:y,autoPanSpeed:b,findNode:k,panBy:g,startConnection:N,updateConnection:h,endConnection:w,emits:q,viewport:P,edges:W,nodes:M,isValidConnection:$,nodeLookup:D}=De();let J=null,B=!1,re=null;function _(R){var X;const ee=n.toValue(o)==="target",oe=Ar(R),U=yd(R.target),G=R.currentTarget;if(G&&(oe&&R.button===0||!oe)){let ne=function(ye){j=$t(ye,fe),me=P_(To(j,P.value,!1,[1,1]),u.value,D.value,T),H||(x(),H=!0);const xe=Dd(ye,{handle:me,connectionMode:d.value,fromNodeId:n.toValue(t),fromHandleId:n.toValue(e),fromType:ee?"target":"source",isValidConnection:se,doc:U,lib:"vue",flowId:s,nodeLookup:D.value},W.value,M.value,k,D.value);re=xe.handleDomNode,J=xe.connection,B=z_(!!me,xe.isValid);const $e={...ke,isValid:B,to:xe.toHandle&&B?Ao({x:xe.toHandle.x,y:xe.toHandle.y},P.value):j,toHandle:xe.toHandle,toPosition:B&&xe.toHandle?xe.toHandle.position:Vr[T.position],toNode:xe.toHandle?D.value.get(xe.toHandle.nodeId):null};if(B&&me&&(ke!=null&&ke.toHandle)&&$e.toHandle&&ke.toHandle.type===$e.toHandle.type&&ke.toHandle.nodeId===$e.toHandle.nodeId&&ke.toHandle.id===$e.toHandle.id&&ke.to.x===$e.to.x&&ke.to.y===$e.to.y)return;const Ve=me??xe.toHandle;if(h(Ve&&B?Ao({x:Ve.x,y:Ve.y},P.value):j,Ve,L_(!!Ve,B)),ke=$e,!me&&!B&&!re)return Tr(_e);J&&J.source!==J.target&&re&&(Tr(_e),_e=re,re.classList.add("connecting","vue-flow__handle-connecting"),re.classList.toggle("valid",!!B),re.classList.toggle("vue-flow__handle-valid",!!B))},ce=function(ye){"touches"in ye&&ye.touches.length>0||((me||re)&&J&&B&&(r?r(ye,J):q.connect(J)),q.connectEnd(ye),a&&(l==null||l(ye)),Tr(_e),cancelAnimationFrame(he),w(ye),H=!1,B=!1,J=null,re=null,U.removeEventListener("mousemove",ne),U.removeEventListener("mouseup",ce),U.removeEventListener("touchmove",ne),U.removeEventListener("touchend",ce))};const pe=k(n.toValue(t));let se=n.toValue(i)||$.value||Xi;!se&&pe&&(se=(ee?pe.isValidSourcePos:pe.isValidTargetPos)||Xi);let me,he=0;const{x:Ee,y:Se}=$t(R),Ie=Od(n.toValue(a),G),fe=(X=c.value)==null?void 0:X.getBoundingClientRect();if(!fe||!Ie)return;const ge=Pd(n.toValue(t),Ie,n.toValue(e),D.value,d.value);if(!ge)return;let _e,j=$t(R,fe),H=!1;const x=()=>{if(!y.value)return;const[ye,xe]=Cd(j,fe,b.value);g({x:ye,y:xe}),he=requestAnimationFrame(x)},T={...ge,nodeId:n.toValue(t),type:Ie,position:ge.position},V=D.value.get(n.toValue(t)),de={inProgress:!0,isValid:null,from:Kn(V,T,Ce.Left,!0),fromHandle:T,fromPosition:T.position,fromNode:V,to:j,toHandle:null,toPosition:Vr[T.position],toNode:null};N({nodeId:n.toValue(t),id:n.toValue(e),type:Ie,position:(G==null?void 0:G.getAttribute("data-handlepos"))||Ce.Top,...j},{x:Ee-fe.left,y:Se-fe.top}),q.connectStart({event:R,nodeId:n.toValue(t),handleId:n.toValue(e),handleType:Ie});let ke=de;U.addEventListener("mousemove",ne),U.addEventListener("mouseup",ce),U.addEventListener("touchmove",ne),U.addEventListener("touchend",ce)}}function K(R){var X,ee;if(!m.value)return;const oe=n.toValue(o)==="target";if(!p.value){q.clickConnectStart({event:R,nodeId:n.toValue(t),handleId:n.toValue(e)}),N({nodeId:n.toValue(t),type:n.toValue(o),id:n.toValue(e),position:Ce.Top,...$t(R)},void 0,!0);return}let U=n.toValue(i)||$.value||Xi;const G=k(n.toValue(t));if(!U&&G&&(U=(oe?G.isValidSourcePos:G.isValidTargetPos)||Xi),G&&(typeof G.connectable>"u"?f.value:G.connectable)===!1)return;const ne=yd(R.target),ce=Dd(R,{handle:{nodeId:n.toValue(t),id:n.toValue(e),type:n.toValue(o),position:Ce.Top,...$t(R)},connectionMode:d.value,fromNodeId:p.value.nodeId,fromHandleId:p.value.id??null,fromType:p.value.type,isValidConnection:U,doc:ne,lib:"vue",flowId:s,nodeLookup:D.value},W.value,M.value,k,D.value),pe=((X=ce.connection)==null?void 0:X.source)===((ee=ce.connection)==null?void 0:ee.target);ce.isValid&&ce.connection&&!pe&&q.connect(ce.connection),q.clickConnectEnd(R),w(R,!0)}return{handlePointerDown:_,handleClick:K}}function q_(){return n.inject(jd,"")}function qd(e){const t=e??q_()??"",o=n.inject(Kd,n.ref(null)),{findNode:i,edges:a,emits:r}=De(),l=i(t);return l||r.error(new Qe(qe.NODE_NOT_FOUND,t)),{id:t,nodeEl:o,node:l,parentNode:n.computed(()=>i(l.parentNode)),connectedEdges:n.computed(()=>hn([l],a.value))}}function X_(){return{doubleClick:ve(),click:ve(),mouseEnter:ve(),mouseMove:ve(),mouseLeave:ve(),contextMenu:ve(),dragStart:ve(),drag:ve(),dragStop:ve()}}function J_(e,t){const o=X_();return o.doubleClick.on(i=>{var a,r;t.nodeDoubleClick(i),(r=(a=e.events)==null?void 0:a.doubleClick)==null||r.call(a,i)}),o.click.on(i=>{var a,r;t.nodeClick(i),(r=(a=e.events)==null?void 0:a.click)==null||r.call(a,i)}),o.mouseEnter.on(i=>{var a,r;t.nodeMouseEnter(i),(r=(a=e.events)==null?void 0:a.mouseEnter)==null||r.call(a,i)}),o.mouseMove.on(i=>{var a,r;t.nodeMouseMove(i),(r=(a=e.events)==null?void 0:a.mouseMove)==null||r.call(a,i)}),o.mouseLeave.on(i=>{var a,r;t.nodeMouseLeave(i),(r=(a=e.events)==null?void 0:a.mouseLeave)==null||r.call(a,i)}),o.contextMenu.on(i=>{var a,r;t.nodeContextMenu(i),(r=(a=e.events)==null?void 0:a.contextMenu)==null||r.call(a,i)}),o.dragStart.on(i=>{var a,r;t.nodeDragStart(i),(r=(a=e.events)==null?void 0:a.dragStart)==null||r.call(a,i)}),o.drag.on(i=>{var a,r;t.nodeDrag(i),(r=(a=e.events)==null?void 0:a.drag)==null||r.call(a,i)}),o.dragStop.on(i=>{var a,r;t.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 Xd(){const{getSelectedNodes:e,nodeExtent:t,updateNodePositions:o,findNode:i,snapGrid:a,snapToGrid:r,nodesDraggable:l,emits:s}=De();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,y=c.y*m*p,b=[];for(const k of e.value)if(k.draggable||l&&typeof k.draggable>"u"){const g={x:k.computedPosition.x+f,y:k.computedPosition.y+y},{position:N}=Rr(k,g,s.error,t.value,k.parentNode?i(k.parentNode):void 0);b.push({id:k.id,position:N,from:k.position,distance:{x:c.x,y:c.y},dimensions:k.dimensions})}o(b,!0,!1)}}const Ji=.1,Z_=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2;function Xt(){return Bo("Viewport not initialized yet."),Promise.resolve(!1)}const Q_={zoomIn:Xt,zoomOut:Xt,zoomTo:Xt,fitView:Xt,setCenter:Xt,fitBounds:Xt,project:e=>e,screenToFlowCoordinate:e=>e,flowToScreenCoordinate:e=>e,setViewport:Xt,setTransform:Xt,getViewport:()=>({x:0,y:0,zoom:1}),getTransform:()=>({x:0,y:0,zoom:1}),viewportInitialized:!1};function e1(e){function t(i,a){return new Promise(r=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((a==null?void 0:a.interpolate)==="linear"?wo:Vi).scaleBy(Or(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}=hd({x:-i,y:-a},e.translateExtent),m=Fn.translate(-d,-u).scale(r);e.d3Selection&&e.d3Zoom?(c=e.d3Zoom)==null||c.interpolate((l==null?void 0:l.interpolate)==="linear"?wo:Vi).transform(Or(e.d3Selection,l==null?void 0:l.duration,l==null?void 0:l.ease,()=>{s(!0)}),m):s(!1)})}return n.computed(()=>e.d3Zoom&&e.d3Selection&&e.dimensions.width&&e.dimensions.height?{viewportInitialized:!0,zoomIn:a=>t(1.2,a),zoomOut:a=>t(1/1.2,a),zoomTo:(a,r)=>new Promise(l=>{e.d3Selection&&e.d3Zoom?e.d3Zoom.interpolate((r==null?void 0:r.interpolate)==="linear"?wo:Vi).scaleTo(Or(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:Ji,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=Cr(s),{x:d,y:u,zoom:m}=Nd(c,e.dimensions.width,e.dimensions.height,a.minZoom??e.minZoom,a.maxZoom??e.maxZoom,a.padding??Ji);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:Ji})=>{const{x:l,y:s,zoom:c}=Nd(a,e.dimensions.width,e.dimensions.height,e.minZoom,e.maxZoom,r.padding??Ji);return o(l,s,c,r)},project:a=>To(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 To(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 Ao(s,e.viewport)}return{x:0,y:0}}}:Q_)}function Or(e,t=0,o=Z_,i=()=>{}){const a=typeof t=="number"&&t>0;return a||i(),a?e.transition().duration(t).ease(o).on("end",i):e}function t1(e,t,o){const i=n.effectScope(!0);return i.run(()=>{const a=()=>{i.run(()=>{let b,k,g=!!(o.nodes.value.length||o.edges.value.length);b=Pn([e.modelValue,()=>{var N,h;return(h=(N=e.modelValue)==null?void 0:N.value)==null?void 0:h.length}],([N])=>{N&&Array.isArray(N)&&(k==null||k.pause(),o.setElements(N),!k&&!g&&N.length?g=!0:k==null||k.resume())}),k=Pn([o.nodes,o.edges,()=>o.edges.value.length,()=>o.nodes.value.length],([N,h])=>{var w;(w=e.modelValue)!=null&&w.value&&Array.isArray(e.modelValue.value)&&(b==null||b.pause(),e.modelValue.value=[...N,...h],n.nextTick(()=>{b==null||b.resume()}))},{immediate:g}),n.onScopeDispose(()=>{b==null||b.stop(),k==null||k.stop()})})},r=()=>{i.run(()=>{let b,k,g=!!o.nodes.value.length;b=Pn([e.nodes,()=>{var N,h;return(h=(N=e.nodes)==null?void 0:N.value)==null?void 0:h.length}],([N])=>{N&&Array.isArray(N)&&(k==null||k.pause(),o.setNodes(N),!k&&!g&&N.length?g=!0:k==null||k.resume())}),k=Pn([o.nodes,()=>o.nodes.value.length],([N])=>{var h;(h=e.nodes)!=null&&h.value&&Array.isArray(e.nodes.value)&&(b==null||b.pause(),e.nodes.value=[...N],n.nextTick(()=>{b==null||b.resume()}))},{immediate:g}),n.onScopeDispose(()=>{b==null||b.stop(),k==null||k.stop()})})},l=()=>{i.run(()=>{let b,k,g=!!o.edges.value.length;b=Pn([e.edges,()=>{var N,h;return(h=(N=e.edges)==null?void 0:N.value)==null?void 0:h.length}],([N])=>{N&&Array.isArray(N)&&(k==null||k.pause(),o.setEdges(N),!k&&!g&&N.length?g=!0:k==null||k.resume())}),k=Pn([o.edges,()=>o.edges.value.length],([N])=>{var h;(h=e.edges)!=null&&h.value&&Array.isArray(e.edges.value)&&(b==null||b.pause(),e.edges.value=[...N],n.nextTick(()=>{b==null||b.resume()}))},{immediate:g}),n.onScopeDispose(()=>{b==null||b.stop(),k==null||k.stop()})})},s=()=>{i.run(()=>{n.watch(()=>t.maxZoom,()=>{t.maxZoom&&Xe(t.maxZoom)&&o.setMaxZoom(t.maxZoom)},{immediate:!0})})},c=()=>{i.run(()=>{n.watch(()=>t.minZoom,()=>{t.minZoom&&Xe(t.minZoom)&&o.setMinZoom(t.minZoom)},{immediate:!0})})},d=()=>{i.run(()=>{n.watch(()=>t.translateExtent,()=>{t.translateExtent&&Xe(t.translateExtent)&&o.setTranslateExtent(t.translateExtent)},{immediate:!0})})},u=()=>{i.run(()=>{n.watch(()=>t.nodeExtent,()=>{t.nodeExtent&&Xe(t.nodeExtent)&&o.setNodeExtent(t.nodeExtent)},{immediate:!0})})},m=()=>{i.run(()=>{n.watch(()=>t.applyDefault,()=>{Xe(t.applyDefault)&&(o.applyDefault.value=t.applyDefault)},{immediate:!0})})},p=()=>{i.run(()=>{const b=async k=>{let g=k;typeof t.autoConnect=="function"&&(g=await t.autoConnect(k)),g!==!1&&o.addEdges([g])};n.watch(()=>t.autoConnect,()=>{Xe(t.autoConnect)&&(o.autoConnect.value=t.autoConnect)},{immediate:!0}),n.watch(o.autoConnect,(k,g,N)=>{k?o.onConnect(b):o.hooks.value.connect.off(b),N(()=>{o.hooks.value.connect.off(b)})},{immediate:!0})})},f=()=>{const b=["id","modelValue","translateExtent","nodeExtent","edges","nodes","maxZoom","minZoom","applyDefault","autoConnect"];for(const k of Object.keys(t)){const g=k;if(!b.includes(g)){const N=n.toRef(()=>t[g]),h=o[g];n.isRef(h)&&i.run(()=>{n.watch(N,w=>{Xe(w)&&(h.value=w)},{immediate:!0})})}}};(()=>{a(),r(),l(),c(),s(),d(),u(),m(),p(),f()})()}),()=>i.stop()}function n1(){return{edgesChange:ve(),nodesChange:ve(),nodeDoubleClick:ve(),nodeClick:ve(),nodeMouseEnter:ve(),nodeMouseMove:ve(),nodeMouseLeave:ve(),nodeContextMenu:ve(),nodeDragStart:ve(),nodeDrag:ve(),nodeDragStop:ve(),nodesInitialized:ve(),miniMapNodeClick:ve(),miniMapNodeDoubleClick:ve(),miniMapNodeMouseEnter:ve(),miniMapNodeMouseMove:ve(),miniMapNodeMouseLeave:ve(),connect:ve(),connectStart:ve(),connectEnd:ve(),clickConnectStart:ve(),clickConnectEnd:ve(),paneReady:ve(),init:ve(),move:ve(),moveStart:ve(),moveEnd:ve(),selectionDragStart:ve(),selectionDrag:ve(),selectionDragStop:ve(),selectionContextMenu:ve(),selectionStart:ve(),selectionEnd:ve(),viewportChangeStart:ve(),viewportChange:ve(),viewportChangeEnd:ve(),paneScroll:ve(),paneClick:ve(),paneContextMenu:ve(),paneMouseEnter:ve(),paneMouseMove:ve(),paneMouseLeave:ve(),edgeContextMenu:ve(),edgeMouseEnter:ve(),edgeMouseMove:ve(),edgeMouseLeave:ve(),edgeDoubleClick:ve(),edgeClick:ve(),edgeUpdateStart:ve(),edgeUpdate:ve(),edgeUpdateEnd:ve(),updateNodeInternals:ve(),error:ve(e=>Bo(e.message))}}function o1(e,t){const o=n.getCurrentInstance();n.onBeforeMount(()=>{for(const[a,r]of Object.entries(t.value)){const l=s=>{e(a,s)};r.setEmitter(l),yo(r.removeEmitter),r.setHasEmitListeners(()=>i(a)),yo(r.removeHasEmitListeners)}});function i(a){var r;const l=i1(a);return!!((r=o==null?void 0:o.vnode.props)==null?void 0:r[l])}}function i1(e){const[t,...o]=e.split(":");return`on${t.replace(/(?:^|-)(\w)/g,(a,r)=>r.toUpperCase())}${o.length?`:${o.join(":")}`:""}`}function Jd(){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:Nr.Full,paneDragging:!1,preventScrolling:!0,zoomOnScroll:!0,zoomOnPinch:!0,zoomOnDoubleClick:!0,panOnScroll:!1,panOnScrollSpeed:.5,panOnScrollMode:So.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:mn.Bezier,style:{}},connectionMode:Lt.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:Mo()?"Meta":"Control",zoomActivationKeyCode:Mo()?"Meta":"Control",deleteKeyCode:"Backspace",panActivationKeyCode:"Space",hooks:n1(),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 a1=["id","vueFlowRef","viewportRef","initialized","modelValue","nodes","edges","maxZoom","minZoom","translateExtent","hooks","defaultEdgeOptions"];function r1(e,t,o){const i=e1(e),a=j=>{const H=j??[];e.hooks.updateNodeInternals.trigger(H)},r=j=>E_(j,e.nodes,e.edges),l=j=>k_(j,e.nodes,e.edges),s=j=>hn(j,e.edges),c=({id:j,type:H,nodeId:x})=>{var T;const V=j?`-${H}-${j}`:`-${H}`;return Array.from(((T=e.connectionLookup.get(`${x}${V}`))==null?void 0:T.values())??[])},d=j=>{if(j)return t.value.get(j)},u=j=>{if(j)return o.value.get(j)},m=(j,H,x)=>{var T,V;const te=[];for(const de of j){const ke={id:de.id,type:"position",dragging:x,from:de.from};if(H&&(ke.position=de.position,de.parentNode)){const ye=d(de.parentNode);ke.position={x:ke.position.x-(((T=ye==null?void 0:ye.computedPosition)==null?void 0:T.x)??0),y:ke.position.y-(((V=ye==null?void 0:ye.computedPosition)==null?void 0:V.y)??0)}}te.push(ke)}te!=null&&te.length&&e.hooks.nodesChange.trigger(te)},p=j=>{if(!e.vueFlowRef)return;const H=e.vueFlowRef.querySelector(".vue-flow__transformationpane");if(!H)return;const x=window.getComputedStyle(H),{m22:T}=new window.DOMMatrixReadOnly(x.transform),V=[];for(const te of j){const de=te,ke=d(de.id);if(ke){const ye=ji(de.nodeElement);if(!!(ye.width&&ye.height&&(ke.dimensions.width!==ye.width||ke.dimensions.height!==ye.height||de.forceUpdate))){const $e=de.nodeElement.getBoundingClientRect();ke.dimensions=ye,ke.handleBounds.source=zd("source",de.nodeElement,$e,T,ke.id),ke.handleBounds.target=zd("target",de.nodeElement,$e,T,ke.id),V.push({id:ke.id,type:"dimensions",dimensions:ye})}}}!e.fitViewOnInitDone&&e.fitViewOnInit&&i.value.fitView().then(()=>{e.fitViewOnInitDone=!0}),V.length&&e.hooks.nodesChange.trigger(V)},f=(j,H)=>{const x=new Set,T=new Set;for(const de of j)pn(de)?x.add(de.id):Yt(de)&&T.add(de.id);const V=qt(t.value,x,!0),te=qt(o.value,T);if(e.multiSelectionActive){for(const de of x)V.push(Wt(de,H));for(const de of T)te.push(Wt(de,H))}V.length&&e.hooks.nodesChange.trigger(V),te.length&&e.hooks.edgesChange.trigger(te)},y=j=>{if(e.multiSelectionActive){const H=j.map(x=>Wt(x.id,!0));e.hooks.nodesChange.trigger(H);return}e.hooks.nodesChange.trigger(qt(t.value,new Set(j.map(H=>H.id)),!0)),e.hooks.edgesChange.trigger(qt(o.value))},b=j=>{if(e.multiSelectionActive){const H=j.map(x=>Wt(x.id,!0));e.hooks.edgesChange.trigger(H);return}e.hooks.edgesChange.trigger(qt(o.value,new Set(j.map(H=>H.id)))),e.hooks.nodesChange.trigger(qt(t.value,new Set,!0))},k=j=>{f(j,!0)},g=j=>{const x=(j||e.nodes).map(T=>(T.selected=!1,Wt(T.id,!1)));e.hooks.nodesChange.trigger(x)},N=j=>{const x=(j||e.edges).map(T=>(T.selected=!1,Wt(T.id,!1)));e.hooks.edgesChange.trigger(x)},h=j=>{if(!j||!j.length)return f([],!1);const H=j.reduce((x,T)=>{const V=Wt(T.id,!1);return pn(T)?x.nodes.push(V):x.edges.push(V),x},{nodes:[],edges:[]});H.nodes.length&&e.hooks.nodesChange.trigger(H.nodes),H.edges.length&&e.hooks.edgesChange.trigger(H.edges)},w=j=>{var H;(H=e.d3Zoom)==null||H.scaleExtent([j,e.maxZoom]),e.minZoom=j},q=j=>{var H;(H=e.d3Zoom)==null||H.scaleExtent([e.minZoom,j]),e.maxZoom=j},P=j=>{var H;(H=e.d3Zoom)==null||H.translateExtent(j),e.translateExtent=j},W=j=>{e.nodeExtent=j,a()},M=j=>{var H;(H=e.d3Zoom)==null||H.clickDistance(j)},$=j=>{e.nodesDraggable=j,e.nodesConnectable=j,e.elementsSelectable=j},D=j=>{const H=j instanceof Function?j(e.nodes):j;!e.initialized&&!H.length||(e.nodes=Ud(H,d,e.hooks.error.trigger))},J=j=>{const H=j instanceof Function?j(e.edges):j;if(!e.initialized&&!H.length)return;const x=Dr(H,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);Br(e.connectionLookup,o.value,x),e.edges=x},B=j=>{const H=j instanceof Function?j([...e.nodes,...e.edges]):j;!e.initialized&&!H.length||(D(H.filter(pn)),J(H.filter(Yt)))},re=j=>{let H=j instanceof Function?j(e.nodes):j;H=Array.isArray(H)?H:[H];const x=Ud(H,d,e.hooks.error.trigger),T=[];for(const V of x)T.push(Sd(V));T.length&&e.hooks.nodesChange.trigger(T)},_=j=>{let H=j instanceof Function?j(e.edges):j;H=Array.isArray(H)?H:[H];const x=Dr(H,e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges),T=[];for(const V of x)T.push(Sd(V));T.length&&e.hooks.edgesChange.trigger(T)},K=(j,H=!0,x=!1)=>{const T=j instanceof Function?j(e.nodes):j,V=Array.isArray(T)?T:[T],te=[],de=[];function ke(xe){const $e=s(xe);for(const Ve of $e)(!Xe(Ve.deletable)||Ve.deletable)&&de.push(Rd(Ve.id,Ve.source,Ve.target,Ve.sourceHandle,Ve.targetHandle))}function ye(xe){const $e=[];for(const Ve of e.nodes)Ve.parentNode===xe&&$e.push(Ve);if($e.length){for(const Ve of $e)te.push($d(Ve.id));H&&ke($e);for(const Ve of $e)ye(Ve.id)}}for(const xe of V){const $e=typeof xe=="string"?d(xe):xe;$e&&(Xe($e.deletable)&&!$e.deletable||(te.push($d($e.id)),H&&ke([$e]),x&&ye($e.id)))}de.length&&e.hooks.edgesChange.trigger(de),te.length&&e.hooks.nodesChange.trigger(te)},R=j=>{const H=j instanceof Function?j(e.edges):j,x=Array.isArray(H)?H:[H],T=[];for(const V of x){const te=typeof V=="string"?u(V):V;te&&(Xe(te.deletable)&&!te.deletable||T.push(Rd(typeof V=="string"?V:V.id,te.source,te.target,te.sourceHandle,te.targetHandle)))}e.hooks.edgesChange.trigger(T)},X=(j,H,x=!0)=>{const T=u(j.id);if(!T)return!1;const V=e.edges.indexOf(T),te=F_(j,H,T,x,e.hooks.error.trigger);if(te){const[de]=Dr([te],e.isValidConnection,d,u,e.hooks.error.trigger,e.defaultEdgeOptions,e.nodes,e.edges);return e.edges=e.edges.map((ke,ye)=>ye===V?de:ke),Br(e.connectionLookup,o.value,[de]),de}return!1},ee=(j,H,x={replace:!1})=>{const T=u(j);if(!T)return;const V=typeof H=="function"?H(T):H;T.data=x.replace?V:{...T.data,...V}},oe=j=>Id(j,e.nodes),U=j=>{const H=Id(j,e.edges);return Br(e.connectionLookup,o.value,H),H},G=(j,H,x={replace:!1})=>{const T=d(j);if(!T)return;const V=typeof H=="function"?H(T):H;x.replace?e.nodes.splice(e.nodes.indexOf(T),1,V):Object.assign(T,V)},ne=(j,H,x={replace:!1})=>{const T=d(j);if(!T)return;const V=typeof H=="function"?H(T):H;T.data=x.replace?V:{...T.data,...V}},ce=(j,H,x=!1)=>{x?e.connectionClickStartHandle=j:e.connectionStartHandle=j,e.connectionEndHandle=null,e.connectionStatus=null,H&&(e.connectionPosition=H)},pe=(j,H=null,x=null)=>{e.connectionStartHandle&&(e.connectionPosition=j,e.connectionEndHandle=H,e.connectionStatus=x)},se=(j,H)=>{e.connectionPosition={x:Number.NaN,y:Number.NaN},e.connectionEndHandle=null,e.connectionStatus=null,H?e.connectionClickStartHandle=null:e.connectionStartHandle=null},me=j=>{const H=b_(j),x=H?null:Ro(j)?j:d(j.id);return!H&&!x?[null,null,H]:[H?j:Fi(x),x,H]},he=(j,H=!0,x=e.nodes)=>{const[T,V,te]=me(j);if(!T)return[];const de=[];for(const ke of x||e.nodes){if(!te&&(ke.id===V.id||!ke.computedPosition))continue;const ye=Fi(ke),xe=Gi(ye,T);(H&&xe>0||xe>=ye.width*ye.height||xe>=Number(T.width)*Number(T.height))&&de.push(ke)}return de},Ee=(j,H,x=!0)=>{const[T]=me(j);if(!T)return!1;const V=Gi(T,H);return x&&V>0||V>=Number(T.width)*Number(T.height)},Se=j=>{const{viewport:H,dimensions:x,d3Zoom:T,d3Selection:V,translateExtent:te}=e;if(!T||!V||!j.x&&!j.y)return!1;const de=Fn.translate(H.x+j.x,H.y+j.y).scale(H.zoom),ke=[[0,0],[x.width,x.height]],ye=T.constrain()(de,ke,te),xe=e.viewport.x!==ye.x||e.viewport.y!==ye.y||e.viewport.zoom!==ye.k;return T.transform(V,ye),xe},Ie=j=>{const H=j instanceof Function?j(e):j,x=["d3Zoom","d3Selection","d3ZoomHandler","viewportRef","vueFlowRef","dimensions","hooks"];Xe(H.defaultEdgeOptions)&&(e.defaultEdgeOptions=H.defaultEdgeOptions);const T=H.modelValue||H.nodes||H.edges?[]:void 0;T&&(H.modelValue&&T.push(...H.modelValue),H.nodes&&T.push(...H.nodes),H.edges&&T.push(...H.edges),B(T));const V=()=>{Xe(H.maxZoom)&&q(H.maxZoom),Xe(H.minZoom)&&w(H.minZoom),Xe(H.translateExtent)&&P(H.translateExtent)};for(const te of Object.keys(H)){const de=te,ke=H[de];![...a1,...x].includes(de)&&Xe(ke)&&(e[de]=ke)}nr(()=>e.d3Zoom).not.toBeNull().then(V),e.initialized||(e.initialized=!0)};return{updateNodePositions:m,updateNodeDimensions:p,setElements:B,setNodes:D,setEdges:J,addNodes:re,addEdges:_,removeNodes:K,removeEdges:R,findNode:d,findEdge:u,updateEdge:X,updateEdgeData:ee,updateNode:G,updateNodeData:ne,applyEdgeChanges:U,applyNodeChanges:oe,addSelectedElements:k,addSelectedNodes:y,addSelectedEdges:b,setMinZoom:w,setMaxZoom:q,setTranslateExtent:P,setNodeExtent:W,setPaneClickDistance:M,removeSelectedElements:h,removeSelectedNodes:g,removeSelectedEdges:N,startConnection:ce,updateConnection:pe,endConnection:se,setInteractive:$,setState:Ie,getIntersectingNodes:he,getIncomers:r,getOutgoers:l,getConnectedEdges:s,getHandleConnections:c,isNodeIntersecting:Ee,panBy:Se,fitView:j=>i.value.fitView(j),zoomIn:j=>i.value.zoomIn(j),zoomOut:j=>i.value.zoomOut(j),zoomTo:(j,H)=>i.value.zoomTo(j,H),setViewport:(j,H)=>i.value.setViewport(j,H),setTransform:(j,H)=>i.value.setTransform(j,H),getViewport:()=>i.value.getViewport(),getTransform:()=>i.value.getTransform(),setCenter:(j,H,x)=>i.value.setCenter(j,H,x),fitBounds:(j,H)=>i.value.fitBounds(j,H),project:j=>i.value.project(j),screenToFlowCoordinate:j=>i.value.screenToFlowCoordinate(j),flowToScreenCoordinate:j=>i.value.flowToScreenCoordinate(j),toObject:()=>{const j=[],H=[];for(const x of e.nodes){const{computedPosition:T,handleBounds:V,selected:te,dimensions:de,isParent:ke,resizing:ye,dragging:xe,events:$e,...Ve}=x;j.push(Ve)}for(const x of e.edges){const{selected:T,sourceNode:V,targetNode:te,events:de,...ke}=x;H.push(ke)}return JSON.parse(JSON.stringify({nodes:j,edges:H,position:[e.viewport.x,e.viewport.y],zoom:e.viewport.zoom,viewport:e.viewport}))},fromObject:j=>new Promise(H=>{const{nodes:x,edges:T,position:V,zoom:te,viewport:de}=j;x&&D(x),T&&J(T);const[ke,ye]=de!=null&&de.x&&(de!=null&&de.y)?[de.x,de.y]:V??[null,null];if(ke&&ye){const xe=(de==null?void 0:de.zoom)||te||e.viewport.zoom;return nr(()=>i.value.viewportInitialized).toBe(!0).then(()=>{i.value.setViewport({x:ke,y:ye,zoom:xe}).then(()=>{H(!0)})})}else H(!0)}),updateNodeInternals:a,viewportHelper:i,$reset:()=>{const j=Jd();if(e.edges=[],e.nodes=[],e.d3Zoom&&e.d3Selection){const H=Fn.translate(j.defaultViewport.x??0,j.defaultViewport.y??0).scale(fn(j.defaultViewport.zoom??1,j.minZoom,j.maxZoom)),x=e.viewportRef.getBoundingClientRect(),T=[[0,0],[x.width,x.height]],V=e.d3Zoom.constrain()(H,T,j.translateExtent);e.d3Zoom.transform(e.d3Selection,V)}Ie(j)},$destroy:()=>{}}}const l1=["data-id","data-handleid","data-nodeid","data-handlepos"],s1={name:"Handle",compatConfig:{MODE:3}},yn=n.defineComponent({...s1,props:{id:{default:null},type:{},position:{default:()=>Ce.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:t}){const o=n.createPropsRestProxy(e,["position","connectable","connectableStart","connectableEnd","id"]),i=n.toRef(()=>o.type??"source"),a=n.toRef(()=>o.isValidConnection??null),{id:r,connectionStartHandle:l,connectionClickStartHandle:s,connectionEndHandle:c,vueFlowRef:d,nodesConnectable:u,noDragClassName:m,noPanClassName:p}=De(),{id:f,node:y,nodeEl:b,connectedEdges:k}=qd(),g=n.ref(),N=n.toRef(()=>typeof e.connectableStart<"u"?e.connectableStart:!0),h=n.toRef(()=>typeof e.connectableEnd<"u"?e.connectableEnd:!0),w=n.toRef(()=>{var J,B,re,_,K,R;return((J=l.value)==null?void 0:J.nodeId)===f&&((B=l.value)==null?void 0:B.id)===e.id&&((re=l.value)==null?void 0:re.type)===i.value||((_=c.value)==null?void 0:_.nodeId)===f&&((K=c.value)==null?void 0:K.id)===e.id&&((R=c.value)==null?void 0:R.type)===i.value}),q=n.toRef(()=>{var J,B,re;return((J=s.value)==null?void 0:J.nodeId)===f&&((B=s.value)==null?void 0:B.id)===e.id&&((re=s.value)==null?void 0:re.type)===i.value}),{handlePointerDown:P,handleClick:W}=Wd({nodeId:f,handleId:e.id,isValidConnection:a,type:i}),M=n.computed(()=>typeof e.connectable=="string"&&e.connectable==="single"?!k.value.some(J=>{const B=J[`${i.value}Handle`];return J[i.value]!==f?!1:B?B===e.id:!0}):typeof e.connectable=="number"?k.value.filter(J=>{const B=J[`${i.value}Handle`];return J[i.value]!==f?!1:B?B===e.id:!0}).length<e.connectable:typeof e.connectable=="function"?e.connectable(y,k.value):Xe(e.connectable)?e.connectable:u.value);n.onMounted(()=>{var J;if(!y.dimensions.width||!y.dimensions.height)return;const B=(J=y.handleBounds[i.value])==null?void 0:J.find(oe=>oe.id===e.id);if(!d.value||B)return;const re=d.value.querySelector(".vue-flow__transformationpane");if(!b.value||!g.value||!re||!e.id)return;const _=b.value.getBoundingClientRect(),K=g.value.getBoundingClientRect(),R=window.getComputedStyle(re),{m22:X}=new window.DOMMatrixReadOnly(R.transform),ee={id:e.id,position:e.position,x:(K.left-_.left)/X,y:(K.top-_.top)/X,type:i.value,nodeId:f,...ji(g.value)};y.handleBounds[i.value]=[...y.handleBounds[i.value]??[],ee]});function $(J){const B=Ar(J);M.value&&N.value&&(B&&J.button===0||!B)&&P(J)}function D(J){!f||!s.value&&!N.value||M.value&&W(J)}return t({handleClick:W,handlePointerDown:P,onClick:D,onPointerDown:$}),(J,B)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"handle",ref:g,"data-id":`${n.unref(r)}-${n.unref(f)}-${e.id}-${i.value}`,"data-handleid":e.id,"data-nodeid":n.unref(f),"data-handlepos":J.position,class:n.normalizeClass(["vue-flow__handle",[`vue-flow__handle-${J.position}`,`vue-flow__handle-${e.id}`,n.unref(m),n.unref(p),i.value,{connectable:M.value,connecting:q.value,connectablestart:N.value,connectableend:h.value,connectionindicator:M.value&&(N.value&&!w.value||h.value&&w.value)}]]),onMousedown:$,onTouchstartPassive:$,onClick:D},[n.renderSlot(J.$slots,"default",{id:J.id})],42,l1))}}),Zi=function({sourcePosition:e=Ce.Bottom,targetPosition:t=Ce.Top,label:o,connectable:i=!0,isValidTargetPos:a,isValidSourcePos:r,data:l}){const s=l.label??o;return[n.h(yn,{type:"target",position:t,connectable:i,isValidConnection:a}),typeof s!="string"&&s?n.h(s):n.h(n.Fragment,[s]),n.h(yn,{type:"source",position:e,connectable:i,isValidConnection:r})]};Zi.props=["sourcePosition","targetPosition","label","isValidTargetPos","isValidSourcePos","connectable","data"],Zi.inheritAttrs=!1,Zi.compatConfig={MODE:3};const c1=Zi,Qi=function({targetPosition:e=Ce.Top,label:t,connectable:o=!0,isValidTargetPos:i,data:a}){const r=a.label??t;return[n.h(yn,{type:"target",position:e,connectable:o,isValidConnection:i}),typeof r!="string"&&r?n.h(r):n.h(n.Fragment,[r])]};Qi.props=["targetPosition","label","isValidTargetPos","connectable","data"],Qi.inheritAttrs=!1,Qi.compatConfig={MODE:3};const d1=Qi,ea=function({sourcePosition:e=Ce.Bottom,label:t,connectable:o=!0,isValidSourcePos:i,data:a}){const r=a.label??t;return[typeof r!="string"&&r?n.h(r):n.h(n.Fragment,[r]),n.h(yn,{type:"source",position:e,connectable:o,isValidConnection:i})]};ea.props=["sourcePosition","label","isValidSourcePos","connectable","data"],ea.inheritAttrs=!1,ea.compatConfig={MODE:3};const u1=ea,m1=["transform"],f1=["width","height","x","y","rx","ry"],p1=["y"],h1={name:"EdgeText",compatConfig:{MODE:3}},y1=n.defineComponent({...h1,props:{x:{},y:{},label:{},labelStyle:{default:()=>({})},labelShowBg:{type:Boolean,default:!0},labelBgStyle:{default:()=>({})},labelBgPadding:{default:()=>[2,4]},labelBgBorderRadius:{default:2}},setup(e){const t=n.ref({x:0,y:0,width:0,height:0}),o=n.ref(null),i=n.computed(()=>`translate(${e.x-t.value.width/2} ${e.y-t.value.height/2})`);n.onMounted(a),n.watch([()=>e.x,()=>e.y,o,()=>e.label],a);function a(){if(!o.value)return;const r=o.value.getBBox();(r.width!==t.value.width||r.height!==t.value.height)&&(t.value=r)}return(r,l)=>(n.openBlock(),n.createElementBlock("g",{transform:i.value,class:"vue-flow__edge-textwrapper"},[r.labelShowBg?(n.openBlock(),n.createElementBlock("rect",{key:0,class:"vue-flow__edge-textbg",width:`${t.value.width+2*r.labelBgPadding[0]}px`,height:`${t.value.height+2*r.labelBgPadding[1]}px`,x:-r.labelBgPadding[0],y:-r.labelBgPadding[1],style:n.normalizeStyle(r.labelBgStyle),rx:r.labelBgBorderRadius,ry:r.labelBgBorderRadius},null,12,f1)):n.createCommentVNode("",!0),n.createElementVNode("text",n.mergeProps(r.$attrs,{ref_key:"el",ref:o,class:"vue-flow__edge-text",y:t.value.height/2,dy:"0.3em",style:r.labelStyle}),[n.renderSlot(r.$slots,"default",{},()=>[typeof r.label!="string"?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(r.label),{key:0})):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createTextVNode(n.toDisplayString(r.label),1)],64))])],16,p1)],8,m1))}}),g1=["id","d","marker-end","marker-start"],b1=["d","stroke-width"],_1={name:"BaseEdge",inheritAttrs:!1,compatConfig:{MODE:3}},ta=n.defineComponent({..._1,props:{id:{},labelX:{},labelY:{},path:{},label:{},markerStart:{},markerEnd:{},interactionWidth:{default:20},labelStyle:{},labelShowBg:{type:Boolean},labelBgStyle:{},labelBgPadding:{},labelBgBorderRadius:{}},setup(e,{expose:t}){const o=n.ref(null),i=n.ref(null),a=n.ref(null),r=n.useAttrs();return t({pathEl:o,interactionEl:i,labelEl:a}),(l,s)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",n.mergeProps(n.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,g1),l.interactionWidth?(n.openBlock(),n.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,b1)):n.createCommentVNode("",!0),l.label&&l.labelX&&l.labelY?(n.openBlock(),n.createBlock(y1,{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"])):n.createCommentVNode("",!0)],64))}});function Zd({sourceX:e,sourceY:t,targetX:o,targetY:i}){const a=Math.abs(o-e)/2,r=o<e?o+a:o-a,l=Math.abs(i-t)/2,s=i<t?i+l:i-l;return[r,s,a,l]}function Qd({sourceX:e,sourceY:t,targetX:o,targetY:i,sourceControlX:a,sourceControlY:r,targetControlX:l,targetControlY:s}){const c=e*.125+a*.375+l*.375+o*.125,d=t*.125+r*.375+s*.375+i*.125,u=Math.abs(c-e),m=Math.abs(d-t);return[c,d,u,m]}function na(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function eu({pos:e,x1:t,y1:o,x2:i,y2:a,c:r}){let l,s;switch(e){case Ce.Left:l=t-na(t-i,r),s=o;break;case Ce.Right:l=t+na(i-t,r),s=o;break;case Ce.Top:l=t,s=o-na(o-a,r);break;case Ce.Bottom:l=t,s=o+na(a-o,r);break}return[l,s]}function tu(e){const{sourceX:t,sourceY:o,sourcePosition:i=Ce.Bottom,targetX:a,targetY:r,targetPosition:l=Ce.Top,curvature:s=.25}=e,[c,d]=eu({pos:i,x1:t,y1:o,x2:a,y2:r,c:s}),[u,m]=eu({pos:l,x1:a,y1:r,x2:t,y2:o,c:s}),[p,f,y,b]=Qd({sourceX:t,sourceY:o,targetX:a,targetY:r,sourceControlX:c,sourceControlY:d,targetControlX:u,targetControlY:m});return[`M${t},${o} C${c},${d} ${u},${m} ${a},${r}`,p,f,y,b]}function nu({pos:e,x1:t,y1:o,x2:i,y2:a}){let r,l;switch(e){case Ce.Left:case Ce.Right:r=.5*(t+i),l=o;break;case Ce.Top:case Ce.Bottom:r=t,l=.5*(o+a);break}return[r,l]}function ou(e){const{sourceX:t,sourceY:o,sourcePosition:i=Ce.Bottom,targetX:a,targetY:r,targetPosition:l=Ce.Top}=e,[s,c]=nu({pos:i,x1:t,y1:o,x2:a,y2:r}),[d,u]=nu({pos:l,x1:a,y1:r,x2:t,y2:o}),[m,p,f,y]=Qd({sourceX:t,sourceY:o,targetX:a,targetY:r,sourceControlX:s,sourceControlY:c,targetControlX:d,targetControlY:u});return[`M${t},${o} C${s},${c} ${d},${u} ${a},${r}`,m,p,f,y]}const iu={[Ce.Left]:{x:-1,y:0},[Ce.Right]:{x:1,y:0},[Ce.Top]:{x:0,y:-1},[Ce.Bottom]:{x:0,y:1}};function k1({source:e,sourcePosition:t=Ce.Bottom,target:o}){return t===Ce.Left||t===Ce.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 au(e,t){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}function E1({source:e,sourcePosition:t=Ce.Bottom,target:o,targetPosition:i=Ce.Top,center:a,offset:r}){const l=iu[t],s=iu[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=k1({source:c,sourcePosition:t,target:d}),m=u.x!==0?"x":"y",p=u[m];let f,y,b;const k={x:0,y:0},g={x:0,y:0},[N,h,w,q]=Zd({sourceX:e.x,sourceY:e.y,targetX:o.x,targetY:o.y});if(l[m]*s[m]===-1){y=a.x??N,b=a.y??h;const W=[{x:y,y:c.y},{x:y,y:d.y}],M=[{x:c.x,y:b},{x:d.x,y:b}];l[m]===p?f=m==="x"?W:M:f=m==="x"?M:W}else{const W=[{x:c.x,y:d.y}],M=[{x:d.x,y:c.y}];if(m==="x"?f=l.x===p?M:W:f=l.y===p?W:M,t===i){const re=Math.abs(e[m]-o[m]);if(re<=r){const _=Math.min(r-1,r-re);l[m]===p?k[m]=(c[m]>e[m]?-1:1)*_:g[m]=(d[m]>o[m]?-1:1)*_}}if(t!==i){const re=m==="x"?"y":"x",_=l[m]===s[re],K=c[re]>d[re],R=c[re]<d[re];(l[m]===1&&(!_&&K||_&&R)||l[m]!==1&&(!_&&R||_&&K))&&(f=m==="x"?W:M)}const $={x:c.x+k.x,y:c.y+k.y},D={x:d.x+g.x,y:d.y+g.y},J=Math.max(Math.abs($.x-f[0].x),Math.abs(D.x-f[0].x)),B=Math.max(Math.abs($.y-f[0].y),Math.abs(D.y-f[0].y));J>=B?(y=($.x+D.x)/2,b=f[0].y):(y=f[0].x,b=($.y+D.y)/2)}return[[e,{x:c.x+k.x,y:c.y+k.y},...f,{x:d.x+g.x,y:d.y+g.y},o],y,b,w,q]}function w1(e,t,o,i){const a=Math.min(au(e,t)/2,au(t,o)/2,i),{x:r,y:l}=t;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 Pr(e){const{sourceX:t,sourceY:o,sourcePosition:i=Ce.Bottom,targetX:a,targetY:r,targetPosition:l=Ce.Top,borderRadius:s=5,centerX:c,centerY:d,offset:u=20}=e,[m,p,f,y,b]=E1({source:{x:t,y:o},sourcePosition:i,target:{x:a,y:r},targetPosition:l,center:{x:c,y:d},offset:u});return[m.reduce((g,N,h)=>{let w;return h>0&&h<m.length-1?w=w1(m[h-1],N,m[h+1],s):w=`${h===0?"M":"L"}${N.x} ${N.y}`,g+=w,g},""),p,f,y,b]}function N1(e){const{sourceX:t,sourceY:o,targetX:i,targetY:a}=e,[r,l,s,c]=Zd({sourceX:t,sourceY:o,targetX:i,targetY:a});return[`M ${t},${o}L ${i},${a}`,r,l,s,c]}const v1=n.defineComponent({name:"StraightEdge",props:["label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],compatConfig:{MODE:3},setup(e,{attrs:t}){return()=>{const[o,i,a]=N1(e);return n.h(ta,{path:o,labelX:i,labelY:a,...t,...e})}}}),ru=n.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:t}){return()=>{const[o,i,a]=Pr({...e,sourcePosition:e.sourcePosition??Ce.Bottom,targetPosition:e.targetPosition??Ce.Top});return n.h(ta,{path:o,labelX:i,labelY:a,...t,...e})}}}),x1=n.defineComponent({name:"StepEdge",props:["sourcePosition","targetPosition","label","labelStyle","labelShowBg","labelBgStyle","labelBgPadding","labelBgBorderRadius","sourceY","sourceX","targetX","targetY","markerEnd","markerStart","interactionWidth"],setup(e,{attrs:t}){return()=>n.h(ru,{...e,...t,borderRadius:0})}}),C1=n.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:t}){return()=>{const[o,i,a]=tu({...e,sourcePosition:e.sourcePosition??Ce.Bottom,targetPosition:e.targetPosition??Ce.Top});return n.h(ta,{path:o,labelX:i,labelY:a,...t,...e})}}}),I1=n.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:t}){return()=>{const[o,i,a]=ou({...e,sourcePosition:e.sourcePosition??Ce.Bottom,targetPosition:e.targetPosition??Ce.Top});return n.h(ta,{path:o,labelX:i,labelY:a,...t,...e})}}}),S1={input:u1,default:c1,output:d1},$1={default:C1,straight:v1,step:x1,smoothstep:ru,simplebezier:I1};function R1(e,t,o){const i=n.computed(()=>b=>t.value.get(b)),a=n.computed(()=>b=>o.value.get(b)),r=n.computed(()=>{const b={...$1,...e.edgeTypes},k=Object.keys(b);for(const g of e.edges)g.type&&!k.includes(g.type)&&(b[g.type]=g.type);return b}),l=n.computed(()=>{const b={...S1,...e.nodeTypes},k=Object.keys(b);for(const g of e.nodes)g.type&&!k.includes(g.type)&&(b[g.type]=g.type);return b}),s=n.computed(()=>e.onlyRenderVisibleElements?wd(e.nodes,{x:0,y:0,width:e.dimensions.width,height:e.dimensions.height},e.viewport,!0):e.nodes),c=n.computed(()=>{if(e.onlyRenderVisibleElements){const b=[];for(const k of e.edges){const g=t.value.get(k.source),N=t.value.get(k.target);A_({sourcePos:g.computedPosition||{x:0,y:0},targetPos:N.computedPosition||{x:0,y:0},sourceWidth:g.dimensions.width,sourceHeight:g.dimensions.height,targetWidth:N.dimensions.width,targetHeight:N.dimensions.height,width:e.dimensions.width,height:e.dimensions.height,viewport:e.viewport})&&b.push(k)}return b}return e.edges}),d=n.computed(()=>[...s.value,...c.value]),u=n.computed(()=>{const b=[];for(const k of e.nodes)k.selected&&b.push(k);return b}),m=n.computed(()=>{const b=[];for(const k of e.edges)k.selected&&b.push(k);return b}),p=n.computed(()=>[...u.value,...m.value]),f=n.computed(()=>{const b=[];for(const k of e.nodes)k.dimensions.width&&k.dimensions.height&&k.handleBounds!==void 0&&b.push(k);return b}),y=n.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:y}}class gn{constructor(){this.currentId=0,this.flows=new Map}static getInstance(){var t;const o=(t=n.getCurrentInstance())==null?void 0:t.appContext.app,i=(o==null?void 0:o.config.globalProperties.$vueFlowStorage)??gn.instance;return gn.instance=i??new gn,o&&(o.config.globalProperties.$vueFlowStorage=gn.instance),gn.instance}set(t,o){return this.flows.set(t,o)}get(t){return this.flows.get(t)}remove(t){return this.flows.delete(t)}create(t,o){const i=Jd(),a=n.reactive(i),r={};for(const[p,f]of Object.entries(a.hooks)){const y=`on${p.charAt(0).toUpperCase()+p.slice(1)}`;r[y]=f.on}const l={};for(const[p,f]of Object.entries(a.hooks))l[p]=f.trigger;const s=n.computed(()=>{const p=new Map;for(const f of a.nodes)p.set(f.id,f);return p}),c=n.computed(()=>{const p=new Map;for(const f of a.edges)p.set(f.id,f);return p}),d=R1(a,s,c),u=r1(a,s,c);u.setState({...a,...o});const m={...r,...d,...u,...Ih(a),nodeLookup:s,edgeLookup:c,emits:l,id:t,vueFlowVersion:"1.48.2",$destroy:()=>{this.remove(t)}};return this.set(t,m),m}getId(){return`vue-flow-${this.currentId++}`}}function De(e){const t=gn.getInstance(),o=n.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=n.inject(Gd,null);typeof c<"u"&&c!==null&&(!l||c.id===l)&&(s=c)}if(s||l&&(s=t.get(l)),!s||l&&s.id!==l){const c=r??t.getId(),d=t.create(c,a);s=d,(o??n.effectScope(!0)).run(()=>{n.watch(d.applyDefault,(m,p,f)=>{const y=k=>{d.applyNodeChanges(k)},b=k=>{d.applyEdgeChanges(k)};m?(d.onNodesChange(y),d.onEdgesChange(b)):(d.hooks.value.nodesChange.off(y),d.hooks.value.edgesChange.off(b)),f(()=>{d.hooks.value.nodesChange.off(y),d.hooks.value.edgesChange.off(b)})},{immediate:!0}),yo(()=>{if(s){const m=t.get(s.id);m?m.$destroy():Bo(`No store instance found for id ${s.id} in storage.`)}})})}else i&&s.setState(a);if(o&&(n.provide(Gd,s),o.vueFlowId=s.id),i){const c=n.getCurrentInstance();(c==null?void 0:c.type.name)!=="VueFlow"&&s.emits.error(new Qe(qe.USEVUEFLOW_OPTIONS))}return s}function A1(e){const{emits:t,dimensions:o}=De();let i;n.onMounted(()=>{const a=()=>{var r,l;if(!e.value||!(((l=(r=e.value).checkVisibility)==null?void 0:l.call(r))??!0))return;const s=ji(e.value);(s.width===0||s.height===0)&&t.error(new Qe(qe.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)),n.onBeforeUnmount(()=>{window.removeEventListener("resize",a),i&&e.value&&i.unobserve(e.value)})})}const T1={name:"UserSelection",compatConfig:{MODE:3}},V1=n.defineComponent({...T1,props:{userSelectionRect:{}},setup(e){return(t,o)=>(n.openBlock(),n.createElementBlock("div",{class:"vue-flow__selection vue-flow__container",style:n.normalizeStyle({width:`${t.userSelectionRect.width}px`,height:`${t.userSelectionRect.height}px`,transform:`translate(${t.userSelectionRect.x}px, ${t.userSelectionRect.y}px)`})},null,4))}}),M1=["tabIndex"],B1={name:"NodesSelection",compatConfig:{MODE:3}},D1=n.defineComponent({...B1,setup(e){const{emits:t,viewport:o,getSelectedNodes:i,noPanClassName:a,disableKeyboardA11y:r,userSelectionActive:l}=De(),s=Xd(),c=n.ref(null),d=Yd({el:c,onStart(y){t.selectionDragStart(y),t.nodeDragStart(y)},onDrag(y){t.selectionDrag(y),t.nodeDrag(y)},onStop(y){t.selectionDragStop(y),t.nodeDragStop(y)}});n.onMounted(()=>{var y;r.value||(y=c.value)==null||y.focus({preventScroll:!0})});const u=n.computed(()=>Cr(i.value)),m=n.computed(()=>({width:`${u.value.width}px`,height:`${u.value.height}px`,top:`${u.value.y}px`,left:`${u.value.x}px`}));function p(y){t.selectionContextMenu({event:y,nodes:i.value})}function f(y){r.value||Gn[y.key]&&(y.preventDefault(),s({x:Gn[y.key].x,y:Gn[y.key].y},y.shiftKey))}return(y,b)=>!n.unref(l)&&u.value.width&&u.value.height?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["vue-flow__nodesselection vue-flow__container",n.unref(a)]),style:n.normalizeStyle({transform:`translate(${n.unref(o).x}px,${n.unref(o).y}px) scale(${n.unref(o).zoom})`})},[n.createElementVNode("div",{ref_key:"el",ref:c,class:n.normalizeClass([{dragging:n.unref(d)},"vue-flow__nodesselection-rect"]),style:n.normalizeStyle(m.value),tabIndex:n.unref(r)?void 0:-1,onContextmenu:p,onKeydown:f},null,46,M1)],6)):n.createCommentVNode("",!0)}});function O1(e,t){return{x:e.clientX-t.left,y:e.clientY-t.top}}const P1={name:"Pane",compatConfig:{MODE:3}},L1=n.defineComponent({...P1,props:{isSelecting:{type:Boolean},selectionKeyPressed:{type:Boolean}},setup(e){const{vueFlowRef:t,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:y,deleteKeyCode:b,multiSelectionKeyCode:k,multiSelectionActive:g,edgeLookup:N,nodeLookup:h,connectionLookup:w,defaultEdgeOptions:q,connectionStartHandle:P,panOnDrag:W}=De(),M=n.shallowRef(null),$=n.shallowRef(new Set),D=n.shallowRef(new Set),J=n.shallowRef(null),B=n.toRef(()=>c.value&&(e.isSelecting||r.value)),re=n.toRef(()=>P.value!==null);let _=!1,K=!1;const R=$o(b,{actInsideInputWithModifier:!1}),X=$o(k);n.watch(R,se=>{se&&(p(m.value),f(u.value),d.value=!1)}),n.watch(X,se=>{g.value=se});function ee(se,me){return he=>{he.target===me&&(se==null||se(he))}}function oe(se){if(_||re.value){_=!1;return}a.paneClick(se),l(),d.value=!1}function U(se){var me;if(Array.isArray(W.value)&&((me=W.value)!=null&&me.includes(2))){se.preventDefault();return}a.paneContextMenu(se)}function G(se){a.paneScroll(se)}function ne(se){var me,he,Ee;if(J.value=((me=t.value)==null?void 0:me.getBoundingClientRect())??null,!c.value||!e.isSelecting||se.button!==0||se.target!==M.value||!J.value)return;(Ee=(he=se.target)==null?void 0:he.setPointerCapture)==null||Ee.call(he,se.pointerId);const{x:Se,y:Ie}=O1(se,J.value);K=!0,_=!1,l(),s.value={width:0,height:0,startX:Se,startY:Ie,x:Se,y:Ie},a.selectionStart(se)}function ce(se){var me;if(!J.value||!s.value)return;_=!0;const{x:he,y:Ee}=$t(se,J.value),{startX:Se=0,startY:Ie=0}=s.value,fe={startX:Se,startY:Ie,x:he<Se?he:Se,y:Ee<Ie?Ee:Ie,width:Math.abs(he-Se),height:Math.abs(Ee-Ie)},ge=$.value,_e=D.value;$.value=new Set(wd(o.value,fe,i.value,y.value===Nr.Partial,!0).map(H=>H.id)),D.value=new Set;const j=((me=q.value)==null?void 0:me.selectable)??!0;for(const H of $.value){const x=w.value.get(H);if(x)for(const{edgeId:T}of x.values()){const V=N.value.get(T);V&&(V.selectable??j)&&D.value.add(T)}}if(!Fd(ge,$.value)){const H=qt(h.value,$.value,!0);a.nodesChange(H)}if(!Fd(_e,D.value)){const H=qt(N.value,D.value);a.edgesChange(H)}s.value=fe,r.value=!0,d.value=!1}function pe(se){var me;se.button!==0||!K||((me=se.target)==null||me.releasePointerCapture(se.pointerId),!r.value&&s.value&&se.target===M.value&&oe(se),r.value=!1,s.value=null,d.value=$.value.size>0,a.selectionEnd(se),e.selectionKeyPressed&&(_=!1),K=!1)}return(se,me)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"container",ref:M,class:n.normalizeClass(["vue-flow__pane vue-flow__container",{selection:se.isSelecting}]),onClick:me[0]||(me[0]=he=>B.value?void 0:ee(oe,M.value)(he)),onContextmenu:me[1]||(me[1]=he=>ee(U,M.value)(he)),onWheelPassive:me[2]||(me[2]=he=>ee(G,M.value)(he)),onPointerenter:me[3]||(me[3]=he=>B.value?void 0:n.unref(a).paneMouseEnter(he)),onPointerdown:me[4]||(me[4]=he=>B.value?ne(he):n.unref(a).paneMouseMove(he)),onPointermove:me[5]||(me[5]=he=>B.value?ce(he):n.unref(a).paneMouseMove(he)),onPointerup:me[6]||(me[6]=he=>B.value?pe(he):void 0),onPointerleave:me[7]||(me[7]=he=>n.unref(a).paneMouseLeave(he))},[n.renderSlot(se.$slots,"default"),n.unref(r)&&n.unref(s)?(n.openBlock(),n.createBlock(V1,{key:0,"user-selection-rect":n.unref(s)},null,8,["user-selection-rect"])):n.createCommentVNode("",!0),n.unref(d)&&n.unref(m).length?(n.openBlock(),n.createBlock(D1,{key:1})):n.createCommentVNode("",!0)],34))}}),z1={name:"Transform",compatConfig:{MODE:3}},U1=n.defineComponent({...z1,setup(e){const{viewport:t,fitViewOnInit:o,fitViewOnInitDone:i}=De(),a=n.computed(()=>o.value?!i.value:!1),r=n.computed(()=>`translate(${t.value.x}px,${t.value.y}px) scale(${t.value.zoom})`);return(l,s)=>(n.openBlock(),n.createElementBlock("div",{class:"vue-flow__transformationpane vue-flow__container",style:n.normalizeStyle({transform:r.value,opacity:a.value?0:void 0})},[n.renderSlot(l.$slots,"default")],4))}}),H1={name:"Viewport",compatConfig:{MODE:3}},F1=n.defineComponent({...H1,setup(e){const{minZoom:t,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:y,preventScrolling:b,noWheelClassName:k,noPanClassName:g,emits:N,connectionStartHandle:h,userSelectionActive:w,paneDragging:q,d3Zoom:P,d3Selection:W,d3ZoomHandler:M,viewport:$,viewportRef:D,paneClickDistance:J}=De();A1(D);const B=n.shallowRef(!1),re=n.shallowRef(!1);let _=null,K=!1,R=0,X={x:0,y:0,zoom:0};const ee=$o(s),oe=$o(l),U=$o(r),G=n.toRef(()=>(!oe.value||oe.value&&l.value===!0)&&(ee.value||m.value)),ne=n.toRef(()=>ee.value||c.value),ce=n.toRef(()=>l.value===!0&&G.value!==!0),pe=n.toRef(()=>oe.value&&l.value!==!0||w.value||ce.value),se=n.toRef(()=>h.value!==null);n.onMounted(()=>{if(!D.value){Bo("Viewport element is missing");return}const Ie=D.value,fe=Ie.getBoundingClientRect(),ge=u_().clickDistance(J.value).scaleExtent([t.value,o.value]).translateExtent(a.value),_e=gt(Ie).call(ge),j=_e.on("wheel.zoom"),H=Fn.translate(i.value.x??0,i.value.y??0).scale(fn(i.value.zoom??1,t.value,o.value)),x=[[0,0],[fe.width,fe.height]],T=ge.constrain()(H,x,a.value);ge.transform(_e,T),ge.wheelDelta(Ir),P.value=ge,W.value=_e,M.value=j,$.value={x:T.x,y:T.y,zoom:T.k},ge.on("start",V=>{var te;if(!V.sourceEvent)return null;R=V.sourceEvent.button,B.value=!0;const de=Ee(V.transform);((te=V.sourceEvent)==null?void 0:te.type)==="mousedown"&&(q.value=!0),X=de,N.viewportChangeStart(de),N.moveStart({event:V,flowTransform:de})}),ge.on("end",V=>{if(!V.sourceEvent)return null;if(B.value=!1,q.value=!1,me(G.value,R??0)&&!K&&N.paneContextMenu(V.sourceEvent),K=!1,he(X,V.transform)){const te=Ee(V.transform);X=te,N.viewportChangeEnd(te),N.moveEnd({event:V,flowTransform:te})}}),ge.filter(V=>{var te;const de=U.value||y.value,ke=f.value&&V.ctrlKey,ye=V.button,xe=V.type==="wheel";if(ye===1&&V.type==="mousedown"&&(Se(V,"vue-flow__node")||Se(V,"vue-flow__edge")))return!0;if(!G.value&&!de&&!ne.value&&!p.value&&!f.value||w.value||se.value&&!xe||!p.value&&V.type==="dblclick"||Se(V,k.value)&&xe||Se(V,g.value)&&(!xe||ne.value&&xe&&!U.value)||!f.value&&V.ctrlKey&&xe||!de&&!ne.value&&!ke&&xe)return!1;if(!f&&V.type==="touchstart"&&((te=V.touches)==null?void 0:te.length)>1)return V.preventDefault(),!1;if(!G.value&&(V.type==="mousedown"||V.type==="touchstart")||ce.value&&Array.isArray(m.value)&&m.value.includes(0)&&ye===0||Array.isArray(m.value)&&!m.value.includes(ye)&&(V.type==="mousedown"||V.type==="touchstart"))return!1;const $e=Array.isArray(m.value)&&m.value.includes(ye)||l.value===!0&&Array.isArray(m.value)&&!m.value.includes(0)||!ye||ye<=1;return(!V.ctrlKey||ee.value||xe)&&$e}),n.watch([w,G],()=>{w.value&&!B.value?ge.on("zoom",null):w.value||ge.on("zoom",V=>{$.value={x:V.transform.x,y:V.transform.y,zoom:V.transform.k};const te=Ee(V.transform);K=me(G.value,R??0),N.viewportChange(te),N.move({event:V,flowTransform:te})})},{immediate:!0}),n.watch([w,ne,d,U,f,b,k],()=>{ne.value&&!U.value&&!w.value?_e.on("wheel.zoom",V=>{if(Se(V,k.value))return!1;const te=U.value||y.value,de=f.value&&V.ctrlKey;if(!(!b.value||ne.value||te||de))return!1;V.preventDefault(),V.stopImmediatePropagation();const ye=_e.property("__zoom").k||1,xe=Mo();if(!ee.value&&V.ctrlKey&&f.value&&xe){const ut=xt(V),C=Ir(V),z=ye*2**C;ge.scaleTo(_e,z,ut,V);return}const $e=V.deltaMode===1?20:1;let Ve=d.value===So.Vertical?0:V.deltaX*$e,Le=d.value===So.Horizontal?0:V.deltaY*$e;!xe&&V.shiftKey&&d.value!==So.Vertical&&!Ve&&Le&&(Ve=Le,Le=0),ge.translateBy(_e,-(Ve/ye)*u.value,-(Le/ye)*u.value);const je=Ee(_e.property("__zoom"));_&&clearTimeout(_),re.value?(N.move({event:V,flowTransform:je}),N.viewportChange(je),_=setTimeout(()=>{N.moveEnd({event:V,flowTransform:je}),N.viewportChangeEnd(je),re.value=!1},150)):(re.value=!0,N.moveStart({event:V,flowTransform:je}),N.viewportChangeStart(je))},{passive:!1}):typeof j<"u"&&_e.on("wheel.zoom",function(V,te){const de=!b.value&&V.type==="wheel"&&!V.ctrlKey,ke=U.value||y.value,ye=f.value&&V.ctrlKey;if(!ke&&!c.value&&!ye&&V.type==="wheel"||de||Se(V,k.value))return null;V.preventDefault(),j.call(this,V,te)},{passive:!1})},{immediate:!0})});function me(Ie,fe){return fe===2&&Array.isArray(Ie)&&Ie.includes(2)}function he(Ie,fe){return Ie.x!==fe.x&&!Number.isNaN(fe.x)||Ie.y!==fe.y&&!Number.isNaN(fe.y)||Ie.zoom!==fe.k&&!Number.isNaN(fe.k)}function Ee(Ie){return{x:Ie.x,y:Ie.y,zoom:Ie.k}}function Se(Ie,fe){return Ie.target.closest(`.${fe}`)}return(Ie,fe)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"viewportRef",ref:D,class:"vue-flow__viewport vue-flow__container"},[n.createVNode(L1,{"is-selecting":pe.value,"selection-key-pressed":n.unref(oe),class:n.normalizeClass({connecting:se.value,dragging:n.unref(q),draggable:n.unref(m)===!0||Array.isArray(n.unref(m))&&n.unref(m).includes(0)})},{default:n.withCtx(()=>[n.createVNode(U1,null,{default:n.withCtx(()=>[n.renderSlot(Ie.$slots,"default")]),_:3})]),_:3},8,["is-selecting","selection-key-pressed","class"])],512))}}),G1=["id"],j1=["id"],K1=["id"],Y1={name:"A11yDescriptions",compatConfig:{MODE:3}},W1=n.defineComponent({...Y1,setup(e){const{id:t,disableKeyboardA11y:o,ariaLiveMessage:i}=De();return(a,r)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("div",{id:`${n.unref(md)}-${n.unref(t)}`,style:{display:"none"}}," Press enter or space to select a node. "+n.toDisplayString(n.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,G1),n.createElementVNode("div",{id:`${n.unref(fd)}-${n.unref(t)}`,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,j1),n.unref(o)?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("div",{key:0,id:`${n.unref(g_)}-${n.unref(t)}`,"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%)"}},n.toDisplayString(n.unref(i)),9,K1))],64))}});function q1(){const e=De();n.watch(()=>e.viewportHelper.value.viewportInitialized,t=>{t&&setTimeout(()=>{e.emits.init(e),e.emits.paneReady(e)},1)})}function X1(e,t,o){return o===Ce.Left?e-t:o===Ce.Right?e+t:e}function J1(e,t,o){return o===Ce.Top?e-t:o===Ce.Bottom?e+t:e}const Lr=function({radius:e=10,centerX:t=0,centerY:o=0,position:i=Ce.Top,type:a}){return n.h("circle",{class:`vue-flow__edgeupdater vue-flow__edgeupdater-${a}`,cx:X1(t,e,i),cy:J1(o,e,i),r:e,stroke:"transparent",fill:"transparent"})};Lr.props=["radius","centerX","centerY","position","type"],Lr.compatConfig={MODE:3};const lu=Lr,Z1=n.defineComponent({name:"Edge",compatConfig:{MODE:3},props:["id"],setup(e){const{id:t,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:y,elementsSelectable:b,edgesUpdatable:k,edgesFocusable:g,hooks:N}=De(),h=n.computed(()=>u(e.id)),{emit:w,on:q}=Y_(h.value,r),P=n.inject(qi),W=n.getCurrentInstance(),M=n.ref(!1),$=n.ref(!1),D=n.ref(""),J=n.ref(null),B=n.ref("source"),re=n.ref(null),_=n.toRef(()=>typeof h.value.selectable>"u"?b.value:h.value.selectable),K=n.toRef(()=>typeof h.value.updatable>"u"?k.value:h.value.updatable),R=n.toRef(()=>typeof h.value.focusable>"u"?g.value:h.value.focusable);n.provide(G_,e.id),n.provide(j_,re);const X=n.computed(()=>h.value.class instanceof Function?h.value.class(h.value):h.value.class),ee=n.computed(()=>h.value.style instanceof Function?h.value.style(h.value):h.value.style),oe=n.computed(()=>{const H=h.value.type||"default",x=P==null?void 0:P[`edge-${H}`];if(x)return x;let T=h.value.template??c.value[H];if(typeof T=="string"&&W){const V=Object.keys(W.appContext.components);V&&V.includes(H)&&(T=n.resolveComponent(H,!1))}return T&&typeof T!="string"?T:(r.error(new Qe(qe.EDGE_TYPE_MISSING,T)),!1)}),{handlePointerDown:U}=Wd({nodeId:D,handleId:J,type:B,isValidConnection:p,edgeUpdaterType:B,onEdgeUpdate:ce,onEdgeUpdateEnd:pe});return()=>{const H=m(h.value.source),x=m(h.value.target),T="pathOptions"in h.value?h.value.pathOptions:{};if(!H&&!x)return r.error(new Qe(qe.EDGE_SOURCE_TARGET_MISSING,h.value.id,h.value.source,h.value.target)),null;if(!H)return r.error(new Qe(qe.EDGE_SOURCE_MISSING,h.value.id,h.value.source)),null;if(!x)return r.error(new Qe(qe.EDGE_TARGET_MISSING,h.value.id,h.value.target)),null;if(!h.value||h.value.hidden||H.hidden||x.hidden)return null;let V;i.value===Lt.Strict?V=H.handleBounds.source:V=[...H.handleBounds.source||[],...H.handleBounds.target||[]];const te=Md(V,h.value.sourceHandle);let de;i.value===Lt.Strict?de=x.handleBounds.target:de=[...x.handleBounds.target||[],...x.handleBounds.source||[]];const ke=Md(de,h.value.targetHandle),ye=(te==null?void 0:te.position)||Ce.Bottom,xe=(ke==null?void 0:ke.position)||Ce.Top,{x:$e,y:Ve}=Kn(H,te,ye),{x:Le,y:je}=Kn(x,ke,xe);return h.value.sourceX=$e,h.value.sourceY=Ve,h.value.targetX=Le,h.value.targetY=je,n.h("g",{ref:re,key:e.id,"data-id":e.id,class:["vue-flow__edge",`vue-flow__edge-${oe.value===!1?"default":h.value.type||"default"}`,s.value,X.value,{updating:M.value,selected:h.value.selected,animated:h.value.animated,inactive:!_.value&&!N.value.edgeClick.hasListeners()}],tabIndex:R.value?0:void 0,"aria-label":h.value.ariaLabel===null?void 0:h.value.ariaLabel??`Edge from ${h.value.source} to ${h.value.target}`,"aria-describedby":R.value?`${fd}-${t}`:void 0,"aria-roledescription":"edge",role:R.value?"group":"img",...h.value.domAttributes,onClick:me,onContextmenu:he,onDblclick:Ee,onMouseenter:Se,onMousemove:Ie,onMouseleave:fe,onKeyDown:R.value?j:void 0},[$.value?null:n.h(oe.value===!1?c.value.default:oe.value,{id:e.id,sourceNode:H,targetNode:x,source:h.value.source,target:h.value.target,type:h.value.type,updatable:K.value,selected:h.value.selected,animated:h.value.animated,label:h.value.label,labelStyle:h.value.labelStyle,labelShowBg:h.value.labelShowBg,labelBgStyle:h.value.labelBgStyle,labelBgPadding:h.value.labelBgPadding,labelBgBorderRadius:h.value.labelBgBorderRadius,data:h.value.data,events:{...h.value.events,...q},style:ee.value,markerStart:`url('#${Vo(h.value.markerStart,t)}')`,markerEnd:`url('#${Vo(h.value.markerEnd,t)}')`,sourcePosition:ye,targetPosition:xe,sourceX:$e,sourceY:Ve,targetX:Le,targetY:je,sourceHandleId:h.value.sourceHandle,targetHandleId:h.value.targetHandle,interactionWidth:h.value.interactionWidth,...T}),[K.value==="source"||K.value===!0?[n.h("g",{onMousedown:ge,onMouseenter:G,onMouseout:ne},n.h(lu,{position:ye,centerX:$e,centerY:Ve,radius:a.value,type:"source","data-type":"source"}))]:null,K.value==="target"||K.value===!0?[n.h("g",{onMousedown:_e,onMouseenter:G,onMouseout:ne},n.h(lu,{position:xe,centerX:Le,centerY:je,radius:a.value,type:"target","data-type":"target"}))]:null]])};function G(){M.value=!0}function ne(){M.value=!1}function ce(H,x){w.update({event:H,edge:h.value,connection:x})}function pe(H){w.updateEnd({event:H,edge:h.value}),$.value=!1}function se(H,x){H.button===0&&($.value=!0,D.value=x?h.value.target:h.value.source,J.value=(x?h.value.targetHandle:h.value.sourceHandle)??null,B.value=x?"target":"source",w.updateStart({event:H,edge:h.value}),U(H))}function me(H){var x;const T={event:H,edge:h.value};_.value&&(l.value=!1,h.value.selected&&f.value?(d([h.value]),(x=re.value)==null||x.blur()):o([h.value])),w.click(T)}function he(H){w.contextMenu({event:H,edge:h.value})}function Ee(H){w.doubleClick({event:H,edge:h.value})}function Se(H){w.mouseEnter({event:H,edge:h.value})}function Ie(H){w.mouseMove({event:H,edge:h.value})}function fe(H){w.mouseLeave({event:H,edge:h.value})}function ge(H){se(H,!0)}function _e(H){se(H,!1)}function j(H){var x;!y.value&&pd.includes(H.key)&&_.value&&(H.key==="Escape"?((x=re.value)==null||x.blur(),d([u(e.id)])):o([u(e.id)]))}}}),Q1=n.defineComponent({name:"ConnectionLine",compatConfig:{MODE:3},setup(){var e;const{id:t,connectionMode:o,connectionStartHandle:i,connectionEndHandle:a,connectionPosition:r,connectionLineType:l,connectionLineStyle:s,connectionLineOptions:c,connectionStatus:d,viewport:u,findNode:m}=De(),p=(e=n.inject(qi))==null?void 0:e["connection-line"],f=n.computed(()=>{var N;return m((N=i.value)==null?void 0:N.nodeId)}),y=n.computed(()=>{var N;return m((N=a.value)==null?void 0:N.nodeId)??null}),b=n.computed(()=>({x:(r.value.x-u.value.x)/u.value.zoom,y:(r.value.y-u.value.y)/u.value.zoom})),k=n.computed(()=>c.value.markerStart?`url(#${Vo(c.value.markerStart,t)})`:""),g=n.computed(()=>c.value.markerEnd?`url(#${Vo(c.value.markerEnd,t)})`:"");return()=>{var N,h,w;if(!f.value||!i.value)return null;const q=i.value.id,P=i.value.type,W=f.value.handleBounds;let M=(W==null?void 0:W[P])??[];if(o.value===Lt.Loose){const ee=(W==null?void 0:W[P==="source"?"target":"source"])??[];M=[...M,...ee]}if(!M)return null;const $=(q?M.find(ee=>ee.id===q):M[0])??null,D=($==null?void 0:$.position)??Ce.Top,{x:J,y:B}=Kn(f.value,$,D);let re=null;y.value&&(o.value===Lt.Strict?re=((N=y.value.handleBounds[P==="source"?"target":"source"])==null?void 0:N.find(ee=>{var oe;return ee.id===((oe=a.value)==null?void 0:oe.id)}))||null:re=((h=[...y.value.handleBounds.source??[],...y.value.handleBounds.target??[]])==null?void 0:h.find(ee=>{var oe;return ee.id===((oe=a.value)==null?void 0:oe.id)}))||null);const _=((w=a.value)==null?void 0:w.position)??(D?Vr[D]:null);if(!D||!_)return null;const K=l.value??c.value.type??mn.Bezier;let R="";const X={sourceX:J,sourceY:B,sourcePosition:D,targetX:b.value.x,targetY:b.value.y,targetPosition:_};return K===mn.Bezier?[R]=tu(X):K===mn.Step?[R]=Pr({...X,borderRadius:0}):K===mn.SmoothStep?[R]=Pr(X):K===mn.SimpleBezier?[R]=ou(X):R=`M${J},${B} ${b.value.x},${b.value.y}`,n.h("svg",{class:"vue-flow__edges vue-flow__connectionline vue-flow__container"},n.h("g",{class:"vue-flow__connection"},p?n.h(p,{sourceX:J,sourceY:B,sourcePosition:D,targetX:b.value.x,targetY:b.value.y,targetPosition:_,sourceNode:f.value,sourceHandle:$,targetNode:y.value,targetHandle:re,markerEnd:g.value,markerStart:k.value,connectionStatus:d.value}):n.h("path",{d:R,class:[c.value.class,d.value,"vue-flow__connection-path"],style:{...s.value,...c.value.style},"marker-end":g.value,"marker-start":k.value})))}}}),e0=["id","markerWidth","markerHeight","markerUnits","orient"],t0={name:"MarkerType",compatConfig:{MODE:3}},n0=n.defineComponent({...t0,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(t,o)=>(n.openBlock(),n.createElementBlock("marker",{id:t.id,class:"vue-flow__arrowhead",viewBox:"-10 -10 20 20",refX:"0",refY:"0",markerWidth:`${t.width}`,markerHeight:`${t.height}`,markerUnits:t.markerUnits,orient:t.orient},[t.type===n.unref(vr).ArrowClosed?(n.openBlock(),n.createElementBlock("polyline",{key:0,style:n.normalizeStyle({stroke:t.color,fill:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",points:"-5,-4 0,0 -5,4 -5,-4"},null,4)):n.createCommentVNode("",!0),t.type===n.unref(vr).Arrow?(n.openBlock(),n.createElementBlock("polyline",{key:1,style:n.normalizeStyle({stroke:t.color,strokeWidth:t.strokeWidth}),"stroke-linecap":"round","stroke-linejoin":"round",fill:"none",points:"-5,-4 0,0 -5,4"},null,4)):n.createCommentVNode("",!0)],8,e0))}}),o0={class:"vue-flow__marker vue-flow__container","aria-hidden":"true"},i0={name:"MarkerDefinitions",compatConfig:{MODE:3}},a0=n.defineComponent({...i0,setup(e){const{id:t,edges:o,connectionLineOptions:i,defaultMarkerColor:a}=De(),r=n.computed(()=>{const l=new Set,s=[],c=d=>{if(d){const u=Vo(d,t);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)=>(n.openBlock(),n.createElementBlock("svg",o0,[n.createElementVNode("defs",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,c=>(n.openBlock(),n.createBlock(n0,{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))])]))}}),r0={name:"Edges",compatConfig:{MODE:3}},l0=n.defineComponent({...r0,setup(e){const{findNode:t,getEdges:o,elevateEdgesOnSelect:i}=De();return(a,r)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createVNode(a0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(o),l=>(n.openBlock(),n.createElementBlock("svg",{key:l.id,class:"vue-flow__edges vue-flow__container",style:n.normalizeStyle({zIndex:n.unref(T_)(l,n.unref(t),n.unref(i))})},[n.createVNode(n.unref(Z1),{id:l.id},null,8,["id"])],4))),128)),n.createVNode(n.unref(Q1))],64))}}),s0=n.defineComponent({name:"Node",compatConfig:{MODE:3},props:["id","resizeObserver"],setup(e){const{id:t,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:y,ariaLiveMessage:b,snapToGrid:k,snapGrid:g,nodeDragThreshold:N,nodesDraggable:h,elementsSelectable:w,nodesConnectable:q,nodesFocusable:P,hooks:W}=De(),M=n.ref(null);n.provide(Kd,M),n.provide(jd,e.id);const $=n.inject(qi),D=n.getCurrentInstance(),J=Xd(),{node:B,parentNode:re}=qd(e.id),{emit:_,on:K}=J_(B,l),R=n.toRef(()=>typeof B.draggable>"u"?h.value:B.draggable),X=n.toRef(()=>typeof B.selectable>"u"?w.value:B.selectable),ee=n.toRef(()=>typeof B.connectable>"u"?q.value:B.connectable),oe=n.toRef(()=>typeof B.focusable>"u"?P.value:B.focusable),U=n.computed(()=>X.value||R.value||W.value.nodeClick.hasListeners()||W.value.nodeDoubleClick.hasListeners()||W.value.nodeMouseEnter.hasListeners()||W.value.nodeMouseMove.hasListeners()||W.value.nodeMouseLeave.hasListeners()),G=n.toRef(()=>!!B.dimensions.width&&!!B.dimensions.height),ne=n.computed(()=>{const x=B.type||"default",T=$==null?void 0:$[`node-${x}`];if(T)return T;let V=B.template||m.value[x];if(typeof V=="string"&&D){const te=Object.keys(D.appContext.components);te&&te.includes(x)&&(V=n.resolveComponent(x,!1))}return V&&typeof V!="string"?V:(l.error(new Qe(qe.NODE_TYPE_MISSING,V)),!1)}),ce=Yd({id:e.id,el:M,disabled:()=>!R.value,selectable:X,dragHandle:()=>B.dragHandle,onStart(x){_.dragStart(x)},onDrag(x){_.drag(x)},onStop(x){_.dragStop(x)},onClick(x){j(x)}}),pe=n.computed(()=>B.class instanceof Function?B.class(B):B.class),se=n.computed(()=>{const x=(B.style instanceof Function?B.style(B):B.style)||{},T=B.width instanceof Function?B.width(B):B.width,V=B.height instanceof Function?B.height(B):B.height;return!x.width&&T&&(x.width=typeof T=="string"?T:`${T}px`),!x.height&&V&&(x.height=typeof V=="string"?V:`${V}px`),x}),me=n.toRef(()=>Number(B.zIndex??se.value.zIndex??0));return u(x=>{(x.includes(e.id)||!x.length)&&Ee()}),n.onMounted(()=>{n.watch(()=>B.hidden,(x=!1,T,V)=>{!x&&M.value&&(e.resizeObserver.observe(M.value),V(()=>{M.value&&e.resizeObserver.unobserve(M.value)}))},{immediate:!0,flush:"post"})}),n.watch([()=>B.type,()=>B.sourcePosition,()=>B.targetPosition],()=>{n.nextTick(()=>{d([{id:e.id,nodeElement:M.value,forceUpdate:!0}])})}),n.watch([()=>B.position.x,()=>B.position.y,()=>{var x;return(x=re.value)==null?void 0:x.computedPosition.x},()=>{var x;return(x=re.value)==null?void 0:x.computedPosition.y},()=>{var x;return(x=re.value)==null?void 0:x.computedPosition.z},me,()=>B.selected,()=>B.dimensions.height,()=>B.dimensions.width,()=>{var x;return(x=re.value)==null?void 0:x.dimensions.height},()=>{var x;return(x=re.value)==null?void 0:x.dimensions.width}],([x,T,V,te,de,ke])=>{const ye={x,y:T,z:ke+(f.value&&B.selected?1e3:0)};typeof V<"u"&&typeof te<"u"?B.computedPosition=C_({x:V,y:te,z:de},ye):B.computedPosition=ye},{flush:"post",immediate:!0}),n.watch([()=>B.extent,p],([x,T],[V,te])=>{(x!==V||T!==te)&&he()}),B.extent==="parent"||typeof B.extent=="object"&&"range"in B.extent&&B.extent.range==="parent"?nr(()=>G).toBe(!0).then(he):he(),()=>B.hidden?null:n.h("div",{ref:M,"data-id":B.id,class:["vue-flow__node",`vue-flow__node-${ne.value===!1?"default":B.type||"default"}`,{[o.value]:R.value,dragging:ce==null?void 0:ce.value,draggable:R.value,selected:B.selected,selectable:X.value,parent:B.isParent},pe.value],style:{visibility:G.value?"visible":"hidden",zIndex:B.computedPosition.z??me.value,transform:`translate(${B.computedPosition.x}px,${B.computedPosition.y}px)`,pointerEvents:U.value?"all":"none",...se.value},tabIndex:oe.value?0:void 0,role:oe.value?"group":void 0,"aria-describedby":y.value?void 0:`${md}-${t}`,"aria-label":B.ariaLabel,"aria-roledescription":"node",...B.domAttributes,onMouseenter:Se,onMousemove:Ie,onMouseleave:fe,onContextmenu:ge,onClick:j,onDblclick:_e,onKeydown:H},[n.h(ne.value===!1?m.value.default:ne.value,{id:B.id,type:B.type,data:B.data,events:{...B.events,...K},selected:B.selected,resizing:B.resizing,dragging:ce.value,connectable:ee.value,position:B.computedPosition,dimensions:B.dimensions,isValidTargetPos:B.isValidTargetPos,isValidSourcePos:B.isValidSourcePos,parent:B.parentNode,parentNodeId:B.parentNode,zIndex:B.computedPosition.z??me.value,targetPosition:B.targetPosition,sourcePosition:B.sourcePosition,label:B.label,dragHandle:B.dragHandle,onUpdateNodeInternals:Ee})]);function he(){const x=B.computedPosition,{computedPosition:T,position:V}=Rr(B,k.value?Wi(x,g.value):x,l.error,p.value,re.value);(B.computedPosition.x!==T.x||B.computedPosition.y!==T.y)&&(B.computedPosition={...B.computedPosition,...T}),(B.position.x!==V.x||B.position.y!==V.y)&&(B.position=V)}function Ee(){M.value&&d([{id:e.id,nodeElement:M.value,forceUpdate:!0}])}function Se(x){ce!=null&&ce.value||_.mouseEnter({event:x,node:B})}function Ie(x){ce!=null&&ce.value||_.mouseMove({event:x,node:B})}function fe(x){ce!=null&&ce.value||_.mouseLeave({event:x,node:B})}function ge(x){return _.contextMenu({event:x,node:B})}function _e(x){return _.doubleClick({event:x,node:B})}function j(x){X.value&&(!i.value||!R.value||N.value>0)&&Mr(B,r.value,c,s,a,!1,M.value),_.click({event:x,node:B})}function H(x){if(!(xr(x)||y.value))if(pd.includes(x.key)&&X.value){const T=x.key==="Escape";Mr(B,r.value,c,s,a,T,M.value)}else R.value&&B.selected&&Gn[x.key]&&(x.preventDefault(),b.value=`Moved selected node ${x.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~B.position.x}, y: ${~~B.position.y}`,J({x:Gn[x.key].x,y:Gn[x.key].y},x.shiftKey))}}});function c0(e={includeHiddenNodes:!1}){const{nodes:t}=De();return n.computed(()=>{if(t.value.length===0)return!1;for(const o of t.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 d0={class:"vue-flow__nodes vue-flow__container"},u0={name:"Nodes",compatConfig:{MODE:3}},m0=n.defineComponent({...u0,setup(e){const{getNodes:t,updateNodeDimensions:o,emits:i}=De(),a=c0(),r=n.ref();return n.watch(a,l=>{l&&n.nextTick(()=>{i.nodesInitialized(t.value)})},{immediate:!0}),n.onMounted(()=>{r.value=new ResizeObserver(l=>{const s=l.map(c=>({id:c.target.getAttribute("data-id"),nodeElement:c.target,forceUpdate:!0}));n.nextTick(()=>o(s))})}),n.onBeforeUnmount(()=>{var l;return(l=r.value)==null?void 0:l.disconnect()}),(l,s)=>(n.openBlock(),n.createElementBlock("div",d0,[r.value?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(n.unref(t),(c,d,u,m)=>{const p=[c.id];if(m&&m.key===c.id&&n.isMemoSame(m,p))return m;const f=(n.openBlock(),n.createBlock(n.unref(s0),{id:c.id,key:c.id,"resize-observer":r.value},null,8,["id","resize-observer"]));return f.memo=p,f},s,0),128)):n.createCommentVNode("",!0)]))}});function f0(){const{emits:e}=De();n.onMounted(()=>{if(Ld()){const t=document.querySelector(".vue-flow__pane");t&&window.getComputedStyle(t).zIndex!=="1"&&e.error(new Qe(qe.MISSING_STYLES))}})}const p0=n.createElementVNode("div",{class:"vue-flow__edge-labels"},null,-1),h0={name:"VueFlow",compatConfig:{MODE:3}},y0=n.defineComponent({...h0,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:t,emit:o}){const i=e,a=n.useSlots(),r=or(i,"modelValue",o),l=or(i,"nodes",o),s=or(i,"edges",o),c=De(i),d=t1({modelValue:r,nodes:l,edges:s},i,c);return o1(o,c.hooks),q1(),f0(),n.provide(qi,a),n.onUnmounted(d),t(c),(u,m)=>(n.openBlock(),n.createElementBlock("div",{ref:n.unref(c).vueFlowRef,class:"vue-flow"},[n.createVNode(F1,null,{default:n.withCtx(()=>[n.createVNode(l0),p0,n.createVNode(m0),n.renderSlot(u.$slots,"zoom-pane")]),_:3}),n.renderSlot(u.$slots,"default"),n.createVNode(W1)],512))}}),g0={name:"Panel",compatConfig:{MODE:3}},su=n.defineComponent({...g0,props:{position:{}},setup(e){const t=e,{userSelectionActive:o}=De(),i=n.computed(()=>`${t.position}`.split("-"));return(a,r)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["vue-flow__panel",i.value]),style:n.normalizeStyle({pointerEvents:n.unref(o)?"none":"all"})},[n.renderSlot(a.$slots,"default")],6))}}),bn=["red","amber","green","teal","blue","indigo","violet","pink"],cu={red:"빨강",amber:"주황",green:"초록",teal:"청록",blue:"파랑",indigo:"남색",violet:"보라",pink:"분홍"};function b0(e){return typeof e=="string"&&e in cu}const _0={red:0,amber:32,green:145,teal:173,blue:221,indigo:244,violet:262,pink:330},k0=.15;function E0(e){const t=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;let o=t[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 w0(e){if(typeof e!="string")return null;const t=E0(e);if(!t||t.s<k0)return null;let o=null,i=1/0;for(const a of bn){const r=Math.abs(t.h-_0[a]),l=Math.min(r,360-r);l<i&&(i=l,o=a)}return o}function at(e){var i;const t=(i=e==null?void 0:e.properties)==null?void 0:i.swatch;if(b0(t))return t;const o=e==null?void 0:e.properties;return w0((o==null?void 0:o["background-color"])??(o==null?void 0:o["font-color"])??(o==null?void 0:o.color))}function zr(e){return e?{bar:`var(--em-swatch-${e}-bar)`,barOn:`var(--em-swatch-${e}-on)`,text:`var(--em-swatch-${e}-text)`}:null}const N0={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)"},v0={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 du(e,t=!1){return e?t?v0[e]:N0[e]:null}function Yn(e){return cu[e]}function Wn(e){return`var(--em-swatch-${e}-bar)`}const x0=["width","height","innerHTML"],C0=n.defineComponent({__name:"EmIcon",props:{name:{},size:{}},setup(e){const t={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"/>',"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)=>(n.openBlock(),n.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:t[e.name]??""},null,8,x0))}}),Pe=(e,t)=>{const o=e.__vccOpts||e;for(const[i,a]of t)o[i]=a;return o},Re=Pe(C0,[["__scopeId","data-v-92c1dba8"]]);function I0(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 S0(e,t){const o=I0(t);return o?e(o):t.split("-")[1]??t}function $0(e){const t=o=>e.params!=null&&o 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"em.check.name3";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-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-6":return"em.check.jpa6";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 t("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-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-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 t("field")?"em.check.dsn5Inherited":"em.check.dsn5Missing";default:return e.ruleId}}function uu(e,t){const o=$0(t);if(t.ruleId==="CHK-TYPE-4"){const i=e("em.check.unspecified"),a=t.params??{};return e(o,{type:a.type||i,dataType:a.dataType||i})}return e(o,t.params)}function R0(e){return e.targetKind==="entity"?e.targetRef:e.contextRef}const A0={class:"em-inline-issue__msgs"},_n=Pe(n.defineComponent({__name:"InlineIssueBadge",props:{controller:{},refId:{}},setup(e){const t=e,o=t.controller,i={error:{order:0,icon:"alert-circle"},warning:{order:1,icon:"alert-triangle"},info:{order:2,icon:"info"}},a=n.computed(()=>t.refId?t.controller.issuesByRef.value.get(t.refId)??[]:[]),r=n.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?(n.openBlock(),n.createElementBlock("p",{key:0,class:n.normalizeClass(["em-inline-issue",`is-${r.value}`])},[n.createVNode(Re,{name:i[r.value].icon,size:13,class:"em-inline-issue__icon"},null,8,["name"]),n.createElementVNode("span",A0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,(c,d)=>(n.openBlock(),n.createElementBlock("span",{key:d},n.toDisplayString(n.unref(uu)(n.unref(o).t,c)),1))),128))])],2)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-9f959cc0"]]),T0={class:"em-mlang"},V0={class:"em-mlang__tabs",role:"tablist"},M0=["aria-selected","onClick"],B0={key:0,class:"em-mlang__dot"},kn=Pe(n.defineComponent({__name:"MultiLangTextField",props:{modelValue:{},name:{},languages:{default:()=>["ko","en","ja","zh"]},defaultLang:{},multiline:{type:Boolean,default:!1},placeholder:{},height:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,i=t;function a(){const d=o.defaultLang;return d&&o.languages.includes(d)?d:o.languages[0]??"ko"}const r=n.ref(a());n.watch(()=>[o.languages,o.defaultLang],()=>{o.languages.includes(r.value)||(r.value=a())});function l(d){var u,m;return!!((m=(u=o.modelValue)==null?void 0:u[d])!=null&&m.trim())}const s=n.computed(()=>{var d;return((d=o.modelValue)==null?void 0:d[r.value])??""});function c(d){const u={...o.modelValue};d.trim()===""?delete u[r.value]:u[r.value]=d,i("update:modelValue",u)}return(d,u)=>(n.openBlock(),n.createElementBlock("div",T0,[n.createElementVNode("div",V0,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(e.languages,m=>(n.openBlock(),n.createElementBlock("button",{key:m,type:"button",class:n.normalizeClass(["em-mlang__tab",{"is-active":r.value===m}]),role:"tab","aria-selected":r.value===m,onClick:p=>r.value=m},[n.createTextVNode(n.toDisplayString(m),1),l(m)?(n.openBlock(),n.createElementBlock("span",B0,"•")):n.createCommentVNode("",!0)],10,M0))),128))]),e.multiline?(n.openBlock(),n.createBlock(n.unref(ie.BSTextArea),{key:0,name:`${e.name}-${r.value}`,width:"100%",height:e.height??"64px",placeholder:e.placeholder,"model-value":s.value,"onUpdate:modelValue":c},null,8,["name","height","placeholder","model-value"])):(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:1,name:`${e.name}-${r.value}`,width:"100%",placeholder:e.placeholder,"model-value":s.value,"onUpdate:modelValue":c},null,8,["name","placeholder","model-value"]))]))}}),[["__scopeId","data-v-274a0fe9"]]),D0=["disabled"],O0={class:"em-panel__sub-label"},P0={class:"em-field"},L0={class:"em-field"},z0={class:"em-field"},U0={class:"em-class"},H0={class:"em-field"},F0={class:"em-field"},G0={class:"em-field"},j0={class:"em-field"},K0={class:"em-multilang"},Y0={class:"em-multilang"},W0={class:"em-jpa"},q0={class:"em-field"},X0={class:"em-field"},J0={class:"em-field"},Z0={class:"em-swatch"},Q0={class:"em-swatch__row"},ek=["title"],tk=["title","onClick"],mu=Pe(n.defineComponent({__name:"EntityBasicsSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean},title:{}},emits:["toggle"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,r=n.computed(()=>a.state.logical.entities.find(B=>B.modelId===o.entityId)??null),l=n.computed(()=>r.value?a.state.layout.entityLayouts.find(B=>B.entityRef===r.value.modelId)??null:null),s=n.computed(()=>{var B;return at(((B=l.value)==null?void 0:B.style)??void 0)}),c=["JPA_ENTITY","JPA_EMBEDDABLE","JPA_MULTI_LANGUAGE_ENTITY","UNDEFINED"],d=[{key:"useVersion",label:"@Version"},{key:"useCacheable",label:"@Cacheable"},{key:"useDynamicInsert",label:"@DynamicInsert"},{key:"useDynamicUpdate",label:"@DynamicUpdate"},{key:"useDiscriminator",label:"@Discriminator"}],u=["inherit","STRING","CHAR","INTEGER"],m=B=>B;function p(B){return B==="inherit"?a.t("em.common.inherit"):B}function f(B){r.value&&a.updateEntity(r.value.modelId,B)}function y(B,re,_){var R;const K=((R=r.value)==null?void 0:R.table)??{physicalName:""};f(B==="physicalName"?{table:{...K,physicalName:_}}:{table:{...K,logicalName:{...K.logicalName,[re]:_}}})}function b(B){f({description:Object.keys(B).length?B:void 0})}function k(B,re){var _;f({jpaAttrs:{...(_=r.value)==null?void 0:_.jpaAttrs,[B]:re}})}function g(B,re){k(B,re)}const N=n.computed(()=>{var B,re;return((re=(B=r.value)==null?void 0:B.jpaAttrs)==null?void 0:re.discriminatorType)??"inherit"}),h=n.computed(()=>{var B,re;return!((re=(B=r.value)==null?void 0:B.jpaAttrs)!=null&&re.useDiscriminator)});function w(B){k("discriminatorType",B==="inherit"?void 0:B)}function q(B){f({hasPersonalInfo:B})}function P(B){f({superClass:B.trim()||void 0})}function W(B){f({schema:B.trim()||void 0})}function M(B){f({abstractClass:B})}const $=n.computed(()=>{var B,re;return((re=(B=r.value)==null?void 0:B.declarationOfInterfaces)==null?void 0:re.join(", "))??""});function D(B){const re=B.split(",").map(_=>_.trim()).filter(Boolean);f({declarationOfInterfaces:re.length?re:void 0})}function J(B){r.value&&a.setEntitySwatch(r.value.modelId,B)}return(B,re)=>{var _,K,R;return r.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!n.unref(a).editable.value},[e.collapsible?(n.openBlock(),n.createElementBlock("h4",{key:0,class:"em-panel__sub em-panel__sub--toggle",onClick:re[0]||(re[0]=X=>i("toggle"))},[n.createElementVNode("span",O0,[n.createVNode(Re,{name:"chevron",size:13,class:n.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"]),n.createTextVNode(" "+n.toDisplayString(e.title||r.value.name||n.unref(a).t("em.entity.fallback")),1)])])):n.createCommentVNode("",!0),!e.collapsible||!e.collapsed?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createVNode(_n,{controller:n.unref(a),"ref-id":e.entityId,class:"em-section__issues"},null,8,["controller","ref-id"]),n.createElementVNode("label",P0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.name")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-name",width:"100%","model-value":r.value.name,"onUpdate:modelValue":re[1]||(re[1]=X=>f({name:X}))},null,8,["model-value"])]),n.createElementVNode("label",L0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.stereotype")),1),n.createVNode(n.unref(ie.BSSelect),{"model-value":r.value.stereotype,items:c,"value-provider":m,"label-provider":m,"onUpdate:modelValue":re[2]||(re[2]=X=>f({stereotype:X}))},null,8,["model-value"])]),n.createElementVNode("label",z0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.package")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-package",width:"100%","model-value":r.value.packageName??"","onUpdate:modelValue":re[3]||(re[3]=X=>f({packageName:X}))},null,8,["model-value"])]),n.createElementVNode("fieldset",U0,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.entity.classLegend")),1),n.createElementVNode("label",H0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.superClass")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-superclass",width:"100%",placeholder:n.unref(a).t("em.entity.superClassPlaceholder"),"model-value":r.value.superClass??"","onUpdate:modelValue":re[4]||(re[4]=X=>P(X))},null,8,["placeholder","model-value"])]),n.createElementVNode("label",F0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.interfaces")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-interfaces",width:"100%",placeholder:n.unref(a).t("em.entity.interfacesPlaceholder"),"model-value":$.value,"onUpdate:modelValue":re[5]||(re[5]=X=>D(X))},null,8,["placeholder","model-value"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"ent-abstract",class:"em-check",label:n.unref(a).t("em.entity.abstractClass"),"model-value":!!r.value.abstractClass,"onUpdate:modelValue":re[6]||(re[6]=X=>M(X))},null,8,["label","model-value"])]),n.createElementVNode("label",G0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.tablePhysical")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-table",width:"100%","model-value":((_=r.value.table)==null?void 0:_.physicalName)??"","onUpdate:modelValue":re[7]||(re[7]=X=>y("physicalName",null,X))},null,8,["model-value"])]),n.createElementVNode("label",j0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.schema")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"ent-schema",width:"100%",placeholder:n.unref(a).t("em.entity.schemaPlaceholder"),"model-value":r.value.schema??"","onUpdate:modelValue":re[8]||(re[8]=X=>W(X))},null,8,["placeholder","model-value"])]),n.createElementVNode("fieldset",K0,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.entity.tableLogicalLegend")),1),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a).languages.value,X=>{var ee,oe;return n.openBlock(),n.createElementBlock("label",{key:X,class:"em-lang"},[n.createElementVNode("span",null,n.toDisplayString(X),1),n.createVNode(n.unref(ie.BSTextInput),{name:`ent-logical-${X}`,width:"100%","model-value":((oe=(ee=r.value.table)==null?void 0:ee.logicalName)==null?void 0:oe[X])??"","onUpdate:modelValue":U=>y("logicalName",X,U)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),n.createElementVNode("fieldset",Y0,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.common.description")),1),n.createVNode(kn,{multiline:"",name:"ent-desc",languages:n.unref(a).languages.value,"default-lang":n.unref(a).userLanguage.value,"model-value":r.value.description,"onUpdate:modelValue":b},null,8,["languages","default-lang","model-value"])]),n.createElementVNode("fieldset",W0,[re[13]||(re[13]=n.createElementVNode("legend",null,"JPA",-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(d,X=>{var ee;return n.createVNode(n.unref(ie.BSCheckbox),{key:X.key,name:`jpa-${X.key}`,class:"em-check",label:X.label,"model-value":!!((ee=r.value.jpaAttrs)!=null&&ee[X.key]),"onUpdate:modelValue":oe=>g(X.key,oe)},null,8,["name","label","model-value","onUpdate:modelValue"])}),64)),n.createElementVNode("label",q0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.discColumn")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"disc-col",width:"100%",placeholder:n.unref(a).t("em.entity.discColumnPlaceholder"),disabled:h.value,"model-value":((K=r.value.jpaAttrs)==null?void 0:K.discriminatorColumnName)??"","onUpdate:modelValue":re[9]||(re[9]=X=>k("discriminatorColumnName",X.trim()||void 0))},null,8,["placeholder","disabled","model-value"])]),n.createElementVNode("label",X0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.discType")),1),n.createVNode(n.unref(ie.BSSelect),{disabled:h.value,"model-value":N.value,items:u,"value-provider":m,"label-provider":p,"onUpdate:modelValue":re[10]||(re[10]=X=>X&&w(X))},null,8,["disabled","model-value"])]),n.createElementVNode("label",J0,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.discLength")),1),n.createVNode(n.unref(ie.BSNumberInput),{name:"disc-len",width:"64px",placeholder:"len",disabled:h.value,"model-value":(R=r.value.jpaAttrs)==null?void 0:R.discriminatorLength,"onUpdate:modelValue":re[11]||(re[11]=X=>k("discriminatorLength",X||void 0))},null,8,["disabled","model-value"])])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"ent-personalinfo",class:"em-check em-check--block",label:n.unref(a).t("em.entity.hasPersonalInfo"),"model-value":!!r.value.hasPersonalInfo,"onUpdate:modelValue":q},null,8,["label","model-value"]),n.createElementVNode("fieldset",Z0,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.entity.headerColor")),1),n.createElementVNode("div",Q0,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":s.value===null}]),title:n.unref(a).t("em.swatch.none"),onClick:re[12]||(re[12]=X=>J(null))},"∅",10,ek),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),X=>(n.openBlock(),n.createElementBlock("button",{key:X,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":s.value===X}]),style:n.normalizeStyle({background:n.unref(Wn)(X)}),title:n.unref(Yn)(X),onClick:ee=>J(X)},null,14,tk))),128))])])],64)):n.createCommentVNode("",!0)],8,D0)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-92e146f7"]]),fu={"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.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.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.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.copy":"Copy","em.export.download":"Download","em.export.copied":"Copied to clipboard.","em.export.copyFailed":"Failed to copy.","em.shortcuts.title":"Keyboard shortcuts","em.shortcuts.groupEdit":"Edit","em.shortcuts.groupMove":"Move · Arrange","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.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.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.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.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.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.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.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.descPlaceholderKo":"Description (ko)","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.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.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.emptyShortcutHint":"Press <kbd>?</kbd> for keyboard shortcuts","em.canvas.emptyReadonly":"No entities to show","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.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.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.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.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.name3":'Duplicate entity name: "{name}"',"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.jpa1":"JPA entity has no identifier (PK) attribute","em.check.jpa2":'An embeddable type 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.jpa6":"{which}: orphanRemoval overlaps with cascade {cascade}","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.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.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.unspecified":"unspecified"},pu={"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.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.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.common.close":"閉じる","em.common.save":"保存","em.export.title":"エクスポート","em.export.formatText":"論理モデルテキスト","em.export.formatMermaidEr":"Mermaid (ER)","em.export.formatMermaidClass":"Mermaid (クラス)","em.export.copy":"コピー","em.export.download":"ダウンロード","em.export.copied":"クリップボードにコピーしました。","em.export.copyFailed":"コピーに失敗しました。","em.shortcuts.title":"キーボードショートカット","em.shortcuts.groupEdit":"編集","em.shortcuts.groupMove":"移動・整列","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.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.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.cascadeAllNote":"ALL は個別の cascade をすべて含みます(CHK-JPA-5)。","em.assoc.orphanRemovalNote":"相手側がコレクション(@ManyToOne/@ManyToMany)のため orphanRemoval は無効です(CHK-JPA-14)。","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.headerColor":"ヘッダー色","em.attr.section":"属性 ({n})","em.attr.addEmbeddable":"埋め込み追加","em.attr.nameless":"(名前なし)","em.attr.selectHint":"上のリストから属性を選択すると編集フォームが表示されます。","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.overrideCollapse":"オーバーライドを折りたたむ","em.attr.overrideExpand":"オーバーライドを展開","em.attr.overrideLegend":"カラムオーバーライド","em.attr.empty":"属性なし — 「追加」で作成","em.op.body":"本文","em.op.bodyDirty":"本文 ●","em.op.descPlaceholderKo":"説明(ko)","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.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.canvas.emptyTitle":"空のダイアグラムです","em.canvas.emptyHint":"キャンバスを<strong>右クリック</strong>するか、左下の<strong>+</strong>ボタンで最初のエンティティを追加してください。","em.canvas.emptyShortcutHint":"ショートカットのヘルプは<kbd>?</kbd>キー","em.canvas.emptyReadonly":"表示するエンティティがありません","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.opsSummaryTitle":"オペレーション {n}件 — クラス表示モードで展開されます","em.node.opsSummary":"オペレーション {n}件","em.node.addAttr":"+ 属性","em.node.addDivider":"+ 区切り線","em.group.ddlExcludeBadge":"DDL 除外","em.explorer.groupFallback":"(グループ)","em.explorer.associations":"関連 ({n})","em.explorer.notes":"ノート ({n})","em.explorer.emptyNote":"(空のノート)","em.explorer.diagram":"ダイアグラム","em.explorer.searchPlaceholder":"エンティティ・属性検索 ( / )","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.check.catName":"名前","em.check.catJpa":"JPA","em.check.catType":"型","em.check.catDsn":"設計","em.check.name1":'属性名が重複しています: "{name}"',"em.check.name2":'カラム物理名が重複しています: "{name}"',"em.check.name3":'エンティティ名が重複しています: "{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.jpa1":"JPAエンティティに識別子(PK)属性がありません","em.check.jpa2":'組込み可能(embeddable)型は識別子属性を持てません: "{name}"',"em.check.jpa4":"識別関係の循環です(PKが自身に無限依存): {path}","em.check.jpa5":"{which}: cascade ALLが個別のcascadeと重複しています(ALLがすべて含む)","em.check.jpa6":"{which}: orphanRemovalがcascade {cascade}と意味が重なります","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.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.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.unspecified":"未指定"},hu={"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.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.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.common.close":"닫기","em.common.save":"저장","em.export.title":"내보내기","em.export.formatText":"논리 모델 텍스트","em.export.formatMermaidEr":"Mermaid (ER)","em.export.formatMermaidClass":"Mermaid (클래스)","em.export.copy":"복사","em.export.download":"다운로드","em.export.copied":"클립보드에 복사되었습니다.","em.export.copyFailed":"복사에 실패했습니다.","em.shortcuts.title":"키보드 단축키","em.shortcuts.groupEdit":"편집","em.shortcuts.groupMove":"이동 · 정렬","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.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.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.cascadeAllNote":"ALL이 개별 cascade를 모두 포함합니다 (CHK-JPA-5).","em.assoc.orphanRemovalNote":"반대편이 컬렉션(@ManyToOne/@ManyToMany)이라 orphanRemoval이 무효입니다 (CHK-JPA-14).","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.headerColor":"헤더 색상","em.attr.section":"속성 ({n})","em.attr.addEmbeddable":"임베더블 추가","em.attr.nameless":"(이름 없음)","em.attr.selectHint":"위 목록에서 속성을 선택하면 편집 폼이 표시됩니다.","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.overrideCollapse":"오버라이드 접기","em.attr.overrideExpand":"오버라이드 펼치기","em.attr.overrideLegend":"컬럼 오버라이드","em.attr.empty":"속성 없음 — '추가'로 생성","em.op.body":"본문","em.op.bodyDirty":"본문 ●","em.op.descPlaceholderKo":"설명(ko)","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.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.canvas.emptyTitle":"빈 다이어그램입니다","em.canvas.emptyHint":"캔버스를 <strong>우클릭</strong>하거나 좌하단 <strong>+</strong> 버튼으로 첫 엔티티를 추가하세요.","em.canvas.emptyShortcutHint":"단축키 도움말은 <kbd>?</kbd> 키","em.canvas.emptyReadonly":"표시할 엔티티가 없습니다","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.opsSummaryTitle":"오퍼레이션 {n}개 — 클래스 표시 모드에서 펼쳐 보입니다","em.node.opsSummary":"오퍼레이션 {n}개","em.node.addAttr":"+ 속성","em.node.addDivider":"+ 구분선","em.group.ddlExcludeBadge":"DDL 제외","em.explorer.groupFallback":"(그룹)","em.explorer.associations":"관계 ({n})","em.explorer.notes":"노트 ({n})","em.explorer.emptyNote":"(빈 노트)","em.explorer.diagram":"다이어그램","em.explorer.searchPlaceholder":"엔티티·속성 검색 ( / )","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.check.catName":"이름","em.check.catJpa":"JPA","em.check.catType":"타입","em.check.catDsn":"설계","em.check.name1":'속성 이름이 중복됩니다: "{name}"',"em.check.name2":'컬럼 물리명이 중복됩니다: "{name}"',"em.check.name3":'엔티티 이름이 중복됩니다: "{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.jpa1":"JPA 엔티티에 식별자(PK) 속성이 없습니다","em.check.jpa2":'임베더블 타입은 식별자 속성을 가질 수 없습니다: "{name}"',"em.check.jpa4":"식별 관계 사이클입니다 (PK 무한 의존): {path}","em.check.jpa5":"{which}: cascade ALL이 개별 cascade와 중복됩니다 (ALL이 모두 포함)","em.check.jpa6":"{which}: orphanRemoval이 cascade {cascade}와 의미가 겹칩니다","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.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.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.unspecified":"미지정"},nk=["ko","en","ja"],Ur={ko:hu,en:fu,ja:pu};function Rt(e,t,o){let a=(Ur[e]??Ur.ko)[t]??Ur.ko[t]??t;return o&&(a=a.replace(/\{(\w+)\}/g,(r,l)=>l in o?String(o[l]):r)),a}const yu=["ko","en","ja","zh"];function ok(e){if(e)for(const t of yu){const o=e[t];if(o)return o}}function Hr(e){const t=ok(e.label);return t?`${e.groupCode} (${t})`:e.groupCode}function ik(e,t){const o=t.trim().toLowerCase();return o?e.filter(i=>i.groupCode.toLowerCase().includes(o)?!0:yu.some(a=>{var r,l;return(l=(r=i.label)==null?void 0:r[a])==null?void 0:l.toLowerCase().includes(o)})):e}const ak=["aria-expanded","placeholder"],rk=["aria-selected","onClick","onMouseenter"],lk={key:0,class:"gcc__opt gcc__opt--empty"},gu=Pe(n.defineComponent({__name:"GroupCodeCombobox",props:{modelValue:{},items:{},locale:{}},emits:["update:modelValue"],setup(e,{emit:t}){const o=e,i=t,a=($,D)=>Rt(o.locale??"ko",$,D),r=n.ref(),l=n.ref(),s=n.ref(),c=n.ref(""),d=n.ref(!1),u=n.ref(-1),m=n.ref({}),p=n.computed(()=>o.items.find($=>$.groupCode===o.modelValue)),f=n.computed(()=>p.value?Hr(p.value):"");n.watch(f,$=>{d.value||(c.value=$)},{immediate:!0});const y=n.computed(()=>c.value===f.value?o.items:ik(o.items,c.value));function b(){var D;const $=(D=r.value)==null?void 0:D.getBoundingClientRect();$&&(m.value={left:`${$.left}px`,top:`${$.bottom}px`,width:`${$.width}px`})}function k(){d.value=!0,b(),u.value=Math.max(0,y.value.findIndex($=>$.groupCode===o.modelValue)),window.addEventListener("scroll",b,!0),window.addEventListener("resize",b),document.addEventListener("mousedown",M)}function g(){d.value=!1,window.removeEventListener("scroll",b,!0),window.removeEventListener("resize",b),document.removeEventListener("mousedown",M)}n.onBeforeUnmount(g);function N(){k(),n.nextTick(()=>{var $;return($=l.value)==null?void 0:$.select()})}function h(){d.value||k(),u.value=0}function w($){i("update:modelValue",$.groupCode),c.value=Hr($),g()}function q(){i("update:modelValue",void 0),c.value="",g()}function P(){c.value.trim()===""?q():(c.value=f.value,g())}function W($){var D;if($.key==="ArrowDown")d.value||k(),u.value=Math.min(u.value+1,y.value.length-1),$.preventDefault();else if($.key==="ArrowUp")u.value=Math.max(u.value-1,0),$.preventDefault();else if($.key==="Enter"){const J=y.value[u.value];J&&w(J),$.preventDefault()}else $.key==="Escape"&&(c.value=f.value,g(),(D=l.value)==null||D.blur())}function M($){var J,B;const D=$.target;!((J=r.value)!=null&&J.contains(D))&&!((B=s.value)!=null&&B.contains(D))&&P()}return($,D)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"root",ref:r,class:"gcc"},[n.withDirectives(n.createElementVNode("input",{ref_key:"inputEl",ref:l,"onUpdate:modelValue":D[0]||(D[0]=J=>c.value=J),class:"gcc__input",type:"text",role:"combobox",autocomplete:"off","aria-expanded":d.value,placeholder:a("em.groupCode.searchPlaceholder"),onFocus:N,onInput:h,onKeydown:W},null,40,ak),[[n.vModelText,c.value]]),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[d.value?(n.openBlock(),n.createElementBlock("ul",{key:0,ref_key:"popup",ref:s,class:"gcc__popup",style:n.normalizeStyle(m.value),role:"listbox"},[n.createElementVNode("li",{class:"gcc__opt gcc__opt--none",onMousedown:D[1]||(D[1]=n.withModifiers(()=>{},["prevent"])),onClick:q},n.toDisplayString(a("em.common.noneParen")),33),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(y.value,(J,B)=>(n.openBlock(),n.createElementBlock("li",{key:J.groupCode,class:n.normalizeClass(["gcc__opt",{"is-active":B===u.value,"is-selected":J.groupCode===e.modelValue}]),role:"option","aria-selected":J.groupCode===e.modelValue,onMousedown:D[2]||(D[2]=n.withModifiers(()=>{},["prevent"])),onClick:re=>w(J),onMouseenter:re=>u.value=B},n.toDisplayString(n.unref(Hr)(J)),43,rk))),128)),y.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",lk,n.toDisplayString(a("em.groupCode.noMatch")),1))],4)):n.createCommentVNode("",!0)]))],512))}}),[["__scopeId","data-v-431f9333"]]),sk=["disabled"],ck={class:"em-aw__toolbar"},dk={class:"em-aw__count"},uk={class:"em-aw__scroll"},mk={class:"em-aw__table"},fk={class:"c-name"},pk={class:"c-type"},hk={class:"c-logical"},yk={class:"c-col"},gk={class:"c-constraints"},bk={class:"c-del"},_k={class:"c-expand"},kk=["title","onClick","onKeydown"],Ek={class:"c-constraints"},wk={class:"em-aw__cflags"},Nk=["title"],vk={colspan:"8"},xk={class:"em-aw__detail"},Ck={class:"em-aw__dgroup"},Ik={class:"em-aw__df"},Sk={class:"em-aw__df"},$k={class:"em-aw__df"},Rk={class:"em-aw__dgroup"},Ak={class:"em-aw__dgroup"},Tk={class:"em-aw__df"},Vk={key:0,class:"em-aw__df"},Mk={class:"em-aw__df"},Bk={class:"c-expand"},Dk={class:"em-aw__caret is-static","aria-hidden":"true"},Ok={class:"c-del"},Pk={class:"c-expand"},Lk=["title","onClick","onKeydown"],zk={class:"em-aw__embed-label"},Uk={class:"em-aw__ro"},Hk={class:"em-aw__ro"},Fk={class:"c-constraints"},Gk={class:"em-aw__ro"},jk={key:0,class:"em-aw__detail-row em-aw__embed-detail"},Kk={colspan:"8"},Yk={class:"em-aw__detail"},Wk={class:"em-aw__dgroup"},qk={key:0,class:"em-aw__df"},Xk={class:"em-aw__df"},Jk={class:"em-aw__df"},Zk={key:0},Qk={colspan:"99",class:"em-aw__empty"},eE=6,tE=5,oa="__OWN__",nE=Pe(n.defineComponent({__name:"EntityAttributesWide",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=n.computed(()=>o.state.logical.entities.find(S=>S.modelId===t.entityId)??null),a=n.computed(()=>{var S;return((S=i.value)==null?void 0:S.stereotype)==="JPA_EMBEDDABLE"}),r=n.computed(()=>new Set(o.selectedAttrIds.value)),l=n.computed(()=>{var S;return(((S=i.value)==null?void 0:S.attributes)??[]).filter(L=>L.attrType!=="DIVIDER").length}),s=n.ref(new Set);function c(S){return s.value.has(S)}function d(S){const L=new Set(s.value);L.has(S)?L.delete(S):L.add(S),s.value=L}const u=["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 m(S){return S==="none"?o.t("em.common.noneParen"):S}const p=S=>S;function f(S,L){i.value&&o.updateAttribute(i.value.modelId,S.modelId,L)}function y(S){return!!i.value&&!!ki(o.state.logical,i.value.modelId,S.modelId)}function b(S,L){f(S,{naturalId:L||void 0,naturalIdMutable:L?S.naturalIdMutable:void 0})}function k(){return{naturalId:void 0,naturalIdMutable:void 0}}function g(S,L){f(S,{identifier:L,...L?k():{}})}function N(S,L){f(S,{transient:L||void 0,...L?k():{}})}function h(S){return!!S.transient}const w=S=>S.value,q=S=>S.label;function P(S,L){if(!L)return;const O=re.value.find(ue=>ue.type===L);if(O){const ue=S.dbAttrs[0]??{modelId:S.modelId+".c",physicalName:S.name,dataType:"VARCHAR"};f(S,{type:L,customType:void 0,dbAttrs:[{...ue,dataType:O.dataType,length:O.length,scale:O.scale}]});return}f(S,L===wt?{type:L}:{type:L,customType:void 0})}function W(S,L){f(S,{customType:L.trim()===""?void 0:L})}function M(S,L){const ue={...S.dbAttrs[0]??{modelId:S.modelId+".c",physicalName:S.name,dataType:"VARCHAR"},...L};L.dataType!==void 0&&!ro.has(ue.dataType)&&(ue.scale=void 0),f(S,{dbAttrs:[ue]})}function $(S){var L;return ro.has(((L=S.dbAttrs[0])==null?void 0:L.dataType)??"")}function D(S,L){M(S,{logicalName:Object.keys(L).length?L:void 0})}function J(S){return S.personalInfoAttributeType??"none"}function B(S,L){f(S,{personalInfoAttributeType:L==="none"?void 0:L})}const re=n.computed(()=>o.predefinedCustomTypeCatalog.value),_=n.computed(()=>o.embeddableCatalog.value);function K(S){var L,O;return((L=S.label)==null?void 0:L.ko)??((O=S.label)==null?void 0:O.en)??S.type}function R(S){!S||!i.value||o.addPredefinedEmbed(i.value.modelId,S)}const X=n.computed(()=>o.groupCodeCatalog.value);function ee(S){var L;return((L=X.value.find(O=>O.groupCode===S.groupCode))==null?void 0:L.codes)??[]}function oe(S){return["none",...ee(S)]}function U(S){return S==="none"?"none":S.code}function G(S){var O,ue;if(S==="none")return o.t("em.common.noneParen");const L=((O=S.label)==null?void 0:O.ko)??((ue=S.label)==null?void 0:ue.en);return L?`${S.code} (${L})`:S.code}function ne(S,L){i.value&&o.setAttributeGroupCode(i.value.modelId,S.modelId,L)}function ce(S,L){f(S,{defaultValue:L==="none"?void 0:L})}function pe(S,L){f(S,{defaultValue:L.trim()===""?void 0:L})}function se(S){return S.attrType.startsWith("EMBED")&&S.dbAttrs.length>0}function me(S,L,O){const ue=S.dbAttrs.map((Q,Z)=>{if(Z!==L)return Q;const E={...Q,...O};for(const I of Object.keys(O))O[I]===void 0&&delete E[I];return E});i.value&&o.setEmbedColumns(i.value.modelId,S.modelId,ue)}function he(S,L,O){me(S,L,{logicalName:Object.keys(O).length?O:void 0})}function Ee(S,L){var Q,Z,E;if(S.attrType==="EMBED_PREDEF"){const I=(Q=o.embeddableCatalog.value.find(Y=>Y.type===S.type))==null?void 0:Q.fields[L];return I?{name:I.name,physicalName:I.physicalName,dataType:I.dataType,length:I.length,shareable:I.shareable,logicalName:I.logicalName}:void 0}const O=(Z=S.embedded)==null?void 0:Z.embeddableRef;if(!O)return;const ue=(E=o.state.logical.entities.find(I=>I.modelId===O))==null?void 0:E.attributes.flatMap(I=>I.dbAttrs)[L];return ue?{physicalName:ue.physicalName,dataType:ue.dataType,length:ue.length,scale:ue.scale,logicalName:ue.logicalName}:void 0}function Se(S,L){var O,ue;return((O=Ee(S,L))==null?void 0:O.dataType)||((ue=S.dbAttrs[L])==null?void 0:ue.dataType)||""}function Ie(S,L){var O,ue;return((O=Ee(S,L))==null?void 0:O.length)??((ue=S.dbAttrs[L])==null?void 0:ue.length)}function fe(S,L){var O,ue;return((O=Ee(S,L))==null?void 0:O.scale)??((ue=S.dbAttrs[L])==null?void 0:ue.scale)}const ge=["inherit","true","false"];function _e(S){return S==="inherit"?o.t("em.common.inherit"):S}function j(S){return(S==null?void 0:S.updatable)===void 0?"inherit":S.updatable?"true":"false"}function H(S,L,O){me(S,L,{updatable:O==="inherit"?void 0:O==="true"})}function x(S,L){M(S,{updatable:L==="inherit"?void 0:L==="true"})}const T=["inherit","true","false"];function V(S){return S==="inherit"?o.t("em.common.inherit"):S}function te(S){return(S==null?void 0:S.insertable)===void 0?"inherit":S.insertable?"true":"false"}function de(S,L,O){me(S,L,{insertable:O==="inherit"?void 0:O==="true"})}function ke(S,L){M(S,{insertable:L==="inherit"?void 0:L==="true"})}const ye=n.computed(()=>i.value?ii(i.value,o.state.logical.entities):[]),xe=n.computed(()=>tn(ye.value.flatMap(S=>S.attributes.flatMap(L=>L.dbAttrs)))),$e=n.computed(()=>ye.value.flatMap(S=>S.attributes.filter(L=>L.attrType==="NORMAL"&&L.dbAttrs.length===1&&L.dbAttrs[0]).map(L=>{var O;return{modelId:L.dbAttrs[0].modelId,physical:L.dbAttrs[0].physicalName||L.name,isCurrency:L.type==="Currency",ownerName:S.modelId===((O=i.value)==null?void 0:O.modelId)?void 0:S.name}})));function Ve(){const S=[...$e.value].sort((L,O)=>Number(O.isCurrency)-Number(L.isCurrency));return[oa,...S.map(L=>L.modelId)]}function Le(S){if(S===oa)return o.t("em.attr.sharedOwn");const L=$e.value.find(ue=>ue.modelId===S);if(!L)return S;const O=L.ownerName?`${L.ownerName}.`:"";return o.t("em.attr.sharedRef",{owner:O,physical:L.physical,mode:L.isCurrency?o.t("em.attr.currencyMode"):o.t("em.attr.sharedMode")})}function je(S){return(S==null?void 0:S.sharedColumnRef)??oa}function ut(S,L,O){me(S,L,{sharedColumnRef:O===oa?void 0:O})}function C(S){return(S==null?void 0:S.sharedColumnRef)!=null}function z(S){var L;return((L=Rn(S,xe.value))==null?void 0:L.physicalName)??""}return(S,L)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-aw",disabled:!n.unref(o).editable.value},[n.createElementVNode("div",ck,[n.createElementVNode("span",dk,n.toDisplayString(n.unref(o).t("em.attr.section",{n:l.value})),1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t("em.common.add"),onClick:L[0]||(L[0]=O=>n.unref(o).addAttribute(i.value.modelId))},null,8,["caption"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t("em.attr.addDivider"),onClick:L[1]||(L[1]=O=>n.unref(o).addDivider(i.value.modelId))},null,8,["caption"]),_.value.length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"140px",placeholder:n.unref(o).t("em.attr.addEmbeddable"),"model-value":void 0,items:_.value,"value-provider":O=>O.type,"label-provider":K,"onUpdate:modelValue":R},null,8,["placeholder","items","value-provider"])):n.createCommentVNode("",!0)]),n.createElementVNode("div",uk,[n.createElementVNode("table",mk,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[L[2]||(L[2]=n.createElementVNode("th",{class:"c-expand"},null,-1)),n.createElementVNode("th",fk,n.toDisplayString(n.unref(o).t("em.attr.namePlaceholder")),1),n.createElementVNode("th",pk,n.toDisplayString(n.unref(o).t("em.attr.typePlaceholder")),1),n.createElementVNode("th",hk,n.toDisplayString(n.unref(o).t("em.attr.logicalPlaceholder")),1),n.createElementVNode("th",yk,n.toDisplayString(n.unref(o).t("em.attr.columnPhysical")),1),L[3]||(L[3]=n.createElementVNode("th",{class:"c-dtype"},"dataType",-1)),L[4]||(L[4]=n.createElementVNode("th",{class:"c-len"},"len",-1)),n.createElementVNode("th",gk,n.toDisplayString(n.unref(o).t("em.attr.constraints")),1),L[5]||(L[5]=n.createElementVNode("th",{class:"c-del"},null,-1))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(i.value.attributes,O=>{var ue,Q,Z,E,I,Y,v,F,A,le;return n.openBlock(),n.createElementBlock(n.Fragment,{key:O.modelId},[O.attrType==="DIVIDER"?(n.openBlock(),n.createElementBlock("tr",{key:0,class:n.normalizeClass(["em-aw__divider-row",{"is-focused":r.value.has(O.modelId)}])},[L[6]||(L[6]=n.createElementVNode("td",{class:"c-expand"},null,-1)),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-divlabel-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.dividerLabelPlaceholder"),"model-value":O.name,"onUpdate:modelValue":ae=>f(O,{name:ae})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",{colspan:eE,class:"em-aw__divider-note"},n.toDisplayString(n.unref(o).t("em.attr.dividerNote")),1),n.createElementVNode("td",bk,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:ae=>n.unref(o).removeAttribute(i.value.modelId,O.modelId)},null,8,["onClick"])])],2)):se(O)?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("tr",{class:n.normalizeClass(["em-aw__embed-parent",{"is-focused":r.value.has(O.modelId)}])},[n.createElementVNode("td",Bk,[n.createElementVNode("span",Dk,[n.createVNode(Re,{name:"chevron",size:14,class:"em-aw__caret-ic"})])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-name-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.namePlaceholder"),"model-value":O.name,"onUpdate:modelValue":ae=>f(O,{name:ae})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-type-${O.modelId}`,width:"100%",disabled:"","model-value":O.type},null,8,["name","model-value"])]),n.createElementVNode("td",{colspan:tE,class:"em-aw__embed-note"},n.toDisplayString(n.unref(o).t("em.attr.embedChildCols",{n:O.dbAttrs.length})),1),n.createElementVNode("td",Ok,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:ae=>n.unref(o).removeAttribute(i.value.modelId,O.modelId)},null,8,["onClick"])])],2),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(O.dbAttrs,(ae,Ne)=>{var Te,Be,Ue,et,Ke,We;return n.openBlock(),n.createElementBlock(n.Fragment,{key:ae.modelId},[n.createElementVNode("tr",{class:n.normalizeClass(["em-aw__embed-col",{"em-aw__open":c(ae.modelId)}])},[n.createElementVNode("td",Pk,[n.createElementVNode("span",{class:n.normalizeClass(["em-aw__caret",{"is-open":c(ae.modelId)}]),role:"button",tabindex:"0",title:n.unref(o).t(c(ae.modelId)?"em.attr.overrideCollapse":"em.attr.overrideExpand"),onClick:Ye=>d(ae.modelId),onKeydown:[n.withKeys(n.withModifiers(Ye=>d(ae.modelId),["prevent"]),["enter"]),n.withKeys(n.withModifiers(Ye=>d(ae.modelId),["prevent"]),["space"])]},[n.createVNode(Re,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,Lk)]),n.createElementVNode("td",zk,"↳ "+n.toDisplayString(((Te=Ee(O,Ne))==null?void 0:Te.name)??((Be=Ee(O,Ne))==null?void 0:Be.physicalName)??n.unref(o).t("em.attr.colFallback",{n:Ne+1})),1),L[13]||(L[13]=n.createElementVNode("td",null,null,-1)),n.createElementVNode("td",null,[n.createVNode(kn,{name:`aw-embed-logical-${ae.modelId}`,languages:n.unref(o).languages.value,"default-lang":n.unref(o).userLanguage.value,placeholder:((et=(Ue=Ee(O,Ne))==null?void 0:Ue.logicalName)==null?void 0:et.ko)??n.unref(o).t("em.attr.logicalPlaceholder"),"model-value":ae.logicalName,"onUpdate:modelValue":Ye=>he(O,Ne,Ye)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-embed-col-${ae.modelId}`,width:"100%",disabled:C(ae),placeholder:((Ke=Ee(O,Ne))==null?void 0:Ke.physicalName)??n.unref(o).t("em.attr.columnPlaceholder"),"model-value":C(ae)?z(ae):ae.physicalName,"onUpdate:modelValue":Ye=>me(O,Ne,{physicalName:Ye})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(_n,{controller:n.unref(o),"ref-id":ae.modelId},null,8,["controller","ref-id"])]),n.createElementVNode("td",null,[n.createElementVNode("span",Uk,n.toDisplayString(Se(O,Ne)),1)]),n.createElementVNode("td",null,[n.createElementVNode("span",Hk,n.toDisplayString(Ie(O,Ne)??""),1)]),n.createElementVNode("td",Fk,[n.createElementVNode("span",Gk,n.toDisplayString(fe(O,Ne)!=null?`scale ${fe(O,Ne)}`:""),1)]),L[14]||(L[14]=n.createElementVNode("td",null,null,-1))],2),c(ae.modelId)?(n.openBlock(),n.createElementBlock("tr",jk,[L[17]||(L[17]=n.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),n.createElementVNode("td",Kk,[n.createElementVNode("div",Yk,[n.createElementVNode("fieldset",Wk,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(o).t("em.attr.overrideLegend")),1),(We=Ee(O,Ne))!=null&&We.shareable?(n.openBlock(),n.createElementBlock("label",qk,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.currencyColumn")),1),n.createVNode(n.unref(ie.BSSelect),{width:"150px","model-value":je(ae),items:Ve(),"value-provider":p,"label-provider":Le,"onUpdate:modelValue":Ye=>Ye&&ut(O,Ne,Ye)},null,8,["model-value","items","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",Xk,[L[15]||(L[15]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px",disabled:C(ae),"model-value":C(ae)?"false":te(ae),items:T,"value-provider":p,"label-provider":V,"onUpdate:modelValue":Ye=>Ye&&de(O,Ne,Ye)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",Jk,[L[16]||(L[16]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px",disabled:C(ae),"model-value":C(ae)?"false":j(ae),items:ge,"value-provider":p,"label-provider":_e,"onUpdate:modelValue":Ye=>Ye&&H(O,Ne,Ye)},null,8,["disabled","model-value","onUpdate:modelValue"])])])])])])):n.createCommentVNode("",!0)],64)}),128))],64)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("tr",{class:n.normalizeClass({"is-focused":r.value.has(O.modelId),"em-aw__open":c(O.modelId)})},[n.createElementVNode("td",_k,[n.createElementVNode("span",{class:n.normalizeClass(["em-aw__caret",{"is-open":c(O.modelId)}]),role:"button",tabindex:"0",title:n.unref(o).t(c(O.modelId)?"em.attr.detailCollapse":"em.attr.detailExpand"),onClick:ae=>d(O.modelId),onKeydown:[n.withKeys(n.withModifiers(ae=>d(O.modelId),["prevent"]),["enter"]),n.withKeys(n.withModifiers(ae=>d(O.modelId),["prevent"]),["space"])]},[n.createVNode(Re,{name:"chevron",size:14,class:"em-aw__caret-ic"})],42,kk)]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-name-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.namePlaceholder"),"model-value":O.name,"onUpdate:modelValue":ae=>f(O,{name:ae})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{name:`aw-type-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.typePlaceholder"),disabled:!!O.groupCode,items:n.unref(Ml)(O.type,re.value),"value-provider":w,"label-provider":q,"model-value":O.type,"onUpdate:modelValue":ae=>P(O,ae)},null,8,["name","placeholder","disabled","items","model-value","onUpdate:modelValue"]),O.type===n.unref(wt)?(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:0,name:`aw-customtype-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.customTypePlaceholder"),"model-value":O.customType??"","onUpdate:modelValue":ae=>W(O,ae)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])):n.createCommentVNode("",!0)]),n.createElementVNode("td",null,[n.createVNode(kn,{name:`aw-logical-${O.modelId}`,languages:n.unref(o).languages.value,"default-lang":n.unref(o).userLanguage.value,placeholder:n.unref(o).t("em.attr.logicalPlaceholder"),"model-value":(ue=O.dbAttrs[0])==null?void 0:ue.logicalName,"onUpdate:modelValue":ae=>D(O,ae)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`aw-col-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.columnPlaceholder"),disabled:h(O),"model-value":((Q=O.dbAttrs[0])==null?void 0:Q.physicalName)??"","onUpdate:modelValue":ae=>M(O,{physicalName:ae})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),n.createVNode(_n,{controller:n.unref(o),"ref-id":(Z=O.dbAttrs[0])==null?void 0:Z.modelId},null,8,["controller","ref-id"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{name:`aw-dtype-${O.modelId}`,width:"100%",placeholder:"dataType",disabled:h(O),items:n.unref(Tl)(((E=O.dbAttrs[0])==null?void 0:E.dataType)??"",n.unref(o).selectableDataTypes.value),"value-provider":p,"label-provider":n.unref(La),"model-value":((I=O.dbAttrs[0])==null?void 0:I.dataType)??"","onUpdate:modelValue":ae=>ae&&M(O,{dataType:ae})},null,8,["name","disabled","items","label-provider","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSNumberInput),{name:`aw-len-${O.modelId}`,width:"100%",placeholder:"len",disabled:h(O),"model-value":(Y=O.dbAttrs[0])==null?void 0:Y.length,"onUpdate:modelValue":ae=>M(O,{length:ae||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",Ek,[n.createElementVNode("div",wk,[n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-pk-${O.modelId}`,label:"PK","model-value":O.identifier,disabled:a.value||h(O),"onUpdate:modelValue":ae=>g(O,ae)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-nn-${O.modelId}`,label:"NN","model-value":O.notNull,disabled:h(O),"onUpdate:modelValue":ae=>f(O,{notNull:ae})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-uq-${O.modelId}`,label:"UQ","model-value":!!((v=O.dbAttrs[0])!=null&&v.unique),disabled:h(O),"onUpdate:modelValue":ae=>M(O,{unique:ae})},null,8,["name","model-value","disabled","onUpdate:modelValue"])])]),n.createElementVNode("td",{class:"c-del",title:y(O)?n.unref(o).t("em.attr.fkDeleteHint"):void 0},[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:ae=>n.unref(o).removeAttribute(i.value.modelId,O.modelId)},null,8,["onClick"])],8,Nk)],2),c(O.modelId)?(n.openBlock(),n.createElementBlock("tr",{key:0,class:n.normalizeClass(["em-aw__detail-row",{"is-focused":r.value.has(O.modelId)}])},[L[12]||(L[12]=n.createElementVNode("td",{class:"em-aw__detail-gutter"},null,-1)),n.createElementVNode("td",vk,[n.createElementVNode("div",xk,[n.createElementVNode("fieldset",Ck,[L[10]||(L[10]=n.createElementVNode("legend",null,"DB",-1)),n.createElementVNode("label",Ik,[L[7]||(L[7]=n.createElementVNode("span",null,"scale",-1)),n.createVNode(n.unref(ie.BSNumberInput),{name:`aw-scale-${O.modelId}`,width:"72px",placeholder:"scale",disabled:h(O)||!$(O),"model-value":(F=O.dbAttrs[0])==null?void 0:F.scale,"onUpdate:modelValue":ae=>M(O,{scale:ae||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-ai-${O.modelId}`,label:"Auto Increment","model-value":!!((A=O.dbAttrs[0])!=null&&A.autoIncrement),disabled:h(O)||!O.identifier,"onUpdate:modelValue":ae=>M(O,{autoIncrement:ae})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createElementVNode("label",Sk,[L[8]||(L[8]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ie.BSSelect),{name:`aw-ins-${O.modelId}`,width:"110px",disabled:h(O),"model-value":te(O.dbAttrs[0]),items:T,"value-provider":p,"label-provider":V,"onUpdate:modelValue":ae=>ae&&ke(O,ae)},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",$k,[L[9]||(L[9]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ie.BSSelect),{name:`aw-upd-${O.modelId}`,width:"110px",disabled:h(O),"model-value":j(O.dbAttrs[0]),items:ge,"value-provider":p,"label-provider":_e,"onUpdate:modelValue":ae=>ae&&x(O,ae)},null,8,["name","disabled","model-value","onUpdate:modelValue"])])]),n.createElementVNode("fieldset",Rk,[L[11]||(L[11]=n.createElementVNode("legend",null,"JPA",-1)),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-tr-${O.modelId}`,label:"@Transient","model-value":!!O.transient,disabled:O.identifier,"onUpdate:modelValue":ae=>N(O,ae)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-nid-${O.modelId}`,label:"@NaturalId","model-value":!!O.naturalId,disabled:O.identifier||h(O),"onUpdate:modelValue":ae=>b(O,ae)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{class:"em-aw__dsub",name:`aw-nidm-${O.modelId}`,label:"mutable","model-value":!!O.naturalIdMutable,disabled:h(O)||!O.naturalId,"onUpdate:modelValue":ae=>f(O,{naturalIdMutable:ae||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`aw-mv-${O.modelId}`,label:"Multi-Value (Set)","model-value":!!((le=O.dbAttrs[0])!=null&&le.multiValue),disabled:h(O),"onUpdate:modelValue":ae=>M(O,{multiValue:ae||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("fieldset",Ak,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(o).t("em.attr.semanticLegend")),1),n.createElementVNode("label",Tk,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.pii")),1),n.createVNode(n.unref(ie.BSSelect),{width:"150px","model-value":J(O),items:u,"value-provider":p,"label-provider":m,"onUpdate:modelValue":ae=>ae&&B(O,ae)},null,8,["model-value","onUpdate:modelValue"])]),X.value.length?(n.openBlock(),n.createElementBlock("label",Vk,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.codeGroup")),1),n.createVNode(gu,{"model-value":O.groupCode,items:X.value,locale:n.unref(o).uiLocale.value,"onUpdate:modelValue":ae=>ne(O,ae)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",Mk,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.defaultValue")),1),ee(O).length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"150px","model-value":O.defaultValue??"none",items:oe(O),"value-provider":U,"label-provider":G,"onUpdate:modelValue":ae=>ae&&ce(O,ae)},null,8,["model-value","items","onUpdate:modelValue"])):(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:1,name:`aw-default-${O.modelId}`,width:"150px",placeholder:n.unref(o).t("em.attr.defaultValue"),"model-value":O.defaultValue??"","onUpdate:modelValue":ae=>pe(O,ae)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))])])])])],2)):n.createCommentVNode("",!0)],64))],64)}),128)),i.value.attributes.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("tr",Zk,[n.createElementVNode("td",Qk,n.toDisplayString(n.unref(o).t("em.attr.empty")),1)]))])])])],8,sk)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-a64a6817"]]),oE=["disabled"],iE={class:"em-idxw__list"},aE={class:"em-idxw__list-head"},rE=["onClick"],lE={class:"em-idxw__item-name"},sE={key:0,class:"em-idxw__badge"},cE={class:"em-idxw__item-cnt"},dE={key:0,class:"em-idxw__empty"},uE={key:0,class:"em-idxw__edit"},mE={class:"em-idxw__form"},fE={class:"em-field em-idxw__name"},pE={class:"em-field"},hE=["value","placeholder"],yE={class:"em-idxw__transfer"},gE={class:"em-idxw__pane"},bE={class:"em-idxw__pane-head"},_E={class:"em-idxw__cols"},kE=["onClick"],EE=["title"],wE={key:0,class:"em-idxw__empty"},NE={class:"em-idxw__arrows"},vE={class:"em-idxw__pane"},xE={class:"em-idxw__pane-head"},CE={class:"em-idxw__cols"},IE={class:"em-idxw__col-name"},SE=["title"],$E={class:"em-idxw__col-ops"},RE=["title","disabled","onClick"],AE=["title","disabled","onClick"],TE=["title","onClick"],VE={key:0,class:"em-idxw__empty"},ME={key:1,class:"em-idxw__edit em-idxw__edit--empty"},BE=Pe(n.defineComponent({__name:"EntityIndexesWide",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=n.computed(()=>o.state.logical.entities.find($=>$.modelId===t.entityId)??null),a=n.computed(()=>{var $;return(($=i.value)==null?void 0:$.indexes)??[]}),r=n.computed(()=>{var $;return(($=i.value)==null?void 0:$.attributes)??[]}),l=n.ref(null);n.watch(a,$=>{var D;$.some(J=>J.modelId===l.value)||(l.value=((D=$[0])==null?void 0:D.modelId)??null)},{immediate:!0});const s=n.computed(()=>a.value.find($=>$.modelId===l.value)??null),c=n.computed(()=>i.value?io(i.value,o.superClassCatalog.value):[]),d=n.computed(()=>{var $;return new Set((($=s.value)==null?void 0:$.columns.map(D=>D.columnRef))??[])}),u=n.computed(()=>[...r.value.filter($=>!d.value.has($.modelId)).map($=>({ref:$.modelId,label:p($),inherited:!1})),...c.value.filter($=>!d.value.has($.modelId)).map($=>({ref:$.modelId,label:f($),inherited:!0}))]),m=n.ref(new Set);n.watch(l,()=>m.value=new Set);function p($){var J;const D=(J=$.dbAttrs[0])==null?void 0:J.physicalName;return D&&D!==$.name?`${$.name} (${D})`:$.name}function f($){return $.physicalName&&$.physicalName!==$.field?`${$.field} (${$.physicalName})`:$.field}function y($){const D=r.value.find(B=>B.modelId===$);if(D)return p(D);const J=c.value.find(B=>B.modelId===$);return J?f(J):$}function b($){return oo($)}function k($,D){i.value&&o.updateIndex(i.value.modelId,$,D)}function g(){var D;if(!i.value)return;const $=Me();o.addIndex(i.value.modelId,{modelId:$,name:`idx_${(((D=i.value.indexes)==null?void 0:D.length)??0)+1}`,unique:!1,columns:[]}),l.value=$}function N($){i.value&&o.removeIndex(i.value.modelId,$)}function h($){s.value&&k(s.value.modelId,{parameters:$.trim()===""?void 0:$})}function w($){const D=new Set(m.value);D.has($)?D.delete($):D.add($),m.value=D}function q(){const $=s.value;if(!$||!m.value.size)return;const D=[...m.value].map(J=>({columnRef:J,descending:!1}));k($.modelId,{columns:[...$.columns,...D]}),m.value=new Set}function P($){const D=s.value;D&&k(D.modelId,{columns:D.columns.filter((J,B)=>B!==$)})}function W($,D){const J=s.value;J&&k(J.modelId,{columns:J.columns.map((B,re)=>re===$?{...B,descending:D}:B)})}function M($,D){const J=s.value;if(!J)return;const B=$+D;if(B<0||B>=J.columns.length)return;const re=[...J.columns];[re[$],re[B]]=[re[B],re[$]],k(J.modelId,{columns:re})}return($,D)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-idxw",disabled:!n.unref(o).editable.value},[n.createElementVNode("aside",iE,[n.createElementVNode("div",aE,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.index.section",{n:a.value.length})),1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t("em.common.add"),onClick:g},null,8,["caption"])]),n.createElementVNode("ul",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value,J=>(n.openBlock(),n.createElementBlock("li",{key:J.modelId,class:n.normalizeClass(["em-idxw__item",{"is-active":J.modelId===l.value}]),onClick:B=>l.value=J.modelId},[n.createElementVNode("span",lE,n.toDisplayString(J.name||n.unref(o).t("em.attr.nameless")),1),J.unique?(n.openBlock(),n.createElementBlock("span",sE,"UQ")):n.createCommentVNode("",!0),n.createElementVNode("span",cE,n.toDisplayString(J.columns.length),1)],10,rE))),128)),a.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",dE,n.toDisplayString(n.unref(o).t("em.index.empty")),1))])]),s.value?(n.openBlock(),n.createElementBlock("section",uE,[n.createElementVNode("div",mE,[n.createElementVNode("label",fE,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.index.namePlaceholder")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"idxw-name",width:"100%","model-value":s.value.name,"onUpdate:modelValue":D[0]||(D[0]=J=>k(s.value.modelId,{name:J}))},null,8,["model-value"]),n.createVNode(_n,{controller:n.unref(o),"ref-id":s.value.modelId},null,8,["controller","ref-id"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"idxw-uq",class:"em-check em-idxw__uq",label:"unique","model-value":s.value.unique,"onUpdate:modelValue":D[1]||(D[1]=J=>k(s.value.modelId,{unique:J}))},null,8,["model-value"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn em-idxw__del",caption:n.unref(o).t("em.index.delete"),onClick:D[2]||(D[2]=J=>N(s.value.modelId))},null,8,["caption"])]),n.createElementVNode("label",pE,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.index.condition")),1),n.createElementVNode("textarea",{class:"em-textarea",value:s.value.parameters??"",rows:"2",placeholder:n.unref(o).t("em.index.conditionPlaceholderWide"),onChange:D[3]||(D[3]=J=>h(J.target.value))},null,40,hE)]),n.createElementVNode("div",yE,[n.createElementVNode("div",gE,[n.createElementVNode("div",bE,n.toDisplayString(n.unref(o).t("em.index.availColumns",{n:u.value.length})),1),n.createElementVNode("ul",_E,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.value,J=>(n.openBlock(),n.createElementBlock("li",{key:J.ref,class:n.normalizeClass(["em-idxw__col",{"is-sel":m.value.has(J.ref)}]),onClick:B=>w(J.ref)},[n.createTextVNode(n.toDisplayString(J.label),1),J.inherited?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-idxw__inh",title:n.unref(o).t("em.index.inheritedColTitle")},n.toDisplayString(n.unref(o).t("em.index.inheritedBadge")),9,EE)):n.createCommentVNode("",!0)],10,kE))),128)),u.value.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",wE,n.toDisplayString(n.unref(o).t("em.index.allColumnsUsed")),1))])]),n.createElementVNode("div",NE,[n.createVNode(n.unref(ie.BSButton),{caption:n.unref(o).t("em.index.addArrow"),disabled:!m.value.size,onClick:q},null,8,["caption","disabled"])]),n.createElementVNode("div",vE,[n.createElementVNode("div",xE,n.toDisplayString(n.unref(o).t("em.index.indexColumns",{n:s.value.columns.length})),1),n.createElementVNode("ul",CE,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(s.value.columns,(J,B)=>(n.openBlock(),n.createElementBlock("li",{key:B,class:"em-idxw__col em-idxw__col--idx"},[n.createElementVNode("span",IE,[n.createTextVNode(n.toDisplayString(y(J.columnRef)),1),b(J.columnRef)?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-idxw__inh",title:n.unref(o).t("em.index.inheritedColTitle")},n.toDisplayString(n.unref(o).t("em.index.inheritedBadge")),9,SE)):n.createCommentVNode("",!0)]),n.createVNode(n.unref(ie.BSCheckbox),{name:`idxw-desc-${B}`,class:"em-check",label:"DESC","model-value":J.descending,"onUpdate:modelValue":re=>W(B,re)},null,8,["name","model-value","onUpdate:modelValue"]),n.createElementVNode("span",$E,[n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn",title:n.unref(o).t("em.index.moveUp"),disabled:B===0,onClick:re=>M(B,-1)},"↑",8,RE),n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn",title:n.unref(o).t("em.index.moveDown"),disabled:B===s.value.columns.length-1,onClick:re=>M(B,1)},"↓",8,AE),n.createElementVNode("button",{type:"button",class:"em-idxw__opbtn em-idxw__opbtn--del",title:n.unref(o).t("em.index.removeColumn"),onClick:re=>P(B)},"✕",8,TE)])]))),128)),s.value.columns.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("li",VE,n.toDisplayString(n.unref(o).t("em.index.noColumns")),1))])])])])):(n.openBlock(),n.createElementBlock("section",ME,n.toDisplayString(n.unref(o).t("em.index.selectPrompt")),1))],8,oE)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-76de4c26"]]),DE={class:"em-op-src"},OE=["placeholder"],PE={class:"em-op-src__actions"},bu=Pe(n.defineComponent({__name:"OperationSourceEditor",props:{operationName:{},sourceCode:{},onSave:{type:Function},locale:{}},setup(e){const t=e,o=ie.useModalHandle(),i=(l,s)=>Rt(t.locale??"ko",l,s),a=n.ref(t.sourceCode);function r(){t.onSave(a.value),o.close()}return(l,s)=>(n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:i("em.opSource.title",{name:t.operationName})},{default:n.withCtx(()=>[n.createElementVNode("div",DE,[n.withDirectives(n.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,OE),[[n.vModelText,a.value]]),n.createElementVNode("div",PE,[n.createVNode(n.unref(ie.BSButton),{caption:i("em.common.save"),onClick:r},null,8,["caption"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:i("em.common.close"),onClick:s[1]||(s[1]=c=>n.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-34c9b822"]]),LE=["disabled"],zE={class:"em-ow__toolbar"},UE={class:"em-ow__count"},HE={class:"em-ow__scroll"},FE={class:"em-ow__table"},GE={class:"c-name"},jE={class:"c-desc"},KE={class:"c-pii"},YE={class:"c-src"},WE={class:"c-del"},qE={key:0},XE={colspan:"6",class:"em-ow__empty"},JE=Pe(n.defineComponent({__name:"EntityOperationsWide",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=ie.useModal(),a=n.computed(()=>o.state.logical.entities.find(y=>y.modelId===t.entityId)??null),r=["PUBLIC","PROTECTED","PACKAGE","PRIVATE"],l=["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 s(y){return y==="none"?o.t("em.common.noneParen"):y}const c=y=>y;function d(y,b){a.value&&o.updateOperation(a.value.modelId,y.modelId,b)}function u(y,b,k){d(y,{description:{...y.description,[b]:k}})}function m(y){return y.personalInfoAttributeType??"none"}function p(y,b){d(y,{personalInfoAttributeType:b==="none"?void 0:b})}function f(y){i.openModal({component:bu,bind:{operationName:y.name,sourceCode:y.sourceCode??"",locale:o.uiLocale.value,onSave:b=>d(y,{sourceCode:b})}})}return(y,b)=>{var k,g;return a.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-ow",disabled:!n.unref(o).editable.value},[n.createElementVNode("div",zE,[n.createElementVNode("span",UE,n.toDisplayString(n.unref(o).t("em.op.section",{n:((k=a.value.operations)==null?void 0:k.length)??0})),1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t("em.common.add"),onClick:b[0]||(b[0]=N=>n.unref(o).addOperation(a.value.modelId))},null,8,["caption"])]),n.createElementVNode("div",HE,[n.createElementVNode("table",FE,[n.createElementVNode("thead",null,[n.createElementVNode("tr",null,[n.createElementVNode("th",GE,n.toDisplayString(n.unref(o).t("em.attr.namePlaceholder")),1),b[1]||(b[1]=n.createElementVNode("th",{class:"c-vis"},"visibility",-1)),n.createElementVNode("th",jE,n.toDisplayString(n.unref(o).t("em.common.description")),1),n.createElementVNode("th",KE,n.toDisplayString(n.unref(o).t("em.attr.pii")),1),n.createElementVNode("th",YE,n.toDisplayString(n.unref(o).t("em.op.body")),1),b[2]||(b[2]=n.createElementVNode("th",{class:"c-del"},null,-1))])]),n.createElementVNode("tbody",null,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(a.value.operations??[],N=>{var h;return n.openBlock(),n.createElementBlock("tr",{key:N.modelId},[n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`ow-name-${N.modelId}`,width:"100%",placeholder:n.unref(o).t("em.op.namePlaceholder"),"model-value":N.name,"onUpdate:modelValue":w=>d(N,{name:w})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":N.visibility??"PACKAGE",items:r,"value-provider":c,"label-provider":c,"onUpdate:modelValue":w=>w&&d(N,{visibility:w})},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSTextInput),{name:`ow-desc-${N.modelId}`,width:"100%",placeholder:n.unref(o).t("em.op.descPlaceholderKo"),"model-value":((h=N.description)==null?void 0:h.ko)??"","onUpdate:modelValue":w=>u(N,"ko",w)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":m(N),items:l,"value-provider":c,"label-provider":s,"onUpdate:modelValue":w=>w&&p(N,w)},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("td",null,[n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t(N.sourceCode?"em.op.bodyDirty":"em.op.body"),onClick:w=>f(N)},null,8,["caption","onClick"])]),n.createElementVNode("td",WE,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:w=>n.unref(o).removeOperation(a.value.modelId,N.modelId)},null,8,["onClick"])])])}),128)),(g=a.value.operations)!=null&&g.length?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("tr",qE,[n.createElementVNode("td",XE,n.toDisplayString(n.unref(o).t("em.op.empty")),1)]))])])])],8,LE)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-1c255914"]]),ZE={class:"em-detail__tabs"},QE=["onClick"],ew={key:0,class:"em-detail__narrow"},tw=Pe(n.defineComponent({__name:"EntityDetailModal",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=ie.useModalHandle(),a=n.computed(()=>o.state.logical.entities.find(s=>s.modelId===t.entityId)??null);n.watch(a,s=>{s||i.close()});const r=[{key:"basics",labelKey:"em.detail.tabBasics"},{key:"columns",labelKey:"em.detail.tabColumns"},{key:"indexes",labelKey:"em.detail.tabIndexes"},{key:"operations",labelKey:"em.detail.tabOperations"}],l=n.ref("basics");return(s,c)=>{var d;return n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:n.unref(o).t("em.detail.title",{name:((d=a.value)==null?void 0:d.name)??""})},{default:n.withCtx(()=>[a.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:n.normalizeClass(["em-detail",{"is-maximized":n.unref(i).maximized}])},[n.createElementVNode("nav",ZE,[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(r,u=>n.createElementVNode("button",{key:u.key,type:"button",class:n.normalizeClass(["em-detail__tab",{"is-active":l.value===u.key}]),onClick:m=>l.value=u.key},n.toDisplayString(n.unref(o).t(u.labelKey)),11,QE)),64))]),n.createElementVNode("div",{class:n.normalizeClass(["em-detail__body",{"is-readonly":!n.unref(o).editable.value}])},[l.value==="basics"?(n.openBlock(),n.createElementBlock("div",ew,[n.createVNode(mu,{controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])])):l.value==="columns"?(n.openBlock(),n.createBlock(nE,{key:1,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])):l.value==="indexes"?(n.openBlock(),n.createBlock(BE,{key:2,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"])):(n.openBlock(),n.createBlock(JE,{key:3,controller:n.unref(o),"entity-id":a.value.modelId},null,8,["controller","entity-id"]))],2)],2)):n.createCommentVNode("",!0)]),_:1},8,["title"])}}}),[["__scopeId","data-v-785c4770"]]);function ia(e,t,o){e.openModal({component:tw,bind:{controller:n.markRaw(t),entityId:o}})}const _u="외래키는 연관관계에서 파생됩니다. 삭제하려면 연관관계선을 선택해 삭제하세요.";function nw(e){var i;const t=JSON.parse(JSON.stringify(e));t.modelId=Me(),t.name=`${e.name}_copy`,(i=t.table)!=null&&i.physicalName&&(t.table.physicalName=`${t.table.physicalName}_copy`);const o=new Map;for(const a of t.attributes){const r=Me();o.set(a.modelId,r),a.modelId=r;for(const l of a.dbAttrs)l.modelId=Me()}for(const a of t.indexes??[]){a.modelId=Me();for(const r of a.columns)r.columnRef=o.get(r.columnRef)??r.columnRef}return t}const ow=220;function iw(e,t){let i=-1/0;for(const r of e.entityLayouts)i=Math.max(i,r.geo.location.x+(r.geo.size.width||ow));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 t.entityLayouts)a=Math.min(a,r.geo.location.x);for(const r of t.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 Fr=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),En=Symbol("editorController");function ku(e="m1",t="d1"){return{logical:{modelId:e,entities:[],associations:[],groups:[]},layout:{diagramId:t,logicalModelRef:e,entityLayouts:[],associationLayouts:[],groupLayouts:[],notes:[]}}}function aa(e,t){const o=[];for(const i of t.remove)o.push(On(e,i));for(const i of t.update)o.push(rn(e,i.attributeId,i.patch));for(const i of t.add)o.push(Mt(e,i));return o}function qn(e,t,o){return{...e,entities:e.entities.map(i=>i.modelId===t?{...i,attributes:o(i.attributes)}:i)}}function Xn(e,t){const o=[];for(const[i,a]of kp(e,t,Me))o.push(...aa(i,a));return o}function Eu(e,t,o){const i=new Set(o.remove);return qn(e,t,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,t){const o=ho(e,t,Me),i=aa(t,o),a=Eu(e,t,o);return i.push(...Xn(a,t)),i}function wu(e){return e.attributes.flatMap(t=>t.dbAttrs).map(t=>({...t,modelId:Me()}))}function aw(e,t){var d;const o=e.entities.find(u=>u.modelId===t);if(!o)return[];const i=[];let a;if(!o.attributes.some(u=>u.identifier)){const u=o.attributes.reduce((f,y)=>Math.max(f,y.order),-1)+1,m=new Set(o.attributes.map(f=>f.name));let p="id";for(let f=2;m.has(p);f++)p=`id${f}`;a={modelId:Me(),name:p,type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:u,dbAttrs:[{modelId:Me(),physicalName:p.toLowerCase(),dataType:"BIGINT"}]},i.push(Mt(t,a))}const r=[];for(const u of e.entities)for(const m of u.attributes){if(((d=m.embedded)==null?void 0:d.embeddableRef)!==t)continue;const p=e.associations.find(k=>k.modelId===m.embedded.associationRef);if(!p)continue;const f=p.end1.entityRef===u.modelId,y=f?p.end1:p.end2,b=f?p.end2:p.end1;r.push({ownerId:u.modelId,dispId:m.modelId,assocId:p.modelId,end1:{entityRef:u.modelId,multiplicity:y.multiplicity,navigable:y.navigable,composition:!1},end2:{entityRef:t,multiplicity:b.multiplicity,navigable:b.navigable,composition:!1}})}const l={...e,entities:e.entities.map(u=>{if(u.modelId===t)return a?{...u,stereotype:"JPA_ENTITY",attributes:[...u.attributes,a]}:{...u,stereotype:"JPA_ENTITY"};const m=new Set(r.filter(p=>p.ownerId===u.modelId).map(p=>p.dispId));return m.size?{...u,attributes:u.attributes.filter(p=>!m.has(p.modelId))}:u}),associations:e.associations.map(u=>{const m=r.find(p=>p.assocId===u.modelId);return m?{...u,end1:m.end1,end2:m.end2}:u})},s=ho(l,t,Me);for(const u of r){const m=s.add.find(p=>{var f;return((f=p.derivedFrom)==null?void 0:f.associationRef)===u.assocId});m&&(u.end2.attributeRef=m.modelId)}for(const u of r)i.push(On(u.ownerId,u.dispId)),i.push(yi(u.assocId,{end1:u.end1,end2:u.end2}));i.push(...aa(t,s));const c=Eu(l,t,s);return i.push(...Xn(c,t)),i}function rw(e,t){const o=e.entities.find(r=>r.modelId===t);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===t,s=r.end2.entityRef===t;if(!l&&!s)continue;const c=l?r.end2.entityRef:r.end1.entityRef,d=e.entities.find(h=>h.modelId===c);if(!d||d.attributes.some(h=>{var w;return((w=h.embedded)==null?void 0:w.associationRef)===r.modelId}))continue;const u=Me(),m=d.attributes.reduce((h,w)=>Math.max(h,w.order),-1)+1,p=new Set(d.attributes.map(h=>h.name)),f=a(o.name);let y=f;for(let h=2;p.has(y);h++)y=`${f}${h}`;const b=o.attributes.filter(h=>!h.identifier&&!h.derivedFrom).flatMap(h=>h.dbAttrs).map(h=>({...h,modelId:Me()})),k={modelId:u,name:y,type:o.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:m,dbAttrs:b,embedded:{associationRef:r.modelId,embeddableRef:t}};i.push(Mt(c,k));const g=l?"end2":"end1",N=l?"end1":"end2";i.push(yi(r.modelId,{identifying:!1,[g]:{entityRef:c,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:Me()},[N]:{entityRef:t,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:u}}))}return i}function lw(e=ku(),t={}){var je,ut;const o=n.reactive(e);let i=new Ja(o);const a=n.ref(t.embeddableCatalog??[]),r=n.ref(t.groupCodeCatalog??[]),l=n.ref(t.predefinedCustomTypeCatalog??[]),s=n.ref(t.superClassCatalog??[]),c=n.ref(t.languages??["ko","en","ja","zh"]),d=n.ref(t.userLanguage??"ko"),u=n.ref(t.uiLocale??"ko"),m=(C,z)=>Rt(u.value,C,z),p=n.ref(t.reservedWords),f=n.ref(t.selectableDataTypes),y=n.ref(t.largeEntityThreshold),b=n.ref(t.flagEntitiesWithoutRelations??!1),k=n.ref(!1),g=n.ref(!1),N=n.ref(!1),h=n.ref(0),w=n.ref(null);let q=0;const P=C=>{if(t.onNotice){t.onNotice(C);return}w.value={text:C,id:++q}},W=n.ref(((je=t.meta)==null?void 0:je.schemaVersion)??1),M=n.ref(((ut=t.meta)==null?void 0:ut.opWriteEnabled)??!1),$=n.computed(()=>W.value>=2&&M.value),D=t.historyTransport,J=n.computed(()=>$.value&&D!==void 0),B=t.restoreTransport,re=n.ref(0),_=n.computed(()=>$.value&&R.value&&B!==void 0);async function K(C){if(!B||!R.value)return{ok:!1,reason:"unavailable"};const z=await B(C);return z.ok&&re.value++,z}const R=n.ref(!(W.value>=2&&M.value===!1)),X=n.ref("LOGICAL_PHYSICAL"),ee=n.ref("straight"),oe=n.ref(!0),U=n.ref(!0),G=n.ref(null),ne=n.computed(()=>{var C;return((C=G.value)==null?void 0:C.kind)==="attribute"?{entityId:G.value.entityId,attrId:G.value.anchor}:null}),ce=n.computed(()=>{var C;return((C=G.value)==null?void 0:C.kind)==="attribute"?G.value.ids:[]}),pe=n.computed(()=>{var C,z;return((C=G.value)==null?void 0:C.kind)==="entity"?G.value.id:((z=G.value)==null?void 0:z.kind)==="attribute"?G.value.entityId:null}),se=n.ref(null);let me=0;const he=n.ref(null),Ee=n.ref(null);let Se=t.meta;function Ie(){i.onChange(()=>{k.value=i.canUndo,g.value=i.canRedo,N.value=i.isDirty,h.value++})}Ie();let fe=null,ge=null;function _e(){ge==null||ge(),ge=null,fe=null}function j(){if(_e(),!$.value||!t.opTransport)return;const C=new Gs({diagramId:o.layout.diagramId,state:o,transport:t.opTransport,origin:"gui",onFreeze:z=>{R.value=!1,Ee.value=z},onError:t.onOpError});C.seed((Se==null?void 0:Se.revSeed)??{}),ge=C.attach(i),fe=C}j();const H=n.computed(()=>bl(o.logical,o.layout)),x=n.computed(()=>({reservedWords:p.value,selectableDataTypes:f.value,largeEntityThreshold:y.value,flagEntitiesWithoutRelations:b.value,embeddableCatalog:a.value,superClassCatalog:s.value})),T=n.computed(()=>Dl(o.logical,x.value)),V=n.computed(()=>{const C=new Map;for(const z of T.value){if(!z.targetRef)continue;const S=C.get(z.targetRef);S?S.push(z):C.set(z.targetRef,[z])}return C}),te=C=>{R.value&&i.execute(C)},de=C=>o.layout.entityLayouts.some(z=>z.entityRef===C&&!!z.locked),ke=C=>o.layout.groupLayouts.some(z=>z.groupRef===C&&!!z.locked),ye=C=>{const z=o.logical.associations.find(S=>S.modelId===C);return!!z&&(de(z.end1.entityRef)||de(z.end2.entityRef))},xe=(C,z,S)=>{if(de(C))return;const L=rn(C,z,S),O=qn(o.logical,C,Q=>Q.map(Z=>Z.modelId===z?{...Z,...S}:Z)),ue=Xn(O,C);te(ue.length?Ge("속성 수정",[L,...ue]):L)};function $e(C){const z=C.map(E=>o.layout.entityLayouts.find(I=>I.entityRef===E)).filter(E=>!!E);if(!z.length)return{location:{x:40,y:40},size:{width:400,height:300}};let S=1/0,L=1/0,O=-1/0,ue=-1/0;for(const E of z){const I=E.geo.size.width||220,Y=E.geo.size.height||140;S=Math.min(S,E.geo.location.x),L=Math.min(L,E.geo.location.y),O=Math.max(O,E.geo.location.x+I),ue=Math.max(ue,E.geo.location.y+Y)}const Q=40,Z=28;return{location:{x:S-Q,y:L-Q-Z},size:{width:O-S+Q*2,height:ue-L+Q*2+Z}}}function Ve(C,z,S){var E;const L=o.layout.groupLayouts.find(I=>I.groupRef===C),O=(L==null?void 0:L.geo.location)??z,ue=z.x-O.x,Q=z.y-O.y,Z=[ms(C,z),...S.map(I=>Dn(I.id,I.location))];if(ue||Q){const I=new Set(((E=o.logical.groups.find(Y=>Y.modelId===C))==null?void 0:E.memberEntityRefs)??[]);for(const Y of o.logical.associations){if(!I.has(Y.end1.entityRef)||!I.has(Y.end2.entityRef))continue;const v=o.layout.associationLayouts.find(F=>F.associationRef===Y.modelId);v&&v.waypoints.length&&Z.push(Is(Y.modelId,ue,Q))}for(const Y of(L==null?void 0:L.memberNoteRefs)??[]){const v=o.layout.notes.find(F=>F.modelId===Y);v&&Z.push(po(Y,{x:v.geo.location.x+ue,y:v.geo.location.y+Q}))}}return Z}const Le={state:o,resolved:H,issues:T,issuesByRef:V,flagEntitiesWithoutRelations:b,canUndo:k,canRedo:g,dirty:N,revision:h,notice:w,editable:R,schemaVersion:W,opWriteEnabled:M,opMode:$,opConflict:Ee,historyTransport:D,historyAvailable:J,restoreTransport:B,restoreAvailable:_,restoreToSeq:K,reloadRequest:re,displayMode:X,routingMode:ee,showGrid:oe,showMinimap:U,selection:G,selectedAttr:ne,selectedAttrIds:ce,inspectedEntityId:pe,focusRequest:se,clipboard:he,embeddableCatalog:a,groupCodeCatalog:r,predefinedCustomTypeCatalog:l,superClassCatalog:s,languages:c,userLanguage:d,uiLocale:u,t:m,selectableDataTypes:f,setEditable(C){R.value=C&&$.value},setEmbeddableCatalog(C){a.value=C},setGroupCodeCatalog(C){r.value=C},setPredefinedCustomTypeCatalog(C){l.value=C},setSuperClassCatalog(C){s.value=C},selectAttribute(C,z,S="replace"){const L=G.value,O=(L==null?void 0:L.kind)==="attribute"&&L.entityId===C;if(S==="replace"||!O){G.value={kind:"attribute",entityId:C,ids:[z],anchor:z};return}if(S==="toggle"){const v=L.ids.includes(z),F=v?L.ids.filter(le=>le!==z):[...L.ids,z];if(!F.length){G.value=null;return}const A=v&&L.anchor===z?F[F.length-1]:v?L.anchor:z;G.value={kind:"attribute",entityId:C,ids:F,anchor:A};return}const ue=o.logical.entities.find(v=>v.modelId===C),Q=[...(ue==null?void 0:ue.attributes)??[]].sort((v,F)=>v.order-F.order).map(v=>v.modelId),Z=Q.indexOf(L.anchor),E=Q.indexOf(z);if(Z<0||E<0){G.value={kind:"attribute",entityId:C,ids:[z],anchor:z};return}const[I,Y]=Z<=E?[Z,E]:[E,Z];G.value={kind:"attribute",entityId:C,ids:Q.slice(I,Y+1),anchor:L.anchor}},moveAttributeFocus(C){const z=G.value;if((z==null?void 0:z.kind)!=="attribute")return!1;const S=o.logical.entities.find(Q=>Q.modelId===z.entityId);if(!S||!S.attributes.length)return!1;const L=S.attributes.findIndex(Q=>Q.modelId===z.anchor);if(L<0)return!1;const O=Math.min(Math.max(L+C,0),S.attributes.length-1);if(O===L)return!0;const ue=S.attributes[O].modelId;return G.value={kind:"attribute",entityId:z.entityId,ids:[ue],anchor:ue},!0},nudgeSelectedAttributes(C){const z=G.value;if((z==null?void 0:z.kind)!=="attribute")return!1;const S=o.logical.entities.find(v=>v.modelId===z.entityId);if(!S)return!1;const L=S.attributes,O=new Set(z.ids),ue=L.map((v,F)=>O.has(v.modelId)?F:-1).filter(v=>v>=0);if(!ue.length)return!1;const Q=Math.min(...ue),Z=L.filter(v=>!O.has(v.modelId)),E=L.slice(0,Q).filter(v=>!O.has(v.modelId)).length;let I;if(C<0){if(E<=0)return!0;I=E-1}else{if(Z.length-E<=0)return!0;I=E+1}if(de(z.entityId))return!0;const Y=L.filter(v=>O.has(v.modelId)).map(v=>v.modelId);return te(Qa(z.entityId,Y,I)),!0},deleteSelection(){if(!R.value)return!1;const C=G.value;if(!C)return!1;if(C.kind==="attribute"){if(de(C.entityId))return!1;const z=C.ids;if(!z.length)return!1;z.length===1?Le.removeAttribute(C.entityId,z[0]):Le.removeAttributes(C.entityId,z)}else if(C.kind==="entity"){if(de(C.id))return!1;Le.removeEntity(C.id)}else if(C.kind==="note")Le.removeNote(C.id);else if(C.kind==="group"){if(ke(C.id))return!1;Le.removeGroup(C.id)}else Le.removeAssociation(C.id);return G.value=null,!0},nudgeNodes(C,z,S){if(!C.length||z===0&&S===0)return!1;const L=new Set(o.logical.entities.map(I=>I.modelId)),O=new Set(o.logical.groups.map(I=>I.modelId)),ue=new Set(o.layout.notes.map(I=>I.modelId)),Q=new Set;for(const I of C){if(!O.has(I))continue;const Y=o.logical.groups.find(v=>v.modelId===I);for(const v of(Y==null?void 0:Y.memberEntityRefs)??[])Q.add(v)}const Z=[],E=[];for(const I of C)if(O.has(I)){if(ke(I))continue;const Y=o.layout.groupLayouts.find(le=>le.groupRef===I);if(!Y)continue;const v=o.logical.groups.find(le=>le.modelId===I),F=((v==null?void 0:v.memberEntityRefs)??[]).map(le=>{var Ne;const ae=((Ne=o.layout.entityLayouts.find(Te=>Te.entityRef===le))==null?void 0:Ne.geo.location)??{x:0,y:0};return{id:le,location:{x:ae.x+z,y:ae.y+S}}}),A={x:Y.geo.location.x+z,y:Y.geo.location.y+S};Z.push(Ge("그룹 이동",Ve(I,A,F))),E.push("g:"+I)}else if(L.has(I)){if(Q.has(I)||de(I))continue;const Y=o.layout.entityLayouts.find(v=>v.entityRef===I);if(!Y)continue;Z.push(Dn(I,{x:Y.geo.location.x+z,y:Y.geo.location.y+S})),E.push("e:"+I)}else if(ue.has(I)){const Y=o.layout.notes.find(v=>v.modelId===I);if(!Y)continue;Z.push(po(I,{x:Y.geo.location.x+z,y:Y.geo.location.y+S})),E.push("n:"+I)}return Z.length?(te(Ge("이동",Z,"nudge:"+E.sort().join(","))),!0):!1},requestFocus(C){se.value={id:C,nonce:++me}},undo:()=>{R.value&&i.undo()},redo:()=>{R.value&&i.redo()},markSaved:()=>{R.value&&(fe==null||fe.flush(),i.markSavePoint())},loadDiagram(C,z){_e(),o.logical=C.logical,o.layout=C.layout,i=new Ja(o),Ie(),W.value=(z==null?void 0:z.schemaVersion)??1,M.value=(z==null?void 0:z.opWriteEnabled)??!1,R.value=!(W.value>=2&&M.value===!1),Se=z,Ee.value=null,G.value=null,k.value=i.canUndo,g.value=i.canRedo,N.value=i.isDirty,j()},flush(){fe==null||fe.flush()},whenOpsSettled(){return(fe==null?void 0:fe.whenSettled())??Promise.resolve()},addEntity(C="NewEntity",z={x:80,y:80}){const S=Me(),L={modelId:S,name:C,stereotype:"JPA_ENTITY",table:{physicalName:C.toLowerCase()},attributes:[{modelId:Me(),name:"id",type:"Long",attrType:"NORMAL",identifier:!0,notNull:!0,order:0,dbAttrs:[{modelId:Me(),physicalName:"id",dataType:"BIGINT"}]}]};return te(ui(L,{location:{...z},size:{width:220,height:140}})),S},renameEntity(C,z){de(C)||te(is(C,z))},updateEntity(C,z){if(de(C))return;const S=os(C,z),L=o.logical.entities.find(Q=>Q.modelId===C),O=z.stereotype==="JPA_EMBEDDABLE"&&!!L&&L.stereotype!=="JPA_EMBEDDABLE",ue=!!z.stereotype&&z.stereotype!=="JPA_EMBEDDABLE"&&!!L&&L.stereotype==="JPA_EMBEDDABLE";if(O&&L){const Q=L.attributes.filter(v=>v.identifier&&!v.derivedFrom).map(v=>rn(C,v.modelId,{identifier:!1})),Z=qn({...o.logical,entities:o.logical.entities.map(v=>v.modelId===C?{...v,stereotype:"JPA_EMBEDDABLE"}:v)},C,v=>v.map(F=>F.identifier&&!F.derivedFrom?{...F,identifier:!1}:F)),E=Gr(Z,C),I=rw(o.logical,C),Y=[S,...Q,...E,...I];te(Y.length>1?Ge("임베더블 변환",Y):S);return}if(ue){const Q=aw(o.logical,C),Z=[S,...Q];te(Z.length>1?Ge("엔터티 전환",Z):S);return}te(S)},moveEntity(C,z){de(C)||te(Dn(C,z))},resizeEntity(C,z){de(C)||te(as(C,z))},removeEntity(C){de(C)||te(ns(C))},setEntitySwatch(C,z){te(rs(C,z))},setEntityCollapsed(C,z){te(ls(C,z))},setEntityLocked(C,z){te(ss(C,z))},isEntityLocked(C){return de(C)},collapseAll(){te(Za(!0))},expandAll(){te(Za(!1))},setAttributeSwatch(C,z,S){te(mi(C,z,S))},dragGroup(C,z,S){ke(C)||te(Ge("그룹 이동",Ve(C,z,S)))},resizeGroup(C,z){ke(C)||te(fs(C,z))},setGroupSwatch(C,z){te(ps(C,z))},setGroupLocked(C,z){te(hs(C,z))},isGroupLocked(C){return ke(C)},updateGroup(C,z){ke(C)||te(cs(C,z))},createGroup(C,z){if(!C.length)return null;const S=[];for(const ue of o.logical.groups)for(const Q of C)ue.memberEntityRefs.includes(Q)&&S.push(pi(ue.modelId,Q));const L=Me(),O={modelId:L,name:z?{ko:z}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[...C]};return S.push(fi(O,$e(C))),te(Ge("그룹 생성",S)),G.value=null,L},addEmptyGroup(C,z){const S=Me();return te(fi({modelId:S,name:z?{ko:z}:void 0,excludeDDLGeneration:!1,memberEntityRefs:[]},{location:{...C},size:{width:360,height:260}})),S},removeGroup(C){ke(C)||te(ds(C))},dropEntity(C,z,S){var ue;if(de(C))return;const L=((ue=o.logical.groups.find(Q=>Q.memberEntityRefs.includes(C)))==null?void 0:ue.modelId)??null,O=[Dn(C,z)];L!==S&&(L&&O.push(pi(L,C)),S&&O.push(us(S,C))),te(Ge("이동",O))},ungroupEntity(C){const z=o.logical.groups.find(S=>S.memberEntityRefs.includes(C));z&&te(pi(z.modelId,C))},dropNote(C,z,S){var ue;const L=((ue=o.layout.groupLayouts.find(Q=>{var Z;return(Z=Q.memberNoteRefs)==null?void 0:Z.includes(C)}))==null?void 0:ue.groupRef)??null,O=[po(C,z)];L!==S&&(L&&O.push(Ds(L,C)),S&&O.push(Bs(S,C))),te(Ge("이동",O))},addPredefinedEmbed(C,z){if(de(C))return;const S=a.value.find(E=>E.type===z),L=o.logical.entities.find(E=>E.modelId===C);if(!S||!L)return;const O=L.attributes.reduce((E,I)=>Math.max(E,I.order),-1)+1,ue=Me(),Q=S.fields.map(()=>({modelId:Me(),physicalName:"",dataType:""})),Z={modelId:ue,name:S.defaultName,type:S.type,attrType:"EMBED_PREDEF",identifier:!1,notNull:!1,order:O,dbAttrs:Q};return te(Mt(C,Z)),ue},addAttribute(C,z={}){if(de(C))return z.modelId??"";const S=o.logical.entities.find(Y=>Y.modelId===C),L=S?S.attributes.length:0,O=z.modelId??Me(),ue=z.name??`field${L}`,Q={modelId:O,name:ue,type:z.type??za,attrType:z.attrType??"NORMAL",identifier:z.identifier??!1,notNull:z.notNull??!1,order:L,dbAttrs:z.dbAttrs??[{modelId:Me(),physicalName:ue,dataType:"VARCHAR",length:255}],...z},Z=Mt(C,Q),E=qn(o.logical,C,Y=>[...Y,Q]),I=Xn(E,C);return te(I.length?Ge("속성 추가",[Z,...I]):Z),O},addDivider(C){if(de(C))return"";const z=o.logical.entities.find(ue=>ue.modelId===C),S=z?z.attributes.length:0,L=Me();return te(Mt(C,{modelId:L,name:"",type:"",attrType:"DIVIDER",identifier:!1,notNull:!1,order:S,dbAttrs:[]})),L},updateAttribute(C,z,S){xe(C,z,S)},setAttributeGroupCode(C,z,S){xe(C,z,{groupCode:S,type:S?Sn:za})},setEmbedColumns(C,z,S){var E,I;if(de(C))return;const L=rn(C,z,{dbAttrs:S}),O=(E=o.logical.entities.find(Y=>Y.modelId===C))==null?void 0:E.attributes.find(Y=>Y.modelId===z),ue=(I=O==null?void 0:O.embedded)==null?void 0:I.associationRef,Q=ue?o.logical.associations.find(Y=>Y.modelId===ue):void 0,Z=[];Q&&ue&&(Q.end1.legacyEmbedRaw&&Z.push(ln(ue,"end1",{legacyEmbedRaw:void 0})),Q.end2.legacyEmbedRaw&&Z.push(ln(ue,"end2",{legacyEmbedRaw:void 0}))),te(Z.length?Ge("임베드 컬럼 수정",[L,...Z]):L)},removeAttribute(C,z){if(de(C))return;if(ki(o.logical,C,z)){P(_u);return}const S=On(C,z),L=qn(o.logical,C,ue=>ue.filter(Q=>Q.modelId!==z)),O=Xn(L,C);te(O.length?Ge("속성 삭제",[S,...O]):S)},removeAttributes(C,z){var Z;if(!z.length||de(C))return;const S=z.filter(E=>!ki(o.logical,C,E));if(S.length<z.length&&P(_u),!S.length)return;const L=S.map(E=>On(C,E)),O=new Set(S),ue=qn(o.logical,C,E=>E.filter(I=>!O.has(I.modelId))),Q=[...L,...Xn(ue,C)];te(Q.length===1?Q[0]:Ge("속성 삭제",Q)),((Z=G.value)==null?void 0:Z.kind)==="attribute"&&G.value.entityId===C&&(G.value=null)},setAttributeSwatches(C,z,S){z.length&&(z.length===1?te(mi(C,z[0],S)):te(Ge("속성 색상",z.map(L=>mi(C,L,S)))))},reorderAttributes(C,z,S){!z.length||de(C)||te(Qa(C,z,S))},addIndex(C,z){de(C)||te(ws(C,z))},updateIndex(C,z,S){de(C)||te(Ns(C,z,S))},removeIndex(C,z){de(C)||te(vs(C,z))},addOperation(C,z={}){var Q;if(de(C))return z.modelId??"";const S=o.logical.entities.find(Z=>Z.modelId===C),L=((Q=S==null?void 0:S.operations)==null?void 0:Q.length)??0,O=z.modelId??Me(),ue={modelId:O,name:z.name??`method${L}`,visibility:z.visibility??"PACKAGE",order:L,...z};return te(ys(C,ue)),O},updateOperation(C,z,S){de(C)||te(gs(C,z,S))},removeOperation(C,z){de(C)||te(bs(C,z))},reorderOperations(C,z,S){!z.length||de(C)||te(_s(C,z,S))},setOperationSwatch(C,z,S){te(ks(C,z,S))},addAssociation(C,z,S,L){if(de(C)||de(z))return"";const O=Me(),ue={modelId:O,end1:{entityRef:C,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:S},end2:{entityRef:z,multiplicity:"ZERO_OR_MORE_INSTANCES",navigable:!0,composition:!1}},Q={...o.logical,associations:[...o.logical.associations,ue]},Z=ho(Q,z,Me),E=Z.add[0];E&&(ue.end2.attributeRef=E.modelId);const I={associationRef:O,waypoints:[],sourceColumnRef:S,targetColumnRef:(E==null?void 0:E.modelId)??L},Y=hi(ue,I),v=aa(z,Z);return te(v.length?Ge("관계 추가",[Y,...v]):Y),O},addEmbedAssociation(C,z){if(de(C))return;const S=o.logical.entities.find(Ne=>Ne.modelId===C),L=o.logical.entities.find(Ne=>Ne.modelId===z);if(!S||!L||L.stereotype!=="JPA_EMBEDDABLE")return;const O=Me(),ue=Me(),Q=Me(),Z=S.attributes.reduce((Ne,Te)=>Math.max(Ne,Te.order),-1)+1,E=wu(L),I=Ne=>Ne&&Ne.charAt(0).toLowerCase()+Ne.slice(1),Y=new Set(S.attributes.map(Ne=>Ne.name)),v=I(L.name);let F=v;for(let Ne=2;Y.has(F);Ne++)F=`${v}${Ne}`;const A={modelId:ue,name:F,type:L.name,attrType:"EMBED_OWN",identifier:!1,notNull:!1,order:Z,dbAttrs:E,embedded:{associationRef:O,embeddableRef:z}},le={modelId:O,end1:{entityRef:C,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!1,attributeRef:Q},end2:{entityRef:z,multiplicity:"EXACTLY_ONE_INSTANCE",navigable:!0,composition:!0,attributeRef:ue}},ae={associationRef:O,waypoints:[],sourceColumnRef:ue,targetColumnRef:void 0};return te(Ge("임베드 추가",[Mt(C,A),hi(le,ae)])),O},setEmbedCardinality(C,z){var v;if(ye(C))return;const S=o.logical.associations.find(F=>F.modelId===C);if(!S)return;let L,O;for(const F of o.logical.entities){const A=F.attributes.find(le=>{var ae;return((ae=le.embedded)==null?void 0:ae.associationRef)===C&&le.attrType==="EMBED_OWN"});if(A){L=F.modelId,O=A;break}}if(!L||!O)return;const ue=O.embedded.embeddableRef,Q=S.end2.entityRef===ue?"end2":"end1",Z=S[Q];if(Z.multiplicity===z)return;const E=F=>F==="ZERO_OR_MORE_INSTANCES"||F==="ONE_OR_MORE_INSTANCES",I=E(Z.multiplicity),Y=E(z);if(I===Y){te(ln(C,Q,{multiplicity:z}));return}if(Y)te(Ge("임베드 컬렉션 전환",[rn(L,O.modelId,{dbAttrs:[]}),ln(C,Q,{multiplicity:z,jpa:{...Z.jpa,collectionType:((v=Z.jpa)==null?void 0:v.collectionType)??"LIST"}})]));else{const F=o.logical.entities.find(A=>A.modelId===ue);if(!F)return;te(Ge("임베드 단일 전환",[rn(L,O.modelId,{dbAttrs:wu(F)}),ln(C,Q,{multiplicity:z,jpa:{...Z.jpa,collectionType:void 0,collectionTable:void 0,orderColumn:void 0}})]))}},removeAssociation(C){if(ye(C))return;const z=o.logical.associations.find(Q=>Q.modelId===C),S=Es(C);if(!z){te(S);return}for(const Q of o.logical.entities){const Z=Q.attributes.find(E=>{var I;return((I=E.embedded)==null?void 0:I.associationRef)===C});if(Z){te(Ge("임베드 삭제",[S,On(Q.modelId,Z.modelId)]));return}}const L=z.end2.entityRef,O={...o.logical,associations:o.logical.associations.filter(Q=>Q.modelId!==C)},ue=Gr(O,L);te(ue.length?Ge("관계 삭제",[S,...ue]):S)},setAssociationIdentifying(C,z){if(ye(C))return;const S=o.logical.associations.find(Z=>Z.modelId===C),L=yi(C,{identifying:z});if(!S||S.identifying===z){te(L);return}const O=S.end2.entityRef,ue={...o.logical,associations:o.logical.associations.map(Z=>Z.modelId===C?{...Z,identifying:z}:Z)},Q=Gr(ue,O);te(Q.length?Ge("식별 관계 변경",[L,...Q]):L)},updateAssociationEnd(C,z,S){ye(C)||te(ln(C,z,S))},moveWaypoint(C,z,S){te(xs(C,z,S))},addWaypoint(C,z,S){te($s(C,z,S))},removeWaypoint(C,z){te(Cs(C,z))},clearWaypoints(C){te(Ss(C))},addNote(C="메모",z={x:80,y:80}){const S=Me();return te(Rs({modelId:S,memo:C,geo:{location:{...z},size:{width:200,height:120}}})),S},removeNote(C){te(As(C))},moveNote(C,z){te(po(C,z))},resizeNote(C,z){te(Ts(C,z))},setNoteMemo(C,z){te(Vs(C,z))},setNoteSwatch(C,z){te(Ms(C,z))},addNoteConnection(C,z){te(Os(C,z))},removeNoteConnection(C,z){te(Ps(C,z))},moveNoteConnectionWaypoint(C,z,S,L){te(Ls(C,z,S,L))},addNoteConnectionWaypoint(C,z,S,L){te(zs(C,z,S,L))},removeNoteConnectionWaypoint(C,z,S){te(Us(C,z,S))},clearNoteConnectionWaypoints(C,z){te(Hs(C,z))},autoLayout(){const C=El(o.logical,o.layout);C.length&&te(Ge("자동 배치",C.map(z=>Dn(z.id,z.location))))},copy(){const C=G.value;if((C==null?void 0:C.kind)==="attribute"){const ue=o.logical.entities.find(Z=>Z.modelId===C.entityId);if(!ue)return;const Q=[...ue.attributes].sort((Z,E)=>Z.order-E.order).filter(Z=>C.ids.includes(Z.modelId));if(!Q.length)return;he.value=JSON.parse(JSON.stringify({kind:"attribute",attributes:Q}));return}const z=pe.value;if(!z)return;const S=o.logical.entities.find(ue=>ue.modelId===z),L=o.layout.entityLayouts.find(ue=>ue.entityRef===z);if(!S)return;const O=(L==null?void 0:L.geo)??{location:{x:80,y:80},size:{width:220,height:140}};he.value=JSON.parse(JSON.stringify({kind:"entity",entity:S,geo:O}))},paste(){if(!R.value)return;const C=he.value;if(!C)return;if(C.kind==="attribute"){const L=pe.value;if(!L)return;const O=o.logical.entities.find(Y=>Y.modelId===L);if(!O)return;const ue=new Set(O.attributes.map(Y=>Y.name)),Q=new Set(O.attributes.flatMap(Y=>Y.dbAttrs.map(v=>v.physicalName))),Z=O.attributes.length,E=[],I=C.attributes.map((Y,v)=>{const F=JSON.parse(JSON.stringify(Y));F.modelId=Me();for(const A of F.dbAttrs)A.modelId=Me();ue.has(F.name)&&(F.name=`${F.name}_copy`);for(const A of F.dbAttrs)A.physicalName&&Q.has(A.physicalName)&&(A.physicalName=`${A.physicalName}_copy`);return F.order=Z+v,E.push(F.modelId),Mt(L,F)});te(I.length===1?I[0]:Ge("속성 붙여넣기",I)),G.value={kind:"attribute",entityId:L,ids:E,anchor:E[E.length-1]};return}const z=nw(C.entity),S={location:{x:C.geo.location.x+40,y:C.geo.location.y+40},size:{...C.geo.size}};te(ui(z,S)),G.value={kind:"entity",id:z.modelId}},importEntities(C,z,S){if(!R.value)return;const L=Wl(C,z,{existing:o.logical,includeRelated:S==null?void 0:S.includeRelated});if(L.logical.entities.length===0)return;const O=iw(o.layout,L.layout),ue=new Map(L.layout.entityLayouts.map(Y=>[Y.entityRef,Y])),Q=new Map(L.layout.associationLayouts.map(Y=>[Y.associationRef,Y])),Z=new Map(L.layout.groupLayouts.map(Y=>[Y.groupRef,Y])),E=[];let I=80;for(const Y of L.logical.entities){const v=ue.get(Y.modelId),F=v?{location:Fr(v.geo.location,O),size:{...v.geo.size}}:{location:{x:I+=40,y:80},size:{width:220,height:140}};let A;if(v){const{entityRef:le,geo:ae,locked:Ne,...Te}=v;A=Te}E.push(ui(Y,F,A))}for(const Y of L.logical.associations){const v=Q.get(Y.modelId),F=v?{...v,waypoints:v.waypoints.map(A=>Fr(A,O))}:{associationRef:Y.modelId,waypoints:[]};E.push(hi(Y,F))}for(const Y of L.logical.groups){const v=Z.get(Y.modelId),F=v?{location:Fr(v.geo.location,O),size:{...v.geo.size}}:{location:{x:80,y:80},size:{width:320,height:200}};let A;if(v){const{groupRef:le,geo:ae,locked:Ne,memberNoteRefs:Te,...Be}=v;A=Be}E.push(fi(Y,F,A))}te(Ge("다이어그램 가져오기",E)),G.value={kind:"entity",id:L.logical.entities[0].modelId}}};return Le}const ra=Symbol("groupHover"),Nu=Symbol("groupDrag"),Jn=Symbol("relationHighlight"),sw={key:0,class:"em-sel","aria-hidden":"true"},cw=["title","aria-expanded","disabled"],dw={class:"em-entity__stereotype"},uw={key:1,class:"em-entity__name"},mw=["data-attr","onClick","onPointerdown","onPointermove","onPointerup","onPointercancel"],fw=["onPointerdown"],pw={key:1,class:"em-entity__divider-label"},hw=["title"],yw={class:"em-key-slot"},gw={class:"em-key-slot"},bw={key:0,class:"em-entity__type"},_w=["onClick"],kw={class:"em-entity__attrname"},Ew={class:"em-entity__type"},ww=["data-op"],Nw=["onPointerdown"],vw={class:"em-entity__op-vis","aria-hidden":"true"},xw=["title"],Cw={key:4,class:"em-entity__footer"},vu=Pe(n.defineComponent({__name:"EntityNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const t=e,o=n.inject(En,null),i=(Q,Z)=>o?o.t(Q,Z):Rt("ko",Q,Z),a=n.computed(()=>(o==null?void 0:o.userLanguage.value)??"ko"),r=ie.useModal();function l(){o&&ia(r,o,t.id)}const s=n.inject(ra,null),c=n.inject(Jn,null),d=n.computed(()=>!!o&&o.editable.value);function u(){s&&(s.value=t.data.groupRef??null)}function m(){c==null||c.setEntityHover(t.id)}function p(){c==null||c.setEntityHover(null)}const f=n.computed(()=>!!c&&c.primaryEntityIds.value.has(t.id)),y=n.computed(()=>!!c&&c.relatedEntityIds.value.has(t.id)&&!f.value),b=n.computed(()=>{var Q;return((Q=o==null?void 0:o.selection.value)==null?void 0:Q.kind)==="entity"&&o.selection.value.id===t.id}),k=n.computed(()=>!!t.selected&&!b.value),g=n.computed(()=>{var Q;return o&&((Q=o.selectedAttr.value)==null?void 0:Q.entityId)===t.id?new Set(o.selectedAttrIds.value):new Set}),N=n.computed(()=>g.value.size>0);function h(Q,Z){const E=Z.shiftKey?"range":Z.metaKey||Z.ctrlKey?"toggle":"replace";o==null||o.selectAttribute(t.id,Q.modelId,E)}const w=n.computed(()=>!!c&&c.active.value&&!c.relatedEntityIds.value.has(t.id)&&!b.value),q=n.computed(()=>t.data.entity),P=n.computed(()=>t.data.displayMode??"LOGICAL_PHYSICAL"),W=n.computed(()=>t.data.collapsed??!1),M=n.computed(()=>t.data.locked??!1);function $(){d.value&&(o==null||o.setEntityCollapsed(t.id,!W.value))}const D=n.computed(()=>P.value==="PHYSICAL"||P.value==="LOGICAL_PHYSICAL"),J=n.computed(()=>{const Q=P.value==="PHYSICAL"||P.value==="LOGICAL_PHYSICAL",Z={};for(const E of q.value.attributes){const I=E.attrType.startsWith("RELATION")&&E.dbAttrs.length>0;Z[E.modelId]={pk:E.identifier,fk:I&&Q,required:E.notNull&&!E.identifier}}return Z});function B(Q){if(!Q)return"";const Z=[];return Q.pk&&Q.fk?Z.push(i("em.node.keyPfk")):Q.pk?Z.push(i("em.node.keyPk")):Q.fk&&Z.push(i("em.node.keyFk")),Q.required&&Z.push(i("em.node.required")),Z.join(" · ")}const re=n.computed(()=>{const Q=zr(at(t.data.style)),Z={};return Q&&(Z["--em-header-bg"]=Q.bar,Z["--em-header-fg"]=Q.barOn),Z});function _(Q){var Z,E;return(E=zr(at((Z=t.data.attributeStyles)==null?void 0:Z[Q.modelId])))==null?void 0:E.text}const K=n.computed(()=>[...q.value.operations??[]].sort((Q,Z)=>Q.order-Z.order)),R=n.computed(()=>P.value==="CLASS"&&K.value.length>0),X={PUBLIC:"+",PRIVATE:"-",PROTECTED:"#",PACKAGE:"~"};function ee(Q){return Q?X[Q]:"~"}function oe(Q){var Z,E;return(E=zr(at((Z=t.data.operationStyles)==null?void 0:Z[Q.modelId])))==null?void 0:E.text}function U(Q,Z,E){switch(P.value){case"CLASS":return[{text:Q}];case"PHYSICAL":return[{text:E||Q}];case"LOGICAL":return[Z?{text:Z}:{text:i("em.node.logicalMissing"),missing:!0}];default:{const I=Z?{text:Z}:{text:i("em.node.logicalMissing"),missing:!0};return E?[I,{text:` · ${E}`}]:[I]}}}function G(Q){var Z,E,I;return ne(Q)?[{text:Q.name}]:U(Q.name,(E=(Z=Q.dbAttrs[0])==null?void 0:Z.logicalName)==null?void 0:E[a.value],((I=Q.dbAttrs[0])==null?void 0:I.physicalName)??"")}function ne(Q){return Q.attrType.startsWith("EMBED")&&Q.dbAttrs.length>0}function ce(Q){return Q.attrType==="DIVIDER"}function pe(Q){if(Q.attrType!=="EMBED_PREDEF")return Q.dbAttrs;const Z=o==null?void 0:o.embeddableCatalog.value.find(I=>I.type===Q.type);if(!Z)return Q.dbAttrs;const E=tn(en(q.value,(o==null?void 0:o.state.logical.entities)??[]));return Q.dbAttrs.map((I,Y)=>{const v=Z.fields[Y],F=Rn(I,E);return F?{...I,physicalName:F.physicalName,logicalName:I.logicalName??(v==null?void 0:v.logicalName),dataType:I.dataType||(v==null?void 0:v.dataType)||""}:v?{...I,physicalName:I.physicalName||v.physicalName,logicalName:I.logicalName??v.logicalName,dataType:I.dataType||v.dataType,length:I.length??v.length}:I})}function se(Q){var Z;return U(Q.physicalName,(Z=Q.logicalName)==null?void 0:Z[a.value],Q.physicalName)}function me(Q){const Z=Ua(Q,(o==null?void 0:o.state.logical.associations)??[]);return Ha(P.value,Q,Z)}const he=n.computed(()=>{var Q,Z,E;return U(q.value.name,(Z=(Q=q.value.table)==null?void 0:Q.logicalName)==null?void 0:Z[a.value],((E=q.value.table)==null?void 0:E.physicalName)??"")}),Ee=n.ref(!1),Se=n.ref(""),Ie=n.ref(null);async function fe(){var Q,Z;d.value&&(Se.value=q.value.name,Ee.value=!0,await n.nextTick(),(Q=Ie.value)==null||Q.focus(),(Z=Ie.value)==null||Z.select())}function ge(){if(!Ee.value)return;Ee.value=!1;const Q=Se.value.trim();Q&&Q!==q.value.name&&(o==null||o.renameEntity(t.id,Q))}function _e(){o==null||o.addAttribute(t.id)}function j(){o==null||o.addDivider(t.id)}const{screenToFlowCoordinate:H,findNode:x}=De(),T=n.ref(null),V=n.computed(()=>{const Q=T.value??t.data.size;return Q?{width:`${Q.width}px`,minHeight:`${Q.height}px`}:void 0});let te=null;function de(Q){var I,Y,v;if(!d.value)return;Q.stopPropagation();const Z=(I=x(t.id))==null?void 0:I.dimensions,E=H({x:Q.clientX,y:Q.clientY});te={fx:E.x,fy:E.y,w:(Z==null?void 0:Z.width)??((Y=t.data.size)==null?void 0:Y.width)??200,h:(Z==null?void 0:Z.height)??((v=t.data.size)==null?void 0:v.height)??120},Q.target.setPointerCapture(Q.pointerId)}function ke(Q){if(!te)return;const Z=H({x:Q.clientX,y:Q.clientY});T.value={width:Math.max(40,te.w+(Z.x-te.fx)),height:Math.max(40,te.h+(Z.y-te.fy))}}function ye(Q){var Z,E,I;if(te&&T.value&&o){const Y=(Z=x(t.id))==null?void 0:Z.dimensions;o.resizeEntity(t.id,{width:Math.round((Y==null?void 0:Y.width)??T.value.width),height:Math.round((Y==null?void 0:Y.height)??T.value.height)})}te=null,T.value=null,(I=(E=Q.target).releasePointerCapture)==null||I.call(E,Q.pointerId)}const xe=n.ref(null),$e=n.ref(null);function Ve(Q,Z){if(!d.value)return;Z.stopPropagation(),Z.preventDefault();const E=g.value,I=E.has(Q.modelId)?new Set(E):new Set([Q.modelId]);$e.value={ids:I,dropIndex:-1,lineY:0},Z.target.setPointerCapture(Z.pointerId)}function Le(Q){if(!$e.value||!xe.value)return;const Z=Array.from(xe.value.querySelectorAll(".em-entity__row"));if(!Z.length)return;let E=Z.length;for(let v=0;v<Z.length;v++){const F=Z[v].getBoundingClientRect();if(Q.clientY<F.top+F.height/2){E=v;break}}const I=Z[Z.length-1],Y=E<Z.length?Z[E].offsetTop:I.offsetTop+I.offsetHeight;$e.value={...$e.value,dropIndex:E,lineY:Y}}function je(){const Q=$e.value;if($e.value=null,!Q||Q.dropIndex<0)return;const Z=q.value.attributes,E=Z.filter(A=>Q.ids.has(A.modelId)).map(A=>A.modelId),I=Z.filter((A,le)=>Q.ids.has(A.modelId)&&le<Q.dropIndex).length,Y=Q.dropIndex-I,v=Z.filter(A=>!Q.ids.has(A.modelId)).map(A=>A.modelId);[...v.slice(0,Y),...E,...v.slice(Y)].join(",")!==Z.map(A=>A.modelId).join(",")&&(o==null||o.reorderAttributes(t.id,E,Y))}function ut(){$e.value=null}const C=n.ref(null),z=n.ref(null);function S(Q,Z){d.value&&(Z.stopPropagation(),Z.preventDefault(),z.value={id:Q.modelId,dropIndex:-1,lineY:0},Z.target.setPointerCapture(Z.pointerId))}function L(Q){if(!z.value||!C.value)return;const Z=Array.from(C.value.querySelectorAll(".em-entity__op-row"));if(!Z.length)return;let E=Z.length;for(let v=0;v<Z.length;v++){const F=Z[v].getBoundingClientRect();if(Q.clientY<F.top+F.height/2){E=v;break}}const I=Z[Z.length-1],Y=E<Z.length?Z[E].offsetTop:I.offsetTop+I.offsetHeight;z.value={...z.value,dropIndex:E,lineY:Y}}function O(){const Q=z.value;if(z.value=null,!Q||Q.dropIndex<0)return;const E=K.value.findIndex(Y=>Y.modelId===Q.id);if(E<0)return;const I=Q.dropIndex-(E<Q.dropIndex?1:0);I!==E&&(o==null||o.reorderOperations(t.id,[Q.id],I))}function ue(){z.value=null}return(Q,Z)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-entity",{"is-hover-origin":f.value,"is-related":y.value,"is-dimmed":w.value,"is-selected":b.value,"is-multi-selected":k.value,"has-focused-attr":N.value,"is-locked":M.value}]),style:n.normalizeStyle(V.value),onPointerdown:u,onMouseenter:m,onMouseleave:p,onDblclick:l},[b.value?(n.openBlock(),n.createElementBlock("div",sw,[...Z[7]||(Z[7]=[n.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):n.createCommentVNode("",!0),n.createElementVNode("header",{class:"em-entity__header",style:n.normalizeStyle(re.value),onDblclick:n.withModifiers(fe,["stop"])},[n.createElementVNode("button",{type:"button",class:"em-entity__caret nodrag",title:i(W.value?"em.panel.expand":"em.panel.collapse"),"aria-expanded":!W.value,disabled:!d.value,onClick:n.withModifiers($,["stop"]),onPointerdown:Z[0]||(Z[0]=n.withModifiers(()=>{},["stop"])),onDblclick:Z[1]||(Z[1]=n.withModifiers(()=>{},["stop"]))},n.toDisplayString(W.value?"▸":"▾"),41,cw),n.createElementVNode("span",dw,"«"+n.toDisplayString(q.value.stereotype)+"»",1),Ee.value?n.withDirectives((n.openBlock(),n.createElementBlock("input",{key:0,ref_key:"inputEl",ref:Ie,"onUpdate:modelValue":Z[2]||(Z[2]=E=>Se.value=E),class:"em-entity__name-input nodrag",onKeyup:[n.withKeys(ge,["enter"]),Z[3]||(Z[3]=n.withKeys(E=>Ee.value=!1,["esc"]))],onBlur:ge,onPointerdown:Z[4]||(Z[4]=n.withModifiers(()=>{},["stop"]))},null,544)),[[n.vModelText,Se.value]]):(n.openBlock(),n.createElementBlock("span",uw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(he.value,(E,I)=>(n.openBlock(),n.createElementBlock("span",{key:I,class:n.normalizeClass({"em-entity__missing":E.missing})},n.toDisplayString(E.text),3))),128))])),M.value?(n.openBlock(),n.createBlock(Re,{key:2,name:"lock",size:12,class:"em-entity__lock",title:i("em.node.editLock")},null,8,["title"])):n.createCommentVNode("",!0)],36),W.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock("ul",{key:1,ref_key:"attrsUl",ref:xe,class:"em-entity__attrs"},[$e.value&&$e.value.dropIndex>=0?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:n.normalizeStyle({top:`${$e.value.lineY}px`}),"aria-hidden":"true"},null,4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(q.value.attributes,E=>{var I,Y,v,F;return n.openBlock(),n.createElementBlock(n.Fragment,{key:E.modelId},[n.createElementVNode("li",{class:n.normalizeClass(["em-entity__row",{"is-attr-selected":g.value.has(E.modelId),"is-dragging":(I=$e.value)==null?void 0:I.ids.has(E.modelId),"is-embed":ne(E),"is-divider":ce(E),nodrag:ce(E)&&d.value}]),"data-attr":E.modelId,onClick:n.withModifiers(A=>h(E,A),["stop"]),onPointerdown:A=>ce(E)?Ve(E,A):void 0,onPointermove:A=>ce(E)?Le(A):void 0,onPointerup:A=>ce(E)?je():void 0,onPointercancel:A=>ce(E)?ut():void 0},[d.value&&!ce(E)?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:A=>Ve(E,A),onPointermove:Le,onPointerup:je,onPointercancel:ut,onClick:Z[5]||(Z[5]=n.withModifiers(()=>{},["stop"]))},"⠿",40,fw)):n.createCommentVNode("",!0),ce(E)?(n.openBlock(),n.createElementBlock("span",pw,n.toDisplayString(E.name),1)):(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createVNode(n.unref(yn),{id:`l:${E.modelId}`,type:"target",position:n.unref(Ce).Left,class:"em-handle"},null,8,["id","position"]),n.createElementVNode("span",{class:"em-entity__keys",title:B(J.value[E.modelId]),"aria-hidden":"true"},[n.createElementVNode("span",yw,[(Y=J.value[E.modelId])!=null&&Y.pk?(n.openBlock(),n.createBlock(Re,{key:0,name:"key",size:12,class:"em-key is-pk"})):(v=J.value[E.modelId])!=null&&v.required?(n.openBlock(),n.createBlock(Re,{key:1,name:"asterisk",size:14,class:"em-key is-required"})):n.createCommentVNode("",!0)]),n.createElementVNode("span",gw,[ne(E)?(n.openBlock(),n.createBlock(Re,{key:0,name:"table",size:11,class:"em-embed-glyph"})):(F=J.value[E.modelId])!=null&&F.fk?(n.openBlock(),n.createBlock(Re,{key:1,name:"key",size:12,class:"em-key is-fk"})):n.createCommentVNode("",!0)])],8,hw),n.createElementVNode("span",{class:"em-entity__attrname",style:n.normalizeStyle({color:_(E)})},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(G(E),(A,le)=>(n.openBlock(),n.createElementBlock("span",{key:le,class:n.normalizeClass({"em-entity__missing":A.missing})},n.toDisplayString(A.text),3))),128))],4),me(E)?(n.openBlock(),n.createElementBlock("span",bw,n.toDisplayString(me(E)),1)):n.createCommentVNode("",!0),n.createVNode(n.unref(yn),{id:`r:${E.modelId}`,type:"source",position:n.unref(Ce).Right,class:"em-handle"},null,8,["id","position"])],64))],42,mw),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ne(E)&&D.value?pe(E):[],A=>(n.openBlock(),n.createElementBlock("li",{key:`${E.modelId}:${A.modelId}`,class:n.normalizeClass(["em-entity__embed-col",{"is-group-selected":g.value.has(E.modelId)}]),onClick:n.withModifiers(le=>h(E,le),["stop"])},[Z[8]||(Z[8]=n.createElementVNode("span",{class:"em-entity__embed-rail","aria-hidden":"true"},null,-1)),n.createElementVNode("span",kw,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(se(A),(le,ae)=>(n.openBlock(),n.createElementBlock("span",{key:ae,class:n.normalizeClass({"em-entity__missing":le.missing})},n.toDisplayString(le.text),3))),128))]),n.createElementVNode("span",Ew,n.toDisplayString(A.dataType),1)],10,_w))),128))],64)}),128))],512)),!W.value&&R.value?(n.openBlock(),n.createElementBlock("ul",{key:2,ref_key:"opsUl",ref:C,class:"em-entity__ops"},[z.value&&z.value.dropIndex>=0?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-entity__drop-line",style:n.normalizeStyle({top:`${z.value.lineY}px`}),"aria-hidden":"true"},null,4)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(K.value,E=>{var I;return n.openBlock(),n.createElementBlock("li",{key:E.modelId,class:n.normalizeClass(["em-entity__op-row",{"is-dragging":((I=z.value)==null?void 0:I.id)===E.modelId}]),"data-op":E.modelId},[d.value?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-entity__grip nodrag","aria-hidden":"true",onPointerdown:Y=>S(E,Y),onPointermove:L,onPointerup:O,onPointercancel:ue,onClick:Z[6]||(Z[6]=n.withModifiers(()=>{},["stop"]))},"⠿",40,Nw)):n.createCommentVNode("",!0),n.createElementVNode("span",vw,n.toDisplayString(ee(E.visibility)),1),n.createElementVNode("span",{class:"em-entity__op-name",style:n.normalizeStyle({color:oe(E)})},n.toDisplayString(E.name)+"()",5)],10,ww)}),128))],512)):K.value.length?(n.openBlock(),n.createElementBlock("div",{key:3,class:"em-entity__ops-summary",title:i("em.node.opsSummaryTitle",{n:K.value.length})},[n.createVNode(Re,{name:"method",size:12}),n.createElementVNode("span",null,n.toDisplayString(i("em.node.opsSummary",{n:K.value.length})),1)],8,xw)):n.createCommentVNode("",!0),d.value?(n.openBlock(),n.createElementBlock("footer",Cw,[n.createElementVNode("button",{type:"button",class:"em-entity__add nodrag",onClick:_e},n.toDisplayString(i("em.node.addAttr")),1),Z[9]||(Z[9]=n.createElementVNode("span",{class:"em-entity__footer-sep","aria-hidden":"true"},null,-1)),n.createElementVNode("button",{type:"button",class:"em-entity__add nodrag",onClick:j},n.toDisplayString(i("em.node.addDivider")),1)])):n.createCommentVNode("",!0),d.value&&!Ee.value?(n.openBlock(),n.createElementBlock("div",{key:5,class:"em-entity__resize nodrag nopan",onPointerdown:de,onPointermove:ke,onPointerup:ye},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-3ffbbf24"]]),Iw={key:0,class:"em-sel","aria-hidden":"true"},Sw={class:"em-group__label"},$w={class:"em-group__name"},Rw={key:0,class:"em-group__pkg"},Aw={key:1,class:"em-group__flag"},xu=Pe(n.defineComponent({__name:"GroupNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const t=e,o=n.computed(()=>t.data.group),i=n.computed(()=>t.data.locked??!1),a=n.computed(()=>at(t.data.style)),r=n.computed(()=>a.value?{"--em-group-fill":`color-mix(in srgb, var(--em-swatch-${a.value}-bar) 14%, transparent)`}:{}),l=n.inject(En,null),s=(D,J)=>l?l.t(D,J):Rt("ko",D,J),c=n.computed(()=>!!l&&l.editable.value),d=n.computed(()=>{var D;return!!t.id&&((D=l==null?void 0:l.selection.value)==null?void 0:D.kind)==="group"&&l.selection.value.id===t.id}),u=n.computed(()=>!!t.selected&&!d.value),m=n.inject(ra,null),p=n.computed(()=>!!t.id&&(m==null?void 0:m.value)===t.id),f=n.inject(Jn,null);function y(){t.id&&(f==null||f.setGroupHover(t.id))}function b(){f==null||f.setGroupHover(null)}const k=n.computed(()=>!!f&&f.hoverGroupId.value===t.id),g=n.computed(()=>!!f&&f.hoverGroupId.value!==null&&f.hoverGroupId.value!==t.id),{screenToFlowCoordinate:N,findNode:h}=De();let w=null,q=null;function P(D){var re;if(!t.id||!c.value)return;D.stopPropagation();const J=((re=h(t.id))==null?void 0:re.dimensions)??{width:400,height:300},B=N({x:D.clientX,y:D.clientY});w={fx:B.x,fy:B.y,w:J.width,h:J.height},D.target.setPointerCapture(D.pointerId)}function W(D){if(!w||!t.id)return;const J=N({x:D.clientX,y:D.clientY});q={width:Math.max(160,w.w+(J.x-w.fx)),height:Math.max(120,w.h+(J.y-w.fy))};const B=h(t.id);B&&(B.style={width:`${q.width}px`,height:`${q.height}px`})}function M(D){var J,B;w&&q&&t.id&&l&&l.resizeGroup(t.id,q),w=null,q=null,(B=(J=D.target).releasePointerCapture)==null||B.call(J,D.pointerId)}const $=n.computed(()=>{const D=o.value.name;return(D==null?void 0:D.ko)||(D==null?void 0:D.en)||(D==null?void 0:D.ja)||(D==null?void 0:D.zh)||o.value.packageName||s("em.group.fallback")});return(D,J)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-group",{"is-drop-target":p.value,"is-hover-origin":k.value,"is-dimmed":g.value,"is-selected":d.value,"is-multi-selected":u.value,"is-locked":i.value}]),style:n.normalizeStyle(r.value),onMouseenter:y,onMouseleave:b},[d.value?(n.openBlock(),n.createElementBlock("div",Iw,[...J[0]||(J[0]=[n.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):n.createCommentVNode("",!0),n.createElementVNode("div",Sw,[n.createElementVNode("span",$w,n.toDisplayString($.value),1),o.value.packageName?(n.openBlock(),n.createElementBlock("span",Rw,n.toDisplayString(o.value.packageName),1)):n.createCommentVNode("",!0),o.value.excludeDDLGeneration?(n.openBlock(),n.createElementBlock("span",Aw,n.toDisplayString(s("em.group.ddlExcludeBadge")),1)):n.createCommentVNode("",!0),i.value?(n.openBlock(),n.createBlock(Re,{key:2,name:"lock",size:12,class:"em-group__lock",title:s("em.node.editLock")},null,8,["title"])):n.createCommentVNode("",!0)]),c.value&&!i.value?(n.openBlock(),n.createElementBlock("div",{key:1,class:"em-group__resize nodrag nopan",onPointerdown:P,onPointermove:W,onPointerup:M},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-9b95a9b6"]]),Tw={key:0,class:"em-sel","aria-hidden":"true"},Vw={key:2,class:"em-note__text"},Cu=Pe(n.defineComponent({__name:"NoteNode",props:{id:{},selected:{type:Boolean},data:{}},setup(e){const t=e,o=n.inject(En,null),i=n.inject(ra,null),a=n.inject(Jn,null),r=n.computed(()=>t.data.note),l=n.computed(()=>!!o&&o.editable.value),s=n.computed(()=>at(r.value.style)),c=n.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=t.data.groupRef??null)}function u(){a==null||a.setNoteHover(t.id)}function m(){a==null||a.setNoteHover(null)}const p=n.computed(()=>{var _;return((_=a==null?void 0:a.source.value)==null?void 0:_.kind)==="note"&&a.source.value.id===t.id}),f=n.computed(()=>!!a&&a.relatedNoteIds.value.has(t.id)&&!p.value),y=n.computed(()=>{var _;return((_=o==null?void 0:o.selection.value)==null?void 0:_.kind)==="note"&&o.selection.value.id===t.id}),b=n.computed(()=>!!t.selected&&!y.value),k=n.computed(()=>!!a&&a.active.value&&!a.relatedNoteIds.value.has(t.id)&&!y.value),g=[{id:"n-top",pos:Ce.Top},{id:"n-right",pos:Ce.Right},{id:"n-bottom",pos:Ce.Bottom},{id:"n-left",pos:Ce.Left}],N=n.ref(!1),h=n.ref(""),w=n.ref(null);async function q(){var _;l.value&&(h.value=r.value.memo,N.value=!0,await n.nextTick(),(_=w.value)==null||_.focus())}function P(){N.value&&(N.value=!1,h.value!==r.value.memo&&(o==null||o.setNoteMemo(t.id,h.value)))}const{screenToFlowCoordinate:W,findNode:M}=De();let $=null,D=null;function J(_){var X;if(!l.value)return;_.stopPropagation();const K=((X=M(t.id))==null?void 0:X.dimensions)??r.value.geo.size,R=W({x:_.clientX,y:_.clientY});$={fx:R.x,fy:R.y,w:K.width,h:K.height},_.target.setPointerCapture(_.pointerId)}function B(_){if(!$)return;const K=W({x:_.clientX,y:_.clientY});D={width:Math.max(140,$.w+(K.x-$.fx)),height:Math.max(60,$.h+(K.y-$.fy))};const R=M(t.id);R&&(R.style={width:`${D.width}px`,height:`${D.height}px`})}function re(_){var K,R;$&&D&&o&&o.resizeNote(t.id,D),$=null,D=null,(R=(K=_.target).releasePointerCapture)==null||R.call(K,_.pointerId)}return(_,K)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-note",{"is-hover-origin":p.value,"is-related":f.value,"is-dimmed":k.value,"is-selected":y.value,"is-multi-selected":b.value}]),style:n.normalizeStyle(c.value),onDblclick:q,onPointerdown:d,onMouseenter:u,onMouseleave:m},[y.value?(n.openBlock(),n.createElementBlock("div",Tw,[...K[4]||(K[4]=[n.createElementVNode("span",{class:"em-sel__c em-sel__c--tl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--tr"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--bl"},null,-1),n.createElementVNode("span",{class:"em-sel__c em-sel__c--br"},null,-1)])])):n.createCommentVNode("",!0),N.value?n.withDirectives((n.openBlock(),n.createElementBlock("textarea",{key:1,ref_key:"area",ref:w,"onUpdate:modelValue":K[0]||(K[0]=R=>h.value=R),class:"em-note__edit nodrag",onBlur:P,onKeydown:K[1]||(K[1]=n.withKeys(R=>N.value=!1,["esc"])),onPointerdown:K[2]||(K[2]=n.withModifiers(()=>{},["stop"]))},null,544)),[[n.vModelText,h.value]]):(n.openBlock(),n.createElementBlock("div",Vw,n.toDisplayString(r.value.memo),1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(g,R=>n.createVNode(n.unref(yn),{id:R.id,key:R.id,type:"source",position:R.pos,class:"em-note-handle",onPointerdown:K[3]||(K[3]=n.withModifiers(()=>{},["stop"]))},null,8,["id","position"])),64)),l.value&&!N.value?(n.openBlock(),n.createElementBlock("div",{key:3,class:"em-note__resize nodrag nopan",onPointerdown:J,onPointermove:B,onPointerup:re},null,32)):n.createCommentVNode("",!0)],38))}}),[["__scopeId","data-v-77c75add"]]),Mw=20,Bw=22,Dw=7,Ow=22,Iu=31,Su=7,Pw=20,$u=11,Ru=11,Lw=Iu+Su;function zw(e){return e==="NO_INSTANCE_OR_ONE_INSTANCE"||e==="ZERO_OR_MORE_INSTANCES"}function Uw(e){return e==="ZERO_OR_MORE_INSTANCES"||e==="ONE_OR_MORE_INSTANCES"}function la(e,t,o){const i=t.x-e.x,a=t.y-e.y,r=Math.hypot(i,a)||1;return{x:e.x+i*o/r,y:e.y+a*o/r}}function Au(e,t){return Math.atan2(t.y-e.y,t.x-e.x)}function sa(e,t,o){return{x:Math.cos(o)*t+e.x,y:Math.sin(o)*t+e.y}}function Tu(e,t,o,i){const a=i/2,r=e.x===t.x&&e.y===t.y?Math.PI/2:Au(e,t);return[sa(o,a,r-Math.PI/2),sa(o,a,r+Math.PI/2)]}function Vu(e,t,o,i){const a=t*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 Mu(e,t,o,i){const a=[],r=[],l=[];if(e.x===t.x&&e.y===t.y)return{lines:a,circles:r,polygons:l};if(i==="db"){const c=la(e,t,Mw),[d,u]=Tu(e,t,c,Bw);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}),zw(o.multiplicity)){const m=la(e,t,Iu);r.push({cx:m.x,cy:m.y,r:Su})}if(Uw(o.multiplicity)){const m=la(e,t,Dw),[p,f]=Tu(e,t,m,Ow);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=la(e,t,Pw),d={x:(e.x+c.x)/2,y:(e.y+c.y)/2},u=Au(e,t),m=sa(d,$u/2,u-Math.PI/2),p=sa(d,$u/2,u+Math.PI/2);l.push({points:[e,m,c,p]}),s=c}if(o.navigable&&!o.otherNavigable){const c=Math.atan2(t.x-e.x,t.y-e.y),d=Vu(s,c,Ru,!0),u=Vu(s,c,Ru,!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 Bu=200,Du=120,jr=24;function Ou(e){var a,r;if(!e)return{x:0,y:0,width:Bu,height:Du};const t=e.computedPosition??e.position??{x:0,y:0},o=((a=e.dimensions)==null?void 0:a.width)||Bu,i=((r=e.dimensions)==null?void 0:r.height)||Du;return{x:t.x,y:t.y,width:o,height:i}}function Pu(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function Lu(e){const t=n.computed(()=>Ou(e.sourceNode())),o=n.computed(()=>Ou(e.targetNode())),i=n.computed(()=>{const d=e.sourceNode(),u=e.targetNode();return!!d&&!!u&&d.id===u.id}),a=n.computed(()=>{var f,y;const d=t.value,u=d.x+d.width;let m=((f=e.sourceRowY)==null?void 0:f.call(e))??d.y+d.height/3,p=((y=e.targetRowY)==null?void 0:y.call(e))??d.y+d.height*2/3;if(Math.abs(p-m)<jr){const b=(m+p)/2;m=b-jr/2,p=b+jr/2}return{source:{x:u,y:m},target:{x:u,y:p}}}),r=n.computed(()=>e.waypoints()[0]??Pu(o.value)),l=n.computed(()=>{const d=e.waypoints();return d[d.length-1]??Pu(t.value)}),s=n.computed(()=>{var u;const d=(u=e.sourceRowY)==null?void 0:u.call(e);return d!=null?Va(t.value,d,r.value.x):Ta(t.value,r.value)}),c=n.computed(()=>{var u;const d=(u=e.targetRowY)==null?void 0:u.call(e);return d!=null?Va(o.value,d,l.value.x):Ta(o.value,l.value)});return{source:n.computed(()=>i.value?a.value.source:s.value.point),target:n.computed(()=>i.value?a.value.target:c.value.point),sourceSide:n.computed(()=>i.value?"right":s.value.side),targetSide:n.computed(()=>i.value?"right":c.value.side),isSelf:i}}const Kr=Symbol("waypointController"),Hw=["d"],Fw=["d"],Gw=["d"],jw=["x1","y1","x2","y2"],Kw=["cx","cy","r"],Yw=["x","y"],Ww=["x","y"],qw=["cx","cy","onDblclick"],Xw=["x","y","onPointerdown","onDblclick"],zu=Pe(n.defineComponent({inheritAttrs:!1,__name:"AssociationEdge",props:{id:{},sourceY:{},targetY:{},sourceNode:{},targetNode:{},data:{}},setup(e){const t=e,{screenToFlowCoordinate:o}=De(),i=n.inject(Kr),a=n.inject(En,null),r=n.computed(()=>!!a&&a.editable.value),l=n.inject(Nu,null),s=n.inject(Jn,null),c=n.computed(()=>!!s&&s.relatedEdgeIds.value.has(t.id)),d=n.computed(()=>{var fe;return((fe=a==null?void 0:a.selection.value)==null?void 0:fe.kind)==="association"&&a.selection.value.id===t.id}),u=n.computed(()=>!!s&&s.active.value&&!s.relatedEdgeIds.value.has(t.id)&&!d.value),m=n.computed(()=>{const fe=l==null?void 0:l.value;if(!fe||!a)return null;const ge=a.resolved.value.entities,_e=H=>{var x;return(x=ge.find(T=>T.entity.modelId===H))==null?void 0:x.groupRef},j=t.data.association;return _e(j.end1.entityRef)===fe.groupId&&_e(j.end2.entityRef)===fe.groupId?{dx:fe.dx,dy:fe.dy}:null}),p=n.computed(()=>(i==null?void 0:i.points(t.id))??[]),f=n.ref(-1),y=n.ref({x:0,y:0}),b=n.computed(()=>{const fe=m.value;return p.value.map((ge,_e)=>_e===f.value?y.value:fe?{x:ge.x+fe.dx,y:ge.y+fe.dy}:ge)}),k=n.computed(()=>{var fe;return!!((fe=t.sourceNode.data)!=null&&fe.collapsed)}),g=n.computed(()=>{var fe;return!!((fe=t.targetNode.data)!=null&&fe.collapsed)}),{source:N,target:h,sourceSide:w,targetSide:q,isSelf:P}=Lu({sourceNode:()=>t.sourceNode,targetNode:()=>t.targetNode,waypoints:()=>b.value,sourceRowY:()=>t.data.sourceColumnRef&&!k.value?t.sourceY:void 0,targetRowY:()=>t.data.targetColumnRef&&!g.value?t.targetY:void 0}),W=Lw+4,M=n.computed(()=>P.value?kl(N.value,h.value):(a==null?void 0:a.routingMode.value)==="orthogonal"?$a(N.value,w.value,b.value,h.value,q.value,W):Aa(N.value,b.value,h.value)),$=n.computed(()=>P.value||!r.value?[]:(a==null?void 0:a.routingMode.value)==="orthogonal"?Ra(N.value,w.value,b.value,h.value,q.value,W):Ma(N.value,b.value,h.value).map((fe,ge)=>({point:fe,segIndex:ge}))),D=n.computed(()=>P.value||!r.value?[]:b.value);function J(fe){switch(fe){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 B(fe,ge){f.value=fe,y.value={...p.value[fe]},ge.target.setPointerCapture(ge.pointerId),ge.stopPropagation()}function re(fe){if(f.value<0)return;const ge=o({x:fe.clientX,y:fe.clientY});y.value={x:ge.x,y:ge.y}}function _(fe){var ge,_e;f.value>=0&&i&&i.movePoint(t.id,f.value,{...y.value}),f.value=-1,(_e=(ge=fe.target).releasePointerCapture)==null||_e.call(ge,fe.pointerId)}function K(fe,ge){ge.stopPropagation(),i==null||i.removePoint(t.id,fe)}function R(fe,ge){if(!i)return;const _e=o({x:ge.clientX,y:ge.clientY});i.insertPoint(t.id,fe,{x:_e.x,y:_e.y})}const X=n.computed(()=>J(t.data.association.end1.multiplicity)),ee=n.computed(()=>J(t.data.association.end2.multiplicity)),oe=n.computed(()=>(a==null?void 0:a.displayMode.value)==="CLASS"?"class":"db"),U=n.computed(()=>oe.value==="class"),G=n.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const fe=no(w.value);return{x:N.value.x+fe.x*10,y:N.value.y+fe.y*10}}return b.value[0]??h.value}),ne=n.computed(()=>{if((a==null?void 0:a.routingMode.value)==="orthogonal"){const ge=no(q.value);return{x:h.value.x+ge.x*10,y:h.value.y+ge.y*10}}const fe=b.value;return fe[fe.length-1]??N.value}),ce=n.computed(()=>{const fe=t.data.association;return{multiplicity:fe.end1.multiplicity,navigable:fe.end1.navigable,composition:fe.end1.composition,otherNavigable:fe.end2.navigable}}),pe=n.computed(()=>{const fe=t.data.association;return{multiplicity:fe.end2.multiplicity,navigable:fe.end2.navigable,composition:fe.end2.composition,otherNavigable:fe.end1.navigable}}),se=n.computed(()=>Mu(N.value,G.value,ce.value,oe.value)),me=n.computed(()=>Mu(h.value,ne.value,pe.value,oe.value)),he=n.computed(()=>[...se.value.lines,...me.value.lines]),Ee=n.computed(()=>[...se.value.circles,...me.value.circles]),Se=n.computed(()=>[...se.value.polygons,...me.value.polygons].map(fe=>`M${fe.points.map(ge=>`${ge.x},${ge.y}`).join(" L")} Z`)),Ie=n.computed(()=>({"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}));return(fe,ge)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",{d:M.value,fill:"none",class:"em-edge__hit"},null,8,Hw),n.createElementVNode("path",{d:M.value,fill:"none","stroke-width":"1.5",class:n.normalizeClass(["em-edge__path",{"is-highlighted":c.value,"is-dimmed":u.value,"is-selected":d.value}])},null,10,Fw),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Se.value,(_e,j)=>(n.openBlock(),n.createElementBlock("path",{key:`mpoly-${j}`,d:_e,class:n.normalizeClass(["em-edge__marker em-edge__marker--fill",Ie.value])},null,10,Gw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(he.value,(_e,j)=>(n.openBlock(),n.createElementBlock("line",{key:`mline-${j}`,x1:_e.x1,y1:_e.y1,x2:_e.x2,y2:_e.y2,class:n.normalizeClass(["em-edge__marker",Ie.value])},null,10,jw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(Ee.value,(_e,j)=>(n.openBlock(),n.createElementBlock("circle",{key:`mcirc-${j}`,cx:_e.cx,cy:_e.cy,r:_e.r,class:n.normalizeClass(["em-edge__marker",Ie.value])},null,10,Kw))),128)),U.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("text",{x:n.unref(N).x+8,y:n.unref(N).y-6,class:n.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},n.toDisplayString(X.value),11,Yw),n.createElementVNode("text",{x:n.unref(h).x-8,y:n.unref(h).y-6,"text-anchor":"end",class:n.normalizeClass(["em-edge__mult",{"is-dimmed":u.value}])},n.toDisplayString(ee.value),11,Ww)],64)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList($.value,(_e,j)=>(n.openBlock(),n.createElementBlock("circle",{key:`mid-${j}`,cx:_e.point.x,cy:_e.point.y,r:"4",class:n.normalizeClass(["em-edge__mid",{"is-dimmed":u.value}]),onDblclick:n.withModifiers(H=>R(_e.segIndex,H),["stop"])},null,42,qw))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(D.value,(_e,j)=>(n.openBlock(),n.createElementBlock("rect",{key:`wp-${j}`,x:_e.x-5,y:_e.y-5,width:"10",height:"10",rx:"2",class:n.normalizeClass(["em-edge__waypoint",{"is-dimmed":u.value}]),onPointerdown:H=>B(j,H),onPointermove:re,onPointerup:_,onDblclick:H=>K(j,H)},null,42,Xw))),128))],64))}}),[["__scopeId","data-v-208ecd02"]]);var zt=(e=>(e.Lines="lines",e.Dots="dots",e))(zt||{});const Uu=function({dimensions:e,size:t,color:o}){return n.h("path",{stroke:o,"stroke-width":t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})},Hu=function({radius:e,color:t}){return n.h("circle",{cx:e,cy:e,r:e,fill:t})};zt.Lines+"",zt.Dots+"";const Jw={[zt.Dots]:"#81818a",[zt.Lines]:"#eee"},Zw=["id","x","y","width","height","patternTransform"],Qw={key:2,height:"100",width:"100"},eN=["fill"],tN=["x","y","fill"],nN={name:"Background",compatConfig:{MODE:3}},oN=n.defineComponent({...nN,props:{id:{},variant:{default:()=>zt.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:t,viewport:o}=De(),i=n.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=n.toRef(()=>`pattern-${t}${e.id?`-${e.id}`:""}`),r=n.toRef(()=>e.color||e.patternColor||Jw[e.variant||zt.Dots]);return(l,s)=>(n.openBlock(),n.createElementBlock("svg",{class:"vue-flow__background vue-flow__container",style:n.normalizeStyle({height:`${l.height>100?100:l.height}%`,width:`${l.width>100?100:l.width}%`})},[n.renderSlot(l.$slots,"pattern-container",{id:a.value},()=>[n.createElementVNode("pattern",{id:a.value,x:n.unref(o).x%i.value.scaledGap[0],y:n.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"},[n.renderSlot(l.$slots,"pattern",{},()=>[l.variant===n.unref(zt).Lines?(n.openBlock(),n.createBlock(n.unref(Uu),{key:0,size:l.lineWidth,color:r.value,dimensions:i.value.scaledGap},null,8,["size","color","dimensions"])):l.variant===n.unref(zt).Dots?(n.openBlock(),n.createBlock(n.unref(Hu),{key:1,color:r.value,radius:i.value.size/2},null,8,["color","radius"])):n.createCommentVNode("",!0),l.bgColor?(n.openBlock(),n.createElementBlock("svg",Qw,[n.createElementVNode("rect",{width:"100%",height:"100%",fill:l.bgColor},null,8,eN)])):n.createCommentVNode("",!0)])],8,Zw)]),n.createElementVNode("rect",{x:l.x,y:l.y,width:"100%",height:"100%",fill:`url(#${a.value})`},null,8,tN),n.renderSlot(l.$slots,"default",{id:a.value})],4))}}),iN={name:"ControlButton",compatConfig:{MODE:3}},aN=(e,t)=>{const o=e.__vccOpts||e;for(const[i,a]of t)o[i]=a;return o},rN={type:"button",class:"vue-flow__controls-button"};function lN(e,t,o,i,a,r){return n.openBlock(),n.createElementBlock("button",rN,[n.renderSlot(e.$slots,"default")])}const wn=aN(iN,[["render",lN]]),sN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32"},cN=[n.createElementVNode("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"},null,-1)];function dN(e,t){return n.openBlock(),n.createElementBlock("svg",sN,cN)}const uN={render:dN},mN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5"},fN=[n.createElementVNode("path",{d:"M0 0h32v4.2H0z"},null,-1)];function pN(e,t){return n.openBlock(),n.createElementBlock("svg",mN,fN)}const hN={render:pN},yN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30"},gN=[n.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 bN(e,t){return n.openBlock(),n.createElementBlock("svg",yN,gN)}const _N={render:bN},kN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},EN=[n.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 wN(e,t){return n.openBlock(),n.createElementBlock("svg",kN,EN)}const NN={render:wN},vN={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32"},xN=[n.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 CN(e,t){return n.openBlock(),n.createElementBlock("svg",vN,xN)}const IN={render:CN},SN={name:"Controls",compatConfig:{MODE:3}},$N=n.defineComponent({...SN,props:{showZoom:{type:Boolean,default:!0},showFitView:{type:Boolean,default:!0},showInteractive:{type:Boolean,default:!0},fitViewParams:{},position:{default:()=>dd.BottomLeft}},emits:["zoomIn","zoomOut","fitView","interactionChange"],setup(e,{emit:t}){const{nodesDraggable:o,nodesConnectable:i,elementsSelectable:a,setInteractive:r,zoomIn:l,zoomOut:s,fitView:c,viewport:d,minZoom:u,maxZoom:m}=De(),p=n.toRef(()=>o.value||i.value||a.value),f=n.toRef(()=>d.value.zoom<=u.value),y=n.toRef(()=>d.value.zoom>=m.value);function b(){l(),t("zoomIn")}function k(){s(),t("zoomOut")}function g(){c(e.fitViewParams),t("fitView")}function N(){r(!p.value),t("interactionChange",!p.value)}return(h,w)=>(n.openBlock(),n.createBlock(n.unref(su),{class:"vue-flow__controls",position:h.position},{default:n.withCtx(()=>[n.renderSlot(h.$slots,"top"),h.showZoom?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.renderSlot(h.$slots,"control-zoom-in",{},()=>[n.createVNode(wn,{class:"vue-flow__controls-zoomin",disabled:y.value,onClick:b},{default:n.withCtx(()=>[n.renderSlot(h.$slots,"icon-zoom-in",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(uN))))])]),_:3},8,["disabled"])]),n.renderSlot(h.$slots,"control-zoom-out",{},()=>[n.createVNode(wn,{class:"vue-flow__controls-zoomout",disabled:f.value,onClick:k},{default:n.withCtx(()=>[n.renderSlot(h.$slots,"icon-zoom-out",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(hN))))])]),_:3},8,["disabled"])])],64)):n.createCommentVNode("",!0),h.showFitView?n.renderSlot(h.$slots,"control-fit-view",{key:1},()=>[n.createVNode(wn,{class:"vue-flow__controls-fitview",onClick:g},{default:n.withCtx(()=>[n.renderSlot(h.$slots,"icon-fit-view",{},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(_N))))])]),_:3})]):n.createCommentVNode("",!0),h.showInteractive?n.renderSlot(h.$slots,"control-interactive",{key:2},()=>[h.showInteractive?(n.openBlock(),n.createBlock(wn,{key:0,class:"vue-flow__controls-interactive",onClick:N},{default:n.withCtx(()=>[p.value?n.renderSlot(h.$slots,"icon-unlock",{key:0},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(IN))))]):n.createCommentVNode("",!0),p.value?n.createCommentVNode("",!0):n.renderSlot(h.$slots,"icon-lock",{key:1},()=>[(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(NN))))])]),_:3})):n.createCommentVNode("",!0)]):n.createCommentVNode("",!0),n.renderSlot(h.$slots,"default")]),_:3},8,["position"]))}});var RN={value:()=>{}};function Yr(){for(var e=0,t=arguments.length,o={},i;e<t;++e){if(!(i=arguments[e]+"")||i in o||/[\s.]/.test(i))throw new Error("illegal type: "+i);o[i]=[]}return new ca(o)}function ca(e){this._=e}function AN(e,t){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&&!t.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:i}})}ca.prototype=Yr.prototype={constructor:ca,on:function(e,t){var o=this._,i=AN(e+"",o),a,r=-1,l=i.length;if(arguments.length<2){for(;++r<l;)if((a=(e=i[r]).type)&&(a=TN(o[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++r<l;)if(a=(e=i[r]).type)o[a]=Fu(o[a],e.name,t);else if(t==null)for(a in o)o[a]=Fu(o[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var o in t)e[o]=t[o].slice();return new ca(e)},call:function(e,t){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(t,o)},apply:function(e,t,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(t,o)}};function TN(e,t){for(var o=0,i=e.length,a;o<i;++o)if((a=e[o]).name===t)return a.value}function Fu(e,t,o){for(var i=0,a=e.length;i<a;++i)if(e[i].name===t){e[i]=RN,e=e.slice(0,i).concat(e.slice(i+1));break}return o!=null&&e.push({name:t,value:o}),e}var Wr="http://www.w3.org/1999/xhtml";const Gu={svg:"http://www.w3.org/2000/svg",xhtml:Wr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function da(e){var t=e+="",o=t.indexOf(":");return o>=0&&(t=e.slice(0,o))!=="xmlns"&&(e=e.slice(o+1)),Gu.hasOwnProperty(t)?{space:Gu[t],local:e}:e}function VN(e){return function(){var t=this.ownerDocument,o=this.namespaceURI;return o===Wr&&t.documentElement.namespaceURI===Wr?t.createElement(e):t.createElementNS(o,e)}}function MN(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ju(e){var t=da(e);return(t.local?MN:VN)(t)}function BN(){}function qr(e){return e==null?BN:function(){return this.querySelector(e)}}function DN(e){typeof e!="function"&&(e=qr(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 pt(i,this._parents)}function ON(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function PN(){return[]}function Ku(e){return e==null?PN:function(){return this.querySelectorAll(e)}}function LN(e){return function(){return ON(e.apply(this,arguments))}}function zN(e){typeof e=="function"?e=LN(e):e=Ku(e);for(var t=this._groups,o=t.length,i=[],a=[],r=0;r<o;++r)for(var l=t[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 pt(i,a)}function Yu(e){return function(){return this.matches(e)}}function Wu(e){return function(t){return t.matches(e)}}var UN=Array.prototype.find;function HN(e){return function(){return UN.call(this.children,e)}}function FN(){return this.firstElementChild}function GN(e){return this.select(e==null?FN:HN(typeof e=="function"?e:Wu(e)))}var jN=Array.prototype.filter;function KN(){return Array.from(this.children)}function YN(e){return function(){return jN.call(this.children,e)}}function WN(e){return this.selectAll(e==null?KN:YN(typeof e=="function"?e:Wu(e)))}function qN(e){typeof e!="function"&&(e=Yu(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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 pt(i,this._parents)}function qu(e){return new Array(e.length)}function XN(){return new pt(this._enter||this._groups.map(qu),this._parents)}function ua(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ua.prototype={constructor:ua,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function JN(e){return function(){return e}}function ZN(e,t,o,i,a,r){for(var l=0,s,c=t.length,d=r.length;l<d;++l)(s=t[l])?(s.__data__=r[l],i[l]=s):o[l]=new ua(e,r[l]);for(;l<c;++l)(s=t[l])&&(a[l]=s)}function QN(e,t,o,i,a,r,l){var s,c,d=new Map,u=t.length,m=r.length,p=new Array(u),f;for(s=0;s<u;++s)(c=t[s])&&(p[s]=f=l.call(c,c.__data__,s,t)+"",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 ua(e,r[s]);for(s=0;s<u;++s)(c=t[s])&&d.get(p[s])===c&&(a[s]=c)}function ev(e){return e.__data__}function tv(e,t){if(!arguments.length)return Array.from(this,ev);var o=t?QN:ZN,i=this._parents,a=this._groups;typeof e!="function"&&(e=JN(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=nv(e.call(u,u&&u.__data__,d,i)),y=f.length,b=s[d]=new Array(y),k=l[d]=new Array(y),g=c[d]=new Array(p);o(u,m,b,k,g,f,t);for(var N=0,h=0,w,q;N<y;++N)if(w=b[N]){for(N>=h&&(h=N+1);!(q=k[h])&&++h<y;);w._next=q||null}}return l=new pt(l,i),l._enter=s,l._exit=c,l}function nv(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ov(){return new pt(this._exit||this._groups.map(qu),this._parents)}function iv(e,t,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+""),t!=null&&(a=t(a),a&&(a=a.selection())),o==null?r.remove():o(r),i&&a?i.merge(a).order():a}function av(e){for(var t=e.selection?e.selection():e,o=this._groups,i=t._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,y=0;y<m;++y)(f=d[y]||u[y])&&(p[y]=f);for(;c<a;++c)s[c]=o[c];return new pt(s,this._parents)}function rv(){for(var e=this._groups,t=-1,o=e.length;++t<o;)for(var i=e[t],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 lv(e){e||(e=sv);function t(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(t)}return new pt(a,this._parents).order()}function sv(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function cv(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function dv(){return Array.from(this)}function uv(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,r=i.length;a<r;++a){var l=i[a];if(l)return l}return null}function mv(){let e=0;for(const t of this)++e;return e}function fv(){return!this.node()}function pv(e){for(var t=this._groups,o=0,i=t.length;o<i;++o)for(var a=t[o],r=0,l=a.length,s;r<l;++r)(s=a[r])&&e.call(s,s.__data__,r,a);return this}function hv(e){return function(){this.removeAttribute(e)}}function yv(e){return function(){this.removeAttributeNS(e.space,e.local)}}function gv(e,t){return function(){this.setAttribute(e,t)}}function bv(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function _v(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttribute(e):this.setAttribute(e,o)}}function kv(e,t){return function(){var o=t.apply(this,arguments);o==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,o)}}function Ev(e,t){var o=da(e);if(arguments.length<2){var i=this.node();return o.local?i.getAttributeNS(o.space,o.local):i.getAttribute(o)}return this.each((t==null?o.local?yv:hv:typeof t=="function"?o.local?kv:_v:o.local?bv:gv)(o,t))}function Xu(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function wv(e){return function(){this.style.removeProperty(e)}}function Nv(e,t,o){return function(){this.style.setProperty(e,t,o)}}function vv(e,t,o){return function(){var i=t.apply(this,arguments);i==null?this.style.removeProperty(e):this.style.setProperty(e,i,o)}}function xv(e,t,o){return arguments.length>1?this.each((t==null?wv:typeof t=="function"?vv:Nv)(e,t,o??"")):Zn(this.node(),e)}function Zn(e,t){return e.style.getPropertyValue(t)||Xu(e).getComputedStyle(e,null).getPropertyValue(t)}function Cv(e){return function(){delete this[e]}}function Iv(e,t){return function(){this[e]=t}}function Sv(e,t){return function(){var o=t.apply(this,arguments);o==null?delete this[e]:this[e]=o}}function $v(e,t){return arguments.length>1?this.each((t==null?Cv:typeof t=="function"?Sv:Iv)(e,t)):this.node()[e]}function Ju(e){return e.trim().split(/^|\s+/)}function Xr(e){return e.classList||new Zu(e)}function Zu(e){this._node=e,this._names=Ju(e.getAttribute("class")||"")}Zu.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Qu(e,t){for(var o=Xr(e),i=-1,a=t.length;++i<a;)o.add(t[i])}function em(e,t){for(var o=Xr(e),i=-1,a=t.length;++i<a;)o.remove(t[i])}function Rv(e){return function(){Qu(this,e)}}function Av(e){return function(){em(this,e)}}function Tv(e,t){return function(){(t.apply(this,arguments)?Qu:em)(this,e)}}function Vv(e,t){var o=Ju(e+"");if(arguments.length<2){for(var i=Xr(this.node()),a=-1,r=o.length;++a<r;)if(!i.contains(o[a]))return!1;return!0}return this.each((typeof t=="function"?Tv:t?Rv:Av)(o,t))}function Mv(){this.textContent=""}function Bv(e){return function(){this.textContent=e}}function Dv(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function Ov(e){return arguments.length?this.each(e==null?Mv:(typeof e=="function"?Dv:Bv)(e)):this.node().textContent}function Pv(){this.innerHTML=""}function Lv(e){return function(){this.innerHTML=e}}function zv(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Uv(e){return arguments.length?this.each(e==null?Pv:(typeof e=="function"?zv:Lv)(e)):this.node().innerHTML}function Hv(){this.nextSibling&&this.parentNode.appendChild(this)}function Fv(){return this.each(Hv)}function Gv(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function jv(){return this.each(Gv)}function Kv(e){var t=typeof e=="function"?e:ju(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function Yv(){return null}function Wv(e,t){var o=typeof e=="function"?e:ju(e),i=t==null?Yv:typeof t=="function"?t:qr(t);return this.select(function(){return this.insertBefore(o.apply(this,arguments),i.apply(this,arguments)||null)})}function qv(){var e=this.parentNode;e&&e.removeChild(this)}function Xv(){return this.each(qv)}function Jv(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Zv(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Qv(e){return this.select(e?Zv:Jv)}function ex(e){return arguments.length?this.property("__data__",e):this.node().__data__}function tx(e){return function(t){e.call(this,t,this.__data__)}}function nx(e){return e.trim().split(/^|\s+/).map(function(t){var o="",i=t.indexOf(".");return i>=0&&(o=t.slice(i+1),t=t.slice(0,i)),{type:t,name:o}})}function ox(e){return function(){var t=this.__on;if(t){for(var o=0,i=-1,a=t.length,r;o<a;++o)r=t[o],(!e.type||r.type===e.type)&&r.name===e.name?this.removeEventListener(r.type,r.listener,r.options):t[++i]=r;++i?t.length=i:delete this.__on}}}function ix(e,t,o){return function(){var i=this.__on,a,r=tx(t);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=t;return}}this.addEventListener(e.type,r,o),a={type:e.type,name:e.name,value:t,listener:r,options:o},i?i.push(a):this.__on=[a]}}function ax(e,t,o){var i=nx(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=t?ix:ox,a=0;a<r;++a)this.each(s(i[a],t,o));return this}function tm(e,t,o){var i=Xu(e),a=i.CustomEvent;typeof a=="function"?a=new a(t,o):(a=i.document.createEvent("Event"),o?(a.initEvent(t,o.bubbles,o.cancelable),a.detail=o.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function rx(e,t){return function(){return tm(this,e,t)}}function lx(e,t){return function(){return tm(this,e,t.apply(this,arguments))}}function sx(e,t){return this.each((typeof t=="function"?lx:rx)(e,t))}function*cx(){for(var e=this._groups,t=0,o=e.length;t<o;++t)for(var i=e[t],a=0,r=i.length,l;a<r;++a)(l=i[a])&&(yield l)}var nm=[null];function pt(e,t){this._groups=e,this._parents=t}function Do(){return new pt([[document.documentElement]],nm)}function dx(){return this}pt.prototype=Do.prototype={constructor:pt,select:DN,selectAll:zN,selectChild:GN,selectChildren:WN,filter:qN,data:tv,enter:XN,exit:ov,join:iv,merge:av,selection:dx,order:rv,sort:lv,call:cv,nodes:dv,node:uv,size:mv,empty:fv,each:pv,attr:Ev,style:xv,property:$v,classed:Vv,text:Ov,html:Uv,raise:Fv,lower:jv,append:Kv,insert:Wv,remove:Xv,clone:Qv,datum:ex,on:ax,dispatch:sx,[Symbol.iterator]:cx};function Jt(e){return typeof e=="string"?new pt([[document.querySelector(e)]],[document.documentElement]):new pt([[e]],nm)}function ux(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Zt(e,t){if(e=ux(e),t===void 0&&(t=e.currentTarget),t){var o=t.ownerSVGElement||t;if(o.createSVGPoint){var i=o.createSVGPoint();return i.x=e.clientX,i.y=e.clientY,i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const Jr={capture:!0,passive:!1};function Zr(e){e.preventDefault(),e.stopImmediatePropagation()}function mx(e){var t=e.document.documentElement,o=Jt(e).on("dragstart.drag",Zr,Jr);"onselectstart"in t?o.on("selectstart.drag",Zr,Jr):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function fx(e,t){var o=e.document.documentElement,i=Jt(e).on("dragstart.drag",null);t&&(i.on("click.drag",Zr,Jr),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 Qr(e,t,o){e.prototype=t.prototype=o,o.constructor=e}function om(e,t){var o=Object.create(e.prototype);for(var i in t)o[i]=t[i];return o}function Oo(){}var Po=.7,ma=1/Po,Qn="\\s*([+-]?\\d+)\\s*",Lo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",At="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",px=/^#([0-9a-f]{3,8})$/,hx=new RegExp(`^rgb\\(${Qn},${Qn},${Qn}\\)$`),yx=new RegExp(`^rgb\\(${At},${At},${At}\\)$`),gx=new RegExp(`^rgba\\(${Qn},${Qn},${Qn},${Lo}\\)$`),bx=new RegExp(`^rgba\\(${At},${At},${At},${Lo}\\)$`),_x=new RegExp(`^hsl\\(${Lo},${At},${At}\\)$`),kx=new RegExp(`^hsla\\(${Lo},${At},${At},${Lo}\\)$`),im={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};Qr(Oo,zo,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:am,formatHex:am,formatHex8:Ex,formatHsl:wx,formatRgb:rm,toString:rm});function am(){return this.rgb().formatHex()}function Ex(){return this.rgb().formatHex8()}function wx(){return um(this).formatHsl()}function rm(){return this.rgb().formatRgb()}function zo(e){var t,o;return e=(e+"").trim().toLowerCase(),(t=px.exec(e))?(o=t[1].length,t=parseInt(t[1],16),o===6?lm(t):o===3?new dt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):o===8?fa(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):o===4?fa(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=hx.exec(e))?new dt(t[1],t[2],t[3],1):(t=yx.exec(e))?new dt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gx.exec(e))?fa(t[1],t[2],t[3],t[4]):(t=bx.exec(e))?fa(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_x.exec(e))?dm(t[1],t[2]/100,t[3]/100,1):(t=kx.exec(e))?dm(t[1],t[2]/100,t[3]/100,t[4]):im.hasOwnProperty(e)?lm(im[e]):e==="transparent"?new dt(NaN,NaN,NaN,0):null}function lm(e){return new dt(e>>16&255,e>>8&255,e&255,1)}function fa(e,t,o,i){return i<=0&&(e=t=o=NaN),new dt(e,t,o,i)}function Nx(e){return e instanceof Oo||(e=zo(e)),e?(e=e.rgb(),new dt(e.r,e.g,e.b,e.opacity)):new dt}function el(e,t,o,i){return arguments.length===1?Nx(e):new dt(e,t,o,i??1)}function dt(e,t,o,i){this.r=+e,this.g=+t,this.b=+o,this.opacity=+i}Qr(dt,el,om(Oo,{brighter(e){return e=e==null?ma:Math.pow(ma,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Po:Math.pow(Po,e),new dt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new dt(Nn(this.r),Nn(this.g),Nn(this.b),pa(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:sm,formatHex:sm,formatHex8:vx,formatRgb:cm,toString:cm}));function sm(){return`#${vn(this.r)}${vn(this.g)}${vn(this.b)}`}function vx(){return`#${vn(this.r)}${vn(this.g)}${vn(this.b)}${vn((isNaN(this.opacity)?1:this.opacity)*255)}`}function cm(){const e=pa(this.opacity);return`${e===1?"rgb(":"rgba("}${Nn(this.r)}, ${Nn(this.g)}, ${Nn(this.b)}${e===1?")":`, ${e})`}`}function pa(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Nn(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function vn(e){return e=Nn(e),(e<16?"0":"")+e.toString(16)}function dm(e,t,o,i){return i<=0?e=t=o=NaN:o<=0||o>=1?e=t=NaN:t<=0&&(e=NaN),new kt(e,t,o,i)}function um(e){if(e instanceof kt)return new kt(e.h,e.s,e.l,e.opacity);if(e instanceof Oo||(e=zo(e)),!e)return new kt;if(e instanceof kt)return e;e=e.rgb();var t=e.r/255,o=e.g/255,i=e.b/255,a=Math.min(t,o,i),r=Math.max(t,o,i),l=NaN,s=r-a,c=(r+a)/2;return s?(t===r?l=(o-i)/s+(o<i)*6:o===r?l=(i-t)/s+2:l=(t-o)/s+4,s/=c<.5?r+a:2-r-a,l*=60):s=c>0&&c<1?0:l,new kt(l,s,c,e.opacity)}function xx(e,t,o,i){return arguments.length===1?um(e):new kt(e,t,o,i??1)}function kt(e,t,o,i){this.h=+e,this.s=+t,this.l=+o,this.opacity=+i}Qr(kt,xx,om(Oo,{brighter(e){return e=e==null?ma:Math.pow(ma,e),new kt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Po:Math.pow(Po,e),new kt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,o=this.l,i=o+(o<.5?o:1-o)*t,a=2*o-i;return new dt(tl(e>=240?e-240:e+120,a,i),tl(e,a,i),tl(e<120?e+240:e-120,a,i),this.opacity)},clamp(){return new kt(mm(this.h),ha(this.s),ha(this.l),pa(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=pa(this.opacity);return`${e===1?"hsl(":"hsla("}${mm(this.h)}, ${ha(this.s)*100}%, ${ha(this.l)*100}%${e===1?")":`, ${e})`}`}}));function mm(e){return e=(e||0)%360,e<0?e+360:e}function ha(e){return Math.max(0,Math.min(1,e||0))}function tl(e,t,o){return(e<60?t+(o-t)*e/60:e<180?o:e<240?t+(o-t)*(240-e)/60:t)*255}const fm=e=>()=>e;function Cx(e,t){return function(o){return e+o*t}}function Ix(e,t,o){return e=Math.pow(e,o),t=Math.pow(t,o)-e,o=1/o,function(i){return Math.pow(e+i*t,o)}}function Sx(e){return(e=+e)==1?pm:function(t,o){return o-t?Ix(t,o,e):fm(isNaN(t)?o:t)}}function pm(e,t){var o=t-e;return o?Cx(e,o):fm(isNaN(e)?t:e)}const hm=(function e(t){var o=Sx(t);function i(a,r){var l=o((a=el(a)).r,(r=el(r)).r),s=o(a.g,r.g),c=o(a.b,r.b),d=pm(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 Qt(e,t){return e=+e,t=+t,function(o){return e*(1-o)+t*o}}var nl=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ol=new RegExp(nl.source,"g");function $x(e){return function(){return e}}function Rx(e){return function(t){return e(t)+""}}function Ax(e,t){var o=nl.lastIndex=ol.lastIndex=0,i,a,r,l=-1,s=[],c=[];for(e=e+"",t=t+"";(i=nl.exec(e))&&(a=ol.exec(t));)(r=a.index)>o&&(r=t.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:Qt(i,a)})),o=ol.lastIndex;return o<t.length&&(r=t.slice(o),s[l]?s[l]+=r:s[++l]=r),s.length<2?c[0]?Rx(c[0].x):$x(t):(t=c.length,function(d){for(var u=0,m;u<t;++u)s[(m=c[u]).i]=m.x(d);return s.join("")})}var ym=180/Math.PI,il={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function gm(e,t,o,i,a,r){var l,s,c;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(c=e*o+t*i)&&(o-=e*c,i-=t*c),(s=Math.sqrt(o*o+i*i))&&(o/=s,i/=s,c/=s),e*i<t*o&&(e=-e,t=-t,c=-c,l=-l),{translateX:a,translateY:r,rotate:Math.atan2(t,e)*ym,skewX:Math.atan(c)*ym,scaleX:l,scaleY:s}}var ya;function Tx(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?il:gm(t.a,t.b,t.c,t.d,t.e,t.f)}function Vx(e){return e==null||(ya||(ya=document.createElementNS("http://www.w3.org/2000/svg","g")),ya.setAttribute("transform",e),!(e=ya.transform.baseVal.consolidate()))?il:(e=e.matrix,gm(e.a,e.b,e.c,e.d,e.e,e.f))}function bm(e,t,o,i){function a(d){return d.length?d.pop()+" ":""}function r(d,u,m,p,f,y){if(d!==m||u!==p){var b=f.push("translate(",null,t,null,o);y.push({i:b-4,x:Qt(d,m)},{i:b-2,x:Qt(u,p)})}else(m||p)&&f.push("translate("+m+t+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:Qt(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:Qt(d,u)}):u&&m.push(a(m)+"skewX("+u+i)}function c(d,u,m,p,f,y){if(d!==m||u!==p){var b=f.push(a(f)+"scale(",null,",",null,")");y.push({i:b-4,x:Qt(d,m)},{i:b-2,x:Qt(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 y=-1,b=p.length,k;++y<b;)m[(k=p[y]).i]=k.x(f);return m.join("")}}}var Mx=bm(Tx,"px, ","px)","deg)"),Bx=bm(Vx,", ",")",")"),Dx=1e-12;function _m(e){return((e=Math.exp(e))+1/e)/2}function Ox(e){return((e=Math.exp(e))-1/e)/2}function Px(e){return((e=Math.exp(2*e))-1)/(e+1)}const Lx=(function e(t,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,y=m-c,b=f*f+y*y,k,g;if(b<Dx)g=Math.log(p/d)/t,k=function(W){return[s+W*f,c+W*y,d*Math.exp(t*W*g)]};else{var N=Math.sqrt(b),h=(p*p-d*d+i*b)/(2*d*o*N),w=(p*p-d*d-i*b)/(2*p*o*N),q=Math.log(Math.sqrt(h*h+1)-h),P=Math.log(Math.sqrt(w*w+1)-w);g=(P-q)/t,k=function(W){var M=W*g,$=_m(q),D=d/(o*N)*($*Px(t*M+q)-Ox(q));return[s+D*f,c+D*y,d*$/_m(t*M+q)]}}return k.duration=g*1e3*t/Math.SQRT2,k}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 eo=0,Uo=0,Ho=0,km=1e3,ga,Fo,ba=0,xn=0,_a=0,Go=typeof performance=="object"&&performance.now?performance:Date,Em=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function al(){return xn||(Em(zx),xn=Go.now()+_a)}function zx(){xn=0}function ka(){this._call=this._time=this._next=null}ka.prototype=wm.prototype={constructor:ka,restart:function(e,t,o){if(typeof e!="function")throw new TypeError("callback is not a function");o=(o==null?al():+o)+(t==null?0:+t),!this._next&&Fo!==this&&(Fo?Fo._next=this:ga=this,Fo=this),this._call=e,this._time=o,rl()},stop:function(){this._call&&(this._call=null,this._time=1/0,rl())}};function wm(e,t,o){var i=new ka;return i.restart(e,t,o),i}function Ux(){al(),++eo;for(var e=ga,t;e;)(t=xn-e._time)>=0&&e._call.call(void 0,t),e=e._next;--eo}function Nm(){xn=(ba=Go.now())+_a,eo=Uo=0;try{Ux()}finally{eo=0,Fx(),xn=0}}function Hx(){var e=Go.now(),t=e-ba;t>km&&(_a-=t,ba=e)}function Fx(){for(var e,t=ga,o,i=1/0;t;)t._call?(i>t._time&&(i=t._time),e=t,t=t._next):(o=t._next,t._next=null,t=e?e._next=o:ga=o);Fo=e,rl(i)}function rl(e){if(!eo){Uo&&(Uo=clearTimeout(Uo));var t=e-xn;t>24?(e<1/0&&(Uo=setTimeout(Nm,e-Go.now()-_a)),Ho&&(Ho=clearInterval(Ho))):(Ho||(ba=Go.now(),Ho=setInterval(Hx,km)),eo=1,Em(Nm))}}function vm(e,t,o){var i=new ka;return t=t==null?0:+t,i.restart(a=>{i.stop(),e(a+t)},t,o),i}var Gx=Yr("start","end","cancel","interrupt"),jx=[],xm=0,Cm=1,ll=2,Ea=3,Im=4,sl=5,wa=6;function Na(e,t,o,i,a,r){var l=e.__transition;if(!l)e.__transition={};else if(o in l)return;Kx(e,o,{name:t,index:i,group:a,on:Gx,tween:jx,time:r.time,delay:r.delay,duration:r.duration,ease:r.ease,timer:null,state:xm})}function cl(e,t){var o=Et(e,t);if(o.state>xm)throw new Error("too late; already scheduled");return o}function Tt(e,t){var o=Et(e,t);if(o.state>Ea)throw new Error("too late; already running");return o}function Et(e,t){var o=e.__transition;if(!o||!(o=o[t]))throw new Error("transition not found");return o}function Kx(e,t,o){var i=e.__transition,a;i[t]=o,o.timer=wm(r,0,o.time);function r(d){o.state=Cm,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!==Cm)return c();for(u in i)if(f=i[u],f.name===o.name){if(f.state===Ea)return vm(l);f.state===Im?(f.state=wa,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete i[u]):+u<t&&(f.state=wa,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete i[u])}if(vm(function(){o.state===Ea&&(o.state=Im,o.timer.restart(s,o.delay,o.time),s(d))}),o.state=ll,o.on.call("start",e,e.__data__,o.index,o.group),o.state===ll){for(o.state=Ea,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=sl,1),m=-1,p=a.length;++m<p;)a[m].call(e,u);o.state===sl&&(o.on.call("end",e,e.__data__,o.index,o.group),c())}function c(){o.state=wa,o.timer.stop(),delete i[t];for(var d in i)return;delete e.__transition}}function va(e,t){var o=e.__transition,i,a,r=!0,l;if(o){t=t==null?null:t+"";for(l in o){if((i=o[l]).name!==t){r=!1;continue}a=i.state>ll&&i.state<sl,i.state=wa,i.timer.stop(),i.on.call(a?"interrupt":"cancel",e,e.__data__,i.index,i.group),delete o[l]}r&&delete e.__transition}}function Yx(e){return this.each(function(){va(this,e)})}function Wx(e,t){var o,i;return function(){var a=Tt(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===t){i=i.slice(),i.splice(l,1);break}}a.tween=i}}function qx(e,t,o){var i,a;if(typeof o!="function")throw new Error;return function(){var r=Tt(this,e),l=r.tween;if(l!==i){a=(i=l).slice();for(var s={name:t,value:o},c=0,d=a.length;c<d;++c)if(a[c].name===t){a[c]=s;break}c===d&&a.push(s)}r.tween=a}}function Xx(e,t){var o=this._id;if(e+="",arguments.length<2){for(var i=Et(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((t==null?Wx:qx)(o,e,t))}function dl(e,t,o){var i=e._id;return e.each(function(){var a=Tt(this,i);(a.value||(a.value={}))[t]=o.apply(this,arguments)}),function(a){return Et(a,i).value[t]}}function Sm(e,t){var o;return(typeof t=="number"?Qt:t instanceof zo?hm:(o=zo(t))?(t=o,hm):Ax)(e,t)}function Jx(e){return function(){this.removeAttribute(e)}}function Zx(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qx(e,t,o){var i,a=o+"",r;return function(){var l=this.getAttribute(e);return l===a?null:l===i?r:r=t(i=l,o)}}function eC(e,t,o){var i,a=o+"",r;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===i?r:r=t(i=l,o)}}function tC(e,t,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=t(i=l,s)))}}function nC(e,t,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=t(i=l,s)))}}function oC(e,t){var o=da(e),i=o==="transform"?Bx:Sm;return this.attrTween(e,typeof t=="function"?(o.local?nC:tC)(o,i,dl(this,"attr."+e,t)):t==null?(o.local?Zx:Jx)(o):(o.local?eC:Qx)(o,i,t))}function iC(e,t){return function(o){this.setAttribute(e,t.call(this,o))}}function aC(e,t){return function(o){this.setAttributeNS(e.space,e.local,t.call(this,o))}}function rC(e,t){var o,i;function a(){var r=t.apply(this,arguments);return r!==i&&(o=(i=r)&&aC(e,r)),o}return a._value=t,a}function lC(e,t){var o,i;function a(){var r=t.apply(this,arguments);return r!==i&&(o=(i=r)&&iC(e,r)),o}return a._value=t,a}function sC(e,t){var o="attr."+e;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;var i=da(e);return this.tween(o,(i.local?rC:lC)(i,t))}function cC(e,t){return function(){cl(this,e).delay=+t.apply(this,arguments)}}function dC(e,t){return t=+t,function(){cl(this,e).delay=t}}function uC(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?cC:dC)(t,e)):Et(this.node(),t).delay}function mC(e,t){return function(){Tt(this,e).duration=+t.apply(this,arguments)}}function fC(e,t){return t=+t,function(){Tt(this,e).duration=t}}function pC(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?mC:fC)(t,e)):Et(this.node(),t).duration}function hC(e,t){if(typeof t!="function")throw new Error;return function(){Tt(this,e).ease=t}}function yC(e){var t=this._id;return arguments.length?this.each(hC(t,e)):Et(this.node(),t).ease}function gC(e,t){return function(){var o=t.apply(this,arguments);if(typeof o!="function")throw new Error;Tt(this,e).ease=o}}function bC(e){if(typeof e!="function")throw new Error;return this.each(gC(this._id,e))}function _C(e){typeof e!="function"&&(e=Yu(e));for(var t=this._groups,o=t.length,i=new Array(o),a=0;a<o;++a)for(var r=t[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,this._name,this._id)}function kC(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,o=e._groups,i=t.length,a=o.length,r=Math.min(i,a),l=new Array(i),s=0;s<r;++s)for(var c=t[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]=t[s];return new Ut(l,this._parents,this._name,this._id)}function EC(e){return(e+"").trim().split(/^|\s+/).every(function(t){var o=t.indexOf(".");return o>=0&&(t=t.slice(0,o)),!t||t==="start"})}function wC(e,t,o){var i,a,r=EC(t)?cl:Tt;return function(){var l=r(this,e),s=l.on;s!==i&&(a=(i=s).copy()).on(t,o),l.on=a}}function NC(e,t){var o=this._id;return arguments.length<2?Et(this.node(),o).on.on(e):this.each(wC(o,e,t))}function vC(e){return function(){var t=this.parentNode;for(var o in this.__transition)if(+o!==e)return;t&&t.removeChild(this)}}function xC(){return this.on("end.remove",vC(this._id))}function CC(e){var t=this._name,o=this._id;typeof e!="function"&&(e=qr(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,Na(d[p],t,o,p,d,Et(u,o)));return new Ut(r,this._parents,t,o)}function IC(e){var t=this._name,o=this._id;typeof e!="function"&&(e=Ku(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,y=Et(u,o),b=0,k=p.length;b<k;++b)(f=p[b])&&Na(f,t,o,b,p,y);r.push(p),l.push(u)}return new Ut(r,l,t,o)}var SC=Do.prototype.constructor;function $C(){return new SC(this._groups,this._parents)}function RC(e,t){var o,i,a;return function(){var r=Zn(this,e),l=(this.style.removeProperty(e),Zn(this,e));return r===l?null:r===o&&l===i?a:a=t(o=r,i=l)}}function $m(e){return function(){this.style.removeProperty(e)}}function AC(e,t,o){var i,a=o+"",r;return function(){var l=Zn(this,e);return l===a?null:l===i?r:r=t(i=l,o)}}function TC(e,t,o){var i,a,r;return function(){var l=Zn(this,e),s=o(this),c=s+"";return s==null&&(c=s=(this.style.removeProperty(e),Zn(this,e))),l===c?null:l===i&&c===a?r:(a=c,r=t(i=l,s))}}function VC(e,t){var o,i,a,r="style."+t,l="end."+r,s;return function(){var c=Tt(this,e),d=c.on,u=c.value[r]==null?s||(s=$m(t)):void 0;(d!==o||a!==u)&&(i=(o=d).copy()).on(l,a=u),c.on=i}}function MC(e,t,o){var i=(e+="")=="transform"?Mx:Sm;return t==null?this.styleTween(e,RC(e,i)).on("end.style."+e,$m(e)):typeof t=="function"?this.styleTween(e,TC(e,i,dl(this,"style."+e,t))).each(VC(this._id,e)):this.styleTween(e,AC(e,i,t),o).on("end.style."+e,null)}function BC(e,t,o){return function(i){this.style.setProperty(e,t.call(this,i),o)}}function DC(e,t,o){var i,a;function r(){var l=t.apply(this,arguments);return l!==a&&(i=(a=l)&&BC(e,l,o)),i}return r._value=t,r}function OC(e,t,o){var i="style."+(e+="");if(arguments.length<2)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,DC(e,t,o??""))}function PC(e){return function(){this.textContent=e}}function LC(e){return function(){var t=e(this);this.textContent=t??""}}function zC(e){return this.tween("text",typeof e=="function"?LC(dl(this,"text",e)):PC(e==null?"":e+""))}function UC(e){return function(t){this.textContent=e.call(this,t)}}function HC(e){var t,o;function i(){var a=e.apply(this,arguments);return a!==o&&(t=(o=a)&&UC(a)),t}return i._value=e,i}function FC(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,HC(e))}function GC(){for(var e=this._name,t=this._id,o=Rm(),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=Et(c,t);Na(c,e,o,d,l,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Ut(i,this._parents,e,o)}function jC(){var e,t,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=Tt(this,i),u=d.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),d.on=t}),a===0&&r()})}var KC=0;function Ut(e,t,o,i){this._groups=e,this._parents=t,this._name=o,this._id=i}function Rm(){return++KC}var Ht=Do.prototype;Ut.prototype={constructor:Ut,select:CC,selectAll:IC,selectChild:Ht.selectChild,selectChildren:Ht.selectChildren,filter:_C,merge:kC,selection:$C,transition:GC,call:Ht.call,nodes:Ht.nodes,node:Ht.node,size:Ht.size,empty:Ht.empty,each:Ht.each,on:NC,attr:oC,attrTween:sC,style:MC,styleTween:OC,text:zC,textTween:FC,remove:xC,tween:Xx,delay:uC,duration:pC,ease:yC,easeVarying:bC,end:jC,[Symbol.iterator]:Ht[Symbol.iterator]};function YC(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var WC={time:null,delay:0,duration:250,ease:YC};function qC(e,t){for(var o;!(o=e.__transition)||!(o=o[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return o}function XC(e){var t,o;e instanceof Ut?(t=e._id,e=e._name):(t=Rm(),(o=WC).time=al(),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])&&Na(c,e,t,d,l,o||qC(c,t));return new Ut(i,this._parents,e,t)}Do.prototype.interrupt=Yx,Do.prototype.transition=XC;const xa=e=>()=>e;function JC(e,{sourceEvent:t,target:o,transform:i,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:a}})}function Ft(e,t,o){this.k=e,this.x=t,this.y=o}Ft.prototype={constructor:Ft,scale:function(e){return e===1?this:new Ft(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ft(this.k,this.x+this.k*e,this.y+this.k*t)},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 ul=new Ft(1,0,0);Ft.prototype;function ml(e){e.stopImmediatePropagation()}function jo(e){e.preventDefault(),e.stopImmediatePropagation()}function ZC(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function QC(){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 Am(){return this.__zoom||ul}function eI(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function tI(){return navigator.maxTouchPoints||"ontouchstart"in this}function nI(e,t,o){var i=e.invertX(t[0][0])-o[0][0],a=e.invertX(t[1][0])-o[1][0],r=e.invertY(t[0][1])-o[0][1],l=e.invertY(t[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 oI(){var e=ZC,t=QC,o=nI,i=eI,a=tI,r=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],s=250,c=Lx,d=Yr("start","zoom","end"),u,m,p,f=500,y=150,b=0,k=10;function g(_){_.property("__zoom",Am).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",D).filter(a).on("touchstart.zoom",J).on("touchmove.zoom",B).on("touchend.zoom touchcancel.zoom",re).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(_,K,R,X){var ee=_.selection?_.selection():_;ee.property("__zoom",Am),_!==ee?q(_,K,R,X):ee.interrupt().each(function(){P(this,arguments).event(X).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},g.scaleBy=function(_,K,R,X){g.scaleTo(_,function(){var ee=this.__zoom.k,oe=typeof K=="function"?K.apply(this,arguments):K;return ee*oe},R,X)},g.scaleTo=function(_,K,R,X){g.transform(_,function(){var ee=t.apply(this,arguments),oe=this.__zoom,U=R==null?w(ee):typeof R=="function"?R.apply(this,arguments):R,G=oe.invert(U),ne=typeof K=="function"?K.apply(this,arguments):K;return o(h(N(oe,ne),U,G),ee,l)},R,X)},g.translateBy=function(_,K,R,X){g.transform(_,function(){return o(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof R=="function"?R.apply(this,arguments):R),t.apply(this,arguments),l)},null,X)},g.translateTo=function(_,K,R,X,ee){g.transform(_,function(){var oe=t.apply(this,arguments),U=this.__zoom,G=X==null?w(oe):typeof X=="function"?X.apply(this,arguments):X;return o(ul.translate(G[0],G[1]).scale(U.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof R=="function"?-R.apply(this,arguments):-R),oe,l)},X,ee)};function N(_,K){return K=Math.max(r[0],Math.min(r[1],K)),K===_.k?_:new Ft(K,_.x,_.y)}function h(_,K,R){var X=K[0]-R[0]*_.k,ee=K[1]-R[1]*_.k;return X===_.x&&ee===_.y?_:new Ft(_.k,X,ee)}function w(_){return[(+_[0][0]+ +_[1][0])/2,(+_[0][1]+ +_[1][1])/2]}function q(_,K,R,X){_.on("start.zoom",function(){P(this,arguments).event(X).start()}).on("interrupt.zoom end.zoom",function(){P(this,arguments).event(X).end()}).tween("zoom",function(){var ee=this,oe=arguments,U=P(ee,oe).event(X),G=t.apply(ee,oe),ne=R==null?w(G):typeof R=="function"?R.apply(ee,oe):R,ce=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),pe=ee.__zoom,se=typeof K=="function"?K.apply(ee,oe):K,me=c(pe.invert(ne).concat(ce/pe.k),se.invert(ne).concat(ce/se.k));return function(he){if(he===1)he=se;else{var Ee=me(he),Se=ce/Ee[2];he=new Ft(Se,ne[0]-Ee[0]*Se,ne[1]-Ee[1]*Se)}U.zoom(null,he)}})}function P(_,K,R){return!R&&_.__zooming||new W(_,K)}function W(_,K){this.that=_,this.args=K,this.active=0,this.sourceEvent=null,this.extent=t.apply(_,K),this.taps=0}W.prototype={event:function(_){return _&&(this.sourceEvent=_),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(_,K){return this.mouse&&_!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&_!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&_!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(_){var K=Jt(this.that).datum();d.call(_,this.that,new JC(_,{sourceEvent:this.sourceEvent,target:g,transform:this.that.__zoom,dispatch:d}),K)}};function M(_,...K){if(!e.apply(this,arguments))return;var R=P(this,K).event(_),X=this.__zoom,ee=Math.max(r[0],Math.min(r[1],X.k*Math.pow(2,i.apply(this,arguments)))),oe=Zt(_);if(R.wheel)(R.mouse[0][0]!==oe[0]||R.mouse[0][1]!==oe[1])&&(R.mouse[1]=X.invert(R.mouse[0]=oe)),clearTimeout(R.wheel);else{if(X.k===ee)return;R.mouse=[oe,X.invert(oe)],va(this),R.start()}jo(_),R.wheel=setTimeout(U,y),R.zoom("mouse",o(h(N(X,ee),R.mouse[0],R.mouse[1]),R.extent,l));function U(){R.wheel=null,R.end()}}function $(_,...K){if(p||!e.apply(this,arguments))return;var R=_.currentTarget,X=P(this,K,!0).event(_),ee=Jt(_.view).on("mousemove.zoom",ne,!0).on("mouseup.zoom",ce,!0),oe=Zt(_,R),U=_.clientX,G=_.clientY;mx(_.view),ml(_),X.mouse=[oe,this.__zoom.invert(oe)],va(this),X.start();function ne(pe){if(jo(pe),!X.moved){var se=pe.clientX-U,me=pe.clientY-G;X.moved=se*se+me*me>b}X.event(pe).zoom("mouse",o(h(X.that.__zoom,X.mouse[0]=Zt(pe,R),X.mouse[1]),X.extent,l))}function ce(pe){ee.on("mousemove.zoom mouseup.zoom",null),fx(pe.view,X.moved),jo(pe),X.event(pe).end()}}function D(_,...K){if(e.apply(this,arguments)){var R=this.__zoom,X=Zt(_.changedTouches?_.changedTouches[0]:_,this),ee=R.invert(X),oe=R.k*(_.shiftKey?.5:2),U=o(h(N(R,oe),X,ee),t.apply(this,K),l);jo(_),s>0?Jt(this).transition().duration(s).call(q,U,X,_):Jt(this).call(g.transform,U,X,_)}}function J(_,...K){if(e.apply(this,arguments)){var R=_.touches,X=R.length,ee=P(this,K,_.changedTouches.length===X).event(_),oe,U,G,ne;for(ml(_),U=0;U<X;++U)G=R[U],ne=Zt(G,this),ne=[ne,this.__zoom.invert(ne),G.identifier],ee.touch0?!ee.touch1&&ee.touch0[2]!==ne[2]&&(ee.touch1=ne,ee.taps=0):(ee.touch0=ne,oe=!0,ee.taps=1+!!u);u&&(u=clearTimeout(u)),oe&&(ee.taps<2&&(m=ne[0],u=setTimeout(function(){u=null},f)),va(this),ee.start())}}function B(_,...K){if(this.__zooming){var R=P(this,K).event(_),X=_.changedTouches,ee=X.length,oe,U,G,ne;for(jo(_),oe=0;oe<ee;++oe)U=X[oe],G=Zt(U,this),R.touch0&&R.touch0[2]===U.identifier?R.touch0[0]=G:R.touch1&&R.touch1[2]===U.identifier&&(R.touch1[0]=G);if(U=R.that.__zoom,R.touch1){var ce=R.touch0[0],pe=R.touch0[1],se=R.touch1[0],me=R.touch1[1],he=(he=se[0]-ce[0])*he+(he=se[1]-ce[1])*he,Ee=(Ee=me[0]-pe[0])*Ee+(Ee=me[1]-pe[1])*Ee;U=N(U,Math.sqrt(he/Ee)),G=[(ce[0]+se[0])/2,(ce[1]+se[1])/2],ne=[(pe[0]+me[0])/2,(pe[1]+me[1])/2]}else if(R.touch0)G=R.touch0[0],ne=R.touch0[1];else return;R.zoom("touch",o(h(U,G,ne),R.extent,l))}}function re(_,...K){if(this.__zooming){var R=P(this,K).event(_),X=_.changedTouches,ee=X.length,oe,U;for(ml(_),p&&clearTimeout(p),p=setTimeout(function(){p=null},f),oe=0;oe<ee;++oe)U=X[oe],R.touch0&&R.touch0[2]===U.identifier?delete R.touch0:R.touch1&&R.touch1[2]===U.identifier&&delete R.touch1;if(R.touch1&&!R.touch0&&(R.touch0=R.touch1,delete R.touch1),R.touch0)R.touch0[1]=this.__zoom.invert(R.touch0[0]);else if(R.end(),R.taps===2&&(U=Zt(U,this),Math.hypot(m[0]-U[0],m[1]-U[1])<k)){var G=Jt(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return g.wheelDelta=function(_){return arguments.length?(i=typeof _=="function"?_:xa(+_),g):i},g.filter=function(_){return arguments.length?(e=typeof _=="function"?_:xa(!!_),g):e},g.touchable=function(_){return arguments.length?(a=typeof _=="function"?_:xa(!!_),g):a},g.extent=function(_){return arguments.length?(t=typeof _=="function"?_:xa([[+_[0][0],+_[0][1]],[+_[1][0],+_[1][1]]]),g):t},g.scaleExtent=function(_){return arguments.length?(r[0]=+_[0],r[1]=+_[1],g):[r[0],r[1]]},g.translateExtent=function(_){return arguments.length?(l[0][0]=+_[0][0],l[1][0]=+_[1][0],l[0][1]=+_[0][1],l[1][1]=+_[1][1],g):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},g.constrain=function(_){return arguments.length?(o=_,g):o},g.duration=function(_){return arguments.length?(s=+_,g):s},g.interpolate=function(_){return arguments.length?(c=_,g):c},g.on=function(){var _=d.on.apply(d,arguments);return _===d?g:_},g.clickDistance=function(_){return arguments.length?(b=(_=+_)*_,g):Math.sqrt(b)},g.tapDistance=function(_){return arguments.length?(k=+_,g):k},g}const Tm=Symbol("MiniMapSlots"),iI=["id","x","y","rx","ry","width","height","fill","stroke","stroke-width","shape-rendering"],aI={name:"MiniMapNode",compatConfig:{MODE:3},inheritAttrs:!1},rI=n.defineComponent({...aI,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:t}){const o=e,i=n.inject(Tm),a=n.useAttrs(),r=n.toRef(()=>a.style??{});function l(m){t("click",m)}function s(m){t("dblclick",m)}function c(m){t("mouseenter",m)}function d(m){t("mousemove",m)}function u(m){t("mouseleave",m)}return(m,p)=>!m.hidden&&m.dimensions.width!==0&&m.dimensions.height!==0?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.unref(i)[`node-${o.type}`]?(n.openBlock(),n.createBlock(n.resolveDynamicComponent(n.unref(i)[`node-${o.type}`]),n.normalizeProps(n.mergeProps({key:0},{...o,...m.$attrs})),null,16)):(n.openBlock(),n.createElementBlock("rect",n.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,iI))],64)):n.createCommentVNode("",!0)}}),lI=["width","height","viewBox","aria-labelledby"],sI=["id"],cI=["d","fill","stroke","stroke-width"],dI={name:"MiniMap",compatConfig:{MODE:3}},uI=n.defineComponent({...dI,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:t}){const o=n.useSlots(),i=n.useAttrs(),a=200,r=150,{id:l,edges:s,viewport:c,translateExtent:d,dimensions:u,emits:m,d3Selection:p,d3Zoom:f,getNodesInitialized:y}=De(),b=n.ref();n.provide(Tm,o);const k=n.toRef(()=>{var ee;return e.width??((ee=i.style)==null?void 0:ee.width)??a}),g=n.toRef(()=>{var ee;return e.height??((ee=i.style)==null?void 0:ee.height)??r}),N=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision",h=n.computed(()=>typeof e.nodeColor=="string"?()=>e.nodeColor:e.nodeColor),w=n.computed(()=>typeof e.nodeStrokeColor=="string"?()=>e.nodeStrokeColor:e.nodeStrokeColor),q=n.computed(()=>typeof e.nodeClassName=="string"?()=>e.nodeClassName:typeof e.nodeClassName=="function"?e.nodeClassName:()=>""),P=n.computed(()=>Cr(y.value.filter(ee=>!ee.hidden))),W=n.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})),M=n.computed(()=>y.value&&y.value.length?N_(P.value,W.value):W.value),$=n.computed(()=>{const ee=M.value.width/k.value,oe=M.value.height/g.value;return Math.max(ee,oe)}),D=n.computed(()=>{const ee=$.value*k.value,oe=$.value*g.value,U=e.offsetScale*$.value;return{offset:U,x:M.value.x-(ee-M.value.width)/2-U,y:M.value.y-(oe-M.value.height)/2-U,width:ee+U*2,height:oe+U*2}}),J=n.computed(()=>!D.value.x||!D.value.y?"":`
|
|
39
|
+
M${D.value.x-D.value.offset},${D.value.y-D.value.offset}
|
|
40
|
+
h${D.value.width+D.value.offset*2}
|
|
41
|
+
v${D.value.height+D.value.offset*2}
|
|
42
|
+
h${-D.value.width-D.value.offset*2}z
|
|
43
|
+
M${W.value.x+e.maskBorderRadius},${W.value.y}
|
|
44
|
+
h${W.value.width-2*e.maskBorderRadius}
|
|
45
45
|
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},${e.maskBorderRadius}
|
|
46
|
-
v${
|
|
46
|
+
v${W.value.height-2*e.maskBorderRadius}
|
|
47
47
|
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},${e.maskBorderRadius}
|
|
48
|
-
h${-(
|
|
48
|
+
h${-(W.value.width-2*e.maskBorderRadius)}
|
|
49
49
|
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 -${e.maskBorderRadius},-${e.maskBorderRadius}
|
|
50
|
-
v${-(
|
|
51
|
-
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);n.watchEffect(ee=>{if(b.value){const ae=Xt(b.value),I=pe=>{if(pe.sourceEvent.type!=="wheel"||!p.value||!f.value)return;const fe=pe.sourceEvent.ctrlKey&&Vo()?10:1,ce=-pe.sourceEvent.deltaY*(pe.sourceEvent.deltaMode===1?.05:pe.sourceEvent.deltaMode?1:.002)*e.zoomStep,ue=c.value.zoom*2**(ce*fe);f.value.scaleTo(p.value,ue)},K=pe=>{if(pe.sourceEvent.type!=="mousemove"||!p.value||!f.value)return;const fe=$.value*Math.max(1,c.value.zoom)*(e.inversePan?-1:1),ce={x:c.value.x-pe.sourceEvent.movementX*fe,y:c.value.y-pe.sourceEvent.movementY*fe},ue=[[0,0],[u.value.width,u.value.height]],he=ml.translate(ce.x,ce.y).scale(c.value.zoom),we=f.value.constrain()(he,ue,d.value);f.value.transform(p.value,we)},oe=oI().wheelDelta(pe=>Ir(pe)*(e.zoomStep/10)).on("zoom",e.pannable?K:()=>{}).on("zoom.wheel",e.zoomable?I:()=>{});ae.call(oe),ee(()=>{ae.on("zoom",null)})}},{flush:"post"});function V(ee){const[ae,I]=Jt(ee);t("click",{event:ee,position:{x:ae,y:I}})}function re(ee,ae){const I={event:ee,node:ae,connectedEdges:hn([ae],s.value)};m.miniMapNodeClick(I),t("nodeClick",I)}function _(ee,ae){const I={event:ee,node:ae,connectedEdges:hn([ae],s.value)};m.miniMapNodeDoubleClick(I),t("nodeDblclick",I)}function W(ee,ae){const I={event:ee,node:ae,connectedEdges:hn([ae],s.value)};m.miniMapNodeMouseEnter(I),t("nodeMouseenter",I)}function R(ee,ae){const I={event:ee,node:ae,connectedEdges:hn([ae],s.value)};m.miniMapNodeMouseMove(I),t("nodeMousemove",I)}function J(ee,ae){const I={event:ee,node:ae,connectedEdges:hn([ae],s.value)};m.miniMapNodeMouseLeave(I),t("nodeMouseleave",I)}return(ee,ae)=>(n.openBlock(),n.createBlock(n.unref(cu),{position:ee.position,class:n.normalizeClass(["vue-flow__minimap",{pannable:ee.pannable,zoomable:ee.zoomable}])},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{ref_key:"el",ref:b,width:k.value,height:g.value,viewBox:[B.value.x,B.value.y,B.value.width,B.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${n.unref(l)}`,onClick:V},[ee.ariaLabel?(n.openBlock(),n.createElementBlock("title",{key:0,id:`vue-flow__minimap-${n.unref(l)}`},n.toDisplayString(ee.ariaLabel),9,sI)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(y),I=>(n.openBlock(),n.createBlock(rI,{id:I.id,key:I.id,f:"",position:I.computedPosition,dimensions:I.dimensions,selected:I.selected,dragging:I.dragging,style:n.normalizeStyle(I.style),class:n.normalizeClass(X.value(I)),color:h.value(I),"border-radius":ee.nodeBorderRadius,"stroke-color":E.value(I),"stroke-width":ee.nodeStrokeWidth,"shape-rendering":n.unref(w),type:I.type,hidden:I.hidden,onClick:K=>re(K,I),onDblclick:K=>_(K,I),onMouseenter:K=>W(K,I),onMousemove:K=>R(K,I),onMouseleave:K=>J(K,I)},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)),n.createElementVNode("path",{class:"vue-flow__minimap-mask",d:Q.value,fill:ee.maskColor,stroke:ee.maskStrokeColor,"stroke-width":ee.maskStrokeWidth,"fill-rule":"evenodd"},null,8,cI)],8,lI))]),_:1},8,["position","class"]))}}),mI=["d"],fI=["cx","cy","onDblclick"],pI=["x","y","onPointerdown","onDblclick"],hI=Pe(n.defineComponent({inheritAttrs:!1,__name:"NoteConnectionEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const t=e,{screenToFlowCoordinate:o}=Oe(),i=n.inject(Yr),a=n.inject(kn,null),r=n.computed(()=>!!a&&a.editable.value),l=n.inject(Xn,null),s=n.computed(()=>!!l&&l.active.value&&(!l.relatedEntityIds.value.has(t.data.targetRef)||!l.relatedNoteIds.value.has(t.data.noteRef))),c=n.computed(()=>(i==null?void 0:i.points(t.id))??[]),d=n.ref(-1),u=n.ref({x:0,y:0}),m=n.computed(()=>c.value.map((D,$)=>$===d.value?u.value:D)),{source:p,target:f,sourceSide:y,targetSide:b}=zu({sourceNode:()=>t.sourceNode,targetNode:()=>t.targetNode,waypoints:()=>m.value}),k=n.computed(()=>(a==null?void 0:a.routingMode.value)==="orthogonal"?$a(p.value,y.value,m.value,f.value,b.value):Aa(p.value,m.value,f.value)),g=n.computed(()=>r.value?(a==null?void 0:a.routingMode.value)==="orthogonal"?Ra(p.value,y.value,m.value,f.value,b.value):Ma(p.value,m.value,f.value).map((D,$)=>({point:D,segIndex:$})):[]),w=n.computed(()=>r.value?m.value:[]);function h(D,$){d.value=D,u.value={...c.value[D]},$.target.setPointerCapture($.pointerId),$.stopPropagation()}function E(D){if(d.value<0)return;const $=o({x:D.clientX,y:D.clientY});u.value={x:$.x,y:$.y}}function X(D){var $,B;d.value>=0&&i&&i.movePoint(t.id,d.value,{...u.value}),d.value=-1,(B=($=D.target).releasePointerCapture)==null||B.call($,D.pointerId)}function z(D,$){$.stopPropagation(),i==null||i.removePoint(t.id,D)}function q(D,$){if(!i)return;const B=o({x:$.clientX,y:$.clientY});i.insertPoint(t.id,D,{x:B.x,y:B.y})}return(D,$)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",{d:k.value,fill:"none","stroke-width":"1.5","stroke-dasharray":"6 4",class:n.normalizeClass(["em-note-edge__path",{"is-dimmed":s.value}])},null,10,mI),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(B,Q)=>(n.openBlock(),n.createElementBlock("circle",{key:`mid-${Q}`,cx:B.point.x,cy:B.point.y,r:"4",class:n.normalizeClass(["em-note-edge__mid",{"is-dimmed":s.value}]),onDblclick:n.withModifiers(V=>q(B.segIndex,V),["stop"])},null,42,fI))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.value,(B,Q)=>(n.openBlock(),n.createElementBlock("rect",{key:`wp-${Q}`,x:B.x-5,y:B.y-5,width:"10",height:"10",rx:"2",class:n.normalizeClass(["em-note-edge__waypoint",{"is-dimmed":s.value}]),onPointerdown:V=>h(Q,V),onPointermove:E,onPointerup:X,onDblclick:V=>z(Q,V)},null,42,pI))),128))],64))}}),[["__scopeId","data-v-8515def1"]]),yI=["data-theme"],gI={key:0,class:"em-ctx__sep",role:"separator"},bI={key:1,class:"em-ctx__swatches"},_I={class:"em-ctx__swatches-label"},kI={class:"em-ctx__chips"},EI=["title","onClick"],wI=["title","onClick"],NI=["disabled","onClick"],vI={class:"em-ctx__icon"},xI={class:"em-ctx__caption"},CI=Pe(n.defineComponent({__name:"EmContextMenu",props:{locale:{}},setup(e,{expose:t}){const o=e,i=(b,k)=>St(o.locale??"ko",b,k),a=n.ref(!1),r=n.ref([]),l=n.ref(void 0),s=n.ref(null),c=n.reactive({x:0,y:0}),d=8;async function u(b,k){var h;r.value=k,l.value=(h=b.target)!=null&&h.closest('[data-theme="dark"]')?"dark":void 0,c.x=b.clientX,c.y=b.clientY,a.value=!0,window.addEventListener("keydown",p),window.addEventListener("resize",m),await n.nextTick();const g=s.value;if(!g)return;const w=g.getBoundingClientRect();c.x+w.width>window.innerWidth-d&&(c.x=Math.max(d,window.innerWidth-d-w.width)),c.y+w.height>window.innerHeight-d&&(c.y=Math.max(d,window.innerHeight-d-w.height))}function m(){a.value&&(a.value=!1,r.value=[],window.removeEventListener("keydown",p),window.removeEventListener("resize",m))}function p(b){b.key==="Escape"&&(b.stopPropagation(),m())}function f(b){b.disabled||(b.handler(),m())}function y(b,k){b.onPick(k),m()}return n.onBeforeUnmount(m),t({open:u,close:m}),(b,k)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[a.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-ctx-layer","data-theme":l.value},[n.createElementVNode("div",{class:"em-ctx__scrim",onPointerdown:m,onContextmenu:n.withModifiers(m,["prevent"])},null,32),n.createElementVNode("div",{ref_key:"menuEl",ref:s,class:"em-ctx",style:n.normalizeStyle({left:c.x+"px",top:c.y+"px"}),role:"menu",onContextmenu:k[0]||(k[0]=n.withModifiers(()=>{},["prevent"]))},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,(g,w)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:w},[g.type==="separator"?(n.openBlock(),n.createElementBlock("div",gI)):g.type==="swatches"?(n.openBlock(),n.createElementBlock("div",bI,[n.createElementVNode("span",_I,n.toDisplayString(g.caption),1),n.createElementVNode("div",kI,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-ctx__chip em-ctx__chip--none",{"is-on":g.current===null}]),title:i("em.swatch.none"),onClick:h=>y(g,null)},null,10,EI),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),h=>(n.openBlock(),n.createElementBlock("button",{key:h,type:"button",class:n.normalizeClass(["em-ctx__chip",{"is-on":g.current===h}]),style:n.normalizeStyle({background:n.unref(Yn)(h)}),title:n.unref(Kn)(h),onClick:E=>y(g,h)},null,14,wI))),128))])])):(n.openBlock(),n.createElementBlock("button",{key:2,type:"button",class:n.normalizeClass(["em-ctx__item",{"is-danger":g.danger,"is-disabled":g.disabled}]),disabled:g.disabled,role:"menuitem",onClick:h=>f(g)},[n.createElementVNode("span",vI,[g.icon?(n.openBlock(),n.createBlock($e,{key:0,name:g.icon,size:15},null,8,["name"])):n.createCommentVNode("",!0)]),n.createElementVNode("span",xI,n.toDisplayString(g.caption),1)],10,NI))],64))),128))],36)],8,yI)):n.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-0b8cdb1f"]]),pl=[".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 eo(e){const t=getComputedStyle(e);return!(t.display==="none"||t.visibility==="hidden"||parseFloat(t.opacity)===0)}function II(e){return e.childElementCount>0?!1:(e.textContent??"").trim().length>0}function SI(e,t){const o=getComputedStyle(e),i={fill:o.color,fontSize:parseFloat(o.fontSize),fontFamily:o.fontFamily,fontWeight:o.fontWeight,fontStyle:o.fontStyle},a=document.createRange();a.selectNodeContents(e);const r=e.firstChild,l=a.getClientRects();if(!r||r.nodeType!==3||l.length<=1){const y=l.length?a.getBoundingClientRect():e.getBoundingClientRect();if(y.width===0&&y.height===0)return[];const b=t(y.left,y.top+y.height/2);return[{...i,x:b.x,y:b.y,text:(e.textContent??"").trim()}]}const s=r.textContent??"",c=[];let d="",u=null,m=0,p=0;const f=()=>{const y=d.trim();if(y){const b=t(m,(u+p)/2);c.push({...i,x:b.x,y:b.y,text:y})}d=""};for(let y=0;y<s.length;y++){a.setStart(r,y),a.setEnd(r,y+1);const b=a.getBoundingClientRect();u===null||Math.abs(b.top-u)>1?(f(),u=b.top,m=b.left,p=b.bottom,d=s[y]):(d+=s[y],p=Math.max(p,b.bottom))}return f(),c}function Ca(e,t){const o=[];for(const i of e.querySelectorAll("*"))II(i)&&(i.closest(pl)||eo(i)&&o.push(...SI(i,t)));return o}function jo(e){return Math.round(e*100)/100}function $I(e,t){const o=[];for(const i of e.querySelectorAll("svg.em-icon")){if(i.closest(pl)||!eo(i))continue;const a=i.getBoundingClientRect();if(a.width===0||a.height===0)continue;const r=t(a.left,a.top),l=t(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="${jo(r.x)}" y="${jo(r.y)}" width="${jo(l.x-r.x)}" height="${jo(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 RI(e){const t=[];for(const o of e.querySelectorAll(".em-edge__marker")){if(!eo(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=>jo(parseFloat(o.getAttribute(d)??"0"));s==="line"?t.push(`<line x1="${c("x1")}" y1="${c("y1")}" x2="${c("x2")}" y2="${c("y2")}" stroke="${a}" stroke-width="${r}" stroke-linecap="round" />`):s==="circle"?t.push(`<circle cx="${c("cx")}" cy="${c("cy")}" r="${c("r")}" fill="none" stroke="${a}" stroke-width="${r}" />`):s==="path"&&t.push(`<path d="${o.getAttribute("d")}" fill="${l}" stroke="${a}" stroke-width="${r}" stroke-linejoin="round" />`)}return t}function Mm(e,t,o){const i=[];for(const a of e.querySelectorAll("*")){if(a===t||a.closest(pl)||!eo(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 Ko(e,t){const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=t(o.left,o.top),r=t(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 hl(e,t){e.minX=Math.min(e.minX,t.x),e.minY=Math.min(e.minY,t.y),e.maxX=Math.max(e.maxX,t.x+t.w),e.maxY=Math.max(e.maxY,t.y+t.h)}function AI(e){const t=e.vueFlowRef.value;if(!t)throw new Error("캔버스가 렌더되지 않아 SVG로 내보낼 수 없습니다.");const o=(f,y)=>e.screenToFlowCoordinate({x:f,y}),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 y=t.querySelector(`.vue-flow__node[data-id="${CSS.escape(f.id)}"]`);if(!y||!eo(y))continue;const b=y.firstElementChild;if(b)if(f.type==="group"){const k=Ko(b,o);hl(s,k),i.push({...k,texts:[]});const g=b.querySelector(".em-group__label");g&&i.push({...Ko(g,o),stroke:"none",texts:[]}),i.push({...k,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:Ca(b,o)})}else if(f.type==="note"){const k={...Ko(b,o),texts:Ca(b,o),lines:Mm(b,b,o)};hl(s,k),r.push(k)}else{const k=Ko(b,o);hl(s,k);const g=k.radius??{tl:0,tr:0};a.push({...k,stroke:"none",texts:[]});const w=b.querySelector(".em-entity__header");if(w){const h=Ko(w,o);a.push({x:k.x,y:k.y,w:k.w,h:h.y+h.h-k.y,fill:h.fill,stroke:"none",radius:{tl:g.tl,tr:g.tr,br:0,bl:0},texts:[]})}a.push({...k,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:Ca(b,o),lines:Mm(b,b,o),icons:$I(b,o)}),a.push({...k,fill:"none",texts:[]})}}for(const f of t.querySelectorAll(".vue-flow__edge")){const y=f.querySelector("path.em-edge__path, path.em-note-edge__path");if(!y||!eo(y))continue;const b=y.getAttribute("d");if(!b)continue;const k=getComputedStyle(y),g=k.strokeDasharray,w=RI(f);l.push({d:b,stroke:k.stroke,strokeWidth:parseFloat(k.strokeWidth)||1.5,strokeDasharray:g&&g!=="none"?g:void 0,labels:Ca(f,o),markers:w.length?w:void 0})}const c=t.closest(".em-canvas")??t,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 yl(e){return Tl(AI(e))}function Bm(e,t){const o=URL.createObjectURL(e);try{const i=document.createElement("a");i.href=o,i.download=t,document.body.appendChild(i),i.click(),i.remove()}finally{URL.revokeObjectURL(o)}}function Dm(e,t="diagram.svg"){const o=yl(e);Bm(new Blob([o],{type:"image/svg+xml;charset=utf-8"}),t)}function TI(e){var i,a;const t=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:t>0?t:1,h:o>0?o:1}}async function Om(e,t="diagram.png",o=2){const i=yl(e),{w:a,h:r}=TI(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 변환 실패");Bm(u,t)}finally{URL.revokeObjectURL(l)}}const VI={class:"em-shortcuts"},MI={class:"em-shortcuts__title"},BI={class:"em-shortcuts__keys"},DI={class:"em-shortcuts__kbd"},OI={key:0,class:"em-shortcuts__plus"},PI={class:"em-shortcuts__desc"},LI={class:"em-shortcuts__actions"},Pm=Pe(n.defineComponent({__name:"ShortcutHelpModal",props:{locale:{}},setup(e){const t=e,o=ie.useModalHandle(),i=(s,c)=>St(t.locale??"ko",s,c),r=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?"⌘":"Ctrl",l=n.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.groupOther"),items:[{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)=>(n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:i("em.shortcuts.title")},{default:n.withCtx(()=>[n.createElementVNode("div",VI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,d=>(n.openBlock(),n.createElementBlock("section",{key:d.title,class:"em-shortcuts__group"},[n.createElementVNode("h4",MI,n.toDisplayString(d.title),1),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.items,u=>(n.openBlock(),n.createElementBlock("div",{key:u.desc,class:"em-shortcuts__row"},[n.createElementVNode("span",BI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.keys,(m,p)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:m+p},[n.createElementVNode("kbd",DI,n.toDisplayString(m),1),p<u.keys.length-1?(n.openBlock(),n.createElementBlock("span",OI,"+")):n.createCommentVNode("",!0)],64))),128))]),n.createElementVNode("span",PI,n.toDisplayString(u.desc),1)]))),128))]))),128)),n.createElementVNode("div",LI,[n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:i("em.common.close"),onClick:c[0]||(c[0]=d=>n.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-fa7e04dd"]]);function zI(e){return e?e.kind==="missing"?{title:"편집이 잠겼습니다",detail:"변경 사항을 저장하지 못했습니다(서버 또는 네트워크 오류). 최신 내용을 다시 불러오세요."}:{title:"편집이 잠겼습니다",detail:"다른 곳에서 변경되어 편집이 잠겼습니다. 최신 내용을 다시 불러오세요."}:null}const UI={key:0,class:"em-canvas__empty","aria-hidden":"true"},HI={class:"em-canvas__empty-title"},FI=["innerHTML"],GI=["innerHTML"],jI={key:1,class:"em-canvas__empty-title"},KI={key:0,class:"em-conflict-banner",role:"alert","aria-live":"assertive"},YI={class:"em-conflict-banner__body"},WI={class:"em-conflict-banner__title"},qI={class:"em-conflict-banner__detail"},XI={key:0,class:"em-toast",role:"status","aria-live":"polite"},gl="nc:",Lm=Pe(n.defineComponent({__name:"DiagramCanvas",props:{controller:{}},setup(e,{expose:t}){const i=e.controller,a=ie.useModal(),r=n.ref(null);let l;n.watch(()=>i.notice.value,v=>{v&&(r.value=v.text,l&&clearTimeout(l),l=setTimeout(()=>r.value=null,3200))}),n.onBeforeUnmount(()=>l&&clearTimeout(l));const s=n.computed(()=>zI(i.opConflict.value)),c=n.ref(!1),d=n.ref(!1),u={x:0,y:0};function m(v){u.x=v.clientX,u.y=v.clientY}const p=n.ref(null);n.provide(ra,p);const f=n.ref(null);n.provide(vu,f);const y=n.ref(null),b=n.computed(()=>{const v=y.value,A=new Set;if(!v)return A;if(v.kind==="entity")A.add(v.id);else if(v.kind==="group"){const Y=i.resolved.value.groups.find(N=>N.group.modelId===v.id);for(const N of(Y==null?void 0:Y.group.memberEntityRefs)??[])A.add(N)}return A}),k=n.computed(()=>{const v=y.value,A=new Set(b.value),Y=new Set,N=new Set;if(!v)return{related:A,edges:Y,notes:N};if(v.kind==="note"){N.add(v.id);for(const O of i.resolved.value.noteConnections)O.noteRef===v.id&&A.add(O.targetRef);return{related:A,edges:Y,notes:N}}const U=b.value;if(!U.size)return{related:A,edges:Y,notes:N};for(const O of i.resolved.value.associations){const{end1:le,end2:Ne}=O.association;(U.has(le.entityRef)||U.has(Ne.entityRef))&&(Y.add(O.association.modelId),A.add(le.entityRef),A.add(Ne.entityRef))}for(const O of i.resolved.value.noteConnections)A.has(O.targetRef)&&N.add(O.noteRef);return{related:A,edges:Y,notes:N}});n.provide(Xn,{source:y,active:n.computed(()=>y.value!==null),primaryEntityIds:b,relatedEntityIds:n.computed(()=>k.value.related),relatedEdgeIds:n.computed(()=>k.value.edges),relatedNoteIds:n.computed(()=>k.value.notes),hoverGroupId:n.computed(()=>{var v;return((v=y.value)==null?void 0:v.kind)==="group"?y.value.id:null}),setEntityHover:v=>{f.value||d.value||(y.value=v?{kind:"entity",id:v}:null)},setGroupHover:v=>{f.value||d.value||(y.value=v?{kind:"group",id:v}:null)},setNoteHover:v=>{f.value||d.value||(y.value=v?{kind:"note",id:v}:null)}}),n.provide(kn,i);function g(v,A){return`${gl}${v}:${A}`}function w(v){if(!v.startsWith(gl))return null;const[A,Y]=v.slice(gl.length).split(":");return A&&Y?{noteRef:A,targetRef:Y}:null}n.provide(Yr,{points:v=>{var Y,N;const A=w(v);return A?((Y=i.resolved.value.noteConnections.find(U=>U.noteRef===A.noteRef&&U.targetRef===A.targetRef))==null?void 0:Y.waypoints)??[]:((N=i.resolved.value.associations.find(U=>U.association.modelId===v))==null?void 0:N.waypoints)??[]},movePoint:(v,A,Y)=>{const N=w(v);N?i.moveNoteConnectionWaypoint(N.noteRef,N.targetRef,A,Y):i.moveWaypoint(v,A,Y)},insertPoint:(v,A,Y)=>{const N=w(v);N?i.addNoteConnectionWaypoint(N.noteRef,N.targetRef,A,Y):i.addWaypoint(v,A,Y)},removePoint:(v,A)=>{const Y=w(v);Y?i.removeNoteConnectionWaypoint(Y.noteRef,Y.targetRef,A):i.removeWaypoint(v,A)}});const h=Oe(),{nodes:E,edges:X,findNode:z,findEdge:q,addNodes:D,addEdges:$,removeNodes:B,removeEdges:Q,fitView:V,setCenter:re,getViewport:_,screenToFlowCoordinate:W,getSelectedNodes:R,updateNodeInternals:J}=h,ee=n.ref(!1);async function ae(v){ee.value=!0,await n.nextTick(),await new Promise(A=>requestAnimationFrame(()=>A(null)));try{return await v()}finally{ee.value=!1}}function I(){return ae(()=>Dm(h))}function K(){return ae(()=>Om(h))}t({exportSvg:I,exportPng:K});const oe=n.computed(()=>i.resolved.value.entities.length===0);function pe(){const v=_(),{width:A,height:Y}=h.dimensions.value;return{x:(A/2-v.x)/v.zoom,y:(Y/2-v.y)/v.zoom}}function fe(){const v=pe();i.addEntity("NewEntity",{x:v.x,y:v.y})}function ce(){const v=pe();i.addNote("메모",{x:v.x,y:v.y})}function ue(v){for(const A of i.resolved.value.groups){const{location:Y,size:N}=A.geo;if(v.x>=Y.x&&v.x<=Y.x+N.width&&v.y>=Y.y&&v.y<=Y.y+N.height)return A.group.modelId}return null}function he(){const v=i.resolved.value,A=new Map(v.groups.map(le=>[le.group.modelId,le.geo])),Y=new Set(v.groups.map(le=>le.group.modelId)),N=new Set([...Y,...v.entities.map(le=>le.entity.modelId),...v.notes.map(le=>le.note.modelId)]);for(const le of[...E.value])N.has(le.id)||B([le.id]);for(const le of v.groups){const Ne=le.group.modelId,se={width:`${le.geo.size.width}px`,height:`${le.geo.size.height}px`},Re={group:le.group,style:le.style,locked:le.locked},De=le.locked?!1:void 0,Ue=z(Ne);Ue?(Ue.position={...le.geo.location},Ue.data=Re,Ue.style=se,Ue.draggable=De):D([{id:Ne,type:"group",position:{...le.geo.location},draggable:De,style:se,data:Re}])}for(const le of v.entities){const Ne=le.entity.modelId,se=le.groupRef&&Y.has(le.groupRef)?le.groupRef:void 0,Re={entity:le.entity,displayMode:i.displayMode.value,collapsed:le.collapsed,locked:le.locked,groupRef:se,size:le.geo.size,style:le.style,attributeStyles:le.attributeStyles,operationStyles:le.operationStyles},De=le.locked?!1:void 0,Ue=se?A.get(se):void 0,Qe=Ue?{x:le.geo.location.x-Ue.location.x,y:le.geo.location.y-Ue.location.y}:{...le.geo.location},Ke=z(Ne);Ke?(Ke.position=Qe,Ke.data=Re,Ke.parentNode=se,Ke.draggable=De):D([{id:Ne,type:"entity",position:Qe,parentNode:se,draggable:De,data:Re}])}for(const le of v.notes){const Ne=le.note,se=Ne.modelId,Re=le.groupRef&&Y.has(le.groupRef)?le.groupRef:void 0,De={note:Ne,groupRef:Re},Ue={width:`${Ne.geo.size.width}px`,height:`${Ne.geo.size.height}px`},Qe=Re?A.get(Re):void 0,Ke=Qe?{x:Ne.geo.location.x-Qe.location.x,y:Ne.geo.location.y-Qe.location.y}:{...Ne.geo.location},Ye=z(se);Ye?(Ye.position=Ke,Ye.data=De,Ye.style=Ue,Ye.parentNode=Re):D([{id:se,type:"note",position:Ke,parentNode:Re,style:Ue,data:De}])}const U=new Map(v.associations.map(le=>[le.association.modelId,le])),O=new Set(v.noteConnections.map(le=>g(le.noteRef,le.targetRef)));for(const le of[...X.value])!U.has(le.id)&&!O.has(le.id)&&Q([le.id]);for(const[le,Ne]of U){const se={id:le,type:"association",source:Ne.association.end1.entityRef,target:Ne.association.end2.entityRef,sourceHandle:Ne.sourceColumnRef?`r:${Ne.sourceColumnRef}`:void 0,targetHandle:Ne.targetColumnRef?`l:${Ne.targetColumnRef}`:void 0,data:{association:Ne.association,sourceColumnRef:Ne.sourceColumnRef,targetColumnRef:Ne.targetColumnRef}},Re=q(le);Re?(Re.data=se.data,Re.sourceHandle=se.sourceHandle,Re.targetHandle=se.targetHandle):$([se])}for(const le of v.noteConnections){const Ne=g(le.noteRef,le.targetRef),se={noteRef:le.noteRef,targetRef:le.targetRef},Re=q(Ne);Re?Re.data=se:$([{id:Ne,type:"note-connection",source:le.noteRef,target:le.targetRef,data:se}])}we()}function we(){n.nextTick(()=>requestAnimationFrame(()=>J()))}function Se(){const v=R.value.map(Y=>Y.id);if(v.length)return v;const A=i.selection.value;return A&&(A.kind==="entity"||A.kind==="note"||A.kind==="group")?[A.id]:[]}function Ie(v){var U;const A=v.target;if(A&&(A.tagName==="INPUT"||A.tagName==="TEXTAREA"||A.isContentEditable))return;if(v.key==="?"){a.openModal({component:Pm,bind:{locale:i.uiLocale.value}}),v.preventDefault();return}if(!i.editable.value){(v.metaKey||v.ctrlKey)&&v.key.toLowerCase()==="c"&&(i.copy(),v.preventDefault());return}if(v.key==="Delete"||v.key==="Backspace"){i.deleteSelection()&&v.preventDefault();return}if(v.key==="ArrowUp"||v.key==="ArrowDown"||v.key==="ArrowLeft"||v.key==="ArrowRight"){if(((U=i.selection.value)==null?void 0:U.kind)==="attribute"){if(v.key==="ArrowUp"||v.key==="ArrowDown"){const se=v.key==="ArrowDown"?1:-1;(v.altKey?i.nudgeSelectedAttributes(se):i.moveAttributeFocus(se))&&v.preventDefault()}return}const O=v.shiftKey?10:1,le=v.key==="ArrowLeft"?-O:v.key==="ArrowRight"?O:0,Ne=v.key==="ArrowUp"?-O:v.key==="ArrowDown"?O:0;i.nudgeNodes(Se(),le,Ne)&&v.preventDefault();return}if(!(v.metaKey||v.ctrlKey))return;const N=v.key.toLowerCase();N==="c"?(i.copy(),v.preventDefault()):N==="v"?(i.paste(),v.preventDefault()):N==="z"&&(v.shiftKey?i.redo():i.undo(),v.preventDefault())}n.onMounted(async()=>{he(),await n.nextTick(),V(),window.addEventListener("keydown",Ie),window.addEventListener("pointerup",me),window.addEventListener("pointermove",m,{passive:!0})}),n.onBeforeUnmount(()=>{window.removeEventListener("keydown",Ie),window.removeEventListener("pointerup",me),window.removeEventListener("pointermove",m)});function me(){p.value=null}function ge(){d.value=!0,y.value=null}function ke(){var N;d.value=!1;const v=(N=document.elementFromPoint(u.x,u.y))==null?void 0:N.closest(".vue-flow__node"),A=v==null?void 0:v.dataset.id;if(!A){y.value=null;return}const Y=v.classList.contains("vue-flow__node-group")?"group":v.classList.contains("vue-flow__node-note")?"note":"entity";y.value={kind:Y,id:A}}n.watch([()=>i.resolved.value,()=>i.displayMode.value],he),n.watch(()=>i.revision.value,we),n.watch(()=>i.resolved.value,v=>{const A=y.value;if(!A)return;(A.kind==="entity"?v.entities.some(N=>N.entity.modelId===A.id):A.kind==="group"?v.groups.some(N=>N.group.modelId===A.id):v.notes.some(N=>N.note.modelId===A.id))||(y.value=null)});function G(v){const A=v.computedPosition??v.position,Y=v.dimensions??{width:0,height:0};return{x:A.x+Y.width/2,y:A.y+Y.height/2}}function H(v){const A=v.node;if(A){if(y.value=null,A.type==="group"){const Y=i.resolved.value.groups.find(N=>N.group.modelId===A.id);f.value=Y?{groupId:A.id,dx:A.position.x-Y.geo.location.x,dy:A.position.y-Y.geo.location.y}:null,p.value=null;return}if(A.type!=="entity"&&A.type!=="note"){p.value=null;return}p.value=ue(G(A))}}function C(v){var N;p.value=null,f.value=null;const A=(N=v.nodes)!=null&&N.length?v.nodes:[v.node],Y=A.filter(U=>(U==null?void 0:U.type)==="group");if(Y.length){for(const U of Y){if(!U)continue;const O=i.resolved.value.entities.filter(le=>le.groupRef===U.id).map(le=>{const Ne=z(le.entity.modelId),se=(Ne==null?void 0:Ne.computedPosition)??(Ne==null?void 0:Ne.position)??{x:0,y:0};return{id:le.entity.modelId,location:{x:se.x,y:se.y}}});i.dragGroup(U.id,{x:U.position.x,y:U.position.y},O)}return}for(const U of A){if(!U||U.type==="group")continue;const O=U.computedPosition??U.position,le=U.dimensions??{width:0,height:0},Ne={x:O.x+le.width/2,y:O.y+le.height/2};U.type==="note"?i.dropNote(U.id,{x:O.x,y:O.y},ue(Ne)):i.dropEntity(U.id,{x:O.x,y:O.y},ue(Ne))}}function M(v){var se,Re,De,Ue,Qe;if(!i.editable.value||!v.source||!v.target)return;const A=((se=z(v.source))==null?void 0:se.type)==="note",Y=((Re=z(v.target))==null?void 0:Re.type)==="note";if(A||Y){if(A&&Y)return;const Ke=A?v.source:v.target,Ye=A?v.target:v.source;((De=z(Ye))==null?void 0:De.type)==="entity"&&i.addNoteConnection(Ke,Ye);return}const N=Ke=>{var Ye;return(Ye=i.state.logical.entities.find(At=>At.modelId===Ke))==null?void 0:Ye.stereotype},U=N(v.source)==="JPA_EMBEDDABLE",O=N(v.target)==="JPA_EMBEDDABLE";if(U||O){if(U&&O)return;const Ke=U?v.source:v.target,Ye=U?v.target:v.source;i.addEmbedAssociation(Ye,Ke);return}const le=(Ue=v.sourceHandle)!=null&&Ue.startsWith("r:")?v.sourceHandle.slice(2):void 0,Ne=(Qe=v.targetHandle)!=null&&Qe.startsWith("l:")?v.targetHandle.slice(2):void 0;i.addAssociation(v.source,v.target,le,Ne)}const T=n.ref(null);function ne(v,A){var N;const Y=i.state.layout.entityLayouts.find(U=>U.entityRef===v);return it((N=Y==null?void 0:Y.attributeStyles)==null?void 0:N[A])}function de(v,A){var N;const Y=i.state.layout.entityLayouts.find(U=>U.entityRef===v);return it((N=Y==null?void 0:Y.operationStyles)==null?void 0:N[A])}function Ee(v){var A;return it((A=i.state.layout.groupLayouts.find(Y=>Y.groupRef===v))==null?void 0:A.style)}function ye(v){var A;return it((A=i.state.layout.notes.find(Y=>Y.modelId===v))==null?void 0:A.style)}function ve(v){var N,U;if(v.preventDefault(),!i.editable.value)return;const A=()=>W({x:v.clientX,y:v.clientY}),Y=[{caption:i.t("em.ctx.addEntity"),icon:"add-entity",handler:()=>{const O=A();i.addEntity("NewEntity",{x:O.x,y:O.y})}},{caption:i.t("em.ctx.addNote"),icon:"note",handler:()=>{const O=A();i.addNote("메모",{x:O.x,y:O.y})}},{caption:i.t("em.ctx.addGroup"),icon:"folder",handler:()=>{const O=A();i.addEmptyGroup({x:O.x,y:O.y})}}];((N=i.clipboard.value)==null?void 0:N.kind)==="entity"&&Y.push({caption:i.t("em.ctx.paste"),icon:"clipboard",handler:()=>i.paste()}),i.resolved.value.entities.length>0&&Y.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()}),(U=T.value)==null||U.open(v,Y)}function Te({event:v,node:A}){var se,Re,De,Ue,Qe,Ke,Ye,At,Qt,be,et,Yo,Wo,qo,Xo,Jo,Zo,Qo;const Y=v;if(Y.preventDefault(),!i.editable.value){if(A.type==="group"||A.type==="note")return;const Me=(Re=(se=Y.target)==null?void 0:se.closest("[data-attr]"))==null?void 0:Re.dataset.attr;if(Me){const Xe=i.selection.value;(Xe==null?void 0:Xe.kind)==="attribute"&&Xe.entityId===A.id&&Xe.ids.includes(Me)||i.selectAttribute(A.id,Me);const xn=((De=i.selection.value)==null?void 0:De.kind)==="attribute"&&i.selection.value.entityId===A.id?[...i.selection.value.ids]:[Me];(Ue=T.value)==null||Ue.open(Y,[{caption:xn.length>1?i.t("em.ctx.copyN",{n:xn.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}(Qe=T.value)==null||Qe.open(Y,[{caption:i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>ia(a,i,A.id)},{caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:A.id},i.copy()}}]);return}if(A.type==="group"){const Me=i.isGroupLocked(A.id),Xe=[];Me||Xe.push({type:"swatches",caption:i.t("em.common.color"),current:Ee(A.id),onPick:nt=>i.setGroupSwatch(A.id,nt)},{type:"separator"}),Xe.push({caption:Me?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:Me?"unlock":"lock",handler:()=>i.setGroupLocked(A.id,!Me)}),Me||Xe.push({type:"separator"},{caption:i.t("em.ctx.ungroup"),icon:"trash",danger:!0,handler:()=>i.removeGroup(A.id)}),(Ke=T.value)==null||Ke.open(Y,Xe);return}if(A.type==="note"){(Ye=T.value)==null||Ye.open(Y,[{type:"swatches",caption:i.t("em.common.color"),current:ye(A.id),onPick:Me=>i.setNoteSwatch(A.id,Me)},{type:"separator"},{caption:i.t("em.ctx.deleteNote"),icon:"trash",danger:!0,handler:()=>i.removeNote(A.id)}]);return}const N=(Qt=(At=Y.target)==null?void 0:At.closest("[data-attr]"))==null?void 0:Qt.dataset.attr;if(N){const Me=i.selection.value;(Me==null?void 0:Me.kind)==="attribute"&&Me.entityId===A.id&&Me.ids.includes(N)||i.selectAttribute(A.id,N);const nt=((be=i.selection.value)==null?void 0:be.kind)==="attribute"&&i.selection.value.entityId===A.id?[...i.selection.value.ids]:[N];if(i.isEntityLocked(A.id)){(et=T.value)==null||et.open(Y,[{caption:nt.length>1?i.t("em.ctx.copyN",{n:nt.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}const xn=nt.length>1,bl=[{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(A.id)},{type:"swatches",caption:xn?i.t("em.ctx.colorN",{n:nt.length}):i.t("em.common.color"),current:xn?null:ne(A.id,N),onPick:rA=>i.setAttributeSwatches(A.id,nt,rA)},{type:"separator"},{caption:xn?i.t("em.ctx.copyN",{n:nt.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}],ei=i.clipboard.value;(ei==null?void 0:ei.kind)==="attribute"&&bl.push({caption:ei.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:ei.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:A.id},i.paste()}}),bl.push({type:"separator"},{caption:xn?i.t("em.ctx.deleteAttrN",{n:nt.length}):i.t("em.ctx.deleteAttr"),icon:"trash",danger:!0,handler:()=>i.removeAttributes(A.id,nt)}),(Yo=T.value)==null||Yo.open(Y,bl);return}const U=(qo=(Wo=Y.target)==null?void 0:Wo.closest("[data-op]"))==null?void 0:qo.dataset.op;if(U){if(i.isEntityLocked(A.id))return;(Xo=T.value)==null||Xo.open(Y,[{caption:i.t("em.ctx.addOperation"),icon:"method",handler:()=>i.addOperation(A.id)},{type:"swatches",caption:i.t("em.common.color"),current:de(A.id,U),onPick:Me=>i.setOperationSwatch(A.id,U,Me)},{type:"separator"},{caption:i.t("em.ctx.deleteOperation"),icon:"trash",danger:!0,handler:()=>i.removeOperation(A.id,U)}]);return}const O=i.resolved.value.entities.find(Me=>Me.entity.modelId===A.id),le=!!(O!=null&&O.locked),Ne=[{caption:le?i.t("em.ctx.viewDetail"):i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>ia(a,i,A.id)}];if(!le){Ne.push({type:"separator"},{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(A.id)},{caption:i.t("em.ctx.addMethod"),icon:"method",handler:()=>i.addOperation(A.id)},{caption:i.t("em.ctx.groupInto"),icon:"folder",handler:()=>{const Xe=R.value.filter(nt=>nt.type==="entity").map(nt=>nt.id);i.createGroup(Xe.includes(A.id)&&Xe.length?Xe:[A.id])}},{caption:i.t("em.ctx.addSelfAssoc"),icon:"arrow-lr",handler:()=>i.addAssociation(A.id,A.id)});const Me=i.embeddableCatalog.value;if(Me.length){Ne.push({type:"separator"});for(const Xe of Me){const nt=((Jo=Xe.label)==null?void 0:Jo.ko)??((Zo=Xe.label)==null?void 0:Zo.en)??Xe.type;Ne.push({caption:i.t("em.ctx.addEmbeddableNamed",{label:nt}),icon:"link",handler:()=>i.addPredefinedEmbed(A.id,Xe.type)})}}}if(Ne.push({type:"separator"}),Ne.push({caption:O!=null&&O.collapsed?i.t("em.panel.expand"):i.t("em.panel.collapse"),icon:O!=null&&O.collapsed?"expand-all":"collapse-all",handler:()=>i.setEntityCollapsed(A.id,!(O!=null&&O.collapsed))}),O!=null&&O.groupRef&&!le&&Ne.push({caption:i.t("em.ctx.ungroupEntity"),icon:"folder",handler:()=>i.ungroupEntity(A.id)}),Ne.push({caption:le?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:le?"unlock":"lock",handler:()=>i.setEntityLocked(A.id,!le)}),Ne.push({caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:A.id},i.copy()}}),!le){const Me=i.clipboard.value;(Me==null?void 0:Me.kind)==="attribute"&&Ne.push({caption:Me.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:Me.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:A.id},i.paste()}}),Ne.push({type:"separator"}),Ne.push({caption:i.t("em.ctx.deleteEntity"),icon:"trash",danger:!0,handler:()=>i.removeEntity(A.id)})}(Qo=T.value)==null||Qo.open(Y,Ne)}function Ve({event:v,edge:A}){var U,O;const Y=v;if(Y.preventDefault(),!i.editable.value)return;const N=w(A.id);if(N){(U=T.value)==null||U.open(Y,[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearNoteConnectionWaypoints(N.noteRef,N.targetRef)},{type:"separator"},{caption:i.t("em.ctx.deleteConnection"),icon:"trash",danger:!0,handler:()=>i.removeNoteConnection(N.noteRef,N.targetRef)}]);return}(O=T.value)==null||O.open(Y,[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearWaypoints(A.id)},{type:"separator"},{caption:i.t("em.ctx.deleteAssociation"),icon:"trash",danger:!0,handler:()=>i.removeAssociation(A.id)}])}function Le(v){return v==="group"?"group":v==="note"?"note":"entity"}function je({node:v}){if(R.value.length>1){i.selection.value=null;return}i.selection.value={kind:Le(v.type),id:v.id}}function lt({nodes:v}){v.length>1&&(i.selection.value=null)}function x({edge:v}){const A=w(v.id);i.selection.value=A?{kind:"note",id:A.noteRef}:{kind:"association",id:v.id}}function F(v){const A=i.selection.value;return!!A&&A.kind!=="attribute"&&A.id===v.id}function S(v){var A,Y;return F(v)?v.type==="group"?"color-mix(in srgb, var(--em-selection) 22%, transparent)":"var(--em-selection)":v.type==="note"?"var(--em-note-soft)":v.type==="group"?uu(it((A=v.data)==null?void 0:A.style),!0)??"var(--em-mm-group)":uu(it((Y=v.data)==null?void 0:Y.style))??"var(--em-mm-entity)"}function L(v){return F(v)?"var(--em-selection)":v.type==="note"?"var(--em-note-accent)":v.type==="group"?"var(--em-node-border)":"var(--em-on-surface-muted)"}function P(v,A){re(v,A,{zoom:_().zoom,duration:350})}n.watch(()=>i.focusRequest.value,v=>{if(!v)return;const A=z(v.id);if(!A)return;const Y=A.computedPosition??A.position,N=A.dimensions??{width:0,height:0};P(Y.x+N.width/2,Y.y+N.height/2)});function j({position:v}){P(v.x,v.y)}function Z({node:v}){i.selection.value={kind:Le(v.type),id:v.id};const A=v.computedPosition??v.position,Y=v.dimensions??{width:0,height:0};P(A.x+Y.width/2,A.y+Y.height/2)}function te({node:v}){V({nodes:[v.id],duration:350,maxZoom:1.2,padding:.6})}return(v,A)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-canvas",{"is-connecting":c.value,"is-panning":d.value}])},[n.createVNode(n.unref(y0),{"min-zoom":.2,"max-zoom":2,"only-render-visible-elements":!ee.value,"delete-key-code":null,"disable-keyboard-a11y":!0,"nodes-draggable":n.unref(i).editable.value,"nodes-connectable":n.unref(i).editable.value,"connection-mode":n.unref(Pt).Loose,"pan-on-scroll":"","zoom-on-scroll":!1,"zoom-on-pinch":!0,"zoom-on-double-click":!1,"zoom-activation-key-code":["Meta","Control"],onMoveStart:ge,onMoveEnd:ke,onConnect:M,onConnectStart:A[1]||(A[1]=Y=>c.value=!0),onConnectEnd:A[2]||(A[2]=Y=>c.value=!1),onNodeDrag:H,onNodeDragStop:C,onNodeClick:je,onEdgeClick:x,onSelectionChange:lt,onPaneClick:A[3]||(A[3]=Y=>n.unref(i).selection.value=null),onPaneContextMenu:ve,onNodeContextMenu:Te,onEdgeContextMenu:Ve},{"node-group":n.withCtx(Y=>[n.createVNode(Cu,n.normalizeProps(n.guardReactiveProps(Y)),null,16)]),"node-entity":n.withCtx(Y=>[n.createVNode(xu,n.normalizeProps(n.guardReactiveProps(Y)),null,16)]),"node-note":n.withCtx(Y=>[n.createVNode(Iu,n.normalizeProps(n.guardReactiveProps(Y)),null,16)]),"edge-association":n.withCtx(Y=>[n.createVNode(Uu,n.normalizeProps(n.guardReactiveProps(Y)),null,16)]),"edge-note-connection":n.withCtx(Y=>[n.createVNode(hI,n.normalizeProps(n.guardReactiveProps(Y)),null,16)]),default:n.withCtx(()=>[n.unref(i).showGrid.value?(n.openBlock(),n.createBlock(n.unref(oN),{key:0,gap:16,"pattern-color":"var(--em-border)"})):n.createCommentVNode("",!0),n.createVNode(n.unref($N),{"show-interactive":!1,position:"bottom-left"},{default:n.withCtx(()=>[n.unref(i).editable.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createVNode(n.unref(En),{class:"em-palette__group-start",title:n.unref(i).t("em.ctx.addEntity"),onClick:fe},{default:n.withCtx(()=>[n.createVNode($e,{name:"add-entity",size:14})]),_:1},8,["title"]),n.createVNode(n.unref(En),{title:n.unref(i).t("em.ctx.addNote"),onClick:ce},{default:n.withCtx(()=>[n.createVNode($e,{name:"note",size:14})]),_:1},8,["title"]),n.createVNode(n.unref(En),{title:n.unref(i).t("em.palette.autoLayout"),onClick:A[0]||(A[0]=Y=>n.unref(i).autoLayout())},{default:n.withCtx(()=>[n.createVNode($e,{name:"auto-layout",size:14})]),_:1},8,["title"])],64)):n.createCommentVNode("",!0)]),_:1}),n.unref(i).showMinimap.value?(n.openBlock(),n.createBlock(n.unref(uI),{key:1,pannable:"",width:224,height:160,"node-color":S,"node-stroke-color":L,"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:j,onNodeClick:Z,onNodeDblclick:te})):n.createCommentVNode("",!0)]),_:1},8,["only-render-visible-elements","nodes-draggable","nodes-connectable","connection-mode"]),oe.value?(n.openBlock(),n.createElementBlock("div",UI,[n.unref(i).editable.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("p",HI,n.toDisplayString(n.unref(i).t("em.canvas.emptyTitle")),1),n.createElementVNode("p",{class:"em-canvas__empty-hint",innerHTML:n.unref(i).t("em.canvas.emptyHint")},null,8,FI),n.createElementVNode("p",{class:"em-canvas__empty-hint em-canvas__empty-sub",innerHTML:n.unref(i).t("em.canvas.emptyShortcutHint")},null,8,GI)],64)):(n.openBlock(),n.createElementBlock("p",jI,n.toDisplayString(n.unref(i).t("em.canvas.emptyReadonly")),1))])):n.createCommentVNode("",!0),n.createVNode(n.Transition,{name:"em-conflict-fade"},{default:n.withCtx(()=>[s.value?(n.openBlock(),n.createElementBlock("div",KI,[n.createVNode($e,{name:"alert-triangle",size:16,class:"em-conflict-banner__icon"}),n.createElementVNode("div",YI,[n.createElementVNode("strong",WI,n.toDisplayString(s.value.title),1),n.createElementVNode("span",qI,n.toDisplayString(s.value.detail),1)])])):n.createCommentVNode("",!0)]),_:1}),n.createVNode(CI,{ref_key:"menuRef",ref:T,locale:n.unref(i).uiLocale.value},null,8,["locale"]),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[n.createVNode(n.Transition,{name:"em-toast-fade"},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",XI,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0)]),_:1})]))],2))}}),[["__scopeId","data-v-2fd94c17"]]);function Ia(...e){return e.filter(o=>!!o).join(" ").toLowerCase().trim()||void 0}function JI(e,t){const o=new Set,i=a=>{const r=!!a.matchText&&a.matchText.includes(t);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 ZI={class:"em-explorer em-scroll-overlay"},QI={class:"em-explorer__search"},eS=["placeholder","aria-label"],tS=["aria-label","title"],nS={key:0,class:"em-explorer__empty"},oS={class:"em-explorer__rows"},iS=["data-key","onClick","onDblclick"],aS=["onClick"],rS=["title"],lS={class:"em-key-slot"},sS={class:"em-key-slot"},cS={class:"em-explorer__label"},zm=Pe(n.defineComponent({__name:"DiagramExplorer",props:{controller:{}},setup(e,{expose:t}){const i=e.controller,a=ie.useModal(),r=n.computed(()=>{var ae;const z=i.resolved.value,q=i.displayMode.value,D=I=>{var K,oe,pe;return ni(q,I.name,(oe=(K=I.table)==null?void 0:K.logicalName)==null?void 0:oe.ko,(pe=I.table)==null?void 0:pe.physicalName,i.t("em.node.logicalMissing"))},$=q==="PHYSICAL"||q==="LOGICAL_PHYSICAL",B=I=>{const K=I.attrType.startsWith("RELATION")&&I.dbAttrs.length>0;return{icon:I.attrType.startsWith("RELATION")?"link":"field",keyMarks:{pk:I.identifier,fk:K&&$}}},Q=I=>I.attrType.startsWith("EMBED")&&I.dbAttrs.length>0,V=q==="PHYSICAL"||q==="LOGICAL_PHYSICAL",re=I=>{if(I.attrType!=="EMBED_PREDEF")return I.dbAttrs;const K=i.embeddableCatalog.value.find(oe=>oe.type===I.type);return K?I.dbAttrs.map((oe,pe)=>{const fe=K.fields[pe];return fe?{...oe,physicalName:oe.physicalName||fe.physicalName,logicalName:oe.logicalName??fe.logicalName,dataType:oe.dataType||fe.dataType,length:oe.length??fe.length}:oe}):I.dbAttrs},_=(I,K)=>{var ce,ue,he,we,Se,Ie,me,ge,ke;const oe={entityId:K,attrId:I.modelId};if(Q(I)){const G=Ha(q,I);return{key:`attr:${I.modelId}`,label:I.name+(G?` : ${G}`:""),icon:"table",attrRef:oe,focusId:K,matchText:Ia(I.name,(ue=(ce=I.dbAttrs[0])==null?void 0:ce.logicalName)==null?void 0:ue.ko,(he=I.dbAttrs[0])==null?void 0:he.physicalName),children:V?re(I).map(H=>{var C,M;return{key:`attr:${I.modelId}:col:${H.modelId}`,label:ni(q,H.physicalName,(C=H.logicalName)==null?void 0:C.ko,H.physicalName,i.t("em.node.logicalMissing"))+(H.dataType?` : ${H.dataType}`:""),icon:"field",attrRef:oe,focusId:K,matchText:Ia(H.physicalName,(M=H.logicalName)==null?void 0:M.ko),children:[]}}):[]}}const pe=Ua(I,i.state.logical.associations),fe=Ha(q,I,pe);return{key:`attr:${I.modelId}`,label:ni(q,I.name,(Se=(we=I.dbAttrs[0])==null?void 0:we.logicalName)==null?void 0:Se.ko,(Ie=I.dbAttrs[0])==null?void 0:Ie.physicalName,i.t("em.node.logicalMissing"))+(fe?` : ${fe}`:""),...B(I),attrRef:oe,focusId:K,matchText:Ia(I.name,(ge=(me=I.dbAttrs[0])==null?void 0:me.logicalName)==null?void 0:ge.ko,(ke=I.dbAttrs[0])==null?void 0:ke.physicalName),children:[]}},W=I=>{var pe,fe,ce;const K=I.entity,oe=[...K.attributes].sort((ue,he)=>ue.order-he.order);return{key:`entity:${K.modelId}`,label:D(K),icon:"table",selectKind:"entity",selectId:K.modelId,focusId:K.modelId,matchText:Ia(K.name,(fe=(pe=K.table)==null?void 0:pe.logicalName)==null?void 0:fe.ko,(ce=K.table)==null?void 0:ce.physicalName),children:oe.map(ue=>_(ue,K.modelId))}},R=new Map,J=[];for(const I of z.entities)if(I.groupRef){const K=R.get(I.groupRef)??[];K.push(I),R.set(I.groupRef,K)}else J.push(I);const ee=[];for(const I of z.groups){const K=I.group;ee.push({key:`group:${K.modelId}`,label:((ae=K.name)==null?void 0:ae.ko)||K.packageName||i.t("em.explorer.groupFallback"),icon:"folder",focusId:K.modelId,children:(R.get(K.modelId)??[]).map(W)})}for(const I of J)ee.push(W(I));if(z.associations.length){const I=new Map(z.entities.map(K=>[K.entity.modelId,D(K.entity)]));ee.push({key:"section:associations",label:i.t("em.explorer.associations",{n:z.associations.length}),icon:"arrow-lr",children:z.associations.map(K=>{const oe=K.association,pe=I.get(oe.end1.entityRef)??oe.end1.entityRef,fe=I.get(oe.end2.entityRef)??oe.end2.entityRef;return{key:`assoc:${oe.modelId}`,label:`${pe} — ${fe}`,icon:"arrow-lr",selectKind:"association",selectId:oe.modelId,children:[]}})})}return z.notes.length&&ee.push({key:"section:notes",label:i.t("em.explorer.notes",{n:z.notes.length}),icon:"note",children:z.notes.map(({note:I})=>{var K;return{key:`note:${I.modelId}`,label:((K=I.memo.split(`
|
|
52
|
-
`)[0])==null?void 0:K.slice(0,30))||i.t("em.explorer.emptyNote"),icon:"note",selectKind:"note",selectId:I.modelId,focusId:I.modelId,children:[]}})}),{key:"root",label:i.state.layout.name||i.t("em.explorer.diagram"),icon:"network",children:ee}});function l(z){return z?z.pk&&z.fk?i.t("em.node.keyPfk"):z.pk?i.t("em.node.keyPk"):z.fk?i.t("em.node.keyFk"):"":""}const s=n.ref(new Set);function c(z){const q=new Set(s.value);q.has(z)?q.delete(z):q.add(z),s.value=q}const d=n.ref(""),u=n.ref(null),m=n.computed(()=>d.value.trim().length>0),p=n.computed(()=>{const z=[];if(m.value){const D=JI(r.value,d.value.trim().toLowerCase()),$=(B,Q)=>{if(D.has(B.key)){z.push({node:B,depth:Q});for(const V of B.children)$(V,Q+1)}};return $(r.value,0),z}const q=(D,$)=>{if(z.push({node:D,depth:$}),!s.value.has(D.key))for(const B of D.children)q(B,$+1)};return q(r.value,0),z}),f=n.computed(()=>m.value&&p.value.length<=1);function y(z){var $;if(z.key!=="/"||z.metaKey||z.ctrlKey||z.altKey||z.shiftKey)return;const q=z.target,D=q==null?void 0:q.tagName;D==="INPUT"||D==="TEXTAREA"||D==="SELECT"||q!=null&&q.isContentEditable||(z.preventDefault(),($=u.value)==null||$.focus())}n.onMounted(()=>window.addEventListener("keydown",y)),n.onBeforeUnmount(()=>window.removeEventListener("keydown",y));const b=n.computed(()=>{const z=[],q=D=>{if(D.children.length){D.key!=="root"&&z.push(D.key);for(const $ of D.children)q($)}};return q(r.value),z}),k=n.computed(()=>!b.value.some(z=>s.value.has(z)));function g(){s.value=k.value?new Set(b.value):new Set}t({toggleAll:g,allExpanded:k,hasExpandable:n.computed(()=>b.value.length>0)});function w(z){const q=i.selection.value;return z.attrRef?(q==null?void 0:q.kind)==="attribute"&&q.entityId===z.attrRef.entityId&&q.ids.includes(z.attrRef.attrId):!!q&&q.kind!=="attribute"&&!!z.selectId&&z.selectKind===q.kind&&z.selectId===q.id}function h(z){const q=i.selection.value;return z.selectKind==="entity"&&(q==null?void 0:q.kind)==="attribute"&&q.entityId===z.selectId}function E(z,q){if(z.attrRef){const D=q.shiftKey?"range":q.metaKey||q.ctrlKey?"toggle":"replace";i.selectAttribute(z.attrRef.entityId,z.attrRef.attrId,D)}else z.selectKind&&z.selectId&&(i.selection.value={kind:z.selectKind,id:z.selectId});z.focusId&&i.requestFocus(z.focusId)}function X(z){z.selectKind==="entity"&&z.selectId&&ia(a,i,z.selectId)}return(z,q)=>(n.openBlock(),n.createElementBlock("section",ZI,[n.createElementVNode("div",QI,[n.createVNode($e,{name:"search",size:14,class:"em-explorer__search-icon"}),n.withDirectives(n.createElementVNode("input",{ref_key:"searchInput",ref:u,"onUpdate:modelValue":q[0]||(q[0]=D=>d.value=D),class:"em-explorer__search-input",type:"text",placeholder:n.unref(i).t("em.explorer.searchPlaceholder"),"aria-label":n.unref(i).t("em.explorer.searchAria"),onKeydown:q[1]||(q[1]=n.withKeys(D=>d.value="",["esc"]))},null,40,eS),[[n.vModelText,d.value]]),d.value?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"em-explorer__search-clear","aria-label":n.unref(i).t("em.explorer.clearSearchAria"),title:n.unref(i).t("em.explorer.clearSearchTitle"),onClick:q[2]||(q[2]=D=>d.value="")},[n.createVNode($e,{name:"x",size:13})],8,tS)):n.createCommentVNode("",!0)]),f.value?(n.openBlock(),n.createElementBlock("p",nS,n.toDisplayString(n.unref(i).t("em.explorer.noMatches")),1)):n.createCommentVNode("",!0),n.createElementVNode("div",oS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p.value,({node:D,depth:$})=>(n.openBlock(),n.createElementBlock("div",{key:D.key,class:n.normalizeClass(["em-explorer__row",{"is-active":w(D),"is-focus-parent":h(D),"is-selectable":!!D.selectKind||!!D.attrRef||!!D.focusId}]),"data-key":D.key,style:n.normalizeStyle({paddingLeft:4+$*14+"px"}),onClick:B=>E(D,B),onDblclick:B=>X(D)},[n.createElementVNode("span",{class:n.normalizeClass(["em-explorer__chevron",{"is-leaf":!D.children.length,"is-open":!s.value.has(D.key)}]),onClick:n.withModifiers(B=>D.children.length&&c(D.key),["stop"])},[D.children.length?(n.openBlock(),n.createBlock($e,{key:0,name:"chevron",size:14})):n.createCommentVNode("",!0)],10,aS),D.keyMarks?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-explorer__keys",title:l(D.keyMarks),"aria-hidden":"true"},[n.createElementVNode("span",lS,[D.keyMarks.pk?(n.openBlock(),n.createBlock($e,{key:0,name:"key",size:14,class:"em-key is-pk"})):D.keyMarks.fk?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock($e,{key:1,class:"em-explorer__icon",name:D.icon,size:14},null,8,["name"]))]),n.createElementVNode("span",sS,[D.keyMarks.fk?(n.openBlock(),n.createBlock($e,{key:0,name:"key",size:14,class:"em-key is-fk"})):n.createCommentVNode("",!0)])],8,rS)):(n.openBlock(),n.createBlock($e,{key:1,class:"em-explorer__icon",name:D.icon,size:15},null,8,["name"])),n.createElementVNode("span",cS,n.toDisplayString(D.label),1)],46,iS))),128))])]))}}),[["__scopeId","data-v-82f80eec"]]),dS={class:"em-text-export"},uS={key:0,class:"em-text-export__tabs",role:"tablist"},mS=["aria-selected","onClick"],fS={class:"em-text-export__pre"},pS={class:"em-text-export__actions"},hS=Pe(n.defineComponent({__name:"TextExportModal",props:{formats:{},title:{},locale:{}},setup(e){const t=e,o=ie.useModalHandle(),i=(c,d)=>St(t.locale??"ko",c,d),a=n.ref(0);function r(){return t.formats[a.value]??t.formats[0]}async function l(){try{await navigator.clipboard.writeText(r().content),ie.showNotification(i("em.export.copied"),"info")}catch{ie.showNotification(i("em.export.copyFailed"),"error")}}function s(){const c=r(),d=new Blob([c.content],{type:"text/plain;charset=utf-8"}),u=URL.createObjectURL(d);try{const m=document.createElement("a");m.href=u,m.download=c.filename,document.body.appendChild(m),m.click(),m.remove()}finally{URL.revokeObjectURL(u)}}return(c,d)=>(n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:t.title??i("em.export.title")},{default:n.withCtx(()=>[n.createElementVNode("div",dS,[t.formats.length>1?(n.openBlock(),n.createElementBlock("div",uS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.formats,(u,m)=>(n.openBlock(),n.createElementBlock("button",{key:u.key,type:"button",role:"tab",class:n.normalizeClass(["em-text-export__tab",{"is-active":m===a.value}]),"aria-selected":m===a.value,onClick:p=>a.value=m},n.toDisplayString(u.label),11,mS))),128))])):n.createCommentVNode("",!0),n.createElementVNode("pre",fS,n.toDisplayString(r().content),1),n.createElementVNode("div",pS,[n.createVNode(n.unref(ie.BSButton),{caption:i("em.export.copy"),onClick:l},null,8,["caption"]),n.createVNode(n.unref(ie.BSButton),{caption:i("em.export.download"),onClick:s},null,8,["caption"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:i("em.common.close"),onClick:d[0]||(d[0]=u=>n.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-f31001c1"]]),yS={class:"em-toolbar"},gS={class:"em-toolbar__mode"},Um=Pe(n.defineComponent({__name:"EditorToolbar",props:{controller:{},historyOpen:{type:Boolean}},emits:["exportSvg","exportPng","toggleHistory"],setup(e,{emit:t}){const i=e.controller,a=t,r=ie.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=n.computed({get:()=>i.displayMode.value,set:f=>i.displayMode.value=f});function c(){i.routingMode.value=i.routingMode.value==="straight"?"orthogonal":"straight"}const d=n.computed(()=>{const f=i.resolved.value.entities;return f.length>0&&f.every(y=>y.collapsed)});function u(){d.value?i.expandAll():i.collapseAll()}function m(){const f=i.state.logical;r.openModal({component:hS,bind:{title:i.t("em.toolbar.exportText"),locale:i.uiLocale.value,formats:[{key:"text",label:i.t("em.export.formatText"),content:Il(f),filename:"diagram.txt"},{key:"mermaid-er",label:i.t("em.export.formatMermaidEr"),content:Da(f,"er"),filename:"diagram.er.mmd"},{key:"mermaid-class",label:i.t("em.export.formatMermaidClass"),content:Da(f,"class"),filename:"diagram.class.mmd"}]}})}function p(){r.openModal({component:Pm,bind:{locale:i.uiLocale.value}})}return(f,y)=>(n.openBlock(),n.createElementBlock("div",yS,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:n.unref(i).t("em.toolbar.undo"),disabled:!n.unref(i).canUndo.value||!n.unref(i).editable.value,onClick:y[0]||(y[0]=b=>n.unref(i).undo())},{left:n.withCtx(()=>[n.createVNode($e,{name:"undo",size:16})]),_:1},8,["tooltip","disabled"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:n.unref(i).t("em.toolbar.redo"),disabled:!n.unref(i).canRedo.value||!n.unref(i).editable.value,onClick:y[1]||(y[1]=b=>n.unref(i).redo())},{left:n.withCtx(()=>[n.createVNode($e,{name:"redo",size:16})]),_:1},8,["tooltip","disabled"]),y[9]||(y[9]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createElementVNode("label",gS,[n.createTextVNode(n.toDisplayString(n.unref(i).t("em.toolbar.displayLabel"))+" ",1),n.createVNode(n.unref(ie.BSSelect),{modelValue:s.value,"onUpdate:modelValue":y[2]||(y[2]=b=>s.value=b),items:l,"value-provider":b=>b.v,"label-provider":b=>n.unref(i).t(b.labelKey)},null,8,["modelValue","value-provider","label-provider"])]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(i).t(n.unref(i).routingMode.value==="orthogonal"?"em.toolbar.routingOrthogonal":"em.toolbar.routingStraight"),tooltip:n.unref(i).t("em.toolbar.routingToggle"),onClick:c},{left:n.withCtx(()=>[n.createVNode($e,{name:"route",size:16})]),_:1},8,["caption","tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":n.unref(i).showGrid.value}]),caption:n.unref(i).t("em.toolbar.grid"),tooltip:n.unref(i).t(n.unref(i).showGrid.value?"em.toolbar.gridOff":"em.toolbar.gridOn"),onClick:y[3]||(y[3]=b=>n.unref(i).showGrid.value=!n.unref(i).showGrid.value)},{left:n.withCtx(()=>[n.createVNode($e,{name:"grid",size:16})]),_:1},8,["class","caption","tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":n.unref(i).showMinimap.value}]),caption:n.unref(i).t("em.toolbar.minimap"),tooltip:n.unref(i).t(n.unref(i).showMinimap.value?"em.toolbar.minimapOff":"em.toolbar.minimapOn"),onClick:y[4]||(y[4]=b=>n.unref(i).showMinimap.value=!n.unref(i).showMinimap.value)},{left:n.withCtx(()=>[n.createVNode($e,{name:"map",size:16})]),_:1},8,["class","caption","tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(i).t(d.value?"em.panel.expandAll":"em.panel.collapseAll"),disabled:!n.unref(i).editable.value,onClick:u},{left:n.withCtx(()=>[n.createVNode($e,{name:d.value?"expand-all":"collapse-all",size:16},null,8,["name"])]),_:1},8,["caption","disabled"]),y[10]||(y[10]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:n.unref(i).t("em.toolbar.exportText"),onClick:m},{left:n.withCtx(()=>[n.createVNode($e,{name:"file-text",size:16})]),_:1},8,["tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:n.unref(i).t("em.toolbar.exportSvg"),onClick:y[5]||(y[5]=b=>a("exportSvg"))},{left:n.withCtx(()=>[n.createVNode($e,{name:"image",size:16})]),_:1},8,["tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:n.unref(i).t("em.toolbar.exportPng"),onClick:y[6]||(y[6]=b=>a("exportPng"))},{left:n.withCtx(()=>[n.createVNode($e,{name:"camera",size:16})]),_:1},8,["tooltip"]),n.unref(i).historyAvailable.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[y[8]||(y[8]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":e.historyOpen}]),caption:n.unref(i).t("em.toolbar.history"),tooltip:n.unref(i).t(e.historyOpen?"em.toolbar.historyClose":"em.toolbar.historyOpen"),onClick:y[7]||(y[7]=b=>a("toggleHistory"))},{left:n.withCtx(()=>[n.createVNode($e,{name:"undo",size:16})]),_:1},8,["class","caption","tooltip"])],64)):n.createCommentVNode("",!0),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn em-toolbar__help",tooltip:n.unref(i).t("em.toolbar.shortcuts"),onClick:p},{left:n.withCtx(()=>[n.createVNode($e,{name:"help",size:16})]),_:1},8,["tooltip"])]))}}),[["__scopeId","data-v-ca5af952"]]),bS=["title"],_S=["title"],kS=["disabled","aria-pressed"],ES=["disabled","aria-pressed"],wS=Pe(n.defineComponent({__name:"EditModeToggle",props:{editable:{type:Boolean},opMode:{type:Boolean},frozen:{type:Boolean},locale:{}},emits:["toggle"],setup(e,{emit:t}){const o=e,i=t,a=l=>St(o.locale??"ko",l);function r(l){o.frozen||!o.opMode||l!==o.editable&&i("toggle")}return(l,s)=>e.frozen?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-mode-toggle em-mode-frozen",role:"status",title:a("em.mode.frozenTitle")},[n.createVNode($e,{name:"lock",size:14}),n.createElementVNode("span",null,n.toDisplayString(a("em.mode.frozen")),1)],8,bS)):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["em-mode-toggle em-mode-segment",{"is-readonly":!e.opMode}]),role:"group",title:e.opMode?void 0:a("em.mode.readonlyTitle")},[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-seg",{"is-active":!e.editable}]),disabled:!e.opMode,"aria-pressed":!e.editable,onClick:s[0]||(s[0]=c=>r(!1))},[n.createVNode($e,{name:"eye",size:13}),n.createElementVNode("span",null,n.toDisplayString(a("em.mode.view")),1)],10,kS),n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-seg",{"is-active":e.editable}]),disabled:!e.opMode,"aria-pressed":e.editable,onClick:s[1]||(s[1]=c=>r(!0))},[n.createVNode($e,{name:"pencil",size:13}),n.createElementVNode("span",null,n.toDisplayString(a("em.mode.edit")),1)],10,ES)],10,_S))}}),[["__scopeId","data-v-2b5162b7"]]),NS=["disabled"],vS={class:"em-panel__sub"},xS={class:"em-nav"},CS={key:0,class:"em-nav__divider","aria-hidden":"true"},IS={key:1},SS=["onClick","onKeydown"],$S={class:"em-nav__name"},RS=["title"],AS={key:0,class:"em-panel__note"},TS=["data-attr-block"],VS={class:"em-attr__row"},MS=["title"],BS={key:0,class:"em-attr__row"},DS={class:"em-attr__row"},OS={class:"em-attr__row"},PS={class:"em-attr__flags"},LS={class:"em-attr__pii"},zS={class:"em-attr__pii"},US={class:"em-attr__pii"},HS={key:0,class:"em-attr__pii em-attr__codetop"},FS={class:"em-multilang"},GS={key:2,class:"em-embed-cols"},jS={class:"em-embed-col__label"},KS={class:"em-attr__row"},YS={class:"em-attr__row"},WS={key:0,class:"em-embed-upd"},qS={class:"em-embed-upd"},XS={class:"em-embed-upd"},JS={class:"em-swatch__row em-attr__swatch"},ZS=["title","onClick"],QS=["title","onClick"],e$={key:0,class:"em-attr__swatch-hint"},Sa="__OWN__",t$=Pe(n.defineComponent({__name:"EntityColumnsSection",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=n.computed(()=>o.state.logical.entities.find(N=>N.modelId===t.entityId)??null),a=n.computed(()=>i.value?o.state.layout.entityLayouts.find(N=>N.entityRef===i.value.modelId)??null:null),r=n.computed(()=>{var N;return((N=i.value)==null?void 0:N.stereotype)==="JPA_EMBEDDABLE"}),l=n.computed(()=>new Set(o.selectedAttrIds.value)),s=n.computed(()=>{var N;return((N=i.value)==null?void 0:N.attributes.filter(U=>U.attrType!=="DIVIDER"))??[]}),c=n.computed(()=>{var N;return((N=i.value)==null?void 0:N.attributes)??[]}),d=n.computed(()=>s.value.filter(N=>l.value.has(N.modelId)));function u(N){return{pk:N.identifier,fk:N.attrType.startsWith("RELATION")&&N.dbAttrs.length>0,required:N.notNull&&!N.identifier}}function m(N){return!!i.value&&!!ki(o.state.logical,i.value.modelId,N.modelId)}function p(N){const U=u(N),O=[U.pk&&"PK",U.fk&&"FK",U.required&&"NOT NULL"].filter(Boolean);return O.length?O.join(" · "):void 0}function f(N,U){i.value&&o.selectAttribute(i.value.modelId,N.modelId,U.shiftKey?"range":U.metaKey||U.ctrlKey?"toggle":"replace")}const y=["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 b(N){return N==="none"?o.t("em.common.noneParen"):N}const k=N=>N;function g(N){var U,O;return it((O=(U=a.value)==null?void 0:U.attributeStyles)==null?void 0:O[N.modelId])}function w(N){return l.value.size>1&&l.value.has(N.modelId)}function h(N,U){if(!i.value)return;const O=w(N)?o.selectedAttrIds.value:[N.modelId];o.setAttributeSwatches(i.value.modelId,O,U)}function E(N,U){i.value&&o.updateAttribute(i.value.modelId,N.modelId,U)}function X(N,U){E(N,{naturalId:U||void 0,naturalIdMutable:U?N.naturalIdMutable:void 0})}function z(){return{naturalId:void 0,naturalIdMutable:void 0}}function q(N,U){E(N,{identifier:U,...U?z():{}})}function D(N,U){E(N,{transient:U||void 0,...U?z():{}})}function $(N){return!!N.transient}const B=N=>N.value,Q=N=>N.label;function V(N,U){if(!U)return;const O=I.value.find(le=>le.type===U);if(O){const le=N.dbAttrs[0]??{modelId:N.modelId+".c",physicalName:N.name,dataType:"VARCHAR"};E(N,{type:U,customType:void 0,dbAttrs:[{...le,dataType:O.dataType,length:O.length,scale:O.scale}]});return}E(N,U===kt?{type:U}:{type:U,customType:void 0})}function re(N,U){E(N,{customType:U.trim()===""?void 0:U})}function _(N,U){const le={...N.dbAttrs[0]??{modelId:N.modelId+".c",physicalName:N.name,dataType:"VARCHAR"},...U};U.dataType!==void 0&&!ao.has(le.dataType)&&(le.scale=void 0),E(N,{dbAttrs:[le]})}function W(N){var U;return ao.has(((U=N.dbAttrs[0])==null?void 0:U.dataType)??"")}function R(N,U,O){var le;_(N,{logicalName:{...(le=N.dbAttrs[0])==null?void 0:le.logicalName,[U]:O}})}function J(N,U){E(N,{description:Object.keys(U).length?U:void 0})}function ee(N){return N.personalInfoAttributeType??"none"}function ae(N,U){E(N,{personalInfoAttributeType:U==="none"?void 0:U})}const I=n.computed(()=>o.predefinedCustomTypeCatalog.value),K=n.computed(()=>o.embeddableCatalog.value),oe=n.ref(void 0);function pe(N){var U,O;return((U=N.label)==null?void 0:U.ko)??((O=N.label)==null?void 0:O.en)??N.type}function fe(N){if(!N||!i.value)return;const U=o.addPredefinedEmbed(i.value.modelId,N);U&&o.selectAttribute(i.value.modelId,U),oe.value=void 0}function ce(){if(!i.value)return;const N=o.addAttribute(i.value.modelId);o.selectAttribute(i.value.modelId,N)}const ue=n.computed(()=>o.groupCodeCatalog.value);function he(N){var U;return((U=ue.value.find(O=>O.groupCode===N.groupCode))==null?void 0:U.codes)??[]}function we(N){return["none",...he(N)]}function Se(N){return N==="none"?"none":N.code}function Ie(N){var O,le;if(N==="none")return o.t("em.common.noneParen");const U=((O=N.label)==null?void 0:O.ko)??((le=N.label)==null?void 0:le.en);return U?`${N.code} (${U})`:N.code}function me(N,U){i.value&&o.setAttributeGroupCode(i.value.modelId,N.modelId,U)}function ge(N,U){E(N,{defaultValue:U==="none"?void 0:U})}function ke(N,U){E(N,{defaultValue:U.trim()===""?void 0:U})}function G(N){return N.attrType.startsWith("EMBED")&&N.dbAttrs.length>0}function H(N,U,O){const le=N.dbAttrs.map((Ne,se)=>{if(se!==U)return Ne;const Re={...Ne,...O};for(const De of Object.keys(O))O[De]===void 0&&delete Re[De];return Re});i.value&&o.setEmbedColumns(i.value.modelId,N.modelId,le)}function C(N,U,O,le){var Ne;H(N,U,{logicalName:{...(Ne=N.dbAttrs[U])==null?void 0:Ne.logicalName,[O]:le}})}function M(N,U){var Ne,se,Re;if(N.attrType==="EMBED_PREDEF"){const De=(Ne=o.embeddableCatalog.value.find(Ue=>Ue.type===N.type))==null?void 0:Ne.fields[U];return De?{name:De.name,physicalName:De.physicalName,dataType:De.dataType,length:De.length,shareable:De.shareable,logicalName:De.logicalName}:void 0}const O=(se=N.embedded)==null?void 0:se.embeddableRef;if(!O)return;const le=(Re=o.state.logical.entities.find(De=>De.modelId===O))==null?void 0:Re.attributes.flatMap(De=>De.dbAttrs)[U];return le?{physicalName:le.physicalName,dataType:le.dataType,length:le.length,scale:le.scale,logicalName:le.logicalName}:void 0}function T(N,U){var O,le;return((O=M(N,U))==null?void 0:O.dataType)||((le=N.dbAttrs[U])==null?void 0:le.dataType)||""}function ne(N,U){var O,le;return((O=M(N,U))==null?void 0:O.length)??((le=N.dbAttrs[U])==null?void 0:le.length)}function de(N,U){var O,le;return((O=M(N,U))==null?void 0:O.scale)??((le=N.dbAttrs[U])==null?void 0:le.scale)}const Ee=["inherit","true","false"];function ye(N){return N==="inherit"?o.t("em.common.inherit"):N}function ve(N){return(N==null?void 0:N.updatable)===void 0?"inherit":N.updatable?"true":"false"}function Te(N,U,O){H(N,U,{updatable:O==="inherit"?void 0:O==="true"})}function Ve(N,U){_(N,{updatable:U==="inherit"?void 0:U==="true"})}const Le=["inherit","true","false"];function je(N){return N==="inherit"?o.t("em.common.inherit"):N}function lt(N){return(N==null?void 0:N.insertable)===void 0?"inherit":N.insertable?"true":"false"}function x(N,U,O){H(N,U,{insertable:O==="inherit"?void 0:O==="true"})}function F(N,U){_(N,{insertable:U==="inherit"?void 0:U==="true"})}const S=n.computed(()=>i.value?ii(i.value,o.state.logical.entities):[]),L=n.computed(()=>tn(S.value.flatMap(N=>N.attributes.flatMap(U=>U.dbAttrs)))),P=n.computed(()=>S.value.flatMap(N=>N.attributes.filter(U=>U.attrType==="NORMAL"&&U.dbAttrs.length===1&&U.dbAttrs[0]).map(U=>{var O;return{modelId:U.dbAttrs[0].modelId,physical:U.dbAttrs[0].physicalName||U.name,isCurrency:U.type==="Currency",ownerName:N.modelId===((O=i.value)==null?void 0:O.modelId)?void 0:N.name}})));function j(){const N=[...P.value].sort((U,O)=>Number(O.isCurrency)-Number(U.isCurrency));return[Sa,...N.map(U=>U.modelId)]}function Z(N){if(N===Sa)return o.t("em.attr.sharedOwn");const U=P.value.find(le=>le.modelId===N);if(!U)return N;const O=U.ownerName?`${U.ownerName}.`:"";return o.t("em.attr.sharedRef",{owner:O,physical:U.physical,mode:U.isCurrency?o.t("em.attr.currencyMode"):o.t("em.attr.sharedMode")})}function te(N){return(N==null?void 0:N.sharedColumnRef)??Sa}function v(N,U,O){H(N,U,{sharedColumnRef:O===Sa?void 0:O})}function A(N){return(N==null?void 0:N.sharedColumnRef)!=null}function Y(N){var U;return((U=$n(N,L.value))==null?void 0:U.physicalName)??""}return(N,U)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!n.unref(o).editable.value},[n.createElementVNode("h4",vS,[n.createTextVNode(n.toDisplayString(n.unref(o).t("em.attr.section",{n:s.value.length}))+" ",1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t("em.common.add"),onClick:ce},null,8,["caption"]),K.value.length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"120px",placeholder:n.unref(o).t("em.attr.addEmbeddable"),"model-value":oe.value,items:K.value,"value-provider":O=>O.type,"label-provider":pe,"onUpdate:modelValue":fe},null,8,["placeholder","model-value","items","value-provider"])):n.createCommentVNode("",!0)]),n.createElementVNode("ul",xS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,O=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:O.modelId},[O.attrType==="DIVIDER"?(n.openBlock(),n.createElementBlock("li",CS,[...U[0]||(U[0]=[n.createElementVNode("hr",null,null,-1)])])):(n.openBlock(),n.createElementBlock("li",IS,[n.createElementVNode("div",{class:n.normalizeClass(["em-nav__item",{"is-selected":l.value.has(O.modelId)}]),role:"button",tabindex:"0",onClick:le=>f(O,le),onKeydown:[n.withKeys(n.withModifiers(le=>f(O,le),["prevent"]),["enter"]),n.withKeys(n.withModifiers(le=>f(O,le),["prevent"]),["space"])]},[n.createElementVNode("span",$S,n.toDisplayString(O.name||n.unref(o).t("em.attr.nameless")),1),n.createElementVNode("span",{class:"em-nav__marks",title:p(O)},[u(O).pk?(n.openBlock(),n.createBlock($e,{key:0,name:"key",size:12,class:"em-nav-key is-pk"})):u(O).required?(n.openBlock(),n.createBlock($e,{key:1,name:"asterisk",size:14,class:"em-nav-key is-required"})):n.createCommentVNode("",!0),u(O).fk?(n.openBlock(),n.createBlock($e,{key:2,name:"key",size:12,class:"em-nav-key is-fk"})):n.createCommentVNode("",!0)],8,RS)],42,SS)]))],64))),128))]),s.value.length&&!d.value.length?(n.openBlock(),n.createElementBlock("p",AS,n.toDisplayString(n.unref(o).t("em.attr.selectHint")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,O=>{var le,Ne,se,Re,De,Ue,Qe,Ke,Ye,At,Qt;return n.openBlock(),n.createElementBlock("div",{key:O.modelId,class:n.normalizeClass(["em-attr",{"is-focused":l.value.has(O.modelId)}]),"data-attr-block":O.modelId},[n.createElementVNode("div",VS,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-name-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.namePlaceholder"),"model-value":O.name,"onUpdate:modelValue":be=>E(O,{name:be})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSSelect),{name:`attr-type-${O.modelId}`,width:"84px",placeholder:n.unref(o).t("em.attr.typePlaceholder"),disabled:O.attrType.startsWith("EMBED")||!!O.groupCode,items:n.unref(Bl)(O.type,I.value),"value-provider":B,"label-provider":Q,"model-value":O.type,"onUpdate:modelValue":be=>V(O,be)},null,8,["name","placeholder","disabled","items","model-value","onUpdate:modelValue"]),n.createElementVNode("span",{title:m(O)?n.unref(o).t("em.attr.fkDeleteHint"):void 0},[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:be=>n.unref(o).removeAttribute(i.value.modelId,O.modelId)},null,8,["onClick"])],8,MS)]),O.type===n.unref(kt)?(n.openBlock(),n.createElementBlock("div",BS,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-customtype-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.customTypePlaceholder"),"model-value":O.customType??"","onUpdate:modelValue":be=>re(O,be)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])])):n.createCommentVNode("",!0),G(O)?(n.openBlock(),n.createElementBlock("div",GS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(O.dbAttrs,(be,et)=>{var Yo,Wo,qo,Xo,Jo,Zo,Qo;return n.openBlock(),n.createElementBlock("div",{key:be.modelId,class:"em-embed-col"},[n.createElementVNode("span",jS,n.toDisplayString(((Yo=M(O,et))==null?void 0:Yo.name)??((Wo=M(O,et))==null?void 0:Wo.physicalName)??n.unref(o).t("em.attr.colFallback",{n:et+1})),1),n.createElementVNode("div",KS,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`embed-col-${be.modelId}`,width:"100%",disabled:A(be),placeholder:((qo=M(O,et))==null?void 0:qo.physicalName)??n.unref(o).t("em.attr.columnPlaceholder"),"model-value":A(be)?Y(be):be.physicalName,"onUpdate:modelValue":Me=>H(O,et,{physicalName:Me})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSTextInput),{name:`embed-dtype-${be.modelId}`,width:"84px",disabled:"","model-value":T(O,et)},null,8,["name","model-value"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`embed-len-${be.modelId}`,width:"48px",disabled:"","model-value":ne(O,et)},null,8,["name","model-value"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`embed-scale-${be.modelId}`,width:"48px",disabled:"","model-value":de(O,et)},null,8,["name","model-value"])]),n.createVNode(_n,{controller:n.unref(o),"ref-id":be.modelId},null,8,["controller","ref-id"]),n.createElementVNode("div",YS,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`embed-logical-${be.modelId}`,width:"100%",placeholder:((Jo=(Xo=M(O,et))==null?void 0:Xo.logicalName)==null?void 0:Jo.ko)??n.unref(o).t("em.attr.logicalPlaceholder"),"model-value":((Zo=be.logicalName)==null?void 0:Zo.ko)??"","onUpdate:modelValue":Me=>C(O,et,"ko",Me)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),(Qo=M(O,et))!=null&&Qo.shareable?(n.openBlock(),n.createElementBlock("label",WS,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.currencyColumn")),1),n.createVNode(n.unref(ie.BSSelect),{width:"110px","model-value":te(be),items:j(),"value-provider":k,"label-provider":Z,"onUpdate:modelValue":Me=>Me&&v(O,et,Me)},null,8,["model-value","items","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",qS,[U[3]||(U[3]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px",disabled:A(be),"model-value":A(be)?"false":lt(be),items:Le,"value-provider":k,"label-provider":je,"onUpdate:modelValue":Me=>Me&&x(O,et,Me)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",XS,[U[4]||(U[4]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px",disabled:A(be),"model-value":A(be)?"false":ve(be),items:Ee,"value-provider":k,"label-provider":ye,"onUpdate:modelValue":Me=>Me&&Te(O,et,Me)},null,8,["disabled","model-value","onUpdate:modelValue"])])])}),128))])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("div",DS,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-logical-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.logicalPlaceholder"),"model-value":((Ne=(le=O.dbAttrs[0])==null?void 0:le.logicalName)==null?void 0:Ne.ko)??"","onUpdate:modelValue":be=>R(O,"ko",be)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("div",OS,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-col-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.columnPlaceholder"),disabled:$(O),"model-value":((se=O.dbAttrs[0])==null?void 0:se.physicalName)??"","onUpdate:modelValue":be=>_(O,{physicalName:be})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSSelect),{name:`attr-dtype-${O.modelId}`,width:"84px",placeholder:"dataType",disabled:$(O),items:n.unref(Vl)(((Re=O.dbAttrs[0])==null?void 0:Re.dataType)??"",n.unref(o).selectableDataTypes.value),"value-provider":k,"label-provider":n.unref(La),"model-value":((De=O.dbAttrs[0])==null?void 0:De.dataType)??"","onUpdate:modelValue":be=>be&&_(O,{dataType:be})},null,8,["name","disabled","items","label-provider","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`attr-len-${O.modelId}`,width:"48px",placeholder:"len",disabled:$(O),"model-value":(Ue=O.dbAttrs[0])==null?void 0:Ue.length,"onUpdate:modelValue":be=>_(O,{length:be||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`attr-scale-${O.modelId}`,width:"48px",placeholder:"scale",disabled:$(O)||!W(O),"model-value":(Qe=O.dbAttrs[0])==null?void 0:Qe.scale,"onUpdate:modelValue":be=>_(O,{scale:be||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createVNode(_n,{controller:n.unref(o),"ref-id":(Ke=O.dbAttrs[0])==null?void 0:Ke.modelId},null,8,["controller","ref-id"]),n.createElementVNode("div",PS,[n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-pk-${O.modelId}`,label:"Primary Key","model-value":O.identifier,disabled:r.value||$(O),"onUpdate:modelValue":be=>q(O,be)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-nn-${O.modelId}`,label:"Not Null","model-value":O.notNull,disabled:$(O),"onUpdate:modelValue":be=>E(O,{notNull:be})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-uq-${O.modelId}`,label:"Unique","model-value":!!((Ye=O.dbAttrs[0])!=null&&Ye.unique),disabled:$(O),"onUpdate:modelValue":be=>_(O,{unique:be})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-ai-${O.modelId}`,label:"Auto Increment","model-value":!!((At=O.dbAttrs[0])!=null&&At.autoIncrement),disabled:$(O)||!O.identifier,"onUpdate:modelValue":be=>_(O,{autoIncrement:be})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-tr-${O.modelId}`,label:"@Transient","model-value":!!O.transient,disabled:O.identifier,"onUpdate:modelValue":be=>D(O,be)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-nid-${O.modelId}`,label:"@NaturalId","model-value":!!O.naturalId,disabled:O.identifier||$(O),"onUpdate:modelValue":be=>X(O,be)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{class:"em-attr__flag-sub",name:`attr-nidm-${O.modelId}`,label:"mutable","model-value":!!O.naturalIdMutable,disabled:$(O)||!O.naturalId,"onUpdate:modelValue":be=>E(O,{naturalIdMutable:be||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-mv-${O.modelId}`,label:"Multi-Value (Set)","model-value":!!((Qt=O.dbAttrs[0])!=null&&Qt.multiValue),disabled:$(O),"onUpdate:modelValue":be=>_(O,{multiValue:be||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("label",LS,[U[1]||(U[1]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"100%",disabled:$(O),"model-value":lt(O.dbAttrs[0]),items:Le,"value-provider":k,"label-provider":je,"onUpdate:modelValue":be=>be&&F(O,be)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",zS,[U[2]||(U[2]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"100%",disabled:$(O),"model-value":ve(O.dbAttrs[0]),items:Ee,"value-provider":k,"label-provider":ye,"onUpdate:modelValue":be=>be&&Ve(O,be)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",US,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.pii")),1),n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":ee(O),items:y,"value-provider":k,"label-provider":b,"onUpdate:modelValue":be=>be&&ae(O,be)},null,8,["model-value","onUpdate:modelValue"])]),ue.value.length?(n.openBlock(),n.createElementBlock("label",HS,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.codeGroup")),1),n.createVNode(bu,{"model-value":O.groupCode,items:ue.value,locale:n.unref(o).uiLocale.value,"onUpdate:modelValue":be=>me(O,be)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",{class:n.normalizeClass(["em-attr__pii",{"em-attr__codetop":!ue.value.length}])},[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.defaultValue")),1),he(O).length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"100%","model-value":O.defaultValue??"none",items:we(O),"value-provider":Se,"label-provider":Ie,"onUpdate:modelValue":be=>be&&ge(O,be)},null,8,["model-value","items","onUpdate:modelValue"])):(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:1,name:`attr-default-${O.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.defaultValue"),"model-value":O.defaultValue??"","onUpdate:modelValue":be=>ke(O,be)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))],2),n.createElementVNode("fieldset",FS,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(o).t("em.common.description")),1),n.createVNode(Ur,{multiline:"",name:`attr-desc-${O.modelId}`,languages:n.unref(o).languages.value,"default-lang":n.unref(o).userLanguage.value,"model-value":O.description,"onUpdate:modelValue":be=>J(O,be)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)),n.createElementVNode("div",JS,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":g(O)===null}]),title:n.unref(o).t("em.swatch.none"),onClick:be=>h(O,null)},"∅",10,ZS),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),be=>(n.openBlock(),n.createElementBlock("button",{key:be,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":g(O)===be}]),style:n.normalizeStyle({background:n.unref(Yn)(be)}),title:n.unref(Kn)(be),onClick:et=>h(O,be)},null,14,QS))),128)),w(O)?(n.openBlock(),n.createElementBlock("span",e$,n.toDisplayString(n.unref(o).t("em.attr.batchHint",{n:l.value.size})),1)):n.createCommentVNode("",!0)])],10,TS)}),128))],8,NS)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-7d18aba6"]]),n$=["disabled"],o$={class:"em-panel__sub-label"},i$={class:"em-attr__row"},a$={class:"em-field em-idx-params"},r$=["value","placeholder","onChange"],l$=Pe(n.defineComponent({__name:"EntityIndexSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean}},emits:["toggle"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,r=n.computed(()=>a.state.logical.entities.find(b=>b.modelId===o.entityId)??null),l=n.computed(()=>r.value?oo(r.value,a.superClassCatalog.value):[]),s=n.computed(()=>{var b;return[...(((b=r.value)==null?void 0:b.attributes)??[]).map(k=>({value:k.modelId,label:k.name})),...l.value.map(k=>({value:k.modelId,label:a.t("em.index.inherited",{field:k.field})}))]});function c(){var k;if(!r.value)return;const b=r.value.attributes[0];a.addIndex(r.value.modelId,{modelId:Be(),name:`idx_${(((k=r.value.indexes)==null?void 0:k.length)??0)+1}`,unique:!1,columns:b?[{columnRef:b.modelId,descending:!1}]:[]})}function d(b,k){r.value&&a.updateIndex(r.value.modelId,b,k)}function u(b){var g;const k=(g=r.value)==null?void 0:g.attributes[0];k&&d(b.modelId,{columns:[...b.columns,{columnRef:k.modelId,descending:!1}]})}function m(b,k,g){d(b.modelId,{columns:b.columns.map((w,h)=>h===k?{...w,columnRef:g}:w)})}function p(b,k,g){d(b.modelId,{columns:b.columns.map((w,h)=>h===k?{...w,descending:g}:w)})}function f(b,k){d(b.modelId,{columns:b.columns.filter((g,w)=>w!==k)})}function y(b,k){d(b.modelId,{parameters:k.trim()===""?void 0:k})}return(b,k)=>{var g;return r.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!n.unref(a).editable.value},[n.createElementVNode("h4",{class:n.normalizeClass(["em-panel__sub",{"em-panel__sub--toggle":e.collapsible}]),onClick:k[0]||(k[0]=w=>e.collapsible&&i("toggle"))},[n.createElementVNode("span",o$,[e.collapsible?(n.openBlock(),n.createBlock($e,{key:0,name:"chevron",size:13,class:n.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"])):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(n.unref(a).t("em.index.section",{n:((g=r.value.indexes)==null?void 0:g.length)??0})),1)]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(a).t("em.common.add"),onClick:n.withModifiers(c,["stop"])},null,8,["caption"])],2),!e.collapsible||!e.collapsed?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(r.value.indexes??[],w=>(n.openBlock(),n.createElementBlock("div",{key:w.modelId,class:"em-attr"},[n.createElementVNode("div",i$,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`idx-name-${w.modelId}`,width:"100%",placeholder:n.unref(a).t("em.index.namePlaceholder"),"model-value":w.name,"onUpdate:modelValue":h=>d(w.modelId,{name:h})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`idx-uq-${w.modelId}`,class:"em-check",label:"UQ","model-value":w.unique,"onUpdate:modelValue":h=>d(w.modelId,{unique:h})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:h=>n.unref(a).removeIndex(r.value.modelId,w.modelId)},null,8,["onClick"])]),n.createVNode(_n,{controller:n.unref(a),"ref-id":w.modelId},null,8,["controller","ref-id"]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(w.columns,(h,E)=>(n.openBlock(),n.createElementBlock("div",{key:E,class:"em-attr__row"},[n.createVNode(n.unref(ie.BSSelect),{class:"grow","model-value":h.columnRef,items:s.value,"value-provider":X=>X.value,"label-provider":X=>X.label,"onUpdate:modelValue":X=>X&&m(w,E,X)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`idx-${w.modelId}-desc-${E}`,class:"em-check",label:"DESC","model-value":h.descending,"onUpdate:modelValue":X=>p(w,E,X)},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"−",onClick:X=>f(w,E)},null,8,["onClick"])]))),128)),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(a).t("em.index.addColumn"),onClick:h=>u(w)},null,8,["caption","onClick"]),n.createElementVNode("label",a$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.index.condition")),1),n.createElementVNode("textarea",{class:"em-textarea",value:w.parameters??"",rows:"2",placeholder:n.unref(a).t("em.index.conditionPlaceholder"),onChange:h=>y(w,h.target.value)},null,40,r$)])]))),128)):n.createCommentVNode("",!0)],8,n$)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-d883aded"]]),s$=["disabled"],c$={class:"em-panel__sub-label"},d$={class:"em-attr__row"},u$={class:"em-attr__row"},m$={class:"em-multilang"},f$={class:"em-attr__pii"},p$={class:"em-swatch__row em-attr__swatch"},h$=["title","onClick"],y$=["title","onClick"],g$=Pe(n.defineComponent({__name:"EntityOperationsSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean}},emits:["toggle"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,r=ie.useModal(),l=n.computed(()=>a.state.logical.entities.find(h=>h.modelId===o.entityId)??null),s=n.computed(()=>l.value?a.state.layout.entityLayouts.find(h=>h.entityRef===l.value.modelId)??null:null),c=["PUBLIC","PROTECTED","PACKAGE","PRIVATE"],d=["none","PASSWORD","SOCIAL_SECURITY_NO","PASSPORT_NO","ALIEN_REGISTRATION_NO","DRIVERS_LICENSE_NO","BIOMETRICS","CREDITCARD_NO","ACCOUNT_NO","MEMBERSHIP_CARD_NO","ID","NAME","DATE_OF_BIRTH","PHONE_NO","EMAIL_ADDRESS","ADDRESS","IP_ADDRESS"];function u(h){return h==="none"?a.t("em.common.noneParen"):h}const m=h=>h;function p(h,E){l.value&&a.updateOperation(l.value.modelId,h.modelId,E)}function f(h,E){p(h,{description:Object.keys(E).length?E:void 0})}function y(h){return h.personalInfoAttributeType??"none"}function b(h,E){p(h,{personalInfoAttributeType:E==="none"?void 0:E})}function k(h){var E,X;return it((X=(E=s.value)==null?void 0:E.operationStyles)==null?void 0:X[h.modelId])}function g(h,E){l.value&&a.setOperationSwatch(l.value.modelId,h.modelId,E)}function w(h){r.openModal({component:_u,bind:{operationName:h.name,sourceCode:h.sourceCode??"",locale:a.uiLocale.value,onSave:E=>p(h,{sourceCode:E})}})}return(h,E)=>{var X;return l.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!n.unref(a).editable.value},[n.createElementVNode("h4",{class:n.normalizeClass(["em-panel__sub",{"em-panel__sub--toggle":e.collapsible}]),onClick:E[1]||(E[1]=z=>e.collapsible&&i("toggle"))},[n.createElementVNode("span",c$,[e.collapsible?(n.openBlock(),n.createBlock($e,{key:0,name:"chevron",size:13,class:n.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"])):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(n.unref(a).t("em.op.section",{n:((X=l.value.operations)==null?void 0:X.length)??0})),1)]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(a).t("em.common.add"),onClick:E[0]||(E[0]=n.withModifiers(z=>n.unref(a).addOperation(l.value.modelId),["stop"]))},null,8,["caption"])],2),!e.collapsible||!e.collapsed?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(l.value.operations??[],z=>(n.openBlock(),n.createElementBlock("div",{key:z.modelId,class:"em-attr"},[n.createElementVNode("div",d$,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`op-name-${z.modelId}`,width:"100%",placeholder:n.unref(a).t("em.op.namePlaceholder"),"model-value":z.name,"onUpdate:modelValue":q=>p(z,{name:q})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSSelect),{width:"96px","model-value":z.visibility??"PACKAGE",items:c,"value-provider":m,"label-provider":m,"onUpdate:modelValue":q=>q&&p(z,{visibility:q})},null,8,["model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:q=>n.unref(a).removeOperation(l.value.modelId,z.modelId)},null,8,["onClick"])]),n.createElementVNode("div",u$,[n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(a).t(z.sourceCode?"em.op.editBodyDirty":"em.op.editBody"),onClick:q=>w(z)},null,8,["caption","onClick"])]),n.createElementVNode("fieldset",m$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.common.description")),1),n.createVNode(Ur,{multiline:"",name:`op-desc-${z.modelId}`,languages:n.unref(a).languages.value,"default-lang":n.unref(a).userLanguage.value,"model-value":z.description,"onUpdate:modelValue":q=>f(z,q)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",f$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.attr.pii")),1),n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":y(z),items:d,"value-provider":m,"label-provider":u,"onUpdate:modelValue":q=>q&&b(z,q)},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("div",p$,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":k(z)===null}]),title:n.unref(a).t("em.swatch.none"),onClick:q=>g(z,null)},"∅",10,h$),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),q=>(n.openBlock(),n.createElementBlock("button",{key:q,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":k(z)===q}]),style:n.normalizeStyle({background:n.unref(Yn)(q)}),title:n.unref(Kn)(q),onClick:D=>g(z,q)},null,14,y$))),128))])]))),128)):n.createCommentVNode("",!0)],8,s$)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-394829bc"]]),b$=["title"],_$={class:"em-panel__head"},k$={class:"em-panel__head-row"},E$=["title"],w$={class:"em-panel__context"},N$={key:0,class:"em-panel__lock"},v$=["disabled"],x$={key:0,class:"em-panel__note"},C$={key:1,class:"em-panel__note"},I$={key:2,class:"em-jpa"},S$={class:"em-field"},$$={class:"em-field"},R$={class:"em-field"},A$={key:0,class:"em-field"},T$={class:"em-panel__note"},V$={class:"em-panel__sub"},M$={class:"em-field"},B$={class:"em-jpa"},D$={key:0,class:"em-panel__note"},O$={class:"em-jpa"},P$={class:"em-field"},L$={key:0,class:"em-panel__note"},z$={class:"em-field"},U$={class:"em-multilang"},H$={class:"em-field"},F$=["value"],G$={class:"em-field"},j$={class:"em-swatch"},K$={class:"em-swatch__row"},Y$=["title"],W$=["title","onClick"],q$={class:"em-panel__note"},X$={class:"em-field"},J$=["value"],Z$={class:"em-swatch"},Q$={class:"em-swatch__row"},eR=["title"],tR=["title","onClick"],Hm=Pe(n.defineComponent({__name:"PropertyPanel",props:{controller:{},width:{},resizing:{type:Boolean},startResize:{type:Function}},emits:["collapse"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,r=n.computed(()=>a.selection.value),l=n.computed(()=>a.inspectedEntityId.value),s=n.computed(()=>{const C=l.value;return C?a.state.logical.entities.find(M=>M.modelId===C)??null:null}),c=n.computed(()=>{const C=r.value;if((C==null?void 0:C.kind)==="association"){const T=a.state.logical.associations.find(ne=>ne.modelId===C.id);return!!T&&(a.isEntityLocked(T.end1.entityRef)||a.isEntityLocked(T.end2.entityRef))}const M=l.value;return!!M&&a.isEntityLocked(M)}),d=n.computed(()=>{var C;return((C=a.selectedAttr.value)==null?void 0:C.attrId)??null}),u=n.computed(()=>new Set(a.selectedAttrIds.value)),m=n.computed(()=>d.value!==null),p=n.ref({});n.watch(m,()=>{p.value={}});function f(C){return p.value[C]??m.value}function y(C){p.value={...p.value,[C]:!f(C)}}const b=n.computed(()=>{var T;const C=s.value;if(!C)return a.t("em.entity.fallback");const M=(T=C.table)==null?void 0:T.physicalName;return M?`${C.name} (${M})`:C.name}),k=n.computed(()=>{const C=r.value;return(C==null?void 0:C.kind)==="association"?a.state.logical.associations.find(M=>M.modelId===C.id)??null:null}),g=n.computed(()=>{const C=r.value;return(C==null?void 0:C.kind)==="group"?a.state.logical.groups.find(M=>M.modelId===C.id)??null:null}),w=n.computed(()=>{const C=r.value;return(C==null?void 0:C.kind)==="note"?a.state.layout.notes.find(M=>M.modelId===C.id)??null:null}),h=n.computed(()=>{var M,T;const C=(M=g.value)==null?void 0:M.name;return(C==null?void 0:C.ko)||(C==null?void 0:C.en)||(C==null?void 0:C.ja)||(C==null?void 0:C.zh)||((T=g.value)==null?void 0:T.packageName)||a.t("em.group.fallback")}),E=n.computed(()=>{if(s.value){const C=u.value.size;if(C>1)return a.t("em.inspector.ctxEntityAttrs",{name:s.value.name,n:C});if(d.value){const M=s.value.attributes.find(T=>T.modelId===d.value);return(M==null?void 0:M.attrType)==="DIVIDER"?a.t("em.inspector.ctxEntityDivider",{name:s.value.name}):a.t("em.inspector.ctxEntityAttr",{name:s.value.name,attr:(M==null?void 0:M.name)??""})}return a.t("em.inspector.ctxEntity",{name:s.value.name})}if(k.value){const C=M=>{var T;return((T=a.state.logical.entities.find(ne=>ne.modelId===M))==null?void 0:T.name)??M};return a.t("em.inspector.ctxAssoc",{a:C(k.value.end1.entityRef),b:C(k.value.end2.entityRef)})}return g.value?a.t("em.inspector.ctxGroup",{name:h.value}):w.value?a.t("em.inspector.ctxNote"):a.t("em.inspector.ctxNone")}),X=["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"],z=["EXACTLY_ONE_INSTANCE","NO_INSTANCE_OR_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES"],q={EXACTLY_ONE_INSTANCE:"em.embed.card1",NO_INSTANCE_OR_ONE_INSTANCE:"em.embed.card01",ZERO_OR_MORE_INSTANCES:"em.embed.card0N"},D=C=>{const M=q[C];return M?a.t(M):C},$=C=>{var M;return((M=a.state.logical.entities.find(T=>T.modelId===C))==null?void 0:M.name)??C},B=["ALL","PERSIST","MERGE","REMOVE","REFRESH","DETACH"],Q=["LIST","SET"],V=["inherit","LAZY","EAGER"],re=C=>C;function _(C){return C==="inherit"?a.t("em.common.inherit"):C}const W=n.computed(()=>!!k.value&&k.value.end1.entityRef===k.value.end2.entityRef);function R(C,M){k.value&&a.updateAssociationEnd(k.value.modelId,C,M)}function J(C){k.value&&!W.value&&a.setAssociationIdentifying(k.value.modelId,C)}function ee(C){var M,T,ne;return!!((ne=(T=(M=k.value)==null?void 0:M[C].jpa)==null?void 0:T.cascadeTypes)!=null&&ne.includes("ALL"))}function ae(C,M,T){var Ee,ye;const ne=(Ee=k.value)==null?void 0:Ee[C];if(M==="ALL"&&T){R(C,{jpa:{...ne==null?void 0:ne.jpa,cascadeTypes:["ALL"]}});return}const de=new Set(((ye=ne==null?void 0:ne.jpa)==null?void 0:ye.cascadeTypes)??[]);T?de.add(M):de.delete(M),R(C,{jpa:{...ne==null?void 0:ne.jpa,cascadeTypes:[...de]}})}function I(C,M){var ne;const T=(ne=k.value)==null?void 0:ne[C];R(C,{jpa:{...T==null?void 0:T.jpa,...M}})}function K(C){var M,T;return((T=(M=k.value)==null?void 0:M[C].jpa)==null?void 0:T.fetchType)??"inherit"}function oe(C,M){I(C,{fetchType:M==="inherit"?void 0:M})}function pe(C){var T;const M=(T=k.value)==null?void 0:T[C==="end1"?"end2":"end1"];return(M==null?void 0:M.multiplicity)==="ZERO_OR_MORE_INSTANCES"||(M==null?void 0:M.multiplicity)==="ONE_OR_MORE_INSTANCES"}const fe=n.computed(()=>{const C=k.value;if(!C)return null;for(const M of a.state.logical.entities){const T=M.attributes.find(ye=>{var ve;return((ve=ye.embedded)==null?void 0:ve.associationRef)===C.modelId&&ye.attrType==="EMBED_OWN"});if(!T)continue;const ne=C.end2.entityRef===T.embedded.embeddableRef?"end2":"end1",de=C[ne].multiplicity,Ee=C[ne].jpa;return{which:ne,cardinality:de,isCollection:de==="ZERO_OR_MORE_INSTANCES"||de==="ONE_OR_MORE_INSTANCES",collectionType:(Ee==null?void 0:Ee.collectionType)??"LIST",collectionTable:(Ee==null?void 0:Ee.collectionTable)??"",orderColumn:(Ee==null?void 0:Ee.orderColumn)??""}}return null});function ce(C){k.value&&a.setEmbedCardinality(k.value.modelId,C)}function ue(C){const M=fe.value;M&&I(M.which,C==="SET"?{collectionType:"SET",orderColumn:void 0}:{collectionType:"LIST"})}function he(C){const M=fe.value;M&&I(M.which,{collectionTable:C.trim()||void 0})}function we(C){const M=fe.value;M&&I(M.which,{orderColumn:C.trim()||void 0})}function Se(C){g.value&&a.updateGroup(g.value.modelId,C)}function Ie(C,M){var T;Se({name:{...(T=g.value)==null?void 0:T.name,[C]:M}})}const me=n.computed(()=>{var C;return g.value?it((C=a.state.layout.groupLayouts.find(M=>M.groupRef===g.value.modelId))==null?void 0:C.style):null});function ge(C){g.value&&a.setGroupSwatch(g.value.modelId,C)}function ke(C){w.value&&a.setNoteMemo(w.value.modelId,C)}const G=n.computed(()=>{var C;return it((C=w.value)==null?void 0:C.style)});function H(C){w.value&&a.setNoteSwatch(w.value.modelId,C)}return(C,M)=>(n.openBlock(),n.createElementBlock("aside",{class:"em-panel",style:n.normalizeStyle({width:e.width+"px"})},[n.createElementVNode("div",{class:n.normalizeClass(["em-resize-handle em-resize-handle--left",{"is-dragging":e.resizing}]),title:n.unref(a).t("em.panel.resizeWidth"),onPointerdown:M[0]||(M[0]=(...T)=>e.startResize&&e.startResize(...T))},null,42,b$),n.createElementVNode("header",_$,[n.createElementVNode("div",k$,[M[14]||(M[14]=n.createElementVNode("h3",{class:"em-panel__title"},"Inspector",-1)),n.createElementVNode("button",{type:"button",class:"em-panel__btn",title:n.unref(a).t("em.panel.collapse"),onClick:M[1]||(M[1]=T=>i("collapse"))},[n.createVNode($e,{name:"panel-right-close",size:16})],8,E$)]),n.createElementVNode("p",w$,n.toDisplayString(E.value),1),c.value&&l.value?(n.openBlock(),n.createElementBlock("div",N$,[n.createVNode($e,{name:"lock",size:13}),n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.panel.lockedBanner")),1),n.unref(a).editable.value?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"em-panel__unlock",onClick:M[2]||(M[2]=T=>n.unref(a).setEntityLocked(l.value,!1))},n.toDisplayString(n.unref(a).t("em.panel.unlock")),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),n.createElementVNode("fieldset",{class:"em-panel__body em-scroll-overlay",disabled:!n.unref(a).editable.value||c.value},[s.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createVNode(fu,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:f("basics"),title:b.value,onToggle:M[3]||(M[3]=T=>y("basics"))},null,8,["controller","entity-id","collapsed","title"]),n.createVNode(t$,{controller:n.unref(a),"entity-id":s.value.modelId},null,8,["controller","entity-id"]),n.createVNode(l$,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:f("index"),onToggle:M[4]||(M[4]=T=>y("index"))},null,8,["controller","entity-id","collapsed"]),n.createVNode(g$,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:f("ops"),onToggle:M[5]||(M[5]=T=>y("ops"))},null,8,["controller","entity-id","collapsed"])],64)):n.createCommentVNode("",!0),k.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createVNode(n.unref(ie.BSCheckbox),{name:"assoc-identifying",class:"em-check",label:n.unref(a).t("em.assoc.identifying"),"model-value":!!k.value.identifying,disabled:W.value||!!fe.value,"onUpdate:modelValue":J},null,8,["label","model-value","disabled"]),W.value?(n.openBlock(),n.createElementBlock("p",x$,n.toDisplayString(n.unref(a).t("em.assoc.selfNoIdentifying")),1)):fe.value?(n.openBlock(),n.createElementBlock("p",C$,n.toDisplayString(n.unref(a).t("em.assoc.embedNoIdentifying")),1)):n.createCommentVNode("",!0),fe.value?(n.openBlock(),n.createElementBlock("fieldset",I$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.embed.legend")),1),n.createElementVNode("label",S$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.embed.cardinality")),1),n.createVNode(n.unref(ie.BSSelect),{"model-value":fe.value.cardinality,items:z,"value-provider":re,"label-provider":D,"onUpdate:modelValue":M[6]||(M[6]=T=>T&&ce(T))},null,8,["model-value"])]),fe.value.isCollection?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("label",$$,[M[15]||(M[15]=n.createElementVNode("span",null,"collectionType",-1)),n.createVNode(n.unref(ie.BSSelect),{"model-value":fe.value.collectionType,items:Q,"value-provider":re,"label-provider":re,"onUpdate:modelValue":M[7]||(M[7]=T=>T&&ue(T))},null,8,["model-value"])]),n.createElementVNode("label",R$,[M[16]||(M[16]=n.createElementVNode("span",null,"collectionTable",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"embed-coll-table",width:"100%",placeholder:n.unref(a).t("em.embed.collectionTablePlaceholder"),"model-value":fe.value.collectionTable,"onUpdate:modelValue":he},null,8,["placeholder","model-value"])]),fe.value.collectionType==="LIST"?(n.openBlock(),n.createElementBlock("label",A$,[M[17]||(M[17]=n.createElementVNode("span",null,"orderColumn",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"embed-order-col",width:"100%",placeholder:n.unref(a).t("em.embed.orderColumnPlaceholder"),"model-value":fe.value.orderColumn,"onUpdate:modelValue":we},null,8,["placeholder","model-value"])])):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0),n.createElementVNode("p",T$,n.toDisplayString(n.unref(a).t("em.embed.ownerFixedNote")),1)])):n.createCommentVNode("",!0),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(["end1","end2"],T=>{var ne,de,Ee;return n.withDirectives(n.createElementVNode("div",{key:T,class:"em-end"},[n.createElementVNode("h4",V$,n.toDisplayString(T)+" → "+n.toDisplayString($(k.value[T].entityRef)),1),fe.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("label",M$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.assoc.multiplicity")),1),n.createVNode(n.unref(ie.BSSelect),{"model-value":k.value[T].multiplicity,items:X,"value-provider":re,"label-provider":re,"onUpdate:modelValue":ye=>R(T,{multiplicity:ye})},null,8,["model-value","onUpdate:modelValue"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:`${T}-navigable`,class:"em-check",label:"navigable","model-value":k.value[T].navigable,"onUpdate:modelValue":ye=>R(T,{navigable:ye})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`${T}-composition`,class:"em-check",label:"composition","model-value":k.value[T].composition,"onUpdate:modelValue":ye=>R(T,{composition:ye})},null,8,["name","model-value","onUpdate:modelValue"])],64)),n.createElementVNode("fieldset",B$,[M[18]||(M[18]=n.createElementVNode("legend",null,"cascade",-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(B,ye=>{var ve,Te;return n.createVNode(n.unref(ie.BSCheckbox),{key:ye,name:`${T}-cascade-${ye}`,class:"em-check",label:ye,"model-value":!!((Te=(ve=k.value[T].jpa)==null?void 0:ve.cascadeTypes)!=null&&Te.includes(ye)),disabled:ye!=="ALL"&&ee(T),"onUpdate:modelValue":Ve=>ae(T,ye,Ve)},null,8,["name","label","model-value","disabled","onUpdate:modelValue"])}),64)),ee(T)?(n.openBlock(),n.createElementBlock("p",D$,n.toDisplayString(n.unref(a).t("em.assoc.cascadeAllNote")),1)):n.createCommentVNode("",!0)]),n.createElementVNode("fieldset",O$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.assoc.jpaDetails")),1),n.createElementVNode("label",P$,[M[19]||(M[19]=n.createElementVNode("span",null,"fetchType",-1)),n.createVNode(n.unref(ie.BSSelect),{"model-value":K(T),items:V,"value-provider":re,"label-provider":_,"onUpdate:modelValue":ye=>ye&&oe(T,ye)},null,8,["model-value","onUpdate:modelValue"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:`${T}-orphan`,class:"em-check",label:"orphanRemoval","model-value":!!((ne=k.value[T].jpa)!=null&&ne.orphanRemoval),disabled:pe(T),"onUpdate:modelValue":ye=>I(T,{orphanRemoval:ye})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),pe(T)&&((de=k.value[T].jpa)!=null&&de.orphanRemoval)?(n.openBlock(),n.createElementBlock("p",L$,n.toDisplayString(n.unref(a).t("em.assoc.orphanRemovalNote")),1)):n.createCommentVNode("",!0),n.createElementVNode("label",z$,[M[20]||(M[20]=n.createElementVNode("span",null,"orderBy",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:`${T}-orderby`,width:"100%",placeholder:n.unref(a).t("em.assoc.orderByPlaceholder"),"model-value":((Ee=k.value[T].jpa)==null?void 0:Ee.orderBy)??"","onUpdate:modelValue":ye=>I(T,{orderBy:ye.trim()||void 0})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])])])]),[[n.vShow,!fe.value||T===fe.value.which]])}),64))],64)):n.createCommentVNode("",!0),g.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("fieldset",U$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.group.nameLegend")),1),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a).languages.value,T=>{var ne;return n.openBlock(),n.createElementBlock("label",{key:T,class:"em-lang"},[n.createElementVNode("span",null,n.toDisplayString(T),1),n.createVNode(n.unref(ie.BSTextInput),{name:`grp-name-${T}`,width:"100%","model-value":((ne=g.value.name)==null?void 0:ne[T])??"","onUpdate:modelValue":de=>Ie(T,de)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),n.createElementVNode("label",H$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.common.description")),1),n.createElementVNode("textarea",{class:"em-textarea",value:g.value.description??"",rows:"3",onChange:M[8]||(M[8]=T=>Se({description:T.target.value}))},null,40,F$)]),n.createElementVNode("label",G$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.package")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"grp-package",width:"100%","model-value":g.value.packageName??"","onUpdate:modelValue":M[9]||(M[9]=T=>Se({packageName:T}))},null,8,["model-value"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"grp-exclude-ddl",class:"em-check",label:n.unref(a).t("em.group.excludeDDL"),"model-value":g.value.excludeDDLGeneration,"onUpdate:modelValue":M[10]||(M[10]=T=>Se({excludeDDLGeneration:T}))},null,8,["label","model-value"]),n.createElementVNode("fieldset",j$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.common.color")),1),n.createElementVNode("div",K$,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":me.value===null}]),title:n.unref(a).t("em.swatch.none"),onClick:M[11]||(M[11]=T=>ge(null))},"∅",10,Y$),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),T=>(n.openBlock(),n.createElementBlock("button",{key:T,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":me.value===T}]),style:n.normalizeStyle({background:n.unref(Yn)(T)}),title:n.unref(Kn)(T),onClick:ne=>ge(T)},null,14,W$))),128))])]),n.createElementVNode("p",q$,n.toDisplayString(n.unref(a).t("em.group.members",{n:g.value.memberEntityRefs.length})),1)],64)):n.createCommentVNode("",!0),w.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("label",X$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.common.memo")),1),n.createElementVNode("textarea",{class:"em-textarea",value:w.value.memo,rows:"6",onChange:M[12]||(M[12]=T=>ke(T.target.value))},null,40,J$)]),n.createElementVNode("fieldset",Z$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.common.color")),1),n.createElementVNode("div",Q$,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":G.value===null}]),title:n.unref(a).t("em.swatch.none"),onClick:M[13]||(M[13]=T=>H(null))},"∅",10,eR),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),T=>(n.openBlock(),n.createElementBlock("button",{key:T,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":G.value===T}]),style:n.normalizeStyle({background:n.unref(Yn)(T)}),title:n.unref(Kn)(T),onClick:ne=>H(T)},null,14,tR))),128))])])],64)):n.createCommentVNode("",!0)],8,v$)],4))}}),[["__scopeId","data-v-4a891fbf"]]),nR=["title"],oR={class:"em-validation__title"},iR=["title","onClick"],aR={key:0,class:"em-validation__body"},rR={class:"em-validation__opt"},lR={key:0,class:"em-validation__empty"},sR={key:1,class:"em-validation__empty"},cR={key:2,class:"em-validation__list"},dR=["onClick"],uR={class:"em-validation__item-msg"},mR={key:0,class:"em-validation__item-entity"},fR=["title"],pR=Pe(n.defineComponent({__name:"ValidationPanel",props:{controller:{},panelWidth:{},inspectorOpen:{type:Boolean,default:!0}},setup(e){const o=e.controller,i=n.computed(()=>o.issues.value),a=n.computed(()=>{const b=new Map;for(const k of o.state.logical.entities)b.set(k.modelId,k.name);return b});function r(b){const k=R0(b);if(!k)return null;const g=a.value.get(k);return g===void 0?null:g.trim()===""?o.t("em.validation.nameless"):g}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=n.computed(()=>{const b={error:0,warning:0,info:0};for(const k of i.value)b[k.severity]++;return b}),c=n.ref({error:!0,warning:!0,info:!0}),d=n.computed(()=>i.value.filter(b=>c.value[b.severity]).slice().sort((b,k)=>l[b.severity].order-l[k.severity].order)),u=n.computed(()=>d.value.map(b=>({issue:b,entityName:r(b),message:mu(o.t,b),category:S0(o.t,b.ruleId)}))),m=n.ref(!1);function p(b){c.value[b]=!c.value[b]}function f(b){if(!m.value){m.value=!0;return}p(b)}function y(b){b.targetRef&&o.requestFocus(b.targetRef)}return(b,k)=>(n.openBlock(),n.createElementBlock("section",{class:n.normalizeClass(["em-validation",{"is-open":m.value,"is-inspector-collapsed":!e.inspectorOpen}]),style:n.normalizeStyle(m.value||!e.inspectorOpen?void 0:{width:e.panelWidth+"px"})},[n.createElementVNode("header",{class:"em-validation__head",onClick:k[1]||(k[1]=g=>m.value=!m.value)},[n.createElementVNode("button",{type:"button",class:"em-validation__toggle",title:n.unref(o).t(m.value?"em.panel.collapse":"em.panel.expand")},[n.createVNode($e,{name:"chevron",size:14,class:n.normalizeClass([{"is-open":m.value},"em-validation__chevron"])},null,8,["class"]),n.createElementVNode("span",oR,n.toDisplayString(n.unref(o).t("em.validation.title")),1)],8,nR),n.createElementVNode("div",{class:"em-validation__counts",onClick:k[0]||(k[0]=n.withModifiers(()=>{},["stop"]))},[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(["error","warning","info"],g=>n.createElementVNode("button",{key:g,type:"button",class:n.normalizeClass(["em-validation__count",[`is-${g}`,{"is-off":!c.value[g]}]]),title:m.value?n.unref(o).t(c.value[g]?"em.validation.hideSeverity":"em.validation.showSeverity",{label:n.unref(o).t(l[g].labelKey)}):n.unref(o).t("em.validation.expandPanel"),onClick:w=>f(g)},[n.createVNode($e,{name:l[g].icon,size:14},null,8,["name"]),n.createElementVNode("span",null,n.toDisplayString(s.value[g]),1)],10,iR)),64))])]),m.value?(n.openBlock(),n.createElementBlock("div",aR,[n.createElementVNode("label",rR,[n.createVNode(n.unref(ie.BSCheckbox),{name:"val-flag-norel",label:n.unref(o).t("em.validation.checkOrphanEntities"),"model-value":n.unref(o).flagEntitiesWithoutRelations.value,"onUpdate:modelValue":k[2]||(k[2]=g=>n.unref(o).flagEntitiesWithoutRelations.value=g)},null,8,["label","model-value"])]),i.value.length===0?(n.openBlock(),n.createElementBlock("p",lR,n.toDisplayString(n.unref(o).t("em.validation.noIssues")),1)):d.value.length===0?(n.openBlock(),n.createElementBlock("p",sR,n.toDisplayString(n.unref(o).t("em.validation.noVisibleIssues")),1)):(n.openBlock(),n.createElementBlock("ul",cR,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.value,({issue:g,entityName:w,message:h,category:E},X)=>(n.openBlock(),n.createElementBlock("li",{key:`${g.ruleId}:${g.targetRef??"model"}:${X}`,class:n.normalizeClass(["em-validation__item",[`is-${g.severity}`,{"is-clickable":!!g.targetRef}]]),onClick:z=>y(g)},[n.createVNode($e,{name:l[g.severity].icon,size:15,class:"em-validation__item-icon"},null,8,["name"]),n.createElementVNode("span",uR,[w?(n.openBlock(),n.createElementBlock("span",mR,n.toDisplayString(w),1)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(h),1)]),n.createElementVNode("span",{class:"em-validation__item-cat",title:g.ruleId},n.toDisplayString(E),9,fR)],10,dR))),128))]))])):n.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-d6738267"]]),hR={class:"em-history"},yR={class:"em-history__head"},gR={class:"em-history__title"},bR={class:"em-history__head-actions"},_R=["title","disabled"],kR=["title"],ER={class:"em-history__filters"},wR={class:"em-history__filter"},NR={class:"em-history__body"},vR={key:0,class:"em-history__empty"},xR={key:1,class:"em-history__empty is-error"},CR={key:2,class:"em-history__empty"},IR={key:3,class:"em-history__list"},SR=["onClick"],$R={class:"em-history__summary"},RR={class:"em-history__seq"},AR={class:"em-history__gmeta"},TR={class:"em-history__who"},VR={key:0,class:"em-history__time"},MR={key:1,class:"em-history__restored-from"},BR={key:0,class:"em-history__detail"},DR={class:"em-history__action-head"},OR={class:"em-history__action-name"},PR={key:0,class:"em-history__fields"},LR={class:"em-history__fname"},zR={key:0,class:"em-history__old"},UR={class:"em-history__val"},HR={key:1,class:"em-history__restore"},FR={class:"em-history__confirm-msg"},GR=["disabled","onClick"],jR=["disabled"],KR=["onClick"],YR=Pe(n.defineComponent({__name:"HistoryPanel",props:{controller:{},open:{type:Boolean}},emits:["close"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,r=n.ref([]),l=n.ref(!1),s=n.ref(null),c=n.ref(!1);async function d(){if(a.historyTransport){l.value=!0,s.value=null;try{r.value=await a.historyTransport(),c.value=!0}catch(I){s.value=I instanceof Error?I.message:a.t("em.history.loadError")}finally{l.value=!1}}}async function u(){await a.whenOpsSettled(),await d()}n.watch(()=>o.open,I=>{I&&u()},{immediate:!0});let m=null;n.watch(()=>a.revision.value,()=>{o.open&&(m&&clearTimeout(m),m=setTimeout(()=>void u(),500))}),n.watch(()=>a.reloadRequest.value,()=>{o.open&&u()});const p=n.computed(()=>new Map(a.state.logical.entities.map(I=>[I.modelId,I]))),f=n.computed(()=>new Map(a.state.logical.associations.map(I=>[I.modelId,I]))),y=n.computed(()=>new Map((a.state.logical.groups??[]).map(I=>{var K;return[I.modelId,I.packageName||((K=I.name)==null?void 0:K.ko)||I.modelId]})));function b(I){var fe,ce,ue,he,we,Se,Ie;const K=f.value.get(I);if(!K)return a.t("em.history.assocFallback");if((fe=K.description)!=null&&fe.trim())return K.description.trim();const oe=(he=(ue=p.value.get((ce=K.end1)==null?void 0:ce.entityRef))==null?void 0:ue.name)==null?void 0:he.trim(),pe=(Ie=(Se=p.value.get((we=K.end2)==null?void 0:we.entityRef))==null?void 0:Se.name)==null?void 0:Ie.trim();return oe&&pe?`${oe}→${pe}`:a.t("em.history.assocFallback")}function k(I){var K,oe,pe,fe;if(I.kind==="entity")return((oe=(K=p.value.get(I.ref))==null?void 0:K.name)==null?void 0:oe.trim())||a.t("em.attr.nameless");if(I.kind==="attribute"||I.kind==="operation"||I.kind==="index"){const ce=I.entityRef?p.value.get(I.entityRef):void 0,he=((I.kind==="attribute"?ce==null?void 0:ce.attributes:I.kind==="operation"?ce==null?void 0:ce.operations:ce==null?void 0:ce.indexes)??[]).find(Se=>Se.modelId===I.ref),we=(pe=ce==null?void 0:ce.name)==null?void 0:pe.trim();return`${we?we+".":""}${((fe=he==null?void 0:he.name)==null?void 0:fe.trim())||I.ref}`}return I.kind==="association"?b(I.ref):I.kind==="associationEnd"?`${b(I.ref)}(${I.end})`:I.kind==="group"?a.t("em.history.groupSubject",{name:y.value.get(I.ref)??I.ref}):I.ref}const g={entity:"table",attribute:"field",operation:"method",index:"key",association:"link",associationEnd:"link",group:"folder"},w={add:"em.history.verbAdd",update:"em.history.verbUpdate",remove:"em.history.verbRemove"},h=n.ref("all"),E=[{v:"all",labelKey:"em.history.filterAll"},{v:"edit",labelKey:"em.history.kindEdit"},{v:"restore",labelKey:"em.history.kindRestore"}],X=n.computed({get:()=>h.value,set:I=>{I&&(h.value=I)}}),z=n.computed(()=>ts(r.value)),q=n.computed(()=>z.value.length?z.value[0].seq:null),D=n.computed(()=>h.value==="all"?z.value:z.value.filter(I=>(I.kind??"edit")===h.value));function $(I){return I===void 0?"—":I===null?a.t("em.history.emptyValue"):typeof I=="object"?JSON.stringify(I):String(I)}function B(I){const K=k(I.subject);if(I.verb==="add")return a.t("em.history.summaryAdd",{name:K});if(I.verb==="remove")return a.t("em.history.summaryRemove",{name:K});if(I.fields.length===1){const oe=I.fields[0];return`${K}.${oe.field} ${oe.oldValue!==void 0?$(oe.oldValue)+"→":""}${$(oe.value)}`}return a.t("em.history.summaryFields",{name:K,n:I.fields.length})}function Q(I){return I.actions.length===0?a.t("em.history.noChange"):I.actions.length===1?B(I.actions[0]):a.t("em.history.summaryMore",{summary:B(I.actions[0]),n:I.actions.length-1})}const V=n.ref(new Set);function re(I){const K=new Set(V.value);K.has(I)?K.delete(I):K.add(I),V.value=K}function _(I){if(I==null)return"";const K=new Date(I);return isNaN(K.getTime())?String(I):K.toLocaleString()}function W(I){const K=I.author,oe=I.origin;return K&&oe?`${K}(${oe})`:K||(oe?`(${oe})`:"—")}const R=n.ref(null),J=n.ref(!1);function ee(I){R.value=I}async function ae(I){J.value=!0;try{const K=await a.restoreToSeq(I);K.ok||(s.value=a.t("em.history.restoreFailed",{reason:K.reason??a.t("em.history.unknown")}))}finally{J.value=!1,R.value=null}}return(I,K)=>(n.openBlock(),n.createBlock(n.Transition,{name:"em-history"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("section",hR,[n.createElementVNode("header",yR,[n.createElementVNode("div",gR,[n.createVNode($e,{name:"undo",size:15}),n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.history.title")),1)]),n.createElementVNode("div",bR,[n.createElementVNode("button",{type:"button",class:"em-history__btn",title:n.unref(a).t("em.history.refresh"),disabled:l.value,onClick:K[0]||(K[0]=oe=>d())},[n.createVNode($e,{name:"redo",size:15})],8,_R),n.createElementVNode("button",{type:"button",class:"em-history__btn",title:n.unref(a).t("em.common.close"),onClick:K[1]||(K[1]=oe=>i("close"))},[n.createVNode($e,{name:"panel-close",size:15})],8,kR)])]),n.createElementVNode("div",ER,[n.createElementVNode("label",wR,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.toolbar.displayLabel")),1),n.createVNode(n.unref(ie.BSSelect),{modelValue:X.value,"onUpdate:modelValue":K[2]||(K[2]=oe=>X.value=oe),items:E,"value-provider":oe=>oe.v,"label-provider":oe=>n.unref(a).t(oe.labelKey)},null,8,["modelValue","value-provider","label-provider"])])]),n.createElementVNode("div",NR,[l.value&&!c.value?(n.openBlock(),n.createElementBlock("p",vR,n.toDisplayString(n.unref(a).t("em.history.loading")),1)):s.value?(n.openBlock(),n.createElementBlock("p",xR,n.toDisplayString(s.value),1)):D.value.length===0?(n.openBlock(),n.createElementBlock("p",CR,n.toDisplayString(c.value?n.unref(a).t("em.history.emptyLoaded"):n.unref(a).t("em.history.emptyNotLoaded")),1)):(n.openBlock(),n.createElementBlock("ul",IR,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(D.value,oe=>(n.openBlock(),n.createElementBlock("li",{key:oe.seq,class:n.normalizeClass(["em-history__group",[`is-${oe.kind??"edit"}`]])},[n.createElementVNode("div",{class:"em-history__ghead",onClick:pe=>re(oe.seq)},[n.createVNode($e,{name:"chevron",size:13,class:n.normalizeClass(["em-history__chevron",{"is-open":V.value.has(oe.seq)}])},null,8,["class"]),n.createElementVNode("span",{class:n.normalizeClass(["em-history__kind",`is-${oe.kind??"edit"}`])},n.toDisplayString(n.unref(a).t(oe.kind==="restore"?"em.history.kindRestore":"em.history.kindEdit")),3),n.createElementVNode("span",$R,n.toDisplayString(Q(oe)),1),n.createElementVNode("span",RR,"#"+n.toDisplayString(oe.seq),1)],8,SR),n.createElementVNode("div",AR,[n.createElementVNode("span",TR,n.toDisplayString(W(oe)),1),oe.ts?(n.openBlock(),n.createElementBlock("span",VR,n.toDisplayString(_(oe.ts)),1)):n.createCommentVNode("",!0),oe.kind==="restore"&&oe.restoredFromSeq!=null?(n.openBlock(),n.createElementBlock("span",MR,"← #"+n.toDisplayString(oe.restoredFromSeq),1)):n.createCommentVNode("",!0)]),V.value.has(oe.seq)?(n.openBlock(),n.createElementBlock("div",BR,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(oe.actions,(pe,fe)=>(n.openBlock(),n.createElementBlock("div",{key:fe,class:"em-history__action"},[n.createElementVNode("div",DR,[n.createVNode($e,{name:g[pe.subject.kind],size:12},null,8,["name"]),n.createElementVNode("span",OR,n.toDisplayString(k(pe.subject)),1),n.createElementVNode("span",{class:n.normalizeClass(["em-history__verb",`is-${pe.verb}`])},n.toDisplayString(n.unref(a).t(w[pe.verb])),3)]),pe.fields.length?(n.openBlock(),n.createElementBlock("ul",PR,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(pe.fields,(ce,ue)=>(n.openBlock(),n.createElementBlock("li",{key:ue,class:"em-history__field"},[n.createElementVNode("span",LR,n.toDisplayString(ce.field),1),ce.oldValue!==void 0?(n.openBlock(),n.createElementBlock("span",zR,n.toDisplayString($(ce.oldValue)),1)):n.createCommentVNode("",!0),ce.oldValue!==void 0?(n.openBlock(),n.createBlock($e,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):n.createCommentVNode("",!0),n.createElementVNode("span",UR,n.toDisplayString($(ce.value)),1)]))),128))])):n.createCommentVNode("",!0)]))),128))])):n.createCommentVNode("",!0),n.unref(a).restoreAvailable.value&&oe.seq!==q.value?(n.openBlock(),n.createElementBlock("div",HR,[R.value===oe.seq?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("span",FR,n.toDisplayString(n.unref(a).t("em.history.confirmRestore")),1),n.createElementVNode("button",{type:"button",class:"em-history__confirm-yes",disabled:J.value,onClick:pe=>ae(oe.seq)},n.toDisplayString(n.unref(a).t("em.history.doRestore")),9,GR),n.createElementVNode("button",{type:"button",class:"em-history__confirm-no",disabled:J.value,onClick:K[3]||(K[3]=pe=>R.value=null)},n.toDisplayString(n.unref(a).t("em.history.cancel")),9,jR)],64)):(n.openBlock(),n.createElementBlock("button",{key:1,type:"button",class:"em-history__restore-btn",onClick:pe=>ee(oe.seq)},[n.createVNode($e,{name:"undo",size:12}),n.createTextVNode(" "+n.toDisplayString(n.unref(a).t("em.history.restoreToHere")),1)],8,KR))])):n.createCommentVNode("",!0)],2))),128))]))])],512),[[n.vShow,e.open]])]),_:1}))}}),[["__scopeId","data-v-45d29598"]]);function WR(e,t){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>=t?i:null}function Fm(e){const t=n.ref(WR(e.storageKey,e.min)??e.initial),o=n.ref(!1);function i(a){a.preventDefault();const r=a.clientX,l=t.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)),t.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(t.value))};window.addEventListener("pointermove",s),window.addEventListener("pointerup",c)}return{width:t,dragging:o,startResize:i}}const qR={class:"em-modeler"},XR={class:"em-modeler__body"},JR={class:"em-drawer__inner"},ZR={class:"em-drawer__head"},QR={class:"em-drawer__actions"},eA=["title"],tA=["title"],nA=["title"],oA=["title"],iA=["title"],aA=Pe(n.defineComponent({__name:"EntityModeler",props:{controller:{}},setup(e){const t=n.ref(!0),o=n.ref(!0),i=n.ref(!1),{width:a,dragging:r,startResize:l}=Fm({initial:260,min:260,max:560,edge:"right",storageKey:"em.explorerWidth"}),{width:s,dragging:c,startResize:d}=Fm({initial:320,min:320,max:640,edge:"left",storageKey:"em.panelWidth"}),u=n.ref(null),m=n.ref(null);return(p,f)=>{var y,b,k;return n.openBlock(),n.createElementBlock("div",qR,[n.createVNode(Um,{controller:e.controller,"history-open":i.value,onExportSvg:f[0]||(f[0]=g=>{var w;return(w=u.value)==null?void 0:w.exportSvg()}),onExportPng:f[1]||(f[1]=g=>{var w;return(w=u.value)==null?void 0:w.exportPng()}),onToggleHistory:f[2]||(f[2]=g=>i.value=!i.value)},null,8,["controller","history-open"]),n.createElementVNode("div",XR,[n.createElementVNode("aside",{class:n.normalizeClass(["em-drawer",{"is-collapsed":!t.value}]),style:n.normalizeStyle({width:n.unref(a)+"px"})},[n.createElementVNode("div",JR,[n.createElementVNode("header",ZR,[f[10]||(f[10]=n.createElementVNode("span",null,"Diagram Explorer",-1)),n.createElementVNode("div",QR,[(y=m.value)!=null&&y.hasExpandable?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"em-drawer__btn",title:e.controller.t((b=m.value)!=null&&b.allExpanded?"em.panel.collapseAll":"em.panel.expandAll"),onClick:f[3]||(f[3]=g=>{var w;return(w=m.value)==null?void 0:w.toggleAll()})},[n.createVNode($e,{name:(k=m.value)!=null&&k.allExpanded?"collapse-all":"expand-all",size:16},null,8,["name"])],8,eA)):n.createCommentVNode("",!0),n.createElementVNode("button",{type:"button",class:"em-drawer__btn",title:e.controller.t("em.panel.collapse"),onClick:f[4]||(f[4]=g=>t.value=!1)},[n.createVNode($e,{name:"panel-close",size:16})],8,tA)])]),n.createVNode(zm,{ref_key:"explorer",ref:m,controller:e.controller},null,8,["controller"])]),n.withDirectives(n.createElementVNode("div",{class:n.normalizeClass(["em-resize-handle em-resize-handle--right",{"is-dragging":n.unref(r)}]),title:e.controller.t("em.panel.resizeWidth"),onPointerdown:f[5]||(f[5]=(...g)=>n.unref(l)&&n.unref(l)(...g))},null,42,nA),[[n.vShow,t.value]])],6),n.createVNode(n.Transition,{name:"em-reopen"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("button",{type:"button",class:"em-drawer__reopen",title:e.controller.t("em.panel.openNamed",{name:"Diagram Explorer"}),onClick:f[6]||(f[6]=g=>t.value=!0)},[n.createVNode($e,{name:"panel-open",size:18})],8,oA),[[n.vShow,!t.value]])]),_:1}),n.createElementVNode("div",{class:n.normalizeClass(["em-modeler__canvas",{"is-drawer-open":t.value,"is-resizing":n.unref(r),"is-inspector-collapsed":!o.value}]),style:n.normalizeStyle({"--em-drawer-shift":n.unref(a)-6+"px"})},[n.createVNode(Lm,{ref_key:"canvas",ref:u,controller:e.controller},null,8,["controller"])],6),n.withDirectives(n.createVNode(Hm,{controller:e.controller,width:n.unref(s),resizing:n.unref(c),"start-resize":n.unref(d),onCollapse:f[7]||(f[7]=g=>o.value=!1)},null,8,["controller","width","resizing","start-resize"]),[[n.vShow,o.value]]),n.createVNode(n.Transition,{name:"em-reopen"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("button",{type:"button",class:"em-panel__reopen",title:e.controller.t("em.panel.openNamed",{name:"Inspector"}),onClick:f[8]||(f[8]=g=>o.value=!0)},[n.createVNode($e,{name:"panel-right-open",size:18})],8,iA),[[n.vShow,!o.value]])]),_:1}),n.createVNode(YR,{controller:e.controller,open:i.value,onClose:f[9]||(f[9]=g=>i.value=!1)},null,8,["controller","open"])]),n.createVNode(pR,{controller:e.controller,"panel-width":n.unref(s),"inspector-open":o.value},null,8,["controller","panel-width","inspector-open"])])}}}),[["__scopeId","data-v-cce29135"]]);_e.APPLY_MODEL_OPS_INPUT_SCHEMA=Hp,_e.AssociationEdge=Uu,_e.CUSTOM_TYPE_VALUE=kt,_e.CommandStack=Ja,_e.DEFAULT_JAVA_TYPE=za,_e.DiagramCanvas=Lm,_e.DiagramExplorer=zm,_e.EDITOR=kn,_e.EditModeToggle=wS,_e.EditorToolbar=Um,_e.EntityModeler=aA,_e.EntityNode=xu,_e.GROUP_CODE_ENUM_VALUE=In,_e.GroupNode=Cu,_e.INHERITED_REF_PREFIX=ti,_e.JAVA_TYPES=oi,_e.NoteNode=Iu,_e.OpSyncAdapter=js,_e.PHYSICAL_NAME_MAX_LENGTH=ro,_e.PropertyPanel=Hm,_e.RevCache=Gs,_e.SELECTABLE_JAVA_TYPES=Ml,_e.SYMBOLIC_OP_KINDS=Ks,_e.SYMBOLIC_OP_SCHEMA=oc,_e.UI_LOCALES=nk,_e.anchoredEdgePoint=Va,_e.buildAgentBatch=Fp,_e.buildDiagramSvg=yl,_e.buildOrthogonalPath=$a,_e.buildSelfLoopPath=El,_e.buildStraightPath=Aa,_e.collectSharedColumns=en,_e.commands=cp,_e.computeAutoLayout=wl,_e.createEditorController=lw,_e.defaultMermaidDialect=Jm,_e.displayLabel=ni,_e.emptyState=Eu,_e.entityModelToMermaid=Da,_e.entityModelToText=Il,_e.estimateEntityHeight=vl,_e.exportDiagramPng=Om,_e.exportDiagramSvg=Dm,_e.fromPersisted=oh,_e.indexColumnsByModelId=tn,_e.isInheritedColumnRef=no,_e.javaTypeLabel=Sn,_e.makeInheritedColumnRef=xl,_e.mergeDiagram=ql,_e.migrateLegacyMoney=Ff,_e.newId=Be,_e.orthogonalMidpoints=Ra,_e.packEntityBoxes=Xm,_e.parseInheritedColumnRef=Ba,_e.physicalNameLengthOverflow=ai,_e.projectActionLog=ts,_e.projectEntityAudit=Ql,_e.projectFieldAudit=Ft,_e.projectInheritedColumns=oo,_e.rectExitPoint=Ta,_e.renderDiagramSvg=Tl,_e.resolveDiagram=_l,_e.resolveSharedColumn=$n,_e.resolveSymbolicOps=Ap,_e.restoreDeepEqual=Vn,_e.scaffoldEntityJava=Ef,_e.segmentMidpoints=Ma,_e.sharedColumnScopeEntities=ii,_e.sideDir=to,_e.synthesizeRestoreOps=ep,_e.toPersisted=gh,_e.toPersistedV2=bh,_e.translate=St,_e.uiMessagesEn=pu,_e.uiMessagesJa=hu,_e.uiMessagesKo=yu,_e.validateModel=Ol,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})}));
|
|
50
|
+
v${-(W.value.height-2*e.maskBorderRadius)}
|
|
51
|
+
a${e.maskBorderRadius},${e.maskBorderRadius} 0 0 1 ${e.maskBorderRadius},-${e.maskBorderRadius}z`);n.watchEffect(ee=>{if(b.value){const oe=Jt(b.value),U=ce=>{if(ce.sourceEvent.type!=="wheel"||!p.value||!f.value)return;const pe=ce.sourceEvent.ctrlKey&&Mo()?10:1,se=-ce.sourceEvent.deltaY*(ce.sourceEvent.deltaMode===1?.05:ce.sourceEvent.deltaMode?1:.002)*e.zoomStep,me=c.value.zoom*2**(se*pe);f.value.scaleTo(p.value,me)},G=ce=>{if(ce.sourceEvent.type!=="mousemove"||!p.value||!f.value)return;const pe=$.value*Math.max(1,c.value.zoom)*(e.inversePan?-1:1),se={x:c.value.x-ce.sourceEvent.movementX*pe,y:c.value.y-ce.sourceEvent.movementY*pe},me=[[0,0],[u.value.width,u.value.height]],he=ul.translate(se.x,se.y).scale(c.value.zoom),Ee=f.value.constrain()(he,me,d.value);f.value.transform(p.value,Ee)},ne=oI().wheelDelta(ce=>Ir(ce)*(e.zoomStep/10)).on("zoom",e.pannable?G:()=>{}).on("zoom.wheel",e.zoomable?U:()=>{});oe.call(ne),ee(()=>{oe.on("zoom",null)})}},{flush:"post"});function B(ee){const[oe,U]=Zt(ee);t("click",{event:ee,position:{x:oe,y:U}})}function re(ee,oe){const U={event:ee,node:oe,connectedEdges:hn([oe],s.value)};m.miniMapNodeClick(U),t("nodeClick",U)}function _(ee,oe){const U={event:ee,node:oe,connectedEdges:hn([oe],s.value)};m.miniMapNodeDoubleClick(U),t("nodeDblclick",U)}function K(ee,oe){const U={event:ee,node:oe,connectedEdges:hn([oe],s.value)};m.miniMapNodeMouseEnter(U),t("nodeMouseenter",U)}function R(ee,oe){const U={event:ee,node:oe,connectedEdges:hn([oe],s.value)};m.miniMapNodeMouseMove(U),t("nodeMousemove",U)}function X(ee,oe){const U={event:ee,node:oe,connectedEdges:hn([oe],s.value)};m.miniMapNodeMouseLeave(U),t("nodeMouseleave",U)}return(ee,oe)=>(n.openBlock(),n.createBlock(n.unref(su),{position:ee.position,class:n.normalizeClass(["vue-flow__minimap",{pannable:ee.pannable,zoomable:ee.zoomable}])},{default:n.withCtx(()=>[(n.openBlock(),n.createElementBlock("svg",{ref_key:"el",ref:b,width:k.value,height:g.value,viewBox:[D.value.x,D.value.y,D.value.width,D.value.height].join(" "),role:"img","aria-labelledby":`vue-flow__minimap-${n.unref(l)}`,onClick:B},[ee.ariaLabel?(n.openBlock(),n.createElementBlock("title",{key:0,id:`vue-flow__minimap-${n.unref(l)}`},n.toDisplayString(ee.ariaLabel),9,sI)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(y),U=>(n.openBlock(),n.createBlock(rI,{id:U.id,key:U.id,f:"",position:U.computedPosition,dimensions:U.dimensions,selected:U.selected,dragging:U.dragging,style:n.normalizeStyle(U.style),class:n.normalizeClass(q.value(U)),color:h.value(U),"border-radius":ee.nodeBorderRadius,"stroke-color":w.value(U),"stroke-width":ee.nodeStrokeWidth,"shape-rendering":n.unref(N),type:U.type,hidden:U.hidden,onClick:G=>re(G,U),onDblclick:G=>_(G,U),onMouseenter:G=>K(G,U),onMousemove:G=>R(G,U),onMouseleave:G=>X(G,U)},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)),n.createElementVNode("path",{class:"vue-flow__minimap-mask",d:J.value,fill:ee.maskColor,stroke:ee.maskStrokeColor,"stroke-width":ee.maskStrokeWidth,"fill-rule":"evenodd"},null,8,cI)],8,lI))]),_:1},8,["position","class"]))}}),mI=["d"],fI=["cx","cy","onDblclick"],pI=["x","y","onPointerdown","onDblclick"],hI=Pe(n.defineComponent({inheritAttrs:!1,__name:"NoteConnectionEdge",props:{id:{},sourceNode:{},targetNode:{},data:{}},setup(e){const t=e,{screenToFlowCoordinate:o}=De(),i=n.inject(Kr),a=n.inject(En,null),r=n.computed(()=>!!a&&a.editable.value),l=n.inject(Jn,null),s=n.computed(()=>!!l&&l.active.value&&(!l.relatedEntityIds.value.has(t.data.targetRef)||!l.relatedNoteIds.value.has(t.data.noteRef))),c=n.computed(()=>(i==null?void 0:i.points(t.id))??[]),d=n.ref(-1),u=n.ref({x:0,y:0}),m=n.computed(()=>c.value.map((M,$)=>$===d.value?u.value:M)),{source:p,target:f,sourceSide:y,targetSide:b}=Lu({sourceNode:()=>t.sourceNode,targetNode:()=>t.targetNode,waypoints:()=>m.value}),k=n.computed(()=>(a==null?void 0:a.routingMode.value)==="orthogonal"?$a(p.value,y.value,m.value,f.value,b.value):Aa(p.value,m.value,f.value)),g=n.computed(()=>r.value?(a==null?void 0:a.routingMode.value)==="orthogonal"?Ra(p.value,y.value,m.value,f.value,b.value):Ma(p.value,m.value,f.value).map((M,$)=>({point:M,segIndex:$})):[]),N=n.computed(()=>r.value?m.value:[]);function h(M,$){d.value=M,u.value={...c.value[M]},$.target.setPointerCapture($.pointerId),$.stopPropagation()}function w(M){if(d.value<0)return;const $=o({x:M.clientX,y:M.clientY});u.value={x:$.x,y:$.y}}function q(M){var $,D;d.value>=0&&i&&i.movePoint(t.id,d.value,{...u.value}),d.value=-1,(D=($=M.target).releasePointerCapture)==null||D.call($,M.pointerId)}function P(M,$){$.stopPropagation(),i==null||i.removePoint(t.id,M)}function W(M,$){if(!i)return;const D=o({x:$.clientX,y:$.clientY});i.insertPoint(t.id,M,{x:D.x,y:D.y})}return(M,$)=>(n.openBlock(),n.createElementBlock(n.Fragment,null,[n.createElementVNode("path",{d:k.value,fill:"none","stroke-width":"1.5","stroke-dasharray":"6 4",class:n.normalizeClass(["em-note-edge__path",{"is-dimmed":s.value}])},null,10,mI),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(g.value,(D,J)=>(n.openBlock(),n.createElementBlock("circle",{key:`mid-${J}`,cx:D.point.x,cy:D.point.y,r:"4",class:n.normalizeClass(["em-note-edge__mid",{"is-dimmed":s.value}]),onDblclick:n.withModifiers(B=>W(D.segIndex,B),["stop"])},null,42,fI))),128)),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.value,(D,J)=>(n.openBlock(),n.createElementBlock("rect",{key:`wp-${J}`,x:D.x-5,y:D.y-5,width:"10",height:"10",rx:"2",class:n.normalizeClass(["em-note-edge__waypoint",{"is-dimmed":s.value}]),onPointerdown:B=>h(J,B),onPointermove:w,onPointerup:q,onDblclick:B=>P(J,B)},null,42,pI))),128))],64))}}),[["__scopeId","data-v-8515def1"]]),yI=["data-theme"],gI={key:0,class:"em-ctx__sep",role:"separator"},bI={key:1,class:"em-ctx__swatches"},_I={class:"em-ctx__swatches-label"},kI={class:"em-ctx__chips"},EI=["title","onClick"],wI=["title","onClick"],NI=["disabled","onClick"],vI={class:"em-ctx__icon"},xI={class:"em-ctx__caption"},CI=Pe(n.defineComponent({__name:"EmContextMenu",props:{locale:{}},setup(e,{expose:t}){const o=e,i=(b,k)=>Rt(o.locale??"ko",b,k),a=n.ref(!1),r=n.ref([]),l=n.ref(void 0),s=n.ref(null),c=n.reactive({x:0,y:0}),d=8;async function u(b,k){var h;r.value=k,l.value=(h=b.target)!=null&&h.closest('[data-theme="dark"]')?"dark":void 0,c.x=b.clientX,c.y=b.clientY,a.value=!0,window.addEventListener("keydown",p),window.addEventListener("resize",m),await n.nextTick();const g=s.value;if(!g)return;const N=g.getBoundingClientRect();c.x+N.width>window.innerWidth-d&&(c.x=Math.max(d,window.innerWidth-d-N.width)),c.y+N.height>window.innerHeight-d&&(c.y=Math.max(d,window.innerHeight-d-N.height))}function m(){a.value&&(a.value=!1,r.value=[],window.removeEventListener("keydown",p),window.removeEventListener("resize",m))}function p(b){b.key==="Escape"&&(b.stopPropagation(),m())}function f(b){b.disabled||(b.handler(),m())}function y(b,k){b.onPick(k),m()}return n.onBeforeUnmount(m),t({open:u,close:m}),(b,k)=>(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[a.value?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-ctx-layer","data-theme":l.value},[n.createElementVNode("div",{class:"em-ctx__scrim",onPointerdown:m,onContextmenu:n.withModifiers(m,["prevent"])},null,32),n.createElementVNode("div",{ref_key:"menuEl",ref:s,class:"em-ctx",style:n.normalizeStyle({left:c.x+"px",top:c.y+"px"}),role:"menu",onContextmenu:k[0]||(k[0]=n.withModifiers(()=>{},["prevent"]))},[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(r.value,(g,N)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:N},[g.type==="separator"?(n.openBlock(),n.createElementBlock("div",gI)):g.type==="swatches"?(n.openBlock(),n.createElementBlock("div",bI,[n.createElementVNode("span",_I,n.toDisplayString(g.caption),1),n.createElementVNode("div",kI,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-ctx__chip em-ctx__chip--none",{"is-on":g.current===null}]),title:i("em.swatch.none"),onClick:h=>y(g,null)},null,10,EI),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),h=>(n.openBlock(),n.createElementBlock("button",{key:h,type:"button",class:n.normalizeClass(["em-ctx__chip",{"is-on":g.current===h}]),style:n.normalizeStyle({background:n.unref(Wn)(h)}),title:n.unref(Yn)(h),onClick:w=>y(g,h)},null,14,wI))),128))])])):(n.openBlock(),n.createElementBlock("button",{key:2,type:"button",class:n.normalizeClass(["em-ctx__item",{"is-danger":g.danger,"is-disabled":g.disabled}]),disabled:g.disabled,role:"menuitem",onClick:h=>f(g)},[n.createElementVNode("span",vI,[g.icon?(n.openBlock(),n.createBlock(Re,{key:0,name:g.icon,size:15},null,8,["name"])):n.createCommentVNode("",!0)]),n.createElementVNode("span",xI,n.toDisplayString(g.caption),1)],10,NI))],64))),128))],36)],8,yI)):n.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-0b8cdb1f"]]),fl=[".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 to(e){const t=getComputedStyle(e);return!(t.display==="none"||t.visibility==="hidden"||parseFloat(t.opacity)===0)}function II(e){return e.childElementCount>0?!1:(e.textContent??"").trim().length>0}function SI(e,t){const o=getComputedStyle(e),i={fill:o.color,fontSize:parseFloat(o.fontSize),fontFamily:o.fontFamily,fontWeight:o.fontWeight,fontStyle:o.fontStyle},a=document.createRange();a.selectNodeContents(e);const r=e.firstChild,l=a.getClientRects();if(!r||r.nodeType!==3||l.length<=1){const y=l.length?a.getBoundingClientRect():e.getBoundingClientRect();if(y.width===0&&y.height===0)return[];const b=t(y.left,y.top+y.height/2);return[{...i,x:b.x,y:b.y,text:(e.textContent??"").trim()}]}const s=r.textContent??"",c=[];let d="",u=null,m=0,p=0;const f=()=>{const y=d.trim();if(y){const b=t(m,(u+p)/2);c.push({...i,x:b.x,y:b.y,text:y})}d=""};for(let y=0;y<s.length;y++){a.setStart(r,y),a.setEnd(r,y+1);const b=a.getBoundingClientRect();u===null||Math.abs(b.top-u)>1?(f(),u=b.top,m=b.left,p=b.bottom,d=s[y]):(d+=s[y],p=Math.max(p,b.bottom))}return f(),c}function Ca(e,t){const o=[];for(const i of e.querySelectorAll("*"))II(i)&&(i.closest(fl)||to(i)&&o.push(...SI(i,t)));return o}function Ko(e){return Math.round(e*100)/100}function $I(e,t){const o=[];for(const i of e.querySelectorAll("svg.em-icon")){if(i.closest(fl)||!to(i))continue;const a=i.getBoundingClientRect();if(a.width===0||a.height===0)continue;const r=t(a.left,a.top),l=t(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="${Ko(r.x)}" y="${Ko(r.y)}" width="${Ko(l.x-r.x)}" height="${Ko(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 RI(e){const t=[];for(const o of e.querySelectorAll(".em-edge__marker")){if(!to(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=>Ko(parseFloat(o.getAttribute(d)??"0"));s==="line"?t.push(`<line x1="${c("x1")}" y1="${c("y1")}" x2="${c("x2")}" y2="${c("y2")}" stroke="${a}" stroke-width="${r}" stroke-linecap="round" />`):s==="circle"?t.push(`<circle cx="${c("cx")}" cy="${c("cy")}" r="${c("r")}" fill="none" stroke="${a}" stroke-width="${r}" />`):s==="path"&&t.push(`<path d="${o.getAttribute("d")}" fill="${l}" stroke="${a}" stroke-width="${r}" stroke-linejoin="round" />`)}return t}function Vm(e,t,o){const i=[];for(const a of e.querySelectorAll("*")){if(a===t||a.closest(fl)||!to(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 Yo(e,t){const o=e.getBoundingClientRect(),i=getComputedStyle(e),a=t(o.left,o.top),r=t(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 pl(e,t){e.minX=Math.min(e.minX,t.x),e.minY=Math.min(e.minY,t.y),e.maxX=Math.max(e.maxX,t.x+t.w),e.maxY=Math.max(e.maxY,t.y+t.h)}function AI(e){const t=e.vueFlowRef.value;if(!t)throw new Error("캔버스가 렌더되지 않아 SVG로 내보낼 수 없습니다.");const o=(f,y)=>e.screenToFlowCoordinate({x:f,y}),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 y=t.querySelector(`.vue-flow__node[data-id="${CSS.escape(f.id)}"]`);if(!y||!to(y))continue;const b=y.firstElementChild;if(b)if(f.type==="group"){const k=Yo(b,o);pl(s,k),i.push({...k,texts:[]});const g=b.querySelector(".em-group__label");g&&i.push({...Yo(g,o),stroke:"none",texts:[]}),i.push({...k,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:Ca(b,o)})}else if(f.type==="note"){const k={...Yo(b,o),texts:Ca(b,o),lines:Vm(b,b,o)};pl(s,k),r.push(k)}else{const k=Yo(b,o);pl(s,k);const g=k.radius??{tl:0,tr:0};a.push({...k,stroke:"none",texts:[]});const N=b.querySelector(".em-entity__header");if(N){const h=Yo(N,o);a.push({x:k.x,y:k.y,w:k.w,h:h.y+h.h-k.y,fill:h.fill,stroke:"none",radius:{tl:g.tl,tr:g.tr,br:0,bl:0},texts:[]})}a.push({...k,fill:"none",stroke:"none",strokeWidth:void 0,strokeDasharray:void 0,radius:void 0,texts:Ca(b,o),lines:Vm(b,b,o),icons:$I(b,o)}),a.push({...k,fill:"none",texts:[]})}}for(const f of t.querySelectorAll(".vue-flow__edge")){const y=f.querySelector("path.em-edge__path, path.em-note-edge__path");if(!y||!to(y))continue;const b=y.getAttribute("d");if(!b)continue;const k=getComputedStyle(y),g=k.strokeDasharray,N=RI(f);l.push({d:b,stroke:k.stroke,strokeWidth:parseFloat(k.strokeWidth)||1.5,strokeDasharray:g&&g!=="none"?g:void 0,labels:Ca(f,o),markers:N.length?N:void 0})}const c=t.closest(".em-canvas")??t,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 hl(e){return Al(AI(e))}function Mm(e,t){const o=URL.createObjectURL(e);try{const i=document.createElement("a");i.href=o,i.download=t,document.body.appendChild(i),i.click(),i.remove()}finally{URL.revokeObjectURL(o)}}function Bm(e,t="diagram.svg"){const o=hl(e);Mm(new Blob([o],{type:"image/svg+xml;charset=utf-8"}),t)}function TI(e){var i,a;const t=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:t>0?t:1,h:o>0?o:1}}async function Dm(e,t="diagram.png",o=2){const i=hl(e),{w:a,h:r}=TI(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 변환 실패");Mm(u,t)}finally{URL.revokeObjectURL(l)}}const VI={class:"em-shortcuts"},MI={class:"em-shortcuts__title"},BI={class:"em-shortcuts__keys"},DI={class:"em-shortcuts__kbd"},OI={key:0,class:"em-shortcuts__plus"},PI={class:"em-shortcuts__desc"},LI={class:"em-shortcuts__actions"},Om=Pe(n.defineComponent({__name:"ShortcutHelpModal",props:{locale:{}},setup(e){const t=e,o=ie.useModalHandle(),i=(s,c)=>Rt(t.locale??"ko",s,c),r=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent)?"⌘":"Ctrl",l=n.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.groupOther"),items:[{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)=>(n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:i("em.shortcuts.title")},{default:n.withCtx(()=>[n.createElementVNode("div",VI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(l.value,d=>(n.openBlock(),n.createElementBlock("section",{key:d.title,class:"em-shortcuts__group"},[n.createElementVNode("h4",MI,n.toDisplayString(d.title),1),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.items,u=>(n.openBlock(),n.createElementBlock("div",{key:u.desc,class:"em-shortcuts__row"},[n.createElementVNode("span",BI,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.keys,(m,p)=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:m+p},[n.createElementVNode("kbd",DI,n.toDisplayString(m),1),p<u.keys.length-1?(n.openBlock(),n.createElementBlock("span",OI,"+")):n.createCommentVNode("",!0)],64))),128))]),n.createElementVNode("span",PI,n.toDisplayString(u.desc),1)]))),128))]))),128)),n.createElementVNode("div",LI,[n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:i("em.common.close"),onClick:c[0]||(c[0]=d=>n.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-fa7e04dd"]]);function zI(e){return e?e.kind==="missing"?{title:"편집이 잠겼습니다",detail:"변경 사항을 저장하지 못했습니다(서버 또는 네트워크 오류). 최신 내용을 다시 불러오세요."}:{title:"편집이 잠겼습니다",detail:"다른 곳에서 변경되어 편집이 잠겼습니다. 최신 내용을 다시 불러오세요."}:null}const UI={key:0,class:"em-canvas__empty","aria-hidden":"true"},HI={class:"em-canvas__empty-title"},FI=["innerHTML"],GI=["innerHTML"],jI={key:1,class:"em-canvas__empty-title"},KI={key:0,class:"em-conflict-banner",role:"alert","aria-live":"assertive"},YI={class:"em-conflict-banner__body"},WI={class:"em-conflict-banner__title"},qI={class:"em-conflict-banner__detail"},XI={key:0,class:"em-toast",role:"status","aria-live":"polite"},yl="nc:",Pm=Pe(n.defineComponent({__name:"DiagramCanvas",props:{controller:{}},setup(e,{expose:t}){const i=e.controller,a=ie.useModal(),r=n.ref(null);let l;n.watch(()=>i.notice.value,E=>{E&&(r.value=E.text,l&&clearTimeout(l),l=setTimeout(()=>r.value=null,3200))}),n.onBeforeUnmount(()=>l&&clearTimeout(l));const s=n.computed(()=>zI(i.opConflict.value)),c=n.ref(!1),d=n.ref(!1),u={x:0,y:0};function m(E){u.x=E.clientX,u.y=E.clientY}const p=n.ref(null);n.provide(ra,p);const f=n.ref(null);n.provide(Nu,f);const y=n.ref(null),b=n.computed(()=>{const E=y.value,I=new Set;if(!E)return I;if(E.kind==="entity")I.add(E.id);else if(E.kind==="group"){const Y=i.resolved.value.groups.find(v=>v.group.modelId===E.id);for(const v of(Y==null?void 0:Y.group.memberEntityRefs)??[])I.add(v)}return I}),k=n.computed(()=>{const E=y.value,I=new Set(b.value),Y=new Set,v=new Set;if(!E)return{related:I,edges:Y,notes:v};if(E.kind==="note"){v.add(E.id);for(const A of i.resolved.value.noteConnections)A.noteRef===E.id&&I.add(A.targetRef);return{related:I,edges:Y,notes:v}}const F=b.value;if(!F.size)return{related:I,edges:Y,notes:v};for(const A of i.resolved.value.associations){const{end1:le,end2:ae}=A.association;(F.has(le.entityRef)||F.has(ae.entityRef))&&(Y.add(A.association.modelId),I.add(le.entityRef),I.add(ae.entityRef))}for(const A of i.resolved.value.noteConnections)I.has(A.targetRef)&&v.add(A.noteRef);return{related:I,edges:Y,notes:v}});n.provide(Jn,{source:y,active:n.computed(()=>y.value!==null),primaryEntityIds:b,relatedEntityIds:n.computed(()=>k.value.related),relatedEdgeIds:n.computed(()=>k.value.edges),relatedNoteIds:n.computed(()=>k.value.notes),hoverGroupId:n.computed(()=>{var E;return((E=y.value)==null?void 0:E.kind)==="group"?y.value.id:null}),setEntityHover:E=>{f.value||d.value||(y.value=E?{kind:"entity",id:E}:null)},setGroupHover:E=>{f.value||d.value||(y.value=E?{kind:"group",id:E}:null)},setNoteHover:E=>{f.value||d.value||(y.value=E?{kind:"note",id:E}:null)}}),n.provide(En,i);function g(E,I){return`${yl}${E}:${I}`}function N(E){if(!E.startsWith(yl))return null;const[I,Y]=E.slice(yl.length).split(":");return I&&Y?{noteRef:I,targetRef:Y}:null}n.provide(Kr,{points:E=>{var Y,v;const I=N(E);return I?((Y=i.resolved.value.noteConnections.find(F=>F.noteRef===I.noteRef&&F.targetRef===I.targetRef))==null?void 0:Y.waypoints)??[]:((v=i.resolved.value.associations.find(F=>F.association.modelId===E))==null?void 0:v.waypoints)??[]},movePoint:(E,I,Y)=>{const v=N(E);v?i.moveNoteConnectionWaypoint(v.noteRef,v.targetRef,I,Y):i.moveWaypoint(E,I,Y)},insertPoint:(E,I,Y)=>{const v=N(E);v?i.addNoteConnectionWaypoint(v.noteRef,v.targetRef,I,Y):i.addWaypoint(E,I,Y)},removePoint:(E,I)=>{const Y=N(E);Y?i.removeNoteConnectionWaypoint(Y.noteRef,Y.targetRef,I):i.removeWaypoint(E,I)}});const h=De(),{nodes:w,edges:q,findNode:P,findEdge:W,addNodes:M,addEdges:$,removeNodes:D,removeEdges:J,fitView:B,setCenter:re,getViewport:_,screenToFlowCoordinate:K,getSelectedNodes:R,updateNodeInternals:X}=h,ee=n.ref(!1);async function oe(E){ee.value=!0,await n.nextTick(),await new Promise(I=>requestAnimationFrame(()=>I(null)));try{return await E()}finally{ee.value=!1}}function U(){return oe(()=>Bm(h))}function G(){return oe(()=>Dm(h))}t({exportSvg:U,exportPng:G});const ne=n.computed(()=>i.resolved.value.entities.length===0);function ce(){const E=_(),{width:I,height:Y}=h.dimensions.value;return{x:(I/2-E.x)/E.zoom,y:(Y/2-E.y)/E.zoom}}function pe(){const E=ce();i.addEntity("NewEntity",{x:E.x,y:E.y})}function se(){const E=ce();i.addNote("메모",{x:E.x,y:E.y})}function me(E){for(const I of i.resolved.value.groups){const{location:Y,size:v}=I.geo;if(E.x>=Y.x&&E.x<=Y.x+v.width&&E.y>=Y.y&&E.y<=Y.y+v.height)return I.group.modelId}return null}function he(){const E=i.resolved.value,I=new Map(E.groups.map(le=>[le.group.modelId,le.geo])),Y=new Set(E.groups.map(le=>le.group.modelId)),v=new Set([...Y,...E.entities.map(le=>le.entity.modelId),...E.notes.map(le=>le.note.modelId)]);for(const le of[...w.value])v.has(le.id)||D([le.id]);for(const le of E.groups){const ae=le.group.modelId,Ne={width:`${le.geo.size.width}px`,height:`${le.geo.size.height}px`},Te={group:le.group,style:le.style,locked:le.locked},Be=le.locked?!1:void 0,Ue=P(ae);Ue?(Ue.position={...le.geo.location},Ue.data=Te,Ue.style=Ne,Ue.draggable=Be):M([{id:ae,type:"group",position:{...le.geo.location},draggable:Be,style:Ne,data:Te}])}for(const le of E.entities){const ae=le.entity.modelId,Ne=le.groupRef&&Y.has(le.groupRef)?le.groupRef:void 0,Te={entity:le.entity,displayMode:i.displayMode.value,collapsed:le.collapsed,locked:le.locked,groupRef:Ne,size:le.geo.size,style:le.style,attributeStyles:le.attributeStyles,operationStyles:le.operationStyles},Be=le.locked?!1:void 0,Ue=Ne?I.get(Ne):void 0,et=Ue?{x:le.geo.location.x-Ue.location.x,y:le.geo.location.y-Ue.location.y}:{...le.geo.location},Ke=P(ae);Ke?(Ke.position=et,Ke.data=Te,Ke.parentNode=Ne,Ke.draggable=Be):M([{id:ae,type:"entity",position:et,parentNode:Ne,draggable:Be,data:Te}])}for(const le of E.notes){const ae=le.note,Ne=ae.modelId,Te=le.groupRef&&Y.has(le.groupRef)?le.groupRef:void 0,Be={note:ae,groupRef:Te},Ue={width:`${ae.geo.size.width}px`,height:`${ae.geo.size.height}px`},et=Te?I.get(Te):void 0,Ke=et?{x:ae.geo.location.x-et.location.x,y:ae.geo.location.y-et.location.y}:{...ae.geo.location},We=P(Ne);We?(We.position=Ke,We.data=Be,We.style=Ue,We.parentNode=Te):M([{id:Ne,type:"note",position:Ke,parentNode:Te,style:Ue,data:Be}])}const F=new Map(E.associations.map(le=>[le.association.modelId,le])),A=new Set(E.noteConnections.map(le=>g(le.noteRef,le.targetRef)));for(const le of[...q.value])!F.has(le.id)&&!A.has(le.id)&&J([le.id]);for(const[le,ae]of F){const Ne={id:le,type:"association",source:ae.association.end1.entityRef,target:ae.association.end2.entityRef,sourceHandle:ae.sourceColumnRef?`r:${ae.sourceColumnRef}`:void 0,targetHandle:ae.targetColumnRef?`l:${ae.targetColumnRef}`:void 0,data:{association:ae.association,sourceColumnRef:ae.sourceColumnRef,targetColumnRef:ae.targetColumnRef}},Te=W(le);Te?(Te.data=Ne.data,Te.sourceHandle=Ne.sourceHandle,Te.targetHandle=Ne.targetHandle):$([Ne])}for(const le of E.noteConnections){const ae=g(le.noteRef,le.targetRef),Ne={noteRef:le.noteRef,targetRef:le.targetRef},Te=W(ae);Te?Te.data=Ne:$([{id:ae,type:"note-connection",source:le.noteRef,target:le.targetRef,data:Ne}])}Ee()}function Ee(){n.nextTick(()=>requestAnimationFrame(()=>X()))}function Se(){const E=R.value.map(Y=>Y.id);if(E.length)return E;const I=i.selection.value;return I&&(I.kind==="entity"||I.kind==="note"||I.kind==="group")?[I.id]:[]}function Ie(E){var F;const I=E.target;if(I&&(I.tagName==="INPUT"||I.tagName==="TEXTAREA"||I.isContentEditable))return;if(E.key==="?"){a.openModal({component:Om,bind:{locale:i.uiLocale.value}}),E.preventDefault();return}if(!i.editable.value){(E.metaKey||E.ctrlKey)&&E.key.toLowerCase()==="c"&&(i.copy(),E.preventDefault());return}if(E.key==="Delete"||E.key==="Backspace"){i.deleteSelection()&&E.preventDefault();return}if(E.key==="ArrowUp"||E.key==="ArrowDown"||E.key==="ArrowLeft"||E.key==="ArrowRight"){if(((F=i.selection.value)==null?void 0:F.kind)==="attribute"){if(E.key==="ArrowUp"||E.key==="ArrowDown"){const Ne=E.key==="ArrowDown"?1:-1;(E.altKey?i.nudgeSelectedAttributes(Ne):i.moveAttributeFocus(Ne))&&E.preventDefault()}return}const A=E.shiftKey?10:1,le=E.key==="ArrowLeft"?-A:E.key==="ArrowRight"?A:0,ae=E.key==="ArrowUp"?-A:E.key==="ArrowDown"?A:0;i.nudgeNodes(Se(),le,ae)&&E.preventDefault();return}if(!(E.metaKey||E.ctrlKey))return;const v=E.key.toLowerCase();v==="c"?(i.copy(),E.preventDefault()):v==="v"?(i.paste(),E.preventDefault()):v==="z"&&(E.shiftKey?i.redo():i.undo(),E.preventDefault())}n.onMounted(async()=>{he(),await n.nextTick(),B(),window.addEventListener("keydown",Ie),window.addEventListener("pointerup",fe),window.addEventListener("pointermove",m,{passive:!0})}),n.onBeforeUnmount(()=>{window.removeEventListener("keydown",Ie),window.removeEventListener("pointerup",fe),window.removeEventListener("pointermove",m)});function fe(){p.value=null}function ge(){d.value=!0,y.value=null}function _e(){var v;d.value=!1;const E=(v=document.elementFromPoint(u.x,u.y))==null?void 0:v.closest(".vue-flow__node"),I=E==null?void 0:E.dataset.id;if(!I){y.value=null;return}const Y=E.classList.contains("vue-flow__node-group")?"group":E.classList.contains("vue-flow__node-note")?"note":"entity";y.value={kind:Y,id:I}}n.watch([()=>i.resolved.value,()=>i.displayMode.value],he),n.watch(()=>i.revision.value,Ee),n.watch(()=>i.resolved.value,E=>{const I=y.value;if(!I)return;(I.kind==="entity"?E.entities.some(v=>v.entity.modelId===I.id):I.kind==="group"?E.groups.some(v=>v.group.modelId===I.id):E.notes.some(v=>v.note.modelId===I.id))||(y.value=null)});function j(E){const I=E.computedPosition??E.position,Y=E.dimensions??{width:0,height:0};return{x:I.x+Y.width/2,y:I.y+Y.height/2}}function H(E){const I=E.node;if(I){if(y.value=null,I.type==="group"){const Y=i.resolved.value.groups.find(v=>v.group.modelId===I.id);f.value=Y?{groupId:I.id,dx:I.position.x-Y.geo.location.x,dy:I.position.y-Y.geo.location.y}:null,p.value=null;return}if(I.type!=="entity"&&I.type!=="note"){p.value=null;return}p.value=me(j(I))}}function x(E){var v;p.value=null,f.value=null;const I=(v=E.nodes)!=null&&v.length?E.nodes:[E.node],Y=I.filter(F=>(F==null?void 0:F.type)==="group");if(Y.length){for(const F of Y){if(!F)continue;const A=i.resolved.value.entities.filter(le=>le.groupRef===F.id).map(le=>{const ae=P(le.entity.modelId),Ne=(ae==null?void 0:ae.computedPosition)??(ae==null?void 0:ae.position)??{x:0,y:0};return{id:le.entity.modelId,location:{x:Ne.x,y:Ne.y}}});i.dragGroup(F.id,{x:F.position.x,y:F.position.y},A)}return}for(const F of I){if(!F||F.type==="group")continue;const A=F.computedPosition??F.position,le=F.dimensions??{width:0,height:0},ae={x:A.x+le.width/2,y:A.y+le.height/2};F.type==="note"?i.dropNote(F.id,{x:A.x,y:A.y},me(ae)):i.dropEntity(F.id,{x:A.x,y:A.y},me(ae))}}function T(E){var Ne,Te,Be,Ue,et;if(!i.editable.value||!E.source||!E.target)return;const I=((Ne=P(E.source))==null?void 0:Ne.type)==="note",Y=((Te=P(E.target))==null?void 0:Te.type)==="note";if(I||Y){if(I&&Y)return;const Ke=I?E.source:E.target,We=I?E.target:E.source;((Be=P(We))==null?void 0:Be.type)==="entity"&&i.addNoteConnection(Ke,We);return}const v=Ke=>{var We;return(We=i.state.logical.entities.find(Ye=>Ye.modelId===Ke))==null?void 0:We.stereotype},F=v(E.source)==="JPA_EMBEDDABLE",A=v(E.target)==="JPA_EMBEDDABLE";if(F||A){if(F&&A)return;const Ke=F?E.source:E.target,We=F?E.target:E.source;i.addEmbedAssociation(We,Ke);return}const le=(Ue=E.sourceHandle)!=null&&Ue.startsWith("r:")?E.sourceHandle.slice(2):void 0,ae=(et=E.targetHandle)!=null&&et.startsWith("l:")?E.targetHandle.slice(2):void 0;i.addAssociation(E.source,E.target,le,ae)}const V=n.ref(null);function te(E,I){var v;const Y=i.state.layout.entityLayouts.find(F=>F.entityRef===E);return at((v=Y==null?void 0:Y.attributeStyles)==null?void 0:v[I])}function de(E,I){var v;const Y=i.state.layout.entityLayouts.find(F=>F.entityRef===E);return at((v=Y==null?void 0:Y.operationStyles)==null?void 0:v[I])}function ke(E){var I;return at((I=i.state.layout.groupLayouts.find(Y=>Y.groupRef===E))==null?void 0:I.style)}function ye(E){var I;return at((I=i.state.layout.notes.find(Y=>Y.modelId===E))==null?void 0:I.style)}function xe(E){var v,F;if(E.preventDefault(),!i.editable.value)return;const I=()=>K({x:E.clientX,y:E.clientY}),Y=[{caption:i.t("em.ctx.addEntity"),icon:"add-entity",handler:()=>{const A=I();i.addEntity("NewEntity",{x:A.x,y:A.y})}},{caption:i.t("em.ctx.addNote"),icon:"note",handler:()=>{const A=I();i.addNote("메모",{x:A.x,y:A.y})}},{caption:i.t("em.ctx.addGroup"),icon:"folder",handler:()=>{const A=I();i.addEmptyGroup({x:A.x,y:A.y})}}];((v=i.clipboard.value)==null?void 0:v.kind)==="entity"&&Y.push({caption:i.t("em.ctx.paste"),icon:"clipboard",handler:()=>i.paste()}),i.resolved.value.entities.length>0&&Y.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()}),(F=V.value)==null||F.open(E,Y)}function $e({event:E,node:I}){var Ne,Te,Be,Ue,et,Ke,We,Ye,we,tt,Wo,qo,Xo,Jo,Zo,Qo,st,Fm;const Y=E;if(Y.preventDefault(),!i.editable.value){if(I.type==="group"||I.type==="note")return;const Oe=(Te=(Ne=Y.target)==null?void 0:Ne.closest("[data-attr]"))==null?void 0:Te.dataset.attr;if(Oe){const Je=i.selection.value;(Je==null?void 0:Je.kind)==="attribute"&&Je.entityId===I.id&&Je.ids.includes(Oe)||i.selectAttribute(I.id,Oe);const Cn=((Be=i.selection.value)==null?void 0:Be.kind)==="attribute"&&i.selection.value.entityId===I.id?[...i.selection.value.ids]:[Oe];(Ue=V.value)==null||Ue.open(Y,[{caption:Cn.length>1?i.t("em.ctx.copyN",{n:Cn.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}(et=V.value)==null||et.open(Y,[{caption:i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>ia(a,i,I.id)},{caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:I.id},i.copy()}}]);return}if(I.type==="group"){const Oe=i.isGroupLocked(I.id),Je=[];Oe||Je.push({type:"swatches",caption:i.t("em.common.color"),current:ke(I.id),onPick:ot=>i.setGroupSwatch(I.id,ot)},{type:"separator"}),Je.push({caption:Oe?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:Oe?"unlock":"lock",handler:()=>i.setGroupLocked(I.id,!Oe)}),Oe||Je.push({type:"separator"},{caption:i.t("em.ctx.ungroup"),icon:"trash",danger:!0,handler:()=>i.removeGroup(I.id)}),(Ke=V.value)==null||Ke.open(Y,Je);return}if(I.type==="note"){(We=V.value)==null||We.open(Y,[{type:"swatches",caption:i.t("em.common.color"),current:ye(I.id),onPick:Oe=>i.setNoteSwatch(I.id,Oe)},{type:"separator"},{caption:i.t("em.ctx.deleteNote"),icon:"trash",danger:!0,handler:()=>i.removeNote(I.id)}]);return}const v=(we=(Ye=Y.target)==null?void 0:Ye.closest("[data-attr]"))==null?void 0:we.dataset.attr;if(v){const Oe=i.selection.value;(Oe==null?void 0:Oe.kind)==="attribute"&&Oe.entityId===I.id&&Oe.ids.includes(v)||i.selectAttribute(I.id,v);const ot=((tt=i.selection.value)==null?void 0:tt.kind)==="attribute"&&i.selection.value.entityId===I.id?[...i.selection.value.ids]:[v];if(i.isEntityLocked(I.id)){(Wo=V.value)==null||Wo.open(Y,[{caption:ot.length>1?i.t("em.ctx.copyN",{n:ot.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}]);return}const Cn=ot.length>1,gl=[{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(I.id)},{type:"swatches",caption:Cn?i.t("em.ctx.colorN",{n:ot.length}):i.t("em.common.color"),current:Cn?null:te(I.id,v),onPick:rA=>i.setAttributeSwatches(I.id,ot,rA)},{type:"separator"},{caption:Cn?i.t("em.ctx.copyN",{n:ot.length}):i.t("em.ctx.copy"),icon:"copy",handler:()=>i.copy()}],ei=i.clipboard.value;(ei==null?void 0:ei.kind)==="attribute"&&gl.push({caption:ei.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:ei.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:I.id},i.paste()}}),gl.push({type:"separator"},{caption:Cn?i.t("em.ctx.deleteAttrN",{n:ot.length}):i.t("em.ctx.deleteAttr"),icon:"trash",danger:!0,handler:()=>i.removeAttributes(I.id,ot)}),(qo=V.value)==null||qo.open(Y,gl);return}const F=(Jo=(Xo=Y.target)==null?void 0:Xo.closest("[data-op]"))==null?void 0:Jo.dataset.op;if(F){if(i.isEntityLocked(I.id))return;(Zo=V.value)==null||Zo.open(Y,[{caption:i.t("em.ctx.addOperation"),icon:"method",handler:()=>i.addOperation(I.id)},{type:"swatches",caption:i.t("em.common.color"),current:de(I.id,F),onPick:Oe=>i.setOperationSwatch(I.id,F,Oe)},{type:"separator"},{caption:i.t("em.ctx.deleteOperation"),icon:"trash",danger:!0,handler:()=>i.removeOperation(I.id,F)}]);return}const A=i.resolved.value.entities.find(Oe=>Oe.entity.modelId===I.id),le=!!(A!=null&&A.locked),ae=[{caption:le?i.t("em.ctx.viewDetail"):i.t("em.ctx.editDetail"),icon:"pencil",handler:()=>ia(a,i,I.id)}];if(!le){ae.push({type:"separator"},{caption:i.t("em.ctx.addAttr"),icon:"field",handler:()=>i.addAttribute(I.id)},{caption:i.t("em.ctx.addMethod"),icon:"method",handler:()=>i.addOperation(I.id)},{caption:i.t("em.ctx.groupInto"),icon:"folder",handler:()=>{const Je=R.value.filter(ot=>ot.type==="entity").map(ot=>ot.id);i.createGroup(Je.includes(I.id)&&Je.length?Je:[I.id])}},{caption:i.t("em.ctx.addSelfAssoc"),icon:"arrow-lr",handler:()=>i.addAssociation(I.id,I.id)});const Oe=i.embeddableCatalog.value;if(Oe.length){ae.push({type:"separator"});for(const Je of Oe){const ot=((Qo=Je.label)==null?void 0:Qo.ko)??((st=Je.label)==null?void 0:st.en)??Je.type;ae.push({caption:i.t("em.ctx.addEmbeddableNamed",{label:ot}),icon:"link",handler:()=>i.addPredefinedEmbed(I.id,Je.type)})}}}if(ae.push({type:"separator"}),ae.push({caption:A!=null&&A.collapsed?i.t("em.panel.expand"):i.t("em.panel.collapse"),icon:A!=null&&A.collapsed?"expand-all":"collapse-all",handler:()=>i.setEntityCollapsed(I.id,!(A!=null&&A.collapsed))}),A!=null&&A.groupRef&&!le&&ae.push({caption:i.t("em.ctx.ungroupEntity"),icon:"folder",handler:()=>i.ungroupEntity(I.id)}),ae.push({caption:le?i.t("em.panel.unlock"):i.t("em.ctx.lock"),icon:le?"unlock":"lock",handler:()=>i.setEntityLocked(I.id,!le)}),ae.push({caption:i.t("em.ctx.copy"),icon:"copy",handler:()=>{i.selection.value={kind:"entity",id:I.id},i.copy()}}),!le){const Oe=i.clipboard.value;(Oe==null?void 0:Oe.kind)==="attribute"&&ae.push({caption:Oe.attributes.length>1?i.t("em.ctx.pasteAttrN",{n:Oe.attributes.length}):i.t("em.ctx.pasteAttr"),icon:"clipboard",handler:()=>{i.selection.value={kind:"entity",id:I.id},i.paste()}}),ae.push({type:"separator"}),ae.push({caption:i.t("em.ctx.deleteEntity"),icon:"trash",danger:!0,handler:()=>i.removeEntity(I.id)})}(Fm=V.value)==null||Fm.open(Y,ae)}function Ve({event:E,edge:I}){var F,A;const Y=E;if(Y.preventDefault(),!i.editable.value)return;const v=N(I.id);if(v){(F=V.value)==null||F.open(Y,[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearNoteConnectionWaypoints(v.noteRef,v.targetRef)},{type:"separator"},{caption:i.t("em.ctx.deleteConnection"),icon:"trash",danger:!0,handler:()=>i.removeNoteConnection(v.noteRef,v.targetRef)}]);return}(A=V.value)==null||A.open(Y,[{caption:i.t("em.ctx.clearWaypoints"),icon:"route",handler:()=>i.clearWaypoints(I.id)},{type:"separator"},{caption:i.t("em.ctx.deleteAssociation"),icon:"trash",danger:!0,handler:()=>i.removeAssociation(I.id)}])}function Le(E){return E==="group"?"group":E==="note"?"note":"entity"}function je({node:E}){if(R.value.length>1){i.selection.value=null;return}i.selection.value={kind:Le(E.type),id:E.id}}function ut({nodes:E}){E.length>1&&(i.selection.value=null)}function C({edge:E}){const I=N(E.id);i.selection.value=I?{kind:"note",id:I.noteRef}:{kind:"association",id:E.id}}function z(E){const I=i.selection.value;return!!I&&I.kind!=="attribute"&&I.id===E.id}function S(E){var I,Y;return z(E)?E.type==="group"?"color-mix(in srgb, var(--em-selection) 22%, transparent)":"var(--em-selection)":E.type==="note"?"var(--em-note-soft)":E.type==="group"?du(at((I=E.data)==null?void 0:I.style),!0)??"var(--em-mm-group)":du(at((Y=E.data)==null?void 0:Y.style))??"var(--em-mm-entity)"}function L(E){return z(E)?"var(--em-selection)":E.type==="note"?"var(--em-note-accent)":E.type==="group"?"var(--em-node-border)":"var(--em-on-surface-muted)"}function O(E,I){re(E,I,{zoom:_().zoom,duration:350})}n.watch(()=>i.focusRequest.value,E=>{if(!E)return;const I=P(E.id);if(!I)return;const Y=I.computedPosition??I.position,v=I.dimensions??{width:0,height:0};O(Y.x+v.width/2,Y.y+v.height/2)});function ue({position:E}){O(E.x,E.y)}function Q({node:E}){i.selection.value={kind:Le(E.type),id:E.id};const I=E.computedPosition??E.position,Y=E.dimensions??{width:0,height:0};O(I.x+Y.width/2,I.y+Y.height/2)}function Z({node:E}){B({nodes:[E.id],duration:350,maxZoom:1.2,padding:.6})}return(E,I)=>(n.openBlock(),n.createElementBlock("div",{class:n.normalizeClass(["em-canvas",{"is-connecting":c.value,"is-panning":d.value}])},[n.createVNode(n.unref(y0),{"min-zoom":.2,"max-zoom":2,"only-render-visible-elements":!ee.value,"delete-key-code":null,"disable-keyboard-a11y":!0,"nodes-draggable":n.unref(i).editable.value,"nodes-connectable":n.unref(i).editable.value,"connection-mode":n.unref(Lt).Loose,"pan-on-scroll":"","zoom-on-scroll":!1,"zoom-on-pinch":!0,"zoom-on-double-click":!1,"zoom-activation-key-code":["Meta","Control"],onMoveStart:ge,onMoveEnd:_e,onConnect:T,onConnectStart:I[1]||(I[1]=Y=>c.value=!0),onConnectEnd:I[2]||(I[2]=Y=>c.value=!1),onNodeDrag:H,onNodeDragStop:x,onNodeClick:je,onEdgeClick:C,onSelectionChange:ut,onPaneClick:I[3]||(I[3]=Y=>n.unref(i).selection.value=null),onPaneContextMenu:xe,onNodeContextMenu:$e,onEdgeContextMenu:Ve},{"node-group":n.withCtx(Y=>[n.createVNode(xu,n.normalizeProps(n.guardReactiveProps(Y)),null,16)]),"node-entity":n.withCtx(Y=>[n.createVNode(vu,n.normalizeProps(n.guardReactiveProps(Y)),null,16)]),"node-note":n.withCtx(Y=>[n.createVNode(Cu,n.normalizeProps(n.guardReactiveProps(Y)),null,16)]),"edge-association":n.withCtx(Y=>[n.createVNode(zu,n.normalizeProps(n.guardReactiveProps(Y)),null,16)]),"edge-note-connection":n.withCtx(Y=>[n.createVNode(hI,n.normalizeProps(n.guardReactiveProps(Y)),null,16)]),default:n.withCtx(()=>[n.unref(i).showGrid.value?(n.openBlock(),n.createBlock(n.unref(oN),{key:0,gap:16,"pattern-color":"var(--em-border)"})):n.createCommentVNode("",!0),n.createVNode(n.unref($N),{"show-interactive":!1,position:"bottom-left"},{default:n.withCtx(()=>[n.unref(i).editable.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createVNode(n.unref(wn),{class:"em-palette__group-start",title:n.unref(i).t("em.ctx.addEntity"),onClick:pe},{default:n.withCtx(()=>[n.createVNode(Re,{name:"add-entity",size:14})]),_:1},8,["title"]),n.createVNode(n.unref(wn),{title:n.unref(i).t("em.ctx.addNote"),onClick:se},{default:n.withCtx(()=>[n.createVNode(Re,{name:"note",size:14})]),_:1},8,["title"]),n.createVNode(n.unref(wn),{title:n.unref(i).t("em.palette.autoLayout"),onClick:I[0]||(I[0]=Y=>n.unref(i).autoLayout())},{default:n.withCtx(()=>[n.createVNode(Re,{name:"auto-layout",size:14})]),_:1},8,["title"])],64)):n.createCommentVNode("",!0)]),_:1}),n.unref(i).showMinimap.value?(n.openBlock(),n.createBlock(n.unref(uI),{key:1,pannable:"",width:224,height:160,"node-color":S,"node-stroke-color":L,"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:ue,onNodeClick:Q,onNodeDblclick:Z})):n.createCommentVNode("",!0)]),_:1},8,["only-render-visible-elements","nodes-draggable","nodes-connectable","connection-mode"]),ne.value?(n.openBlock(),n.createElementBlock("div",UI,[n.unref(i).editable.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("p",HI,n.toDisplayString(n.unref(i).t("em.canvas.emptyTitle")),1),n.createElementVNode("p",{class:"em-canvas__empty-hint",innerHTML:n.unref(i).t("em.canvas.emptyHint")},null,8,FI),n.createElementVNode("p",{class:"em-canvas__empty-hint em-canvas__empty-sub",innerHTML:n.unref(i).t("em.canvas.emptyShortcutHint")},null,8,GI)],64)):(n.openBlock(),n.createElementBlock("p",jI,n.toDisplayString(n.unref(i).t("em.canvas.emptyReadonly")),1))])):n.createCommentVNode("",!0),n.createVNode(n.Transition,{name:"em-conflict-fade"},{default:n.withCtx(()=>[s.value?(n.openBlock(),n.createElementBlock("div",KI,[n.createVNode(Re,{name:"alert-triangle",size:16,class:"em-conflict-banner__icon"}),n.createElementVNode("div",YI,[n.createElementVNode("strong",WI,n.toDisplayString(s.value.title),1),n.createElementVNode("span",qI,n.toDisplayString(s.value.detail),1)])])):n.createCommentVNode("",!0)]),_:1}),n.createVNode(CI,{ref_key:"menuRef",ref:V,locale:n.unref(i).uiLocale.value},null,8,["locale"]),(n.openBlock(),n.createBlock(n.Teleport,{to:"body"},[n.createVNode(n.Transition,{name:"em-toast-fade"},{default:n.withCtx(()=>[r.value?(n.openBlock(),n.createElementBlock("div",XI,n.toDisplayString(r.value),1)):n.createCommentVNode("",!0)]),_:1})]))],2))}}),[["__scopeId","data-v-2fd94c17"]]);function Ia(...e){return e.filter(o=>!!o).join(" ").toLowerCase().trim()||void 0}function JI(e,t){const o=new Set,i=a=>{const r=!!a.matchText&&a.matchText.includes(t);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 ZI={class:"em-explorer em-scroll-overlay"},QI={class:"em-explorer__search"},eS=["placeholder","aria-label"],tS=["aria-label","title"],nS={key:0,class:"em-explorer__empty"},oS={class:"em-explorer__rows"},iS=["data-key","onClick","onDblclick"],aS=["onClick"],rS=["title"],lS={class:"em-key-slot"},sS={class:"em-key-slot"},cS={class:"em-explorer__label"},Lm=Pe(n.defineComponent({__name:"DiagramExplorer",props:{controller:{}},setup(e,{expose:t}){const i=e.controller,a=ie.useModal(),r=n.computed(()=>{var U;const P=i.resolved.value,W=i.displayMode.value,M=i.userLanguage.value,$=G=>{var ne,ce,pe;return ni(W,G.name,(ce=(ne=G.table)==null?void 0:ne.logicalName)==null?void 0:ce[M],(pe=G.table)==null?void 0:pe.physicalName,i.t("em.node.logicalMissing"))},D=W==="PHYSICAL"||W==="LOGICAL_PHYSICAL",J=G=>{const ne=G.attrType.startsWith("RELATION")&&G.dbAttrs.length>0;return{icon:G.attrType.startsWith("RELATION")?"link":"field",keyMarks:{pk:G.identifier,fk:ne&&D}}},B=G=>G.attrType.startsWith("EMBED")&&G.dbAttrs.length>0,re=W==="PHYSICAL"||W==="LOGICAL_PHYSICAL",_=G=>{if(G.attrType!=="EMBED_PREDEF")return G.dbAttrs;const ne=i.embeddableCatalog.value.find(ce=>ce.type===G.type);return ne?G.dbAttrs.map((ce,pe)=>{const se=ne.fields[pe];return se?{...ce,physicalName:ce.physicalName||se.physicalName,logicalName:ce.logicalName??se.logicalName,dataType:ce.dataType||se.dataType,length:ce.length??se.length}:ce}):G.dbAttrs},K=(G,ne)=>{var me,he,Ee,Se,Ie,fe,ge,_e,j;const ce={entityId:ne,attrId:G.modelId};if(B(G)){const H=Ha(W,G);return{key:`attr:${G.modelId}`,label:G.name+(H?` : ${H}`:""),icon:"table",attrRef:ce,focusId:ne,matchText:Ia(G.name,(he=(me=G.dbAttrs[0])==null?void 0:me.logicalName)==null?void 0:he[M],(Ee=G.dbAttrs[0])==null?void 0:Ee.physicalName),children:re?_(G).map(x=>{var T,V;return{key:`attr:${G.modelId}:col:${x.modelId}`,label:ni(W,x.physicalName,(T=x.logicalName)==null?void 0:T[M],x.physicalName,i.t("em.node.logicalMissing"))+(x.dataType?` : ${x.dataType}`:""),icon:"field",attrRef:ce,focusId:ne,matchText:Ia(x.physicalName,(V=x.logicalName)==null?void 0:V[M]),children:[]}}):[]}}const pe=Ua(G,i.state.logical.associations),se=Ha(W,G,pe);return{key:`attr:${G.modelId}`,label:ni(W,G.name,(Ie=(Se=G.dbAttrs[0])==null?void 0:Se.logicalName)==null?void 0:Ie[M],(fe=G.dbAttrs[0])==null?void 0:fe.physicalName,i.t("em.node.logicalMissing"))+(se?` : ${se}`:""),...J(G),attrRef:ce,focusId:ne,matchText:Ia(G.name,(_e=(ge=G.dbAttrs[0])==null?void 0:ge.logicalName)==null?void 0:_e[M],(j=G.dbAttrs[0])==null?void 0:j.physicalName),children:[]}},R=G=>{var pe,se,me;const ne=G.entity,ce=[...ne.attributes].sort((he,Ee)=>he.order-Ee.order);return{key:`entity:${ne.modelId}`,label:$(ne),icon:"table",selectKind:"entity",selectId:ne.modelId,focusId:ne.modelId,matchText:Ia(ne.name,(se=(pe=ne.table)==null?void 0:pe.logicalName)==null?void 0:se[M],(me=ne.table)==null?void 0:me.physicalName),children:ce.map(he=>K(he,ne.modelId))}},X=new Map,ee=[];for(const G of P.entities)if(G.groupRef){const ne=X.get(G.groupRef)??[];ne.push(G),X.set(G.groupRef,ne)}else ee.push(G);const oe=[];for(const G of P.groups){const ne=G.group;oe.push({key:`group:${ne.modelId}`,label:((U=ne.name)==null?void 0:U.ko)||ne.packageName||i.t("em.explorer.groupFallback"),icon:"folder",focusId:ne.modelId,children:(X.get(ne.modelId)??[]).map(R)})}for(const G of ee)oe.push(R(G));if(P.associations.length){const G=new Map(P.entities.map(ne=>[ne.entity.modelId,$(ne.entity)]));oe.push({key:"section:associations",label:i.t("em.explorer.associations",{n:P.associations.length}),icon:"arrow-lr",children:P.associations.map(ne=>{const ce=ne.association,pe=G.get(ce.end1.entityRef)??ce.end1.entityRef,se=G.get(ce.end2.entityRef)??ce.end2.entityRef;return{key:`assoc:${ce.modelId}`,label:`${pe} — ${se}`,icon:"arrow-lr",selectKind:"association",selectId:ce.modelId,children:[]}})})}return P.notes.length&&oe.push({key:"section:notes",label:i.t("em.explorer.notes",{n:P.notes.length}),icon:"note",children:P.notes.map(({note:G})=>{var ne;return{key:`note:${G.modelId}`,label:((ne=G.memo.split(`
|
|
52
|
+
`)[0])==null?void 0:ne.slice(0,30))||i.t("em.explorer.emptyNote"),icon:"note",selectKind:"note",selectId:G.modelId,focusId:G.modelId,children:[]}})}),{key:"root",label:i.state.layout.name||i.t("em.explorer.diagram"),icon:"network",children:oe}});function l(P){return P?P.pk&&P.fk?i.t("em.node.keyPfk"):P.pk?i.t("em.node.keyPk"):P.fk?i.t("em.node.keyFk"):"":""}const s=n.ref(new Set);function c(P){const W=new Set(s.value);W.has(P)?W.delete(P):W.add(P),s.value=W}const d=n.ref(""),u=n.ref(null),m=n.computed(()=>d.value.trim().length>0),p=n.computed(()=>{const P=[];if(m.value){const M=JI(r.value,d.value.trim().toLowerCase()),$=(D,J)=>{if(M.has(D.key)){P.push({node:D,depth:J});for(const B of D.children)$(B,J+1)}};return $(r.value,0),P}const W=(M,$)=>{if(P.push({node:M,depth:$}),!s.value.has(M.key))for(const D of M.children)W(D,$+1)};return W(r.value,0),P}),f=n.computed(()=>m.value&&p.value.length<=1);function y(P){var $;if(P.key!=="/"||P.metaKey||P.ctrlKey||P.altKey||P.shiftKey)return;const W=P.target,M=W==null?void 0:W.tagName;M==="INPUT"||M==="TEXTAREA"||M==="SELECT"||W!=null&&W.isContentEditable||(P.preventDefault(),($=u.value)==null||$.focus())}n.onMounted(()=>window.addEventListener("keydown",y)),n.onBeforeUnmount(()=>window.removeEventListener("keydown",y));const b=n.computed(()=>{const P=[],W=M=>{if(M.children.length){M.key!=="root"&&P.push(M.key);for(const $ of M.children)W($)}};return W(r.value),P}),k=n.computed(()=>!b.value.some(P=>s.value.has(P)));function g(){s.value=k.value?new Set(b.value):new Set}t({toggleAll:g,allExpanded:k,hasExpandable:n.computed(()=>b.value.length>0)});function N(P){const W=i.selection.value;return P.attrRef?(W==null?void 0:W.kind)==="attribute"&&W.entityId===P.attrRef.entityId&&W.ids.includes(P.attrRef.attrId):!!W&&W.kind!=="attribute"&&!!P.selectId&&P.selectKind===W.kind&&P.selectId===W.id}function h(P){const W=i.selection.value;return P.selectKind==="entity"&&(W==null?void 0:W.kind)==="attribute"&&W.entityId===P.selectId}function w(P,W){if(P.attrRef){const M=W.shiftKey?"range":W.metaKey||W.ctrlKey?"toggle":"replace";i.selectAttribute(P.attrRef.entityId,P.attrRef.attrId,M)}else P.selectKind&&P.selectId&&(i.selection.value={kind:P.selectKind,id:P.selectId});P.focusId&&i.requestFocus(P.focusId)}function q(P){P.selectKind==="entity"&&P.selectId&&ia(a,i,P.selectId)}return(P,W)=>(n.openBlock(),n.createElementBlock("section",ZI,[n.createElementVNode("div",QI,[n.createVNode(Re,{name:"search",size:14,class:"em-explorer__search-icon"}),n.withDirectives(n.createElementVNode("input",{ref_key:"searchInput",ref:u,"onUpdate:modelValue":W[0]||(W[0]=M=>d.value=M),class:"em-explorer__search-input",type:"text",placeholder:n.unref(i).t("em.explorer.searchPlaceholder"),"aria-label":n.unref(i).t("em.explorer.searchAria"),onKeydown:W[1]||(W[1]=n.withKeys(M=>d.value="",["esc"]))},null,40,eS),[[n.vModelText,d.value]]),d.value?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"em-explorer__search-clear","aria-label":n.unref(i).t("em.explorer.clearSearchAria"),title:n.unref(i).t("em.explorer.clearSearchTitle"),onClick:W[2]||(W[2]=M=>d.value="")},[n.createVNode(Re,{name:"x",size:13})],8,tS)):n.createCommentVNode("",!0)]),f.value?(n.openBlock(),n.createElementBlock("p",nS,n.toDisplayString(n.unref(i).t("em.explorer.noMatches")),1)):n.createCommentVNode("",!0),n.createElementVNode("div",oS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(p.value,({node:M,depth:$})=>(n.openBlock(),n.createElementBlock("div",{key:M.key,class:n.normalizeClass(["em-explorer__row",{"is-active":N(M),"is-focus-parent":h(M),"is-selectable":!!M.selectKind||!!M.attrRef||!!M.focusId}]),"data-key":M.key,style:n.normalizeStyle({paddingLeft:4+$*14+"px"}),onClick:D=>w(M,D),onDblclick:D=>q(M)},[n.createElementVNode("span",{class:n.normalizeClass(["em-explorer__chevron",{"is-leaf":!M.children.length,"is-open":!s.value.has(M.key)}]),onClick:n.withModifiers(D=>M.children.length&&c(M.key),["stop"])},[M.children.length?(n.openBlock(),n.createBlock(Re,{key:0,name:"chevron",size:14})):n.createCommentVNode("",!0)],10,aS),M.keyMarks?(n.openBlock(),n.createElementBlock("span",{key:0,class:"em-explorer__keys",title:l(M.keyMarks),"aria-hidden":"true"},[n.createElementVNode("span",lS,[M.keyMarks.pk?(n.openBlock(),n.createBlock(Re,{key:0,name:"key",size:14,class:"em-key is-pk"})):M.keyMarks.fk?n.createCommentVNode("",!0):(n.openBlock(),n.createBlock(Re,{key:1,class:"em-explorer__icon",name:M.icon,size:14},null,8,["name"]))]),n.createElementVNode("span",sS,[M.keyMarks.fk?(n.openBlock(),n.createBlock(Re,{key:0,name:"key",size:14,class:"em-key is-fk"})):n.createCommentVNode("",!0)])],8,rS)):(n.openBlock(),n.createBlock(Re,{key:1,class:"em-explorer__icon",name:M.icon,size:15},null,8,["name"])),n.createElementVNode("span",cS,n.toDisplayString(M.label),1)],46,iS))),128))])]))}}),[["__scopeId","data-v-7b20d13b"]]),dS={class:"em-text-export"},uS={key:0,class:"em-text-export__tabs",role:"tablist"},mS=["aria-selected","onClick"],fS={class:"em-text-export__pre"},pS={class:"em-text-export__actions"},hS=Pe(n.defineComponent({__name:"TextExportModal",props:{formats:{},title:{},locale:{}},setup(e){const t=e,o=ie.useModalHandle(),i=(c,d)=>Rt(t.locale??"ko",c,d),a=n.ref(0);function r(){return t.formats[a.value]??t.formats[0]}async function l(){try{await navigator.clipboard.writeText(r().content),ie.showNotification(i("em.export.copied"),"info")}catch{ie.showNotification(i("em.export.copyFailed"),"error")}}function s(){const c=r(),d=new Blob([c.content],{type:"text/plain;charset=utf-8"}),u=URL.createObjectURL(d);try{const m=document.createElement("a");m.href=u,m.download=c.filename,document.body.appendChild(m),m.click(),m.remove()}finally{URL.revokeObjectURL(u)}}return(c,d)=>(n.openBlock(),n.createBlock(n.unref(ie.BSModalFrame),{title:t.title??i("em.export.title")},{default:n.withCtx(()=>[n.createElementVNode("div",dS,[t.formats.length>1?(n.openBlock(),n.createElementBlock("div",uS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(t.formats,(u,m)=>(n.openBlock(),n.createElementBlock("button",{key:u.key,type:"button",role:"tab",class:n.normalizeClass(["em-text-export__tab",{"is-active":m===a.value}]),"aria-selected":m===a.value,onClick:p=>a.value=m},n.toDisplayString(u.label),11,mS))),128))])):n.createCommentVNode("",!0),n.createElementVNode("pre",fS,n.toDisplayString(r().content),1),n.createElementVNode("div",pS,[n.createVNode(n.unref(ie.BSButton),{caption:i("em.export.copy"),onClick:l},null,8,["caption"]),n.createVNode(n.unref(ie.BSButton),{caption:i("em.export.download"),onClick:s},null,8,["caption"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:i("em.common.close"),onClick:d[0]||(d[0]=u=>n.unref(o).close())},null,8,["caption"])])])]),_:1},8,["title"]))}}),[["__scopeId","data-v-f31001c1"]]),yS={class:"em-toolbar"},gS={class:"em-toolbar__mode"},zm=Pe(n.defineComponent({__name:"EditorToolbar",props:{controller:{},historyOpen:{type:Boolean}},emits:["exportSvg","exportPng","toggleHistory"],setup(e,{emit:t}){const i=e.controller,a=t,r=ie.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=n.computed({get:()=>i.displayMode.value,set:f=>i.displayMode.value=f});function c(){i.routingMode.value=i.routingMode.value==="straight"?"orthogonal":"straight"}const d=n.computed(()=>{const f=i.resolved.value.entities;return f.length>0&&f.every(y=>y.collapsed)});function u(){d.value?i.expandAll():i.collapseAll()}function m(){const f=i.state.logical;r.openModal({component:hS,bind:{title:i.t("em.toolbar.exportText"),locale:i.uiLocale.value,formats:[{key:"text",label:i.t("em.export.formatText"),content:Cl(f),filename:"diagram.txt"},{key:"mermaid-er",label:i.t("em.export.formatMermaidEr"),content:Da(f,"er"),filename:"diagram.er.mmd"},{key:"mermaid-class",label:i.t("em.export.formatMermaidClass"),content:Da(f,"class"),filename:"diagram.class.mmd"}]}})}function p(){r.openModal({component:Om,bind:{locale:i.uiLocale.value}})}return(f,y)=>(n.openBlock(),n.createElementBlock("div",yS,[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:n.unref(i).t("em.toolbar.undo"),disabled:!n.unref(i).canUndo.value||!n.unref(i).editable.value,onClick:y[0]||(y[0]=b=>n.unref(i).undo())},{left:n.withCtx(()=>[n.createVNode(Re,{name:"undo",size:16})]),_:1},8,["tooltip","disabled"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:n.unref(i).t("em.toolbar.redo"),disabled:!n.unref(i).canRedo.value||!n.unref(i).editable.value,onClick:y[1]||(y[1]=b=>n.unref(i).redo())},{left:n.withCtx(()=>[n.createVNode(Re,{name:"redo",size:16})]),_:1},8,["tooltip","disabled"]),y[9]||(y[9]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createElementVNode("label",gS,[n.createTextVNode(n.toDisplayString(n.unref(i).t("em.toolbar.displayLabel"))+" ",1),n.createVNode(n.unref(ie.BSSelect),{modelValue:s.value,"onUpdate:modelValue":y[2]||(y[2]=b=>s.value=b),items:l,"value-provider":b=>b.v,"label-provider":b=>n.unref(i).t(b.labelKey)},null,8,["modelValue","value-provider","label-provider"])]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(i).t(n.unref(i).routingMode.value==="orthogonal"?"em.toolbar.routingOrthogonal":"em.toolbar.routingStraight"),tooltip:n.unref(i).t("em.toolbar.routingToggle"),onClick:c},{left:n.withCtx(()=>[n.createVNode(Re,{name:"route",size:16})]),_:1},8,["caption","tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":n.unref(i).showGrid.value}]),caption:n.unref(i).t("em.toolbar.grid"),tooltip:n.unref(i).t(n.unref(i).showGrid.value?"em.toolbar.gridOff":"em.toolbar.gridOn"),onClick:y[3]||(y[3]=b=>n.unref(i).showGrid.value=!n.unref(i).showGrid.value)},{left:n.withCtx(()=>[n.createVNode(Re,{name:"grid",size:16})]),_:1},8,["class","caption","tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":n.unref(i).showMinimap.value}]),caption:n.unref(i).t("em.toolbar.minimap"),tooltip:n.unref(i).t(n.unref(i).showMinimap.value?"em.toolbar.minimapOff":"em.toolbar.minimapOn"),onClick:y[4]||(y[4]=b=>n.unref(i).showMinimap.value=!n.unref(i).showMinimap.value)},{left:n.withCtx(()=>[n.createVNode(Re,{name:"map",size:16})]),_:1},8,["class","caption","tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(i).t(d.value?"em.panel.expandAll":"em.panel.collapseAll"),disabled:!n.unref(i).editable.value,onClick:u},{left:n.withCtx(()=>[n.createVNode(Re,{name:d.value?"expand-all":"collapse-all",size:16},null,8,["name"])]),_:1},8,["caption","disabled"]),y[10]||(y[10]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:n.unref(i).t("em.toolbar.exportText"),onClick:m},{left:n.withCtx(()=>[n.createVNode(Re,{name:"file-text",size:16})]),_:1},8,["tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:n.unref(i).t("em.toolbar.exportSvg"),onClick:y[5]||(y[5]=b=>a("exportSvg"))},{left:n.withCtx(()=>[n.createVNode(Re,{name:"image",size:16})]),_:1},8,["tooltip"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn",tooltip:n.unref(i).t("em.toolbar.exportPng"),onClick:y[6]||(y[6]=b=>a("exportPng"))},{left:n.withCtx(()=>[n.createVNode(Re,{name:"camera",size:16})]),_:1},8,["tooltip"]),n.unref(i).historyAvailable.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[y[8]||(y[8]=n.createElementVNode("span",{class:"em-toolbar__sep"},null,-1)),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:n.normalizeClass(["em-toolbar__toggle",{"is-active":e.historyOpen}]),caption:n.unref(i).t("em.toolbar.history"),tooltip:n.unref(i).t(e.historyOpen?"em.toolbar.historyClose":"em.toolbar.historyOpen"),onClick:y[7]||(y[7]=b=>a("toggleHistory"))},{left:n.withCtx(()=>[n.createVNode(Re,{name:"undo",size:16})]),_:1},8,["class","caption","tooltip"])],64)):n.createCommentVNode("",!0),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-toolbar__icon-btn em-toolbar__help",tooltip:n.unref(i).t("em.toolbar.shortcuts"),onClick:p},{left:n.withCtx(()=>[n.createVNode(Re,{name:"help",size:16})]),_:1},8,["tooltip"])]))}}),[["__scopeId","data-v-ca5af952"]]),bS=["title"],_S=["title"],kS=["disabled","aria-pressed"],ES=["disabled","aria-pressed"],wS=Pe(n.defineComponent({__name:"EditModeToggle",props:{editable:{type:Boolean},opMode:{type:Boolean},frozen:{type:Boolean},locale:{}},emits:["toggle"],setup(e,{emit:t}){const o=e,i=t,a=l=>Rt(o.locale??"ko",l);function r(l){o.frozen||!o.opMode||l!==o.editable&&i("toggle")}return(l,s)=>e.frozen?(n.openBlock(),n.createElementBlock("div",{key:0,class:"em-mode-toggle em-mode-frozen",role:"status",title:a("em.mode.frozenTitle")},[n.createVNode(Re,{name:"lock",size:14}),n.createElementVNode("span",null,n.toDisplayString(a("em.mode.frozen")),1)],8,bS)):(n.openBlock(),n.createElementBlock("div",{key:1,class:n.normalizeClass(["em-mode-toggle em-mode-segment",{"is-readonly":!e.opMode}]),role:"group",title:e.opMode?void 0:a("em.mode.readonlyTitle")},[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-seg",{"is-active":!e.editable}]),disabled:!e.opMode,"aria-pressed":!e.editable,onClick:s[0]||(s[0]=c=>r(!1))},[n.createVNode(Re,{name:"eye",size:13}),n.createElementVNode("span",null,n.toDisplayString(a("em.mode.view")),1)],10,kS),n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-seg",{"is-active":e.editable}]),disabled:!e.opMode,"aria-pressed":e.editable,onClick:s[1]||(s[1]=c=>r(!0))},[n.createVNode(Re,{name:"pencil",size:13}),n.createElementVNode("span",null,n.toDisplayString(a("em.mode.edit")),1)],10,ES)],10,_S))}}),[["__scopeId","data-v-2b5162b7"]]),NS=["disabled"],vS={class:"em-panel__sub"},xS={class:"em-nav"},CS={key:0,class:"em-nav__divider","aria-hidden":"true"},IS={key:1},SS=["onClick","onKeydown"],$S={class:"em-nav__name"},RS=["title"],AS={key:0,class:"em-panel__note"},TS=["data-attr-block"],VS={class:"em-attr__row"},MS=["title"],BS={key:0,class:"em-attr__row"},DS={class:"em-attr__row"},OS={class:"em-attr__row"},PS={class:"em-attr__flags"},LS={class:"em-attr__pii"},zS={class:"em-attr__pii"},US={class:"em-attr__pii"},HS={key:0,class:"em-attr__pii em-attr__codetop"},FS={class:"em-multilang"},GS={key:2,class:"em-embed-cols"},jS={class:"em-embed-col__label"},KS={class:"em-attr__row"},YS={class:"em-attr__row"},WS={key:0,class:"em-embed-upd"},qS={class:"em-embed-upd"},XS={class:"em-embed-upd"},JS={class:"em-swatch__row em-attr__swatch"},ZS=["title","onClick"],QS=["title","onClick"],e$={key:0,class:"em-attr__swatch-hint"},Sa="__OWN__",t$=Pe(n.defineComponent({__name:"EntityColumnsSection",props:{controller:{},entityId:{}},setup(e){const t=e,o=t.controller,i=n.computed(()=>o.state.logical.entities.find(v=>v.modelId===t.entityId)??null),a=n.computed(()=>i.value?o.state.layout.entityLayouts.find(v=>v.entityRef===i.value.modelId)??null:null),r=n.computed(()=>{var v;return((v=i.value)==null?void 0:v.stereotype)==="JPA_EMBEDDABLE"}),l=n.computed(()=>new Set(o.selectedAttrIds.value)),s=n.computed(()=>{var v;return((v=i.value)==null?void 0:v.attributes.filter(F=>F.attrType!=="DIVIDER"))??[]}),c=n.computed(()=>{var v;return((v=i.value)==null?void 0:v.attributes)??[]}),d=n.computed(()=>s.value.filter(v=>l.value.has(v.modelId)));function u(v){return{pk:v.identifier,fk:v.attrType.startsWith("RELATION")&&v.dbAttrs.length>0,required:v.notNull&&!v.identifier}}function m(v){return!!i.value&&!!ki(o.state.logical,i.value.modelId,v.modelId)}function p(v){const F=u(v),A=[F.pk&&"PK",F.fk&&"FK",F.required&&"NOT NULL"].filter(Boolean);return A.length?A.join(" · "):void 0}function f(v,F){i.value&&o.selectAttribute(i.value.modelId,v.modelId,F.shiftKey?"range":F.metaKey||F.ctrlKey?"toggle":"replace")}const y=["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 b(v){return v==="none"?o.t("em.common.noneParen"):v}const k=v=>v;function g(v){var F,A;return at((A=(F=a.value)==null?void 0:F.attributeStyles)==null?void 0:A[v.modelId])}function N(v){return l.value.size>1&&l.value.has(v.modelId)}function h(v,F){if(!i.value)return;const A=N(v)?o.selectedAttrIds.value:[v.modelId];o.setAttributeSwatches(i.value.modelId,A,F)}function w(v,F){i.value&&o.updateAttribute(i.value.modelId,v.modelId,F)}function q(v,F){w(v,{naturalId:F||void 0,naturalIdMutable:F?v.naturalIdMutable:void 0})}function P(){return{naturalId:void 0,naturalIdMutable:void 0}}function W(v,F){w(v,{identifier:F,...F?P():{}})}function M(v,F){w(v,{transient:F||void 0,...F?P():{}})}function $(v){return!!v.transient}const D=v=>v.value,J=v=>v.label;function B(v,F){if(!F)return;const A=U.value.find(le=>le.type===F);if(A){const le=v.dbAttrs[0]??{modelId:v.modelId+".c",physicalName:v.name,dataType:"VARCHAR"};w(v,{type:F,customType:void 0,dbAttrs:[{...le,dataType:A.dataType,length:A.length,scale:A.scale}]});return}w(v,F===wt?{type:F}:{type:F,customType:void 0})}function re(v,F){w(v,{customType:F.trim()===""?void 0:F})}function _(v,F){const le={...v.dbAttrs[0]??{modelId:v.modelId+".c",physicalName:v.name,dataType:"VARCHAR"},...F};F.dataType!==void 0&&!ro.has(le.dataType)&&(le.scale=void 0),w(v,{dbAttrs:[le]})}function K(v){var F;return ro.has(((F=v.dbAttrs[0])==null?void 0:F.dataType)??"")}function R(v,F){_(v,{logicalName:Object.keys(F).length?F:void 0})}function X(v,F){w(v,{description:Object.keys(F).length?F:void 0})}function ee(v){return v.personalInfoAttributeType??"none"}function oe(v,F){w(v,{personalInfoAttributeType:F==="none"?void 0:F})}const U=n.computed(()=>o.predefinedCustomTypeCatalog.value),G=n.computed(()=>o.embeddableCatalog.value),ne=n.ref(void 0);function ce(v){var F,A;return((F=v.label)==null?void 0:F.ko)??((A=v.label)==null?void 0:A.en)??v.type}function pe(v){if(!v||!i.value)return;const F=o.addPredefinedEmbed(i.value.modelId,v);F&&o.selectAttribute(i.value.modelId,F),ne.value=void 0}function se(){if(!i.value)return;const v=o.addAttribute(i.value.modelId);o.selectAttribute(i.value.modelId,v)}const me=n.computed(()=>o.groupCodeCatalog.value);function he(v){var F;return((F=me.value.find(A=>A.groupCode===v.groupCode))==null?void 0:F.codes)??[]}function Ee(v){return["none",...he(v)]}function Se(v){return v==="none"?"none":v.code}function Ie(v){var A,le;if(v==="none")return o.t("em.common.noneParen");const F=((A=v.label)==null?void 0:A.ko)??((le=v.label)==null?void 0:le.en);return F?`${v.code} (${F})`:v.code}function fe(v,F){i.value&&o.setAttributeGroupCode(i.value.modelId,v.modelId,F)}function ge(v,F){w(v,{defaultValue:F==="none"?void 0:F})}function _e(v,F){w(v,{defaultValue:F.trim()===""?void 0:F})}function j(v){return v.attrType.startsWith("EMBED")&&v.dbAttrs.length>0}function H(v,F,A){const le=v.dbAttrs.map((ae,Ne)=>{if(Ne!==F)return ae;const Te={...ae,...A};for(const Be of Object.keys(A))A[Be]===void 0&&delete Te[Be];return Te});i.value&&o.setEmbedColumns(i.value.modelId,v.modelId,le)}function x(v,F,A){H(v,F,{logicalName:Object.keys(A).length?A:void 0})}function T(v,F){var ae,Ne,Te;if(v.attrType==="EMBED_PREDEF"){const Be=(ae=o.embeddableCatalog.value.find(Ue=>Ue.type===v.type))==null?void 0:ae.fields[F];return Be?{name:Be.name,physicalName:Be.physicalName,dataType:Be.dataType,length:Be.length,shareable:Be.shareable,logicalName:Be.logicalName}:void 0}const A=(Ne=v.embedded)==null?void 0:Ne.embeddableRef;if(!A)return;const le=(Te=o.state.logical.entities.find(Be=>Be.modelId===A))==null?void 0:Te.attributes.flatMap(Be=>Be.dbAttrs)[F];return le?{physicalName:le.physicalName,dataType:le.dataType,length:le.length,scale:le.scale,logicalName:le.logicalName}:void 0}function V(v,F){var A,le;return((A=T(v,F))==null?void 0:A.dataType)||((le=v.dbAttrs[F])==null?void 0:le.dataType)||""}function te(v,F){var A,le;return((A=T(v,F))==null?void 0:A.length)??((le=v.dbAttrs[F])==null?void 0:le.length)}function de(v,F){var A,le;return((A=T(v,F))==null?void 0:A.scale)??((le=v.dbAttrs[F])==null?void 0:le.scale)}const ke=["inherit","true","false"];function ye(v){return v==="inherit"?o.t("em.common.inherit"):v}function xe(v){return(v==null?void 0:v.updatable)===void 0?"inherit":v.updatable?"true":"false"}function $e(v,F,A){H(v,F,{updatable:A==="inherit"?void 0:A==="true"})}function Ve(v,F){_(v,{updatable:F==="inherit"?void 0:F==="true"})}const Le=["inherit","true","false"];function je(v){return v==="inherit"?o.t("em.common.inherit"):v}function ut(v){return(v==null?void 0:v.insertable)===void 0?"inherit":v.insertable?"true":"false"}function C(v,F,A){H(v,F,{insertable:A==="inherit"?void 0:A==="true"})}function z(v,F){_(v,{insertable:F==="inherit"?void 0:F==="true"})}const S=n.computed(()=>i.value?ii(i.value,o.state.logical.entities):[]),L=n.computed(()=>tn(S.value.flatMap(v=>v.attributes.flatMap(F=>F.dbAttrs)))),O=n.computed(()=>S.value.flatMap(v=>v.attributes.filter(F=>F.attrType==="NORMAL"&&F.dbAttrs.length===1&&F.dbAttrs[0]).map(F=>{var A;return{modelId:F.dbAttrs[0].modelId,physical:F.dbAttrs[0].physicalName||F.name,isCurrency:F.type==="Currency",ownerName:v.modelId===((A=i.value)==null?void 0:A.modelId)?void 0:v.name}})));function ue(){const v=[...O.value].sort((F,A)=>Number(A.isCurrency)-Number(F.isCurrency));return[Sa,...v.map(F=>F.modelId)]}function Q(v){if(v===Sa)return o.t("em.attr.sharedOwn");const F=O.value.find(le=>le.modelId===v);if(!F)return v;const A=F.ownerName?`${F.ownerName}.`:"";return o.t("em.attr.sharedRef",{owner:A,physical:F.physical,mode:F.isCurrency?o.t("em.attr.currencyMode"):o.t("em.attr.sharedMode")})}function Z(v){return(v==null?void 0:v.sharedColumnRef)??Sa}function E(v,F,A){H(v,F,{sharedColumnRef:A===Sa?void 0:A})}function I(v){return(v==null?void 0:v.sharedColumnRef)!=null}function Y(v){var F;return((F=Rn(v,L.value))==null?void 0:F.physicalName)??""}return(v,F)=>i.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!n.unref(o).editable.value},[n.createElementVNode("h4",vS,[n.createTextVNode(n.toDisplayString(n.unref(o).t("em.attr.section",{n:s.value.length}))+" ",1),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(o).t("em.common.add"),onClick:se},null,8,["caption"]),G.value.length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"120px",placeholder:n.unref(o).t("em.attr.addEmbeddable"),"model-value":ne.value,items:G.value,"value-provider":A=>A.type,"label-provider":ce,"onUpdate:modelValue":pe},null,8,["placeholder","model-value","items","value-provider"])):n.createCommentVNode("",!0)]),n.createElementVNode("ul",xS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(c.value,A=>(n.openBlock(),n.createElementBlock(n.Fragment,{key:A.modelId},[A.attrType==="DIVIDER"?(n.openBlock(),n.createElementBlock("li",CS,[...F[0]||(F[0]=[n.createElementVNode("hr",null,null,-1)])])):(n.openBlock(),n.createElementBlock("li",IS,[n.createElementVNode("div",{class:n.normalizeClass(["em-nav__item",{"is-selected":l.value.has(A.modelId)}]),role:"button",tabindex:"0",onClick:le=>f(A,le),onKeydown:[n.withKeys(n.withModifiers(le=>f(A,le),["prevent"]),["enter"]),n.withKeys(n.withModifiers(le=>f(A,le),["prevent"]),["space"])]},[n.createElementVNode("span",$S,n.toDisplayString(A.name||n.unref(o).t("em.attr.nameless")),1),n.createElementVNode("span",{class:"em-nav__marks",title:p(A)},[u(A).pk?(n.openBlock(),n.createBlock(Re,{key:0,name:"key",size:12,class:"em-nav-key is-pk"})):u(A).required?(n.openBlock(),n.createBlock(Re,{key:1,name:"asterisk",size:14,class:"em-nav-key is-required"})):n.createCommentVNode("",!0),u(A).fk?(n.openBlock(),n.createBlock(Re,{key:2,name:"key",size:12,class:"em-nav-key is-fk"})):n.createCommentVNode("",!0)],8,RS)],42,SS)]))],64))),128))]),s.value.length&&!d.value.length?(n.openBlock(),n.createElementBlock("p",AS,n.toDisplayString(n.unref(o).t("em.attr.selectHint")),1)):n.createCommentVNode("",!0),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(d.value,A=>{var le,ae,Ne,Te,Be,Ue,et,Ke,We,Ye;return n.openBlock(),n.createElementBlock("div",{key:A.modelId,class:n.normalizeClass(["em-attr",{"is-focused":l.value.has(A.modelId)}]),"data-attr-block":A.modelId},[n.createElementVNode("div",VS,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-name-${A.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.namePlaceholder"),"model-value":A.name,"onUpdate:modelValue":we=>w(A,{name:we})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSSelect),{name:`attr-type-${A.modelId}`,width:"84px",placeholder:n.unref(o).t("em.attr.typePlaceholder"),disabled:A.attrType.startsWith("EMBED")||!!A.groupCode,items:n.unref(Ml)(A.type,U.value),"value-provider":D,"label-provider":J,"model-value":A.type,"onUpdate:modelValue":we=>B(A,we)},null,8,["name","placeholder","disabled","items","model-value","onUpdate:modelValue"]),n.createElementVNode("span",{title:m(A)?n.unref(o).t("em.attr.fkDeleteHint"):void 0},[n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:we=>n.unref(o).removeAttribute(i.value.modelId,A.modelId)},null,8,["onClick"])],8,MS)]),A.type===n.unref(wt)?(n.openBlock(),n.createElementBlock("div",BS,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-customtype-${A.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.customTypePlaceholder"),"model-value":A.customType??"","onUpdate:modelValue":we=>re(A,we)},null,8,["name","placeholder","model-value","onUpdate:modelValue"])])):n.createCommentVNode("",!0),j(A)?(n.openBlock(),n.createElementBlock("div",GS,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(A.dbAttrs,(we,tt)=>{var Wo,qo,Xo,Jo,Zo,Qo;return n.openBlock(),n.createElementBlock("div",{key:we.modelId,class:"em-embed-col"},[n.createElementVNode("span",jS,n.toDisplayString(((Wo=T(A,tt))==null?void 0:Wo.name)??((qo=T(A,tt))==null?void 0:qo.physicalName)??n.unref(o).t("em.attr.colFallback",{n:tt+1})),1),n.createElementVNode("div",KS,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`embed-col-${we.modelId}`,width:"100%",disabled:I(we),placeholder:((Xo=T(A,tt))==null?void 0:Xo.physicalName)??n.unref(o).t("em.attr.columnPlaceholder"),"model-value":I(we)?Y(we):we.physicalName,"onUpdate:modelValue":st=>H(A,tt,{physicalName:st})},null,8,["name","disabled","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSTextInput),{name:`embed-dtype-${we.modelId}`,width:"84px",disabled:"","model-value":V(A,tt)},null,8,["name","model-value"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`embed-len-${we.modelId}`,width:"48px",disabled:"","model-value":te(A,tt)},null,8,["name","model-value"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`embed-scale-${we.modelId}`,width:"48px",disabled:"","model-value":de(A,tt)},null,8,["name","model-value"])]),n.createVNode(_n,{controller:n.unref(o),"ref-id":we.modelId},null,8,["controller","ref-id"]),n.createElementVNode("div",YS,[n.createVNode(kn,{class:"grow",name:`embed-logical-${we.modelId}`,languages:n.unref(o).languages.value,"default-lang":n.unref(o).userLanguage.value,placeholder:((Zo=(Jo=T(A,tt))==null?void 0:Jo.logicalName)==null?void 0:Zo.ko)??n.unref(o).t("em.attr.logicalPlaceholder"),"model-value":we.logicalName,"onUpdate:modelValue":st=>x(A,tt,st)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),(Qo=T(A,tt))!=null&&Qo.shareable?(n.openBlock(),n.createElementBlock("label",WS,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.currencyColumn")),1),n.createVNode(n.unref(ie.BSSelect),{width:"110px","model-value":Z(we),items:ue(),"value-provider":k,"label-provider":Q,"onUpdate:modelValue":st=>st&&E(A,tt,st)},null,8,["model-value","items","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",qS,[F[3]||(F[3]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px",disabled:I(we),"model-value":I(we)?"false":ut(we),items:Le,"value-provider":k,"label-provider":je,"onUpdate:modelValue":st=>st&&C(A,tt,st)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",XS,[F[4]||(F[4]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"110px",disabled:I(we),"model-value":I(we)?"false":xe(we),items:ke,"value-provider":k,"label-provider":ye,"onUpdate:modelValue":st=>st&&$e(A,tt,st)},null,8,["disabled","model-value","onUpdate:modelValue"])])])}),128))])):(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createElementVNode("div",DS,[n.createVNode(kn,{class:"grow",name:`attr-logical-${A.modelId}`,languages:n.unref(o).languages.value,"default-lang":n.unref(o).userLanguage.value,placeholder:n.unref(o).t("em.attr.logicalPlaceholder"),"model-value":(le=A.dbAttrs[0])==null?void 0:le.logicalName,"onUpdate:modelValue":we=>R(A,we)},null,8,["name","languages","default-lang","placeholder","model-value","onUpdate:modelValue"])]),n.createElementVNode("div",OS,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`attr-col-${A.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.columnPlaceholder"),disabled:$(A),"model-value":((ae=A.dbAttrs[0])==null?void 0:ae.physicalName)??"","onUpdate:modelValue":we=>_(A,{physicalName:we})},null,8,["name","placeholder","disabled","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSSelect),{name:`attr-dtype-${A.modelId}`,width:"84px",placeholder:"dataType",disabled:$(A),items:n.unref(Tl)(((Ne=A.dbAttrs[0])==null?void 0:Ne.dataType)??"",n.unref(o).selectableDataTypes.value),"value-provider":k,"label-provider":n.unref(La),"model-value":((Te=A.dbAttrs[0])==null?void 0:Te.dataType)??"","onUpdate:modelValue":we=>we&&_(A,{dataType:we})},null,8,["name","disabled","items","label-provider","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`attr-len-${A.modelId}`,width:"48px",placeholder:"len",disabled:$(A),"model-value":(Be=A.dbAttrs[0])==null?void 0:Be.length,"onUpdate:modelValue":we=>_(A,{length:we||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSNumberInput),{name:`attr-scale-${A.modelId}`,width:"48px",placeholder:"scale",disabled:$(A)||!K(A),"model-value":(Ue=A.dbAttrs[0])==null?void 0:Ue.scale,"onUpdate:modelValue":we=>_(A,{scale:we||void 0})},null,8,["name","disabled","model-value","onUpdate:modelValue"])]),n.createVNode(_n,{controller:n.unref(o),"ref-id":(et=A.dbAttrs[0])==null?void 0:et.modelId},null,8,["controller","ref-id"]),n.createElementVNode("div",PS,[n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-pk-${A.modelId}`,label:"Primary Key","model-value":A.identifier,disabled:r.value||$(A),"onUpdate:modelValue":we=>W(A,we)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-nn-${A.modelId}`,label:"Not Null","model-value":A.notNull,disabled:$(A),"onUpdate:modelValue":we=>w(A,{notNull:we})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-uq-${A.modelId}`,label:"Unique","model-value":!!((Ke=A.dbAttrs[0])!=null&&Ke.unique),disabled:$(A),"onUpdate:modelValue":we=>_(A,{unique:we})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-ai-${A.modelId}`,label:"Auto Increment","model-value":!!((We=A.dbAttrs[0])!=null&&We.autoIncrement),disabled:$(A)||!A.identifier,"onUpdate:modelValue":we=>_(A,{autoIncrement:we})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-tr-${A.modelId}`,label:"@Transient","model-value":!!A.transient,disabled:A.identifier,"onUpdate:modelValue":we=>M(A,we)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-nid-${A.modelId}`,label:"@NaturalId","model-value":!!A.naturalId,disabled:A.identifier||$(A),"onUpdate:modelValue":we=>q(A,we)},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{class:"em-attr__flag-sub",name:`attr-nidm-${A.modelId}`,label:"mutable","model-value":!!A.naturalIdMutable,disabled:$(A)||!A.naturalId,"onUpdate:modelValue":we=>w(A,{naturalIdMutable:we||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`attr-mv-${A.modelId}`,label:"Multi-Value (Set)","model-value":!!((Ye=A.dbAttrs[0])!=null&&Ye.multiValue),disabled:$(A),"onUpdate:modelValue":we=>_(A,{multiValue:we||void 0})},null,8,["name","model-value","disabled","onUpdate:modelValue"])]),n.createElementVNode("label",LS,[F[1]||(F[1]=n.createElementVNode("span",null,"insertable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"100%",disabled:$(A),"model-value":ut(A.dbAttrs[0]),items:Le,"value-provider":k,"label-provider":je,"onUpdate:modelValue":we=>we&&z(A,we)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",zS,[F[2]||(F[2]=n.createElementVNode("span",null,"updatable",-1)),n.createVNode(n.unref(ie.BSSelect),{width:"100%",disabled:$(A),"model-value":xe(A.dbAttrs[0]),items:ke,"value-provider":k,"label-provider":ye,"onUpdate:modelValue":we=>we&&Ve(A,we)},null,8,["disabled","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",US,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.pii")),1),n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":ee(A),items:y,"value-provider":k,"label-provider":b,"onUpdate:modelValue":we=>we&&oe(A,we)},null,8,["model-value","onUpdate:modelValue"])]),me.value.length?(n.openBlock(),n.createElementBlock("label",HS,[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.codeGroup")),1),n.createVNode(gu,{"model-value":A.groupCode,items:me.value,locale:n.unref(o).uiLocale.value,"onUpdate:modelValue":we=>fe(A,we)},null,8,["model-value","items","locale","onUpdate:modelValue"])])):n.createCommentVNode("",!0),n.createElementVNode("label",{class:n.normalizeClass(["em-attr__pii",{"em-attr__codetop":!me.value.length}])},[n.createElementVNode("span",null,n.toDisplayString(n.unref(o).t("em.attr.defaultValue")),1),he(A).length?(n.openBlock(),n.createBlock(n.unref(ie.BSSelect),{key:0,width:"100%","model-value":A.defaultValue??"none",items:Ee(A),"value-provider":Se,"label-provider":Ie,"onUpdate:modelValue":we=>we&&ge(A,we)},null,8,["model-value","items","onUpdate:modelValue"])):(n.openBlock(),n.createBlock(n.unref(ie.BSTextInput),{key:1,name:`attr-default-${A.modelId}`,width:"100%",placeholder:n.unref(o).t("em.attr.defaultValue"),"model-value":A.defaultValue??"","onUpdate:modelValue":we=>_e(A,we)},null,8,["name","placeholder","model-value","onUpdate:modelValue"]))],2),n.createElementVNode("fieldset",FS,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(o).t("em.common.description")),1),n.createVNode(kn,{multiline:"",name:`attr-desc-${A.modelId}`,languages:n.unref(o).languages.value,"default-lang":n.unref(o).userLanguage.value,"model-value":A.description,"onUpdate:modelValue":we=>X(A,we)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])])],64)),n.createElementVNode("div",JS,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":g(A)===null}]),title:n.unref(o).t("em.swatch.none"),onClick:we=>h(A,null)},"∅",10,ZS),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),we=>(n.openBlock(),n.createElementBlock("button",{key:we,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":g(A)===we}]),style:n.normalizeStyle({background:n.unref(Wn)(we)}),title:n.unref(Yn)(we),onClick:tt=>h(A,we)},null,14,QS))),128)),N(A)?(n.openBlock(),n.createElementBlock("span",e$,n.toDisplayString(n.unref(o).t("em.attr.batchHint",{n:l.value.size})),1)):n.createCommentVNode("",!0)])],10,TS)}),128))],8,NS)):n.createCommentVNode("",!0)}}),[["__scopeId","data-v-7fd67ee7"]]),n$=["disabled"],o$={class:"em-panel__sub-label"},i$={class:"em-attr__row"},a$={class:"em-field em-idx-params"},r$=["value","placeholder","onChange"],l$=Pe(n.defineComponent({__name:"EntityIndexSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean}},emits:["toggle"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,r=n.computed(()=>a.state.logical.entities.find(b=>b.modelId===o.entityId)??null),l=n.computed(()=>r.value?io(r.value,a.superClassCatalog.value):[]),s=n.computed(()=>{var b;return[...(((b=r.value)==null?void 0:b.attributes)??[]).map(k=>({value:k.modelId,label:k.name})),...l.value.map(k=>({value:k.modelId,label:a.t("em.index.inherited",{field:k.field})}))]});function c(){var k;if(!r.value)return;const b=r.value.attributes[0];a.addIndex(r.value.modelId,{modelId:Me(),name:`idx_${(((k=r.value.indexes)==null?void 0:k.length)??0)+1}`,unique:!1,columns:b?[{columnRef:b.modelId,descending:!1}]:[]})}function d(b,k){r.value&&a.updateIndex(r.value.modelId,b,k)}function u(b){var g;const k=(g=r.value)==null?void 0:g.attributes[0];k&&d(b.modelId,{columns:[...b.columns,{columnRef:k.modelId,descending:!1}]})}function m(b,k,g){d(b.modelId,{columns:b.columns.map((N,h)=>h===k?{...N,columnRef:g}:N)})}function p(b,k,g){d(b.modelId,{columns:b.columns.map((N,h)=>h===k?{...N,descending:g}:N)})}function f(b,k){d(b.modelId,{columns:b.columns.filter((g,N)=>N!==k)})}function y(b,k){d(b.modelId,{parameters:k.trim()===""?void 0:k})}return(b,k)=>{var g;return r.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!n.unref(a).editable.value},[n.createElementVNode("h4",{class:n.normalizeClass(["em-panel__sub",{"em-panel__sub--toggle":e.collapsible}]),onClick:k[0]||(k[0]=N=>e.collapsible&&i("toggle"))},[n.createElementVNode("span",o$,[e.collapsible?(n.openBlock(),n.createBlock(Re,{key:0,name:"chevron",size:13,class:n.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"])):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(n.unref(a).t("em.index.section",{n:((g=r.value.indexes)==null?void 0:g.length)??0})),1)]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(a).t("em.common.add"),onClick:n.withModifiers(c,["stop"])},null,8,["caption"])],2),!e.collapsible||!e.collapsed?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(r.value.indexes??[],N=>(n.openBlock(),n.createElementBlock("div",{key:N.modelId,class:"em-attr"},[n.createElementVNode("div",i$,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`idx-name-${N.modelId}`,width:"100%",placeholder:n.unref(a).t("em.index.namePlaceholder"),"model-value":N.name,"onUpdate:modelValue":h=>d(N.modelId,{name:h})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`idx-uq-${N.modelId}`,class:"em-check",label:"UQ","model-value":N.unique,"onUpdate:modelValue":h=>d(N.modelId,{unique:h})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:h=>n.unref(a).removeIndex(r.value.modelId,N.modelId)},null,8,["onClick"])]),n.createVNode(_n,{controller:n.unref(a),"ref-id":N.modelId},null,8,["controller","ref-id"]),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(N.columns,(h,w)=>(n.openBlock(),n.createElementBlock("div",{key:w,class:"em-attr__row"},[n.createVNode(n.unref(ie.BSSelect),{class:"grow","model-value":h.columnRef,items:s.value,"value-provider":q=>q.value,"label-provider":q=>q.label,"onUpdate:modelValue":q=>q&&m(N,w,q)},null,8,["model-value","items","value-provider","label-provider","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`idx-${N.modelId}-desc-${w}`,class:"em-check",label:"DESC","model-value":h.descending,"onUpdate:modelValue":q=>p(N,w,q)},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:"−",onClick:q=>f(N,w)},null,8,["onClick"])]))),128)),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(a).t("em.index.addColumn"),onClick:h=>u(N)},null,8,["caption","onClick"]),n.createElementVNode("label",a$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.index.condition")),1),n.createElementVNode("textarea",{class:"em-textarea",value:N.parameters??"",rows:"2",placeholder:n.unref(a).t("em.index.conditionPlaceholder"),onChange:h=>y(N,h.target.value)},null,40,r$)])]))),128)):n.createCommentVNode("",!0)],8,n$)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-d883aded"]]),s$=["disabled"],c$={class:"em-panel__sub-label"},d$={class:"em-attr__row"},u$={class:"em-attr__row"},m$={class:"em-multilang"},f$={class:"em-attr__pii"},p$={class:"em-swatch__row em-attr__swatch"},h$=["title","onClick"],y$=["title","onClick"],g$=Pe(n.defineComponent({__name:"EntityOperationsSection",props:{controller:{},entityId:{},collapsible:{type:Boolean},collapsed:{type:Boolean}},emits:["toggle"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,r=ie.useModal(),l=n.computed(()=>a.state.logical.entities.find(h=>h.modelId===o.entityId)??null),s=n.computed(()=>l.value?a.state.layout.entityLayouts.find(h=>h.entityRef===l.value.modelId)??null:null),c=["PUBLIC","PROTECTED","PACKAGE","PRIVATE"],d=["none","PASSWORD","SOCIAL_SECURITY_NO","PASSPORT_NO","ALIEN_REGISTRATION_NO","DRIVERS_LICENSE_NO","BIOMETRICS","CREDITCARD_NO","ACCOUNT_NO","MEMBERSHIP_CARD_NO","ID","NAME","DATE_OF_BIRTH","PHONE_NO","EMAIL_ADDRESS","ADDRESS","IP_ADDRESS"];function u(h){return h==="none"?a.t("em.common.noneParen"):h}const m=h=>h;function p(h,w){l.value&&a.updateOperation(l.value.modelId,h.modelId,w)}function f(h,w){p(h,{description:Object.keys(w).length?w:void 0})}function y(h){return h.personalInfoAttributeType??"none"}function b(h,w){p(h,{personalInfoAttributeType:w==="none"?void 0:w})}function k(h){var w,q;return at((q=(w=s.value)==null?void 0:w.operationStyles)==null?void 0:q[h.modelId])}function g(h,w){l.value&&a.setOperationSwatch(l.value.modelId,h.modelId,w)}function N(h){r.openModal({component:bu,bind:{operationName:h.name,sourceCode:h.sourceCode??"",locale:a.uiLocale.value,onSave:w=>p(h,{sourceCode:w})}})}return(h,w)=>{var q;return l.value?(n.openBlock(),n.createElementBlock("fieldset",{key:0,class:"em-section",disabled:!n.unref(a).editable.value},[n.createElementVNode("h4",{class:n.normalizeClass(["em-panel__sub",{"em-panel__sub--toggle":e.collapsible}]),onClick:w[1]||(w[1]=P=>e.collapsible&&i("toggle"))},[n.createElementVNode("span",c$,[e.collapsible?(n.openBlock(),n.createBlock(Re,{key:0,name:"chevron",size:13,class:n.normalizeClass(["em-sub-caret",{"is-open":!e.collapsed}])},null,8,["class"])):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(n.unref(a).t("em.op.section",{n:((q=l.value.operations)==null?void 0:q.length)??0})),1)]),n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(a).t("em.common.add"),onClick:w[0]||(w[0]=n.withModifiers(P=>n.unref(a).addOperation(l.value.modelId),["stop"]))},null,8,["caption"])],2),!e.collapsible||!e.collapsed?(n.openBlock(!0),n.createElementBlock(n.Fragment,{key:0},n.renderList(l.value.operations??[],P=>(n.openBlock(),n.createElementBlock("div",{key:P.modelId,class:"em-attr"},[n.createElementVNode("div",d$,[n.createVNode(n.unref(ie.BSTextInput),{class:"grow",name:`op-name-${P.modelId}`,width:"100%",placeholder:n.unref(a).t("em.op.namePlaceholder"),"model-value":P.name,"onUpdate:modelValue":W=>p(P,{name:W})},null,8,["name","placeholder","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSSelect),{width:"96px","model-value":P.visibility??"PACKAGE",items:c,"value-provider":m,"label-provider":m,"onUpdate:modelValue":W=>W&&p(P,{visibility:W})},null,8,["model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSButton),{variant:"text",class:"em-del-btn",caption:"✕",onClick:W=>n.unref(a).removeOperation(l.value.modelId,P.modelId)},null,8,["onClick"])]),n.createElementVNode("div",u$,[n.createVNode(n.unref(ie.BSButton),{variant:"text",caption:n.unref(a).t(P.sourceCode?"em.op.editBodyDirty":"em.op.editBody"),onClick:W=>N(P)},null,8,["caption","onClick"])]),n.createElementVNode("fieldset",m$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.common.description")),1),n.createVNode(kn,{multiline:"",name:`op-desc-${P.modelId}`,languages:n.unref(a).languages.value,"default-lang":n.unref(a).userLanguage.value,"model-value":P.description,"onUpdate:modelValue":W=>f(P,W)},null,8,["name","languages","default-lang","model-value","onUpdate:modelValue"])]),n.createElementVNode("label",f$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.attr.pii")),1),n.createVNode(n.unref(ie.BSSelect),{width:"100%","model-value":y(P),items:d,"value-provider":m,"label-provider":u,"onUpdate:modelValue":W=>W&&b(P,W)},null,8,["model-value","onUpdate:modelValue"])]),n.createElementVNode("div",p$,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":k(P)===null}]),title:n.unref(a).t("em.swatch.none"),onClick:W=>g(P,null)},"∅",10,h$),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),W=>(n.openBlock(),n.createElementBlock("button",{key:W,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":k(P)===W}]),style:n.normalizeStyle({background:n.unref(Wn)(W)}),title:n.unref(Yn)(W),onClick:M=>g(P,W)},null,14,y$))),128))])]))),128)):n.createCommentVNode("",!0)],8,s$)):n.createCommentVNode("",!0)}}}),[["__scopeId","data-v-394829bc"]]),b$=["title"],_$={class:"em-panel__head"},k$={class:"em-panel__head-row"},E$=["title"],w$={class:"em-panel__context"},N$={key:0,class:"em-panel__lock"},v$=["disabled"],x$={key:0,class:"em-panel__note"},C$={key:1,class:"em-panel__note"},I$={key:2,class:"em-jpa"},S$={class:"em-field"},$$={class:"em-field"},R$={class:"em-field"},A$={key:0,class:"em-field"},T$={class:"em-panel__note"},V$={class:"em-panel__sub"},M$={class:"em-field"},B$={class:"em-jpa"},D$={key:0,class:"em-panel__note"},O$={class:"em-jpa"},P$={class:"em-field"},L$={key:0,class:"em-panel__note"},z$={class:"em-field"},U$={class:"em-multilang"},H$={class:"em-field"},F$=["value"],G$={class:"em-field"},j$={class:"em-swatch"},K$={class:"em-swatch__row"},Y$=["title"],W$=["title","onClick"],q$={class:"em-panel__note"},X$={class:"em-field"},J$=["value"],Z$={class:"em-swatch"},Q$={class:"em-swatch__row"},eR=["title"],tR=["title","onClick"],Um=Pe(n.defineComponent({__name:"PropertyPanel",props:{controller:{},width:{},resizing:{type:Boolean},startResize:{type:Function}},emits:["collapse"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,r=n.computed(()=>a.selection.value),l=n.computed(()=>a.inspectedEntityId.value),s=n.computed(()=>{const x=l.value;return x?a.state.logical.entities.find(T=>T.modelId===x)??null:null}),c=n.computed(()=>{const x=r.value;if((x==null?void 0:x.kind)==="association"){const V=a.state.logical.associations.find(te=>te.modelId===x.id);return!!V&&(a.isEntityLocked(V.end1.entityRef)||a.isEntityLocked(V.end2.entityRef))}const T=l.value;return!!T&&a.isEntityLocked(T)}),d=n.computed(()=>{var x;return((x=a.selectedAttr.value)==null?void 0:x.attrId)??null}),u=n.computed(()=>new Set(a.selectedAttrIds.value)),m=n.computed(()=>d.value!==null),p=n.ref({});n.watch(m,()=>{p.value={}});function f(x){return p.value[x]??m.value}function y(x){p.value={...p.value,[x]:!f(x)}}const b=n.computed(()=>{var V;const x=s.value;if(!x)return a.t("em.entity.fallback");const T=(V=x.table)==null?void 0:V.physicalName;return T?`${x.name} (${T})`:x.name}),k=n.computed(()=>{const x=r.value;return(x==null?void 0:x.kind)==="association"?a.state.logical.associations.find(T=>T.modelId===x.id)??null:null}),g=n.computed(()=>{const x=r.value;return(x==null?void 0:x.kind)==="group"?a.state.logical.groups.find(T=>T.modelId===x.id)??null:null}),N=n.computed(()=>{const x=r.value;return(x==null?void 0:x.kind)==="note"?a.state.layout.notes.find(T=>T.modelId===x.id)??null:null}),h=n.computed(()=>{var T,V;const x=(T=g.value)==null?void 0:T.name;return(x==null?void 0:x.ko)||(x==null?void 0:x.en)||(x==null?void 0:x.ja)||(x==null?void 0:x.zh)||((V=g.value)==null?void 0:V.packageName)||a.t("em.group.fallback")}),w=n.computed(()=>{if(s.value){const x=u.value.size;if(x>1)return a.t("em.inspector.ctxEntityAttrs",{name:s.value.name,n:x});if(d.value){const T=s.value.attributes.find(V=>V.modelId===d.value);return(T==null?void 0:T.attrType)==="DIVIDER"?a.t("em.inspector.ctxEntityDivider",{name:s.value.name}):a.t("em.inspector.ctxEntityAttr",{name:s.value.name,attr:(T==null?void 0:T.name)??""})}return a.t("em.inspector.ctxEntity",{name:s.value.name})}if(k.value){const x=T=>{var V;return((V=a.state.logical.entities.find(te=>te.modelId===T))==null?void 0:V.name)??T};return a.t("em.inspector.ctxAssoc",{a:x(k.value.end1.entityRef),b:x(k.value.end2.entityRef)})}return g.value?a.t("em.inspector.ctxGroup",{name:h.value}):N.value?a.t("em.inspector.ctxNote"):a.t("em.inspector.ctxNone")}),q=["NO_INSTANCE_OR_ONE_INSTANCE","EXACTLY_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES","ONE_OR_MORE_INSTANCES"],P=["EXACTLY_ONE_INSTANCE","NO_INSTANCE_OR_ONE_INSTANCE","ZERO_OR_MORE_INSTANCES"],W={EXACTLY_ONE_INSTANCE:"em.embed.card1",NO_INSTANCE_OR_ONE_INSTANCE:"em.embed.card01",ZERO_OR_MORE_INSTANCES:"em.embed.card0N"},M=x=>{const T=W[x];return T?a.t(T):x},$=x=>{var T;return((T=a.state.logical.entities.find(V=>V.modelId===x))==null?void 0:T.name)??x},D=["ALL","PERSIST","MERGE","REMOVE","REFRESH","DETACH"],J=["LIST","SET"],B=["inherit","LAZY","EAGER"],re=x=>x;function _(x){return x==="inherit"?a.t("em.common.inherit"):x}const K=n.computed(()=>!!k.value&&k.value.end1.entityRef===k.value.end2.entityRef);function R(x,T){k.value&&a.updateAssociationEnd(k.value.modelId,x,T)}function X(x){k.value&&!K.value&&a.setAssociationIdentifying(k.value.modelId,x)}function ee(x){var T,V,te;return!!((te=(V=(T=k.value)==null?void 0:T[x].jpa)==null?void 0:V.cascadeTypes)!=null&&te.includes("ALL"))}function oe(x,T,V){var ke,ye;const te=(ke=k.value)==null?void 0:ke[x];if(T==="ALL"&&V){R(x,{jpa:{...te==null?void 0:te.jpa,cascadeTypes:["ALL"]}});return}const de=new Set(((ye=te==null?void 0:te.jpa)==null?void 0:ye.cascadeTypes)??[]);V?de.add(T):de.delete(T),R(x,{jpa:{...te==null?void 0:te.jpa,cascadeTypes:[...de]}})}function U(x,T){var te;const V=(te=k.value)==null?void 0:te[x];R(x,{jpa:{...V==null?void 0:V.jpa,...T}})}function G(x){var T,V;return((V=(T=k.value)==null?void 0:T[x].jpa)==null?void 0:V.fetchType)??"inherit"}function ne(x,T){U(x,{fetchType:T==="inherit"?void 0:T})}function ce(x){var V;const T=(V=k.value)==null?void 0:V[x==="end1"?"end2":"end1"];return(T==null?void 0:T.multiplicity)==="ZERO_OR_MORE_INSTANCES"||(T==null?void 0:T.multiplicity)==="ONE_OR_MORE_INSTANCES"}const pe=n.computed(()=>{const x=k.value;if(!x)return null;for(const T of a.state.logical.entities){const V=T.attributes.find(ye=>{var xe;return((xe=ye.embedded)==null?void 0:xe.associationRef)===x.modelId&&ye.attrType==="EMBED_OWN"});if(!V)continue;const te=x.end2.entityRef===V.embedded.embeddableRef?"end2":"end1",de=x[te].multiplicity,ke=x[te].jpa;return{which:te,cardinality:de,isCollection:de==="ZERO_OR_MORE_INSTANCES"||de==="ONE_OR_MORE_INSTANCES",collectionType:(ke==null?void 0:ke.collectionType)??"LIST",collectionTable:(ke==null?void 0:ke.collectionTable)??"",orderColumn:(ke==null?void 0:ke.orderColumn)??""}}return null});function se(x){k.value&&a.setEmbedCardinality(k.value.modelId,x)}function me(x){const T=pe.value;T&&U(T.which,x==="SET"?{collectionType:"SET",orderColumn:void 0}:{collectionType:"LIST"})}function he(x){const T=pe.value;T&&U(T.which,{collectionTable:x.trim()||void 0})}function Ee(x){const T=pe.value;T&&U(T.which,{orderColumn:x.trim()||void 0})}function Se(x){g.value&&a.updateGroup(g.value.modelId,x)}function Ie(x,T){var V;Se({name:{...(V=g.value)==null?void 0:V.name,[x]:T}})}const fe=n.computed(()=>{var x;return g.value?at((x=a.state.layout.groupLayouts.find(T=>T.groupRef===g.value.modelId))==null?void 0:x.style):null});function ge(x){g.value&&a.setGroupSwatch(g.value.modelId,x)}function _e(x){N.value&&a.setNoteMemo(N.value.modelId,x)}const j=n.computed(()=>{var x;return at((x=N.value)==null?void 0:x.style)});function H(x){N.value&&a.setNoteSwatch(N.value.modelId,x)}return(x,T)=>(n.openBlock(),n.createElementBlock("aside",{class:"em-panel",style:n.normalizeStyle({width:e.width+"px"})},[n.createElementVNode("div",{class:n.normalizeClass(["em-resize-handle em-resize-handle--left",{"is-dragging":e.resizing}]),title:n.unref(a).t("em.panel.resizeWidth"),onPointerdown:T[0]||(T[0]=(...V)=>e.startResize&&e.startResize(...V))},null,42,b$),n.createElementVNode("header",_$,[n.createElementVNode("div",k$,[T[14]||(T[14]=n.createElementVNode("h3",{class:"em-panel__title"},"Inspector",-1)),n.createElementVNode("button",{type:"button",class:"em-panel__btn",title:n.unref(a).t("em.panel.collapse"),onClick:T[1]||(T[1]=V=>i("collapse"))},[n.createVNode(Re,{name:"panel-right-close",size:16})],8,E$)]),n.createElementVNode("p",w$,n.toDisplayString(w.value),1),c.value&&l.value?(n.openBlock(),n.createElementBlock("div",N$,[n.createVNode(Re,{name:"lock",size:13}),n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.panel.lockedBanner")),1),n.unref(a).editable.value?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"em-panel__unlock",onClick:T[2]||(T[2]=V=>n.unref(a).setEntityLocked(l.value,!1))},n.toDisplayString(n.unref(a).t("em.panel.unlock")),1)):n.createCommentVNode("",!0)])):n.createCommentVNode("",!0)]),n.createElementVNode("fieldset",{class:"em-panel__body em-scroll-overlay",disabled:!n.unref(a).editable.value||c.value},[s.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createVNode(mu,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:f("basics"),title:b.value,onToggle:T[3]||(T[3]=V=>y("basics"))},null,8,["controller","entity-id","collapsed","title"]),n.createVNode(t$,{controller:n.unref(a),"entity-id":s.value.modelId},null,8,["controller","entity-id"]),n.createVNode(l$,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:f("index"),onToggle:T[4]||(T[4]=V=>y("index"))},null,8,["controller","entity-id","collapsed"]),n.createVNode(g$,{controller:n.unref(a),"entity-id":s.value.modelId,collapsible:"",collapsed:f("ops"),onToggle:T[5]||(T[5]=V=>y("ops"))},null,8,["controller","entity-id","collapsed"])],64)):n.createCommentVNode("",!0),k.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:1},[n.createVNode(n.unref(ie.BSCheckbox),{name:"assoc-identifying",class:"em-check",label:n.unref(a).t("em.assoc.identifying"),"model-value":!!k.value.identifying,disabled:K.value||!!pe.value,"onUpdate:modelValue":X},null,8,["label","model-value","disabled"]),K.value?(n.openBlock(),n.createElementBlock("p",x$,n.toDisplayString(n.unref(a).t("em.assoc.selfNoIdentifying")),1)):pe.value?(n.openBlock(),n.createElementBlock("p",C$,n.toDisplayString(n.unref(a).t("em.assoc.embedNoIdentifying")),1)):n.createCommentVNode("",!0),pe.value?(n.openBlock(),n.createElementBlock("fieldset",I$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.embed.legend")),1),n.createElementVNode("label",S$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.embed.cardinality")),1),n.createVNode(n.unref(ie.BSSelect),{"model-value":pe.value.cardinality,items:P,"value-provider":re,"label-provider":M,"onUpdate:modelValue":T[6]||(T[6]=V=>V&&se(V))},null,8,["model-value"])]),pe.value.isCollection?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("label",$$,[T[15]||(T[15]=n.createElementVNode("span",null,"collectionType",-1)),n.createVNode(n.unref(ie.BSSelect),{"model-value":pe.value.collectionType,items:J,"value-provider":re,"label-provider":re,"onUpdate:modelValue":T[7]||(T[7]=V=>V&&me(V))},null,8,["model-value"])]),n.createElementVNode("label",R$,[T[16]||(T[16]=n.createElementVNode("span",null,"collectionTable",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"embed-coll-table",width:"100%",placeholder:n.unref(a).t("em.embed.collectionTablePlaceholder"),"model-value":pe.value.collectionTable,"onUpdate:modelValue":he},null,8,["placeholder","model-value"])]),pe.value.collectionType==="LIST"?(n.openBlock(),n.createElementBlock("label",A$,[T[17]||(T[17]=n.createElementVNode("span",null,"orderColumn",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:"embed-order-col",width:"100%",placeholder:n.unref(a).t("em.embed.orderColumnPlaceholder"),"model-value":pe.value.orderColumn,"onUpdate:modelValue":Ee},null,8,["placeholder","model-value"])])):n.createCommentVNode("",!0)],64)):n.createCommentVNode("",!0),n.createElementVNode("p",T$,n.toDisplayString(n.unref(a).t("em.embed.ownerFixedNote")),1)])):n.createCommentVNode("",!0),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(["end1","end2"],V=>{var te,de,ke;return n.withDirectives(n.createElementVNode("div",{key:V,class:"em-end"},[n.createElementVNode("h4",V$,n.toDisplayString(V)+" → "+n.toDisplayString($(k.value[V].entityRef)),1),pe.value?n.createCommentVNode("",!0):(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("label",M$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.assoc.multiplicity")),1),n.createVNode(n.unref(ie.BSSelect),{"model-value":k.value[V].multiplicity,items:q,"value-provider":re,"label-provider":re,"onUpdate:modelValue":ye=>R(V,{multiplicity:ye})},null,8,["model-value","onUpdate:modelValue"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:`${V}-navigable`,class:"em-check",label:"navigable","model-value":k.value[V].navigable,"onUpdate:modelValue":ye=>R(V,{navigable:ye})},null,8,["name","model-value","onUpdate:modelValue"]),n.createVNode(n.unref(ie.BSCheckbox),{name:`${V}-composition`,class:"em-check",label:"composition","model-value":k.value[V].composition,"onUpdate:modelValue":ye=>R(V,{composition:ye})},null,8,["name","model-value","onUpdate:modelValue"])],64)),n.createElementVNode("fieldset",B$,[T[18]||(T[18]=n.createElementVNode("legend",null,"cascade",-1)),(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(D,ye=>{var xe,$e;return n.createVNode(n.unref(ie.BSCheckbox),{key:ye,name:`${V}-cascade-${ye}`,class:"em-check",label:ye,"model-value":!!(($e=(xe=k.value[V].jpa)==null?void 0:xe.cascadeTypes)!=null&&$e.includes(ye)),disabled:ye!=="ALL"&&ee(V),"onUpdate:modelValue":Ve=>oe(V,ye,Ve)},null,8,["name","label","model-value","disabled","onUpdate:modelValue"])}),64)),ee(V)?(n.openBlock(),n.createElementBlock("p",D$,n.toDisplayString(n.unref(a).t("em.assoc.cascadeAllNote")),1)):n.createCommentVNode("",!0)]),n.createElementVNode("fieldset",O$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.assoc.jpaDetails")),1),n.createElementVNode("label",P$,[T[19]||(T[19]=n.createElementVNode("span",null,"fetchType",-1)),n.createVNode(n.unref(ie.BSSelect),{"model-value":G(V),items:B,"value-provider":re,"label-provider":_,"onUpdate:modelValue":ye=>ye&&ne(V,ye)},null,8,["model-value","onUpdate:modelValue"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:`${V}-orphan`,class:"em-check",label:"orphanRemoval","model-value":!!((te=k.value[V].jpa)!=null&&te.orphanRemoval),disabled:ce(V),"onUpdate:modelValue":ye=>U(V,{orphanRemoval:ye})},null,8,["name","model-value","disabled","onUpdate:modelValue"]),ce(V)&&((de=k.value[V].jpa)!=null&&de.orphanRemoval)?(n.openBlock(),n.createElementBlock("p",L$,n.toDisplayString(n.unref(a).t("em.assoc.orphanRemovalNote")),1)):n.createCommentVNode("",!0),n.createElementVNode("label",z$,[T[20]||(T[20]=n.createElementVNode("span",null,"orderBy",-1)),n.createVNode(n.unref(ie.BSTextInput),{name:`${V}-orderby`,width:"100%",placeholder:n.unref(a).t("em.assoc.orderByPlaceholder"),"model-value":((ke=k.value[V].jpa)==null?void 0:ke.orderBy)??"","onUpdate:modelValue":ye=>U(V,{orderBy:ye.trim()||void 0})},null,8,["name","placeholder","model-value","onUpdate:modelValue"])])])]),[[n.vShow,!pe.value||V===pe.value.which]])}),64))],64)):n.createCommentVNode("",!0),g.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:2},[n.createElementVNode("fieldset",U$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.group.nameLegend")),1),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(a).languages.value,V=>{var te;return n.openBlock(),n.createElementBlock("label",{key:V,class:"em-lang"},[n.createElementVNode("span",null,n.toDisplayString(V),1),n.createVNode(n.unref(ie.BSTextInput),{name:`grp-name-${V}`,width:"100%","model-value":((te=g.value.name)==null?void 0:te[V])??"","onUpdate:modelValue":de=>Ie(V,de)},null,8,["name","model-value","onUpdate:modelValue"])])}),128))]),n.createElementVNode("label",H$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.common.description")),1),n.createElementVNode("textarea",{class:"em-textarea",value:g.value.description??"",rows:"3",onChange:T[8]||(T[8]=V=>Se({description:V.target.value}))},null,40,F$)]),n.createElementVNode("label",G$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.entity.package")),1),n.createVNode(n.unref(ie.BSTextInput),{name:"grp-package",width:"100%","model-value":g.value.packageName??"","onUpdate:modelValue":T[9]||(T[9]=V=>Se({packageName:V}))},null,8,["model-value"])]),n.createVNode(n.unref(ie.BSCheckbox),{name:"grp-exclude-ddl",class:"em-check",label:n.unref(a).t("em.group.excludeDDL"),"model-value":g.value.excludeDDLGeneration,"onUpdate:modelValue":T[10]||(T[10]=V=>Se({excludeDDLGeneration:V}))},null,8,["label","model-value"]),n.createElementVNode("fieldset",j$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.common.color")),1),n.createElementVNode("div",K$,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":fe.value===null}]),title:n.unref(a).t("em.swatch.none"),onClick:T[11]||(T[11]=V=>ge(null))},"∅",10,Y$),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),V=>(n.openBlock(),n.createElementBlock("button",{key:V,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":fe.value===V}]),style:n.normalizeStyle({background:n.unref(Wn)(V)}),title:n.unref(Yn)(V),onClick:te=>ge(V)},null,14,W$))),128))])]),n.createElementVNode("p",q$,n.toDisplayString(n.unref(a).t("em.group.members",{n:g.value.memberEntityRefs.length})),1)],64)):n.createCommentVNode("",!0),N.value?(n.openBlock(),n.createElementBlock(n.Fragment,{key:3},[n.createElementVNode("label",X$,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.common.memo")),1),n.createElementVNode("textarea",{class:"em-textarea",value:N.value.memo,rows:"6",onChange:T[12]||(T[12]=V=>_e(V.target.value))},null,40,J$)]),n.createElementVNode("fieldset",Z$,[n.createElementVNode("legend",null,n.toDisplayString(n.unref(a).t("em.common.color")),1),n.createElementVNode("div",Q$,[n.createElementVNode("button",{type:"button",class:n.normalizeClass(["em-swatch__chip em-swatch__none",{"is-on":j.value===null}]),title:n.unref(a).t("em.swatch.none"),onClick:T[13]||(T[13]=V=>H(null))},"∅",10,eR),(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(n.unref(bn),V=>(n.openBlock(),n.createElementBlock("button",{key:V,type:"button",class:n.normalizeClass(["em-swatch__chip",{"is-on":j.value===V}]),style:n.normalizeStyle({background:n.unref(Wn)(V)}),title:n.unref(Yn)(V),onClick:te=>H(V)},null,14,tR))),128))])])],64)):n.createCommentVNode("",!0)],8,v$)],4))}}),[["__scopeId","data-v-4a891fbf"]]),nR=["title"],oR={class:"em-validation__title"},iR=["title","onClick"],aR={key:0,class:"em-validation__body"},rR={class:"em-validation__opt"},lR={key:0,class:"em-validation__empty"},sR={key:1,class:"em-validation__empty"},cR={key:2,class:"em-validation__list"},dR=["onClick"],uR={class:"em-validation__item-msg"},mR={key:0,class:"em-validation__item-entity"},fR=["title"],pR=Pe(n.defineComponent({__name:"ValidationPanel",props:{controller:{},panelWidth:{},inspectorOpen:{type:Boolean,default:!0}},setup(e){const o=e.controller,i=n.computed(()=>o.issues.value),a=n.computed(()=>{const b=new Map;for(const k of o.state.logical.entities)b.set(k.modelId,k.name);return b});function r(b){const k=R0(b);if(!k)return null;const g=a.value.get(k);return g===void 0?null:g.trim()===""?o.t("em.validation.nameless"):g}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=n.computed(()=>{const b={error:0,warning:0,info:0};for(const k of i.value)b[k.severity]++;return b}),c=n.ref({error:!0,warning:!0,info:!0}),d=n.computed(()=>i.value.filter(b=>c.value[b.severity]).slice().sort((b,k)=>l[b.severity].order-l[k.severity].order)),u=n.computed(()=>d.value.map(b=>({issue:b,entityName:r(b),message:uu(o.t,b),category:S0(o.t,b.ruleId)}))),m=n.ref(!1);function p(b){c.value[b]=!c.value[b]}function f(b){if(!m.value){m.value=!0;return}p(b)}function y(b){b.targetRef&&o.requestFocus(b.targetRef)}return(b,k)=>(n.openBlock(),n.createElementBlock("section",{class:n.normalizeClass(["em-validation",{"is-open":m.value,"is-inspector-collapsed":!e.inspectorOpen}]),style:n.normalizeStyle(m.value||!e.inspectorOpen?void 0:{width:e.panelWidth+"px"})},[n.createElementVNode("header",{class:"em-validation__head",onClick:k[1]||(k[1]=g=>m.value=!m.value)},[n.createElementVNode("button",{type:"button",class:"em-validation__toggle",title:n.unref(o).t(m.value?"em.panel.collapse":"em.panel.expand")},[n.createVNode(Re,{name:"chevron",size:14,class:n.normalizeClass([{"is-open":m.value},"em-validation__chevron"])},null,8,["class"]),n.createElementVNode("span",oR,n.toDisplayString(n.unref(o).t("em.validation.title")),1)],8,nR),n.createElementVNode("div",{class:"em-validation__counts",onClick:k[0]||(k[0]=n.withModifiers(()=>{},["stop"]))},[(n.openBlock(),n.createElementBlock(n.Fragment,null,n.renderList(["error","warning","info"],g=>n.createElementVNode("button",{key:g,type:"button",class:n.normalizeClass(["em-validation__count",[`is-${g}`,{"is-off":!c.value[g]}]]),title:m.value?n.unref(o).t(c.value[g]?"em.validation.hideSeverity":"em.validation.showSeverity",{label:n.unref(o).t(l[g].labelKey)}):n.unref(o).t("em.validation.expandPanel"),onClick:N=>f(g)},[n.createVNode(Re,{name:l[g].icon,size:14},null,8,["name"]),n.createElementVNode("span",null,n.toDisplayString(s.value[g]),1)],10,iR)),64))])]),m.value?(n.openBlock(),n.createElementBlock("div",aR,[n.createElementVNode("label",rR,[n.createVNode(n.unref(ie.BSCheckbox),{name:"val-flag-norel",label:n.unref(o).t("em.validation.checkOrphanEntities"),"model-value":n.unref(o).flagEntitiesWithoutRelations.value,"onUpdate:modelValue":k[2]||(k[2]=g=>n.unref(o).flagEntitiesWithoutRelations.value=g)},null,8,["label","model-value"])]),i.value.length===0?(n.openBlock(),n.createElementBlock("p",lR,n.toDisplayString(n.unref(o).t("em.validation.noIssues")),1)):d.value.length===0?(n.openBlock(),n.createElementBlock("p",sR,n.toDisplayString(n.unref(o).t("em.validation.noVisibleIssues")),1)):(n.openBlock(),n.createElementBlock("ul",cR,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.value,({issue:g,entityName:N,message:h,category:w},q)=>(n.openBlock(),n.createElementBlock("li",{key:`${g.ruleId}:${g.targetRef??"model"}:${q}`,class:n.normalizeClass(["em-validation__item",[`is-${g.severity}`,{"is-clickable":!!g.targetRef}]]),onClick:P=>y(g)},[n.createVNode(Re,{name:l[g.severity].icon,size:15,class:"em-validation__item-icon"},null,8,["name"]),n.createElementVNode("span",uR,[N?(n.openBlock(),n.createElementBlock("span",mR,n.toDisplayString(N),1)):n.createCommentVNode("",!0),n.createTextVNode(" "+n.toDisplayString(h),1)]),n.createElementVNode("span",{class:"em-validation__item-cat",title:g.ruleId},n.toDisplayString(w),9,fR)],10,dR))),128))]))])):n.createCommentVNode("",!0)],6))}}),[["__scopeId","data-v-d6738267"]]),hR={class:"em-history"},yR={class:"em-history__head"},gR={class:"em-history__title"},bR={class:"em-history__head-actions"},_R=["title","disabled"],kR=["title"],ER={class:"em-history__filters"},wR={class:"em-history__filter"},NR={class:"em-history__body"},vR={key:0,class:"em-history__empty"},xR={key:1,class:"em-history__empty is-error"},CR={key:2,class:"em-history__empty"},IR={key:3,class:"em-history__list"},SR=["onClick"],$R={class:"em-history__summary"},RR={class:"em-history__seq"},AR={class:"em-history__gmeta"},TR={class:"em-history__who"},VR={key:0,class:"em-history__time"},MR={key:1,class:"em-history__restored-from"},BR={key:0,class:"em-history__detail"},DR={class:"em-history__action-head"},OR={class:"em-history__action-name"},PR={key:0,class:"em-history__fields"},LR={class:"em-history__fname"},zR={key:0,class:"em-history__old"},UR={class:"em-history__val"},HR={key:1,class:"em-history__restore"},FR={class:"em-history__confirm-msg"},GR=["disabled","onClick"],jR=["disabled"],KR=["onClick"],YR=Pe(n.defineComponent({__name:"HistoryPanel",props:{controller:{},open:{type:Boolean}},emits:["close"],setup(e,{emit:t}){const o=e,i=t,a=o.controller,r=n.ref([]),l=n.ref(!1),s=n.ref(null),c=n.ref(!1);async function d(){if(a.historyTransport){l.value=!0,s.value=null;try{r.value=await a.historyTransport(),c.value=!0}catch(U){s.value=U instanceof Error?U.message:a.t("em.history.loadError")}finally{l.value=!1}}}async function u(){await a.whenOpsSettled(),await d()}n.watch(()=>o.open,U=>{U&&u()},{immediate:!0});let m=null;n.watch(()=>a.revision.value,()=>{o.open&&(m&&clearTimeout(m),m=setTimeout(()=>void u(),500))}),n.watch(()=>a.reloadRequest.value,()=>{o.open&&u()});const p=n.computed(()=>new Map(a.state.logical.entities.map(U=>[U.modelId,U]))),f=n.computed(()=>new Map(a.state.logical.associations.map(U=>[U.modelId,U]))),y=n.computed(()=>new Map((a.state.logical.groups??[]).map(U=>{var G;return[U.modelId,U.packageName||((G=U.name)==null?void 0:G.ko)||U.modelId]})));function b(U){var pe,se,me,he,Ee,Se,Ie;const G=f.value.get(U);if(!G)return a.t("em.history.assocFallback");if((pe=G.description)!=null&&pe.trim())return G.description.trim();const ne=(he=(me=p.value.get((se=G.end1)==null?void 0:se.entityRef))==null?void 0:me.name)==null?void 0:he.trim(),ce=(Ie=(Se=p.value.get((Ee=G.end2)==null?void 0:Ee.entityRef))==null?void 0:Se.name)==null?void 0:Ie.trim();return ne&&ce?`${ne}→${ce}`:a.t("em.history.assocFallback")}function k(U){var G,ne,ce,pe;if(U.kind==="entity")return((ne=(G=p.value.get(U.ref))==null?void 0:G.name)==null?void 0:ne.trim())||a.t("em.attr.nameless");if(U.kind==="attribute"||U.kind==="operation"||U.kind==="index"){const se=U.entityRef?p.value.get(U.entityRef):void 0,he=((U.kind==="attribute"?se==null?void 0:se.attributes:U.kind==="operation"?se==null?void 0:se.operations:se==null?void 0:se.indexes)??[]).find(Se=>Se.modelId===U.ref),Ee=(ce=se==null?void 0:se.name)==null?void 0:ce.trim();return`${Ee?Ee+".":""}${((pe=he==null?void 0:he.name)==null?void 0:pe.trim())||U.ref}`}return U.kind==="association"?b(U.ref):U.kind==="associationEnd"?`${b(U.ref)}(${U.end})`:U.kind==="group"?a.t("em.history.groupSubject",{name:y.value.get(U.ref)??U.ref}):U.ref}const g={entity:"table",attribute:"field",operation:"method",index:"key",association:"link",associationEnd:"link",group:"folder"},N={add:"em.history.verbAdd",update:"em.history.verbUpdate",remove:"em.history.verbRemove"},h=n.ref("all"),w=[{v:"all",labelKey:"em.history.filterAll"},{v:"edit",labelKey:"em.history.kindEdit"},{v:"restore",labelKey:"em.history.kindRestore"}],q=n.computed({get:()=>h.value,set:U=>{U&&(h.value=U)}}),P=n.computed(()=>es(r.value)),W=n.computed(()=>P.value.length?P.value[0].seq:null),M=n.computed(()=>h.value==="all"?P.value:P.value.filter(U=>(U.kind??"edit")===h.value));function $(U){return U===void 0?"—":U===null?a.t("em.history.emptyValue"):typeof U=="object"?JSON.stringify(U):String(U)}function D(U){const G=k(U.subject);if(U.verb==="add")return a.t("em.history.summaryAdd",{name:G});if(U.verb==="remove")return a.t("em.history.summaryRemove",{name:G});if(U.fields.length===1){const ne=U.fields[0];return`${G}.${ne.field} ${ne.oldValue!==void 0?$(ne.oldValue)+"→":""}${$(ne.value)}`}return a.t("em.history.summaryFields",{name:G,n:U.fields.length})}function J(U){return U.actions.length===0?a.t("em.history.noChange"):U.actions.length===1?D(U.actions[0]):a.t("em.history.summaryMore",{summary:D(U.actions[0]),n:U.actions.length-1})}const B=n.ref(new Set);function re(U){const G=new Set(B.value);G.has(U)?G.delete(U):G.add(U),B.value=G}function _(U){if(U==null)return"";const G=new Date(U);return isNaN(G.getTime())?String(U):G.toLocaleString()}function K(U){const G=U.author,ne=U.origin;return G&&ne?`${G}(${ne})`:G||(ne?`(${ne})`:"—")}const R=n.ref(null),X=n.ref(!1);function ee(U){R.value=U}async function oe(U){X.value=!0;try{const G=await a.restoreToSeq(U);G.ok||(s.value=a.t("em.history.restoreFailed",{reason:G.reason??a.t("em.history.unknown")}))}finally{X.value=!1,R.value=null}}return(U,G)=>(n.openBlock(),n.createBlock(n.Transition,{name:"em-history"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("section",hR,[n.createElementVNode("header",yR,[n.createElementVNode("div",gR,[n.createVNode(Re,{name:"undo",size:15}),n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.history.title")),1)]),n.createElementVNode("div",bR,[n.createElementVNode("button",{type:"button",class:"em-history__btn",title:n.unref(a).t("em.history.refresh"),disabled:l.value,onClick:G[0]||(G[0]=ne=>d())},[n.createVNode(Re,{name:"redo",size:15})],8,_R),n.createElementVNode("button",{type:"button",class:"em-history__btn",title:n.unref(a).t("em.common.close"),onClick:G[1]||(G[1]=ne=>i("close"))},[n.createVNode(Re,{name:"panel-close",size:15})],8,kR)])]),n.createElementVNode("div",ER,[n.createElementVNode("label",wR,[n.createElementVNode("span",null,n.toDisplayString(n.unref(a).t("em.toolbar.displayLabel")),1),n.createVNode(n.unref(ie.BSSelect),{modelValue:q.value,"onUpdate:modelValue":G[2]||(G[2]=ne=>q.value=ne),items:w,"value-provider":ne=>ne.v,"label-provider":ne=>n.unref(a).t(ne.labelKey)},null,8,["modelValue","value-provider","label-provider"])])]),n.createElementVNode("div",NR,[l.value&&!c.value?(n.openBlock(),n.createElementBlock("p",vR,n.toDisplayString(n.unref(a).t("em.history.loading")),1)):s.value?(n.openBlock(),n.createElementBlock("p",xR,n.toDisplayString(s.value),1)):M.value.length===0?(n.openBlock(),n.createElementBlock("p",CR,n.toDisplayString(c.value?n.unref(a).t("em.history.emptyLoaded"):n.unref(a).t("em.history.emptyNotLoaded")),1)):(n.openBlock(),n.createElementBlock("ul",IR,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(M.value,ne=>(n.openBlock(),n.createElementBlock("li",{key:ne.seq,class:n.normalizeClass(["em-history__group",[`is-${ne.kind??"edit"}`]])},[n.createElementVNode("div",{class:"em-history__ghead",onClick:ce=>re(ne.seq)},[n.createVNode(Re,{name:"chevron",size:13,class:n.normalizeClass(["em-history__chevron",{"is-open":B.value.has(ne.seq)}])},null,8,["class"]),n.createElementVNode("span",{class:n.normalizeClass(["em-history__kind",`is-${ne.kind??"edit"}`])},n.toDisplayString(n.unref(a).t(ne.kind==="restore"?"em.history.kindRestore":"em.history.kindEdit")),3),n.createElementVNode("span",$R,n.toDisplayString(J(ne)),1),n.createElementVNode("span",RR,"#"+n.toDisplayString(ne.seq),1)],8,SR),n.createElementVNode("div",AR,[n.createElementVNode("span",TR,n.toDisplayString(K(ne)),1),ne.ts?(n.openBlock(),n.createElementBlock("span",VR,n.toDisplayString(_(ne.ts)),1)):n.createCommentVNode("",!0),ne.kind==="restore"&&ne.restoredFromSeq!=null?(n.openBlock(),n.createElementBlock("span",MR,"← #"+n.toDisplayString(ne.restoredFromSeq),1)):n.createCommentVNode("",!0)]),B.value.has(ne.seq)?(n.openBlock(),n.createElementBlock("div",BR,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ne.actions,(ce,pe)=>(n.openBlock(),n.createElementBlock("div",{key:pe,class:"em-history__action"},[n.createElementVNode("div",DR,[n.createVNode(Re,{name:g[ce.subject.kind],size:12},null,8,["name"]),n.createElementVNode("span",OR,n.toDisplayString(k(ce.subject)),1),n.createElementVNode("span",{class:n.normalizeClass(["em-history__verb",`is-${ce.verb}`])},n.toDisplayString(n.unref(a).t(N[ce.verb])),3)]),ce.fields.length?(n.openBlock(),n.createElementBlock("ul",PR,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(ce.fields,(se,me)=>(n.openBlock(),n.createElementBlock("li",{key:me,class:"em-history__field"},[n.createElementVNode("span",LR,n.toDisplayString(se.field),1),se.oldValue!==void 0?(n.openBlock(),n.createElementBlock("span",zR,n.toDisplayString($(se.oldValue)),1)):n.createCommentVNode("",!0),se.oldValue!==void 0?(n.openBlock(),n.createBlock(Re,{key:1,name:"arrow-lr",size:10,class:"em-history__arrow"})):n.createCommentVNode("",!0),n.createElementVNode("span",UR,n.toDisplayString($(se.value)),1)]))),128))])):n.createCommentVNode("",!0)]))),128))])):n.createCommentVNode("",!0),n.unref(a).restoreAvailable.value&&ne.seq!==W.value?(n.openBlock(),n.createElementBlock("div",HR,[R.value===ne.seq?(n.openBlock(),n.createElementBlock(n.Fragment,{key:0},[n.createElementVNode("span",FR,n.toDisplayString(n.unref(a).t("em.history.confirmRestore")),1),n.createElementVNode("button",{type:"button",class:"em-history__confirm-yes",disabled:X.value,onClick:ce=>oe(ne.seq)},n.toDisplayString(n.unref(a).t("em.history.doRestore")),9,GR),n.createElementVNode("button",{type:"button",class:"em-history__confirm-no",disabled:X.value,onClick:G[3]||(G[3]=ce=>R.value=null)},n.toDisplayString(n.unref(a).t("em.history.cancel")),9,jR)],64)):(n.openBlock(),n.createElementBlock("button",{key:1,type:"button",class:"em-history__restore-btn",onClick:ce=>ee(ne.seq)},[n.createVNode(Re,{name:"undo",size:12}),n.createTextVNode(" "+n.toDisplayString(n.unref(a).t("em.history.restoreToHere")),1)],8,KR))])):n.createCommentVNode("",!0)],2))),128))]))])],512),[[n.vShow,e.open]])]),_:1}))}}),[["__scopeId","data-v-45d29598"]]);function WR(e,t){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>=t?i:null}function Hm(e){const t=n.ref(WR(e.storageKey,e.min)??e.initial),o=n.ref(!1);function i(a){a.preventDefault();const r=a.clientX,l=t.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)),t.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(t.value))};window.addEventListener("pointermove",s),window.addEventListener("pointerup",c)}return{width:t,dragging:o,startResize:i}}const qR={class:"em-modeler"},XR={class:"em-modeler__body"},JR={class:"em-drawer__inner"},ZR={class:"em-drawer__head"},QR={class:"em-drawer__actions"},eA=["title"],tA=["title"],nA=["title"],oA=["title"],iA=["title"],aA=Pe(n.defineComponent({__name:"EntityModeler",props:{controller:{}},setup(e){const t=n.ref(!0),o=n.ref(!0),i=n.ref(!1),{width:a,dragging:r,startResize:l}=Hm({initial:260,min:260,max:560,edge:"right",storageKey:"em.explorerWidth"}),{width:s,dragging:c,startResize:d}=Hm({initial:320,min:320,max:640,edge:"left",storageKey:"em.panelWidth"}),u=n.ref(null),m=n.ref(null);return(p,f)=>{var y,b,k;return n.openBlock(),n.createElementBlock("div",qR,[n.createVNode(zm,{controller:e.controller,"history-open":i.value,onExportSvg:f[0]||(f[0]=g=>{var N;return(N=u.value)==null?void 0:N.exportSvg()}),onExportPng:f[1]||(f[1]=g=>{var N;return(N=u.value)==null?void 0:N.exportPng()}),onToggleHistory:f[2]||(f[2]=g=>i.value=!i.value)},null,8,["controller","history-open"]),n.createElementVNode("div",XR,[n.createElementVNode("aside",{class:n.normalizeClass(["em-drawer",{"is-collapsed":!t.value}]),style:n.normalizeStyle({width:n.unref(a)+"px"})},[n.createElementVNode("div",JR,[n.createElementVNode("header",ZR,[f[10]||(f[10]=n.createElementVNode("span",null,"Diagram Explorer",-1)),n.createElementVNode("div",QR,[(y=m.value)!=null&&y.hasExpandable?(n.openBlock(),n.createElementBlock("button",{key:0,type:"button",class:"em-drawer__btn",title:e.controller.t((b=m.value)!=null&&b.allExpanded?"em.panel.collapseAll":"em.panel.expandAll"),onClick:f[3]||(f[3]=g=>{var N;return(N=m.value)==null?void 0:N.toggleAll()})},[n.createVNode(Re,{name:(k=m.value)!=null&&k.allExpanded?"collapse-all":"expand-all",size:16},null,8,["name"])],8,eA)):n.createCommentVNode("",!0),n.createElementVNode("button",{type:"button",class:"em-drawer__btn",title:e.controller.t("em.panel.collapse"),onClick:f[4]||(f[4]=g=>t.value=!1)},[n.createVNode(Re,{name:"panel-close",size:16})],8,tA)])]),n.createVNode(Lm,{ref_key:"explorer",ref:m,controller:e.controller},null,8,["controller"])]),n.withDirectives(n.createElementVNode("div",{class:n.normalizeClass(["em-resize-handle em-resize-handle--right",{"is-dragging":n.unref(r)}]),title:e.controller.t("em.panel.resizeWidth"),onPointerdown:f[5]||(f[5]=(...g)=>n.unref(l)&&n.unref(l)(...g))},null,42,nA),[[n.vShow,t.value]])],6),n.createVNode(n.Transition,{name:"em-reopen"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("button",{type:"button",class:"em-drawer__reopen",title:e.controller.t("em.panel.openNamed",{name:"Diagram Explorer"}),onClick:f[6]||(f[6]=g=>t.value=!0)},[n.createVNode(Re,{name:"panel-open",size:18})],8,oA),[[n.vShow,!t.value]])]),_:1}),n.createElementVNode("div",{class:n.normalizeClass(["em-modeler__canvas",{"is-drawer-open":t.value,"is-resizing":n.unref(r),"is-inspector-collapsed":!o.value}]),style:n.normalizeStyle({"--em-drawer-shift":n.unref(a)-6+"px"})},[n.createVNode(Pm,{ref_key:"canvas",ref:u,controller:e.controller},null,8,["controller"])],6),n.withDirectives(n.createVNode(Um,{controller:e.controller,width:n.unref(s),resizing:n.unref(c),"start-resize":n.unref(d),onCollapse:f[7]||(f[7]=g=>o.value=!1)},null,8,["controller","width","resizing","start-resize"]),[[n.vShow,o.value]]),n.createVNode(n.Transition,{name:"em-reopen"},{default:n.withCtx(()=>[n.withDirectives(n.createElementVNode("button",{type:"button",class:"em-panel__reopen",title:e.controller.t("em.panel.openNamed",{name:"Inspector"}),onClick:f[8]||(f[8]=g=>o.value=!0)},[n.createVNode(Re,{name:"panel-right-open",size:18})],8,iA),[[n.vShow,!o.value]])]),_:1}),n.createVNode(YR,{controller:e.controller,open:i.value,onClose:f[9]||(f[9]=g=>i.value=!1)},null,8,["controller","open"])]),n.createVNode(pR,{controller:e.controller,"panel-width":n.unref(s),"inspector-open":o.value},null,8,["controller","panel-width","inspector-open"])])}}}),[["__scopeId","data-v-cce29135"]]);be.APPLY_MODEL_OPS_INPUT_SCHEMA=Hp,be.AssociationEdge=zu,be.CUSTOM_TYPE_VALUE=wt,be.CommandStack=Ja,be.DEFAULT_JAVA_TYPE=za,be.DiagramCanvas=Pm,be.DiagramExplorer=Lm,be.EDITOR=En,be.EditModeToggle=wS,be.EditorToolbar=zm,be.EntityModeler=aA,be.EntityNode=vu,be.GROUP_CODE_ENUM_VALUE=Sn,be.GroupNode=xu,be.INHERITED_REF_PREFIX=ti,be.JAVA_TYPES=oi,be.NoteNode=Cu,be.OpSyncAdapter=Gs,be.PHYSICAL_NAME_MAX_LENGTH=lo,be.PropertyPanel=Um,be.RevCache=Fs,be.SELECTABLE_JAVA_TYPES=Vl,be.SYMBOLIC_OP_KINDS=js,be.SYMBOLIC_OP_SCHEMA=nc,be.UI_LOCALES=nk,be.anchoredEdgePoint=Va,be.buildAgentBatch=Fp,be.buildDiagramSvg=hl,be.buildOrthogonalPath=$a,be.buildSelfLoopPath=kl,be.buildStraightPath=Aa,be.collectSharedColumns=en,be.commands=cp,be.computeAutoLayout=El,be.createEditorController=lw,be.defaultMermaidDialect=Jm,be.displayLabel=ni,be.emptyState=ku,be.entityModelToMermaid=Da,be.entityModelToText=Cl,be.estimateEntityHeight=Nl,be.exportDiagramPng=Dm,be.exportDiagramSvg=Bm,be.fromPersisted=oh,be.indexColumnsByModelId=tn,be.isInheritedColumnRef=oo,be.javaTypeLabel=$n,be.makeInheritedColumnRef=vl,be.mergeDiagram=Wl,be.migrateLegacyMoney=Ff,be.newId=Me,be.orthogonalMidpoints=Ra,be.packEntityBoxes=Xm,be.parseInheritedColumnRef=Ba,be.physicalNameLengthOverflow=ai,be.projectActionLog=es,be.projectEntityAudit=Zl,be.projectFieldAudit=Gt,be.projectInheritedColumns=io,be.rectExitPoint=Ta,be.renderDiagramSvg=Al,be.resolveDiagram=bl,be.resolveSharedColumn=Rn,be.resolveSymbolicOps=Ap,be.restoreDeepEqual=Mn,be.scaffoldEntityJava=Ef,be.segmentMidpoints=Ma,be.sharedColumnScopeEntities=ii,be.sideDir=no,be.synthesizeRestoreOps=ep,be.toPersisted=gh,be.toPersistedV2=bh,be.translate=Rt,be.uiMessagesEn=fu,be.uiMessagesJa=pu,be.uiMessagesKo=hu,be.validateModel=Dl,Object.defineProperty(be,Symbol.toStringTag,{value:"Module"})}));
|